Commit 3ac7351e authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[MERGE] - merged in default. Fixed some minor stuff and additionally removed windows line-endings

parents 76818b3a a72df849
......@@ -25,4 +25,5 @@ frohl.robert@googlemail.com Robert_Frohl
dirk_albrecht@gmx.net Dirk_Albrecht
albrecht Dirk_Albrecht
mstuber Marcus_Stuber
skiunke Sebastian_Kiunke
\ No newline at end of file
skiunke Sebastian_Kiunke
a_berres@informatik.uni-kl.de Anne_Berres
\ No newline at end of file
<html>
<body bgcolor="#fff">
<h1>OpenWalnut Help <img src="icons/logoIcon.png"/></h1>
<h2>Contents</h2>
<ol>
<li><a href="#Introduction">Introduction</a></li>
<li><a href="#MainWindow">Main Window</a></li>
<li><a href="#Navigation">Navigation</a></li>
<li><a href="#Keyboard">Keyboard Shortcuts</a></li>
<li><a href="#Toolbar">Toolbar</a></li>
<li><a href="#Config">Customizing OpenWalnut</a></li>
</ol>
<h2><a name="Introduction" />Introduction</h2>
The intention of this help document is to give short overview of how to use the current version
of OpenWalnut. Although it is not at all comprehensive,
it provides a description of the most commonly used features and GUI elements.
As described <a href="#Config">below</a>, the appearance of the GUI is customizable. This help document
asumes the standard configuration. Additionally, some described features may not be available
in every instance of OpenWalnut because the belong to special modules.
<h2><a name="MainWindow" />Main Window</h2>
By now this section only shows a snapshot of the main window of OpenWalnut. In
the future this illustration will be annotated to explain the names and the use of
all components of the main window.
<img src="images/mainWindow.png" width="100%"/>
<h2><a name="Navigation" />Navigation</h2>
<h3>Navigation in Main View</h3>
<table>
<tr><td><b><i>Mouse Button&nbsp;&nbsp;</i></b></td><td><b><i>Action</i></b></td></tr>
<tr><td>Left</td><td>Rotate</td></tr>
<tr><td>Middle</td><td>Pan</td></tr>
<tr><td>Right</td><td>Pick, move ROI box, or move slice</td></tr>
<tr><td>Right + [Shift]</td><td>Resize ROI box</td></tr>
<tr><td>Wheel</td><td>Zoom</td></tr>
<tr><td><b><i>Key</i></b></td><td><b><i>Action</i></b></td></tr>
<tr><td>+</td><td>Zoom in</td></tr>
<tr><td>-</td><td>Zoom out</td></tr>
<tr><td>[Space]</td><td>Reset view</td></tr>
</table>
<h3>Navigation in EEG View</h3>
<table>
<tr><td><b><i>Mouse Button</i></b></td><td><b><i>Action</i></b></td></tr>
<tr><td>Left</td><td>Mark event position</td></tr>
<tr><td>Middle</td><td>Pan</td></tr>
<tr><td>Right</td><td>Zoom in time</td></tr>
<tr><td>Wheel</td><td>Scale voltage</td></tr>
<tr><td>Wheel + Right</td><td>Change spacing between graphs</td></tr>
<tr><td>Wheel + Left</td><td>Change sensitivity of the coloring of the head surface</td></tr>
</table>
<h2><a name="Keyboard" />Keyboard Shortcuts</h2>
<h3>Program-wide Keyboard Shortcuts</h3>
<table>
<tr><td><b><i>Key</i></b></td><td><b><i>Action</i></b></td></tr>
<tr><td>[Ctrl] + q</td><td>Quit</td></tr>
<tr><td>[Esc]</td><td>Resets main view</td></tr>
<tr><td>[F1]</td><td>Opens help window</td></tr>
</table>
<h3>ROI tree</h3>
<table>
<tr><td><b><i>Key</i></b></td><td><b><i>Action</i></b></td></tr>
<tr><td>[Delete]</td><td>Removes ROI</td></tr>
</table>
<h3>Module tree</h3>
<table>
<tr><td><b><i>Key</i></b></td><td><b><i>Action</i></b></td></tr>
<tr><td>[Backspace]</td><td>Removes module</td></tr>
</table>
<h2><a name="Toolbar" />Toolbar</h2>
<table>
<tr><td><b>Icon</b></td><td><b>Name</b></td><td><b>Description</b></td></tr>
<tr><td><img src="icons/fileopen.png" width="20"></td><td>Load
Data</td><td>Loads data given in various formats like fibers (.fib), NIfTI
images (.nii, .nii.gz) or EEG data (.cnt).</td></tr>
<tr><td><img src="icons/projOpen.png" width="20"></td><td>Load a project from
file</td><td>Opens a project file (.owp), and instantiates modules, sets their
connections and orients the scene accordingly.</td></tr>
<tr><td><img src="icons/disc.png" width="20"></td><td>Save current project to
file</td><td>Saves the current state (modules, connections, orientation of
the scene) of OpenWalnut to a project file (.owp).</td></tr>
<tr><td><img src="icons/camera.png" width="20"></td><td>Reset Main View</td><td>Rotates
and scales the scene in the cetral 3D view to show the same orientation as
after program startup but zoomed to show all contents of the
scene.</td></tr>
</table>
<h2><a name="Config" />Customizing OpenWalnut</h2>
OpenWalnut allows you to configure several features. Most of these options are only useful to advanced users.
You can have a user-scope configuration in your HOME directory as ".walnut.cfg".
If this file exists, OpenWalnut loads this file. You can also specify a "walnut.cfg" in your OpenWalnut directory under
"share/OpenWalnut/". A default file will be there after installation. The dafault file is very well documented.
<br />
<br />
<small>For more information on OpenWalnut visit <a href="http://www.openwalnut.org">www.openwalnut.org</a>.</small>
</body>
</html>
......@@ -26,7 +26,6 @@
####################################################################
# Toolbars
# useToolBarBreak = no # put compatibles toolbar in separate row
useAutoDisplay = no # automatically add a standard module after loading a data module.
# The next property controls the style of ALL toolbars in OpenWalnut.
......@@ -37,16 +36,6 @@ useAutoDisplay = no # automatically add a standard module after loading a data m
toolBarStyle = 0
compatiblesToolBarStyle = 0 # this pref allows the compatibles toolbar to have a different style (overrides toolBarStyle)
# Position of the compatibles toolbar
# 0 -> top
# 1 -> bottom
# 2 -> left
# 3 -> right
# 4 -> hide completely
# 5 -> inside the control panel ( not possible for compatiblesToolBarPos! This will be mapped to right (=3) )
toolBarPos = 0 # default position of the toolbars
compatiblesToolBarPos = 0 # position of the compatibles toolbar (overrides toolBarPos)
####################################################################
# Control panel
......
......@@ -29,7 +29,6 @@ whiteList = Arbitrary Plane,Coordinate System,Image Extractor,Paint Texture,Arbi
####################################################################
# Toolbars
# useToolBarBreak = no # put compatibles toolbar in separate row
# useAutoDisplay = no # automatically add a standard module after loading a data module.
# The next property controls the style of ALL toolbars in OpenWalnut.
......@@ -40,16 +39,6 @@ whiteList = Arbitrary Plane,Coordinate System,Image Extractor,Paint Texture,Arbi
toolBarStyle = 0
compatiblesToolBarStyle = 0 # this pref allows the compatibles toolbar to have a different style (overrides toolBarStyle)
# Position of the compatibles toolbar
# 0 -> top
# 1 -> bottom
# 2 -> left
# 3 -> right
# 4 -> hide completely
# 5 -> inside the control panel ( not possible for compatiblesToolBarPos! This will be mapped to right (=3) )
toolBarPos = 0 # default position of the toolbars
compatiblesToolBarPos = 0 # position of the compatibles toolbar (overrides toolBarPos)
####################################################################
# Control panel
......
......@@ -38,7 +38,7 @@ ENDIF()
OPTION( OW_BUILD_AS_ONE_BIG_FILE "Build every library as one big cpp" OFF )
INCLUDE( FindPythonInterp )
# define libnames
# define libnames
SET( OWCommonName "OWcommon" )
SET( OWDatahandlerName "OWdataHandler" )
SET( OWgeName "OWge" )
......@@ -143,14 +143,6 @@ IF( ITK_FOUND )
ENDIF()
ENDIF()
### Eigen #### (for the gauss process, the covariance matrices tend to be sparse and 20x20, but ~70.000 of them)
FIND_PACKAGE( Eigen3 QUIET )
IF( EIGEN3_FOUND )
MESSAGE( STATUS "Found Eigen3 in: ${EIGEN3_INCLUDE_DIR} with version: ${EIGEN3_VERSION}" )
MARK_AS_ADVANCED( EIGEN3_INCLUDE_DIR )
MARK_AS_ADVANCED( EIGEN3_VERSION )
ENDIF()
### OPENCL ###
OPTION( OW_USE_OPENCL "Enable OpenCL if available." )
IF( OW_USE_OPENCL )
......@@ -300,6 +292,23 @@ add_custom_target( fontsDirectoryConfiguration
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."
)
#---------- OpenWalnut help -------------
ADD_CUSTOM_TARGET( onlineHelp
ALL
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/../doc/user/help/OpenWalnutHelp.html ${PROJECT_BINARY_DIR}/share/OpenWalnut
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/../doc/user/help/images/ ${PROJECT_BINARY_DIR}/share/OpenWalnut/images
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/gui/icons/ ${PROJECT_BINARY_DIR}/share/OpenWalnut/icons
COMMENT "Copy online help"
)
#---------- About OpenWalnut -------------
ADD_CUSTOM_TARGET( aboutOpenWalnut
ALL
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/gui/qt4/OpenWalnutAbout.html ${PROJECT_BINARY_DIR}/share/OpenWalnut
COMMENT "Copy about page"
)
#---------- shell scripts -------------
IF( CMAKE_GENERATOR MATCHES "Visual Studio" )
......@@ -384,11 +393,26 @@ ENDIF()
FILE( GLOB_RECURSE STYLE_CPP ${PROJECT_SOURCE_DIR}/*.cpp )
FILE( GLOB_RECURSE STYLE_H ${PROJECT_SOURCE_DIR}/*.h )
FILE( GLOB_RECURSE STYLE_GLSL ${PROJECT_SOURCE_DIR}/*.glsl )
FILE( GLOB_RECURSE EXT_SOURCES ${PROJECT_SOURCE_DIR}/ext/* )
FOREACH( file ${EXT_SOURCES} )
LIST( REMOVE_ITEM STYLE_H ${file} )
LIST( REMOVE_ITEM STYLE_CPP ${file} )
ENDFOREACH( file )
# Set dirs to exclude from stylecheck
SET( EXCLUDE_DIRS "/ext/nifti/;/dataHandler/io/biosig/;/dataHandler/io/biosigWin/;/dataHandler/io/biosig/XMLParser/;/dataHandler/io/biosigWin/XMLParser/;/ext/libeep/avr/;/ext/libeep/cnt/;/ext/libeep/eep/;/common/platformDependent/visualStudio/;/modules/lic/fibernavigator/;/modules/lic/fantom/" )
LIST( APPEND EXCLUDE_DIRS "/dataHandler/io/biosig" )
LIST( APPEND EXCLUDE_DIRS "/dataHandler/io/biosigWin" )
LIST( APPEND EXCLUDE_DIRS "/dataHandler/io/biosig/XMLParser" )
LIST( APPEND EXCLUDE_DIRS "/dataHandler/io/biosigWin/XMLParser" )
LIST( APPEND EXCLUDE_DIRS "/common/platformDependent/visualStudio" )
LIST( APPEND EXCLUDE_DIRS "/modules/lic/fibernavigator" )
LIST( APPEND EXCLUDE_DIRS "/modules/lic/fantom" )
LIST( APPEND EXCLUDE_DIRS "/dataHandler/io/biosigWin" )
FOREACH( dirname ${EXCLUDE_DIRS} )
FILE( GLOB EXCLUDE_H ${PROJECT_SOURCE_DIR}${dirname}*.h )
FILE( GLOB EXCLUDE_CPP ${PROJECT_SOURCE_DIR}${dirname}*.cpp )
FILE( GLOB EXCLUDE_H ${PROJECT_SOURCE_DIR}${dirname}/*.h )
FILE( GLOB EXCLUDE_CPP ${PROJECT_SOURCE_DIR}${dirname}/*.cpp )
FOREACH( fname ${EXCLUDE_H} )
LIST( REMOVE_ITEM STYLE_H ${fname} )
......@@ -398,6 +422,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 )
......
......@@ -44,11 +44,20 @@ ENDIF()
# Unit tests
IF( OW_COMPILE_TESTS )
CXXTEST_ADD_TESTS_FROM_LIST( "${COMMON_SRC}"
"${LIB_NAME}"
"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
"WLimits.cpp" # there are only some definitions
)
CXXTEST_ADD_TESTS_FROM_LIST( "${COMMON_SRC}"
"${LIB_NAME}"
"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
"WLimits.cpp" # there are only some definitions
)
# Copy fixtures if existend
IF( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test/fixtures )
ADD_CUSTOM_TARGET( ${LIB_NAME}_CopyFixtures
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/test/fixtures ${CMAKE_BINARY_DIR}/common/fixtures/
COMMENT "Copy fixtures of ${LIB_NAME}"
)
ADD_DEPENDENCIES( ${LIB_NAME} ${LIB_NAME}_CopyFixtures )
ENDIF( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test/fixtures )
ENDIF( OW_COMPILE_TESTS )
......@@ -113,11 +113,11 @@ public:
using osg::BoundingBoxImpl< VT >::corner;
/**
* Converts this bounding box to the osg::BoundingBoxImpl< VT >.
* Explicit type conversion function to use a WBoundingBox as osg::BoundingBox.
*
* \return Copy of this casted to the osg::BoundingBoxImpl< VT > type
* \return A copy of this bounding box as osg::BoundingBox.
*/
osg::BoundingBoxImpl< VT > toOSGBB() const;
osg::BoundingBox toOSGBB() const;
using osg::BoundingBoxImpl< VT >::expandBy;
......@@ -202,9 +202,9 @@ inline typename WBoundingBoxImpl< VT >::value_type WBoundingBoxImpl< VT >::radiu
}
template< class VT >
inline osg::BoundingBoxImpl< VT > WBoundingBoxImpl< VT >::toOSGBB() const
inline osg::BoundingBox WBoundingBoxImpl< VT >::toOSGBB() const
{
return *this;
return osg::BoundingBox( osg::BoundingBoxImpl< VT >::_min, osg::BoundingBoxImpl< VT >::_max );
}
template< class VT >
......@@ -296,6 +296,6 @@ inline const typename WBoundingBoxImpl< VT >::vec_type& WBoundingBoxImpl< VT >::
return osg::BoundingBoxImpl< VT >::_max;
}
typedef WBoundingBoxImpl< wmath::WVector3D > WBoundingBox;
typedef WBoundingBoxImpl< WVector3D > WBoundingBox;
#endif // WBOUNDINGBOX_H
......@@ -35,8 +35,18 @@ WConditionSet::WConditionSet():
WConditionSet::~WConditionSet()
{
// get write lock
boost::unique_lock<boost::shared_mutex> lock = boost::unique_lock<boost::shared_mutex>( m_conditionSetLock );
// clean conditions list
// NOTE: we need to disconnect here.
for ( ConditionConnectionMap::iterator it = m_conditionSet.begin(); it != m_conditionSet.end(); ++it )
{
( *it ).second.disconnect();
}
m_conditionSet.clear();
lock.unlock();
}
void WConditionSet::add( boost::shared_ptr< WCondition > condition )
......
//---------------------------------------------------------------------------
//
// 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 "WDefines.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/>.
//
//---------------------------------------------------------------------------
#ifndef WDEFINES_H
#define WDEFINES_H
/**
* \defgroup macros Macros
*
* This are macros used in OpenWalnut. Generally speaking we want to use as less macros as possible, so introduce new macros only if you have read:
* http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.5 esp. all four "why are macros - evil" pages.
*/
/**
* \ingroup macros
* \def OW_API_DEPRECATED
* In order to mark functions for the compiler as deprecated we need to put this before each deprecated funtion to get compiler warnings whenever this function is used.
* \note This macro is defined in here, since almost every header of the dataHandler includes this header.
*/
#if ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) )
#define OW_API_DEPRECATED __attribute__( ( __deprecated__ ) )
#else
#define OW_API_DEPRECATED
#endif /* __GNUC__ */
#endif // WDEFINES_H
......@@ -111,6 +111,13 @@ public:
*/
virtual const T operator()() const;
/**
* Operator returns value of the flag. It does not reset the change flag.
*
* \return the value.
*/
virtual operator T() const;
/**
* Wait for the flag to change its value. For WConditionOneShot is also recognizes if the flag has changed before.
*/
......@@ -262,6 +269,12 @@ const T WFlag< T >::get() const
return m_flag;
}
template < typename T >
WFlag< T >::operator T() const
{
return get();
}
template < typename T >
void WFlag< T >::wait() const
{
......
......@@ -22,4 +22,66 @@
//
//---------------------------------------------------------------------------
#include <fstream>
#include <streambuf>
#include <string>
#include <boost/filesystem.hpp>
#include "exceptions/WFileNotFound.h"
#include "exceptions/WFileOpenFailed.h"
#include "WIOTools.h"
std::string readFileIntoString( const std::string& name )
{
return readFileIntoString( boost::filesystem::path( name ) );
}
std::string readFileIntoString( const boost::filesystem::path& path )
{
std::string filename = path.file_string();
std::ifstream input( filename.c_str() );
if( !input.is_open() )
{
throw WFileNotFound( std::string( "The file \"" ) + boost::filesystem::complete( path ).file_string() + std::string( "\" does not exist." ) );
}
// preallocate space for the string.
std::string str;
input.seekg( 0, std::ios::end );
str.reserve( input.tellg() );
input.seekg( 0, std::ios::beg );
str.assign( ( std::istreambuf_iterator< char >( input ) ), std::istreambuf_iterator< char >() );
input.close();
return str;
}
void writeStringIntoFile( const std::string& name, const std::string& content )
{
writeStringIntoFile( boost::filesystem::path( name ), content );
}
void writeStringIntoFile( const boost::filesystem::path& path, const std::string& content )
{
std::ofstream outfile( path.file_string().c_str() );
if( !outfile.is_open() )
{
throw WFileOpenFailed( "The file \"" + boost::filesystem::complete( path ).file_string() + "\" could not be opened." );
}
outfile << content << std::flush;
outfile.close();
}
boost::filesystem::path tempFileName()
{
// REGARDING THE COMPILER WARNING
// 1. mkstemp is only available for POSIX systems
// 2. reason: the warning generated here is due to a race condition
// while tmpnam invents the fileName it may be created by another process
// 3. file names like "/tmp/pansen" or "C:\pansen" are platform dependent
return boost::filesystem::path( std::string( std::tmpnam( NULL ) ) );
}
......@@ -27,102 +27,137 @@
#include <stdint.h>
#include <cstdio>
#include <algorithm>
#include <cassert>
// #include <cstdio>
#include <string>
#include <boost/filesystem.hpp>
#include "WExportCommon.h"
#include "WAssert.h"
/**
* Namespaces for several tools we may need while doing IO
* Checks if you are on a big endian machine or not.
*/
namespace wiotools
inline bool isBigEndian()
{
/**
* Checks if you are on a big endian machine or not.
*/
inline bool isBigEndian()
union
{
union
{
uint32_t i;
char c[4];
} some = {0x01020305}; // NOLINT assigning an 32 bit unsigned integer
uint32_t i;
char c[4];
} some = {0x01020305}; // NOLINT assigning an 32 bit unsigned integer
return some.c[0] == 1;
}
return some.c[0] == 1;
}
/**
* Transforms a value of type T into the opposite byte order.
*
* \param value The value where byte swapping should be applied to
*/
template< class T > T switchByteOrder( const T value )
/**
* Transforms a value of type T into the opposite byte order.
*
* \param value The value where byte swapping should be applied to
*/
template< class T > T switchByteOrder( const T value )
{
size_t numBytes = sizeof( T );
T result = value;
if( numBytes == 1 )
{
size_t numBytes = sizeof( T );
T result = value;
if( numBytes == 1 )
{
return result;
}
assert( numBytes % 2 == 0 && numBytes > 0 );
char *s = reinterpret_cast< char* >( &result );
for( size_t i = 0; i < numBytes / 2; ++i )
{
std::swap( s[i], s[ ( numBytes - 1 ) - i ] );
}
return result;
}
/**
* Transform a whole array of elements (of type T and size of sizeof(T))
* into opposite byte order.
*
* \param array Array containing the data
* \param arraySize The number of elements which is not the number of
* bytes but e.g. the number of floats
*/
template< class T > void switchByteOrderOfArray( T *array, const size_t arraySize )
WAssert( numBytes % 2 == 0 && numBytes > 0, "odd number of bytes whilte switching byte order" );
char *s = reinterpret_cast< char* >( &result );
for( size_t i = 0; i < numBytes / 2; ++i )
{
for( size_t i = 0; i < arraySize; ++i )
{
array[i] = switchByteOrder< T >( array[i] );
}
std::swap( s[i], s[ ( numBytes - 1 ) - i ] );
}
return result;
}
/**
* \param name File name to get the extension or suffix from.
* \return filename suffix
*/
inline std::string getSuffix( std::string name )
/**
* Transform a whole array of elements (of type T and size of sizeof(T))
* into opposite byte order.
*
* \param array Array containing the data
* \param arraySize The number of elements which is not the number of
* bytes but e.g. the number of floats
*/
template< class T > void switchByteOrderOfArray( T *array, const size_t arraySize )
{
for( size_t i = 0; i < arraySize; ++i )
{
return boost::filesystem::path( name ).extension();
array[i] = switchByteOrder< T >( array[i] );
}
}