Commit 934c0cfb authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[MERGE]

parents 767467ae f863e5aa
......@@ -24,6 +24,9 @@ syntax: regexp
^src/tags
^src/cscope.out
# files geneterated by build system
^src/version.h
# local vim rc
^lvimrc
......
See the "doc" directory for more information.
------------------------------------------------------
See the "doc" directory for more information.
------------------------------------------------------
......@@ -12,4 +14,5 @@ Directory Structure:
-src
The sources, i.e. code, icons, ...
-tools
Tools used during development and building (e.g. style checker)
Tools used during development and building
(e.g. style checker)
This directory is intended to serve as the place where one can compile OpenWalnut.
This .README file is in the build directory so that the directory will be recognized and created by mercurial. Only remove it if you know what you are doing or if the behavior of mercurial concerning empty directories has changed.
\ No newline at end of file
......@@ -8,6 +8,13 @@
# 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.
## 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
## 2. if the directory does not contain any libOWmodule_XYZ, the subdirectories get searched.
## 3. DO NOT use this string thing --> " <-- to enclose the string!
## NOTE: you do not need to specify the global module path as it gets search automatically
#path = /home/user/otherModules;/usr/local/OpenWalnut/niceModule/
[qt4gui]
####################################################################
# Views
......
......@@ -14,6 +14,13 @@ allowOnlyOneFiberDataSet = yes # This will prevent you from accidently loading m
## 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
## 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
## 2. if the directory does not contain any libOWmodule_XYZ, the subdirectories get searched.
## 3. DO NOT use this string thing --> " <-- to enclose the string!
## NOTE: you do not need to specify the global module path as it gets search automatically
#path = /home/user/otherModules;/usr/local/OpenWalnut/niceModule/
[qt4gui]
####################################################################
# Views
......
#!/bin/sh
# get path of this script
BINDIR=`dirname "$0"`
# assume that this script is in the bin dir
# go there to ensure walnuts working directory is set correctly
cd "$BINDIR"
#run walnut
echo "OpenWalnut built from: $(cat ./revision)"
./walnut-bin $@
......@@ -12,7 +12,6 @@ echo run $@ > $PARAM_FILENAME
cd "$BINDIR"
# run walnut
echo "OpenWalnut built from: $(cat ./revision)"
gdb ./walnut-bin -command=$PARAM_FILENAME
gdb ./walnut -command=$PARAM_FILENAME
rm $PARAM_FILENAME
......@@ -12,6 +12,5 @@ PARAMS="$*"
echo "Parameters: $PARAMS"
# run walnut
echo "OpenWalnut built from: $(cat ./revision)"
kdbg -a "$PARAMS" walnut-bin
kdbg -a "$PARAMS" walnut
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT( OpenWalnut )
# append search path for FindModules:
#------------------------------------
LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../tools/CMakeModules )
......@@ -13,6 +12,7 @@ INCLUDE( ${PROJECT_SOURCE_DIR}/../tools/CMakeModules/Utils.cmake )
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib )
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib )
SET( SHARED_FILES_RELATIVE "../share/${CMAKE_PROJECT_NAME}" CACHE INTERNAL "Relative path to bin/ denoting the destination for shaders and cfg files." ) # this path us the relative path to bin/ used for all shared files like shaders and config file
# CMAKE automatism to select static vs. shared building:
#-------------------------------------------------------
......@@ -139,23 +139,34 @@ ADD_SUBDIRECTORY( gui )
ADD_SUBDIRECTORY( kernel )
ADD_SUBDIRECTORY( common )
ADD_SUBDIRECTORY( modules )
ADD_EXECUTABLE( walnut-bin OpenWalnut.cpp )
TARGET_LINK_LIBRARIES( walnut-bin kernel dataHandler gui guiqt4 common ge ${Boost_LIBRARIES} )
#-------------------------------------------------------------------------------------------------------------
# Writes information about the revision of the current code to the file version.h which then gets included by OpenWalnut.cpp
add_custom_command( OUTPUT ${PROJECT_SOURCE_DIR}/version.h
MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/../.hg/dirstate
COMMAND hg parents --template '\#define W_VERSION \"{node|short} {rev} {branches} {tags}\"' > ${PROJECT_SOURCE_DIR}/version.h
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Creating version.h"
)
# finally, build walnut
ADD_EXECUTABLE( walnut OpenWalnut.cpp version.h )
TARGET_LINK_LIBRARIES( walnut OWkernel OWdataHandler OWgui OWguiqt4 OWcommon OWge ${Boost_LIBRARIES} )
#---------- Shaders -------------
option( OW_COPY_SHADERS "This enables copying shaders with every make call." ON )
if( OW_COPY_SHADERS )
add_custom_target( shaderDirectoryConfiguration
ALL
COMMAND ${CMAKE_COMMAND} -D OW_SOURCE_DIR:STRING=${PROJECT_SOURCE_DIR} -P ${PROJECT_SOURCE_DIR}/../tools/CMakeModules/UpdateShaders.cmake
COMMENT "Put all shaders to the right place or update them if they are already there."
COMMAND ${CMAKE_COMMAND} -D OW_SOURCE_DIR:STRING=${PROJECT_SOURCE_DIR} -D SHARED_FILES_RELATIVE:PATH=${SHARED_FILES_RELATIVE} -P ${PROJECT_SOURCE_DIR}/../tools/CMakeModules/UpdateShaders.cmake
COMMENT "Put all global shaders to the right place or update them if they are already there."
)
endif( OW_COPY_SHADERS )
#---------- fonts -------------
add_custom_target( fontsDirectoryConfiguration
ALL
COMMAND ${CMAKE_COMMAND} -D OW_SOURCE_DIR:STRING=${PROJECT_SOURCE_DIR} -P ${PROJECT_SOURCE_DIR}/../tools/CMakeModules/CopyFonts.cmake
COMMAND ${CMAKE_COMMAND} -D OW_SOURCE_DIR:STRING=${PROJECT_SOURCE_DIR} -D SHARED_FILES_RELATIVE:PATH=${SHARED_FILES_RELATIVE} -P ${PROJECT_SOURCE_DIR}/../tools/CMakeModules/CopyFonts.cmake
COMMENT "Put all fonts to the right place."
)
......@@ -175,9 +186,9 @@ ELSE()
ENDIF()
#---------- walnut.cfg file -------------
IF( NOT EXISTS ${PROJECT_BINARY_DIR}/bin/walnut.cfg )
CONFIGURE_FILE( ${PROJECT_SOURCE_DIR}/../doc/user/walnut.cfg.mpi ${PROJECT_BINARY_DIR}/bin/walnut.cfg COPYONLY )
MESSAGE( STATUS "Copied ${PROJECT_SOURCE_DIR}/../doc/user/walnut.cfg.mpi to ${PROJECT_BINARY_DIR}/bin/walnut.cfg" )
IF( NOT EXISTS ${PROJECT_BINARY_DIR}/bin/${SHARED_FILES_RELATIVE}/walnut.cfg )
CONFIGURE_FILE( ${PROJECT_SOURCE_DIR}/../doc/user/walnut.cfg.mpi ${PROJECT_BINARY_DIR}/bin/${SHARED_FILES_RELATIVE}/walnut.cfg COPYONLY )
MESSAGE( STATUS "Copied ${PROJECT_SOURCE_DIR}/../doc/user/walnut.cfg.mpi to ${PROJECT_BINARY_DIR}/bin/${SHARED_FILES_RELATIVE}/walnut.cfg" )
ENDIF()
# Special targets:
......@@ -221,6 +232,18 @@ ADD_CUSTOM_COMMAND( OUTPUT cscope
# The command "make tags" creates ctags and cscope tag files
ADD_CUSTOM_TARGET( tags DEPENDS ctags DEPENDS cscope )
#-------------------------------------------------------------------------------------------------------------
# Determines the number of cores available on this machine
SET( NUM_CORES_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../tools/numCores )
SET( NUM_CORES_BINARY_DIR ${PROJECT_BINARY_DIR}/numCores )
SET( NUM_CORES_BINARY ${NUM_CORES_BINARY_DIR}/numCores )
ADD_CUSTOM_TARGET( numCores
COMMAND ${CMAKE_COMMAND} -E make_directory ${NUM_CORES_BINARY_DIR}
COMMAND cd ${NUM_CORES_BINARY_DIR} && ${CMAKE_COMMAND} ${NUM_CORES_SOURCE_DIR} > /dev/null
COMMAND $(MAKE) -C ${NUM_CORES_BINARY_DIR} > /dev/null
COMMENT "Determines the number of cores available on this machine"
)
#-------------------------------------------------------------------------------------------------------------
# Checks style guide lines via the BrainLint tool against all source code files
# The output is colored when variable CMAKE_COLOR_MAKEFILE is set to ON,
......@@ -241,6 +264,7 @@ FOREACH( dirname ${EXCLUDE_DIRS} )
LIST( REMOVE_ITEM STYLE_CPP ${fname} )
ENDFOREACH( fname )
ENDFOREACH( dirname )
LIST( REMOVE_ITEM STYLE_H ${PROJECT_SOURCE_DIR}/version.h )
IF( CMAKE_COLOR_MAKEFILE )
SET( STYLECHECK_OPTIONS "--color" )
......@@ -250,6 +274,8 @@ ENDIF()
IF( CMAKE_HOST_WIN32 )
SET( XARGS_OPTIONS "-n 128" )
ELSEIF( CMAKE_HOST_UNIX )
SET( XARGS_OPTIONS -P \$\$\(${NUM_CORES_BINARY}\) -n 64 )
ELSE()
SET( XARGS_OPTIONS "" )
ENDIF()
......@@ -260,19 +286,12 @@ FOREACH( fname ${STYLE_CPP} ${STYLE_H} )
ENDFOREACH()
ADD_CUSTOM_TARGET( stylecheck
COMMAND cat ${PROJECT_BINARY_DIR}/brainlintlist | xargs ${XARGS_OPTIONS} ${PROJECT_SOURCE_DIR}/../tools/brainlint.py ${STYLECHECK_OPTIONS}
COMMAND cat ${PROJECT_BINARY_DIR}/brainlintlist | xargs ${XARGS_OPTIONS} ${PROJECT_SOURCE_DIR}/../tools/brainlint.py ${STYLECHECK_OPTIONS} 2>&1 | grep -iv 'Total errors found: 0$$' | cat
DEPENDS numCores
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Check if code complies to CodingStandard"
)
#-------------------------------------------------------------------------------------------------------------
# Writes information about the revision of the current code to a file
ADD_CUSTOM_TARGET( identify
ALL
COMMAND hg identify --cwd ${PROJECT_SOURCE_DIR} -n -i -b -t > ${PROJECT_BINARY_DIR}/bin/revision
COMMENT "Write information about the revision of the current code to a file"
)
#-------------------------------------------------------------------------------------------------------------
# Prints the verbose output of the test runners, so you may identify the source of error early, if any
ADD_CUSTOM_TARGET( vtest
......@@ -287,43 +306,14 @@ ADD_CUSTOM_TARGET( cicheck
COMMENT "Checks if all is well to commit"
)
#-------------------------------------------------------------------------------------------------------------
# Copies fixtures used for tests to the binary directory (where they are expected).
IF( NOT CMAKE_GENERATOR MATCHES "Visual Studio" )
ADD_CUSTOM_TARGET( fixtures
ALL
COMMAND cp -rf ${PROJECT_SOURCE_DIR}/dataHandler/test/fixtures ${PROJECT_BINARY_DIR}/dataHandler/
COMMAND cp -rf ${PROJECT_SOURCE_DIR}/dataHandler/io/test/fixtures ${PROJECT_BINARY_DIR}/dataHandler/io
# TODO(wiebel): we need to find a way to do this automatically
COMMAND cp -rf ${PROJECT_SOURCE_DIR}/modules/marchingCubes/test/fixtures ${PROJECT_BINARY_DIR}/modules/marchingCubes
COMMENT "Copy fixtures to the right place."
)
ELSE()
ADD_CUSTOM_TARGET( fixtures
ALL
COMMAND ${CMAKE_COMMAND} -D OW_SOURCE_DIR:STRING=${PROJECT_SOURCE_DIR} -P ${PROJECT_SOURCE_DIR}/../tools/CMakeModules/FixturesWin.cmake
COMMENT "Copy fixtures to the right place."
)
ENDIF()
#-------------------------------------------------------------------------------------------------------------
# Makes many special make targets in combination. Default number of cores is 1.
SET( NUM_CORES_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../tools/numCores )
SET( NUM_CORES_BINARY_DIR ${PROJECT_BINARY_DIR}/numCores )
SET( NUM_CORES_BINARY ${NUM_CORES_BINARY_DIR}/numCores )
ADD_CUSTOM_TARGET( many
COMMAND ${CMAKE_COMMAND} ${PROJECT_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${NUM_CORES_BINARY_DIR}
COMMAND cd ${NUM_CORES_BINARY_DIR} && ${CMAKE_COMMAND} ${NUM_CORES_SOURCE_DIR} > /dev/null
COMMAND $(MAKE) -C ${NUM_CORES_BINARY_DIR} > /dev/null
COMMAND if [ -e ${NUM_CORES_BINARY} ]\; then echo Using \$\$\(${NUM_CORES_BINARY}\) cores.\; $(MAKE) all -j\$\$\(${NUM_CORES_BINARY}\)\; else echo WARNING: No binary for numCores found: ${NUM_CORES_BINARY}. Using 1 core.\; $(MAKE) all -j1\; fi
COMMAND echo Using \$\$\(${NUM_CORES_BINARY}\) cores.\; $(MAKE) all -j\$\$\(${NUM_CORES_BINARY}\)
COMMAND $(MAKE) test
COMMAND $(MAKE) stylecheck
COMMAND $(MAKE) doc
DEPENDS numCores
COMMENT "Make many special make targets in combination."
)
......
......@@ -29,6 +29,8 @@
#include "gui/qt4/WQt4Gui.h"
#include "version.h" // this header gets created by our build system.
/**
* \mainpage OpenWalnut Inline Documentation
* \par
......@@ -43,7 +45,8 @@
*/
int main( int argc, char** argv )
{
std::cout << "OpenWalnut ( http://www.openwalnut.org )\n"
std::cout << "OpenWalnut ( http://www.openwalnut.org )" << std::endl <<
"Build from: " << W_VERSION << std::endl << std::endl <<
"Copyright (C) 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS\n"
"For more information see http://www.openwalnut.org/copying\n"
"This program comes with ABSOLUTELY NO WARRANTY.\n"
......
......@@ -7,14 +7,19 @@ ADD_SUBDIRECTORY( datastructures )
ADD_SUBDIRECTORY( constraints )
ADD_SUBDIRECTORY( math )
ADD_LIBRARY( common ${COMMON_SRC} ${COMMON_DATASTRUCTURES_SRC} ${COMMON_EXCEPTIONS_SRC} ${MATH_SRC} ${FIBERSIMILARITY_SRC} )
TARGET_LINK_LIBRARIES( common ${Boost_LIBRARIES} )
ADD_LIBRARY( OWcommon ${COMMON_SRC} ${COMMON_DATASTRUCTURES_SRC} ${COMMON_EXCEPTIONS_SRC} ${MATH_SRC} ${FIBERSIMILARITY_SRC} )
TARGET_LINK_LIBRARIES( OWcommon ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} )
# 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.
add_definitions( '-DW_LIB_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}"' )
add_definitions( '-DW_LIB_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}"' )
# Unit tests
IF( OW_COMPILE_TESTS )
CXXTEST_ADD_TESTS_FROM_LIST( "${COMMON_SRC}"
"common"
"OWcommon"
"WSegmentationFault.cpp" # can't test seg-faults ;-)
"WTransferable.cpp" # its an empty class
"WPropertyBase.cpp" # its an abstract class. Its small functionality is tested in WPropertyVariable_test.h
......
......@@ -22,54 +22,65 @@
//
//---------------------------------------------------------------------------
#ifndef WLOADER_TEST_H
#define WLOADER_TEST_H
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <string>
#include "WAssert.h"
#include "WHistogram.h"
#include "WLimits.h"
#include "WLogger.h"
#include <cxxtest/TestSuite.h>
WHistogram::WHistogram( double min, double max, size_t size )
: m_bins( size, 0 ),
m_min( min ),
m_max( max )
{
if( min > max )
{
std::swap( m_min, m_max );
}
WAssert( m_bins.size() > 0, "Error: A histogram with a size of 0 does not make any sense" );
m_intervalWidth = std::abs( m_min - m_max ) / m_bins.size();
}
#include "../WLoader.h"
#include "../WDataSet.h"
WHistogram::~WHistogram()
{
}
/**
* Just a dummy for testing the base class
*/
class DummyLoader : public WLoader
void WHistogram::insert( double value )
{
public:
/**
* Constructor of Dummy class for testing of WLoader
* \param fileName this file will be loaded
*/
explicit DummyLoader( std::string fileName )
: WLoader( fileName )
if( value > m_max || value < m_min )
{
wlog::warn( "WHistogram" ) << std::scientific << std::setprecision( 16 ) << "Inserted value out of bounds, thread: "
<< value << " as min, resp. max: " << m_min << "," << m_max;
return; // value = ( value > m_max ? m_max : m_min );
}
virtual boost::shared_ptr< WDataSet > load()
if( value == m_max )
{
return boost::shared_ptr< WDataSet >();
value = m_max - wlimits::DBL_EPS;
}
};
/**
* Unit tests the Loader base class.
*/
class WLoaderTest : public CxxTest::TestSuite
m_bins.at( static_cast< size_t >( std::abs( value - m_min ) / m_intervalWidth ) )++;
}
size_t WHistogram::binSize() const
{
public:
/**
* If the given file name is invalid an exception should be thrown.
*/
void testExceptionOnInvalidFilename( void )
return m_bins.size();
}
size_t WHistogram::valuesSize() const
{
return std::accumulate( m_bins.begin(), m_bins.end(), 0 );
}
size_t WHistogram::operator[]( size_t index ) const
{
if( index >= m_bins.size() )
{
TS_ASSERT_THROWS_EQUALS( DummyLoader( "no such file" ),
const WDHIOFailure &e,
e.what(),
std::string( "file 'no such file' doesn't exists." ) );
TS_ASSERT_THROWS_NOTHING( DummyLoader( "fixtures/scalar_float.nii.gz" ) );
wlog::error( "WHistogram" ) << index << "th interval is not available, there are only: " << m_bins.size();
return 0;
}
};
#endif // WLOADER_TEST_H
return m_bins[ index ];
}
//---------------------------------------------------------------------------
//
// 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 WHISTOGRAM_H
#define WHISTOGRAM_H
#include <vector>
/**
* Container which associate values with (uniform width) bins (aka intervals or buckets).
*/
class WHistogram
{
public:
/**
* Default constructor.
*
* \param min
* \param max
* \param size
*/
WHistogram( double min, double max, size_t size = 1000 );
/**
* Default destructor.
*/
~WHistogram();
/**
* Inserts a given value within the given range (min, max) into exactly one bin and increment its size.
*
* \param value Value to insert.
*/
void insert( double value );
/**
* Computes number of invervals.
*
* \return Number of intervals.
*/
size_t binSize() const;
/**
* Computes the number of inserted values so far.
*
* \return Number of values so far.
*/
size_t valuesSize() const;
/**
* LooksUp how many elements are in this bin with the given index.
*
* \param index The bin number to look up for
*
* \return Number of values associated with this interval.
*/
size_t operator[]( size_t index ) const;
protected:
private:
/**
* Bins to associate with the values. Each bin has the width of m_intervalWidth;
*/
std::vector< size_t > m_bins;
/**
* Minimal value
*/
double m_min;
/**
* Maximal value
*/
double m_max;
/**
* The width of an interval is precomputed to save performance.
*/
double m_intervalWidth;
};
#endif // WHISTOGRAM_H
//---------------------------------------------------------------------------
//
// 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/>.
//
//---------------------------------------------------------------------------
#include <string>
#include <vector>
#include <boost/tokenizer.hpp>
#include "WPreferences.h"
#include "WPathHelper.h"
// path helper instance as singleton
boost::shared_ptr< WPathHelper > WPathHelper::m_instance = boost::shared_ptr< WPathHelper >();
WPathHelper::WPathHelper()
{
// initialize members
}
WPathHelper::~WPathHelper()
{
// cleanup
}
boost::shared_ptr< WPathHelper > WPathHelper::getPathHelper()
{
if ( !m_instance )
{
m_instance = boost::shared_ptr< WPathHelper >( new WPathHelper() );
}
return m_instance;
}
void WPathHelper::setAppPath( boost::filesystem::path appPath )
{
m_appPath = appPath;
m_sharePath = m_appPath / "../share/OpenWalnut";
m_libPath = m_appPath / "../lib";
m_modulePath = m_libPath / "modules";
}
boost::filesystem::path WPathHelper::getAppPath()
{
return getPathHelper()->m_appPath;
}
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";
}
boost::filesystem::path WPathHelper::getFontPath()
{
return getPathHelper()->m_sharePath / "fonts";
}
boost::filesystem::path WPathHelper::getShaderPath()
{
return getPathHelper()->m_sharePath / "shaders";
}
WPathHelper::Fonts WPathHelper::getAllFonts()
{
Fonts fonts;
fonts.Regular = getFontPath() / "LiberationMono-Regular.ttf";
fonts.Bold = getFontPath() / "LiberationMono-Bold.ttf";