16#ifndef __albaInteractor2DMeasure_h
17#define __albaInteractor2DMeasure_h
36class vtkALBATextActorMeter;
41class vtkPolyDataMapper2D;
44class vtkRendererCollection;
47#define TEXT_W_SHIFT 10
91 virtual void AddMeasure(
double *point1,
double *point2 = NULL);
102 void Enable(
bool enable =
true) { m_IsEnabled = enable; SelectMeasure(-1); };
149 void SetColorDefault(
double r,
double g,
double b,
double a = 1.0) { iSetColor(COLOR_DEFAULT, r, g, b, a); };
151 void SetColorSelection(
double r,
double g,
double b,
double a = 1.0) { iSetColor(COLOR_SELECTION, r, g, b, a); };
153 void SetColorEdit(
double r,
double g,
double b,
double a = 1.0) { iSetColor(COLOR_EDIT, r, g, b, a); };
155 void SetColorDisable(
double r,
double g,
double b,
double a = 1.0) { iSetColor(COLOR_DISABLE, r, g, b, a); };
157 void SetColorText(
double r,
double g,
double b,
double a = 1.0) { iSetColor(COLOR_TEXT, r, g, b, a); };
162 virtual void Show(
bool show) {};
200 vtkRenderer *Renderer = NULL;
249 void iSetColor(
int color,
double r,
double g,
double b,
double a);
262 void GetMidPoint(
double(&midPoint)[3],
double *point1,
double *point2);
263 bool FindPointOnLine(
double(&point)[3],
double *linePoint1,
double *linePoint2,
double distance);
264 double GetAngle(
double* point1,
double* point2,
double* origin);
267 void GetParallelLine(
double(&point1)[3],
double(&point2)[3],
double *linePoint1,
double *linePoint2,
double distance);
291 double m_OldLineP1[3];
292 double m_OldLineP2[3];
298 double m_StartMousePosition[3];
302 double m_ViewPlaneNormal[3];
335 friend class albaInteractor2DMeasureTest;
Implementation of the message object for the Subject/Observer design pattern.
Event class to transport a triggering button and a position from pointing devices.
albaRWIBase * GetCurrentRwi(int m)
long m_AddMeasurePhase_Counter
vtkRenderer * m_CurrentRenderer
albaDeviceButtonsPadMouse * m_Mouse
virtual bool Save(albaVME *input, wxString tag)
void SetCurrPlane(int plane)
void SetMaxMeasures(int maxMeasures)
SET.
std::vector< vtkRenderer * > m_AllRenderersVector
virtual void UpdateEditActors(double *point1, double *point2=NULL)
Update.
void EnableEditMeasure(bool edit=true)
Enable/Disable Editing Mode.
virtual void SetLineWidth(double width)
bool IsInBound(double *pos)
Utilities.
virtual void AddMeasure(double *point1, double *point2=NULL)
MEASURE.
int GetLastEditedMeasureIndex()
Returns the last Edited Measure index.
void ScreenToWorld(double screen[2], double world[3])
albaString GetMeasureType()
Get a string type of measure.
void SetColorDisable(double r, double g, double b, double a=1.0)
Set Color For Disable Measure.
void EnableMoveMeasure(bool move=true)
Enable/Disable Moving Mode.
albaInteractor2DMeasure()
virtual ~albaInteractor2DMeasure()
virtual void Show(bool show)
void SetColorText(double r, double g, double b, double a=1.0)
Set Color For Disable Measure.
albaRWIBase * m_CurrentRwi
virtual void EditMeasure(int index, double *point)
Edit Measure.
void iSetColor(int color, double r, double g, double b, double a)
void SetColorDefault(double r, double g, double b, double a=1.0)
Set Color Default.
void SetColorSelection(double r, double g, double b, double a=1.0)
Set Color Selection.
virtual void OnRightButtonUp(albaEventInteraction *e)
void SetUpdateDistance(double dist)
void WorldToScreen(double world[3], double screen[2])
int GetMaxMeasures()
Get Max Measures.
void EnableAddMeasure(bool move=true)
Enable/Disable Add Mode.
albaString GetMeasureText(int index)
Get Measure Text Value.
virtual void OnMove(albaEventInteraction *e)
virtual void OnEvent(albaEventBase *event)
Process events coming from input device.
void GetMidPoint(double(&midPoint)[3], double *point1, double *point2)
virtual void Update(int index=-1)
Update All Actors.
void RotatePoint(double *point, double *origin, double angle)
albaTypeMacro(albaInteractor2DMeasure, albaInteractorPER)
void InitRenderer(albaEventInteraction *e)
double GetMeasureValue(int index)
GET.
double m_PointUpdateDist2
albaString GetMeasureLabel(int index)
Get Measure Extra Label.
virtual void SetPointSize(double size)
void GetParallelLine(double(&point1)[3], double(&point2)[3], double *linePoint1, double *linePoint2, double distance)
vtkPointSource * GetNewPointSource()
virtual void UpdateTextActor(int index, double *point)
int GetMeasureCount()
Get Number of Measures.
virtual void SelectMeasure(int index)
Select a Measure.
albaRWIBase * GetCurrentRwi()
return the current rwi
virtual void RemoveAllMeasures()
Delete all Measures.
double GetAngle(double *point1, double *point2, double *origin)
virtual void HideEditActors()
virtual void RemoveMeasure(int index)
Delete the Measure.
int GetCurreasureIdx() const
Returns current measure index.
void Enable(bool enable=true)
Enable/Disable Measure Interactor.
bool FindPointOnLine(double(&point)[3], double *linePoint1, double *linePoint2, double distance)
vtkCoordinate * m_Coordinate
bool IsEnabled()
Measure Interactor Is Enabled.
void SetAction(MEASURE_ACTIONS action)
Set Measure Action (None, Add, Edit, Move) and Update mouse Cursor.
std::vector< Measure2D > m_Measure2DVector
void ShowText(int measure, bool show)
virtual void MoveMeasure(int index, double *pointCoord)
Move Measure.
double m_ParallelScale_OnStart
virtual void UpdatePointActor(double *point)
void ShowText(bool show)
Show/Hide Text Labels.
double PixelSizeInWorld()
void SetColorEdit(double r, double g, double b, double a=1.0)
Set Color Edit.
virtual void OnLeftButtonUp(albaEventInteraction *e)
int PointUpDownLine(double *point, double *lp1, double *lp2)
albaString m_MeasureTypeText
void SetColor(vtkActor2D *actor, Color *color)
virtual void FindAndHighlight(double *pointCoord)
Find Measure Point and Set Action.
virtual void OnLeftButtonDown(albaEventInteraction *e)
Mouse Events.
virtual void ActivateMeasure(int index=-1, bool activate=true)
Disable Measure.
virtual void DrawNewMeasure(double *wp)
Draw New Measure.
virtual bool Load(albaVME *input, wxString tag)
LOAD/SAVE.
double DistancePointToLine(double *point, double *lineP1, double *lineP2)
void SetRendererByView(albaView *view)
Set Renderer by View needed.
void SetMeasureLabel(int index, albaString text)
Set Measure Extra Label.
MEASURE_ACTIONS GetAction()
Get current Measure.
int GetSelectedMeasureIndex()
Returns the Current Measure Selected index.
double DistanceBetweenPoints(double *point1, double *point2)
virtual void ShowEditLineActors()
std::vector< vtkALBATextActorMeter * > m_TextActorVector
Class implementing routing of events based on picking.
albaRWIBase is a vtkRenderWindowInteractor placed on a wxWindow
albaString - performs common string operations on c-strings.
albaView is the base class for Views in alba.