#include <vlvoxelopvalue.h>
Public Member Functions | |
| vlVoxelOpValue () | |
| Default constructor. | |
| ~vlVoxelOpValue () | |
| Default destructor. | |
| int32 | i () const |
| uint32 | ui () const |
| double | dl () const |
| vlVector3f | vector3f () const |
| vlNormal3f | normal3f () const |
| vlColor4f | color4f () const |
| vlColor4ub | color4ub () const |
| vlColor4us | color4us () const |
| uint8 * | ptr (bool autoDelete=true) const |
| Returns the pointer stored. | |
| void | setI (const int32 &value) |
| void | setUi (const uint32 &value) |
| void | setDl (const double &value) |
| void | setVector3f (const vlVector3f &value) |
| void | setNormal3f (const vlNormal3f &value) |
| void | setColor4f (const vlColor4f &value) |
| void | setColor4ub (const vlColor4ub &value) |
| void | setColor4us (const vlColor4us &value) |
| void | setPtr (uint8 *ptr) |
Protected Types | |
| enum | ReturnType { Int32 = 0x0001, UInt32 = 0x0002, Double = 0x0004, Vector3f = 0x0008, Normal3f = 0x0010, Color4f = 0x0020, Color4ub = 0x0040, Color4us = 0x0080, Pointer = 0x0100 } |
| The type of data stored in the class. More... | |
Protected Attributes | |
| vlVoxelOpValue::ReturnData_ | m_realValue |
| Use union to save some space. | |
| vlVector3f | m_vector3f |
| vlNormal3f | m_normal3f |
| vlColor4f | m_color4f |
| vlColor4ub | m_color4ub |
| vlColor4us | m_color4us |
| int | m_datatype |
| bool | m_autoDelete |
| Decides if to delete pointer or not when this object is deleted. Default is true. | |
If you are now thinking this is a hack: Yes, it is a hack.. but a pretty good one I think. This is the best solution I thought of to overcome this C++ limitation. It ofcourse has the drawback that the return value is not typesafe and thus it is easy for the user to access the wrong data. To solve this problem to a certain extent, we return a 0 if the user is trying to access wrong datatype. For example, if the voxel operator stores an int value and the user uses dl() function to access the value, a 0 will be returned. We ofcourse assume that the user knows what data the operator is returning. This is a fair assumption because unless the user knows the datatype of the data being returned by the operator, he/she cannot really use it anyway.
Definition at line 63 of file vlvoxelopvalue.h.
|
|
Definition at line 182 of file vlvoxelopvalue.h. |
|
|
Definition at line 66 of file vlvoxelopvalue.h. References m_autoDelete, m_color4ub, m_color4us, and m_datatype. |
|
|
Definition at line 73 of file vlvoxelopvalue.h. References m_autoDelete, m_datatype, m_realValue, Pointer, and vlVoxelOpValue::ReturnData_::ptr. |
|
|
Definition at line 112 of file vlvoxelopvalue.h. References m_color4f. |
|
|
Definition at line 117 of file vlvoxelopvalue.h. References m_color4ub. |
|
|
Definition at line 122 of file vlvoxelopvalue.h. References m_color4us. |
|
|
Definition at line 94 of file vlvoxelopvalue.h. References vlVoxelOpValue::ReturnData_::dl, Double, m_datatype, and m_realValue. Referenced by vlVolProcessorSobel::runT(), and vlVolProcessorCentralDiff::runT(). |
|
|
Definition at line 78 of file vlvoxelopvalue.h. References vlVoxelOpValue::ReturnData_::i32, Int32, int32, m_datatype, and m_realValue. |
|
|
Definition at line 107 of file vlvoxelopvalue.h. References m_normal3f. |
|
|
If no pointer is stored, returns 0L.
Definition at line 135 of file vlvoxelopvalue.h. References m_autoDelete, m_datatype, m_realValue, Pointer, vlVoxelOpValue::ReturnData_::ptr, and uint8. |
|
|
Definition at line 154 of file vlvoxelopvalue.h. References Color4f, m_color4f, and m_datatype. |
|
|
Definition at line 156 of file vlvoxelopvalue.h. References Color4ub, m_color4ub, and m_datatype. |
|
|
Definition at line 158 of file vlvoxelopvalue.h. References Color4us, m_color4us, and m_datatype. |
|
|
Definition at line 148 of file vlvoxelopvalue.h. References vlVoxelOpValue::ReturnData_::dl, Double, m_datatype, and m_realValue. Referenced by vlVoxelOpSobel< DataType, Layout >::getValue(), and vlVoxelOpCentralDiff< DataType, Layout >::getValue(). |
|
|
Definition at line 144 of file vlvoxelopvalue.h. References vlVoxelOpValue::ReturnData_::i32, Int32, m_datatype, and m_realValue. |
|
|
Definition at line 152 of file vlvoxelopvalue.h. References m_datatype, m_normal3f, and Normal3f. Referenced by vlVoxelOpSobel< DataType, Layout >::getValue(), and vlVoxelOpCentralDiff< DataType, Layout >::getValue(). |
|
|
Definition at line 160 of file vlvoxelopvalue.h. References m_datatype, m_realValue, Pointer, and vlVoxelOpValue::ReturnData_::ptr. |
|
|
Definition at line 146 of file vlvoxelopvalue.h. References m_datatype, m_realValue, vlVoxelOpValue::ReturnData_::ui32, and UInt32. |
|
|
Definition at line 150 of file vlvoxelopvalue.h. References m_datatype, m_vector3f, and Vector3f. |
|
|
Definition at line 86 of file vlvoxelopvalue.h. References m_datatype, m_realValue, vlVoxelOpValue::ReturnData_::ui32, UInt32, and uint32. |
|
|
Definition at line 102 of file vlvoxelopvalue.h. References m_vector3f. |
|
|
Definition at line 197 of file vlvoxelopvalue.h. Referenced by ptr(), vlVoxelOpValue(), and ~vlVoxelOpValue(). |
|
|
Definition at line 177 of file vlvoxelopvalue.h. Referenced by color4f(), and setColor4f(). |
|
|
Definition at line 178 of file vlvoxelopvalue.h. Referenced by color4ub(), setColor4ub(), and vlVoxelOpValue(). |
|
|
Definition at line 179 of file vlvoxelopvalue.h. Referenced by color4us(), setColor4us(), and vlVoxelOpValue(). |
|
|
Definition at line 194 of file vlvoxelopvalue.h. Referenced by dl(), i(), ptr(), setColor4f(), setColor4ub(), setColor4us(), setDl(), setI(), setNormal3f(), setPtr(), setUi(), setVector3f(), ui(), vlVoxelOpValue(), and ~vlVoxelOpValue(). |
|
|
Definition at line 176 of file vlvoxelopvalue.h. Referenced by normal3f(), and setNormal3f(). |
|
|
Other datatypes cannot be kept here because C++ does not allow storage of user defined datatypes with non-trivial constructor, destrcutor inside unions. Referenced by dl(), i(), ptr(), setDl(), setI(), setPtr(), setUi(), ui(), and ~vlVoxelOpValue(). |
|
|
Definition at line 175 of file vlvoxelopvalue.h. Referenced by setVector3f(), and vector3f(). |
1.3.3