MeVisLab Toolbox Reference
SoCSOEllipseEditor.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2012, 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 {
26  SO_NODE_HEADER(SoCSOEllipseEditor);
27 
28 public:
29 
32 
34  SoSFBool isCircle;
45 
47  static void initClass();
48 
49  void cancel() override;
50 
51  void createStartPressAt(const SoPointerPosition& pos) override;
52  void createDragMoveTo(const SoPointerPosition& pos) override;
53  bool createEndPress(int clickCount) override;
55 
56  void selectAndMoveStartPressAt(const SoPointerPosition& pos) override;
57  void selectAndMoveDragMoveTo(const SoPointerPosition& pos) override;
58  SoPointingAction* selectAndMoveEndPress(int clickCount) override;
59 
60 protected:
61 
62 private:
63 
66  void interpolateEllipseSeedAndPathPoints(const SoPointerPosition& pos, bool isCreating);
68  unsigned int getHitSeedPointIndex() const;
70  void createNewCSO(const SoPointerPosition& pos);
72  ml::CSO* createCircleOnSingleClick(ml::CSOList* csoList);
73 
74  bool _wasCanceled;
75 
76  SbVec3f _startPosition;
77  SoPointerPosition _startPointerPosition;
78 };
79 
#define SOCSO_EXPORT
Header file for system independent resolution.
Definition: SoCSOSystem.h:21
Base class for extensions that extend the editor with interaction and rendering for specific CSO type...
Extension for rendering, generating, and modifying a circle/ellipse CSO.
static void initClass()
init class in inventor runtime
void cancel() override
Cancels an action like generating a CSO. Depends on concrete editor.
void pointerPositionIfAllowedAt(const SoPointerPosition &) override
Sets seed points while moving the mouse – but not while dragging.
SoSFFloat singleClickCircleRadius
The radius of the single-click circle.
SoSFFloat ellipseCreationRatio
Ratio of the ellipse's length to width on creation in [0..1].
void createStartPressAt(const SoPointerPosition &pos) override
void selectAndMoveStartPressAt(const SoPointerPosition &pos) override
void createDragMoveTo(const SoPointerPosition &pos) override
SoPointingAction * selectAndMoveEndPress(int clickCount) override
bool createEndPress(int clickCount) override
SoSFBool createCircleWithSingleClick
Should a circle be created with a single click?
SoSFBool isCircle
Is the ellipse actually a circle?
SoCSOEllipseEditor()
Standard constructor.
SoSFBool shouldKeepCenterConstant
Should the center be kept constant?
void selectAndMoveDragMoveTo(const SoPointerPosition &pos) override
SoSFBool shouldUseShiftToToggleCircleEllipse
Should the SHIFT modifier key be active for toggling circle/ellipse?
SoPointerPosition manages the current position of the mouse cursor.
SoPointingAction is the base class for any mouse based interaction.
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
Definition: CSOList.h:61
The CSO represents a contour segmentation object.
Definition: CSO.h:44