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//---------------------------------------------------------------------------
27class albaVME;
28class albaVMEGizmo;
29class vtkPoints;
30class vtkDoubleArray;
31class albaVMEPolylineSpline;
32class albaVMEPolyline;
33class vtkLineSource;
34class albaVME;
35
44class ALBA_EXPORT albaGizmoPath : public albaGizmoInterface
45{
46public:
47
48 albaGizmoPath(albaVME* inputVme, albaObserver *Listener = NULL, const char *name = "GizmoPath", int textVisibility = 0);
49
50 virtual ~albaGizmoPath();
51
53 {
54 ID_LEFT_TEXT_SIDE = 0,
56 };
57
59
61 void SetCurvilinearAbscissa(double s);
63
66 void SetConstraintPolyline(albaVME* constraintPolyline)
67 {
68 m_ConstraintPolyline = constraintPolyline;
69 }
70
73 void Show(bool show) ;
74
77 void SetInput(albaVME *vme);
78
80 albaVMEGizmo *GetOutput() {return m_VmeGizmoPath;};
81
83
85 void SetColor(double col[3]);
86
90 void SetLineLength (double lineLength);
91
93 void SetConstraintModalityToSnapVertex(); // not yet implemented
95 void SetConstraintModalityToBounds(); // not yet implemented
96 int GetConstraintModality() {return this->m_ConstraintModality;};
97
99 void OnEvent(albaEventBase *alba_event);
100
101 void SetSideTextPosition(bool leftRight = ID_LEFT_TEXT_SIDE){m_TextSidePosition = leftRight;};
102 bool GetSideTextPosition(){return m_TextSidePosition;};
103
104protected:
105
106 // create gizmo
109
110
111 // move to albaMatrix
112 void SetVersor(int axis, double versor[3], albaMatrix &matrix);
113
114 static void BuildVector(double p0[3],double p1[3],double vOut[3]);
115
116 // move somewhere else... [coeff * inVector];
117 static void BuildVector(double coeff, const double *inVector, double *outVector);
118
119 static void AddVectors(double p0[3],double p1[3],double sum[3]);
120
121 void Constructor(albaVME *imputVme, albaObserver *listener, const char *name);
123
125
127 albaVMEGizmo *m_VmeGizmoPath;
130
131
133
134 vtkLineSource *m_LineSource;
135
136
137 void FindGizmoAbsPose(double s);
138 void FindBoundaryVerticesID(double s, int &idMin, int &idMax, double &sFromIdMin);
139 void ComputeLocalPointPositionBetweenVertices(double distP0s, int idP0, int idP1, double pOut[3]);
140 void ComputeLocalNormal(int idP0, int idP1, double viewUp[3], double normal[3]);
141
144
147
149 {
150 FREE = 0,
154 };
155};
156#endif
Constrained interaction with mouse device: the left button moves the VME (see OnLeftButtonDown).
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:45
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:80
albaBehaviorTransform * m_LeftMouseInteractor
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:66
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:96
bool m_TextSidePosition
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)
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])
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:45
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