ALBA
albaCurvilinearAbscissaOnSkeletonHelper.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaCurvilinearAbscissaOnSkeletonHelper
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 __albaCurvilinearAbscissaOnSkeletonHelper_h
18#define __albaCurvilinearAbscissaOnSkeletonHelper_h
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaDefines.h"
24#include "vtkIdList.h"
25#include "albaServiceClient.h"
26#include "albaAbsLogicManager.h"
27
28//----------------------------------------------------------------------------
29// Forward declarations:
30//----------------------------------------------------------------------------
31class albaEvent;
32class albaVME;
34class albaVMEPolylineGraph;
35
38class ALBA_EXPORT albaCurvilinearAbscissaOnSkeletonHelper : albaObserver, public albaServiceClient
39{
40public:
41
43 albaCurvilinearAbscissaOnSkeletonHelper(albaVME *inputVME, albaObserver *listener = NULL, bool testMode = false);
44
46 void SetConstraintPolylineGraph(albaVMEPolylineGraph* constraintPolylineGraph);
47
49 albaVMEPolylineGraph *GetSetConstraintPolylineGraph() {return m_ConstraintVMEPolylineGraph;};
50
52 int SetCurvilinearAbscissa( vtkIdType branchId, double s );
53
55 double GetCurvilinearAbscissa() { return m_CurvilinearAbscissa;};
56
58 vtkIdType GetActiveBranchId() { return m_ActiveBranchId;};
59
74 void MoveOnSkeleton( albaEvent *mouseEvent);
75
77
80 virtual void OnEvent(albaEventBase *alba_event);
81
83 albaGUI *GetGui() {return m_Gui;};
84
86 virtual void EnableWidgets(bool enable);
87
88private:
89
90 void GetAbsPose( albaVMEPolylineGraph *inputConstrainVMEGraph, vtkIdType inBranchId, double s, albaMatrix &moverOutputAbsPose );
91 void MoveOnSkeletonInternal( vtkIdType inBranchId, double inS, double inMoveAbsVector[3], vtkIdType &outputBranch, double &outputS, albaMatrix &outputGizmoAbsMatrix );
92 void ComputeLocalPointPositionBetweenVerticesForSkeletonBranch( double distP0s, int idP0, int idP1, double pOut[3] );
93 double CheckS( vtkIdType inputBranchId, double inS );
94 void FindBoundaryVertices( vtkIdType inputSkeletonBranchId, double inS, int &outIdMin, int &outIdMax, double &outSFromIdMin );
95 void FindTargetBranchAfterBifurcation( vtkIdType bifurcationVertexId, double moveAbsVector[3], vtkIdType &outputVertexId, vtkIdType &outputEdgeID, vtkIdType &outputBranchId);
96 bool IsBifurcationVertex( albaPolylineGraph *inPG, int inVertexID );
97 void FindPerpendicularVersorsToSegment( int idP0, int idP1, double viewUp[3], double normal[3] );
98
99 albaVME *m_InputVME;
100 albaVMEPolylineGraph *m_ConstraintVMEPolylineGraph;
101 albaPolylineGraph *m_ConstraintPolylineGraph;
102 vtkIdType m_ActiveBranchId;
103 double m_CurvilinearAbscissa;
104
105 // log helpers
106 static void LogPoint( double *point, const char *logMessage = NULL );
107 static void LogVector3( double *vector , const char *logMessage = NULL);
108
109 // gui stuff
110 virtual void CreateGui();
111
112 int m_GUIActiveBranchId;
113 double m_GUICurvilinearAbscissa;
114 bool m_TestMode;
115
116 albaObserver *m_Listener;
117 albaGUI *m_Gui;
118
119};
120
121#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.
virtual void OnEvent(albaEventBase *alba_event)
GUI Stuff.
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.
albaVMEPolylineGraph * GetSetConstraintPolylineGraph()
Get the polyline graph constraint.
void MoveOnSkeleton(albaEvent *mouseEvent)
Move input vme constrained to skeleton in response to mouse events: use in your client as:
virtual void EnableWidgets(bool enable)
Enable-Disable the GUI's widgets.
albaCurvilinearAbscissaOnSkeletonHelper(albaVME *inputVME, albaObserver *listener=NULL, bool testMode=false)
Pass the vme you want to decorate with curvilinear abscissa interface.
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
albaGUI is a panel with function to easily create GUI.
Definition: albaGUI.h:110
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:44
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaPolylineGraph class
albaVME -
Definition: albaVME.h:150