-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
4,620 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.