00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _SO_DATA_RANGE__
00026 #define _SO_DATA_RANGE__
00027
00028 #include <Inventor/nodes/SoNode.h>
00029 #include <Inventor/fields/SoSFDouble.h>
00030 #include <Inventor/fields/SoSFBool.h>
00031 #include <Inventor/fields/SoSFInt32.h>
00032
00033 #include <LDM/nodes/SoDataSet.h>
00034 #include <Inventor/algorithms/SoConversion.h>
00035
00192 class SoDataRange : public SoNode {
00193 SO_NODE_HEADER( SoDataRange );
00194
00195 public:
00199 SoDataRange();
00200
00210 SoSFInt32 dataRangeId;
00211
00216 SoSFDouble min;
00217
00221 SoSFDouble max;
00222
00235 SoSFBool mapOnFullColorRange;
00236
00237 private:
00238 static void initClass();
00239 static void exitClass();
00240
00248 static void mapDataRangeToIndex(
00249 const SoDataSet::DataType dataTypeSrc, SoBufferObject* sourceBufferObject,
00250 const SoDataSet::DataType dataTypeDst, SoBufferObject* targetBufferObject,
00251 const double dataRangeMin, const double dataRangeMax, const bool dataRangeMap,
00252 const int shift, const int offset
00253 );
00254
00255
00263 static void mapDataRangeToRgba(
00264 const SoDataSet::DataType dataTypeSrc, SoBufferObject* sourceBufferObject,
00265 const SoDataSet::DataType dataTypeDst, SoBufferObject* targetBufferObject,
00266 const double dataRangeMin, const double dataRangeMax, const bool dataRangeMap,
00267 const int shift, const int offset,
00268 SoBufferObject *rgba, const int numRgba, SoConversion::MappingMethod rgbaMapping
00269 );
00270
00280 static void mapDataToIndex(
00281 const SoDataSet::DataType dataTypeSrc, SoBufferObject* sourceBufferObject,
00282 const SoDataSet::DataType dataTypeDst, SoBufferObject* targetBufferObject,
00283 const int numSigBits, const int shift, const int offset
00284 );
00285
00286
00296 static void mapDataToRgba(
00297 const SoDataSet::DataType dataTypeSrc, SoBufferObject* sourceBufferObject,
00298 const SoDataSet::DataType dataTypeDst, SoBufferObject* targetBufferObject,
00299 const int numSigBits, const int shift, const int offset,
00300 SoBufferObject *rgba, const int numRgba, SoConversion::MappingMethod rgbaMapping
00301 );
00302
00303
00304 private:
00305 virtual void doAction( SoAction *action );
00306 virtual void GLRender( SoGLRenderAction *action );
00307 virtual void callback( SoCallbackAction *action );
00308 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
00309 virtual void pick(SoPickAction *action) ;
00310 virtual void write(SoWriteAction *action);
00311
00312 private:
00313
00314 virtual ~SoDataRange();
00315
00316 private:
00317
00318 static SoConversion* s_conversion;
00319 };
00320
00321 #endif // _SO_DATA_RANGE__
00322
00323
00324