Commit fc08affc authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[CHANGE] - now module path can be defined in the walnut.cfg

parent 6fd24134
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
## An example could be ## An example could be
# default=HUD # default=HUD
#whiteList =Isosurface,Bounding Box, Direct Volume Rendering,Distance Map Isosurface,Gauss Filtering,HUD,Vector Plot,Write NIfTI # A list of modules that will be provided through the GUI. If the list is empty all available modules are provided. #whiteList =Isosurface,Bounding Box, Direct Volume Rendering,Distance Map Isosurface,Gauss Filtering,HUD,Vector Plot,Write NIfTI # A list of modules that will be provided through the GUI. If the list is empty all available modules are provided.
# path = /some/directory # this is useful to define the path where OpenWalnut searches modules for loading. It can be relative to the bin
# directory.
[qt4gui] [qt4gui]
#################################################################### ####################################################################
......
...@@ -13,6 +13,8 @@ allowOnlyOneFiberDataSet = yes # This will prevent you from accidently loading m ...@@ -13,6 +13,8 @@ allowOnlyOneFiberDataSet = yes # This will prevent you from accidently loading m
## A list of modules that will be provided through the GUI. ## A list of modules that will be provided through the GUI.
## If the list is empty all available modules are provided. ## If the list is empty all available modules are provided.
whiteList = Isosurface,Bounding Box,Isosurface Raytracer,Distance Map Isosurface,Gauss Filtering,HUD,Vector Plot,Write NIfTI,Mesh Reader,Triangle Mesh Renderer,Arbitrary Rois,LIC,Voxelizer,Superquadric Glyphs whiteList = Isosurface,Bounding Box,Isosurface Raytracer,Distance Map Isosurface,Gauss Filtering,HUD,Vector Plot,Write NIfTI,Mesh Reader,Triangle Mesh Renderer,Arbitrary Rois,LIC,Voxelizer,Superquadric Glyphs
# path = /some/directory # this is useful to define the path where OpenWalnut searches modules for loading. It can be relative to the bin
# directory.
[qt4gui] [qt4gui]
#################################################################### ####################################################################
......
...@@ -42,7 +42,7 @@ boost::shared_ptr< WModuleFactory > WModuleFactory::m_instance = boost::shared_p ...@@ -42,7 +42,7 @@ boost::shared_ptr< WModuleFactory > WModuleFactory::m_instance = boost::shared_p
WModuleFactory::WModuleFactory(): WModuleFactory::WModuleFactory():
m_prototypes(), m_prototypes(),
m_moduleLoader( "../lib/modules" ) m_moduleLoader()
{ {
// initialize members // initialize members
} }
......
...@@ -26,14 +26,18 @@ ...@@ -26,14 +26,18 @@
#include <string> #include <string>
#include "../common/WIOTools.h" #include "../common/WIOTools.h"
#include "../common/WPreferences.h"
#include "../common/WSharedLib.h" #include "../common/WSharedLib.h"
#include "WModuleLoader.h" #include "WModuleLoader.h"
WModuleLoader::WModuleLoader( const boost::filesystem::path& relPath ): WModuleLoader::WModuleLoader( ):
m_path( relPath ) m_path( "." )
{ {
// initialize members // initialize members
std::string libPath = "../lib/modules";
WPreferences::getPreference( "modules.path", &libPath );
m_path = boost::filesystem::path( libPath );
} }
WModuleLoader::~WModuleLoader() WModuleLoader::~WModuleLoader()
......
...@@ -46,9 +46,8 @@ public: ...@@ -46,9 +46,8 @@ public:
/** /**
* Constructor. It does not load any files. Use load to do this. * Constructor. It does not load any files. Use load to do this.
* *
* \param relPath The relative path of the module lib directory.
*/ */
explicit WModuleLoader( const boost::filesystem::path& relPath ); explicit WModuleLoader();
/** /**
* Destructor, closes all handles to shared libraries. * Destructor, closes all handles to shared libraries.
...@@ -72,7 +71,7 @@ private: ...@@ -72,7 +71,7 @@ private:
/** /**
* Path to the modules. This is used during load to find all libMODULENAME.{so,dll,dylib} files. * Path to the modules. This is used during load to find all libMODULENAME.{so,dll,dylib} files.
*/ */
const boost::filesystem::path m_path; boost::filesystem::path m_path;
}; };
#endif // WMODULELOADER_H #endif // WMODULELOADER_H
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