ALBA
albaGizmoPathRuler.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoPathRuler
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 __albaGizmoPathRuler_H__
18#define __albaGizmoPathRuler_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaEvent.h"
24#include "albaGizmoInterface.h"
26#include "albaGizmoPath.h"
27#include <vector>
28//----------------------------------------------------------------------------
29// forward references :
30//----------------------------------------------------------------------------
31
32class albaMatrix;
33
59class ALBA_EXPORT albaGizmoPathRuler : public albaGizmoInterface
60{
61public:
62
63 albaGizmoPathRuler(albaVME *input, albaObserver* listener = NULL, int ticksNumber = 1, \
64 int originTickId = 0, double ticksHeigth = 50, double ticksDistance = 20, bool enableShorterTicks = true);
66
68 void SetCurvilinearAbscissa(double s);
69 double GetCurvilinearAbscissa() {return m_CurvilinearAbscissa;};
71 {
72 if(index >= m_GizmoPathVector.size())
73 {
74 index = m_GizmoPathVector.size() - 1;
75 }
76 return m_GizmoPathVector[index]->GetCurvilinearAbscissa();
77 };
78
81 void SetConstraintPolyline(albaVME* constraintPolyline);
82
83 void SetTicksHeigth(double height);
84 double GetTicksHeigth() {return m_TicksHeigth;};
85
86 void SetTicksDistance(double distance);
87 double GetTicksDistance() {return m_TicksDistance;};
88
89 int GetTicksNumber() {return m_TicksNumber;};
90
92 void SetColor(double col[3]);
93 void SetColor(int idGizmo,double col[3]);
94
95 void SetColor(double abscissa,double col[3]);
96
97 void HighlightExtremes(double col[3], int bound1, int bound2, int center, bool inside = false);
98 void HighlightExtremes(double col[3], double bound1, double bound2, double center, bool inside = false);
99
100
103 void SetInput(albaVME *vme);
104
107 void OnEvent(albaEventBase *alba_event);
108
111 void Show(bool show);
112
114 albaVMEGizmo *GetOutput(int tickId) {return m_GizmoPathVector[tickId]->GetOutput();};
115
118 void SetAbsPose(albaMatrix *absPose);
119
121 albaMatrix *GetAbsPose(int tickId);
122
124 albaGUI *GetGui() {return NULL;};
125
126 void SetGizmoLabelsVisibility(bool value);
127
129
130 void CustomIndexLabelVisibility(int index, int flag);
131
132protected:
133
136
143
146
149
150 std::vector<albaGizmoPath *> m_GizmoPathVector;
151
152
153};
154
155#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.
A gizmo representing a ruler that can move on a polyline.
void SetConstraintPolyline(albaVME *constraintPolyline)
Set the constraint polyline: any VME can be provided but its output must be a albaVMEOutputPolyline.
void SetTicksHeigth(double height)
albaVMEGizmo * GetOutput(int tickId)
return the gizmo object
std::vector< albaGizmoPath * > m_GizmoPathVector
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 HighlightExtremes(double col[3], int bound1, int bound2, int center, bool inside=false)
void SetAbsPose(albaMatrix *absPose)
Set the gizmo pose; not yet implemented!!!
double GetGizmoPathCurvilinearAbscissa(int index)
albaGUI * GetGui()
not yet available...
void SetColor(int idGizmo, double col[3])
void HighlightExtremes(double col[3], double bound1, double bound2, double center, bool inside=false)
virtual ~albaGizmoPathRuler()
void SetTicksDistance(double distance)
void OnEventGizmoGui(albaEventBase *alba_event)
Gizmo gui events handling; not yet implemented...
void OnEventGizmoComponents(albaEventBase *alba_event)
Gizmo components events handling.
void SetColor(double col[3])
Set the gizmo color.
void OnEvent(albaEventBase *alba_event)
Events handling.
void SetColor(double abscissa, double col[3])
albaGizmoPathRuler(albaVME *input, albaObserver *listener=NULL, int ticksNumber=1, int originTickId=0, double ticksHeigth=50, double ticksDistance=20, bool enableShorterTicks=true)
void ResetLabelsVisibility()
void Show(bool show)
Show the gizmo.
void CustomIndexLabelVisibility(int index, int flag)
void SetCurvilinearAbscissa(double s)
Set position of the origin tick along constraint polyline; other ticks will follow.
void SetGizmoLabelsVisibility(bool value)
albaMatrix * GetAbsPose(int tickId)
get the abs pose for each tick
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:44
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaVME -
Definition: albaVME.h:150