Commit 8d37c3b5 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Refactoring pipeline concept #6: Introducing automatic creating of pipeline...

Refactoring pipeline concept #6: Introducing automatic creating of pipeline registration file using CMake
parent 52a0444f
MACRO(ADD_PIPELINE_REGISTRATION IncludeFile ClassName)
LIST(APPEND PipelineRegistrationIncludeFiles ${IncludeFile})
LIST(APPEND PipelineRegistrationClassNames ${ClassName})
ENDMACRO(ADD_PIPELINE_REGISTRATION)
MACRO(WRITE_PIPELINE_REGISTRATION FileName)
MESSAGE(STATUS "* Generating pipeline registration header: ${FileName}")
SET(PipelineRegistrationSource "// WARNING: This file is automatically generated by CMake, do not modify!\n\n" )
LIST(APPEND PipelineRegistrationSource "// Include Pipeline Headers:\n" )
FOREACH(IncludeFile ${PipelineRegistrationIncludeFiles})
LIST(APPEND PipelineRegistrationSource "#include \"${IncludeFile}\"\n" )
ENDFOREACH()
LIST(APPEND PipelineRegistrationSource "\nnamespace campvis {\n" )
LIST(APPEND PipelineRegistrationSource "\t// Instantiate templated PipelineRegistrars to register the pipelines.\n" )
FOREACH(ClassName ${PipelineRegistrationClassNames})
LIST(APPEND PipelineRegistrationSource "\ttemplate class PipelineRegistrar<${ClassName}>\;\n" )
ENDFOREACH()
LIST(APPEND PipelineRegistrationSource "}\n\n" )
FILE(WRITE ${FileName} ${PipelineRegistrationSource})
ENDMACRO(WRITE_PIPELINE_REGISTRATION)
# copy and pasted from Voreen...
MACRO(LIST_SUBDIRECTORIES Result Directory AbsolutePath)
......
......@@ -3,8 +3,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
#INCLUDE(../cmake/commonconf.cmake)
MESSAGE(STATUS "Configuring Campvis Modules")
WRITE_PIPELINE_REGISTRATION("gen_pipelineregistration.h")
LIST(APPEND CampvisModulesHeaders
gen_pipelineregistration.h
pipelinefactory.h
)
LIST(APPEND CampvisModulesSources
......
......@@ -15,3 +15,6 @@ FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
)
SET(ThisModShaderDirectories "modules/advancedusvis/glsl")
ADD_PIPELINE_REGISTRATION("modules/advancedusvis/pipelines/advancedusvis.h" "AdvancedUsVis")
ADD_PIPELINE_REGISTRATION("modules/advancedusvis/pipelines/cmbatchgeneration.h" "CmBatchGeneration")
......@@ -18,3 +18,5 @@ FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
)
SET(ThisModShaderDirectories "modules/columbia/glsl")
ADD_PIPELINE_REGISTRATION("modules/columbia/pipelines/columbia1.h" "Columbia1")
#ifdef CAMPVIS_HAS_MODULE_ADVANCEDUSVIS
#include "modules/advancedusvis/pipelines/advancedusvis.h"
#include "modules/advancedusvis/pipelines/cmbatchgeneration.h"
/// Instantiate templated PipelineRegistrar to automatically register this pipeline.
template class campvis::PipelineRegistrar<campvis::AdvancedUsVis>;
template class campvis::PipelineRegistrar<campvis::CmBatchGeneration>;
#endif
#ifdef CAMPVIS_HAS_MODULE_VIS
#include "modules/vis/pipelines/ixpvdemo.h"
#include "modules/vis/pipelines/dvrvis.h"
#include "modules/vis/pipelines/volumerendererdemo.h"
#include "modules/vis/pipelines/volumeexplorerdemo.h"
#include "modules/vis/pipelines/slicevis.h"
template class campvis::PipelineRegistrar<campvis::DVRVis>;
template class campvis::PipelineRegistrar<campvis::IxpvDemo>;
template class campvis::PipelineRegistrar<campvis::SliceVis>;
template class campvis::PipelineRegistrar<campvis::VolumeExplorerDemo>;
template class campvis::PipelineRegistrar<campvis::VolumeRendererDemo>;
#endif
#ifdef HAS_KISSCL
#include "modules/opencl/pipelines/openclpipeline.h"
/// Instantiate templated PipelineRegistrar to automatically register this pipeline.
template class campvis::PipelineRegistrar<campvis::OpenCLPipeline>;
#endif
#ifdef CAMPVIS_HAS_MODULE_SCR_MSK
#include "modules/scr_msk/pipelines/uscompounding.h"
template class campvis::PipelineRegistrar<campvis::UsCompounding>;
#endif
#ifdef CAMPVIS_HAS_MODULE_COLUMBIA
#include "modules/columbia/pipelines/columbia1.h"
/// Instantiate templated PipelineRegistrar to automatically register this pipeline.
template class campvis::PipelineRegistrar<campvis::Columbia1>;
#endif
......@@ -18,4 +18,6 @@ FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
)
LIST(APPEND ThisModExternalLibs kisscl)
SET(ThisModShaderDirectories "modules/opencl/cl")
\ No newline at end of file
SET(ThisModShaderDirectories "modules/opencl/cl")
ADD_PIPELINE_REGISTRATION("modules/opencl/pipelines/openclpipeline.h" "OpenCLPipeline")
......@@ -39,4 +39,6 @@ FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
modules/scr_msk/processors/*.h
)
SET(ThisModShaderDirectories "modules/scr_msk/glsl")
\ No newline at end of file
SET(ThisModShaderDirectories "modules/scr_msk/glsl")
ADD_PIPELINE_REGISTRATION("modules/scr_msk/pipelines/uscompounding.h" "UsCompounding")
......@@ -15,3 +15,9 @@ FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
)
SET(ThisModShaderDirectories "modules/vis/glsl")
ADD_PIPELINE_REGISTRATION("modules/vis/pipelines/dvrvis.h" "DVRVis")
ADD_PIPELINE_REGISTRATION("modules/vis/pipelines/ixpvdemo.h" "IxpvDemo")
ADD_PIPELINE_REGISTRATION("modules/vis/pipelines/slicevis.h" "SliceVis")
ADD_PIPELINE_REGISTRATION("modules/vis/pipelines/volumeexplorerdemo.h" "VolumeExplorerDemo")
ADD_PIPELINE_REGISTRATION("modules/vis/pipelines/volumerendererdemo.h" "VolumeRendererDemo")
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