OpenWalnut  1.3.1
Classes | Public Member Functions | Static Public Member Functions | Static Protected Attributes | Private Attributes | List of all members
WDataSetDipoles Class Reference

Represents a dipole dataset. More...

#include <WDataSetDipoles.h>

+ Inheritance diagram for WDataSetDipoles:

Classes

class  Dipole
 Internal class representing one dipole. More...
 

Public Member Functions

 WDataSetDipoles ()
 Creates a new dipole dataset. More...
 
 WDataSetDipoles (WPosition dipPos, std::vector< float > mags, std::vector< float > times, size_t firstTimeStep, size_t lastTimeStep)
 Creates a new dipole data set containing one dipole with the given information and checks consistency of the information. More...
 
 ~WDataSetDipoles ()
 Destructs this dataset. More...
 
size_t addDipole (WPosition dipPos, std::vector< float > mags, std::vector< float > times, size_t firstTimeStep, size_t lastTimeStep)
 Adds a new dipole with given information and checks consistency of the information. More...
 
WPosition getPosition (size_t dipoleId=0)
 Return position of dipole. More...
 
float getMagnitude (float time, size_t dipoleId=0)
 Return magnitude of dipole for a given time. More...
 
float getStartTime (size_t dipoleId=0u) const
 Return first time where the magnitude is not 0. More...
 
float getEndTime (size_t dipoleId=0u) const
 Return last time where the magnitude is not 0. More...
 
std::vector< float > getTimes (size_t dipoleId=0u) const
 Return the times where the magnitude is not 0. More...
 
std::vector< float > getMagnitudes (size_t dipoleId=0u) const
 Return the magnitudes where the magnitude is not 0. More...
 
size_t getNumberOfDipoles ()
 Return number of dipoles in this dataset. More...
 
float getMaxMagnitude () const
 Return the biggest magnitude of all dipoles. More...
 
- Public Member Functions inherited from WDataSet
 WDataSet ()
 This constructor should be used if a dataSet does not stem from a file. More...
 
virtual ~WDataSet ()
 Since WDataSet is a base class and thus should be polymorphic we add virtual destructor. More...
 
void setFilename (const std::string filename)
 Set the name of the file that this data set stems from. More...
 
std::string getFilename () const
 Get the name of the file that this data set stems from. More...
 
OW_API_DEPRECATED void setFileName (const std::string filename)
 Set the name of the file that this data set stems from. More...
 
OW_API_DEPRECATED std::string getFileName () const
 Get the name of the file that this data set stems from. More...
 
virtual bool isTexture () const
 Determines whether this dataset can be used as a texture. More...
 
virtual boost::shared_ptr
< WDataSetVector
isVectorDataSet ()
 Checks if this dataset is a vector dataset. More...
 
virtual osg::ref_ptr
< WDataTexture3D
getTexture () const
 Returns the texture- representation of the dataset. More...
 
virtual const std::string getName () const
 Gets the name of this prototype. More...
 
virtual const std::string getDescription () const
 Gets the description for this prototype. More...
 
boost::shared_ptr< WPropertiesgetProperties () const
 Return a pointer to the properties object of the dataset. More...
 
boost::shared_ptr< WPropertiesgetInformationProperties () const
 Return a pointer to the information properties object of the dataset. More...
 
- Public Member Functions inherited from WTransferable
 WTransferable ()
 Default constructor. More...
 
virtual ~WTransferable ()
 Destructor. More...
 
- Public Member Functions inherited from WPrototyped
 WPrototyped ()
 Default constructor. More...
 
virtual ~WPrototyped ()
 Destructor. More...
 
template<typename T >
bool isA ()
 Checks whether the actual prototype has the specified runtime type. More...
 

Static Public Member Functions

static boost::shared_ptr
< WPrototyped
getPrototype ()
 Returns a prototype instantiated with the true type of the deriving class. More...
 
- Static Public Member Functions inherited from WDataSet
static boost::shared_ptr
< WPrototyped
getPrototype ()
 Returns a prototype instantiated with the true type of the deriving class. More...
 

Static Protected Attributes

static boost::shared_ptr
< WPrototyped
m_prototype = boost::shared_ptr< WPrototyped >()
 The prototype as singleton. More...
 
- Static Protected Attributes inherited from WDataSet
static boost::shared_ptr
< WPrototyped
m_prototype = boost::shared_ptr< WPrototyped >()
 The prototype as singleton. More...
 

Private Attributes

std::vector< Dipolem_dipoles
 List of dipoles representeing this dipoles dataset. More...
 
float m_maxMagnitude
 Biggest magnitude of all dipoles. More...
 

Additional Inherited Members

- Protected Attributes inherited from WDataSet
boost::shared_ptr< WPropertiesm_properties
 The property object for the dataset. More...
 
boost::shared_ptr< WPropertiesm_infoProperties
 The property object for the dataset containing only props whose purpose is "PV_PURPOSE_INFORMNATION". More...
 

Detailed Description

Represents a dipole dataset.

Definition at line 37 of file WDataSetDipoles.h.

Constructor & Destructor Documentation

WDataSetDipoles::WDataSetDipoles ( )

Creates a new dipole dataset.

Definition at line 33 of file WDataSetDipoles.cpp.

Referenced by getPrototype().

WDataSetDipoles::WDataSetDipoles ( WPosition  dipPos,
std::vector< float >  mags,
std::vector< float >  times,
size_t  firstTimeStep,
size_t  lastTimeStep 
)
explicit

Creates a new dipole data set containing one dipole with the given information and checks consistency of the information.

Parameters
dipPosSpatial location of the dipole
magsMagnitudes of dipole over time
timesTimes for the dipole activity
firstTimeStepFirst time where the magnitude is not 0
lastTimeStepLast time where the magnitude is not 0

Definition at line 38 of file WDataSetDipoles.cpp.

References addDipole().

WDataSetDipoles::~WDataSetDipoles ( )

Destructs this dataset.

Definition at line 50 of file WDataSetDipoles.cpp.

Member Function Documentation

size_t WDataSetDipoles::addDipole ( WPosition  dipPos,
std::vector< float >  mags,
std::vector< float >  times,
size_t  firstTimeStep,
size_t  lastTimeStep 
)

Adds a new dipole with given information and checks consistency of the information.

Parameters
dipPosSpatial location of the dipole
magsMagnitudes of dipole over time
timesTimes for the dipole activity
firstTimeStepFirst time where the magnitude is not 0
lastTimeStepLast time where the magnitude is not 0
Returns
Id of the added dipole.

Definition at line 64 of file WDataSetDipoles.cpp.

References WDataSetDipoles::Dipole::m_dipolePosition, m_dipoles, WDataSetDipoles::Dipole::m_firstTimeStep, WDataSetDipoles::Dipole::m_lastTimeStep, WDataSetDipoles::Dipole::m_magnitudes, m_maxMagnitude, and WDataSetDipoles::Dipole::m_times.

Referenced by WDataSetDipoles().

float WDataSetDipoles::getEndTime ( size_t  dipoleId = 0u) const

Return last time where the magnitude is not 0.

Parameters
dipoleIdId number of dipole
Returns
Last time where the magnitude is not 0.

Definition at line 96 of file WDataSetDipoles.cpp.

References m_dipoles.

float WDataSetDipoles::getMagnitude ( float  time,
size_t  dipoleId = 0 
)

Return magnitude of dipole for a given time.

Parameters
timeThe selected time.
dipoleIdId number of dipole
Returns
Magnitude of the dipole.

Definition at line 127 of file WDataSetDipoles.cpp.

References m_dipoles.

std::vector< float > WDataSetDipoles::getMagnitudes ( size_t  dipoleId = 0u) const

Return the magnitudes where the magnitude is not 0.

Parameters
dipoleIdId number of dipole
Returns
Magnitudes where the magnitude is not 0.

Definition at line 109 of file WDataSetDipoles.cpp.

References m_dipoles, WDataSetDipoles::Dipole::m_firstTimeStep, WDataSetDipoles::Dipole::m_lastTimeStep, and WDataSetDipoles::Dipole::m_magnitudes.

float WDataSetDipoles::getMaxMagnitude ( ) const

Return the biggest magnitude of all dipoles.

Returns
Biggest magnitude of all dipoles.

Definition at line 122 of file WDataSetDipoles.cpp.

References m_maxMagnitude.

size_t WDataSetDipoles::getNumberOfDipoles ( )

Return number of dipoles in this dataset.

Returns
number of dipoles in this dataset.

Definition at line 117 of file WDataSetDipoles.cpp.

References m_dipoles.

WPosition WDataSetDipoles::getPosition ( size_t  dipoleId = 0)

Return position of dipole.

Parameters
dipoleIdId number of dipole
Returns
Position of the dipole.

Definition at line 86 of file WDataSetDipoles.cpp.

References m_dipoles.

boost::shared_ptr< WPrototyped > WDataSetDipoles::getPrototype ( )
static

Returns a prototype instantiated with the true type of the deriving class.

Returns
the prototype.

Definition at line 54 of file WDataSetDipoles.cpp.

References m_prototype, and WDataSetDipoles().

float WDataSetDipoles::getStartTime ( size_t  dipoleId = 0u) const

Return first time where the magnitude is not 0.

Parameters
dipoleIdId number of dipole
Returns
First time where the magnitude is not 0.

Definition at line 91 of file WDataSetDipoles.cpp.

References m_dipoles.

std::vector< float > WDataSetDipoles::getTimes ( size_t  dipoleId = 0u) const

Return the times where the magnitude is not 0.

Parameters
dipoleIdId number of dipole
Returns
Times where the magnitude is not 0.

Definition at line 101 of file WDataSetDipoles.cpp.

References m_dipoles, WDataSetDipoles::Dipole::m_firstTimeStep, WDataSetDipoles::Dipole::m_lastTimeStep, and WDataSetDipoles::Dipole::m_times.

Member Data Documentation

std::vector< Dipole > WDataSetDipoles::m_dipoles
private

List of dipoles representeing this dipoles dataset.

Definition at line 167 of file WDataSetDipoles.h.

Referenced by addDipole(), getEndTime(), getMagnitude(), getMagnitudes(), getNumberOfDipoles(), getPosition(), getStartTime(), and getTimes().

float WDataSetDipoles::m_maxMagnitude
private

Biggest magnitude of all dipoles.

Definition at line 168 of file WDataSetDipoles.h.

Referenced by addDipole(), and getMaxMagnitude().

boost::shared_ptr< WPrototyped > WDataSetDipoles::m_prototype = boost::shared_ptr< WPrototyped >()
staticprotected

The prototype as singleton.

Definition at line 151 of file WDataSetDipoles.h.

Referenced by getPrototype().


The documentation for this class was generated from the following files: