Skip to content

Commit

Permalink
Merge branch 'release/v0.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bernstein committed May 28, 2014
2 parents c5ad846 + f5a275e commit f306dcf
Show file tree
Hide file tree
Showing 36 changed files with 4,620 additions and 51 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ editor/guacamole_editor
guarc/guarc
guacamole.sublime-workspace
include/gua/generated/*
include/gua/config.hpp
src/gua/generated/*
tags
.nfs*
Expand Down
34 changes: 31 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ PROJECT(GUACAMOLE CXX)

# version number
set(GUACAMOLE_MAJOR 0)
set(GUACAMOLE_MINOR 7)
set(GUACAMOLE_PATCH 2)
set(GUACAMOLE_MINOR 8)
set(GUACAMOLE_PATCH 0)
set(GUACAMOLE_VERSION ${GUACAMOLE_MAJOR}.${GUACAMOLE_MINOR}.${GUACAMOLE_PATCH})
set(GUACAMOLE_DESCRIPTION "GUACAMOLE - an astonishing virtual reality engine")
set(GUACAMOLE_HOMEPAGE "http://www.GUACAMOLE.org")
set(GUACAMOLE_EXENAME "GUACAMOLE")
set(GUACAMOLE_PACKAGENAME "GUACAMOLE")

option (GUACAMOLE_PBR_SUPPORT "Set to enable PBR (point based rendering) support.")

# We require at least version 2.8.0
cmake_minimum_required(VERSION 2.8.0)

Expand All @@ -24,6 +26,13 @@ endif(UNIX)
# Location where cmake first looks for modules.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)

###############################################################################
# write Config.h
###############################################################################

configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/gua/config.hpp.in
${CMAKE_CURRENT_SOURCE_DIR}/include/gua/config.hpp )

################################################################
# Configure and find libraries
################################################################
Expand All @@ -43,6 +52,7 @@ include(find_compiler)
include(FindSchism)
include(FindBoost)
include(FindZMQ)
include(find_protobuf)

if (UNIX)
set (BULLET_ROOT "/opt/bullet/default" CACHE PATH "Set to your bullet install path.")
Expand All @@ -53,6 +63,11 @@ endif (UNIX)
find_package(Bullet REQUIRED)
find_package(Json REQUIRED)

IF (GUACAMOLE_PBR_SUPPORT)
set(PBR_ROOT "/opt/pbr/gualod/trunk/pbr" CACHE PATH "Set to your PBR install path.")
find_package(PBR REQUIRED)
endif (GUACAMOLE_PBR_SUPPORT)

set(LIB_PATHS
${ASSIMP_LIBRARY_DIRS}
${JSON_LIBRARY_DIRS}
Expand All @@ -62,6 +77,7 @@ set(LIB_PATHS
${BULLET_LIBRARY_DIRS}
${SCHISM_LIBRARY_DIRS}
${ZMQ_LIBRARY_DIRS}
${PROTOBUF_LIBRARY_DIRS}
)

set(INCLUDE_PATHS
Expand All @@ -74,9 +90,15 @@ set(INCLUDE_PATHS
${GL_INCLUDE_DIRS}
${GLEW_INCLUDE_DIRS}
${BULLET_INCLUDE_DIRS}
${ZMQ_INCLUDE_DIRS}
${ZMQ_INCLUDE_DIRS}
${PROTOBUF_INCLUDE_DIRS}
)

IF (GUACAMOLE_PBR_SUPPORT)
LIST(APPEND LIB_PATHS ${PBR_LIBRARY_DIRS})
LIST(APPEND INCLUDE_PATHS ${PBR_INCLUDE_DIRS})
ENDIF (GUACAMOLE_PBR_SUPPORT)

if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
Expand Down Expand Up @@ -214,4 +236,10 @@ message(STATUS " bullet:" )
message(STATUS " library: ${BULLET_LIBRARIES}" )
message(STATUS " library path: ${BULLET_LIBRARY_DIRS}" )
message(STATUS " include: ${BULLET_INCLUDE_DIRS}" )
IF (GUACAMOLE_PBR_SUPPORT)
message(STATUS " PBR:" )
message(STATUS " library: ${PBR_LIBRARIES}" )
message(STATUS " library path: ${PBR_LIBRARY_DIRS}" )
message(STATUS " include: ${PBR_INCLUDE_DIRS}" )
ENDIF (GUACAMOLE_PBR_SUPPORT)
message(STATUS "" )
83 changes: 83 additions & 0 deletions cmake/modules/FindPBR.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# - Try to find the point based renderer (PBR)
#
# This module defines the following variables
#
# PBR_FOUND - Was PBR found
# PBR_INCLUDE_DIRS - the PBR include directories
# PBR_LIBRARIES - Link to this, by default it includes rendering lib
#
# This module accepts the following variables
#
# PBR_ROOT - Can be set to PBR install path
#

#=============================================================================
# Copyright 2009 Kitware, Inc.
# Copyright 2009 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)

macro(_PBR_APPEND_LIBRARIES _list _release)
set(_debug ${_release}_DEBUG)
if(${_debug})
set(${_list} ${${_list}} optimized ${${_release}} debug ${${_debug}})
else()
set(${_list} ${${_list}} ${${_release}})
endif()
endmacro()

# Find includes

find_path(PBR_COMMON_INCLUDE_DIR
NAMES pbr/utils.h
HINTS
${PBR_ROOT}/common/include
${PBR_ROOT}/common/src
)

find_path(PBR_RENDERING_INCLUDE_DIR
NAMES pbr/ren/renderer.h
HINTS
${PBR_ROOT}/rendering/include
${PBR_ROOT}/rendering/src
)

# Find the libraries

find_library(PBR_COMMON_LIBRARY
NAMES pbr_common
HINTS
${PBR_ROOT}/build/common
${PBR_ROOT}/build_codeblocks_rel/common
${PBR_ROOT}/build_codeblocks/common
)

find_library(PBR_RENDERING_LIBRARY
NAMES pbr_rendering
HINTS
${PBR_ROOT}/build/rendering
${PBR_ROOT}/build_codeblocks_rel/rendering
${PBR_ROOT}/build_codeblocks/rendering
)

# handle the QUIETLY and REQUIRED arguments and set PBR_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PBR DEFAULT_MSG
PBR_COMMON_LIBRARY PBR_RENDERING_LIBRARY
PBR_COMMON_INCLUDE_DIR PBR_RENDERING_INCLUDE_DIR)

if(PBR_FOUND)
set(PBR_INCLUDE_DIRS ${PBR_COMMON_INCLUDE_DIR} ${PBR_RENDERING_INCLUDE_DIR})
_PBR_APPEND_LIBRARIES(PBR_LIBRARIES PBR_COMMON_LIBRARY)
_PBR_APPEND_LIBRARIES(PBR_LIBRARIES PBR_RENDERING_LIBRARY)
endif()

68 changes: 68 additions & 0 deletions cmake/modules/find_protobuf.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
SET(PROTOBUF_INCLUDE_SEARCH_DIRS
/opt/protobuf/current/src
)

SET(PROTOBUF_LIBRARY_SEARCH_DIRS
/opt/protobuf/current/src/.libs
)

message("-- checking for protobuf")

IF (NOT PROTOBUF_INCLUDE_DIRS)

SET(_PROTOBUF_FOUND_INC_DIRS "")

FOREACH(_SEARCH_DIR ${PROTOBUF_INCLUDE_SEARCH_DIRS})
FIND_PATH(_CUR_SEARCH
NAMES google/protobuf/stubs/common.h
PATHS ${_SEARCH_DIR}
NO_DEFAULT_PATH)
IF (_CUR_SEARCH)
LIST(APPEND _PROTOBUF_FOUND_INC_DIRS ${_CUR_SEARCH})
ENDIF(_CUR_SEARCH)
SET(_CUR_SEARCH _CUR_SEARCH-NOTFOUND CACHE INTERNAL "internal use")
ENDFOREACH(_SEARCH_DIR ${PROTOBUF_INCLUDE_SEARCH_DIRS})

IF (NOT _PROTOBUF_FOUND_INC_DIRS)
MESSAGE(FATAL_ERROR "find_protobuf.cmake: unable to find protobuf headers")
ENDIF (NOT _PROTOBUF_FOUND_INC_DIRS)

FOREACH(_INC_DIR ${_PROTOBUF_FOUND_INC_DIRS})
LIST(APPEND PROTOBUF_INCLUDE_DIRS ${_INC_DIR})
ENDFOREACH(_INC_DIR ${_BOOST_FOUND_INC_DIRS})

ENDIF(NOT PROTOBUF_INCLUDE_DIRS)

IF ( PROTOBUF_INCLUDE_DIRS
AND NOT PROTOBUF_LIBRARIES)

SET(_PROTOBUF_FOUND_LIB_DIR "")
SET(_PROTOBUF_POSTFIX "")

FOREACH(_SEARCH_DIR ${PROTOBUF_LIBRARY_SEARCH_DIRS})
FIND_PATH(_CUR_SEARCH
NAMES libprotobuf.so
PATHS ${_SEARCH_DIR}
NO_DEFAULT_PATH)
IF (_CUR_SEARCH)
LIST(APPEND _PROTOBUF_FOUND_LIB_DIR ${_SEARCH_DIR})
ENDIF(_CUR_SEARCH)
SET(_CUR_SEARCH _CUR_SEARCH-NOTFOUND CACHE INTERNAL "internal use")
ENDFOREACH(_SEARCH_DIR ${PROTOBUF_LIBRARY_SEARCH_DIRS})

IF (NOT _PROTOBUF_FOUND_LIB_DIR)
MESSAGE(FATAL_ERROR "find_protobuf.cmake: unable to find protobuf library")
ELSE (NOT _PROTOBUF_FOUND_LIB_DIR)
message("-- found matching version")
ENDIF (NOT _PROTOBUF_FOUND_LIB_DIR)

FOREACH(_LIB_DIR ${_PROTOBUF_FOUND_LIB_DIR})
LIST(APPEND PROTOBUF_LIBRARIES ${_LIB_DIR}/libprotobuf.so)
ENDFOREACH(_LIB_DIR ${_PROTOBUF_FOUND_INC_DIRS})


ENDIF( PROTOBUF_INCLUDE_DIRS
AND NOT PROTOBUF_LIBRARIES)



27 changes: 27 additions & 0 deletions include/gua/config.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/******************************************************************************
* guacamole - delicious VR *
* *
* Copyright: (c) 2011-2013 Bauhaus-Universität Weimar *
* Contact: felix.lauer@uni-weimar.de / simon.schneegans@uni-weimar.de *
* *
* This program is free software: you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the Free *
* Software Foundation, either version 3 of the License, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
* for more details. *
* *
* You should have received a copy of the GNU General Public License along *
* with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
******************************************************************************/

#ifndef GUA_CONFIG_HPP
#define GUA_CONFIG_HPP

#cmakedefine GUACAMOLE_PBR_SUPPORT

#endif // GUA_CONFIG_HPP
76 changes: 76 additions & 0 deletions include/gua/renderer/PBRLoader.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/******************************************************************************
* guacamole - delicious VR *
* *
* Copyright: (c) 2011-2013 Bauhaus-Universität Weimar *
* Contact: felix.lauer@uni-weimar.de / simon.schneegans@uni-weimar.de *
* *
* This program is free software: you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the Free *
* Software Foundation, either version 3 of the License, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
* for more details. *
* *
* You should have received a copy of the GNU General Public License along *
* with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
******************************************************************************/

#ifndef GUA_PBR_LOADER_HPP
#define GUA_PBR_LOADER_HPP

// guacamole headers
#include <gua/platform.hpp>
#include <gua/renderer/GeometryLoader.hpp>
#include <gua/databases/Database.hpp>

// external headers
#include <string>
#include <list>
#include <memory>

namespace gua{

class Node;
class InnerNode;
class GeometryNode;

class PBRLoader : public GeometryLoader {
public:

/**
* Default constructor.
*
* Constructs a new and empty PBRLoader.
*/
PBRLoader();

/**
* Constructor from a file.
*
* Creates a new PBRLoader from a given file.
*
* \param file_name The file to load the pointclouds data from.
* \param material_name The material name that was set to the parent node
*/
std::shared_ptr<Node> create_geometry_from_file(std::string const& nodename,
std::string const& xyzfile);



bool is_supported(std::string const& file_name) const;

private:
unsigned node_counter_;
static unsigned model_counter_;
boost::unordered_set<std::string> _supported_file_extensions;

};


}

#endif // GUA_PBR_LOADER_HPP
Loading

0 comments on commit f306dcf

Please sign in to comment.