Commit cd63ad29 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[ADD] - added fiber creation module skel

parent 86f5f2c1
FILE( GLOB_RECURSE MODULES_SRC "*.cpp" "*.h" )
# Grab module name and setup target directories
GET_FILENAME_COMPONENT( MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME )
SET( MODULE_TARGET_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/modules/${MODULE_NAME} )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${MODULE_TARGET_DIR} )
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${MODULE_TARGET_DIR} )
SET( MODULE_DIRNAME ${MODULE_NAME} )
SET( MODULE_NAME "${OWmodulesPrefix}_${MODULE_NAME}" ) # prefix all module names with "OWmodule_" to separate them from other libs
SET( ${MODULE_NAME}_COMBINER_SRC ${MODULES_SRC} )
SET( ${MODULE_NAME}_ALL_CPP ${MODULES_SRC} )
FILE( GLOB_RECURSE ${MODULE_NAME}_REMOVE_H "*.h" )
LIST( REMOVE_ITEM ${MODULE_NAME}_ALL_CPP ${${MODULE_NAME}_REMOVE_H} )
IF( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/" )
FILE( GLOB_RECURSE ${MODULE_NAME}_REMOVE_TEST "test/*.cpp" "test/*.h" )
LIST( REMOVE_ITEM ${MODULE_NAME}_ALL_CPP ${${MODULE_NAME}_REMOVE_TEST} )
LIST( REMOVE_ITEM ${MODULE_NAME}_COMBINER_SRC ${${MODULE_NAME}_REMOVE_TEST} )
ENDIF( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/" )
LIST( LENGTH ${MODULE_NAME}_ALL_CPP cpp_count )
IF( ${cpp_count} GREATER 3 )
IF( OW_BUILD_AS_ONE_BIG_FILE )
SET( UNITY_BUILD_FILE_NAME "${MODULE_NAME}UnityBuildFile.cpp" )
GENERATE_UNITY_BUILD_FILE( ${MODULE_NAME}_ALL_CPP )
ADD_LIBRARY( ${MODULE_NAME} SHARED ${UNITY_BUILD_FILE_NAME} ${${MODULE_NAME}_COMBINER_SRC} )
ENDIF( OW_BUILD_AS_ONE_BIG_FILE )
ENDIF( ${cpp_count} GREATER 3 )
IF( ( NOT OW_BUILD_AS_ONE_BIG_FILE ) OR NOT ( ${cpp_count} GREATER 3 ) )
ADD_LIBRARY( ${MODULE_NAME} SHARED ${${MODULE_NAME}_COMBINER_SRC} )
ENDIF( ( NOT OW_BUILD_AS_ONE_BIG_FILE ) OR NOT ( ${cpp_count} GREATER 3 ) )
# Build module lib
#ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} ${OWKernelName} )
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( ${MODULE_NAME} PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
# Copy local shaders to module target directory
IF( OW_COPY_SHADERS AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/shaders ) # copy shaders only if the user wants it
ADD_CUSTOM_TARGET( ${MODULE_NAME}_CopyShaders
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/shaders ${MODULE_TARGET_DIR}/shaders/
COMMENT "Copy shaders of ${MODULE_NAME}"
)
ADD_DEPENDENCIES( ${MODULE_NAME} ${MODULE_NAME}_CopyShaders )
ENDIF()
# Build unit tests
IF( OW_COMPILE_TESTS )
# This ensures that the test is copied to the module directory
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${MODULE_TARGET_DIR} )
CXXTEST_ADD_TESTS_FROM_LIST( "${MODULES_SRC}"
"${OWKernelName};${MODULE_NAME}"
)
# Copy fixtures if they exist
IF( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test/fixtures )
ADD_CUSTOM_TARGET( ${MODULE_NAME}_CopyFixtures
# as the "test" target runs in CMakes temporary build dir, the fixtures need to be placed there too.
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/test/fixtures ${CMAKE_BINARY_DIR}/modules/${MODULE_DIRNAME}/fixtures/
COMMENT "Copy fixtures of ${MODULE_NAME}"
)
ADD_DEPENDENCIES( ${MODULE_NAME} ${MODULE_NAME}_CopyFixtures )
ENDIF( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test/fixtures )
ENDIF( OW_COMPILE_TESTS )
This diff is collapsed.
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WMFIBERCREATOR_H
#define WMFIBERCREATOR_H
#include <string>
#include "../../dataHandler/WDataSetFibers.h"
#include "../../kernel/WModule.h"
#include "../../kernel/WModuleOutputData.h"
/**
* This module creates fiber datasets using some scheme, like spirals. This is very useful tool for papers where artificial data is needed
* sometimes to create images showing some certain strength or weakness.
*
* \ingroup modules
*/
class WMFiberCreator: public WModule
{
public:
/**
* Default constructor.
*/
WMFiberCreator();
/**
* Destructor.
*/
virtual ~WMFiberCreator();
/**
* Gives back the name of this module.
* \return the module's name.
*/
virtual const std::string getName() const;
/**
* Gives back a description of this module.
* \return description to module.
*/
virtual const std::string getDescription() const;
/**
* Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
* should never be initialized or modified in some other way. A simple new instance is required.
*
* \return the prototype used to create every module in OpenWalnut.
*/
virtual boost::shared_ptr< WModule > factory() const;
/**
* Get the icon for this module in XPM format.
*/
virtual const char** getXPMIcon() const;
protected:
/**
* Entry point after loading the module. Runs in separate thread.
*/
virtual void moduleMain();
/**
* Initialize the connectors this module is using.
*/
virtual void connectors();
/**
* Initialize the properties for this module.
*/
virtual void properties();
private:
/**
* The output connector used to provide the calculated data to other modules.
*/
boost::shared_ptr< WModuleOutputData< WDataSetFibers > > m_fiberOutput;
/**
* A condition used to notify about changes in several properties.
*/
boost::shared_ptr< WCondition > m_propCondition;
};
#endif // WMFIBERCREATOR_H
/* XPM */
static const char * WMFiberCreator_xpm[] = {
"16 16 58 1",
" c None",
". c #8162D6",
"+ c #7568DD",
"@ c #6366D8",
"# c #8479E0",
"$ c #8699DF",
"% c #2227DB",
"& c #7C71D9",
"* c #6251D2",
"= c #6C69D7",
"- c #7673DD",
"; c #9089E1",
"> c #8B9ADF",
", c #22DB4E",
"' c #6597C1",
") c #698ECE",
"! c #6B71D1",
"~ c #828CBA",
"{ c #000000",
"] c #8795E4",
"^ c #8BA5C4",
"/ c #7CB0AF",
"( c #85BD95",
"_ c #6B96B4",
": c #6A8BBB",
"< c #6C9B9F",
"[ c #4A8984",
"} c #948EC5",
"| c #8BA7BA",
"1 c #6DC298",
"2 c #60C673",
"3 c #66CC6D",
"4 c #7CABBA",
"5 c #63AC9D",
"6 c #9FA3BF",
"7 c #6BBC8E",
"8 c #DB2222",
"9 c #62CC5F",
"0 c #6DC353",
"a c #71B792",
"b c #7DC669",
"c c #53BE78",
"d c #85AE81",
"e c #917CE0",
"f c #7BA364",
"g c #74BC56",
"h c #58C24C",
"i c #70C669",
"j c #83B282",
"k c #65A18E",
"l c #6FBD57",
"m c #69BD5E",
"n c #60B364",
"o c #53BF53",
"p c #6DC468",
"q c #6DAE8C",
"r c #6FAE9C",
"s c #81C869",
" ",
" ",
" ",
" .+@# ",
" $%&*=-;> ",
" ,'%)!~{]^/( ",
" _,:%<[{{}|123 ",
" 45,,%%{{678890 ",
" abc,d%{e888fgh ",
" ijk,,%{88lmnop ",
" %{qr ",
" s,,{ ",
" ",
" ",
" ",
" "};
......@@ -8,15 +8,16 @@ ADD_SUBDIRECTORY( clusterDisplayVoxels )
ADD_SUBDIRECTORY( clusterParamDisplay )
ADD_SUBDIRECTORY( clusterSlicer )
ADD_SUBDIRECTORY( contourTree )
ADD_SUBDIRECTORY( dataTypeConversion )
ADD_SUBDIRECTORY( datasetManipulator )
ADD_SUBDIRECTORY( datasetProfile )
ADD_SUBDIRECTORY( dataTypeConversion )
ADD_SUBDIRECTORY( deterministicFTMori )
ADD_SUBDIRECTORY( detTractClustering )
ADD_SUBDIRECTORY( detTractCulling )
ADD_SUBDIRECTORY( deterministicFTMori )
ADD_SUBDIRECTORY( directVolumeRendering )
ADD_SUBDIRECTORY( effectiveConnectivityCluster )
ADD_SUBDIRECTORY( eigenSystem )
ADD_SUBDIRECTORY( fiberCreator )
ADD_SUBDIRECTORY( fiberDisplaySimple )
ADD_SUBDIRECTORY( fiberParameterColoring )
ADD_SUBDIRECTORY( fiberResampling )
......
......@@ -163,6 +163,8 @@ void WMTemplate::connectors()
new WModuleInputData< WDataSetSingle >( shared_from_this(),
"in", "The dataset to display" )
);
// Alternative for lazy ones
// m_input = WModuleInputData< WDataSetSingle >::createAndAdd( shared_from_this(), "in", "The dataset to display" );
// This creates an input connector which can receive WDataSetSingle. It will never be able to connect to output connectors providing just a
// WDataSet (which is the father class of WDataSetSingle), but it will be able to be connected to an output connector with a type derived
......
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