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 
28 public:
29 
32 
37  SoSFBool isSquare;
38 
40  static void initClass();
41 
42  void cancel() override;
43 
44  void createStartPressAt(const SoPointerPosition& pos) override;
45  void createDragMoveTo(const SoPointerPosition& pos) override;
46  bool createEndPress(int clickCount) override;
48 
49  void selectAndMoveStartPressAt(const SoPointerPosition& pos) override;
50  void selectAndMoveDragMoveTo(const SoPointerPosition& pos) override;
51  SoPointingAction* selectAndMoveEndPress(int clickCount) override;
52 
53 protected:
54 
55 private:
56 
59  void interpolateRectangleSeedAndPathPoints(const SoPointerPosition& pos);
61  unsigned int getHitSeedPointIndex() const;
63  void createNewCSO(const SoPointerPosition& pos);
64 
65  bool _wasCanceled;
66 
67  SbVec3f _startPosition;
68 };
69 
#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.
SoSFBool shouldMoveOnlyGrabbedSide
Should only a side of the rectangle be moved instead of the whole CSO?
void cancel() override
Cancels an action like generating a CSO. Depends on concrete editor.
bool createEndPress(int clickCount) override
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.
void createStartPressAt(const SoPointerPosition &pos) override
SoSFBool isSquare
Is the rectangle actually a square?
static void initClass()
init class in inventor runtime
SoPointingAction * selectAndMoveEndPress(int clickCount) override
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.