OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes | List of all members
WDataSetSingle Class Reference

A data set consisting of a set of values based on a grid. More...

#include <WDataSetSingle.h>

+ Inheritance diagram for WDataSetSingle:
+ Collaboration diagram for WDataSetSingle:

Public Types

typedef std::shared_ptr< WDataSetSingleSPtr
 Convenience typedef for a std::shared_ptr. More...
 
typedef std::shared_ptr< const WDataSetSingleConstSPtr
 Convenience typedef for a std::shared_ptr; const. More...
 
- 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...
 

Public Member Functions

 WDataSetSingle (std::shared_ptr< WValueSetBase > newValueSet, std::shared_ptr< WGrid > newGrid)
 Constructs an instance out of a value set and a grid. More...
 
 WDataSetSingle ()
 Construct an empty and unusable instance. More...
 
virtual ~WDataSetSingle ()
 Destroys this DataSet instance. More...
 
virtual WDataSetSingle::SPtr clone (std::shared_ptr< WValueSetBase > newValueSet, std::shared_ptr< WGrid > newGrid) const
 Creates a copy (clone) of this instance but allows one to change the valueset. More...
 
virtual WDataSetSingle::SPtr clone (std::shared_ptr< WValueSetBase > newValueSet) const
 Creates a copy (clone) of this instance but allows one to change the valueset. More...
 
virtual WDataSetSingle::SPtr clone (std::shared_ptr< WGrid > newGrid) const
 Creates a copy (clone) of this instance but allows one to change the grid. More...
 
virtual WDataSetSingle::SPtr clone () const
 Creates a copy (clone) of this instance. More...
 
std::shared_ptr< WValueSetBasegetValueSet () const
 
std::shared_ptr< WGridgetGrid () const
 
template<typename T >
OW_API_DEPRECATEDgetValueAt (size_t id)
 Get the scalar value stored at id-th position of the array of the value set. More...
 
double OW_API_DEPRECATED getValueAt (size_t id) const
 Get the scalar value stored at id-th position of the array of the value set. More...
 
double getSingleRawValue (size_t id) const
 Get the raw scalar value stored at id-th position of the raw array of the value set. More...
 
virtual bool isTexture () const
 Determines whether this dataset can be used as a texture. 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...
 
- 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 std::shared_ptr< WDataSetVectorisVectorDataSet ()
 Checks if this dataset is a vector dataset. 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...
 

Protected Attributes

std::shared_ptr< WGridm_grid
 Stores the reference of the WGrid of this DataSetSingle instance. More...
 
std::shared_ptr< WValueSetBasem_valueSet
 Stores the reference of the WValueSet of this DataSetSingle instance. 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...
 

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

osg::ref_ptr< WDataTexture3Dm_texture
 The 3D texture representing this dataset. More...
 

Detailed Description

A data set consisting of a set of values based on a grid.

Definition at line 44 of file WDataSetSingle.h.

Member Typedef Documentation

◆ ConstSPtr

typedef std::shared_ptr< const WDataSetSingle > WDataSetSingle::ConstSPtr

Convenience typedef for a std::shared_ptr; const.

Definition at line 55 of file WDataSetSingle.h.

◆ SPtr

typedef std::shared_ptr< WDataSetSingle > WDataSetSingle::SPtr

Convenience typedef for a std::shared_ptr.

Definition at line 50 of file WDataSetSingle.h.

Constructor & Destructor Documentation

◆ WDataSetSingle() [1/2]

WDataSetSingle::WDataSetSingle ( std::shared_ptr< WValueSetBase newValueSet,
std::shared_ptr< WGrid newGrid 
)

Constructs an instance out of a value set and a grid.

Parameters
newValueSetthe value set to use
newGridthe grid which maps world space to the value set

Definition at line 41 of file WDataSetSingle.cpp.

References m_grid, WDataSet::m_infoProperties, m_texture, and m_valueSet.

◆ WDataSetSingle() [2/2]

WDataSetSingle::WDataSetSingle ( )

Construct an empty and unusable instance.

This is useful for prototypes.

Definition at line 64 of file WDataSetSingle.cpp.

Referenced by clone(), and getPrototype().

+ Here is the caller graph for this function:

◆ ~WDataSetSingle()

WDataSetSingle::~WDataSetSingle ( )
virtual

Destroys this DataSet instance.

Definition at line 73 of file WDataSetSingle.cpp.

Member Function Documentation

◆ clone() [1/4]

WDataSetSingle::SPtr WDataSetSingle::clone ( ) const
virtual

Creates a copy (clone) of this instance.

Unlike copy construction, this is a very useful function if you want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.

Returns
the clone

Reimplemented in WDataSetVector, WDataSetSphericalHarmonics, WDataSetSegmentation, WDataSetScalar, WDataSetRawHARDI, and WDataSetDTI.

Definition at line 92 of file WDataSetSingle.cpp.

References getGrid(), getValueSet(), and WDataSetSingle().

+ Here is the call graph for this function:

◆ clone() [2/4]

WDataSetSingle::SPtr WDataSetSingle::clone ( std::shared_ptr< WGrid newGrid) const
virtual

Creates a copy (clone) of this instance but allows one to change the grid.

Unlike copy construction, this is a very useful function if you want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.

Parameters
newGridthe new grid.
Returns
the clone

Reimplemented in WDataSetVector, WDataSetSphericalHarmonics, WDataSetSegmentation, WDataSetScalar, WDataSetRawHARDI, and WDataSetDTI.

Definition at line 87 of file WDataSetSingle.cpp.

References getValueSet(), and WDataSetSingle().

+ Here is the call graph for this function:

◆ clone() [3/4]

WDataSetSingle::SPtr WDataSetSingle::clone ( std::shared_ptr< WValueSetBase newValueSet) const
virtual

Creates a copy (clone) of this instance but allows one to change the valueset.

Unlike copy construction, this is a very useful function if you want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.

Parameters
newValueSetthe new valueset.
Returns
the clone

Reimplemented in WDataSetVector, WDataSetSphericalHarmonics, WDataSetSegmentation, WDataSetScalar, WDataSetRawHARDI, and WDataSetDTI.

Definition at line 82 of file WDataSetSingle.cpp.

References getGrid(), and WDataSetSingle().

+ Here is the call graph for this function:

◆ clone() [4/4]

WDataSetSingle::SPtr WDataSetSingle::clone ( std::shared_ptr< WValueSetBase newValueSet,
std::shared_ptr< WGrid newGrid 
) const
virtual

Creates a copy (clone) of this instance but allows one to change the valueset.

Unlike copy construction, this is a very useful function if you want to keep the dynamic type of your dataset.

Parameters
newValueSetthe new valueset.
newGridthe new grid.
Returns
the clone

Reimplemented in WDataSetVector, WDataSetSphericalHarmonics, WDataSetSegmentation, WDataSetScalar, WDataSetRawHARDI, and WDataSetDTI.

Definition at line 77 of file WDataSetSingle.cpp.

References WDataSetSingle().

+ Here is the call graph for this function:

◆ getDescription()

const std::string WDataSetSingle::getDescription ( ) const
virtual

Gets the description for this prototype.

Returns
the description

Reimplemented from WDataSet.

Reimplemented in WDataSetSphericalHarmonics, WDataSetSegmentation, WDataSetScalar, WDataSetRawHARDI, and WDataSetDTI.

Definition at line 123 of file WDataSetSingle.cpp.

◆ getGrid()

std::shared_ptr< WGrid > WDataSetSingle::getGrid ( ) const

◆ getName()

const std::string WDataSetSingle::getName ( ) const
virtual

Gets the name of this prototype.

Returns
the name.

Reimplemented from WDataSet.

Reimplemented in WDataSetSphericalHarmonics, WDataSetSegmentation, WDataSetScalar, WDataSetRawHARDI, and WDataSetDTI.

Definition at line 118 of file WDataSetSingle.cpp.

◆ getPrototype()

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

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

Returns
the prototype.

Definition at line 130 of file WDataSetSingle.cpp.

References m_prototype, and WDataSetSingle().

+ Here is the call graph for this function:

◆ getSingleRawValue()

T WDataSetSingle::getSingleRawValue ( size_t  id) const

Get the raw scalar value stored at id-th position of the raw array of the value set.

This is the value at the id-th grid position only for scalar data sets.

Parameters
idThe id of the raw value to be obtained
Returns
Scalar value for that given id

Definition at line 145 of file WDataSetSingle.cpp.

References getValueSet().

Referenced by WDataSetSegmentation::getCSFProbability(), WDataSetSegmentation::getGMProbability(), WDataSetScalar::getValueAt(), getValueAt(), WDataSetSegmentation::getWMProbability(), and WDataSetScalar::interpolate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTexture()

osg::ref_ptr< WDataTexture3D > WDataSetSingle::getTexture ( ) const
virtual

Returns the texture representation of the dataset.

May throw an exception if no texture is available.

Returns
the texture.

Reimplemented from WDataSet.

Definition at line 113 of file WDataSetSingle.cpp.

References m_texture.

◆ getValueAt() [1/2]

template<typename T >
OW_API_DEPRECATED T WDataSetSingle::getValueAt ( size_t  id)

Get the scalar value stored at id-th position of the array of the value set.

This is the id-th grid position only for scalar data sets.

Deprecated:
use getSingleRawValue
Parameters
idThe id of the value to be obtained
Returns
Scalar value for that given position

Definition at line 224 of file WDataSetSingle.h.

◆ getValueAt() [2/2]

double WDataSetSingle::getValueAt ( size_t  id) const

Get the scalar value stored at id-th position of the array of the value set.

This is the id-th grid position only for scalar data sets.

Deprecated:
use getSingleRawValue
Parameters
idThe id of the value to be obtained
Returns
Scalar value for that given position

Definition at line 140 of file WDataSetSingle.cpp.

References getSingleRawValue().

+ Here is the call graph for this function:

◆ getValueSet()

std::shared_ptr< WValueSetBase > WDataSetSingle::getValueSet ( ) const

◆ isTexture()

bool WDataSetSingle::isTexture ( ) const
virtual

Determines whether this dataset can be used as a texture.

Returns
true if usable as texture.

Reimplemented from WDataSet.

Reimplemented in WDataSetVector, and WDataSetSphericalHarmonics.

Definition at line 107 of file WDataSetSingle.cpp.

References m_texture.

Member Data Documentation

◆ m_grid

std::shared_ptr< WGrid > WDataSetSingle::m_grid
protected

◆ m_prototype

std::shared_ptr< WPrototyped > WDataSetSingle::m_prototype = std::shared_ptr< WPrototyped >()
staticprotected

The prototype as singleton.

Definition at line 205 of file WDataSetSingle.h.

Referenced by getPrototype().

◆ m_texture

osg::ref_ptr< WDataTexture3D > WDataSetSingle::m_texture
private

The 3D texture representing this dataset.

Definition at line 221 of file WDataSetSingle.h.

Referenced by getTexture(), isTexture(), and WDataSetSingle().

◆ m_valueSet

std::shared_ptr< WValueSetBase > WDataSetSingle::m_valueSet
protected

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