GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Slots | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
QGoTrackEditingWidget Class Reference

This dialog allows the user to split/merge the tracks using a GUI. More...

#include <Code/GUI/lib/QGoTrackEditingWidget.h>

Inheritance diagram for QGoTrackEditingWidget:
Inheritance graph
[legend]
Collaboration diagram for QGoTrackEditingWidget:
Collaboration graph
[legend]

Classes

struct  TrackInformation
 

Public Slots

void restoreTrackIDs ()
 Restore the track IDs to theirs original values (ie before entering the widget). Creates a TracksToBeCreated list, a TracksToBeUpdated list and a TracksToBeDeleted list. More...
 
void updateCurrentActorSelection (vtkObject *caller)
 Defines behavior when we pick an actor in the visualization. More...
 
void updateMeshesActors (bool)
 

Public Member Functions

std::list< std::list< unsigned
int > > 
GetListOfTracksToBeCreated ()
 Returns the list of tracks to be created. More...
 
std::list< unsigned int > GetListOfTracksToBeDeleted ()
 Returns the list of tracks to be deleted. More...
 
std::map< unsigned int,
std::list< unsigned int > > 
GetListOfTracksToBeUpdated ()
 Returns the list of tracks to be updated. More...
 
void init ()
 Initialize the renderer, the rendering window, the interactor style and add the meshes, polylines and labels to the visualization. More...
 
 QGoTrackEditingWidget (MeshContainer *imeshContainer=NULL, QWidget *parent=0)
 
 ~QGoTrackEditingWidget ()
 

Private Types

typedef std::map< vtkActor
*, unsigned int >::iterator 
LineActor2MeshIDIterator
 
typedef std::map< unsigned int,
TrackInformation
TrackMapping
 
enum  TrackStatusType { NEW_TRACK = 0, UPDATED_TRACK, DELETED_TRACK }
 

Private Member Functions

void computeLabelActor ()
 Create label actors to see the temporal information of each mesh. It is very useful for the merge. Note that the 2 input parameters have to ordered in the same way. More...
 
void computeLineActors ()
 Create the polyLines actors according to the current MeshContainer. More...
 
void computeMeshActors ()
 Get and display the meshes actors. More...
 
vtkActor * computeSphere (unsigned int iTraceID, double *iCenter, double radius)
 
vtkActor * createPolylineActor (double *iCenter1, double *iCenter2, const double *iColor1=NULL, const double *iColor2=NULL)
 Create a line between 2 points. More...
 
void cutTrack (vtkActor *iActor)
 Cut a track at the current actor. The actor represents a polyline between 2 meshes. More...
 
void getClosestPoints ()
 
std::list< unsigned int > getMeshIDsInTrack (unsigned int iCollection)
 Get the list of the mesh IDs which belong to the given track. More...
 
std::pair< std::pair< unsigned
int, unsigned int >, std::pair
< unsigned int, unsigned int > > 
getTrackBorders (const unsigned int &iCollectionID)
 Get the borders of the given track. More...
 
void highlightFirstActor (bool iHighlight)
 Change the apperance of the mesh depending on if we want to highlight it or not. First click on one actor will highlight it. Second click will restore its original apperance. More...
 
void initializeVisualization ()
 Reassigns track IDs and add the meshes, polylines and labels actors to the visualization. More...
 
void merge (MeshContainer::MultiIndexContainerTraceIDIterator iBegin)
 
bool mergeTrack (const unsigned int &iFirstMesh, const unsigned int &iSecondMesh)
 Merge 2 tracks, given 2 mesh IDs. Requierements for a successful merge: -Each mesh must belong to different tracks. -The tracks can't overlap. -The mesh has to be a border of its own track. More...
 
void modifyMeshCollectionID (unsigned int iMeshID, unsigned int iCollectionID)
 Modify the mesh collection to the chosen track ID. More...
 
 Q_DISABLE_COPY (QGoTrackEditingWidget)
 
void reassignTrackIDs ()
 Reassing real track IDs to temporary ones for convenience. More...
 
void removeLineActors ()
 Remove the polyLines actors. Usefull after a merge or a cut. An "Update" method would be more efficient than remove then compute. More...
 
void updateTracksIDs (const unsigned int &iIDToDelete, const unsigned int &iIDToUpdate)
 Update track IDs after a merge -The mesh has to be a border of its own track. More...
 

Private Attributes

vtkActor * m_CurrentActor
 
vtkActor * m_FirstMeshActor
 
unsigned int m_FirstMeshID
 
vtkInteractorStyleImage3Dm_InteractorStyle3D
 
std::map< vtkActor *, unsigned
int > 
m_Line2MeshID
 
std::list< unsigned int > m_ListOfDeletedTracks
 
std::list< std::list< unsigned
int > > 
m_ListOfNewTrack
 
std::map< unsigned int,
std::list< unsigned int > > 
m_ListOfUpdatedTracks
 
unsigned int m_MaxTrackID
 
MeshContainerm_MeshContainer
 
double m_MinimalDistance
 
unsigned int m_NumberOfTracks
 
bool m_SecondClick
 
QStatusBar * m_StatusBar
 
TrackMapping m_TrackMapping
 
vtkSmartPointer
< vtkEventQtSlotConnect > 
m_VtkEventQtConnector
 
vtkSmartPointer< vtkRenderer > renderer
 

Detailed Description

This dialog allows the user to split/merge the tracks using a GUI.

Definition at line 61 of file QGoTrackEditingWidget.h.

Member Typedef Documentation

typedef std::map< vtkActor*, unsigned int >::iterator QGoTrackEditingWidget::LineActor2MeshIDIterator
private

Definition at line 265 of file QGoTrackEditingWidget.h.

typedef std::map< unsigned int, TrackInformation > QGoTrackEditingWidget::TrackMapping
private

Definition at line 262 of file QGoTrackEditingWidget.h.

Member Enumeration Documentation

Enumerator
NEW_TRACK 
UPDATED_TRACK 
DELETED_TRACK 

Definition at line 246 of file QGoTrackEditingWidget.h.

Constructor & Destructor Documentation

QGoTrackEditingWidget::QGoTrackEditingWidget ( MeshContainer imeshContainer = NULL,
QWidget *  parent = 0 
)
explicit

Definition at line 67 of file QGoTrackEditingWidget.cxx.

QGoTrackEditingWidget::~QGoTrackEditingWidget ( )

Definition at line 101 of file QGoTrackEditingWidget.cxx.

Member Function Documentation

void QGoTrackEditingWidget::computeLabelActor ( )
private

Create label actors to see the temporal information of each mesh. It is very useful for the merge. Note that the 2 input parameters have to ordered in the same way.

Definition at line 339 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::computeLineActors ( )
private

Create the polyLines actors according to the current MeshContainer.

Todo:
should color be hard coded? hoew to define it? - Nicolas

Definition at line 457 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::computeMeshActors ( )
private

Get and display the meshes actors.

Definition at line 281 of file QGoTrackEditingWidget.cxx.

vtkActor * QGoTrackEditingWidget::computeSphere ( unsigned int  iTraceID,
double *  iCenter,
double  radius 
)
private

Definition at line 817 of file QGoTrackEditingWidget.cxx.

vtkActor * QGoTrackEditingWidget::createPolylineActor ( double *  iCenter1,
double *  iCenter2,
const double *  iColor1 = NULL,
const double *  iColor2 = NULL 
)
private

Create a line between 2 points.

Parameters
[in]iCenter1Center of the first mesh
[in]iCenter2Center of the second mesh
[in]iColor1Color of the first mesh
[in]iColor2Color of the second mesh
Returns
a pointer to the new actor. It has to be deleted somewhere.

Definition at line 118 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::cutTrack ( vtkActor *  iActor)
private

Cut a track at the current actor. The actor represents a polyline between 2 meshes.

Parameters
[in]iActorposition where we want to split the track

Definition at line 392 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::getClosestPoints ( )
private

Definition at line 850 of file QGoTrackEditingWidget.cxx.

std::list< std::list< unsigned int > > QGoTrackEditingWidget::GetListOfTracksToBeCreated ( )

Returns the list of tracks to be created.

Returns
The list of tracks to be created

Definition at line 582 of file QGoTrackEditingWidget.cxx.

std::list< unsigned int > QGoTrackEditingWidget::GetListOfTracksToBeDeleted ( )

Returns the list of tracks to be deleted.

Returns
The list of tracks to be deleted

Definition at line 600 of file QGoTrackEditingWidget.cxx.

std::map< unsigned int, std::list< unsigned int > > QGoTrackEditingWidget::GetListOfTracksToBeUpdated ( )

Returns the list of tracks to be updated.

Returns
The list of tracks to be updated

Definition at line 591 of file QGoTrackEditingWidget.cxx.

std::list< unsigned int > QGoTrackEditingWidget::getMeshIDsInTrack ( unsigned int  iCollection)
private

Get the list of the mesh IDs which belong to the given track.

Parameters
[in]iCollectiontrack from which we want to extract the mesh id
Returns
list of the meshes IDs

Definition at line 561 of file QGoTrackEditingWidget.cxx.

std::pair< std::pair< unsigned int, unsigned int >, std::pair< unsigned int, unsigned int > > QGoTrackEditingWidget::getTrackBorders ( const unsigned int &  iCollectionID)
private

Get the borders of the given track.

Parameters
[in]iCollectionIDtrack IDs we are interested in
Returns
time point and mesh id of the first and last mesh of the track

Definition at line 692 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::highlightFirstActor ( bool  iHighlight)
private

Change the apperance of the mesh depending on if we want to highlight it or not. First click on one actor will highlight it. Second click will restore its original apperance.

Parameters
[in]iHighlighttrue if we want to highlight the actor (i.e. first click)

Definition at line 783 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::init ( )

Initialize the renderer, the rendering window, the interactor style and add the meshes, polylines and labels to the visualization.

Definition at line 752 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::initializeVisualization ( )
private

Reassigns track IDs and add the meshes, polylines and labels actors to the visualization.

Definition at line 262 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::merge ( MeshContainer::MultiIndexContainerTraceIDIterator  iBegin)
private

Definition at line 203 of file QGoTrackEditingWidget.cxx.

bool QGoTrackEditingWidget::mergeTrack ( const unsigned int &  iFirstMesh,
const unsigned int &  iSecondMesh 
)
private

Merge 2 tracks, given 2 mesh IDs. Requierements for a successful merge: -Each mesh must belong to different tracks. -The tracks can't overlap. -The mesh has to be a border of its own track.

Parameters
[in]iFirstMeshID of a mesh belonging to the first track
[in]iSecondMeshID of a mesh belonging to the second track
Returns
true is the merge was successful

Definition at line 609 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::modifyMeshCollectionID ( unsigned int  iMeshID,
unsigned int  iCollectionID 
)
private

Modify the mesh collection to the chosen track ID.

Parameters
[in]iMeshIDmesh to be modified
[in]iCollectionIDnew track ID of the mesh

Definition at line 769 of file QGoTrackEditingWidget.cxx.

QGoTrackEditingWidget::Q_DISABLE_COPY ( QGoTrackEditingWidget  )
private
void QGoTrackEditingWidget::reassignTrackIDs ( )
private

Reassing real track IDs to temporary ones for convenience.

Definition at line 222 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::removeLineActors ( )
private

Remove the polyLines actors. Usefull after a merge or a cut. An "Update" method would be more efficient than remove then compute.

Definition at line 440 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::restoreTrackIDs ( )
slot

Restore the track IDs to theirs original values (ie before entering the widget). Creates a TracksToBeCreated list, a TracksToBeUpdated list and a TracksToBeDeleted list.

Definition at line 513 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::updateCurrentActorSelection ( vtkObject *  caller)
slot

Defines behavior when we pick an actor in the visualization.

Definition at line 162 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::updateMeshesActors ( bool  iRealMeshes)
slot

Definition at line 794 of file QGoTrackEditingWidget.cxx.

void QGoTrackEditingWidget::updateTracksIDs ( const unsigned int &  iIDToDelete,
const unsigned int &  iIDToUpdate 
)
private

Update track IDs after a merge -The mesh has to be a border of its own track.

Parameters
[in]iIDToDeleteID of the track to be deleted
[in]iIDToUpdateID of the track to be updated

Definition at line 732 of file QGoTrackEditingWidget.cxx.

Member Data Documentation

vtkActor* QGoTrackEditingWidget::m_CurrentActor
private

Definition at line 236 of file QGoTrackEditingWidget.h.

vtkActor* QGoTrackEditingWidget::m_FirstMeshActor
private

Definition at line 237 of file QGoTrackEditingWidget.h.

unsigned int QGoTrackEditingWidget::m_FirstMeshID
private

Definition at line 238 of file QGoTrackEditingWidget.h.

vtkInteractorStyleImage3D* QGoTrackEditingWidget::m_InteractorStyle3D
private

Definition at line 242 of file QGoTrackEditingWidget.h.

std::map< vtkActor*, unsigned int > QGoTrackEditingWidget::m_Line2MeshID
private

Definition at line 266 of file QGoTrackEditingWidget.h.

std::list< unsigned int > QGoTrackEditingWidget::m_ListOfDeletedTracks
private

Definition at line 227 of file QGoTrackEditingWidget.h.

std::list< std::list< unsigned int > > QGoTrackEditingWidget::m_ListOfNewTrack
private

Definition at line 225 of file QGoTrackEditingWidget.h.

std::map< unsigned int, std::list< unsigned int > > QGoTrackEditingWidget::m_ListOfUpdatedTracks
private

Definition at line 226 of file QGoTrackEditingWidget.h.

unsigned int QGoTrackEditingWidget::m_MaxTrackID
private

Definition at line 231 of file QGoTrackEditingWidget.h.

MeshContainer* QGoTrackEditingWidget::m_MeshContainer
private

Definition at line 223 of file QGoTrackEditingWidget.h.

double QGoTrackEditingWidget::m_MinimalDistance
private

Definition at line 240 of file QGoTrackEditingWidget.h.

unsigned int QGoTrackEditingWidget::m_NumberOfTracks
private

Definition at line 232 of file QGoTrackEditingWidget.h.

bool QGoTrackEditingWidget::m_SecondClick
private

Definition at line 234 of file QGoTrackEditingWidget.h.

QStatusBar* QGoTrackEditingWidget::m_StatusBar
private

Definition at line 229 of file QGoTrackEditingWidget.h.

TrackMapping QGoTrackEditingWidget::m_TrackMapping
private

Definition at line 263 of file QGoTrackEditingWidget.h.

vtkSmartPointer<vtkEventQtSlotConnect> QGoTrackEditingWidget::m_VtkEventQtConnector
private

Definition at line 243 of file QGoTrackEditingWidget.h.

vtkSmartPointer<vtkRenderer> QGoTrackEditingWidget::renderer
private

Definition at line 244 of file QGoTrackEditingWidget.h.


The documentation for this class was generated from the following files: