OpenWalnut  1.5.0dev
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:
+ Collaboration 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 std::shared_ptr< WDataSetVectorisVectorDataSet ()
 Checks if this dataset is a vector dataset. More...
 
virtual osg::ref_ptr< WDataTexture3DgetTexture () 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...
 
std::shared_ptr< WPropertiesgetProperties () const
 Return a pointer to the properties object of the dataset. More...
 
std::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 std::shared_ptr< WPrototypedgetPrototype ()
 Returns a prototype instantiated with the true type of the deriving class. More...
 
- Static Public Member Functions inherited from WDataSet
static std::shared_ptr< WPrototypedgetPrototype ()
 Returns a prototype instantiated with the true type of the deriving class. More...
 

Static Protected Attributes

static std::shared_ptr< WPrototypedm_prototype = std::shared_ptr< WPrototyped >()
 The prototype as singleton. More...
 
- Static Protected Attributes inherited from WDataSet
static std::shared_ptr< WPrototypedm_prototype = std::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

- Public Types inherited from WDataSet
typedef std::shared_ptr< WDataSetSPtr
 Shared pointer abbreviation to a instance of this class. More...
 
typedef std::shared_ptr< const WDataSetConstSPtr
 Shared pointer abbreviation to a const instance of this class. More...
 
- Protected Attributes inherited from WDataSet
std::shared_ptr< WPropertiesm_properties
 The property object for the dataset. More...
 
std::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() [1/2]

WDataSetDipoles::WDataSetDipoles ( )

Creates a new dipole dataset.

Definition at line 34 of file WDataSetDipoles.cpp.

Referenced by getPrototype().

+ Here is the caller graph for this function:

◆ WDataSetDipoles() [2/2]

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 39 of file WDataSetDipoles.cpp.

References addDipole().

+ Here is the call graph for this function:

◆ ~WDataSetDipoles()

WDataSetDipoles::~WDataSetDipoles ( )

Destructs this dataset.

Definition at line 51 of file WDataSetDipoles.cpp.

Member Function Documentation

◆ addDipole()

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 65 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().

+ Here is the caller graph for this function:

◆ getEndTime()

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 97 of file WDataSetDipoles.cpp.

References m_dipoles.

◆ getMagnitude()

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 128 of file WDataSetDipoles.cpp.

References m_dipoles.

◆ getMagnitudes()

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 110 of file WDataSetDipoles.cpp.

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

◆ getMaxMagnitude()

float WDataSetDipoles::getMaxMagnitude ( ) const

Return the biggest magnitude of all dipoles.

Returns
Biggest magnitude of all dipoles.

Definition at line 123 of file WDataSetDipoles.cpp.

References m_maxMagnitude.

◆ getNumberOfDipoles()

size_t WDataSetDipoles::getNumberOfDipoles ( )

Return number of dipoles in this dataset.

Returns
number of dipoles in this dataset.

Definition at line 118 of file WDataSetDipoles.cpp.

References m_dipoles.

◆ getPosition()

WPosition WDataSetDipoles::getPosition ( size_t  dipoleId = 0)

Return position of dipole.

Parameters
dipoleIdId number of dipole
Returns
Position of the dipole.

Definition at line 87 of file WDataSetDipoles.cpp.

References m_dipoles.

◆ getPrototype()

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

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

Returns
the prototype.

Definition at line 55 of file WDataSetDipoles.cpp.

References m_prototype, and WDataSetDipoles().

+ Here is the call graph for this function:

◆ getStartTime()

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 92 of file WDataSetDipoles.cpp.

References m_dipoles.

◆ getTimes()

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 102 of file WDataSetDipoles.cpp.

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

Member Data Documentation

◆ m_dipoles

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().

◆ m_maxMagnitude

float WDataSetDipoles::m_maxMagnitude
private

Biggest magnitude of all dipoles.

Definition at line 168 of file WDataSetDipoles.h.

Referenced by addDipole(), and getMaxMagnitude().

◆ m_prototype

std::shared_ptr< WPrototyped > WDataSetDipoles::m_prototype = std::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: