MeVisLab Toolbox Reference
SoCSORectangleEditor.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(SoCSORectangleEditor);
27
28public:
29
32
37 SoSFBool isSquare;
40
45
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
56 void selectAndMoveDragMoveTo(const SoPointerPosition& pos) override;
57 SoPointingAction* selectAndMoveEndPress(int clickCount) override;
58
60
61protected:
62
63private:
64
67 void interpolateRectangleSeedAndPathPoints(const SoPointerPosition& pos);
69 unsigned int getHitSeedPointIndex() const;
71 void createNewCSO(const SoPointerPosition& pos);
72
73 bool _wasCanceled;
74
75 SbVec3f _startPosition;
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 square/rectangle CSO.
SoPointingAction * selectAndMoveEndPress(int clickCount) override
SoSFBool shouldMoveOnlyGrabbedSide
Should only a side of the rectangle be moved instead of the entire CSO?
void cancel() override
Cancels an action like generating a CSO. Depends on concrete editor.
bool createEndPress(int clickCount) override
SoSFBool shouldUseShiftToToggleSquareRectangle
Should the SHIFT modifier key be active for toggling square/rectangle?
void pointerPositionIfAllowedAt(const SoPointerPosition &) override
Sets seed points while moving the mouse – but not while dragging.
void selectAndMoveStartPressAt(const SoPointerPosition &pos) override
SoCSORectangleEditor()
Standard constructor.
SoSFFloat grabbedSideMouseOverLineWidth
Line width of a grabbed side on mouse-over.
void createStartPressAt(const SoPointerPosition &pos) override
SoSFBool isSquare
Is the rectangle actually a square?
virtual void drawAdditionalGeometry(const CSODrawView2DInfos &view2DInfos, SoView2DCSOExtensibleEditor *editor)
Routine for drawing additional geometry of the extension.
static void initClass()
SoSFColor grabbedSideMouseOverColor
Color of a grabbed side on mouse-over.
void selectAndMoveDragMoveTo(const SoPointerPosition &pos) override
void createDragMoveTo(const SoPointerPosition &pos) override
SoPointerPosition manages the current position of the mouse cursor.
SoPointingAction is the base class for any mouse based interaction.