OpenWalnut  1.2.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Static Protected Attributes
WDataSetVector Class Reference

This data set type contains vectors as values. More...

#include <WDataSetVector.h>

+ Inheritance diagram for WDataSetVector:

List of all members.

Public Member Functions

 WDataSetVector (boost::shared_ptr< WValueSetBase > newValueSet, boost::shared_ptr< WGrid > newGrid)
 Constructs an instance out of an appropriate value set and a grid.
 WDataSetVector ()
 Construct an empty and unusable instance.
virtual ~WDataSetVector ()
 Destroys this DataSet instance.
virtual WDataSetSingle::SPtr clone (boost::shared_ptr< WValueSetBase > newValueSet) const
 Creates a copy (clone) of this instance but allows to change the valueset.
virtual WDataSetSingle::SPtr clone (boost::shared_ptr< WGrid > newGrid) const
 Creates a copy (clone) of this instance but allows to change the grid.
virtual WDataSetSingle::SPtr clone () const
 Creates a copy (clone) of this instance.
WVector3d interpolate (const WPosition &pos, bool *success) const
 Interpolates the vector field at the given position.
WVector3d eigenVectorInterpolate (const WPosition &pos, bool *success) const
 Interpolates the very same way as interpolate but it assures that all vecs are aligned to point into the same half-space.
WVector3d getVectorAt (size_t index) const
 Get the vector on the given position in value set.
virtual bool isTexture () const
 Determines whether this dataset can be used as a texture.
boost::shared_ptr< WDataSetVectorisVectorDataSet ()
 Overwrites the isVectorDataSet check.
- Public Member Functions inherited from WDataSetSingle
 WDataSetSingle (boost::shared_ptr< WValueSetBase > newValueSet, boost::shared_ptr< WGrid > newGrid)
 Constructs an instance out of a value set and a grid.
 WDataSetSingle ()
 Construct an empty and unusable instance.
virtual ~WDataSetSingle ()
 Destroys this DataSet instance.
boost::shared_ptr< WValueSetBasegetValueSet () const
boost::shared_ptr< WGridgetGrid () const
template<typename T >
getValueAt (size_t id)
 Get the value stored at position of the value set.
double getValueAt (size_t id) const
 Get the value stored at position of the value set.
virtual osg::ref_ptr
< WDataTexture3D
getTexture () const
 Returns the texture representation of the dataset.
virtual const std::string getName () const
 Gets the name of this prototype.
virtual const std::string getDescription () const
 Gets the description for this prototype.
- Public Member Functions inherited from WDataSet
 WDataSet ()
 This constructor should be used if a dataSet does not stem from a file.
virtual ~WDataSet ()
 Since WDataSet is a base class and thus should be polymorphic we add virtual destructor.
void setFileName (const std::string fileName)
 Set the name of the file that this data set stems from.
std::string getFileName () const
 Get the name of the file that this data set stems from.
boost::shared_ptr< WPropertiesgetProperties () const
 Return a pointer to the properties object of the dataset.
boost::shared_ptr< WPropertiesgetInformationProperties () const
 Return a pointer to the information properties object of the dataset.
- Public Member Functions inherited from WTransferable
 WTransferable ()
 Default constructor.
virtual ~WTransferable ()
 Destructor.
- Public Member Functions inherited from WPrototyped
 WPrototyped ()
 Default constructor.
virtual ~WPrototyped ()
 Destructor.
template<typename T >
bool isA ()
 Checks whether the actual prototype has the specified runtime type.

Static Public Member Functions

static boost::shared_ptr
< WPrototyped
getPrototype ()
 Returns a prototype instantiated with the true type of the deriving class.

Static Protected Attributes

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

Additional Inherited Members

- Public Types inherited from WDataSetSingle
typedef boost::shared_ptr
< WDataSetSingle
SPtr
 Convenience typedef for a boost::shared_ptr.
typedef boost::shared_ptr
< const WDataSetSingle
ConstSPtr
 Convenience typedef for a boost::shared_ptr; const.
- Protected Attributes inherited from WDataSetSingle
boost::shared_ptr< WGridm_grid
 Stores the reference of the WGrid of this DataSetSingle instance.
boost::shared_ptr< WValueSetBasem_valueSet
 Stores the reference of the WValueSet of this DataSetSingle instance.
- Protected Attributes inherited from WDataSet
boost::shared_ptr< WPropertiesm_properties
 The property object for the dataset.
boost::shared_ptr< WPropertiesm_infoProperties
 The property object for the dataset containing only props whose purpose is "PV_PURPOSE_INFORMNATION".

Detailed Description

This data set type contains vectors as values.

Definition at line 35 of file WDataSetVector.h.


Constructor & Destructor Documentation

WDataSetVector::WDataSetVector ( boost::shared_ptr< WValueSetBase newValueSet,
boost::shared_ptr< WGrid newGrid 
)

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

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

Definition at line 39 of file WDataSetVector.cpp.

WDataSetVector::WDataSetVector ( )

Construct an empty and unusable instance.

This is needed for the prototype mechanism.

Definition at line 49 of file WDataSetVector.cpp.

Referenced by clone(), and getPrototype().

WDataSetVector::~WDataSetVector ( )
virtual

Destroys this DataSet instance.

Definition at line 54 of file WDataSetVector.cpp.


Member Function Documentation

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

Creates a copy (clone) of this instance but allows 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 from WDataSetSingle.

Definition at line 58 of file WDataSetVector.cpp.

References WDataSetSingle::getGrid(), and WDataSetVector().

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

Creates a copy (clone) of this instance but allows 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 from WDataSetSingle.

Definition at line 63 of file WDataSetVector.cpp.

References WDataSetSingle::getValueSet(), and WDataSetVector().

WDataSetSingle::SPtr WDataSetVector::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 from WDataSetSingle.

Definition at line 68 of file WDataSetVector.cpp.

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

WVector3d WDataSetVector::eigenVectorInterpolate ( const WPosition pos,
bool *  success 
) const

Interpolates the very same way as interpolate but it assures that all vecs are aligned to point into the same half-space.

This is useful for eigenvector fields, where -v, and v both are eigenvectors.

Parameters:
posPosition to interpolate a vector for
successreturn parameter which is true if pos was inside of the grid, false otherwise.
Returns:
The resulting interpolated vector.

Definition at line 153 of file WDataSetVector.cpp.

References getVectorAt(), WDataSetSingle::m_grid, and WDataSetSingle::m_valueSet.

Referenced by WDataSetVectorTest::testEigenVectorInterpolate().

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

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

Returns:
the prototype.

Reimplemented from WDataSetSingle.

Definition at line 73 of file WDataSetVector.cpp.

References m_prototype, and WDataSetVector().

WVector3d WDataSetVector::getVectorAt ( size_t  index) const

Get the vector on the given position in value set.

Notes:
currently only implmented for WVector3d
Parameters:
indexthe position where to get the vector from
Returns:
the vector

Definition at line 175 of file WDataSetVector.cpp.

References WDataSetSingle::getValueSet().

Referenced by eigenVectorInterpolate(), and interpolate().

WVector3d WDataSetVector::interpolate ( const WPosition pos,
bool *  success 
) const

Interpolates the vector field at the given position.

Parameters:
posposition to interpolate
successif the position was inside the grid
Returns:
Vector beeing the interpolate.

Definition at line 136 of file WDataSetVector.cpp.

References getVectorAt(), WDataSetSingle::m_grid, and WDataSetSingle::m_valueSet.

Referenced by WDataSetVectorTest::testBoundary_ticket313(), WDataSetVectorTest::testEigenVectorInterpolate(), and WDataSetVectorTest::testInterpolate().

bool WDataSetVector::isTexture ( ) const
virtual

Determines whether this dataset can be used as a texture.

Returns:
true if usable as texture.

Reimplemented from WDataSetSingle.

Definition at line 206 of file WDataSetVector.cpp.

boost::shared_ptr< WDataSetVector > WDataSetVector::isVectorDataSet ( )
inlinevirtual

Overwrites the isVectorDataSet check.

Returns:
Non empty reference to the dataset if it is a vector dataset, empty if not.

Reimplemented from WDataSet.

Definition at line 148 of file WDataSetVector.h.


Member Data Documentation

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

The prototype as singleton.

Reimplemented from WDataSetSingle.

Definition at line 143 of file WDataSetVector.h.

Referenced by getPrototype().


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