ALBA
albaGizmoPolylineGraph.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoPolylineGraph
5 Authors: Josef Kohout, Stefano Perticoni
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16
17#ifndef __albaGizmoInteractionDebugger_h
18#define __albaGizmoInteractionDebugger_h
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaDefines.h"
24#include "albaGizmoInterface.h"
25#include "albaMatrix.h"
28
29//---------------------------------------------------------------------------
30// forward refs:
31//---------------------------------------------------------------------------
34
35
36class albaEvent;
37class albaVME;
38class albaVMEGizmo;
39
40class vtkSphereSource;
41class vtkArrowSource;
42class vtkPlaneSource;
43class vtkAppendPolyData;
44class vtkTransformPolyDataFilter;
45
46class albaVMEPolylineGraph;
48
54{
55public:
57 inline static albaGizmoPolylineGraph* New(albaVME* inputVme,
58 albaObserver *Listener = NULL, const char *name = "GizmoPath", bool showOnlyDirectionAxis = false, bool testMode = false)
59 {
60 albaGizmoPolylineGraph* pThis = new albaGizmoPolylineGraph(inputVme,Listener, name, showOnlyDirectionAxis, testMode);
61 pThis->InternalInitInstance();
62 return pThis;
63 }
64
66 inline virtual void Delete()
67 {
68 if (this != NULL)
69 {
70 InternalRelease();
71 delete this;
72 }
73 }
74
75protected:
76 albaGizmoPolylineGraph(albaVME* inputVme, albaObserver *Listener = NULL, const char *name = "GizmoPath", bool showOnlyDirectionAxis = false, bool testMode = false);
77
79 virtual void InternalInitInstance();
80
82 virtual void InternalRelease();
83
84public:
86 inline void SetConstraintPolylineGraph(albaVMEPolylineGraph* constraintPolylineGraph);
87
89 virtual void SetCurvilinearAbscissa(vtkIdType branchId, double s);
90
92 inline double GetCurvilinearAbscissa();
93
95 inline vtkIdType GetActiveBranchId();;
96
98 virtual void SetGizmoLength (double lineLength);
99
102 virtual void Show(bool show) ;
103
105 /*virtual*/ void OnEvent(albaEventBase *alba_event);
106
108 void SetInput(albaVME *vme) {return;};
109
111 virtual void SetColor(double col[3]);
112
113 inline albaVMEGizmo* GetOutput() {
114 return m_VmeGizmo;
115 }
116
117protected:
119 virtual void CreateVMEGizmo();
120
122 virtual void DestroyVMEGizmo();
123
125 virtual void CreateGizmoVTKData();
126
128 virtual void DestroyGizmoVTKData();
129
131 virtual void CreateInteractor();
132
134 virtual void DestroyInteractor();
135
137 virtual void OnTransform(albaEvent *e);
138
140
142 albaVMEGizmo *m_VmeGizmo; //<VME gizmo (this is used by medCurvilinearAbscisaHelper)
143
146
147 vtkSphereSource *m_SphereSource; //<sphere denoting the position
148 vtkArrowSource* m_AxisSource[3]; //<source for axis
149 vtkTransformPolyDataFilter* m_Axis[3]; //<correctly positioned axis
150
151 vtkPlaneSource *m_PlaneSource;
152 vtkAppendPolyData *m_AppendPolyData;
153
154 bool m_ShowOnlyDirectionAxis; //< if true visualize only directional arrow source and hides the perpendiculars
155 bool m_TestMode; //< if true don't visualize gui
156
157
159
161 {
162 FREE = 0,
166 };
167
168};
169
170#pragma region inlines
171//------------------------------------------------------------------------
172inline void albaGizmoPolylineGraph::SetConstraintPolylineGraph( albaVMEPolylineGraph* constraintPolylineGraph )
173//------------------------------------------------------------------------
174{
176}
177
178//------------------------------------------------------------------------
180//------------------------------------------------------------------------
181{
183}
184
185//------------------------------------------------------------------------
187//------------------------------------------------------------------------
188{
190}
191
192//------------------------------------------------------------------------
193inline void albaGizmoPolylineGraph::SetCurvilinearAbscissa( vtkIdType branchId, double s )
194//------------------------------------------------------------------------
195{
197}
198#pragma endregion inlines
199
200
201#endif
Decorate input vme with curvilinear abscissa interface for albaVMEPolylineGraph constrained interacti...
vtkIdType GetActiveBranchId()
Get the active branch ie the branch to which inputVME is currently constrained.
void SetConstraintPolylineGraph(albaVMEPolylineGraph *constraintPolylineGraph)
Set the polyline graph constraint.
double GetCurvilinearAbscissa()
Get the curvilinear abscissa.
int SetCurvilinearAbscissa(vtkIdType branchId, double s)
Set the curvilinear abscissa value s on branchId branch, return ALBA_OK or ALBA_ERROR.
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaEvent - Class implementing ALBA application events.
Definition: albaEvent.h:55
Base class for operations and views gizmos.
Gizmo Helper Object for interaction stuff debug: this class should be expanded and refactored increme...
virtual void DestroyInteractor()
Destroys the interactor of the gizmo.
virtual void SetGizmoLength(double lineLength)
Set the length of the gizmo.
vtkSphereSource * m_SphereSource
albaCurvilinearAbscissaOnSkeletonHelper * m_CurvilinearAbscissaHelper
void LogTransformEvent(albaEvent *e)
virtual void OnTransform(albaEvent *e)
Handles ID_TRANSFORM event.
double GetCurvilinearAbscissa()
Get curvilinear abscissa along given constraint skeleton branch.
virtual void Show(bool show)
Show/Hide the gizmos using actor visibility instead of pipe creation/destruction: this is used for fa...
void SetConstraintPolylineGraph(albaVMEPolylineGraph *constraintPolylineGraph)
Set the constraint polyline graph.
virtual void CreateGizmoVTKData()
Creates VTK pipeline for the gizmo.
static albaGizmoPolylineGraph * New(albaVME *inputVme, albaObserver *Listener=NULL, const char *name="GizmoPath", bool showOnlyDirectionAxis=false, bool testMode=false)
The only way to construct correctly the instance.
void SetInput(albaVME *vme)
Not used since this gizmo is not moving anything.
albaInteractorGenericMouse * m_LeftMouseInteractor
virtual void SetCurvilinearAbscissa(vtkIdType branchId, double s)
Set curvilinear abscissa along given constraint skeleton branch.
vtkAppendPolyData * m_AppendPolyData
virtual void CreateInteractor()
Creates the interactor for the gizmo.
vtkIdType GetActiveBranchId()
Get the active branch ie the branch to which gizmo is currently constrained.
albaGizmoPolylineGraph(albaVME *inputVme, albaObserver *Listener=NULL, const char *name="GizmoPath", bool showOnlyDirectionAxis=false, bool testMode=false)
void OnEvent(albaEventBase *alba_event)
Events handling method.
virtual void Delete()
The only way to destruct correctly the instance.
virtual void InternalInitInstance()
Initializes the object.
virtual void DestroyVMEGizmo()
Destroys the gizmo.
virtual void CreateVMEGizmo()
Creates the gizmo.
virtual void DestroyGizmoVTKData()
Destroys VTK pipeline for the gizmo.
albaInteractorCompositorMouse * m_GizmoInteractor
virtual void InternalRelease()
Finalizes the object.
virtual void SetColor(double col[3])
Set the gizmo color.
Associates instances of albaInteractorGenericMouse to mouse buttons and ctrl/shift keys combinations.
Constrained interaction with mouse device.
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaString - performs common string operations on c-strings.
Definition: albaString.h:43
albaVME -
Definition: albaVME.h:150