MeVisLabToolboxReference
|
00001 // **InsertLicense** code 00002 00006 00007 00008 #ifndef _SO_ML_IMAGE_ELEMENT_ 00009 #define _SO_ML_IMAGE_ELEMENT_ 00010 00011 #include "SoMLSupportSystem.h" 00012 #include <Inventor/elements/SoReplacedElement.h> 00013 #include <Inventor/SbLinear.h> 00014 #include <mlTypeDefs.h> 00015 00017 class SbMLImageProperties 00018 { 00019 public: 00020 00021 bool isUpToDate; 00022 00023 SbVec3s imageSize; 00024 SbVec3f voxelSize; 00025 00026 MLDataType dataType; 00027 00028 double minVoxelValue; 00029 double maxVoxelValue; 00030 00031 SbMLImageProperties() : isUpToDate(false), imageSize(0,0,0), voxelSize(0.f,0.f,0.f), dataType(MLint8Type), minVoxelValue(0.0), maxVoxelValue(0.0) { 00032 } 00033 00034 SbMLImageProperties(const SbVec3s& _imageSize, const SbVec3f& _voxelSize, MLDataType _dataType, double _minVoxelValue, double _maxVoxelValue) : isUpToDate(true), imageSize(_imageSize), voxelSize(_voxelSize), dataType(_dataType), minVoxelValue(_minVoxelValue), maxVoxelValue(_maxVoxelValue) { 00035 } 00036 00037 void setOutOfDate() { 00038 isUpToDate = false; 00039 } 00040 }; 00041 00042 00044 class INVENTOR_ML_SUPPORT_API SoMLImageElement : public SoReplacedElement 00045 { 00046 typedef SoReplacedElement inherited; 00047 00048 SO_ELEMENT_HEADER(SoMLImageElement); 00049 00050 public: 00051 00053 static void set(SoState *state, SoNode *node, const SbMLImageProperties &imgProps); 00055 static const SbMLImageProperties &get(SoState *state); 00056 00057 SoINTERNAL public: 00058 00060 static void initClass(); 00061 00062 protected: 00063 00064 SbMLImageProperties _imgProps; 00065 00067 virtual ~SoMLImageElement(); 00068 }; 00069 00070 #endif // _SO_ML_IMAGE_ELEMENT_