OpenWalnut  1.4.0
Public Types | Public Member Functions | Protected Attributes | Private Member Functions
WValueSetBase Class Reference

Abstract base class to all WValueSets. More...

#include <WValueSetBase.h>

+ Inheritance diagram for WValueSetBase:

List of all members.

Public Types

typedef boost::shared_ptr
< WValueSetBase
SPtr
 Shared pointer to an instance of this class.
typedef boost::shared_ptr
< const WValueSetBase
ConstSPtr
 Shared pointer to an const instance of this class.

Public Member Functions

 WValueSetBase (size_t order, size_t dimension, dataType inDataType)
 Despite this is an abstract class all subclasses should have an order and dimension.
virtual ~WValueSetBase ()=0
 Dummy since each class with virtual member functions needs one.
virtual size_t size () const =0
virtual size_t rawSize () const =0
virtual double getScalarDouble (size_t i) const =0
virtual WValue< double > getWValueDouble (size_t i) const =0
virtual size_t dimension () const
virtual size_t order () const
virtual size_t elementsPerValue () const
 Returns the number of elements of type T per value.
virtual dataType getDataType () const
virtual double getMinimumValue () const =0
 This method returns the smallest value in the valueset.
virtual double getMaximumValue () const =0
 This method returns the largest value in the valueset.
template<typename Func_T >
Func_T::result_type applyFunction (Func_T const &func)
 Apply a function object to this valueset.

Protected Attributes

const size_t m_order
 The order of the tensors for this ValueSet.
const size_t m_dimension
 The dimension of the tensors for this ValueSet.
const dataType m_dataType
 The data type of the values' elements.

Private Member Functions

virtual WValueSetVariant const getVariant () const
 Creates a boost::variant reference.

Detailed Description

Abstract base class to all WValueSets.

This class doesn't provide any genericness.

Definition at line 59 of file WValueSetBase.h.


Member Typedef Documentation

typedef boost::shared_ptr< const WValueSetBase > WValueSetBase::ConstSPtr

Shared pointer to an const instance of this class.

Definition at line 70 of file WValueSetBase.h.

typedef boost::shared_ptr< WValueSetBase > WValueSetBase::SPtr

Shared pointer to an instance of this class.

Definition at line 65 of file WValueSetBase.h.


Constructor & Destructor Documentation

WValueSetBase::WValueSetBase ( size_t  order,
size_t  dimension,
dataType  inDataType 
)

Despite this is an abstract class all subclasses should have an order and dimension.

Parameters:
orderthe tensor order of the values stored in this WValueSet
dimensionthe tensor dimension of the values stored in this WValueSet
inDataTypeindication of the primitive data type used to store the values

Definition at line 31 of file WValueSetBase.cpp.

WValueSetBase::~WValueSetBase ( ) [pure virtual]

Dummy since each class with virtual member functions needs one.

Definition at line 40 of file WValueSetBase.cpp.


Member Function Documentation

template<typename Func_T >
Func_T::result_type WValueSetBase::applyFunction ( Func_T const &  func) [inline]

Apply a function object to this valueset.

Template Parameters:
Func_TThe type of the function object, should be derived from the boost::static_visitor template.
Parameters:
funcThe function object to apply.
Returns:
The result of the operation.

Definition at line 167 of file WValueSetBase.h.

References getVariant().

virtual size_t WValueSetBase::dimension ( ) const [inline, virtual]
Returns:
Dimension of the values in this ValueSet

Definition at line 111 of file WValueSetBase.h.

References m_dimension.

Referenced by WValueSet< T >::getRequiredRawSizePerVoxel(), and WValueSetBaseTest::testDimension().

virtual size_t WValueSetBase::elementsPerValue ( ) const [inline, virtual]

Returns the number of elements of type T per value.

Notes:
this is dimension to the power of order.
Returns:
number of elements per value

Definition at line 129 of file WValueSetBase.h.

References m_dimension, and m_order.

virtual dataType WValueSetBase::getDataType ( ) const [inline, virtual]
Returns:
Dimension of the values in this ValueSet

Definition at line 137 of file WValueSetBase.h.

References m_dataType.

Referenced by WValueSetBaseTest::testDataType().

virtual double WValueSetBase::getMaximumValue ( ) const [pure virtual]

This method returns the largest value in the valueset.

It does not handle vectors, matrices and so on well. It simply returns the largest value in the data array. This is especially useful for texture scaling or other statistic tools (histograms).

Returns:
the largest value in the data.

Implemented in WValueSet< T >, and Dummy.

virtual double WValueSetBase::getMinimumValue ( ) const [pure virtual]

This method returns the smallest value in the valueset.

It does not handle vectors, matrices and so on well. It simply returns the smallest value in the data array. This is especially useful for texture scaling or other statistic tools (histograms).

Returns:
the smallest value in the data.

Implemented in WValueSet< T >, and Dummy.

virtual double WValueSetBase::getScalarDouble ( size_t  i) const [pure virtual]
Parameters:
iid of the scalar to retrieve
Returns:
The i-th scalar stored in this value set. There are rawSize() such scalars.

Implemented in WValueSet< T >, and Dummy.

Referenced by WValueSetHistogram::buildHistogram().

virtual WValueSetVariant const WValueSetBase::getVariant ( ) const [inline, private, virtual]

Creates a boost::variant reference.

Returns:
var A pointer to a variant reference to the valueset.

Reimplemented in WValueSet< T >.

Definition at line 194 of file WValueSetBase.h.

Referenced by applyFunction().

virtual WValue< double > WValueSetBase::getWValueDouble ( size_t  i) const [pure virtual]
Parameters:
iid of the WValue to retrieve
Returns:
The i-th WValue stored in this value set. There are size() such scalars.

Implemented in WValueSet< T >, and Dummy.

virtual size_t WValueSetBase::order ( ) const [inline, virtual]
Returns:
Order of the values in this ValueSet

Definition at line 119 of file WValueSetBase.h.

References m_order.

virtual size_t WValueSetBase::rawSize ( ) const [pure virtual]
Returns:
The number of integrals (POD like int, double) in this ValueSet.

Implemented in WValueSet< T >, and Dummy.

virtual size_t WValueSetBase::size ( ) const [pure virtual]
Returns:
The number of tensors in this ValueSet.

Implemented in WValueSet< T >, and Dummy.

Referenced by WValueSetHistogram::buildHistogram().


Member Data Documentation

The data type of the values' elements.

Definition at line 186 of file WValueSetBase.h.

Referenced by getDataType().

The dimension of the tensors for this ValueSet.

Definition at line 181 of file WValueSetBase.h.

Referenced by dimension(), elementsPerValue(), WValueSet< T >::getVector3D(), WValueSet< T >::getWValue(), and WValueSet< T >::size().

const size_t WValueSetBase::m_order [protected]

The order of the tensors for this ValueSet.

Definition at line 176 of file WValueSetBase.h.

Referenced by elementsPerValue(), WValueSet< T >::getVector3D(), WValueSet< T >::getWValue(), order(), and WValueSet< T >::size().


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