OpenWalnut
1.5.0dev
|
Base Class for all value set types. More...
#include <WValueSet.h>
Classes | |
class | SubArray |
A helper class granting safe access to a certain part of the valueset. More... | |
Public Types | |
typedef T | ValueT |
The type of the single value in this value set. More... | |
Public Types inherited from WValueSetBase | |
typedef std::shared_ptr< WValueSetBase > | SPtr |
Shared pointer to an instance of this class. More... | |
typedef std::shared_ptr< const WValueSetBase > | ConstSPtr |
Shared pointer to an const instance of this class. More... | |
Public Member Functions | |
WValueSet (size_t order, size_t dimension, const std::shared_ptr< std::vector< T > > data, dataType inDataType) | |
Constructs a value set with values of type T. More... | |
WValueSet (size_t order, size_t dimension, const std::shared_ptr< std::vector< T > > data) | |
Constructs a value set with values of type T. More... | |
virtual size_t | size () const |
virtual size_t | rawSize () const |
virtual T | getScalar (size_t i) const |
virtual double | getScalarDouble (size_t i) const |
virtual WValue< double > | getWValueDouble (size_t i) const |
WVector3d | getVector3D (size_t index) const |
Get the i'th vector. More... | |
WValue< T > | getWValue (size_t index) const |
Get the i'th WValue with the dimension of WValueSet. More... | |
const T * | rawData () const |
Sometimes we need raw access to the data array, for e.g. More... | |
const std::vector< T > * | rawDataVectorPointer () const |
Sometimes we need raw access to the data vector. More... | |
SubArray const | getSubArray (std::size_t start, std::size_t size) const |
Request (read-) access object to a subarray of this valueset. More... | |
virtual double | getMinimumValue () const |
This method returns the smallest value in the valueset. More... | |
virtual double | getMaximumValue () const |
This method returns the largest value in the valueset. More... | |
Public Member Functions inherited from WValueSetBase | |
WValueSetBase (size_t order, size_t dimension, dataType inDataType) | |
Despite this is an abstract class all subclasses should have an order and dimension. More... | |
virtual | ~WValueSetBase ()=0 |
Dummy since each class with virtual member functions needs one. More... | |
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. More... | |
virtual dataType | getDataType () const |
template<typename Func_T > | |
Func_T::result_type | applyFunction (Func_T const &func) |
Apply a function object to this valueset. More... | |
Static Public Member Functions | |
static size_t | getRequiredRawSizePerVoxel (size_t oder, size_t dimension) |
Calculates the needed number of integral values for a valueset with specified order and dimension for one voxel. More... | |
Protected Attributes | |
T | m_minimum |
The smallest value in m_data. More... | |
T | m_maximum |
The largest value in m_data. More... | |
Protected Attributes inherited from WValueSetBase | |
const size_t | m_order |
The order of the tensors for this ValueSet. More... | |
const size_t | m_dimension |
The dimension of the tensors for this ValueSet. More... | |
const dataType | m_dataType |
The data type of the values' elements. More... | |
Private Member Functions | |
virtual WValueSetVariant const | getVariant () const |
Get a variant reference to this valueset (the reference is stored in the variant). More... | |
Private Attributes | |
const std::shared_ptr< std::vector< T > > | m_data |
Stores the values of type T as simple array which never should be modified. More... | |
Friends | |
class | WValueSetTest |
Only UnitTests are allowed to be friends. More... | |
Base Class for all value set types.
forward declaration
Definition at line 46 of file WValueSet.h.
The type of the single value in this value set.
Definition at line 57 of file WValueSet.h.
|
inline |
Constructs a value set with values of type T.
Sets order and dimension to allow to interpret the values as tensors of a certain order and dimension.
order | tensor order of values stored in the value set |
dimension | tensor dimension of values stored in the value set |
data | the vector holding the raw data |
inDataType | indicator telling us which dataType comes in |
Definition at line 122 of file WValueSet.h.
References WValueSet< T >::m_maximum, and WValueSet< T >::m_minimum.
|
inline |
Constructs a value set with values of type T.
Sets order and dimension to allow to interpret the values as tensors of a certain order and dimension.
order | tensor order of values stored in the value set |
dimension | tensor dimension of values stored in the value set |
data | the vector holding the raw data |
Definition at line 144 of file WValueSet.h.
References WValueSet< T >::m_maximum, and WValueSet< T >::m_minimum.
|
inlinevirtual |
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).
Implements WValueSetBase.
Definition at line 289 of file WValueSet.h.
References WValueSet< T >::m_maximum.
Referenced by WSegmentationAlgoThreshold::operator()().
|
inlinevirtual |
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).
Implements WValueSetBase.
Definition at line 278 of file WValueSet.h.
References WValueSet< T >::m_minimum.
Referenced by WSegmentationAlgoThreshold::operator()().
|
static |
Calculates the needed number of integral values for a valueset with specified order and dimension for one voxel.
The whole dataset will then be as large as the number of voxels multiplied by this value.
oder | desired tensor order. |
dimension | desired dimension. |
Definition at line 357 of file WValueSet.h.
References WValueSetBase::dimension().
|
inlinevirtual |
i | id of the scalar to retrieve |
Definition at line 193 of file WValueSet.h.
References WValueSet< T >::m_data.
Referenced by WSegmentationAlgoThreshold::operator()().
|
inlinevirtual |
i | id of the scalar to retrieve |
Implements WValueSetBase.
Definition at line 202 of file WValueSet.h.
References WValueSet< T >::m_data.
|
inline |
Request (read-) access object to a subarray of this valueset.
The object returned by this function can be used as an array ( starting at index 0 ), whose elements are the data elements at positions start to ( including ) start + size - 1 of the valueset.
start | The position of the first element of the subarray. |
size | The number of elements in the subarray. |
Definition at line 265 of file WValueSet.h.
References WValueSet< T >::rawData(), WValueSet< T >::rawSize(), and WValueSet< T >::size().
|
inlineprivatevirtual |
Get a variant reference to this valueset (the reference is stored in the variant).
Reimplemented from WValueSetBase.
Definition at line 326 of file WValueSet.h.
Get the i'th vector.
index | the index number of the vector |
Definition at line 332 of file WValueSet.h.
References WValueSet< T >::m_data, WValueSetBase::m_dimension, and WValueSetBase::m_order.
Get the i'th WValue with the dimension of WValueSet.
index | the index number of the WValue |
Definition at line 340 of file WValueSet.h.
References WValueSet< T >::m_data, WValueSetBase::m_dimension, WValueSetBase::m_order, and WValueSet< T >::size().
Referenced by WValueSet< T >::getWValueDouble().
|
inlinevirtual |
i | id of the WValue to retrieve |
Implements WValueSetBase.
Definition at line 211 of file WValueSet.h.
References WValueSet< T >::getWValue().
|
inline |
Sometimes we need raw access to the data array, for e.g.
OpenGL.
Definition at line 240 of file WValueSet.h.
References WValueSet< T >::m_data.
Referenced by WValueSet< T >::getSubArray(), and VisitorVSetB< VSetAType >::operator()().
|
inline |
Sometimes we need raw access to the data vector.
Definition at line 250 of file WValueSet.h.
References WValueSet< T >::m_data.
|
inlinevirtual |
Implements WValueSetBase.
Definition at line 184 of file WValueSet.h.
References WValueSet< T >::m_data.
Referenced by WValueSet< T >::getSubArray(), VisitorVSetB< VSetAType >::operator()(), and WValueSet< T >::size().
|
inlinevirtual |
Implements WValueSetBase.
Definition at line 162 of file WValueSet.h.
References WValueSetBase::m_dimension, WValueSetBase::m_order, and WValueSet< T >::rawSize().
Referenced by WValueSet< T >::getSubArray(), WValueSet< T >::getWValue(), and WSegmentationAlgoThreshold::operator()().
|
friend |
Only UnitTests are allowed to be friends.
Definition at line 51 of file WValueSet.h.
|
private |
Stores the values of type T as simple array which never should be modified.
Definition at line 319 of file WValueSet.h.
Referenced by WValueSet< T >::getScalar(), WValueSet< T >::getScalarDouble(), WValueSet< T >::getVector3D(), WValueSet< T >::getWValue(), WValueSet< T >::rawData(), WValueSet< T >::rawDataVectorPointer(), and WValueSet< T >::rawSize().
|
protected |
The largest value in m_data.
Definition at line 313 of file WValueSet.h.
Referenced by WValueSet< T >::getMaximumValue(), and WValueSet< T >::WValueSet().
|
protected |
The smallest value in m_data.
Definition at line 308 of file WValueSet.h.
Referenced by WValueSet< T >::getMinimumValue(), and WValueSet< T >::WValueSet().