65 m_lastMousePosition = click;
69 if (contourGeometry->
IsInside(click))
71 m_lastMousePosition = click;
102 bool isHover =
false;
103 this->GetDataNode()->GetBoolProperty(
"contour.hovering", isHover, positionEvent->
GetSender());
106 if (isHover ==
false)
108 this->GetDataNode()->SetBoolProperty(
"contour.hovering",
true);
116 this->GetDataNode()->SetBoolProperty(
"contour.hovering",
false);
133 translation[0] = currentPosition[0] - this->m_lastMousePosition[0];
134 translation[1] = currentPosition[1] - this->m_lastMousePosition[1];
135 translation[2] = currentPosition[2] - this->m_lastMousePosition[2];
153 translation[0] = currentPosition[0] - this->m_lastMousePosition[0];
154 translation[1] = currentPosition[1] - this->m_lastMousePosition[1];
155 translation[2] = currentPosition[2] - this->m_lastMousePosition[2];
virtual void OnMovePoint(StateMachineAction *, InteractionEvent *interactionEvent)
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
Super class for all position events.
Standard implementation of BaseGeometry.
virtual void OnFinishEditing(StateMachineAction *, InteractionEvent *interactionEvent)
BaseRenderer * GetSender() const
void Deselect()
Deselect vertex.
Point3D GetPositionInWorld() const
virtual ~ContourModelInteractor()
Constants for most interaction classes, due to the generic StateMachines.
bool SelectVertexAt(int index, int timestep=0)
Mark a vertex at an index in the container as selected.
virtual void ConnectActionsAndFunctions() override
virtual bool IsNearContour(mitk::Point3D &point, float eps, int timestep)
Check if mouse cursor is near the contour.
VertexType * GetSelectedVertex()
Get the current selected vertex.
static RenderingManager * GetInstance()
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
void ShiftSelectedVertex(mitk::Vector3D &translate)
Shift the currently selected vertex by a translation vector.
virtual mitk::BaseGeometry * GetGeometry(int t=0) const
Get the BaseGeometry for timestep t.
void SetSelectedVertexAsControlPoint(bool isControlPoint=true)
Set selected vertex as control point.
virtual bool IsHovering(const InteractionEvent *interactionEvent)
void ShiftContour(mitk::Vector3D &translate, int timestep=0)
Shift the whole contour by a translation vector at given timestep.
virtual unsigned int GetTimeStep() const
void RequestUpdate(vtkRenderWindow *renderWindow)
#define CONNECT_CONDITION(a, f)
virtual void OnDeletePoint(StateMachineAction *, InteractionEvent *interactionEvent)
#define CONNECT_FUNCTION(a, f)
bool IsInside(const mitk::Point3D &p) const
Test whether the point p (world coordinates in mm) is inside the bounding box.
bool RemoveVertex(const VertexType *vertex, int timestep=0)
Remove a vertex at given timestep within the container.
virtual void OnMoveContour(StateMachineAction *, InteractionEvent *interactionEvent)
vtkRenderWindow * GetRenderWindow() const
Access the RenderWindow into which this renderer renders.
virtual bool OnCheckPointClick(const InteractionEvent *interactionEvent)