MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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
28public:
31
44
46 static void initClass();
47
48 void cancel() override;
49
50 void createStartPressAt(const SoPointerPosition& pos) override;
51 void createDragMoveTo(const SoPointerPosition& pos) override;
52 bool createEndPress(int clickCount) override;
54 {}
55
57 void selectAndMoveDragMoveTo(const SoPointerPosition& pos) override;
58 SoPointingAction* selectAndMoveEndPress(int clickCount) override;
59
60protected:
61private:
64 void interpolateEllipseSeedAndPathPoints(const SoPointerPosition& pos, bool isCreating);
66 unsigned int getHitSeedPointIndex() const;
68 void createNewCSO(const SoPointerPosition& pos);
70 ml::CSO* createCircleOnSingleClick(ml::CSOList* csoList);
71
72 bool _wasCanceled;
73
74 SbVec3f _startPosition;
75 SoPointerPosition _startPointerPosition;
76};
77
#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
SoPointingAction * selectAndMoveEndPress(int clickCount) override
void selectAndMoveStartPressAt(const SoPointerPosition &pos) override
void createDragMoveTo(const SoPointerPosition &pos) 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
Target mlrange_cast(Source arg)
Generic version of checked ML casts.