MeVisLab Toolbox Reference
SoCSOIsoEditor.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2015, 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#pragma once
14
16#include <SoSFMLImage.h>
18#include <CSOBase/CSODefines.h>
19
21
24{
25 SO_NODE_HEADER(SoCSOIsoEditor);
26
27public:
28
30 ~SoCSOIsoEditor() override;
31
32 static void initClass();
33
36 SoSFTypedEnum<ml::CSOSmoothingModes> smoothingMode;
37
38 void createStartPressAt(const SoPointerPosition& pos) override;
39
41
42 void createDragMoveTo(const SoPointerPosition& pos) override;
43 bool createEndPress(int clickCount) override;
45
47 void selectAndMoveDragMoveTo(const SoPointerPosition& pos) override;
48 SoPointingAction* selectAndMoveEndPress(int clickCount) override;
49
50 void cancel() override;
51
52 void initMembers() override;
53
54protected:
55
57
58private:
59
60 void _initialize();
61
62 void _getVoxelPosition(const SoPointerPosition& pos, int& voxelPosX, int& voxelPosY) const;
63 ml::Vector3 _getWorldPosition(float voxelX, float voxelY);
64
65 void _setImageData(const SoPointerPosition& pos);
66 bool _areEqual(const XVImageSize& imageSize1, const XVImageSize& imageSize2) const;
67 float _getIsoValue(const SoPointerPosition& pos) const;
68
69 void _setIsoContourToCSO(const SoPointerPosition& pos, ml::CSO* cso);
70 void _fillCSO(ml::CSO* cso, const ml::CSOMarchingSquaresCell::vecPoint2D& positions);
71
72 void fieldChanged(SoField*);
73
74 float* _imageData;
75 int _imageSizeX;
76 int _imageSizeY;
77
78 ml::Matrix4 _imageVoxelToWorldMatrix;
79
80 int _sliceZ;
81 int _sliceT;
82 unsigned int _lastImageSerialNumber;
83
84 ml::CSOMarchingSquares _marchingSquares;
85};
86
#define SOCSO_EXPORT
Header file for system independent resolution.
Definition SoCSOSystem.h:21
SoCSOCreatorEditorExtension()
Hidden constructor.
void createDragMoveTo(const SoPointerPosition &pos) override
SoSFMLImage inputImage
SoPointingAction * selectAndMoveEndPress(int clickCount) override
void cancel() override
Cancels an action like generating a CSO. Depends on concrete editor.
void selectAndMoveDragMoveTo(const SoPointerPosition &pos) override
void selectAndMoveStartPressAt(const SoPointerPosition &pos) override
void pointerPositionIfAllowedAt(const SoPointerPosition &) override
ml::Vector3 getCurrentPositon(const SoPointerPosition &pos)
void initMembers() override
bool createEndPress(int clickCount) override
void createStartPressAt(const SoPointerPosition &pos) override
SoSFBool interpolateContour
void createNewCSO(const SoPointerPosition &pos)
static void initClass()
~SoCSOIsoEditor() override
SoSFTypedEnum< ml::CSOSmoothingModes > smoothingMode
SoPointerPosition manages the current position of the mouse cursor.
SoSFMLImage - field interface to ML images and related classes.
Definition SoSFMLImage.h:32
std::vector< Vector2 > vecPoint2D
Defines a 2D point vector.
Definition CSO.h:44
Tmat4< MLdouble > Matrix4
The standard 4x4 matrix of type double.
Definition mlMatrix4.h:713
Tvec3< MLdouble > Vector3
A vector with three components of type double.
Definition mlVector3.h:286