Commit 03da07f4 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[FIX] - cleaned up wlimits.

parent 40b314eb
...@@ -37,33 +37,6 @@ ...@@ -37,33 +37,6 @@
*/ */
namespace wlimits namespace wlimits
{ {
/**
* Maximum sample size per axis for image
* data like MRI, CT, funcMRI and dwMRI.
*/
static const unsigned int MAX_IMAGE_DIMENSION = 256;
/**
* Maximum number of channels for a certain modality.
*/
static const unsigned int MAX_RECORDING_CHANNELS = 1024;
/**
* Maximum number of samples of a recording.
* (2^32)-1 this is often equal to UINT_MAX
*/
static const unsigned int MAX_RECORDING_SAMPLES = 4294967295U;
/**
* Maximum number of segments of a recording.
*/
static const unsigned int MAX_RECORDING_SEGMENTS = 128;
/**
* Maximum samplimg frequency of a recording.
*/
static const unsigned int MAX_RECORDING_SAMPLING_FREQUENCY = 20000;
static const double MAX_DOUBLE = std::numeric_limits< double >::max(); //!< Maximum double value static const double MAX_DOUBLE = std::numeric_limits< double >::max(); //!< Maximum double value
static const float MAX_FLOAT = std::numeric_limits< float >::max(); //!< Maximum float value static const float MAX_FLOAT = std::numeric_limits< float >::max(); //!< Maximum float value
...@@ -105,12 +78,6 @@ namespace wlimits ...@@ -105,12 +78,6 @@ namespace wlimits
* \return True if the value is infinity, false otherwise. * \return True if the value is infinity, false otherwise.
*/ */
template< typename T > bool isinf( T value ); template< typename T > bool isinf( T value );
//! The maximum texture dimension.
static std::size_t const MAX_TEXTURE_DIMENSION = 2048;
//! We support only 8 textures because some known hardware does not support more texture coordinates.
static std::size_t const MAX_NUMBER_OF_TEXTURES = 8;
} }
template< typename T > bool wlimits::isnan( T value ) template< typename T > bool wlimits::isnan( T value )
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <string> #include <string>
#include "../common/WPrototyped.h" #include "../common/WPrototyped.h"
#include "../common/WLimits.h"
#include "WEEG.h" #include "WEEG.h"
...@@ -37,15 +36,15 @@ WEEG::WEEG( const WEEGSegmentArray& data, ...@@ -37,15 +36,15 @@ WEEG::WEEG( const WEEGSegmentArray& data,
const WEEGChannelLabels& channelLabels ) const WEEGChannelLabels& channelLabels )
: WRecording() : WRecording()
{ {
assert( data.size() <= wlimits::MAX_RECORDING_SEGMENTS ); assert( data.size() <= WRecording::MAX_RECORDING_SEGMENTS );
assert( data.size() > 0 ); // ensure that ther is really data assert( data.size() > 0 ); // ensure that ther is really data
for( WEEGSegmentArray::const_iterator it1 = data.begin(); it1 != data.end(); ++it1 ) for( WEEGSegmentArray::const_iterator it1 = data.begin(); it1 != data.end(); ++it1 )
{ {
assert( it1->size() <= wlimits::MAX_RECORDING_CHANNELS ); assert( it1->size() <= WRecording::MAX_RECORDING_CHANNELS );
assert( it1->size() > 0 ); // ensure that ther is really data assert( it1->size() > 0 ); // ensure that ther is really data
for( WEEGSegment::const_iterator it2 = it1->begin(); it2 != it1->end(); ++it2 ) for( WEEGSegment::const_iterator it2 = it1->begin(); it2 != it1->end(); ++it2 )
{ {
assert( it2->size() <= wlimits::MAX_RECORDING_SAMPLES ); assert( it2->size() <= WRecording::MAX_RECORDING_SAMPLES );
assert( it2->size() > 0 ); // ensure that ther is really data assert( it2->size() > 0 ); // ensure that ther is really data
} }
} }
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "../common/WLimits.h"
#include "../common/exceptions/WOutOfBounds.h" #include "../common/exceptions/WOutOfBounds.h"
#include "exceptions/WDHException.h" #include "exceptions/WDHException.h"
#include "io/WPagerEEG.h" #include "io/WPagerEEG.h"
...@@ -55,19 +54,19 @@ WEEG2::WEEG2( boost::shared_ptr< WPagerEEG > pager, boost::shared_ptr< WEEGPosit ...@@ -55,19 +54,19 @@ WEEG2::WEEG2( boost::shared_ptr< WPagerEEG > pager, boost::shared_ptr< WEEGPosit
} }
std::size_t nbSegments = pager->getNumberOfSegments(); std::size_t nbSegments = pager->getNumberOfSegments();
if( nbSegments <= 0 || wlimits::MAX_RECORDING_SEGMENTS < nbSegments ) if( nbSegments <= 0 || WRecording::MAX_RECORDING_SEGMENTS < nbSegments )
{ {
throw WDHException( std::string( "Couldn't construct new EEG: invalid number of segments" ) ); throw WDHException( std::string( "Couldn't construct new EEG: invalid number of segments" ) );
} }
std::size_t nbChannels = pager->getNumberOfChannels(); std::size_t nbChannels = pager->getNumberOfChannels();
if( nbChannels <= 0 || wlimits::MAX_RECORDING_CHANNELS < nbChannels ) if( nbChannels <= 0 || WRecording::MAX_RECORDING_CHANNELS < nbChannels )
{ {
throw WDHException( std::string( "Couldn't construct new EEG: invalid number of channels" ) ); throw WDHException( std::string( "Couldn't construct new EEG: invalid number of channels" ) );
} }
m_samplingRate = pager->getSamplingRate(); m_samplingRate = pager->getSamplingRate();
if( m_samplingRate <= 0.0 || wlimits::MAX_RECORDING_SAMPLING_FREQUENCY < m_samplingRate ) if( m_samplingRate <= 0.0 || WRecording::MAX_RECORDING_SAMPLING_FREQUENCY < m_samplingRate )
{ {
throw WDHException( std::string( "Couldn't construct new EEG: invalid sampling rate" ) ); throw WDHException( std::string( "Couldn't construct new EEG: invalid sampling rate" ) );
} }
......
...@@ -29,13 +29,12 @@ ...@@ -29,13 +29,12 @@
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "../common/WLimits.h"
#include "../common/exceptions/WOutOfBounds.h" #include "../common/exceptions/WOutOfBounds.h"
#include "WEEG2Segment.h"
#include "WEEGValueMatrix.h"
#include "WRecording.h"
#include "exceptions/WDHException.h" #include "exceptions/WDHException.h"
#include "io/WPagerEEG.h" #include "io/WPagerEEG.h"
#include "WEEGValueMatrix.h"
#include "WEEG2Segment.h"
WEEG2Segment::WEEG2Segment( std::size_t segmentID, boost::shared_ptr< WPagerEEG > pager ) WEEG2Segment::WEEG2Segment( std::size_t segmentID, boost::shared_ptr< WPagerEEG > pager )
: m_segmentID( segmentID ), : m_segmentID( segmentID ),
...@@ -54,7 +53,7 @@ WEEG2Segment::WEEG2Segment( std::size_t segmentID, boost::shared_ptr< WPagerEEG ...@@ -54,7 +53,7 @@ WEEG2Segment::WEEG2Segment( std::size_t segmentID, boost::shared_ptr< WPagerEEG
} }
m_nbSamples = m_pager->getNumberOfSamples( m_segmentID ); m_nbSamples = m_pager->getNumberOfSamples( m_segmentID );
if( m_nbSamples <= 0 || wlimits::MAX_RECORDING_SAMPLES < m_nbSamples ) if( m_nbSamples <= 0 || WRecording::MAX_RECORDING_SAMPLES < m_nbSamples )
{ {
throw WDHException( std::string( "Couldn't construct new EEG segment: invalid number of samples" ) ); throw WDHException( std::string( "Couldn't construct new EEG segment: invalid number of samples" ) );
} }
......
...@@ -67,6 +67,27 @@ public: ...@@ -67,6 +67,27 @@ public:
*/ */
static boost::shared_ptr< WPrototyped > getPrototype(); static boost::shared_ptr< WPrototyped > getPrototype();
/**
* Maximum number of channels for a certain modality.
*/
static const unsigned int MAX_RECORDING_CHANNELS = 1024;
/**
* Maximum number of samples of a recording.
* (2^32)-1 this is often equal to UINT_MAX
*/
static const unsigned int MAX_RECORDING_SAMPLES = 4294967295U;
/**
* Maximum number of segments of a recording.
*/
static const unsigned int MAX_RECORDING_SEGMENTS = 128;
/**
* Maximum samplimg frequency of a recording.
*/
static const unsigned int MAX_RECORDING_SAMPLING_FREQUENCY = 20000;
protected: protected:
/** /**
......
...@@ -54,6 +54,12 @@ template < typename TextureType = osg::Texture > ...@@ -54,6 +54,12 @@ template < typename TextureType = osg::Texture >
class WGETexture: public TextureType class WGETexture: public TextureType
{ {
public: public:
//! We support only 8 textures because some known hardware does not support more texture coordinates.
static std::size_t const MAX_NUMBER_OF_TEXTURES = 8;
//! The maximum texture dimension.
static std::size_t const MAX_TEXTURE_DIMENSION = 2048;
/** /**
* Default constructor. Creates an empty instance of the texture. * Default constructor. Creates an empty instance of the texture.
* *
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include <QtGui/QListWidgetItem> #include <QtGui/QListWidgetItem>
#include <QtGui/QApplication> #include <QtGui/QApplication>
#include "core/common/WLimits.h"
#include "core/dataHandler/WDataSet.h" #include "core/dataHandler/WDataSet.h"
#include "core/dataHandler/WDataHandler.h" #include "core/dataHandler/WDataHandler.h"
#include "core/dataHandler/exceptions/WDHNoSuchSubject.h" #include "core/dataHandler/exceptions/WDHNoSuchSubject.h"
...@@ -56,7 +55,7 @@ WQtColormapper::WQtColormapper( QWidget* parent ) ...@@ -56,7 +55,7 @@ WQtColormapper::WQtColormapper( QWidget* parent )
m_textureListWidget = new QListWidget( this ); m_textureListWidget = new QListWidget( this );
m_textureListWidget->setToolTip( "List of available colormaps. Only the upper <b>" m_textureListWidget->setToolTip( "List of available colormaps. Only the upper <b>"
+ QString().setNum( wlimits::MAX_NUMBER_OF_TEXTURES ) + QString().setNum( WGETexture3D::MAX_NUMBER_OF_TEXTURES )
+ "</b> textures will be applied." ); + "</b> textures will be applied." );
this->setAllowedAreas( Qt::AllDockWidgetAreas ); this->setAllowedAreas( Qt::AllDockWidgetAreas );
this->setFeatures( QDockWidget::AllDockWidgetFeatures ); this->setFeatures( QDockWidget::AllDockWidgetFeatures );
......
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