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
00190 class SoDataRange : public SoNode {
00191 SO_NODE_HEADER( SoDataRange );
00192
00193 public:
00197 SoDataRange();
00198
00208 SoSFInt32 dataRangeId;
00209
00214 SoSFDouble min;
00215
00219 SoSFDouble max;
00220
00233 SoSFBool mapOnFullColorRange;
00234
00235 private:
00236 static void initClass();
00237 static void exitClass();
00238
00243 static void mapDataRangeToIndex(
00244 const SoDataSet::DataType dataTypeSrc, SoBufferObject* sourceBufferObject,
00245 const SoDataSet::DataType dataTypeDst, SoBufferObject* targetBufferObject,
00246 const double dataRangeMin, const double dataRangeMax, const bool dataRangeMap,
00247 const double undefinedValue = std::numeric_limits<double>::quiet_NaN()
00248 );
00249
00250
00255 static void mapDataRangeToRgba(
00256 const SoDataSet::DataType dataTypeSrc, SoBufferObject* sourceBufferObject,
00257 const SoDataSet::DataType dataTypeDst, SoBufferObject* targetBufferObject,
00258 const double dataRangeMin, const double dataRangeMax, const bool dataRangeMap,
00259 SoBufferObject *rgba, const int numRgba, SoConversion::MappingMethod rgbaMapping
00260 );
00261
00268 static void mapDataToIndex(
00269 const SoDataSet::DataType dataTypeSrc, SoBufferObject* sourceBufferObject,
00270 const SoDataSet::DataType dataTypeDst, SoBufferObject* targetBufferObject,
00271 const int numSigBits
00272 );
00273
00274
00281 static void mapDataToRgba(
00282 const SoDataSet::DataType dataTypeSrc, SoBufferObject* sourceBufferObject,
00283 const SoDataSet::DataType dataTypeDst, SoBufferObject* targetBufferObject,
00284 const int numSigBits,
00285 SoBufferObject *rgba, const int numRgba, SoConversion::MappingMethod rgbaMapping
00286 );
00287
00288
00289 private:
00290 virtual void doAction( SoAction *action );
00291 virtual void GLRender( SoGLRenderAction *action );
00292 virtual void callback( SoCallbackAction *action );
00293 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
00294 virtual void pick(SoPickAction *action) ;
00295 virtual void write(SoWriteAction *action);
00296
00297 private:
00298
00299 virtual ~SoDataRange();
00300
00301 private:
00302
00303 static SoConversion* s_conversion;
00304 };
00305
00306 #endif // _SO_DATA_RANGE__
00307
00308
00309