OpenWalnut
1.2.5
|
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. | |
Public Member Functions | |
WValueSet (size_t order, size_t dimension, const boost::shared_ptr< std::vector< T > > data, dataType inDataType) | |
Constructs a value set with values of type T. | |
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 |
virtual WVector_2 | getWVector (size_t i) const |
WVector3d | getVector3D (size_t index) const |
Get the i'th vector. | |
WValue< T > | getWValue (size_t index) const |
Get the i'th WValue with the dimension of WValueSet. | |
const T * | rawData () const |
Sometimes we need raw access to the data array, for e.g. | |
const std::vector< T > * | rawDataVectorPointer () const |
Sometimes we need raw access to the data vector. | |
SubArray const | getSubArray (std::size_t start, std::size_t size) const |
Request (read-) access object to a subarray of this valueset. | |
virtual double | getMinimumValue () const |
This method returns the smallest value in the valueset. | |
virtual double | getMaximumValue () const |
This method returns the largest value in the valueset. | |
Protected Attributes | |
T | m_minimum |
The smallest value in m_data. | |
T | m_maximum |
The largest value in m_data. | |
Private Member Functions | |
virtual WValueSetVariant const | getVariant () const |
Get a variant reference to this valueset (the reference is stored in the variant). | |
Private Attributes | |
const boost::shared_ptr < std::vector< T > > | m_data |
Stores the values of type T as simple array which never should be modified. | |
Friends | |
class | WValueSetTest |
Only UnitTests are allowed to be friends. |
Base Class for all value set types.
Definition at line 43 of file WValueSet.h.
The type of the single value in this value set.
Definition at line 54 of file WValueSet.h.
WValueSet< T >::WValueSet | ( | size_t | order, |
size_t | dimension, | ||
const boost::shared_ptr< std::vector< T > > | data, | ||
dataType | inDataType | ||
) | [inline] |
Constructs a value set with values of type T.
Sets order and dimension to allow to interprete 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 119 of file WValueSet.h.
References WValueSet< T >::m_maximum, WValueSet< T >::m_minimum, wlimits::MAX_DOUBLE, and wlimits::MIN_DOUBLE.
virtual double WValueSet< T >::getMaximumValue | ( | ) | const [inline, 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).
Implements WValueSetBase.
Definition at line 273 of file WValueSet.h.
References WValueSet< T >::m_maximum.
virtual double WValueSet< T >::getMinimumValue | ( | ) | const [inline, 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).
Implements WValueSetBase.
Definition at line 262 of file WValueSet.h.
References WValueSet< T >::m_minimum.
i | id of the scalar to retrieve |
Definition at line 168 of file WValueSet.h.
References WValueSet< T >::m_data.
Referenced by WDataSetSingle::getValueAt().
virtual double WValueSet< T >::getScalarDouble | ( | size_t | i | ) | const [inline, virtual] |
i | id of the scalar to retrieve |
Implements WValueSetBase.
Definition at line 177 of file WValueSet.h.
References WValueSet< T >::m_data.
SubArray const WValueSet< T >::getSubArray | ( | std::size_t | start, |
std::size_t | size | ||
) | const [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 249 of file WValueSet.h.
References WValueSet< T >::rawData(), and WValueSet< T >::rawSize().
virtual WValueSetVariant const WValueSet< T >::getVariant | ( | ) | const [inline, private, virtual] |
Get a variant reference to this valueset (the reference is stored in the variant).
Reimplemented from WValueSetBase.
Definition at line 300 of file WValueSet.h.
WVector3d WValueSet< T >::getVector3D | ( | size_t | index | ) | const |
Get the i'th vector.
index | the index number of the vector |
Definition at line 306 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 314 of file WValueSet.h.
References WValueSet< T >::m_data, WValueSetBase::m_dimension, WValueSetBase::m_order, and WValueSet< T >::size().
Referenced by WValueSet< T >::getWValueDouble(), WValueSet< T >::getWVector(), and WValueSetTest::testGetWValue().
virtual WValue< double > WValueSet< T >::getWValueDouble | ( | size_t | i | ) | const [inline, virtual] |
i | id of the WValue to retrieve |
Implements WValueSetBase.
Definition at line 186 of file WValueSet.h.
References WValueSet< T >::getWValue().
virtual WVector_2 WValueSet< T >::getWVector | ( | size_t | i | ) | const [inline, virtual] |
i | id of the WVector to retrieve |
Implements WValueSetBase.
Definition at line 195 of file WValueSet.h.
References WValueSet< T >::getWValue().
Sometimes we need raw access to the data array, for e.g.
OpenGL.
Definition at line 224 of file WValueSet.h.
References WValueSet< T >::m_data.
Referenced by WValueSet< T >::getSubArray(), and WValueSetTest::testReadOnlyRawAccess().
const std::vector< T >* WValueSet< T >::rawDataVectorPointer | ( | ) | const [inline] |
Sometimes we need raw access to the data vector.
Definition at line 234 of file WValueSet.h.
References WValueSet< T >::m_data.
Implements WValueSetBase.
Definition at line 159 of file WValueSet.h.
References WValueSet< T >::m_data, and WValueSet< T >::size().
Referenced by WValueSet< T >::getSubArray(), WValueSet< T >::size(), and WValueSetTest::testRawSize().
Implements WValueSetBase.
Definition at line 137 of file WValueSet.h.
References WValueSetBase::m_dimension, WValueSetBase::m_order, and WValueSet< T >::rawSize().
Referenced by WValueSet< T >::getWValue(), WValueSet< T >::rawSize(), WValueSetTest::testGetNumberOfValues(), WValueSetTest::testGetWValue(), and WValueSetHistogramTest::testSizes().
friend class WValueSetTest [friend] |
Only UnitTests are allowed to be friends.
Definition at line 48 of file WValueSet.h.
Stores the values of type T as simple array which never should be modified.
Definition at line 293 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().
The largest value in m_data.
Definition at line 287 of file WValueSet.h.
Referenced by WValueSet< T >::getMaximumValue(), WValueSetHistogramTest::testCopyWithIntervalChanges(), WValueSetHistogramTest::testCopyWithoutIntervalChanges(), and WValueSet< T >::WValueSet().
The smallest value in m_data.
Definition at line 282 of file WValueSet.h.
Referenced by WValueSet< T >::getMinimumValue(), WValueSetHistogramTest::testCopyWithIntervalChanges(), WValueSetHistogramTest::testCopyWithoutIntervalChanges(), and WValueSet< T >::WValueSet().