ALBA
albaGizmoPath.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoPath
5 Authors: 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 __albaGizmoPath_h
18#define __albaGizmoPath_h
19
20#include "albaGizmoInterface.h"
21#include "albaMatrix.h"
23//---------------------------------------------------------------------------
24// forward refs:
25//---------------------------------------------------------------------------
28class albaVME;
29class albaVMEGizmo;
30class vtkPoints;
31class vtkDoubleArray;
32class albaVMEPolylineSpline;
33class albaVMEPolyline;
34class vtkLineSource;
35class albaVME;
36
45class ALBA_EXPORT albaGizmoPath : public albaGizmoInterface
46{
47public:
48
49 albaGizmoPath(albaVME* inputVme, albaObserver *Listener = NULL, const char *name = "GizmoPath", int textVisibility = 0);
50
51 virtual ~albaGizmoPath();
52
54 {
55 ID_LEFT_TEXT_SIDE = 0,
57 };
58
60
62 void SetCurvilinearAbscissa(double s);
64
67 void SetConstraintPolyline(albaVME* constraintPolyline)
68 {
69 m_ConstraintPolyline = constraintPolyline;
70 }
71
74 void Show(bool show) ;
75
78 void SetInput(albaVME *vme);
79
81 albaVMEGizmo *GetOutput() {return m_VmeGizmoPath;};
82
84
86 void SetColor(double col[3]);
87
91 void SetLineLength (double lineLength);
92
94 void SetConstraintModalityToSnapVertex(); // not yet implemented
96 void SetConstraintModalityToBounds(); // not yet implemented
97 int GetConstraintModality() {return this->m_ConstraintModality;};
98
100 void OnEvent(albaEventBase *alba_event);
101
102 void SetSideTextPosition(bool leftRight = ID_LEFT_TEXT_SIDE){m_TextSidePosition = leftRight;};
103 bool GetSideTextPosition(){return m_TextSidePosition;};
104
105protected:
106
107 // create gizmo
110
111
112 // move to albaMatrix
113 void SetVersor(int axis, double versor[3], albaMatrix &matrix);
114
115 static void BuildVector(double p0[3],double p1[3],double vOut[3]);
116
117 // move somewhere else... [coeff * inVector];
118 static void BuildVector(double coeff, const double *inVector, double *outVector);
119
120 static void AddVectors(double p0[3],double p1[3],double sum[3]);
121
122 void Constructor(albaVME *imputVme, albaObserver *listener, const char *name);
124
126
128 albaVMEGizmo *m_VmeGizmoPath;
132
133
135
136 vtkLineSource *m_LineSource;
137
138
139 void FindGizmoAbsPose(double s);
140 void FindBoundaryVerticesID(double s, int &idMin, int &idMax, double &sFromIdMin);
141 void ComputeLocalPointPositionBetweenVertices(double distP0s, int idP0, int idP1, double pOut[3]);
142 void ComputeLocalNormal(int idP0, int idP1, double viewUp[3], double normal[3]);
143
146
149
151 {
152 FREE = 0,
156 };
157};
158#endif
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaGUI is a panel with function to easily create GUI.
Definition: albaGUI.h:110
Base class for operations and views gizmos.
Gizmo constrained to arbitrary path...
Definition: albaGizmoPath.h:46
void SetInput(albaVME *vme)
This method is used to change the input: this VME is used only to reparent the gizmo to the root.
void SetColor(double col[3])
Set the gizmo color.
albaVMEGizmo * GetOutput()
return the gizmo object
Definition: albaGizmoPath.h:81
albaGUI * m_GizmoGui
vtkLineSource * m_LineSource
albaMatrix * GetAbsPose()
Get the gizmo abs pose.
void Destructor()
void SetVersor(int axis, double versor[3], albaMatrix &matrix)
double m_CurvilinearAbscissa
void FindBoundaryVerticesID(double s, int &idMin, int &idMax, double &sFromIdMin)
void Show(bool show)
Show/Hide the gizmos using actor visibility instead of pipe creation/destruction: this is used for fa...
void OnEvent(albaEventBase *alba_event)
Events handling method.
void CreateVMEGizmo()
double GetCurvilinearAbscissa()
void SetConstraintPolyline(albaVME *constraintPolyline)
Set the constraint polyline: any VME can be provided but its output must be a albaVMEOutputPolyline.
Definition: albaGizmoPath.h:67
albaString m_Name
void SetLineLength(double lineLength)
set the length of the gizmo default representation ie a 2d line REFACTOR NOTE: graphical representati...
void SetConstraintModalityToBounds()
void SetCurvilinearAbscissa(double s)
Set position along constraint polyline.
static void BuildVector(double coeff, const double *inVector, double *outVector)
int GetConstraintModality()
Definition: albaGizmoPath.h:97
bool m_TextSidePosition
albaInteractorGenericMouse * m_LeftMouseInteractor
virtual ~albaGizmoPath()
void SetConstraintModalityToFree()
void ComputeLocalPointPositionBetweenVertices(double distP0s, int idP0, int idP1, double pOut[3])
void SetConstraintModalityToSnapVertex()
Set/Get the gizmo moving modality, default is free.
void DestroyVMEGizmo()
albaGizmoPath(albaVME *inputVme, albaObserver *Listener=NULL, const char *name="GizmoPath", int textVisibility=0)
albaInteractorCompositorMouse * m_GizmoInteractor
static void AddVectors(double p0[3], double p1[3], double sum[3])
albaVMEGizmo * m_VmeGizmoPath
static void BuildVector(double p0[3], double p1[3], double vOut[3])
void FindGizmoAbsPose(double s)
albaVME * m_ConstraintPolyline
void Constructor(albaVME *imputVme, albaObserver *listener, const char *name)
bool GetSideTextPosition()
void SetSideTextPosition(bool leftRight=ID_LEFT_TEXT_SIDE)
void CreateInteractor()
int m_ConstraintModality
@ CONSTRAINT_MODALITY_NUMBERS
void ComputeLocalNormal(int idP0, int idP1, double viewUp[3], double normal[3])
Associates instances of albaInteractorGenericMouse to mouse buttons and ctrl/shift keys combinations.
Constrained interaction with mouse device.
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:44
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