MeVisLab Toolbox Reference
SoCSOAngleEditor.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2021, 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 
15 
16 #pragma once
17 
20 
22 
25  public CSOPointDensity
26 {
27  SO_NODE_HEADER(SoCSOAngleEditor);
28 
29 public:
32 
34  static void initClass();
35 
37  SoSFBool drawArc;
39  SoSFFloat arcDistance;
40  SoSFFloat arcLineWidth;
41  SoSFColor arcColor;
42  SoSFFloat arcAlpha;
43 
44  SoSFBool drawLabel;
45  SoSFFloat labelDistance;
46  SoSFInt32 labelPrecision;
47  SoSFBool labelShadow;
48  SoSFColor labelColor;
49  SoSFFloat labelAlpha;
50  SoSFInt32 labelFontSize;
51 
52  void initMembers() override;
53 
54  void createStartPressAt(const SoPointerPosition &pos) override;
55 
56  void createNewCSO(const SoPointerPosition &pos);
57  void createDragMoveTo(const SoPointerPosition &pos) override;
58  bool createEndPress(int clickCount) override;
59  void pointerPositionIfAllowedAt(const SoPointerPosition &pos) override;
60 
61  void selectAndMoveStartPressAt(const SoPointerPosition &pos) override;
62  void selectAndMoveDragMoveTo(const SoPointerPosition &pos) override;
63  SoPointingAction *selectAndMoveEndPress(int clickCount) override;
64 
66  void insertSeedPointDragMoveTo(const SoPointerPosition &pos) override;
67  SoPointingAction *insertSeedPointEndPress(int clickCount) override;
68 
69  bool deleteSeedPoint(ml::CSO *cso, ml::CSOSeedPoint *seedPoint) override;
70 
71  void draw(const CSODrawCSOInfos& csoInfos, const CSODrawView2DInfos& view2DInfos, const CSODrawSliceInformation& drawSliceInfo, SoView2DCSOExtensibleEditor* editor) override;
72 
73  void drawHalfArc(const SbVec2f & arcPos1, const SbVec2f & arcPos2, const SbVec2f & center, float radius);
74 
75  void cancel() override;
76 
78 
79 protected:
81 
82 private:
83  SbVec3f _startPosition;
84  SoPointerPosition _startPointerPosition;
85  ml::Vector3 _currentPosition;
86 
87  bool _isCurrentlyGenerating;
88  bool _justStartedToCreate;
89  bool _hasClickedToCreate;
90 };
91 
#define SOCSO_EXPORT
Header file for system independent resolution.
Definition: SoCSOSystem.h:21
Extension for rendering, generating, and modifying a distance polyline CSO.
void insertSeedPointStartPressAt(const SoPointerPosition &pos) override
SoSFFloat arcDistance
Distance of the angle arc from the joint in pixels.
void initMembers() override
bool deleteSeedPoint(ml::CSO *cso, ml::CSOSeedPoint *seedPoint) override
Removes the given seed point from the given CSO and returns whether that was successful.
void createDragMoveTo(const SoPointerPosition &pos) override
SoPointingAction * selectAndMoveEndPress(int clickCount) override
void createNewCSO(const SoPointerPosition &pos)
void selectAndMoveDragMoveTo(const SoPointerPosition &pos) override
bool createEndPress(int clickCount) override
ml::Vector3 getCurrentPositon(const SoPointerPosition &pos)
SoSFFloat arcLineWidth
void cancel() override
Cancels an action like generating a CSO. Depends on concrete editor.
void drawHalfArc(const SbVec2f &arcPos1, const SbVec2f &arcPos2, const SbVec2f &center, float radius)
SoPointingAction * insertSeedPointEndPress(int clickCount) override
SoSFInt32 labelFontSize
bool canAddSeedPoint()
SoCSOAngleEditor()
Standard constructor.
static void initClass()
init class in inventor runtime
void pointerPositionIfAllowedAt(const SoPointerPosition &pos) override
Sets seed points while moving the mouse – but not while dragging.
void draw(const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, const CSODrawSliceInformation &drawSliceInfo, SoView2DCSOExtensibleEditor *editor) override
Main routine for drawing a CSO.
void createStartPressAt(const SoPointerPosition &pos) override
void insertSeedPointDragMoveTo(const SoPointerPosition &pos) override
SoSFInt32 labelPrecision
void selectAndMoveStartPressAt(const SoPointerPosition &pos) override
SoSFFloat labelDistance
SoSFBool drawArc
Draw the angle arc on line joint.
Base class for extensions that extend the editor with interaction and rendering for specific CSO type...
SoPointerPosition manages the current position of the mouse cursor.
SoPointingAction is the base class for any mouse based interaction.
The CSOSeedPoint can be interactively set and modified and is the framework for contours.
Definition: CSOSeedPoint.h:35
The CSO represents a contour segmentation object.
Definition: CSO.h:44