Commit 784b6f41 authored by schultezub's avatar schultezub

Major update in project structure:

The modules package is now itsself modular. Every subdirectory in modules/ builds its own submodule that can be individually switched on and off. Therefore each submodule needs its own submodule.cmake file to specify the build targets etc.
This is neat!

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@340 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent dcc0c5db
......@@ -31,6 +31,8 @@ ENDIF()
include(cmake/commonconf.cmake)
MESSAGE(STATUS "--------------------------------------------------------------------------------")
IF(CAMPVIS_BUILD_LIB_TGT)
ADD_SUBDIRECTORY(ext/tgt)
ENDIF()
......
......@@ -28,8 +28,8 @@
// ================================================================================================
#include "application/campvisapplication.h"
#include "modules/pipelines/dvrvis.h"
#include "modules/pipelines/slicevis.h"
#include "modules/vis/pipelines/dvrvis.h"
#include "modules/vis/pipelines/slicevis.h"
using namespace campvis;
......
......@@ -185,5 +185,59 @@ ELSE(OPENCL_FOUND)
MESSAGE(FATAL_ERROR "OpenCL not found!")
ENDIF(OPENCL_FOUND)
# detect modules
MESSAGE(STATUS "--------------------------------------------------------------------------------")
MESSAGE(STATUS "Detecting installed modules:")
# collect list of directories in modules directories
SET(ModulesDir ${CAMPVIS_HOME}/modules)
LIST_SUBDIRECTORIES(ModDirs ${ModulesDir} false)
# remove CMake realted directories
LIST(REMOVE_ITEM ModDirs CMakeFiles)
LIST(REMOVE_ITEM ModDirs campvis-modules.dir)
# go through each subdirectory
FOREACH(ModDir ${ModDirs})
# check whether module.cmake file exists
SET(ModFile ${ModulesDir}/${ModDir}/${ModDir}.cmake)
IF(EXISTS ${ModFile})
MESSAGE(STATUS "* Found Module ${ModDir}")
STRING(TOLOWER ${ModDir} ModDirLower)
STRING(TOUPPER ${ModDir} ModDirUpper)
# check whether the option to build this very module exists and is checked
IF(CAMPVIS_BUILD_MODULE_${ModDirUpper})
SET(ThisModDir ${ModulesDir}/${ModDir})
# load .cmake file
INCLUDE(${ModFile})
# merge module settings into global settings
LIST(APPEND CAMPVisModulesDefinitions ${ThisModDefinitions})
LIST(APPEND CAMPVisModulesIncludeDirs ${ThisModIncludeDirs})
LIST(APPEND CAMPVisModulesExternalLibs ${ThisModExternalLibs})
LIST(APPEND CAMPVisModulesSources ${ThisModSources})
LIST(APPEND CAMPVisModulesHeaders ${ThisModHeaders})
# unset module settings to avoid duplicates if module cmake file misses sth.
UNSET(ThisModDefinitions)
UNSET(ThisModIncludeDirs)
UNSET(ThisModExternalLibs)
UNSET(ThisModSources)
UNSET(ThisModHeaders)
ELSEIF(NOT DEFINED CAMPVIS_BUILD_MODULE_${ModDirUpper})
# add a CMake option for building this module
OPTION(CAMPVIS_BUILD_MODULE_${ModDirUpper} "Build Module ${ModDir}" OFF)
ENDIF(CAMPVIS_BUILD_MODULE_${ModDirUpper})
ELSE(EXISTS ${ModFile})
MESSAGE(STATUS "* WARNING: Found Directory ${ModDir} Without CMake file - ignored")
ENDIF(EXISTS ${ModFile})
ENDFOREACH(ModDir ${ModDirs})
SET(COMMONCONF_PROCESSED TRUE)
ENDIF(NOT COMMONCONF_PROCESSED)
PROJECT(campvis-modules)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
INCLUDE(../cmake/commonconf.cmake)
#INCLUDE(../cmake/commonconf.cmake)
MESSAGE(STATUS "Configuring CAMPVis Modules")
FILE(GLOB CAMPVIS_MODULES_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
classification/*.cpp
io/*.cpp
pipelines/*.cpp
preprocessing/*.cpp
vis/*.cpp
)
FILE(GLOB CAMPVIS_MODULES_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
classification/*.h
io/*.h
pipelines/*.h
preprocessing/*.h
vis/*.h
vis/*.frag
vis/*.cl
ADD_LIBRARY(campvis-modules
${CAMPVisModulesSources} ${CAMPVisModulesHeaders}
)
#SET(CAMPVIS_MODULES_SOURCES
# application/campvis.cpp
# application/campvispainter.cpp
# datastructures/
#)
# TODO: Remove Qt dependency as soon as the pipelines got cleaned up (and thus removed their hard link to tgt/qt/qtcontextmanager.h
#SET(CAMPVIS_MODULES_HEADERS
# application/campvispainter.h
#)
#
# Qt related stuff:
#
FIND_PACKAGE(Qt4 ${CAMPVIS_REQUIRED_QT_VERSION} REQUIRED QtCore QtGui QtOpenGL)
#QT4_WRAP_CPP(CAMPVIS_MODULES_MOC ${CAMPVIS_MODULES_HEADERS})
INCLUDE(${QT_USE_FILE})
ADD_LIBRARY(campvis-modules
${CAMPVIS_MODULES_SOURCES} ${CAMPVIS_MODULES_HEADERS}
# ${CAMPVIS_MODULES_MOC}
)
ADD_DEFINITIONS(${CAMPVIS_DEFINITIONS} ${QT_DEFINITIONS})
INCLUDE_DIRECTORIES(${CAMPVIS_INCLUDE_DIRECTORIES})
TARGET_LINK_LIBRARIES(campvis-modules campvis-core tgt kisscl ${CAMPVIS_EXTERNAL_LIBRARIES} ${QT_LIBRARIES})
ADD_DEFINITIONS(${CAMPVIS_DEFINITIONS} ${CAMPVisModulesDefinitions} ${QT_DEFINITIONS})
INCLUDE_DIRECTORIES(${CAMPVIS_INCLUDE_DIRECTORIES} ${CAMPVisModulesIncludeDirs})
TARGET_LINK_LIBRARIES(campvis-modules campvis-core tgt ${CAMPVisModulesExternalLibs} ${QT_LIBRARIES})
# CMake file for IO module
# Source files:
FILE(GLOB ThisModSources RELATIVE ${ModulesDir}
modules/io/processors/*.cpp
)
# Header files
FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
modules/io/processors/*.h
)
# CMake file for OpenCL module
# Source files:
FILE(GLOB ThisModSources RELATIVE ${ModulesDir}
modules/opencl/processors/*.cpp
)
# Header files (including CL files so that they'll appear in VS projects)
FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
modules/opencl/glsl/*.cl
modules/opencl/processors/*.h
)
LIST(APPEND ThisModExternalLibs kisscl)
\ No newline at end of file
......@@ -93,7 +93,7 @@ namespace campvis {
_clContext = CLRtm.createGlSharingContext();
if (_clContext != 0) {
_clProgram = CLRtm.loadProgram(_clContext, "modules/vis/clraycaster.cl");
_clProgram = CLRtm.loadProgram(_clContext, "modules/vis/cl/clraycaster.cl");
_clProgram->setBuildOptions(" -cl-fast-relaxed-math -cl-mad-enable");
_clProgram->build();
}
......
# CMake file for Preprocessing module
# Source files:
FILE(GLOB ThisModSources RELATIVE ${ModulesDir}
modules/preprocessing/processors/*.cpp
)
# Header files
FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
modules/preprocessing/processors/*.h
)
......@@ -34,15 +34,15 @@
#include "core/eventhandlers/trackballnavigationeventhandler.h"
#include "core/pipeline/visualizationpipeline.h"
#include "core/properties/cameraproperty.h"
#include "modules/io/mhdimagereader.h"
#include "modules/vis/virtualmirrorgeometrygenerator.h"
#include "modules/vis/proxygeometrygenerator.h"
#include "modules/vis/geometryrenderer.h"
#include "modules/vis/eepgenerator.h"
#include "modules/vis/drrraycaster.h"
#include "modules/vis/simpleraycaster.h"
#include "modules/vis/depthdarkening.h"
#include "modules/vis/virtualmirrorcombine.h"
#include "modules/io/processors/mhdimagereader.h"
#include "modules/vis/processors/virtualmirrorgeometrygenerator.h"
#include "modules/vis/processors/proxygeometrygenerator.h"
#include "modules/vis/processors/geometryrenderer.h"
#include "modules/vis/processors/eepgenerator.h"
#include "modules/vis/processors/drrraycaster.h"
#include "modules/vis/processors/simpleraycaster.h"
#include "modules/vis/processors/depthdarkening.h"
#include "modules/vis/processors/virtualmirrorcombine.h"
namespace campvis {
class DVRVis : public VisualizationPipeline {
......
......@@ -33,10 +33,10 @@
#include "core/datastructures/imagedatalocal.h"
#include "core/eventhandlers/mwheeltonumericpropertyeventhandler.h"
#include "core/pipeline/visualizationpipeline.h"
#include "modules/io/mhdimagereader.h"
#include "modules/vis/sliceextractor.h"
#include "modules/preprocessing/gradientvolumegenerator.h"
#include "modules/classification/lhhistogram.h"
#include "modules/io/processors/mhdimagereader.h"
#include "modules/vis/processors/sliceextractor.h"
#include "modules/preprocessing/processors/gradientvolumegenerator.h"
#include "modules/preprocessing/processors/lhhistogram.h"
namespace campvis {
class SliceVis : public VisualizationPipeline {
......
......@@ -70,7 +70,7 @@ namespace campvis {
void DepthDarkening::init() {
VisualizationProcessor::init();
_shader = ShdrMgr.loadSeparate("core/glsl/passthrough.vert", "modules/vis/depthdarkening.frag", generateHeader(), false);
_shader = ShdrMgr.loadSeparate("core/glsl/passthrough.vert", "modules/vis/glsl/depthdarkening.frag", generateHeader(), false);
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
}
......
......@@ -36,7 +36,7 @@ namespace campvis {
const std::string DRRRaycaster::loggerCat_ = "CAMPVis.modules.vis.DRRRaycaster";
DRRRaycaster::DRRRaycaster(GenericProperty<tgt::ivec2>& canvasSize)
: RaycastingProcessor(canvasSize, "modules/vis/drrraycaster.frag", false)
: RaycastingProcessor(canvasSize, "modules/vis/glsl/drrraycaster.frag", false)
, _targetImageID("targetImageID", "Output Image", "", DataNameProperty::WRITE)
, _shift("shift", "Normalization Shift", 0.f, -10.f, 10.f)
, _scale("scale", "Normalization Scale", 1.f, 0.f, 1000.f)
......
......@@ -72,7 +72,7 @@ namespace campvis {
void EEPGenerator::init() {
VisualizationProcessor::init();
_shader = ShdrMgr.loadSeparate("core/glsl/passthrough.vert", "modules/vis/eepgenerator.frag", generateHeader(), false);
_shader = ShdrMgr.loadSeparate("core/glsl/passthrough.vert", "modules/vis/glsl/eepgenerator.frag", generateHeader(), false);
if (_shader != 0) {
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
......
......@@ -61,7 +61,7 @@ namespace campvis {
void GeometryRenderer::init() {
VisualizationProcessor::init();
_shader = ShdrMgr.loadSeparate("core/glsl/passthrough.vert", "modules/vis/geometryrenderer.frag", "", false);
_shader = ShdrMgr.loadSeparate("core/glsl/passthrough.vert", "modules/vis/glsl/geometryrenderer.frag", "", false);
if (_shader != 0) {
_shader->setAttributeLocation(0, "in_Position");
}
......
......@@ -37,7 +37,7 @@ namespace campvis {
const std::string SimpleRaycaster::loggerCat_ = "CAMPVis.modules.vis.SimpleRaycaster";
SimpleRaycaster::SimpleRaycaster(GenericProperty<tgt::ivec2>& canvasSize)
: RaycastingProcessor(canvasSize, "modules/vis/simpleraycaster.frag", true)
: RaycastingProcessor(canvasSize, "modules/vis/glsl/simpleraycaster.frag", true)
, _targetImageID("targetImageID", "Output Image", "", DataNameProperty::WRITE)
, _enableShadowing("EnableShadowing", "Enable Hard Shadows", false, InvalidationLevel::INVALID_SHADER)
, _shadowIntensity("ShadowIntensity", "Shadow Intensity", .5f, .0f, 1.f)
......
......@@ -64,7 +64,7 @@ namespace campvis {
void SliceExtractor::init() {
VisualizationProcessor::init();
_shader = ShdrMgr.loadSeparate("core/glsl/passthrough.vert", "modules/vis/sliceextractor.frag", "", false);
_shader = ShdrMgr.loadSeparate("core/glsl/passthrough.vert", "modules/vis/glsl/sliceextractor.frag", "", false);
}
void SliceExtractor::deinit() {
......
......@@ -68,7 +68,7 @@ namespace campvis {
void VirtualMirrorCombine::init() {
VisualizationProcessor::init();
_shader = ShdrMgr.loadSeparate("core/glsl/passthrough.vert", "modules/vis/virtualmirrorcombine.frag", "", false);
_shader = ShdrMgr.loadSeparate("core/glsl/passthrough.vert", "modules/vis/glsl/virtualmirrorcombine.frag", "", false);
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment