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

This class manages the database queries, the table widget and the data from the database in the Container for visu for the tracks ,. More...

#include <Code/GUI/lib/DBManager/QGoDBTrackManager.h>

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

Public Slots

void CreateCorrespondingTrackFamily (std::list< unsigned int > iDivisions=std::list< unsigned int >())
 slot called when the user chose "Create a new division from checked tracks" More...
 
void DeleteTheDivisions (std::list< unsigned int > iDivisions=std::list< unsigned int >())
 slot called when the user chose "Delete the division for this tracks" More...
 

Signals

void CheckedTracksToAddToSelectedLineage (std::list< unsigned int > iDaughtersID, unsigned int iLineageID, std::list< unsigned > iLineagesToDelete)
 
void MeshesToAddToTrack (std::list< unsigned int > iListMeshes, unsigned int iTrackID)
 
void NeedMeshesInfoForImportedTrack (unsigned int iTrackID)
 
void NeedToGoToTheRealLocation (double, double, double, int)
 
void NewLineageToCreateFromTracks (std::list< unsigned int > iCheckedTracksIDs, unsigned int iTrackIDRoot, std::list< unsigned > iLineagesToDelete)
 
void TrackIDToBeModifiedWithWidget (std::list< unsigned int > iListTracksID)
 
void TrackToSplit (unsigned int iTrackID, std::list< unsigned int > iListMeshIDs)
 
- Signals inherited from QGoDBTraceManager
void AddNewTraceIDInTS (std::pair< std::string, QColor > iTraceToAddData)
 signal emitted when a new trace is created that need to be added in the trace settings widget. (when a new mesh is created while contour table is displayed for example) More...
 
void CheckedTracesToAddToSelectedCollection (std::list< unsigned int >)
 
void CheckedTracesToDelete ()
 signal emitted when the user click on the action "DeleteTraces" from the context menu as it can impact different TraceManagers More...
 
void DBConnectionNotNeededAnymore ()
 
void NeedToGetDatabaseConnection ()
 
void NeedToGoToTheLocation (int XCoord, int YCoord, int ZCoord, int TCoord)
 signal emitted when the user clicks on "go to the trace" in the context menu and return the coordinates for the center of the bounding box of the trace More...
 
void NewCollectionFromCheckedTraces (std::list< unsigned int >)
 signal emitted when the user clicks on "create a new collection from checked traces" in the context menu and return the list of checked tracesIDs More...
 
void PrintMessage (QString iMessage, int iTimeOut=0)
 
void TraceColorToChange ()
 signal emitted when the user click on the action "change color" from the context menu as it can impact different TraceManagers More...
 

Public Member Functions

void AddVolume (const unsigned int &iTrackID, const double &iVolume)
 Modify volume of the given track ID. More...
 
void AddVolumes (const std::list< std::pair< unsigned int, double > > &iVolumes)
 Modify volume of the given track ID. More...
 
void AddVolumes (const std::list< std::pair< unsigned int, double > > &iVolumes, unsigned int iTrackID)
 Modify volume of the given track ID. More...
 
std::string CheckMeshCanBeAddedToTrack (vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackID, unsigned int iMeshTimePoint, std::list< unsigned int > &ioMotherTrackDivisionToUpdate)
 check if the track belongs to a division and if it is possible to add the mesh without making the track overlapping the other tracks of the divisions, if so return a message to the user, if not, return the trackID of the divisions to be updated in the visu, if return empty message and empty list, the track doesn't belong to any division More...
 
unsigned int CreateNewTrackWithNoMesh (vtkMySQLDatabase *iDatabaseConnector)
 create a new track with no mesh and no points in the database, add it in the TW and in the visu container More...
 
int CreateTrackFamily (vtkMySQLDatabase *iDatabaseConnector, unsigned int iMotherTrackID, const std::list< unsigned int > &iDaughtersID)
 check that the mothertrackID is not already a mother in another trackfamily, create the trackfamily if not and return the trackfamilyID More...
 
virtual void DeleteCheckedTraces (vtkMySQLDatabase *iDatabaseConnector)
 delete the checked traces from the database, the TW and the container for visu More...
 
void DeleteListTraces (vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTraces)
 delete the traces of the list from the database, the TW and the container for visu More...
 
void DisplayInfoAndLoadVisuContainerForAllTracks (vtkMySQLDatabase *iDatabaseConnector)
 get all the data from the database to load all the tracks for the imagingsession into the table widget and the container for the visu More...
 
virtual void DisplayInfoForExistingTrace (vtkMySQLDatabase *iDatabaseConnector, int iTraceID)
 Virtual pure method: get the data needed from the database for the existing trace with iTraceID and update the corresponding row in the m_Table. More...
 
virtual void DisplayInfoForLastCreatedTrace (vtkMySQLDatabase *iDatabaseConnector)
 Virtual pure method: get the data needed from the database for the last created trace and display them in a new inserted row of the m_Table. More...
 
void DisplayOnlyCalculatedValuesForExistingTrack (GoFigureTrackAttributes *iTrackAttributes, unsigned int iTrackID)
 display in the TW the values extracted from iTrackAttributes called when loading all tracks from database when opening an imagingsession More...
 
virtual std::list< unsigned int > GetListHighlightedIDs ()
 
std::vector< unsigned int > GetTrackFamily (vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackID)
 
bool isMother (vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackID)
 
void LoadInfoVisuContainerForTrackFamilies (vtkMySQLDatabase *iDatabaseConnector)
 get all the data from the database of the track family table and give the corresponding info to the track container for visu More...
 
 QGoDBTrackManager (int iImgSessionID, QWidget *iparent)
 
void RemoveVolumes (const std::list< std::pair< unsigned int, double > > &iVolumes)
 Modify volume of the given track ID. More...
 
void RemoveVolumes (const std::list< std::pair< unsigned int, double > > &iVolumes, unsigned int iTrackID)
 Modify volume of the given track ID. More...
 
void SetTracksInfoContainerForVisu (TrackContainer *iContainerForVisu)
 set the m_TrackContainerInfoForVisu to the iContainerForVisu More...
 
void UpdateBoundingBoxes (vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTracesIDs)
 
void UpdateCurrentElementTrackContainer ()
 get the data from the TrackContainer corresponding to the user selected TrackID and put them in the current element of the track container More...
 
void UpdateDivisions (const std::list< unsigned int > &iListMotherTrackIDs)
 update the track container for visu and consequently the divisions in the visu More...
 
void UpdatePointsOfCurrentElementForImportedTrack (std::map< unsigned int, double * > iMeshesInfo, vtkMySQLDatabase *iDatabaseConnector)
 update the points of the imported track in current_element with the info from the meshes and save them in the database More...
 
std::list< unsigned int > UpdateTheTracesColor (vtkMySQLDatabase *iDatabaseConnector)
 virtual pure. update the color of the checked traces in the database, the visu container and the TW and return the collectionOf IDs. (i.e traces that belongs to these traces as collection: contourIDs belonging to these meshes if the trace is a mesh) More...
 
virtual void UpdateTWAndContainerForImportedTraces (const std::vector< int > &iVectorImportedTraces, vtkMySQLDatabase *iDatabaseConnector)
 get the data needed from the database for the imported traces,display them in new inserted rows of the m_Table and update the container for the visu. More...
 
 ~QGoDBTrackManager ()
 
- Public Member Functions inherited from QGoDBTraceManager
void CheckShowRows ()
 if m_IsShowOnlyCurrentTimePointOn is true, call the method to show only the rows for the current timepoint, useful when the timepoint changes More...
 
void DisplayInfoForExistingTraces (vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTraces)
 get the data from the database corresponding to the iListTraces and display them in the Table Widget More...
 
virtual std::list
< NameWithColorData
GetAllTraceIDsWithColor (vtkMySQLDatabase *iDatabaseConnector, std::string &ioIDToSelect)
 return the distinct traces with their color for the imagingsession, for all timepoints if the timepoint is set to the default one or for the corresponding timepoint if not More...
 
std::list< unsigned int > GetLastCreatedTracesIDs (vtkMySQLDatabase *iDatabaseConnector, int iNumberOfTracesIDs)
 get the last saved traces in the database More...
 
std::list< unsigned int > GetListCollectionIDs (vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTracesIDs)
 return the list of collection IDs distinct and different from zero corresponding to the tracesIDs More...
 
std::list< unsigned int > GetListTracesIDsBelongingToCollectionIDs (vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListCollectionIDs)
 get the list of tracesIDs belonging to the collection listed in iListCollectionIDs More...
 
std::list< unsigned int > GetListTracesIDsFromThisCollectionOf (vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTraces)
 get the collectionOf IDs for the TracesIDs found in iListTraces More...
 
QGoTableWidgetGetTableWidget ()
 get the m_Table More...
 
 QGoDBTraceManager (QObject *iParent=NULL)
 
void SetCurrentTimePoint (int *iTimePoint)
 set the pointer to the current timepoint More...
 
void SetDatabaseConnection (vtkMySQLDatabase *iDatabaseConnector)
 set the m_DatabaseConnection to iDatabaseConnector More...
 
void SetSelectedCollection (NameWithColorData *iCollectionData)
 set the pointer to the selected collection data More...
 
void SetSelectedColor (NameWithColorData *iColorData)
 set the pointer to the current selected color More...
 
virtual void UpdateBoundingBoxes (vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTracesIDs, bool UpdateTW=true)
 update in the database the bounding boxes corresponding to the TracesIDs and update the corresponding rows in the TW if the bool is set to true. More...
 
void UpdateCollectionID (vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTracesIDs, int iCollectionID)
 update the collectionID of the tracesIDs in the list with the iCollectionID in the database and the TW More...
 
void UpdateLastSelectedOneAsCollection ()
 
void UpdateTWAndContainerForDeletedTraces (const std::list< unsigned int > &iTraceIDs)
 delete the corresponding traces in the table widget and in the container for visu More...
 
virtual ~QGoDBTraceManager ()
 

Protected Slots

void GoToTrackBegin ()
 
void GoToTrackEnd ()
 
void MergeTracks ()
 check that only 2 tracks are checked in the TW, if not display a message to the user, check that the 2 tracks are not overlapping, if yes, display a message to the user, get the meshes of the track with the lowest timepoints, delete this track and send a signal for the list of meshes of the previous track to be reassigned to the track with the highest timepoints More...
 
virtual void SetColorCoding (bool IsChecked)
 
void SplitMergeTrackWithWidget ()
 get the trackIDs checked in the TW that will be modified with the widget and emit a signal with them as info on meshes are needed. More...
 
void TrackIDToEmit ()
 check that there is only one checked track in the TW and emit a signal with it as the checked mesh is needed also to split the track More...
 
virtual void UpdateHighlightedElementsInVisuContainer (int iTraceID)
 
virtual void UpdateVisibleElementsInVisuContainer (int iTraceID)
 
- Protected Slots inherited from QGoDBTraceManager
virtual void AddToSelectedCollection ()
 
virtual void ChangeTraceColor ()
 is called when the user choses the change color action in the context menu, emit the signal TraceColorToChange as it impacts the collectionOf also More...
 
void CheckSelectedRows ()
 
void CheckTheTraceInTW (unsigned int iTraceID, Qt::CheckState iState)
 slot called when a trace has been picked from the visu, to update the TW "checked/unchecked" column correspondingly More...
 
void CreateContextMenu (const QPoint &iPos)
 create the context menu when the user clicks on the table widget More...
 
virtual void CreateCorrespondingCollection ()
 slot called when the user click on "create a collection from checked traces" in the context menu, emit the signal NewCollectionFromCheckedTraces as it impact the collection also More...
 
void DeleteTracesFromContextMenu ()
 
void GoToTheTrace ()
 
void HideSelectedRows ()
 
virtual void SetColorCoding (bool IsChecked)=0
 ColorCode the traces in the visualization base on a selected column in the table widget. More...
 
void ShowOnlyRowsForCurrentTimePoint (bool IsChecked)
 Show only the rows in the table widget that have a timepoint equal to the current timepoint if IsChecked is true, show all the rows if false. More...
 
void ShowSelectedRows ()
 
void ShowTheTraceInTW (unsigned int iTraceID, Qt::CheckState iState)
 slot called when a trace has been shown/hidden from the visu, to update the TW "show/hide" column correspondingly More...
 
void UncheckSelectedRows ()
 
virtual void UpdateHighlightedElementsInVisuContainer (int iTraceID)=0
 modify to the opposite one the highlighted property of the corresponding trace base on traceID in the container for visu More...
 
virtual void UpdateVisibleElementsInVisuContainer (int iTraceID)=0
 modify to the opposite one the Visible property of the corresponding trace base on traceID in the container for visu More...
 

Protected Member Functions

void AddActionsContextMenu (QMenu *iMenu)
 
unsigned int CheckBoundingBoxDivisionAsADaughter (vtkMySQLDatabase *iDatabaseConnector, unsigned int iTimePoint, unsigned int iTrackFamilyID)
 check that the iTimePoint is > to the maxtimepoint of the mother from the division where trackID is a daughter More...
 
unsigned int CheckBoundingBoxDivisionAsAMother (vtkMySQLDatabase *iDatabaseConnector, unsigned int iTimePoint, unsigned int iTrackFamilyID)
 check that the iTimePoint is < to the mintimepoint of the daughter from the division where trackID is a mother More...
 
bool CheckOverlappingTracks (const std::list< unsigned int > &iTrackIDs, unsigned int &ioTraceIDToKeep, unsigned int &ioTraceIDToDelete, vtkMySQLDatabase *iDatabaseConnector)
 check that the 2 tracks are not overloaping, if not, return the trackID to keep for the merge and the one to delete More...
 
void CreateALineageWithFormerDaughterOfADeletedDivision (unsigned int iDaughterID, vtkMySQLDatabase *iDatabaseConnector, bool &ioPartOfHigherLineage)
 set the trackfamilyID of the daughter to 0, get all the tracks with the same lineage and emit a signal to create a lineage from these tracks with the daughter as trackIDRoot if ioPartOfHigherLineage, the lineage of the division will not be deleted as higher tracks belong to it More...
 
void DeleteOneDivision (GoDBTrackFamilyRow iDivision, vtkMySQLDatabase *iDatabaseConnector, std::list< unsigned int > &ioTrackIDsNoLineage, std::list< unsigned int > &ioMotherLineageToDelete)
 set the trackfamilyid of the daughters to 0, delete the trackfamily from the database and from the visu and check if the daughters are mothers, if not fill the ioTrackIDsNoLineage, if yes, update the all family \ More...
 
virtual void DisplayInfoForAllTraces (vtkMySQLDatabase *iDatabaseConnector)
 Virtual pure method: get the data needed from the database and display them in the m_Table for all traces corresponding to the imagingsession. More...
 
virtual void DisplayInfoForTracesForSpecificTPs (vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTPs)
 
std::list< unsigned int > GetDivisionIDsTheTrackBelongsTo (vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackID)
 get the division IDs the track belongs to as a mother or as a daughter More...
 
virtual void GetTracesInfoFromDBAndModifyContainerForVisu (vtkMySQLDatabase *iDatabaseConnector, std::list< unsigned int > iListTraceIDs=std::list< unsigned int >())
 get the info needed from the database to update the container for visu More...
 
std::list< unsigned int > GetTrackIDFromDaughtersFamilies (vtkMySQLDatabase *iDatabaseConnector, std::list< unsigned int > &ioTrackIDsOfTheFamilies)
 get the lineage ids of the 2 daughters, then get all the tracks belonging to these 2 lineages and push them into the ioTrackIDsOfTheFamilies. More...
 
bool IdentifyMotherDaughtersToCreateTrackFamily (vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTracksID, int &ioMotherID, std::list< unsigned int > &ioDaughtersID)
 get the trackID with the lowest timepoint as the mother trackID, if several tracks have the lowest timepoint, return false. if other tracks from the list are overlapping the mother trackID, return false. More...
 
unsigned int IsTheTrackADaughter (unsigned int iTrackID, vtkMySQLDatabase *iDatabaseConnector)
 return the trackfamilyID of the division the track is a daughter of or 0 if the track is not a daughter More...
 
unsigned int IsTheTrackAMother (unsigned int iDaughterID, vtkMySQLDatabase *iDatabaseConnector)
 return the trackfamilyID of the division the track is a mother of or 0 if the track is not a mother More...
 
void PrintAMessageForTracksWithNoDivision (std::list< unsigned int > iTracksNoDivision)
 build a message for the user to know which ones of the selected tracks have no division and emit a signal for it to be printed into the status bar More...
 
void SaveTrackCurrentElement (vtkMySQLDatabase *iDatabaseConnector)
 create or update the track contained in the current element of the track container into the database, the table widget and insert the current element into the track container More...
 
void SaveTrackStructure (vtkMySQLDatabase *iDatabaseConnector, TrackStructure *iStructure)
 
virtual void SetCollectionsTraceNames ()
 virtual pure method: set the std::string class members More...
 
void UpdateFormerDaughtersOfADeletedDivision (std::list< unsigned int > iDaughtersID, std::list< unsigned int > &ioTrackIDsNoLineage, bool &ioPartOfHigherLineage)
 check if the daughters are mothers, if yes, create a new lineage for them, if not, update the track familyID to 0 and fill the ioTrackIDsNoLineage with them, if ioPartOfHigherLineage is false, delete the lineage after creating a new one for the daughter family if the daughter is a mother and set the ioPartOfHigherLineage to true More...
 
void UpdateTrackFamilyIDForDaughter (vtkMySQLDatabase *iDatabaseConnector, unsigned int iDaughterID, unsigned int iTrackFamilyID)
 update the trackFamilyID in the database for the track corresponding to iDaughterID, if the trackfamilyID is 0, then the lineageID will be set to 0 also for this track More...
 
void UpdateTrackPolydataForVisu (vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackID)
 get the center of bounding boxes from the database for the meshes belonging to the iTrackID, update the polydata in the container for visu and save it in the database More...
 
- Protected Member Functions inherited from QGoDBTraceManager
virtual void AddActionForAddingCheckedTracesToCollection ()
 
void AddGeneralActionsContextMenu (QMenu *iMenu)
 
void AddSpecificActionsForContourMesh (QMenu *iMenu)
 
bool CheckThatThereAreTracesToDelete (const std::list< unsigned int > &iListTracesIDToDelete)
 
template<typename T >
unsigned int CreateNewTraceInDBFromVisu (unsigned int iXCoordMin, unsigned int iYCoordMin, unsigned int iZCoordMin, unsigned int iTCoord, unsigned int iXCoordMax, unsigned int iYCoordMax, unsigned int iZCoordMax, vtkPolyData *iTraceNodes, NameWithColorData iColor, vtkMySQLDatabase *iDatabaseConnector, T &iTrace, unsigned int iCollectionID, unsigned int iTCoordMax=0)
 create the trace row with the related data provided by the visu, iTCoordMax is equal to 0 as for contour and mesh, it is the same as TCoord More...
 
template<typename T >
void DeleteTracesTemplate (vtkMySQLDatabase *iDatabaseConnector, T *iContainerForVisu, std::list< unsigned int > iListTracesToDelete=std::list< unsigned int >(), bool DeleteHighlightedTraces=true)
 delete the traces from the database, the TW and the container for visu More...
 
template<typename T >
void DisplayInfoAndLoadVisuContainerWithAllTraces (T *iTWContainer, vtkMySQLDatabase *iDatabaseConnector)
 get all the data from the database to load all the traces for the imagingsession into the table widget and the container for the visu More...
 
template<typename C >
void DisplayInfoAndLoadVisuContainerWithAllTracesForSpecificTPs (vtkMySQLDatabase *iDatabaseConnector, C *iContainerForVisu, const std::list< unsigned int > &iListTPs)
 
template<typename T >
void DisplayInfoForAllTracesTemplate (T *iTWContainer, vtkMySQLDatabase *iDatabaseConnector, Qt::CheckState iState, int iIndexShowColumn=0)
 fill the TWContainer with all the data needed from the database and display them into the m_Table More...
 
template<typename T >
void DisplayInfoForExistingTraceTemplate (T *iTWContainer, vtkMySQLDatabase *iDatabaseConnector, int iTraceID)
 fill the TWContainer with the data needed from the database for the trace with the iTraceID and update the corresponding row into the m_Table More...
 
template<typename T >
void DisplayInfoForLastCreatedTraceTemplate (T *iTWContainer, vtkMySQLDatabase *iDatabaseConnector)
 fill the TWContainer with the data needed from the database for the last created trace and insert a new row into the m_Table to display them More...
 
template<typename T >
void DisplayInfoForTracesForSpecificTPsTemplate (T *iTWContainer, vtkMySQLDatabase *iDatabaseConnector, Qt::CheckState iState, const std::list< unsigned int > &iListTPs, int iIndexShowColumn=0)
 
GoDBCoordinateRow GetCoordinateFromInt (int iXCoord, int iYCoord, int iZCoord, int iTCoord)
 create a GoDBCoordinateRow and set its fields X,Y,Z,Tcoord More...
 
int GetLastCreatedTraceID (vtkMySQLDatabase *iDatabaseConnector)
 get the ID for the last created trace in the database More...
 
std::string GetTheNameIDFromName (std::string iName)
 transform the iName into iNameID More...
 
template<typename C , typename S >
void GetTracesInfoFromDBAndModifyContainerForVisu (vtkMySQLDatabase *iDatabaseConnector, std::vector< int > iVectIDs, C *iContainerForVisu)
 
template<typename T >
void GetTracesInfoFromDBAndModifyContainerForVisuTemplate (T *iContainerForVisu, vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTraceIDs)
 get the info needed from the database to fill the container for visu More...
 
double * GetVectorFromQColor (QColor iColor)
 return a double rgba[4] from a QColor More...
 
template<typename C >
void RemoveTracesFromTWAndContainerForVisuForSpecificTPsTemplate (vtkMySQLDatabase *iDatabaseConnector, C *iContainerForVisu, const std::list< unsigned int > &iListTPs)
 
template<typename T >
void SetColorCodingTemplate (T *iContainerForVisu, bool IsChecked)
 get a map with the tracesIDs as keys and the values of the selected columns as values for all traces in the table widget and update the color of the traces in the visu More...
 
void SetInfo (unsigned int iImgSessionID, QWidget *iParent)
 set the variables class members More...
 
template<typename T >
void SetTraceBoundingBoxAndPoints (unsigned int iXCoordMin, unsigned int iYCoordMin, unsigned int iZCoordMin, unsigned int iTCoord, unsigned int iXCoordMax, unsigned int iYCoordMax, unsigned int iZCoordMax, vtkPolyData *iTraceNodes, vtkMySQLDatabase *iDatabaseConnector, T &iTrace, unsigned int iTCoordMax=0)
 
template<typename T >
void SetTracesInfoContainerForVisuTemplate (T *iContainerForVisu, T **iMemberContainerForVisu)
 set the iMemberContainerInfoForVisu to the iContainerForVisu and create the connections SLOT/SIGNAL More...
 
template<typename T , typename C >
std::list< unsigned int > UpdateTheTracesColorTemplate (vtkMySQLDatabase *iDatabaseConnector, C *iContainerInfoForVisu)
 update the visu container, the database and the TW with the user selected color for the highlighted traces More...
 
template<typename T >
void UpdateTWAndContainerWithImportedTracesTemplate (T *iTWContainer, const std::vector< int > &iVectorTraceIDs, vtkMySQLDatabase *iDatabaseConnector)
 update for the imported traces the table widget and the database info of the container for visu. More...
 

Protected Attributes

TrackContainerm_TrackContainerInfoForVisu
 
GoDBTWContainerForTrackm_TWContainer
 
- Protected Attributes inherited from QGoDBTraceManager
QMenu * m_CheckedTracesMenu
 
std::string m_CollectionName
 
std::string m_CollectionNameID
 
std::string m_CollectionOf
 
std::string m_CollectionOfID
 
GoDBCollectionOfTracesm_CollectionOfTraces
 
int * m_CurrentTimePoint
 
vtkMySQLDatabase * m_DatabaseConnector
 
int m_ImgSessionID
 
bool m_IsColorCodingOn
 
bool m_IsShowOnlyCurrentTimePointOn
 
std::string m_LastSelectedTraceAsCollection
 
NameWithColorDatam_SelectedCollectionData
 
NameWithColorDatam_SelectedColorData
 
QGoTableWidgetm_Table
 
std::string m_TraceName
 
std::string m_TraceNameID
 

Additional Inherited Members

- Public Types inherited from QGoDBTraceManager
typedef std::pair< unsigned
int, QColor > 
IDWithColorData
 
typedef std::pair< std::string,
QColor > 
NameWithColorData
 
typedef
GoDBTableWidgetContainer::TWContainerType 
TWContainerType
 

Detailed Description

This class manages the database queries, the table widget and the data from the database in the Container for visu for the tracks ,.

Definition at line 54 of file QGoDBTrackManager.h.

Constructor & Destructor Documentation

QGoDBTrackManager::QGoDBTrackManager ( int  iImgSessionID,
QWidget *  iparent 
)

Definition at line 45 of file QGoDBTrackManager.cxx.

QGoDBTrackManager::~QGoDBTrackManager ( )

Definition at line 55 of file QGoDBTrackManager.cxx.

Member Function Documentation

void QGoDBTrackManager::AddActionsContextMenu ( QMenu *  iMenu)
protectedvirtual

Reimplemented from QGoDBTraceManager.

Definition at line 388 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::AddVolume ( const unsigned int &  iTrackID,
const double &  iVolume 
)

Modify volume of the given track ID.

Definition at line 1218 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::AddVolumes ( const std::list< std::pair< unsigned int, double > > &  iVolumes)

Modify volume of the given track ID.

Definition at line 1227 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::AddVolumes ( const std::list< std::pair< unsigned int, double > > &  iVolumes,
unsigned int  iTrackID 
)

Modify volume of the given track ID.

Definition at line 1257 of file QGoDBTrackManager.cxx.

unsigned int QGoDBTrackManager::CheckBoundingBoxDivisionAsADaughter ( vtkMySQLDatabase *  iDatabaseConnector,
unsigned int  iTimePoint,
unsigned int  iTrackFamilyID 
)
protected

check that the iTimePoint is > to the maxtimepoint of the mother from the division where trackID is a daughter

Definition at line 1175 of file QGoDBTrackManager.cxx.

unsigned int QGoDBTrackManager::CheckBoundingBoxDivisionAsAMother ( vtkMySQLDatabase *  iDatabaseConnector,
unsigned int  iTimePoint,
unsigned int  iTrackFamilyID 
)
protected

check that the iTimePoint is < to the mintimepoint of the daughter from the division where trackID is a mother

Definition at line 1155 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::CheckedTracksToAddToSelectedLineage ( std::list< unsigned int >  iDaughtersID,
unsigned int  iLineageID,
std::list< unsigned >  iLineagesToDelete 
)
signal
std::string QGoDBTrackManager::CheckMeshCanBeAddedToTrack ( vtkMySQLDatabase *  iDatabaseConnector,
unsigned int  iTrackID,
unsigned int  iMeshTimePoint,
std::list< unsigned int > &  ioMotherTrackDivisionToUpdate 
)

check if the track belongs to a division and if it is possible to add the mesh without making the track overlapping the other tracks of the divisions, if so return a message to the user, if not, return the trackID of the divisions to be updated in the visu, if return empty message and empty list, the track doesn't belong to any division

Definition at line 1087 of file QGoDBTrackManager.cxx.

bool QGoDBTrackManager::CheckOverlappingTracks ( const std::list< unsigned int > &  iTrackIDs,
unsigned int &  ioTraceIDToKeep,
unsigned int &  ioTraceIDToDelete,
vtkMySQLDatabase *  iDatabaseConnector 
)
protected

check that the 2 tracks are not overloaping, if not, return the trackID to keep for the merge and the one to delete

Parameters
[in]iTrackIDsIDs of both tracks to check
[in,out]ioTraceIDToKeepID of the trace to keep after the merge
[in,out]ioTraceIDToDeleteID of the trace to delete after the merge
[in]iDatabaseConnectorconnection to the database
Returns
false of the tracks are not overlapping, true if they are

Definition at line 616 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::CreateALineageWithFormerDaughterOfADeletedDivision ( unsigned int  iDaughterID,
vtkMySQLDatabase *  iDatabaseConnector,
bool &  ioPartOfHigherLineage 
)
protected

set the trackfamilyID of the daughter to 0, get all the tracks with the same lineage and emit a signal to create a lineage from these tracks with the daughter as trackIDRoot if ioPartOfHigherLineage, the lineage of the division will not be deleted as higher tracks belong to it

Definition at line 1057 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::CreateCorrespondingTrackFamily ( std::list< unsigned int >  iDivisions = std::list<unsigned int>())
slot

slot called when the user chose "Create a new division from checked tracks"

Definition at line 670 of file QGoDBTrackManager.cxx.

unsigned int QGoDBTrackManager::CreateNewTrackWithNoMesh ( vtkMySQLDatabase *  iDatabaseConnector)

create a new track with no mesh and no points in the database, add it in the TW and in the visu container

Parameters
[in]iDatabaseConnectorconnection to the database
Returns
the ID of the new track just created

Definition at line 141 of file QGoDBTrackManager.cxx.

int QGoDBTrackManager::CreateTrackFamily ( vtkMySQLDatabase *  iDatabaseConnector,
unsigned int  iMotherTrackID,
const std::list< unsigned int > &  iDaughtersID 
)

check that the mothertrackID is not already a mother in another trackfamily, create the trackfamily if not and return the trackfamilyID

Parameters
[in]iDatabaseConnectorconnection to the database
[in]iMotherTrackID
[in]iDaughtersID
Returns
ID of the new created trackfamily

Definition at line 787 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::DeleteCheckedTraces ( vtkMySQLDatabase *  iDatabaseConnector)
virtual

delete the checked traces from the database, the TW and the container for visu

Parameters
[in]iDatabaseConnectorconnection to the database

Implements QGoDBTraceManager.

Definition at line 189 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::DeleteListTraces ( vtkMySQLDatabase *  iDatabaseConnector,
const std::list< unsigned int > &  iListTraces 
)

delete the traces of the list from the database, the TW and the container for visu

Parameters
[in]iDatabaseConnectorconnection to the database
[in]iListTraceslist of the tracesIDs to be deleted

Definition at line 223 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::DeleteOneDivision ( GoDBTrackFamilyRow  iDivision,
vtkMySQLDatabase *  iDatabaseConnector,
std::list< unsigned int > &  ioTrackIDsNoLineage,
std::list< unsigned int > &  ioMotherLineageToDelete 
)
protected

set the trackfamilyid of the daughters to 0, delete the trackfamily from the database and from the visu and check if the daughters are mothers, if not fill the ioTrackIDsNoLineage, if yes, update the all family \

Definition at line 945 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::DeleteTheDivisions ( std::list< unsigned int >  iDivisions = std::list<unsigned int>())
slot

slot called when the user chose "Delete the division for this tracks"

Definition at line 890 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::DisplayInfoAndLoadVisuContainerForAllTracks ( vtkMySQLDatabase *  iDatabaseConnector)

get all the data from the database to load all the tracks for the imagingsession into the table widget and the container for the visu

Parameters
[in]iDatabaseConnectorconnection to the database

Definition at line 111 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::DisplayInfoForAllTraces ( vtkMySQLDatabase *  iDatabaseConnector)
protectedvirtual

Virtual pure method: get the data needed from the database and display them in the m_Table for all traces corresponding to the imagingsession.

Parameters
[in]iDatabaseConnectorconnection to the database

Implements QGoDBTraceManager.

Definition at line 91 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::DisplayInfoForExistingTrace ( vtkMySQLDatabase *  iDatabaseConnector,
int  iTraceID 
)
virtual

Virtual pure method: get the data needed from the database for the existing trace with iTraceID and update the corresponding row in the m_Table.

Parameters
[in]iDatabaseConnectorconnection to the database
[in]iTraceIDID of the trace

Implements QGoDBTraceManager.

Definition at line 131 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::DisplayInfoForLastCreatedTrace ( vtkMySQLDatabase *  iDatabaseConnector)
virtual

Virtual pure method: get the data needed from the database for the last created trace and display them in a new inserted row of the m_Table.

Parameters
[in]iDatabaseConnectorconnection to the database

Implements QGoDBTraceManager.

Definition at line 121 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::DisplayInfoForTracesForSpecificTPs ( vtkMySQLDatabase *  iDatabaseConnector,
const std::list< unsigned int > &  iListTPs 
)
protectedvirtual

Implements QGoDBTraceManager.

Definition at line 101 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::DisplayOnlyCalculatedValuesForExistingTrack ( GoFigureTrackAttributes iTrackAttributes,
unsigned int  iTrackID 
)

display in the TW the values extracted from iTrackAttributes called when loading all tracks from database when opening an imagingsession

Parameters
[in]iTrackAttributescomputed values for a track
[in]iTrackIDtrackID of the track we want to display the values

Definition at line 462 of file QGoDBTrackManager.cxx.

std::list< unsigned int > QGoDBTrackManager::GetDivisionIDsTheTrackBelongsTo ( vtkMySQLDatabase *  iDatabaseConnector,
unsigned int  iTrackID 
)
protected

get the division IDs the track belongs to as a mother or as a daughter

Definition at line 1193 of file QGoDBTrackManager.cxx.

std::list< unsigned int > QGoDBTrackManager::GetListHighlightedIDs ( )
virtual
Returns
the list of traceIDs that have highlighted set to true in the ContainerForVisu.

Implements QGoDBTraceManager.

Definition at line 233 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::GetTracesInfoFromDBAndModifyContainerForVisu ( vtkMySQLDatabase *  iDatabaseConnector,
std::list< unsigned int >  iListTraceIDs = std::list< unsigned int >() 
)
protectedvirtual

get the info needed from the database to update the container for visu

Implements QGoDBTraceManager.

Definition at line 259 of file QGoDBTrackManager.cxx.

std::vector< unsigned int > QGoDBTrackManager::GetTrackFamily ( vtkMySQLDatabase *  iDatabaseConnector,
unsigned int  iTrackID 
)

Definition at line 1395 of file QGoDBTrackManager.cxx.

std::list< unsigned int > QGoDBTrackManager::GetTrackIDFromDaughtersFamilies ( vtkMySQLDatabase *  iDatabaseConnector,
std::list< unsigned int > &  ioTrackIDsOfTheFamilies 
)
protected

get the lineage ids of the 2 daughters, then get all the tracks belonging to these 2 lineages and push them into the ioTrackIDsOfTheFamilies.

Parameters
[in]iDatabaseConnectorconnection to the database
[in,out]ioTrackIDsOfTheFamiliesIDs of all the tracks that will belong to the same lineage as the mother of the new created division
Returns
the lineage ids of the 2 daughters

Definition at line 835 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::GoToTrackBegin ( )
protectedslot

Definition at line 1346 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::GoToTrackEnd ( )
protectedslot

Definition at line 1287 of file QGoDBTrackManager.cxx.

bool QGoDBTrackManager::IdentifyMotherDaughtersToCreateTrackFamily ( vtkMySQLDatabase *  iDatabaseConnector,
const std::list< unsigned int > &  iListTracksID,
int &  ioMotherID,
std::list< unsigned int > &  ioDaughtersID 
)
protected

get the trackID with the lowest timepoint as the mother trackID, if several tracks have the lowest timepoint, return false. if other tracks from the list are overlapping the mother trackID, return false.

Parameters
[in]iListTracksIDtracks ID to be identified
[in,out]ioMotherIDto be modified with the identified mother TrackID
[in,out]ioDaughtersIDto be modified with the identified daughters TrackID
Returns
false if it was not possible to identify them based on the timepoints

Definition at line 739 of file QGoDBTrackManager.cxx.

bool QGoDBTrackManager::isMother ( vtkMySQLDatabase *  iDatabaseConnector,
unsigned int  iTrackID 
)

Definition at line 1405 of file QGoDBTrackManager.cxx.

unsigned int QGoDBTrackManager::IsTheTrackADaughter ( unsigned int  iTrackID,
vtkMySQLDatabase *  iDatabaseConnector 
)
protected

return the trackfamilyID of the division the track is a daughter of or 0 if the track is not a daughter

Definition at line 1048 of file QGoDBTrackManager.cxx.

unsigned int QGoDBTrackManager::IsTheTrackAMother ( unsigned int  iDaughterID,
vtkMySQLDatabase *  iDatabaseConnector 
)
protected

return the trackfamilyID of the division the track is a mother of or 0 if the track is not a mother

Definition at line 1032 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::LoadInfoVisuContainerForTrackFamilies ( vtkMySQLDatabase *  iDatabaseConnector)

get all the data from the database of the track family table and give the corresponding info to the track container for visu

Parameters
[in]iDatabaseConnectorconnection to the database

Definition at line 880 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::MergeTracks ( )
protectedslot

check that only 2 tracks are checked in the TW, if not display a message to the user, check that the 2 tracks are not overlapping, if yes, display a message to the user, get the meshes of the track with the lowest timepoints, delete this track and send a signal for the list of meshes of the previous track to be reassigned to the track with the highest timepoints

Definition at line 502 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::MeshesToAddToTrack ( std::list< unsigned int >  iListMeshes,
unsigned int  iTrackID 
)
signal
void QGoDBTrackManager::NeedMeshesInfoForImportedTrack ( unsigned int  iTrackID)
signal
void QGoDBTrackManager::NeedToGoToTheRealLocation ( double  ,
double  ,
double  ,
int   
)
signal
void QGoDBTrackManager::NewLineageToCreateFromTracks ( std::list< unsigned int >  iCheckedTracksIDs,
unsigned int  iTrackIDRoot,
std::list< unsigned >  iLineagesToDelete 
)
signal
void QGoDBTrackManager::PrintAMessageForTracksWithNoDivision ( std::list< unsigned int >  iTracksNoDivision)
protected

build a message for the user to know which ones of the selected tracks have no division and emit a signal for it to be printed into the status bar

Parameters
[in]iTracksNoDivisionIDs of the selected tracks that are not mothers

Definition at line 1012 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::RemoveVolumes ( const std::list< std::pair< unsigned int, double > > &  iVolumes)

Modify volume of the given track ID.

Definition at line 1242 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::RemoveVolumes ( const std::list< std::pair< unsigned int, double > > &  iVolumes,
unsigned int  iTrackID 
)

Modify volume of the given track ID.

Definition at line 1273 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::SaveTrackCurrentElement ( vtkMySQLDatabase *  iDatabaseConnector)
protected

create or update the track contained in the current element of the track container into the database, the table widget and insert the current element into the track container

Parameters
[in]iDatabaseConnectorconnection to the database

Definition at line 270 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::SaveTrackStructure ( vtkMySQLDatabase *  iDatabaseConnector,
TrackStructure iStructure 
)
protected

Definition at line 310 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::SetCollectionsTraceNames ( )
protectedvirtual

virtual pure method: set the std::string class members

Implements QGoDBTraceManager.

Definition at line 81 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::SetColorCoding ( bool  IsChecked)
protectedvirtualslot

Definition at line 379 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::SetTracksInfoContainerForVisu ( TrackContainer iContainerForVisu)

set the m_TrackContainerInfoForVisu to the iContainerForVisu

Parameters
[in]iContainerForVisucommon container for the visu and database

Definition at line 66 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::SplitMergeTrackWithWidget ( )
protectedslot

get the trackIDs checked in the TW that will be modified with the widget and emit a signal with them as info on meshes are needed.

Definition at line 441 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::TrackIDToBeModifiedWithWidget ( std::list< unsigned int >  iListTracksID)
signal
void QGoDBTrackManager::TrackIDToEmit ( )
protectedslot

check that there is only one checked track in the TW and emit a signal with it as the checked mesh is needed also to split the track

Definition at line 415 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::TrackToSplit ( unsigned int  iTrackID,
std::list< unsigned int >  iListMeshIDs 
)
signal
void QGoDBTrackManager::UpdateBoundingBoxes ( vtkMySQLDatabase *  iDatabaseConnector,
const std::list< unsigned int > &  iListTracesIDs 
)

Definition at line 365 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::UpdateCurrentElementTrackContainer ( )

get the data from the TrackContainer corresponding to the user selected TrackID and put them in the current element of the track container

void QGoDBTrackManager::UpdateDivisions ( const std::list< unsigned int > &  iListMotherTrackIDs)

update the track container for visu and consequently the divisions in the visu

Definition at line 1205 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::UpdateFormerDaughtersOfADeletedDivision ( std::list< unsigned int >  iDaughtersID,
std::list< unsigned int > &  ioTrackIDsNoLineage,
bool &  ioPartOfHigherLineage 
)
protected

check if the daughters are mothers, if yes, create a new lineage for them, if not, update the track familyID to 0 and fill the ioTrackIDsNoLineage with them, if ioPartOfHigherLineage is false, delete the lineage after creating a new one for the daughter family if the daughter is a mother and set the ioPartOfHigherLineage to true

Definition at line 983 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::UpdateHighlightedElementsInVisuContainer ( int  iTraceID)
protectedvirtualslot

Definition at line 241 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::UpdatePointsOfCurrentElementForImportedTrack ( std::map< unsigned int, double * >  iMeshesInfo,
vtkMySQLDatabase *  iDatabaseConnector 
)

update the points of the imported track in current_element with the info from the meshes and save them in the database

Definition at line 342 of file QGoDBTrackManager.cxx.

std::list< unsigned int > QGoDBTrackManager::UpdateTheTracesColor ( vtkMySQLDatabase *  iDatabaseConnector)
virtual

virtual pure. update the color of the checked traces in the database, the visu container and the TW and return the collectionOf IDs. (i.e traces that belongs to these traces as collection: contourIDs belonging to these meshes if the trace is a mesh)

Parameters
[in]iDatabaseConnectorconnection to the database
Returns
a list of the tracesIDs, part of the collection represented by the checked traces

Implements QGoDBTraceManager.

Definition at line 166 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::UpdateTrackFamilyIDForDaughter ( vtkMySQLDatabase *  iDatabaseConnector,
unsigned int  iDaughterID,
unsigned int  iTrackFamilyID 
)
protected

update the trackFamilyID in the database for the track corresponding to iDaughterID, if the trackfamilyID is 0, then the lineageID will be set to 0 also for this track

Parameters
[in]iDatabaseconnectorconnection to the database
[in]iDaughterIDID of the track to be updated
[in]iTrackFamilyID

Definition at line 823 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::UpdateTrackPolydataForVisu ( vtkMySQLDatabase *  iDatabaseConnector,
unsigned int  iTrackID 
)
protected

get the center of bounding boxes from the database for the meshes belonging to the iTrackID, update the polydata in the container for visu and save it in the database

Parameters
[in]iDatabaseConnectorconnection to the database
[in]iTrackIDID for the track the polydata needs to be recalculated

Definition at line 352 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::UpdateTWAndContainerForImportedTraces ( const std::vector< int > &  iVectorImportedTraces,
vtkMySQLDatabase *  iDatabaseConnector 
)
virtual

get the data needed from the database for the imported traces,display them in new inserted rows of the m_Table and update the container for the visu.

Parameters
[in]iVectorImportedTracesIDs of the imported traces
[in]iDatabaseConnectorconnection to the database

Implements QGoDBTraceManager.

Definition at line 176 of file QGoDBTrackManager.cxx.

void QGoDBTrackManager::UpdateVisibleElementsInVisuContainer ( int  iTraceID)
protectedvirtualslot

Definition at line 250 of file QGoDBTrackManager.cxx.

Member Data Documentation

TrackContainer* QGoDBTrackManager::m_TrackContainerInfoForVisu
protected

Definition at line 236 of file QGoDBTrackManager.h.

GoDBTWContainerForTrack* QGoDBTrackManager::m_TWContainer
protected

Definition at line 235 of file QGoDBTrackManager.h.


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