MeVisLab Toolbox Reference
|
Namespace with a collection of converter tools between the libraries Open Inventor and PCL. More...
Enumerations | |
enum | PCLMFVecStorageTypes { StoreIntensitReplacementAsRGB = 0 , StoreIntensitReplacementAsRGBA , UseOnlyRGBA , CopyFromData , CopyFromData_n , CopyDataAndData_n } |
Describes the way how data combinations of a point cloud are stored in an OpenInventor MFVec field. More... | |
Functions | |
void | setOneMFVecFieldValue (SbVec2f *dstVal, const float data[4]) |
Writes data[0] and data[1] to dstVal; data[2] and data[3] are ignored. | |
void | setOneMFVecFieldValue (SbVec2f *dstVal, const unsigned int *) |
Implemented for completeness to match all possible template variant, which, however, is not clearly defined, thus it writes (0.f, 0.f) into all entries of *dstVal. | |
void | setOneMFVecFieldValue (SbVec2f *dstVal, float data) |
Writes data in the two components of the idx'th value of mField. | |
void | setOneMFVecFieldValue (SbVec3f *dstVal, const float data[4]) |
Writes data[0], data[1], and data[2] to dstVal; data[3] is ignored. | |
void | setOneMFVecFieldValue (SbVec3f *dstVal, const unsigned int *) |
Implemented for completeness to match all possible template variant, which, however, is not clearly defined, thus it writes (0.f, 0.f, 0.f) into all entries of *dstVal. | |
void | setOneMFVecFieldValue (SbVec3f *dstVal, float data) |
Writes data in all three components of the idx'th value of mField. | |
void | setOneMFVecFieldValue (MLuint32 *dstVal, const float data) |
Special version writing a float to be from [0,256[ as RGBA value with same components into the idx'th value of mField. | |
void | setOneMFVecFieldValue (MLuint32 *dstVal, const float data[4]) |
Writes data[0] - data[3] into the idx'th value of mField, data must have at least four values; all other arguments are ignored. | |
void | setOneMFVecFieldValue (MLuint32 *dstVal, const unsigned int *rgbaVal) |
Writes swapped *rgbaVal into *dstVal. | |
template<typename DST_VAL_TYPE > | |
void | setOneMFVecFieldValueFromPoint (DST_VAL_TYPE *dstVal, const SpecializedPCLPointXYZ &pnt, bool useData_n) |
Explicit case for PointXYZ (which does not have data_n members) to copy pnt.data[0-2] or pnt.data_n[0-2] dependent on useData_n to dstVal; for useData_n == TRUE (0,0,0) is written. | |
template<typename POINT_TYPE , typename DST_VAL_TYPE > | |
void | setOneMFVecFieldValueFromPoint (DST_VAL_TYPE *dstVal, const POINT_TYPE &pnt, bool useData_n) |
Generic function to copy pnt.data[0-2] or pnt.data_n[0-2] (dependent on useData_n) to dstVal. | |
template<typename DST_VAL_TYPE > | |
void | setTwoMFVecFieldValuesFromPoint (DST_VAL_TYPE *dstVal, const SpecializedPCLPointXYZ &pnt) |
Explicit case for pclPointXYZ which copies pnt.data[0-2] to dstVal and dstVal+1. | |
template<typename POINT_TYPE , typename DST_VAL_TYPE > | |
void | setTwoMFVecFieldValuesFromPoint (DST_VAL_TYPE *dstVal, const POINT_TYPE &pnt) |
Generic function to copy data[0-2] to dstVal and data[0-2}+data_n[0-2] to dstVal+1. | |
MLPCL_InventorAdapters_EXPORT void | getRainbowRGB_From0_to_1 (float intensity, float retRGB[3]) |
Maps an intensity value from [0,1] to an RGB rainbow value where 0 is mapped to red increasing to green and finally to blue and violet; values outside [0,1] are clamped to the interval borders. | |
template<typename POINT_CLOUD_TYPE , typename SM_MF_VEC_FIELD_TYPE > | |
size_t | setMFVecFromPointCloud (const POINT_CLOUD_TYPE &pointCloud, SM_MF_VEC_FIELD_TYPE &mfvecField, PCLMFVecStorageTypes storageType, bool duplicateColors=false, bool mapToRainbow=false, bool useCurvatureForColor=false, bool scaleFromInputRange=false, float inRangeMin=0.f, float inRangeMax=1.f) |
Converts the point cloud to an Inventor SoMFVec2f, SoMFVec3f, or SoMFUInt32 field; it does not necessarily touch the modified field since it uses Inventor field editing. | |
MLPCL_InventorAdapters_EXPORT void | setVertices (const std::vector< pcl::Vertices > &verticesVector, SoMFInt32 &mfIntField, bool terminateWithMinusOne) |
For each entry of verticesVector all indexes of are appended mfIntField and - if terminateWithMinusOne is true - a -1 is also appended. | |
Namespace with a collection of converter tools between the libraries Open Inventor and PCL.
Describes the way how data combinations of a point cloud are stored in an OpenInventor MFVec field.
Definition at line 204 of file mlPCLInventorTools.h.
MLPCL_InventorAdapters_EXPORT void ml::PCLInventorTools::getRainbowRGB_From0_to_1 | ( | float | intensity, |
float | retRGB[3] ) |
Maps an intensity value from [0,1] to an RGB rainbow value where 0 is mapped to red increasing to green and finally to blue and violet; values outside [0,1] are clamped to the interval borders.
References getRainbowRGB_From0_to_1().
Referenced by getRainbowRGB_From0_to_1(), and setMFVecFromPointCloud().
|
inline |
Converts the point cloud to an Inventor SoMFVec2f, SoMFVec3f, or SoMFUInt32 field; it does not necessarily touch the modified field since it uses Inventor field editing.
pointCloud | The point cloud whose point coordinates data or data_n shall be written into mfvecField. |
mfvecField | Must be a SoMFVec2f, SoMFVec3f, or SoMFUInt32. It is the MField into which the data entries from the pointCloud shall be transferred. mfvecField will be resized to the number of written points or to zero if pointCloud is nullptr or empty. |
storageType | Describes how members of the points are are copied into the mfvecFields, see PCLMFVecStorageTypes for details. |
duplicateColors | If true and storageType is StoreIntensityReplacement, then each color is added twice, i.e. the double number of entries is created. Ignored in all other modes. |
mapToRainbow | If true and an intensity is converted to RGB[a], then is is not scaled to same red/green/blue but to a rainbow color map. |
useCurvatureForColor | If true then the curvature value is used to determine RGB values (even is otherwise the normal intensity replacement is used). |
scaleFromInputRange | If true then the values are scaled from input range to [0,1] before mapping them to corresponding ranges; if false it is assumed that they are already from that range. |
inRangeMin | ignored if scaleFromInputRange is false, otherwise the interval minimum to scale incoming values from. Must be smaller than inRangeMax or unpredictable error may occur. |
inRangeMax | ignored if scaleFromInputRange is false, otherwise the interval maximum to scale incoming values from. Must be larger than inRangeMin or unpredictable error may occur. |
Definition at line 255 of file mlPCLInventorTools.h.
References CopyDataAndData_n, CopyFromData, CopyFromData_n, getRainbowRGB_From0_to_1(), ML_BAD_PARAMETER, ML_PRINT_ERROR, mlrange_cast(), setMFVecFromPointCloud(), setOneMFVecFieldValue(), setOneMFVecFieldValueFromPoint(), setTwoMFVecFieldValuesFromPoint(), StoreIntensitReplacementAsRGB, StoreIntensitReplacementAsRGBA, and UseOnlyRGBA.
Referenced by setMFVecFromPointCloud().
Special version writing a float to be from [0,256[ as RGBA value with same components
into the idx'th value of mField.
dstVal | destination value in which data is written as rgba. |
data | the input value to be converted to rgba before writing it to dstVal. |
Definition at line 116 of file mlPCLInventorTools.h.
References setOneMFVecFieldValue().
Writes data[0] - data[3] into the idx'th value of mField, data must have at least four values; all other arguments are ignored.
dstVal | destination value in which data[0-3] are converted as components. |
data | the input values to be converted to the four UInt32 colour components. |
Definition at line 128 of file mlPCLInventorTools.h.
References setOneMFVecFieldValue().
|
inline |
Writes swapped *rgbaVal into *dstVal.
Definition at line 139 of file mlPCLInventorTools.h.
References setOneMFVecFieldValue().
Writes data[0] and data[1] to dstVal; data[2] and data[3] are ignored.
dstVal | destination value in which data[0] and data[1] are written. |
data | provides the two input values to be written at dstVal. |
Definition at line 42 of file mlPCLInventorTools.h.
References setOneMFVecFieldValue().
Referenced by setMFVecFromPointCloud(), setOneMFVecFieldValue(), setOneMFVecFieldValue(), setOneMFVecFieldValue(), setOneMFVecFieldValue(), setOneMFVecFieldValue(), setOneMFVecFieldValue(), setOneMFVecFieldValue(), setOneMFVecFieldValue(), setOneMFVecFieldValue(), setOneMFVecFieldValueFromPoint(), setOneMFVecFieldValueFromPoint(), setTwoMFVecFieldValuesFromPoint(), and setTwoMFVecFieldValuesFromPoint().
Implemented for completeness to match all possible template variant, which, however, is not clearly defined, thus it writes (0.f, 0.f) into all entries of *dstVal.
dstVal | destination value in which 0 and 0 are written; Arguments rgbaVal is ignored. |
Definition at line 53 of file mlPCLInventorTools.h.
References setOneMFVecFieldValue().
Writes data in the two components of the idx'th value of mField.
dstVal | destination value in which data is written two times. |
data | the input value to be written in each of the two components of dstVal. |
Definition at line 63 of file mlPCLInventorTools.h.
References setOneMFVecFieldValue().
Writes data[0], data[1], and data[2] to dstVal; data[3] is ignored.
dstVal | destination value in which data[0], data[1], and data[2] are written. |
data | provides the three input values to be written at dstVal. |
Definition at line 78 of file mlPCLInventorTools.h.
References setOneMFVecFieldValue().
Implemented for completeness to match all possible template variant, which, however, is not clearly defined, thus it writes (0.f, 0.f, 0.f) into all entries of *dstVal.
dstVal | destination value in which 0, 0, and 0 are written; Arguments rgbaVal is ignored. |
Definition at line 89 of file mlPCLInventorTools.h.
References setOneMFVecFieldValue().
Writes data in all three components of the idx'th value of mField.
dstVal | destination value in which data is written three times. |
data | the input value to be written in each of the three components of dstVal. |
Definition at line 99 of file mlPCLInventorTools.h.
References setOneMFVecFieldValue().
|
inline |
Generic function to copy pnt.data[0-2] or pnt.data_n[0-2] (dependent on useData_n) to dstVal.
Definition at line 174 of file mlPCLInventorTools.h.
References setOneMFVecFieldValue(), and setOneMFVecFieldValueFromPoint().
|
inline |
Explicit case for PointXYZ (which does not have data_n members) to copy pnt.data[0-2] or pnt.data_n[0-2] dependent on useData_n to dstVal; for useData_n == TRUE (0,0,0) is written.
Definition at line 164 of file mlPCLInventorTools.h.
References setOneMFVecFieldValue(), and setOneMFVecFieldValueFromPoint().
Referenced by setMFVecFromPointCloud(), setOneMFVecFieldValueFromPoint(), and setOneMFVecFieldValueFromPoint().
|
inline |
Generic function to copy data[0-2] to dstVal and data[0-2}+data_n[0-2] to dstVal+1.
Definition at line 193 of file mlPCLInventorTools.h.
References setOneMFVecFieldValue(), and setTwoMFVecFieldValuesFromPoint().
|
inline |
Explicit case for pclPointXYZ which copies pnt.data[0-2] to dstVal and dstVal+1.
Definition at line 183 of file mlPCLInventorTools.h.
References setOneMFVecFieldValue(), and setTwoMFVecFieldValuesFromPoint().
Referenced by setMFVecFromPointCloud(), setTwoMFVecFieldValuesFromPoint(), and setTwoMFVecFieldValuesFromPoint().
MLPCL_InventorAdapters_EXPORT void ml::PCLInventorTools::setVertices | ( | const std::vector< pcl::Vertices > & | verticesVector, |
SoMFInt32 & | mfIntField, | ||
bool | terminateWithMinusOne ) |
For each entry of verticesVector all indexes of are appended mfIntField and - if terminateWithMinusOne is true - a -1 is also appended.
If the number of allowed entries in mfIntField is exceeded then the maximum possible indexes is transferred, the the rest is skipped and an ML error is posted.
References setVertices().
Referenced by setVertices().