48 this->
SetInfo(iImgSessionID, iparent);
69 this->SetTracesInfoContainerForVisuTemplate< TrackContainer >(
92 vtkMySQLDatabase *iDatabaseConnector)
94 this->DisplayInfoForAllTracesTemplate< GoDBTWContainerForTrack >(
102 vtkMySQLDatabase *iDatabaseConnector,
const std::list<unsigned int> & iListTPs)
112 vtkMySQLDatabase *iDatabaseConnector)
114 this->DisplayInfoAndLoadVisuContainerWithAllTraces< GoDBTWContainerForTrack >
122 vtkMySQLDatabase *iDatabaseConnector)
124 this->DisplayInfoForLastCreatedTraceTemplate< GoDBTWContainerForTrack >(
132 vtkMySQLDatabase *iDatabaseConnector,
int iTraceID)
134 this->DisplayInfoForExistingTraceTemplate< GoDBTWContainerForTrack >(
142 vtkMySQLDatabase *iDatabaseConnector)
145 unsigned int NewTrackID =
153 NewTrackID, color,
true);
158 this->m_SelectedColorData->second);
167 vtkMySQLDatabase *iDatabaseConnector)
177 const std::vector< int > & iVectorImportedTraces,
178 vtkMySQLDatabase *iDatabaseConnector)
182 iVectorImportedTraces, iDatabaseConnector);
193 std::list<unsigned int> ListDivisionsToDelete =
196 std::list<unsigned int>::iterator iter = ListDivisionsToDelete.begin();
197 std::list<unsigned int> TrackIDsWithNoLineage = std::list<unsigned int>();
198 std::list<unsigned int> LineagesToDelete = std::list<unsigned int>();
199 while( iter != ListDivisionsToDelete.end() )
210 if (!TrackIDsWithNoLineage.empty() )
224 const std::list< unsigned int > & iListTraces)
226 this->DeleteTracesTemplate< TrackContainer >(iDatabaseConnector,
253 UpdateElementVisibilityWithGivenTraceID(iTraceID);
260 vtkMySQLDatabase *iDatabaseConnector,
261 std::list< unsigned int > iListTraceIDs)
263 this->GetTracesInfoFromDBAndModifyContainerForVisuTemplate< TrackContainer >(
271 vtkMySQLDatabase *iDatabaseConnector)
284 TrackID = TrackToSave.
SaveInDB(iDatabaseConnector);
314 unsigned int TrackID = iStructure->
TraceID;
323 TrackID = TrackToSave.
SaveInDB(iDatabaseConnector);
343 std::map< unsigned int, double * > iMeshesInfo,
344 vtkMySQLDatabase *iDatabaseConnector)
353 unsigned int iTrackID)
355 std::list< double * > ListCenters =
357 iDatabaseConnector, iTrackID);
366 vtkMySQLDatabase *iDatabaseConnector,
367 const std::list< unsigned int > & iListTracesIDs)
370 std::list< unsigned int >::const_iterator iter = iListTracesIDs.begin();
371 while ( iter != iListTracesIDs.end() )
381 this->SetColorCodingTemplate< TrackContainer >(
392 QMenu *SplitMergeMenu =
new QMenu(
tr(
"Split/Merge them"), iMenu);
417 std::list< unsigned int > HighlightedTrackIDs =
420 if ( HighlightedTrackIDs.size() != 1 )
424 tr(
"Please check one and only one Track to split") );
430 std::list<unsigned int> list_meshes =
432 HighlightedTrackIDs);
433 emit
TrackToSplit( HighlightedTrackIDs.front(), list_meshes );
443 std::list< unsigned int > HighlightedTrackIDs =
446 if ( HighlightedTrackIDs.size() == 0 )
450 tr(
"Please check at least one Track to be visualized in the widget") );
465 if ( iTrackAttributes != 0 )
469 assert( timeInterval != 0 );
471 std::vector< std::string > ColumnNames (9);
472 std::vector< std::string > Values (9);
474 ColumnNames.at(0) =
"Deplacement";
475 Values.at(0) = ConvertToString< double >(iTrackAttributes->
total_length);
476 ColumnNames.at(1) =
"Distance";
477 Values.at(1) = ConvertToString< double >(iTrackAttributes->
distance);
478 ColumnNames.at(2) =
"Theta";
479 Values.at(2) = ConvertToString< double >(iTrackAttributes->
theta);
480 ColumnNames.at(3) =
"Phi";
481 Values.at(3) = ConvertToString< double >(iTrackAttributes->
phi);
482 ColumnNames.at(4) =
"AvgSpeed";
483 Values.at(4) = ConvertToString< double >
484 (iTrackAttributes->
avg_speed /
static_cast< double >( timeInterval ));
485 ColumnNames.at(5) =
"MaxSpeed";
486 Values.at(5) = ConvertToString< double >
487 (iTrackAttributes->
max_speed /
static_cast< double >( timeInterval ));
488 ColumnNames.at(6) =
"AvgVolume";
489 Values.at(6) = ConvertToString< double >(iTrackAttributes->
avg_volume);
490 ColumnNames.at(7) =
"NumberOfMeshes";
491 Values.at(7) = ConvertToString< unsigned int >(iTrackAttributes->
number_meshes);
492 ColumnNames.at(8) =
"Tmax - Tmin";
493 Values.at(8) = ConvertToString< unsigned int >(iTrackAttributes->
temporal_extent);
505 std::list< unsigned int > CheckedTrack =
507 if ( CheckedTrack.size() != 2 )
511 tr(
"Please check two and only two tracks to be merged") );
517 unsigned int TrackIDToKeep = 0;
518 unsigned int TrackIDToDelete = 0;
524 tr(
"The two tracks are overlapping, it is not possible to merge them !!") );
538 tr(
"The first track is already a mother track !!") );
544 std::vector<unsigned int> family1 =
547 if(family1.size() > 0)
552 tr(
"The second track is already a daughter track !!") );
563 unsigned int oldMotherID = 0;
564 unsigned int oldDaughter = 0;
566 std::vector<unsigned int> family =
570 if(family.size() > 0)
572 oldMotherID = family[1];
573 if(family[2] == TrackIDToDelete)
575 oldDaughter = family[3];
579 oldDaughter = family[2];
583 std::list<unsigned int> oldList;
584 oldList.push_back(oldMotherID);
590 std::list< unsigned int > TraceIDToDelete;
591 TraceIDToDelete.push_back(TrackIDToDelete);
592 std::list< unsigned int > MeshesBelongingToTrackToDelete =
599 if(family.size() > 0)
602 std::list<unsigned int> newdaughter;
603 newdaughter.push_back(oldMotherID);
604 newdaughter.push_back(oldDaughter);
605 newdaughter.push_back(TrackIDToKeep);
617 std::list< unsigned int > iTrackIDs,
unsigned int & ioTraceIDToKeep,
618 unsigned int & ioTraceIDToDelete, vtkMySQLDatabase *iDatabaseConnector)
620 unsigned int TraceID1 = 0, TraceID2 = 0;
621 unsigned int TimePointMin1 = 0, TimePointMin2 = 0, TimePointMax1 = 0,
623 bool oTracksOverlapping =
true;
625 std::list< unsigned int >::iterator iter = iTrackIDs.begin();
626 if ( iter == iTrackIDs.end() )
628 std::cout <<
"Pb, there should have been 2 tracks instead of 0 in this method" << std::endl;
629 return oTracksOverlapping;
633 iDatabaseConnector, TraceID1,
true);
635 iDatabaseConnector, TraceID1,
false);
637 if ( iter == iTrackIDs.end() )
639 std::cout <<
"Pb, there should have been 2 tracks instead of 1 in this method" << std::endl;
640 return oTracksOverlapping;
645 iDatabaseConnector, TraceID2,
true);
647 iDatabaseConnector, TraceID2,
false);
649 if ( TimePointMin2 > TimePointMax1 )
651 oTracksOverlapping =
false;
652 ioTraceIDToKeep = TraceID2;
653 ioTraceIDToDelete = TraceID1;
656 if ( TimePointMin1 > TimePointMax2 )
658 oTracksOverlapping =
false;
659 ioTraceIDToKeep = TraceID1;
660 ioTraceIDToDelete = TraceID2;
663 return oTracksOverlapping;
671 std::list<unsigned int> DaughtersIDs = std::list<unsigned int>();
672 std::list<unsigned int> CheckedTracks;
674 if(iDivisions.size())
676 CheckedTracks = iDivisions;
684 if (CheckedTracks.size() != 3)
688 tr(
"Please select 3 tracks to add your division") );
694 CheckedTracks, MotherID, DaughtersIDs) )
697 MotherID, DaughtersIDs);
698 if (TrackFamilyID != -1)
701 std::list<unsigned int> TrackID;
702 TrackID.push_back(MotherID);
703 std::list<unsigned int> LineageIDToCheck =
706 std::list<unsigned int>::iterator iter = DaughtersIDs.begin();
707 while(iter != DaughtersIDs.end() )
710 *iter, TrackFamilyID);
715 std::list<unsigned int> PreviousLineagesToDelete =
717 if (!LineageIDToCheck.empty())
721 PreviousLineagesToDelete);
726 DaughtersIDs.push_back(MotherID);
738 vtkMySQLDatabase* iDatabaseConnector,
739 const std::list<unsigned int> & iListTracksID,
741 std::list<unsigned int> & ioDaughtersID)
745 iDatabaseConnector,iListTracksID);
746 if (ioMotherID == -1)
750 tr(
"Can not create the division as two of your selected tracks can be the mother") );
755 std::list<unsigned int>::const_iterator iter = iListTracksID.begin();
757 unsigned int ioTraceIDToKeep = 0;
758 unsigned int ioTraceIDToDelete = 0;
759 while(iter != iListTracksID.end())
761 if (*iter != static_cast<unsigned int>(ioMotherID) )
763 std::list<unsigned int> TracksOverlappingToCheck;
764 TracksOverlappingToCheck.push_back(ioMotherID);
765 TracksOverlappingToCheck.push_back(*iter);
767 ioTraceIDToKeep, ioTraceIDToDelete, iDatabaseConnector) )
771 tr(
"Can not create the division as one daughter is overlapping the mother") );
775 ioDaughtersID.push_back(*iter);
786 unsigned int iMotherTrackID,
const std::list<unsigned int> & iDaughtersID)
788 int oTrackFamilyID = -1;
791 TrackFamily.
SetField<
unsigned int>(
"TrackIDMother", iMotherTrackID);
796 tr(
"Can not create the division as the Mother track is already mother of other daugthers") );
798 return oTrackFamilyID;
800 if(iDaughtersID.size() != 2)
802 std::cout<<
"Pb, there is more than 2 daughters to create the division !!";
803 std::cout <<
"Debug: In " << __FILE__ <<
", line " << __LINE__;
804 std::cout << std::endl;
805 return oTrackFamilyID;
807 std::list<unsigned int>::const_iterator iter = iDaughtersID.begin();
808 unsigned int TrackIDDaughterOne = *iter;
810 unsigned int TrackIDDaughterTwo = *iter;
811 TrackFamily.
SetField<
unsigned int>(
"TrackIDDaughter1", TrackIDDaughterOne);
813 TrackFamily.
SetField<
unsigned int>(
"TrackIDDaughter2", TrackIDDaughterTwo);
816 return TrackFamily.
SaveInDB(iDatabaseConnector);
822 vtkMySQLDatabase* iDatabaseConnector,
823 unsigned int iDaughterID,
unsigned int iTrackFamilyID)
827 Daughter.
SetField<
unsigned int>(
"TrackFamilyID", iTrackFamilyID);
828 Daughter.
SaveInDB(iDatabaseConnector);
834 vtkMySQLDatabase* iDatabaseConnector,
835 std::list<unsigned int> &ioTrackIDsOfTheFamilies)
838 std::list<unsigned int> DaughtersLineageID =
840 ioTrackIDsOfTheFamilies);
842 std::list<unsigned int> FirstDaugthersIDs = ioTrackIDsOfTheFamilies;
843 std::list<unsigned int>::iterator iter = FirstDaugthersIDs.begin();
844 ioTrackIDsOfTheFamilies.clear();
846 while(iter != FirstDaugthersIDs.end() )
848 std::list<unsigned int> ListDaughterID;
849 ListDaughterID.push_back(*iter);
850 std::list<unsigned int> LineageIDofDaughter =
852 if (LineageIDofDaughter.empty())
854 ioTrackIDsOfTheFamilies.push_back(*iter);
858 std::list<unsigned int> CollectionID;
859 CollectionID.push_back(LineageIDofDaughter.front());
860 std::list<unsigned int> TrackIDsofTheFamily =
862 iDatabaseConnector, CollectionID);
863 std::list<unsigned int>::iterator iterTrackIDs = TrackIDsofTheFamily.begin();
864 while (iterTrackIDs != TrackIDsofTheFamily.end() )
866 ioTrackIDsOfTheFamilies.push_back(*iterTrackIDs);
873 return DaughtersLineageID;
879 vtkMySQLDatabase *iDatabaseConnector)
881 std::list<unsigned int> ListTrackIDs =
891 std::list<unsigned int> TrackIDNotMother = std::list<unsigned int>();
892 std::list<unsigned int> CheckedTracks;
894 if(iDivisions.size())
896 CheckedTracks = iDivisions;
904 std::list<unsigned int> TrackIDsWithNoLineage = std::list<unsigned int>();
905 std::list<unsigned int> LineagesToDelete = std::list<unsigned int>();
906 if (CheckedTracks.empty() )
910 tr(
"Please select the MotherTracks you want the divisions to be deleted") );
914 std::list<unsigned int>::iterator iter = CheckedTracks.begin();
915 while (iter != CheckedTracks.end())
919 Division.
SetField(
"TrackIDMother", *iter);
921 if (TrackFamilyToDelete == -1)
923 TrackIDNotMother.push_back(*iter);
935 if (!TrackIDsWithNoLineage.empty() )
944 vtkMySQLDatabase* iDatabaseConnector,
945 std::list<unsigned int> &ioTrackIDsNoLineage,
946 std::list<unsigned int> &ioMotherLineageToDelete)
948 std::list<unsigned int> DaughtersIDs;
949 DaughtersIDs.push_back( iDivision.
GetMapValue<
unsigned int>(
"TrackIDDaughter1") );
950 DaughtersIDs.push_back( iDivision.
GetMapValue<
unsigned int>(
"TrackIDDaughter2") );
951 int MotherID = iDivision.
GetMapValue<
int>(
"TrackIDMother");
952 bool IsPartOfBiggerLineage =
true;
956 ioTrackIDsNoLineage.push_back(MotherID);
957 IsPartOfBiggerLineage =
false;
965 IsPartOfBiggerLineage);
970 if (!IsPartOfBiggerLineage)
975 ioMotherLineageToDelete.push_back(Mother.
GetMapValue<
unsigned int>(
"lineageID") );
982 std::list<unsigned int> iDaughtersID,
983 std::list<unsigned int> &ioTrackIDsNoLineage,
984 bool &ioPartOfHigherLineage)
986 std::list<unsigned int>::iterator iter = iDaughtersID.begin();
987 while (iter != iDaughtersID.end() )
1000 ioTrackIDsNoLineage.push_back(*iter);
1011 std::list<unsigned int> iTracksNoDivision)
1013 if (!iTracksNoDivision.empty() )
1015 std::string Message =
"Nothing has been done for these tracks ";
1016 std::list<unsigned int>::iterator iter = iTracksNoDivision.begin();
1017 while (iter != iTracksNoDivision.end() )
1019 Message += ConvertToString<unsigned int>(*iter);
1023 Message +=
"because they are not mothers of any divisions";
1031 vtkMySQLDatabase* iDatabaseConnector)
1034 Family.
SetField<
unsigned int>(
"TrackIDMother", iDaughterID);
1037 if (TrackFamilyID != -1)
1039 return static_cast< unsigned int >( TrackFamilyID );
1047 vtkMySQLDatabase* iDatabaseConnector)
1050 return ss_atoi<unsigned int> (Track.
GetMapValue(
"TrackFamilyID") );
1056 unsigned int iDaughterID, vtkMySQLDatabase* iDatabaseConnector,
1057 bool &ioPartOfHigherLineage)
1060 std::list<unsigned int> PreviousLineageToDelete = std::list<unsigned int>();
1061 if (!ioPartOfHigherLineage)
1063 GoDBTrackRow Daughter(iDaughterID, iDatabaseConnector);
1064 PreviousLineageToDelete.push_back( Daughter.
GetMapValue<
unsigned int>(
"lineageID") );
1066 ioPartOfHigherLineage =
true;
1071 if (TracksIDs.size() > 1)
1081 vtkMySQLDatabase* iDatabaseConnector,
unsigned int iTrackID,
1082 unsigned int iMeshTimePoint,
1083 std::list<unsigned int> &ioMotherTrackDivisionToUpdate)
1085 std::string Message =
"";
1086 unsigned int TrackMinTimePoint =
1088 unsigned int TrackMaxTimePoint =
1091 if (iMeshTimePoint > TrackMinTimePoint && iMeshTimePoint < TrackMaxTimePoint)
1096 unsigned int DivisionIDTrackIsAMother = this->
IsTheTrackAMother(iTrackID, iDatabaseConnector);
1097 unsigned int DivisionIDTrackIsADaughter = this->
IsTheTrackADaughter(iTrackID, iDatabaseConnector);
1099 if (!DivisionIDTrackIsAMother && !DivisionIDTrackIsADaughter)
1104 if (DivisionIDTrackIsAMother)
1106 if (iMeshTimePoint >= TrackMinTimePoint)
1110 iDatabaseConnector, iMeshTimePoint, DivisionIDTrackIsAMother );
1111 if (DivisionToUpdate != 0)
1113 ioMotherTrackDivisionToUpdate.push_back(DivisionToUpdate);
1117 Message =
"The mesh will not belong to any track as there is a problem with the division";
1123 if (DivisionIDTrackIsADaughter)
1125 if (iMeshTimePoint > TrackMaxTimePoint)
1130 unsigned int DivisionToUpdate =
1132 DivisionIDTrackIsADaughter);
1133 if (DivisionToUpdate != 0)
1135 ioMotherTrackDivisionToUpdate.push_back(DivisionToUpdate);
1139 Message =
"The mesh will not belong to any track as there is a problem with the division";
1149 vtkMySQLDatabase* iDatabaseConnector,
unsigned int iTimePoint,
unsigned int iTrackFamilyID )
1151 if(iTrackFamilyID != 0)
1155 iDatabaseConnector, Division.
GetMapValue<
unsigned int>(
"TrackIDDaughter1") )
1157 iDatabaseConnector, Division.
GetMapValue<
unsigned int>(
"TrackIDDaughter2") ) ) ) )
1159 return Division.
GetMapValue<
unsigned int>(
"TrackIDMother");
1169 vtkMySQLDatabase* iDatabaseConnector,
unsigned int iTimePoint,
unsigned int iTrackFamilyID )
1171 if (iTrackFamilyID != 0)
1175 iDatabaseConnector, Division.
GetMapValue<
unsigned int>(
"TrackIDMother") ) )
1177 return Division.
GetMapValue<
unsigned int>(
"TrackIDMother");
1187 vtkMySQLDatabase* iDatabaseConnector,
unsigned int iTrackID )
1189 std::list<unsigned int> Tracks;
1190 Tracks.push_back(iTrackID);
1192 iDatabaseConnector, Tracks );
1193 return oDivisionIDs;
1200 std::list<unsigned int>::const_iterator iter = iListMotherTrackIDs.begin();
1201 while (iter != iListMotherTrackIDs.end() )
1211 AddVolume(
const unsigned int& iTrackID,
const double& iVolume)
1220 AddVolumes(
const std::list< std::pair<unsigned int, double> > & iVolumes)
1222 std::list< std::pair<unsigned int, double> >::const_iterator it =
1224 while(it != iVolumes.end())
1237 std::list< std::pair<unsigned int, double> >::const_iterator it =
1239 while(it != iVolumes.end())
1250 AddVolumes(
const std::list< std::pair<unsigned int, double> > & iVolumes,
1251 unsigned int iTrackID)
1253 std::list< std::pair<unsigned int, double> >::const_iterator it =
1255 while(it != iVolumes.end())
1267 unsigned int iTrackID)
1269 std::list< std::pair<unsigned int, double> >::const_iterator it =
1271 while(it != iVolumes.end())
1286 std::list< unsigned int > ListCheckedTraces =
1288 if ( ListCheckedTraces.size() != 1 )
1292 tr(
"Please select one and only one %1 to go to")
1300 this->m_DatabaseConnector,
1302 ListCheckedTraces.front()) );
1304 int numberOfPoints = 0;
1306 points >> numberOfPoints;
1308 if( numberOfPoints > 0)
1312 while( count < numberOfPoints )
1345 std::list< unsigned int > ListCheckedTraces =
1347 if ( ListCheckedTraces.size() != 1 )
1351 tr(
"Please select one and only one %1 to go to")
1359 this->m_DatabaseConnector,
1361 ListCheckedTraces.front()) );
1363 int numberOfPoints = 0;
1364 points >> numberOfPoints;
1366 if( numberOfPoints > 0)
1387 std::vector<unsigned int>
1389 unsigned int iTrackID)
1399 unsigned int iTrackID)
void TrackIDToBeModifiedWithWidget(std::list< unsigned int > iListTracksID)
void SaveTrackStructure(vtkMySQLDatabase *iDatabaseConnector, TrackStructure *iStructure)
virtual void DisplayInfoForLastCreatedTrace(vtkMySQLDatabase *iDatabaseConnector)
Virtual pure method: get the data needed from the database for the last created trace and display the...
virtual void UpdateHighlightedElementsInVisuContainer(int iTraceID)
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
int CreateCollectionWithNoTracesNoPoints(vtkMySQLDatabase *iDatabaseConnector, NameWithColorData iColor, T iNewCollection, int iTimePoint=-1)
save the collection in the database after getting an empty bounding box and return the corresponding ...
virtual void SetColorCoding(bool IsChecked)
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 ti...
virtual void UpdateVisibleElementsInVisuContainer(int iTraceID)
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 signa...
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 i...
void AddVolumes(const std::list< std::pair< unsigned int, double > > &iVolumes)
Modify volume of the given track ID.
std::list< double * > GetCoordinateCenterBoundingBox(vtkMySQLDatabase *iDatabaseConnector, unsigned int iTraceID)
return a list of the coordinates of all the centers of the bounding boxes for all the collectionOf co...
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...
virtual void SetCollectionsTraceNames()
virtual pure method: set the std::string class members
void UpdateCurrentElementFromDB(unsigned int iTraceID, double irgba[4], bool IsVisible=false)
Update Current Element from te database.
GoFigureTrackAttributes ComputeAttributes() const
void DeleteFromDB(vtkMySQLDatabase *iDatabaseConnector)
delete from the database the row which has the same TableID
void DisplayOnlyCalculatedValuesForExistingTrack(GoFigureTrackAttributes *iTrackAttributes, unsigned int iTrackID)
display in the TW the values extracted from iTrackAttributes called when loading all tracks from data...
std::string m_CollectionName
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 conta...
int GetTraceIDWithLowestTimePoint(vtkMySQLDatabase *iDatabaseConnector, std::list< unsigned int > iListTraceIDs)
return the traceID with the lowest timepoint or -1 if there is not only one that have the lowest time...
unsigned int GetBoundedBoxTimePoint(vtkMySQLDatabase *iDatabaseConnector, unsigned int iTraceID, bool MinTimePoint=true)
get the timepoint min or max for the trace
void TrackToSplit(unsigned int iTrackID, std::list< unsigned int > iListMeshIDs)
Abstract class inherited by QGoDBContourManager,Mesh,Track,Lineage.
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...
void NewLineageToCreateFromTracks(std::list< unsigned int > iCheckedTracksIDs, unsigned int iTrackIDRoot, std::list< unsigned > iLineagesToDelete)
NameWithColorData * m_SelectedColorData
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
virtual bool SetValuesForSpecificID(int ID, vtkMySQLDatabase *iDatabaseConnector)
get the data from the database corresponding to the specific ID and put them in the map ...
void MeshesToAddToTrack(std::list< unsigned int > iListMeshes, unsigned int iTrackID)
int SaveInDB(vtkMySQLDatabase *DatabaseConnector)
int DoesThisTrackFamilyAlreadyExists(vtkMySQLDatabase *DatabaseConnector)
check if the track family already exists in the database, if yes, return the corresponding ID...
void SplitMergeTrackWithWidget()
get the trackIDs checked in the TW that will be modified with the widget and emit a signal with them ...
QString tr(const char *sourceText, const char *disambiguation, int n)
std::string m_CollectionOf
void DisplayInfoAndLoadVisuContainerForAllTracks(vtkMySQLDatabase *iDatabaseConnector)
get all the data from the database to load all the tracks for the imagingsession into the table widge...
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
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 daught...
manages a map with keys matching fields of the gofiguredatabase TrackFamily table and values of the m...
void DeleteADivision(const unsigned int &iMotherID)
std::string GetPoints(vtkMySQLDatabase *iDatabaseConnector, std::string iTraceName, unsigned int iTraceID)
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 th...
virtual void DeleteCheckedTraces(vtkMySQLDatabase *iDatabaseConnector)
delete the checked traces from the database, the TW and the container for visu
TrackContainer * m_TrackContainerInfoForVisu
virtual void DisplayInfoForAllTraces(vtkMySQLDatabase *iDatabaseConnector)
Virtual pure method: get the data needed from the database and display them in the m_Table for all tr...
double * GetVectorFromQColor(QColor iColor)
return a double rgba[4] from a QColor
std::list< unsigned int > GetListTracesIDsFromThisCollectionOf(vtkMySQLDatabase *iDatabaseConnector, std::list< unsigned int > iListTraces)
get the list of IDs belonging to the iListTraces as collectionof
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...
void LoadInfoVisuContainerForTrackFamilies(vtkMySQLDatabase *iDatabaseConnector)
get all the data from the database of the track family table and give the corresponding info to the t...
bool SetValuesForSpecificID(int ID, vtkMySQLDatabase *iDatabaseConnector)
This class describes the specificities of the GoDBTWContainerForTrackLineage for track.
this class manages the map with the keys matching the fields of the Track gofiguredatabase table and ...
std::list< unsigned int > GetListCollectionIDs(vtkMySQLDatabase *iDatabaseConnector, std::list< unsigned int > iListTracesIDs, bool ExcludeZero=true, bool Distinct=true)
get the list of IDs that are collection of iListTraces
std::list< unsigned int > GetListTracesIDsFromThisCollectionOf(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTraces)
get the collectionOf IDs for the TracesIDs found in iListTraces
void RemoveVolumes(const std::list< std::pair< unsigned int, double > > &iVolumes)
Modify volume of the given track ID.
bool CheckOverlappingTracks(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...
std::list< unsigned int > GetHighlightedElementsTraceID()
Get the list of highlighted elements TraceID.
void ImportTrackInCurrentElement(std::map< unsigned int, double * > &iMeshes)
Update the current element map then polydata.
Structure which represent a track, and used for interaction between Visualization and TableWidget...
void setText(const QString &text)
QGoDBTrackManager(int iImgSessionID, QWidget *iparent)
bool isMother(vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackID)
std::list< unsigned int > GetTrackFamilyDataFromDB(vtkMySQLDatabase *iDatabaseConnector)
void CreateCorrespondingTrackFamily(std::list< unsigned int > iDivisions=std::list< unsigned int >())
slot called when the user chose "Create a new division from checked tracks"
virtual int SaveInDB(vtkMySQLDatabase *DatabaseConnector)
save the row in the database if the TraceID is set to "0", update the existing traceRow if the TraceI...
void CheckedTracksToAddToSelectedLineage(std::list< unsigned int > iDaughtersID, unsigned int iLineageID, std::list< unsigned > iLineagesToDelete)
void AddActionsContextMenu(QMenu *iMenu)
void SetInfo(unsigned int iImgSessionID, QWidget *iParent)
set the variables class members
void SetTracksInfoContainerForVisu(TrackContainer *iContainerForVisu)
set the m_TrackContainerInfoForVisu to the iContainerForVisu
void NeedToGetDatabaseConnection()
void PrintMessage(QString iMessage, int iTimeOut=0)
void SetListOfDivisions(std::list< unsigned int > &iListOfDivisions)
void AddVolume(const unsigned int &iTrackID, const double &iVolume)
Modify volume of the given track ID.
std::list< unsigned int > GetSubLineage(const unsigned int &iTrackID)
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 t...
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 a...
void NeedToGoToTheRealLocation(double, double, double, int)
virtual void DisplayInfoForExistingTrace(vtkMySQLDatabase *iDatabaseConnector, int iTraceID)
Virtual pure method: get the data needed from the database for the existing trace with iTraceID and u...
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 pus...
std::list< unsigned int > GetTraceIDsBelongingToCollectionID(vtkMySQLDatabase *iDatabaseConnector, std::list< unsigned int > iListTraceIDs, unsigned int iCollectionID)
get the tracesIDs contained in iListTraceIDs that have iCollectionID as a collectionID ...
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...
void SaveTrackCurrentElement(vtkMySQLDatabase *iDatabaseConnector)
create or update the track contained in the current element of the track container into the database...
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
void ResetCurrentElement()
Reset Current Element to a default state.
MultiIndexContainerElementType m_CurrentElement
Current Element of the trace type.
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 vi...
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 the...
void SetField(const std::string &key, const T &value)
convert the value into a string and assign it to the key in the map
std::list< unsigned int > GetTrackFamilyID(vtkMySQLDatabase *iDatabaseConnector, std::list< unsigned int > iListTrackIDs)
return the trackFamilyIDs the track belongs to (as a mother or as a daughter)
void UpdateBoundingBoxes(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTracesIDs)
void SetTrackAttributes(GoFigureTrackAttributes *iTrackAttributes)
set m_TrackAttributes to iTrackAttributes, needs to be called before displaying the volume...
Wraps a boost multi index container of TrackStructure. This class intends to synchronize Track repres...
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 ...
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...
std::vector< unsigned int > GetTrackFamily(vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackID)
TrackStructure * UpdatePointsForATrack(const unsigned int &iTrackID, std::list< double * > &iListCenterBoundingBoxes)
get the element with iTrackID into the current element, remove it from the container, recalculate the points from the iListCenterBoundingBox and emit a signal for the current element to be saved into the database
GoDBTWContainerForTrack * m_TWContainer
void CreateDivisionPolydata(const unsigned int &iMother)
bool isMother(vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackID)
void UpdateDivisions(const std::list< unsigned int > &iListMotherTrackIDs)
update the track container for visu and consequently the divisions in the visu
void DeleteTheDivisions(std::list< unsigned int > iDivisions=std::list< unsigned int >())
slot called when the user chose "Delete the division for this tracks"
void TrackIDToEmit()
check that there is only one checked track in the TW and emit a signal with it as the checked mesh is...
virtual std::list< unsigned int > GetListHighlightedIDs()
std::pair< std::string, QColor > NameWithColorData
void AddDivision(const unsigned int &iMotherID, const unsigned int &iDaughter1ID, const unsigned int &iDaughter2ID, const bool &iVisible=true)
void AddVolume(const unsigned int &iTrackID, const double &iVolume)
void UpdateTrackPolydataForVisu(vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackID)
get the center of bounding boxes from the database for the meshes belonging to the iTrackID...
void NeedMeshesInfoForImportedTrack(unsigned int iTrackID)
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
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
virtual void DisplayInfoForTracesForSpecificTPs(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTPs)
QMenu * m_CheckedTracesMenu
vtkMySQLDatabase * m_DatabaseConnector
void DBConnectionNotNeededAnymore()
std::vector< unsigned int > GetTrackFamily(vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackID)
virtual void AddActionsContextMenu(QMenu *iMenu)
std::string GetMapValue(const std::string &key)
return the value for the field map[key] after having removed the " at the beginning and at the end of...
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 ...
void SetThePointsFromPolydata(vtkPolyData *iTrackVisu)
convert the iTrackVisu into a string and set the field 'points' of the map
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 tra...
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 si...
GoDBCollectionOfTraces * m_CollectionOfTraces
void InsertCurrentElement()
Insert Current Element in the container.
bool UpdateElementHighlightingWithGivenTraceID(const unsigned int &iId)
Update element highlighting given it TraceId.