MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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{
27public:
28 bool isUpToDate = false;
29
30 SbVec3s imageSize = {0, 0, 0};
31 SbVec3f voxelSize = {0.f, 0.f, 0.f};
32
34
35 double minVoxelValue = 0.0;
36 double maxVoxelValue = 0.0;
37
39
41
42 inline SbMLImageProperties(const SbVec3s& _imageSize, const SbVec3f& _voxelSize, MLDataType _dataType,
43 double _minVoxelValue, double _maxVoxelValue, const SbMatrix& _worldToVoxelMatrix)
46 , voxelSize(_voxelSize)
47 , dataType(_dataType)
48 , minVoxelValue(_minVoxelValue)
49 , maxVoxelValue(_maxVoxelValue)
50 , worldToVoxelMatrix(_worldToVoxelMatrix)
51 {}
52
53 inline void setOutOfDate()
54 {
55 isUpToDate = false;
56 }
57};
58
59
61class INVENTOR_ML_SUPPORT_API SoMLImageElement : public SoReplacedElement
62{
63 typedef SoReplacedElement inherited;
64
65 SO_ELEMENT_HEADER(SoMLImageElement);
66
67public:
69 static void set(SoState* state, SoNode* node, const SbMLImageProperties& imgProps);
71 static const SbMLImageProperties& get(SoState* state);
72
74
76 static void initClass();
77
78protected:
80
83};
84
85#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:592
@ MLint8Type
Enumerator for the signed 8-bit ML integer type.
Definition mlTypeDefs.h:616
Target mlrange_cast(Source arg)
Generic version of checked ML casts.