Commit 2081ad51 by schurade

[MERGE] with af067365b90d687a0fc85d93bc734d35edeee81d

parents 29efacae 407d5387
......@@ -12,7 +12,7 @@ allowOnlyOneFiberDataSet = yes # This will prevent you from accidently loading m
# default=HUD
## A list of modules that will be provided through the GUI.
## If the list is empty all available modules are provided.
whiteList = Arbitrary Plane,Coordinate System,Image Extractor,Paint Texture,Arbitrary Rois,Bounding Box,Distance Map Isosurface,Gauss Filtering,HUD,Isosurface,Isosurface Raytracer,LIC,Mesh Reader,Voxelizer,Superquadric Glyphs,Triangle Mesh Renderer,Vector Plot,Write NIfTI
whiteList = Arbitrary Plane,Coordinate System,Image Extractor,Paint Texture,Arbitrary Rois,Bounding Box,Distance Map Isosurface,Gauss Filtering,HUD,Isosurface,Isosurface Raytracer,LIC,Read Mesh,Voxelizer,Superquadric Glyphs,Triangle Mesh Renderer,Vector Plot,Write NIfTI
## Specify a ";" separated list of additional paths for modules. The order of appearance is the order of loading. The following additional rules apply here:
## 1. if the directory contains one or more libOWmodule_XYZ it/they get loaded
......
......@@ -152,6 +152,8 @@ IF( CMAKE_GENERATOR MATCHES "Visual Studio" )
SET( CMAKE_SHARED_LINKER_FLAGS " /STACK:10000000 /machine:I386 /NODEFAULTLIB:${EXCLUDE_LIBRARIES}" CACHE STRING "" FORCE )
SET( CMAKE_EXE_LINKER_FLAGS " /STACK:10000000 /machine:I386 /NODEFAULTLIB:${EXCLUDE_LIBRARIES}" CACHE STRING "" FORCE )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"NOMINMAX\"" )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP" )
SET( CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows" )
ELSE()
# Unfortunately libstdc++'s header files don't work with mingw in ansi mode (basically libstdc++'s fault)
IF( CMAKE_HOST_SYSTEM MATCHES "Windows" )
......@@ -208,6 +210,11 @@ ENDIF()
ADD_EXECUTABLE( walnut OpenWalnut.cpp version.h )
TARGET_LINK_LIBRARIES( walnut OWkernel OWdataHandler OWgui OWguiqt4 OWcommon OWge ${Boost_LIBRARIES} )
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( walnut PROPERTIES DEBUG_POSTFIX "d")
SET_TARGET_PROPERTIES( walnut PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
#---------- Shaders -------------
option( OW_COPY_SHADERS "This enables copying shaders with every make call." ON )
if( OW_COPY_SHADERS )
......
......@@ -10,6 +10,10 @@ ADD_SUBDIRECTORY( math )
ADD_LIBRARY( OWcommon SHARED ${COMMON_SRC} ${COMMON_DATASTRUCTURES_SRC} ${COMMON_EXCEPTIONS_SRC} ${MATH_SRC} ${FIBERSIMILARITY_SRC} )
TARGET_LINK_LIBRARIES( OWcommon ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} )
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( OWcommon PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
# Set the prefix and suffix of dynamically loadable modules to match
# CMAKEs naming of them. The quotes are necessary so the shell doesn't mess
# with these defines. Unfortunately, the Visual Studio has problems handling
......
......@@ -24,6 +24,7 @@
#include <string>
#include <vector>
#include <cstdlib>
#include <boost/tokenizer.hpp>
......@@ -70,7 +71,22 @@ boost::filesystem::path WPathHelper::getAppPath()
boost::filesystem::path WPathHelper::getConfigFile()
{
// TODO(ebaum): we should prefer a user config file in ~.walnut.cfg in future. This needs to be platform independent of course.
return getPathHelper()->m_sharePath / "walnut.cfg";
namespace fs = boost::filesystem;
// I know that this work only for linux, but it should not break anything elsewhere.
// Thus, we prefer the file in the home directory now.
std::string homeDir = getenv( "HOME" ) ? getenv( "HOME" ) : "";
std::string linuxDefault= homeDir + "/.walnut.cfg";
boost::filesystem::path configFile;
if( fs::exists( linuxDefault ) )
{
configFile = boost::filesystem::path( linuxDefault );
}
else
{
configFile = getPathHelper()->m_sharePath / "walnut.cfg";
}
return configFile;
}
boost::filesystem::path WPathHelper::getFontPath()
......
......@@ -40,11 +40,6 @@ class OWCOMMON_EXPORT WPathHelper // NOLINT
public:
/**
* Default constructor.
*/
WPathHelper();
/**
* Destructor.
*/
virtual ~WPathHelper();
......@@ -157,6 +152,11 @@ public:
protected:
/**
* Constructors are protected because this is a Singleton.
*/
WPathHelper();
private:
/**
......
......@@ -24,6 +24,11 @@ FILE( GLOB DATAHANDLER_IO_SRC "io/*.cpp" "io/*.h" ) # former WLoader
TARGET_LINK_LIBRARIES( OWdataHandler OWcommon ${Boost_LIBRARIES} OWext_niftiio OWext_biosig OWext_eep ${OPENSCENEGRAPH_LIBRARIES} )
ENDIF()
#ENDIF()
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( OWdataHandler PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
# Unit tests
IF( OW_COMPILE_TESTS )
# in case of not installed ITK the unit test won't compile, so we remove it
......
......@@ -16,3 +16,7 @@ IF( CMAKE_GENERATOR MATCHES "Visual Studio" )
ELSE()
TARGET_LINK_LIBRARIES( OWext_eep m )
ENDIF()
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( OWext_eep PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
......@@ -42,6 +42,9 @@ SET(NIFTI_NIFTILIB_NAME ${PACKAGE_PREFIX}niftiio)
ADD_LIBRARY(${NIFTI_NIFTILIB_NAME} ${NIFTILIB_SRC} )
TARGET_LINK_LIBRARIES( ${NIFTI_NIFTILIB_NAME} ${PACKAGE_PREFIX}znz)
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( ${NIFTI_NIFTILIB_NAME} PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
IF(UNIX)
TARGET_LINK_LIBRARIES(${NIFTI_NIFTILIB_NAME} -lm)
......
......@@ -10,6 +10,10 @@ FILE( GLOB GE_SRC "*.cpp" "*.h" )
ADD_LIBRARY( OWge SHARED ${GE_SRC} ${GE_EXCEPTIONS_SRC} ${GE_CALLBACKS_SRC} ${GE_ALGORITHMS_SRC} )
TARGET_LINK_LIBRARIES( OWge OWcommon ${OPENGL_gl_LIBRARY} ${OPENSCENEGRAPH_LIBRARIES} )
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( OWge PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
# Unit tests
IF( OW_COMPILE_TESTS )
CXXTEST_ADD_TESTS_FROM_LIST( "${GE_SRC}" "OWge;OWkernel"
......
......@@ -89,12 +89,6 @@ namespace wge
osg::Vec3 WGE_EXPORT unprojectFromScreen( const osg::Vec3 screen, osg::ref_ptr< osg::Camera > camera );
/**
* Conversion of WVector3D to osg::Vec3
* \param v the vector to convert.
*/
osg::Vec3 wv3D2ov3( wmath::WVector3D v );
/**
* creates the same color as the atlas colormap shader from the index
*
* \param index unsigned char that indexes the color
......@@ -180,11 +174,6 @@ inline osg::Vec3 wge::osgVec3( const wmath::WPosition& pos )
return osg::Vec3( pos[0], pos[1], pos[2] );
}
inline osg::Vec3 wge::wv3D2ov3( wmath::WVector3D v )
{
return osg::Vec3( v[0], v[1], v[2] );
}
inline osg::Matrixd wge::toOSGMatrix( const wmath::WMatrix<double>& matrix )
{
WAssert( ( matrix.getNbRows() == 3 || matrix.getNbRows() == 4 ) && ( matrix.getNbCols() == 3 || matrix.getNbCols() == 4 ),
......
......@@ -63,11 +63,6 @@ class WGE_EXPORT WGraphicsEngine: public WThreadedRunner
public:
/**
* Default constructor.
*/
explicit WGraphicsEngine();
/**
* Destructor.
*/
virtual ~WGraphicsEngine();
......@@ -143,6 +138,11 @@ public:
protected:
/**
* Constructors are protected because this is a Singleton.
*/
explicit WGraphicsEngine();
/**
* Handler for repainting and event handling. Gets executed in separate thread.
*/
virtual void threadMain();
......
......@@ -5,6 +5,10 @@ FILE( GLOB GUI_SRC "*.cpp" "*.h" )
ADD_LIBRARY( OWgui ${GUI_SRC} )
TARGET_LINK_LIBRARIES( OWgui OWcommon )
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( OWgui PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
# Unit tests
IF( OW_COMPILE_TESTS )
CXXTEST_ADD_TESTS_FROM_LIST( "${GUI_SRC}"
......
......@@ -41,3 +41,7 @@ FILE(GLOB GUI_QT4_SRC "*.cpp" "guiElements/*.cpp" "controlPanel/*.cpp" "ribbonMe
ADD_LIBRARY( OWguiqt4 ${GUI_QT4_SRC} ${GUI_QT4_MOC_SRCS} )
TARGET_LINK_LIBRARIES( OWguiqt4 OWcommon OWgui OWge OWkernel ${QT_LIBS} ${Boost_LIBRARIES} )
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( OWguiqt4 PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
......@@ -150,7 +150,7 @@ int WQt4Gui::run()
m_ge = WGraphicsEngine::getGraphicsEngine();
// and startup kernel
m_kernel = boost::shared_ptr< WKernel >( new WKernel( m_ge, shared_from_this() ) );
m_kernel = boost::shared_ptr< WKernel >( WKernel::instance( m_ge, shared_from_this() ) );
m_kernel->run();
t_ModuleErrorSignalHandlerType func = boost::bind( &WQt4Gui::moduleError, this, _1, _2 );
m_kernel->getRootContainer()->addDefaultNotifier( WM_ERROR, func );
......
......@@ -8,6 +8,10 @@ FILE( GLOB KERNEL_COMBINER_SRC "combiner/*.cpp" "combiner/*.h" )
ADD_LIBRARY( OWkernel SHARED ${KERNEL_SRC} ${MODULES_SRC} ${KERNEL_EXCEPTIONS_SRC} ${KERNEL_COMBINER_SRC} )
TARGET_LINK_LIBRARIES( OWkernel OWcommon OWdataHandler OWge ${OPENSCENEGRAPH_LIBRARIES} ${CMAKE_DL_LIBS} )
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( OWkernel PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
# Unit tests
IF( OW_COMPILE_TESTS )
# SET( testLibs guiqt4 )
......
......@@ -50,7 +50,7 @@
/**
* Used for program wide access to the kernel.
*/
WKernel* kernel = NULL;
WKernel* WKernel::m_kernel = NULL;
WKernel::WKernel( boost::shared_ptr< WGraphicsEngine > ge, boost::shared_ptr< WGUI > gui ):
WThreadedRunner()
......@@ -58,7 +58,7 @@ WKernel::WKernel( boost::shared_ptr< WGraphicsEngine > ge, boost::shared_ptr< WG
WLogger::getLogger()->addLogMessage( "Initializing Kernel", "Kernel", LL_INFO );
// init the singleton
kernel = this;
m_kernel = this;
// initialize members
m_gui = gui;
......@@ -74,6 +74,16 @@ WKernel::~WKernel()
WLogger::getLogger()->addLogMessage( "Shutting down Kernel", "Kernel", LL_INFO );
}
WKernel* WKernel::instance( boost::shared_ptr< WGraphicsEngine > ge, boost::shared_ptr< WGUI > gui )
{
if( m_kernel == NULL )
{
new WKernel( ge, gui ); // m_kernel will be set in the constructor.
}
return m_kernel;
}
void WKernel::init()
{
// initialize
......@@ -99,7 +109,7 @@ void WKernel::init()
WKernel* WKernel::getRunningKernel()
{
return kernel;
return m_kernel;
}
boost::shared_ptr< WGraphicsEngine > WKernel::getGraphicsEngine() const
......
......@@ -64,12 +64,15 @@ class OWKERNEL_EXPORT WKernel: public WThreadedRunner
public:
/**
* Constructor. Awaits an INITIALIZED graphics engine an gui.
* Returns pointer to the running kernel or a new if no kernel was there.
* If a running kernel exists the function return it and does not check if
* ge and gui of the running kernel are equivalent to the ones given as parameters.
*
* \param ge initialized graphics engine.
* \param gui initialized gui.
* \return the kernel instance.
*/
WKernel( boost::shared_ptr< WGraphicsEngine > ge, boost::shared_ptr< WGUI > gui );
static WKernel* instance( boost::shared_ptr< WGraphicsEngine > ge, boost::shared_ptr< WGUI > gui );
/**
* Destructor.
......@@ -155,6 +158,14 @@ public:
boost::shared_ptr< WSelectionManager>getSelectionManager();
protected:
/**
* Constructor is protected because this class is a singleton. Awaits an INITIALIZED graphics engine an gui.
*
* \param ge initialized graphics engine.
* \param gui initialized gui.
*/
WKernel( boost::shared_ptr< WGraphicsEngine > ge, boost::shared_ptr< WGUI > gui );
/**
* Function that has to be overwritten for execution. It gets executed in a separate thread after run()
......@@ -202,6 +213,11 @@ private:
* Initializes the graphics engine, data handler and so on.
*/
void init();
/**
* Pointer to the unique instance of this singleton class.
*/
static WKernel* m_kernel;
};
#endif // WKERNEL_H
......
......@@ -73,11 +73,6 @@ public:
typedef WSharedAssociativeContainer< PrototypeContainerType > PrototypeSharedContainerType;
/**
* Default constructor.
*/
WModuleFactory();
/**
* Destructor.
*/
virtual ~WModuleFactory();
......@@ -182,6 +177,10 @@ public:
static bool isPrototype( boost::shared_ptr< WModule > module );
protected:
/**
* Constructors are protected because this is a Singleton.
*/
WModuleFactory();
/**
* The module prototypes available.
......
......@@ -56,8 +56,21 @@ void WModuleLoader::load( WSharedAssociativeContainer< std::set< boost::shared_p
std::string suffix = wiotools::getSuffix( i->leaf() );
std::string stem = i->path().stem();
#ifdef _MSC_VER
std::string supposedFilename = getModulePrefix() + '_' + i->path().parent_path().filename()
#ifdef _DEBUG
+ 'd'
#endif
+ WSharedLib::getSystemSuffix();
std::string isFileName = i->path().filename();
#endif // _MSC_VER
if( !boost::filesystem::is_directory( *i ) && ( suffix == WSharedLib::getSystemSuffix() ) &&
( stem.compare( 0, getModulePrefix().length(), getModulePrefix() ) == 0 ) )
( stem.compare( 0, getModulePrefix().length(), getModulePrefix() ) == 0 )
#ifdef _MSC_VER
&& supposedFilename == isFileName
#endif
)
{
try
{
......@@ -104,19 +117,6 @@ void WModuleLoader::load( WSharedAssociativeContainer< std::set< boost::shared_p
// if it a dir -> traverse down
load( ticket, *i, level + 1 );
}
// this little construct will enable vc to find the dll's in the correct build mode we are in
#ifdef _MSC_VER
else if ( ( level == 1 ) &&
#ifdef _DEBUG
boost::filesystem::path( *i ).filename() == "Debug"
#else // _DEBUG
boost::filesystem::path( *i ).filename() == "Release"
#endif // _DEBUG
)
{
load( ticket, *i, level + 1 );
}
#endif // _MSC_VER
}
}
......
......@@ -510,7 +510,7 @@ void WMNavSlices::setSlicePosFromPick( WPickInfo pickInfo )
osg::Vec3 endPosWorld = wge::unprojectFromScreen( endPosScreen, m_viewer->getCamera() );
osg::Vec3 moveDirWorld = endPosWorld - startPosWorld;
float diff = wge::wv3D2ov3( normal ) * moveDirWorld;
float diff = normal * moveDirWorld;
// recognize also small values.
if( diff < 0 && diff > -1 )
......@@ -628,7 +628,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
vertices.push_back( wmath::WPosition( xPos, m_bb.second[1], m_bb.first[2] ) );
for( size_t i = 0; i < nbVerts; ++i )
{
sliceVertices->push_back( wge::wv3D2ov3( vertices[i] ) );
sliceVertices->push_back( vertices[i] );
}
sliceGeometry->setVertexArray( sliceVertices );
......@@ -641,7 +641,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array;
for( size_t i = 0; i < nbVerts; ++i )
{
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( vertices[i] ) ) );
texCoords->push_back( grid->worldCoordToTexCoord( vertices[i] ) );
}
sliceGeometry->setTexCoordArray( c, texCoords );
++c;
......@@ -655,7 +655,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array;
for( size_t i = 0; i < nbVerts; ++i )
{
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( vertices[i] ) ) );
texCoords->push_back( grid->worldCoordToTexCoord( vertices[i] ) );
}
sliceGeometry->setTexCoordArray( c, texCoords );
++c;
......@@ -672,7 +672,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
vertices.push_back( wmath::WPosition( m_bb.second[0], yPos, m_bb.first[2] ) );
for( size_t i = 0; i < nbVerts; ++i )
{
sliceVertices->push_back( wge::wv3D2ov3( vertices[i] ) );
sliceVertices->push_back( vertices[i] );
}
sliceGeometry->setVertexArray( sliceVertices );
......@@ -684,7 +684,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array;
for( size_t i = 0; i < nbVerts; ++i )
{
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( vertices[i] ) ) );
texCoords->push_back( grid->worldCoordToTexCoord( vertices[i] ) );
}
sliceGeometry->setTexCoordArray( c, texCoords );
++c;
......@@ -698,7 +698,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array;
for( size_t i = 0; i < nbVerts; ++i )
{
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( vertices[i] ) ) );
texCoords->push_back( grid->worldCoordToTexCoord( vertices[i] ) );
}
sliceGeometry->setTexCoordArray( c, texCoords );
++c;
......@@ -714,7 +714,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
vertices.push_back( wmath::WPosition( m_bb.second[0], m_bb.first[1], zPos ) );
for( size_t i = 0; i < nbVerts; ++i )
{
sliceVertices->push_back( wge::wv3D2ov3( vertices[i] ) );
sliceVertices->push_back( vertices[i] );
}
sliceGeometry->setVertexArray( sliceVertices );
......@@ -727,7 +727,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array;
for( size_t i = 0; i < nbVerts; ++i )
{
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( vertices[i] ) ) );
texCoords->push_back( grid->worldCoordToTexCoord( vertices[i] ) );
}
sliceGeometry->setTexCoordArray( c, texCoords );
++c;
......@@ -742,7 +742,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
for( size_t i = 0; i < nbVerts; ++i )
{
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( vertices[i] ) ) );
texCoords->push_back( grid->worldCoordToTexCoord( vertices[i] ) );
}
sliceGeometry->setTexCoordArray( c, texCoords );
++c;
......@@ -818,7 +818,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createCrossGeometry( int slice )
for( size_t i = 0; i < vertices.size(); ++i )
{
crossVertices->push_back( wge::wv3D2ov3( vertices[i] ) );
crossVertices->push_back( vertices[i] );
}
colorArray->push_back( osg::Vec3( 1.0f, 0.0f, 0.0f ) );
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )
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
......
......@@ -275,10 +275,10 @@ void WMArbitraryPlane::updatePlane()
osg::ref_ptr<osg::Geometry> planeGeometry = osg::ref_ptr<osg::Geometry>( new osg::Geometry() );
osg::Vec3Array* planeVertices = new osg::Vec3Array;
planeVertices->push_back( wge::wv3D2ov3( v0 ) );
planeVertices->push_back( wge::wv3D2ov3( v1 ) );
planeVertices->push_back( wge::wv3D2ov3( v2 ) );
planeVertices->push_back( wge::wv3D2ov3( v3 ) );
planeVertices->push_back( v0 );
planeVertices->push_back( v1 );
planeVertices->push_back( v2 );
planeVertices->push_back( v3 );
planeGeometry->setVertexArray( planeVertices );
osg::DrawElementsUInt* quad = new osg::DrawElementsUInt( osg::PrimitiveSet::QUADS, 0 );
......@@ -298,10 +298,10 @@ void WMArbitraryPlane::updatePlane()
boost::shared_ptr< WGridRegular3D > grid = WKernel::getRunningKernel()->getSelectionManager()->getGrid();
osg::Vec3Array* texCoords = new osg::Vec3Array;
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v0 ) ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v1 ) ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v2 ) ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v3 ) ) );
texCoords->push_back( grid->worldCoordToTexCoord( v0 ) );
texCoords->push_back( grid->worldCoordToTexCoord( v1 ) );
texCoords->push_back( grid->worldCoordToTexCoord( v2 ) );
texCoords->push_back( grid->worldCoordToTexCoord( v3 ) );
planeGeometry->setTexCoordArray( c, texCoords );
++c;
......@@ -313,10 +313,10 @@ void WMArbitraryPlane::updatePlane()
osg::Vec3Array* texCoords = new osg::Vec3Array;
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v0 ) ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v1 ) ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v2 ) ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v3 ) ) );
texCoords->push_back( grid->worldCoordToTexCoord( v0 ) );
texCoords->push_back( grid->worldCoordToTexCoord( v1 ) );
texCoords->push_back( grid->worldCoordToTexCoord( v2 ) );
texCoords->push_back( grid->worldCoordToTexCoord( v3 ) );
planeGeometry->setTexCoordArray( c, texCoords );
++c;
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel ${Teem_LIBRARIES} )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel ${Teem_LIBRARIES} )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )
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
......
......@@ -12,6 +12,10 @@ SET( MODULE_NAME "OWmodule_${MODULE_NAME}" ) # prefix all module names w
ADD_LIBRARY( ${MODULE_NAME} SHARED ${MODULES_SRC} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} OWkernel )