MeVisLab Toolbox Reference
SoMLImageElement.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef SO_MLIMAGE_ELEMENT_H
14 #define SO_MLIMAGE_ELEMENT_H
15 
16 
18 
19 #include "SoMLSupportSystem.h"
20 #include <Inventor/elements/SoReplacedElement.h>
21 #include <Inventor/SbLinear.h>
22 #include <mlTypeDefs.h>
23 
26 {
27  public:
28 
29  bool isUpToDate = false;
30 
31  SbVec3s imageSize = {0, 0, 0 };
32  SbVec3f voxelSize = { 0.f,0.f,0.f };
33 
35 
36  double minVoxelValue = 0.0;
37  double maxVoxelValue = 0.0;
38 
40 
41  SbMLImageProperties() = default;
42 
43  inline SbMLImageProperties(const SbVec3s& _imageSize, const SbVec3f& _voxelSize, MLDataType _dataType, double _minVoxelValue, double _maxVoxelValue, const SbMatrix& _worldToVoxelMatrix)
44  : isUpToDate(true), imageSize(_imageSize), voxelSize(_voxelSize), dataType(_dataType), minVoxelValue(_minVoxelValue), maxVoxelValue(_maxVoxelValue),
45  worldToVoxelMatrix(_worldToVoxelMatrix)
46  {
47  }
48 
49  inline void setOutOfDate() { isUpToDate = false; }
50 };
51 
52 
54 class INVENTOR_ML_SUPPORT_API SoMLImageElement : public SoReplacedElement
55 {
56  typedef SoReplacedElement inherited;
57 
58  SO_ELEMENT_HEADER(SoMLImageElement);
59 
60  public:
61 
63  static void set(SoState *state, SoNode *node, const SbMLImageProperties &imgProps);
65  static const SbMLImageProperties &get(SoState *state);
66 
67  SoINTERNAL public:
68 
70  static void initClass();
71 
72  protected:
73 
75 
77  ~SoMLImageElement() override;
78 };
79 
80 #endif // _SO_ML_IMAGE_ELEMENT_
Inventor element storing ML image properties in the OpenInventor state.
SbMLImageProperties()=default
SbMLImageProperties(const SbVec3s &_imageSize, const SbVec3f &_voxelSize, MLDataType _dataType, double _minVoxelValue, double _maxVoxelValue, const SbMatrix &_worldToVoxelMatrix)
Inventor element storing ML image properties in the Open Inventor state.
static void initClass()
Initialize class with runtime type system.
static void set(SoState *state, SoNode *node, const SbMLImageProperties &imgProps)
Sets the current ML image properties in the state.
SbMLImageProperties _imgProps
~SoMLImageElement() override
Destructor.
static const SbMLImageProperties & get(SoState *state)
Returns the current ML image properties from the state.
MLint32 MLDataType
MLDataType.
Definition: mlTypeDefs.h:684
@ MLint8Type
Enumerator for the signed 8 bit ML integer type.
Definition: mlTypeDefs.h:722