OpenWalnut
1.5.0dev
|
Represents a dipole dataset. More...
#include <WDataSetDipoles.h>
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< 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... | |
std::shared_ptr< WProperties > | getProperties () const |
Return a pointer to the properties object of the dataset. More... | |
std::shared_ptr< WProperties > | getInformationProperties () 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< WPrototyped > | getPrototype () |
Returns a prototype instantiated with the true type of the deriving class. More... | |
Static Public Member Functions inherited from WDataSet | |
static std::shared_ptr< WPrototyped > | getPrototype () |
Returns a prototype instantiated with the true type of the deriving class. More... | |
Static Protected Attributes | |
static std::shared_ptr< WPrototyped > | m_prototype = std::shared_ptr< WPrototyped >() |
The prototype as singleton. More... | |
Static Protected Attributes inherited from WDataSet | |
static std::shared_ptr< WPrototyped > | m_prototype = std::shared_ptr< WPrototyped >() |
The prototype as singleton. More... | |
Private Attributes | |
std::vector< Dipole > | m_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< WDataSet > | SPtr |
Shared pointer abbreviation to a instance of this class. More... | |
typedef std::shared_ptr< const WDataSet > | ConstSPtr |
Shared pointer abbreviation to a const instance of this class. More... | |
Protected Attributes inherited from WDataSet | |
std::shared_ptr< WProperties > | m_properties |
The property object for the dataset. More... | |
std::shared_ptr< WProperties > | m_infoProperties |
The property object for the dataset containing only props whose purpose is "PV_PURPOSE_INFORMNATION". More... | |
Represents a dipole dataset.
Definition at line 37 of file WDataSetDipoles.h.
WDataSetDipoles::WDataSetDipoles | ( | ) |
Creates a new dipole dataset.
Definition at line 34 of file WDataSetDipoles.cpp.
Referenced by getPrototype().
|
explicit |
Creates a new dipole data set containing one dipole with the given information and checks consistency of the information.
dipPos | Spatial location of the dipole |
mags | Magnitudes of dipole over time |
times | Times for the dipole activity |
firstTimeStep | First time where the magnitude is not 0 |
lastTimeStep | Last time where the magnitude is not 0 |
Definition at line 39 of file WDataSetDipoles.cpp.
References addDipole().
WDataSetDipoles::~WDataSetDipoles | ( | ) |
Destructs this dataset.
Definition at line 51 of file WDataSetDipoles.cpp.
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.
dipPos | Spatial location of the dipole |
mags | Magnitudes of dipole over time |
times | Times for the dipole activity |
firstTimeStep | First time where the magnitude is not 0 |
lastTimeStep | Last time where the magnitude is not 0 |
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().
float WDataSetDipoles::getEndTime | ( | size_t | dipoleId = 0u | ) | const |
Return last time where the magnitude is not 0.
dipoleId | Id number of dipole |
Definition at line 97 of file WDataSetDipoles.cpp.
References m_dipoles.
float WDataSetDipoles::getMagnitude | ( | float | time, |
size_t | dipoleId = 0 |
||
) |
Return magnitude of dipole for a given time.
time | The selected time. |
dipoleId | Id number of dipole |
Definition at line 128 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.
dipoleId | Id number of dipole |
Definition at line 110 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.
Definition at line 123 of file WDataSetDipoles.cpp.
References m_maxMagnitude.
size_t WDataSetDipoles::getNumberOfDipoles | ( | ) |
Return number of dipoles in this dataset.
Definition at line 118 of file WDataSetDipoles.cpp.
References m_dipoles.
WPosition WDataSetDipoles::getPosition | ( | size_t | dipoleId = 0 | ) |
Return position of dipole.
dipoleId | Id number of dipole |
Definition at line 87 of file WDataSetDipoles.cpp.
References m_dipoles.
|
static |
Returns a prototype instantiated with the true type of the deriving class.
Definition at line 55 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.
dipoleId | Id number of dipole |
Definition at line 92 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.
dipoleId | Id number of dipole |
Definition at line 102 of file WDataSetDipoles.cpp.
References m_dipoles, WDataSetDipoles::Dipole::m_firstTimeStep, WDataSetDipoles::Dipole::m_lastTimeStep, and WDataSetDipoles::Dipole::m_times.
|
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().
|
private |
Biggest magnitude of all dipoles.
Definition at line 168 of file WDataSetDipoles.h.
Referenced by addDipole(), and getMaxMagnitude().
|
staticprotected |
The prototype as singleton.
Definition at line 151 of file WDataSetDipoles.h.
Referenced by getPrototype().