36 #include <QStringList>
39 #include <QInputDialog>
40 #include <QFileDialog>
41 #include <QTableWidgetItem>
42 #include <QMessageBox>
44 #include <QCloseEvent>
51 #include "vtkMySQLDatabase.h"
52 #include "vtkSQLQuery.h"
53 #include "vtkStringArray.h"
54 #include "vtkStdString.h"
77 m_ContoursManager(NULL),
78 m_MeshesManager(NULL),
79 m_TracksManager(NULL),
80 m_LineagesManager(NULL),
81 m_DatabaseConnector(NULL),
82 m_IsDatabaseUsed(false),
84 m_MeshGenerationMode(false)
146 QIcon TableWidgetIcon;
148 QIcon::Normal, QIcon::Off);
172 const std::string & iNameDB,
const std::string & iServer,
173 const std::string & iUser,
const std::string & iPassword,
174 const unsigned int & iImgSessionID,
const std::string & iImgSessionName)
221 bool limitedMemory = ( iThreshold != std::numeric_limits< unsigned int >::max() );
230 if( ( nbOfTraces <= iThreshold ) || !limitedMemory )
271 unsigned int iYCoordMin,
272 unsigned int iZCoordMin,
273 unsigned int iTCoord,
274 unsigned int iXCoordMax,
275 unsigned int iYCoordMax,
276 unsigned int iZCoordMax,
277 vtkPolyData *iContourNodes)
280 unsigned int ContourID;
297 iXCoordMin, iYCoordMin, iZCoordMin, iTCoord, iXCoordMax, iYCoordMax, iZCoordMax,
302 std::list< unsigned int > ListContours;
303 ListContours.push_back(ContourID);
304 std::list< unsigned int > ListMeshes =
306 if ( !ListMeshes.empty() )
318 unsigned int iYCoordMin,
319 unsigned int iZCoordMin,
320 unsigned int iXCoordMax,
321 unsigned int iYCoordMax,
322 unsigned int iZCoordMax,
324 vtkPolyData *iMeshNodes,
331 unsigned int TrackID = 0;
349 if ( MessageToPrint !=
"" )
352 int kickedMeshID = MessageToPrint.
toInt();
358 "Warning: existing mesh at this timepoint for this track !!The track of the mesh with the meshID %1 has been reassigned to 0")
362 std::list<unsigned int> MotherTrackDivisionToUpdate;
365 unsigned int NewMeshID;
366 if (!MessageToPrint.
isEmpty() )
395 std::list< unsigned int > ListNewMeshes;
396 ListNewMeshes.push_back(NewMeshID);
411 if (!MotherTrackDivisionToUpdate.empty() )
475 unsigned int iXCoordMin,
476 unsigned int iYCoordMin,
477 unsigned int iZCoordMin,
478 unsigned int iXCoordMax,
479 unsigned int iYCoordMax,
480 unsigned int iZCoordMax,
481 vtkPolyData *iTraceNodes)
504 std::list< QGoPrintDatabase::ItemColorComboboxData >
506 std::string & ioIDToSelect)
508 std::list< ItemColorComboboxData > EmptyList = std::list< ItemColorComboboxData >();
510 if ( TraceName ==
"contour" )
514 if ( TraceName ==
"mesh" )
529 if ( TraceName !=
"contour" && TraceName !=
"mesh" )
535 unsigned int NewCollectionID = 0;
536 if ( TraceName ==
"contour" )
542 if ( TraceName ==
"mesh" )
549 NewCollectionData.first = ConvertToString< unsigned int >(NewCollectionID);
560 int iZCoord,
int iTCoord)
564 BookmarkCoord.
SetField<
int >(
"XCoord", iXCoord);
565 BookmarkCoord.
SetField<
int >(
"YCoord", iYCoord);
566 BookmarkCoord.
SetField<
int >(
"ZCoord", iZCoord);
567 BookmarkCoord.
SetField<
int >(
"TCoord", iTCoord);
584 return ListBookmarks;
670 if ( iTableName ==
"contour" )
674 if ( iTableName ==
"mesh" )
686 tr(
"Save Contour Export File"),
"",
tr(
"TextFile (*.txt)") );
709 tr(
"Save Contour Export File"),
"",
tr(
"TextFile (*.txt)") );
733 tr(
"Open Contours Export File"),
"",
734 tr(
"TextFile (*.txt)") );
739 while ( it != p.
end() )
741 emit
PrintMessage(
tr(
"Warning: Close and reopen your imagingsession once the import is done !!") );
743 std::string filename = (*it).toStdString();
776 tr(
"Open Meshes Export Files"),
"",
777 tr(
"TextFile (*.txt)") );
781 emit
PrintMessage(
tr(
"Warning: Close and reopen your imagingsession once the import is done !!") );
787 for(
int i = 0; i < p.
size(); i++ )
790 std::string filename = ( p[i] ).toStdString();
816 tr(
"Open Tracks Export File"),
"",
817 tr(
"TextFile (*.txt)") );
819 std::vector< int > NewTrackIDs = std::vector< int >();
823 emit
PrintMessage(
tr(
"Warning: Close and reopen your imagingsession once the import is done !!") );
925 SIGNAL( NewCollectionToBeCreated() ),
930 SIGNAL( AddANewCellType() ),
934 SIGNAL( AddANewSubCellType() ),
955 if (PreviousTraceName != iTraceName)
1011 std::string IDToSelect;
1012 std::list< ItemColorComboboxData > ListCollectionID =
1056 iSubCellTypeToSelect);
1059 iSubCellTypeToSelect);
1084 if ( !NewCellType.empty() )
1102 std::string NewSubCellType =
1104 if ( !NewSubCellType.empty() )
1124 if ( !NewColor.first.empty() )
1193 vtkMySQLDatabase *iDatabaseConnector)
1196 iDatabaseConnector);
1198 iDatabaseConnector);
1200 iDatabaseConnector);
1203 iDatabaseConnector);
1211 vtkMySQLDatabase *iDatabaseConnector)
1224 DisplayInfoAndLoadVisuContainerForAllContoursForSpecificTPs(
1228 DisplayInfoAndLoadVisuContainerForAllMeshesForSpecificTPs(iDatabaseConnector,
1231 iDatabaseConnector);
1234 iDatabaseConnector);
1241 vtkMySQLDatabase *iDatabaseConnector, std::list<unsigned int> iListTimePoints)
1244 iDatabaseConnector, iListTimePoints);
1246 iDatabaseConnector, iListTimePoints);
1273 this->DeleteCheckedTraces< QGoDBContourManager, QGoDBMeshManager, QGoDBContourManager >(
1284 std::list< std::pair<unsigned int, double> > temp_list =
1289 this->DeleteCheckedTraces< QGoDBMeshManager, QGoDBTrackManager, QGoDBContourManager >(
1298 this->DeleteCheckedTraces< QGoDBTrackManager, QGoDBLineageManager, QGoDBMeshManager >(
1307 this->DeleteCheckedTraces< QGoDBLineageManager, QGoDBLineageManager, QGoDBTrackManager >(
1316 this->ChangeTraceColor< QGoDBMeshManager, QGoDBContourManager >(
1325 this->ChangeTraceColor< QGoDBTrackManager, QGoDBMeshManager >(
1334 this->ChangeTraceColor< QGoDBLineageManager, QGoDBTrackManager >(
1342 iMeshAttributes,
unsigned int iMeshID)
1345 iMeshAttributes, iMeshID);
1352 iTrackAttributes,
unsigned int iTrackID)
1356 iTrackAttributes, iTrackID);
1392 SIGNAL ( NeedMeshesInfoForImportedTrack(
unsigned int) ),
1440 SIGNAL( NewCollectionFromCheckedTraces(std::list< unsigned int > ) ),
1444 SIGNAL( CheckedTracesToAddToSelectedCollection(
1445 std::list< unsigned int > ) ),
this,
1448 SIGNAL( DBConnectionNotNeededAnymore() ),
1472 SIGNAL( TraceColorToChange() ),
1480 SIGNAL ( NewCollectionFromCheckedTraces(std::list< unsigned int > ) ),
1484 SIGNAL( CheckedTracesToAddToSelectedCollection(
1485 std::list< unsigned int > ) ),
this,
1488 SIGNAL( DBConnectionNotNeededAnymore() ),
1492 SIGNAL( AddNewTraceIDInTS(std::pair< std::string, QColor > ) ),
1494 SLOT( AddANewCollectionID(std::pair< std::string, QColor > ) ) );
1496 SIGNAL( AddNewTraceIDInTS(std::pair< std::string, QColor > ) ),
1498 SLOT( AddANewCollectionID(std::pair< std::string, QColor > ) ) );
1524 SIGNAL( TraceColorToChange() ),
1534 SIGNAL( DBConnectionNotNeededAnymore() ),
1540 SIGNAL( DBConnectionNotNeededAnymore() ),
1544 SIGNAL( TrackToSplit(
unsigned int, std::list< unsigned int > ) ),
1547 std::list< unsigned int > ) ) );
1549 SIGNAL( TrackIDToBeModifiedWithWidget(std::list< unsigned int > ) ),
1553 SIGNAL( MeshesToAddToTrack(std::list< unsigned int >,
unsigned int) ),
1557 SIGNAL( AddNewTraceIDInTS(std::pair< std::string, QColor > ) ),
1559 SLOT( AddANewCollectionID(std::pair< std::string, QColor > ) ) );
1561 SIGNAL( AddNewTraceIDInTS(std::pair< std::string, QColor > ) ),
1563 SLOT( AddANewCollectionID(std::pair< std::string, QColor > ) ) );
1570 SIGNAL(CheckedTracksToAddToSelectedLineage(
1571 std::list< unsigned int >,
unsigned int,
1572 std::list<unsigned int> ) ),
this,
1574 std::list<unsigned int> ) ) );
1577 SIGNAL ( NewLineageToCreateFromTracks( std::list<unsigned int>,
unsigned int,
1578 std::list<unsigned int> )),
1581 std::list<unsigned int> ) ) );
1596 SIGNAL( NeedToGetDatabaseConnection() ),
1600 SIGNAL( DBConnectionNotNeededAnymore() ),
1604 SIGNAL( CheckedTracesToDelete() ),
1612 SIGNAL( TraceColorToChange() ),
1668 std::list< unsigned int > TrackIDs;
1669 TrackIDs.push_back(iTrackID);
1672 std::list< unsigned int > ListMeshesIDs =
1676 if ( !ListMeshesIDs.empty() )
1679 std::map< unsigned int, double * > MeshesInfo = this->
m_MeshesManager->
1680 GetMeshesInfoForImportedMesh(ListMeshesIDs);
1681 if ( !MeshesInfo.empty() )
1696 std::list< unsigned int > iListMeshIDs)
1699 std::list< unsigned int > ListMeshesForNewTrack =
1702 if(ListMeshesForNewTrack.size() != 0)
1713 std::list< unsigned int > iListCheckedMeshes)
1716 unsigned int NewTrackID =
1719 std::list< std::pair<unsigned int, double> > temp;
1721 std::list< unsigned int > ListMeshToBelongToTheTrack;
1722 std::list< unsigned int > ListMeshToReassign;
1724 std::string MessageToPrint =
1727 ListMeshToBelongToTheTrack, ListMeshToReassign);
1742 unsigned int oldMotherID = 0;
1743 unsigned int oldTrackID = 0;
1744 unsigned int newTrackID = NewTrackID;
1745 unsigned int oldDaughter = 0;
1747 std::list< std::pair<unsigned int, double> >::const_iterator it =
1749 if(it != temp.end())
1751 oldTrackID = (*it).first;
1755 std::vector<unsigned int> family =
1758 if(family.size() > 0)
1760 oldMotherID = family[1];
1761 if(family[2] == oldTrackID)
1763 oldDaughter = family[3];
1767 oldDaughter = family[2];
1770 std::list<unsigned int> oldList;
1771 oldList.push_back(oldMotherID);
1777 if ( MessageToPrint !=
"" )
1786 this->AddCheckedTracesToCollection< QGoDBMeshManager, QGoDBTrackManager >(
1788 NewTrackID, ListMeshToBelongToTheTrack);
1791 if(family.size() > 0)
1794 std::list<unsigned int> newdaughter;
1795 newdaughter.push_back(oldMotherID);
1796 newdaughter.push_back(oldDaughter);
1797 newdaughter.push_back(newTrackID);
1798 this->m_TracksManager->CreateCorrespondingTrackFamily(newdaughter);
1808 std::list< std::list< unsigned int > > iListsCheckedMeshes)
1810 std::list< std::list< unsigned int > >::iterator iter = iListsCheckedMeshes.begin();
1811 while ( iter != iListsCheckedMeshes.end() )
1823 std::list< unsigned int > iListCheckedContours)
1826 unsigned int NewMeshID =
1830 this->AddCheckedTracesToCollection< QGoDBContourManager, QGoDBMeshManager >(
1832 NewMeshID, iListCheckedContours);
1843 std::list< unsigned int > iListCheckedTracks,
unsigned int iTrackRoot,
1844 std::list< unsigned int > iListLineagesToDelete)
1847 unsigned int NewLineageID =
1852 (iListCheckedTracks, NewLineageID, iListLineagesToDelete);
1862 this->AddCheckedTracesToCollection< QGoDBContourManager, QGoDBMeshManager >
1876 std::list< unsigned int > ListMeshToBelongToTheTrack;
1877 std::list< unsigned int > ListNullMeshToBelongToTheTrack;
1878 std::list< std::pair<unsigned int, double> > temp;
1880 if ( iTrackID == 0 )
1882 ListMeshToBelongToTheTrack = iListMeshes;
1889 std::list< unsigned int > ListMeshToReassign;
1890 std::string MessageToPrint =
1893 ListMeshToBelongToTheTrack, ListMeshToReassign);
1905 ListMeshToBelongToTheTrack, ListNullMeshToBelongToTheTrack).
toStdString();
1914 if ( MessageToPrint !=
"" )
1921 this->AddCheckedTracesToCollection< QGoDBMeshManager, QGoDBTrackManager >(
1923 iTrackID, ListMeshToBelongToTheTrack);
1926 this->m_MeshesManager->ModifyTrackIDInVisuContainer(iTrackID,
1927 ListMeshToBelongToTheTrack,
1928 ListNullMeshToBelongToTheTrack);
1937 std::map<
unsigned int, std::list< unsigned int > > iListMeshesWithTracks)
1939 std::map< unsigned int, std::list< unsigned int > >::iterator iter =
1940 iListMeshesWithTracks.begin();
1941 while ( iter != iListMeshesWithTracks.end() )
1953 unsigned int SelectedTrackID =
1963 std::list< unsigned int > iTrackIDs)
1967 GetMeshesInfoFromDBAndCreateContainerForVisu(
1975 std::list< std::list< unsigned int > > ListTracksToCreate =
1977 std::map< unsigned int, std::list< unsigned int > > ListTracksToUpdate =
1981 if ( !ListTracksToCreate.empty() )
1985 if ( !ListTracksToUpdate.empty() )
2002 std::list<unsigned int> iListDaughters,
unsigned int iLineageID,
2003 std::list<unsigned int> iListLineagesToDelete)
2005 if (!iListLineagesToDelete.empty() )
2007 this->DeleteListTraces< QGoDBLineageManager, QGoDBLineageManager > (
2009 iListLineagesToDelete,
true);
2012 if (!iListDaughters.empty() )
2016 this->AddCheckedTracesToCollection< QGoDBTrackManager, QGoDBLineageManager >(
2048 std::list<unsigned int>
2051 const unsigned int& iNewTimePoint)
2058 std::list<unsigned int> listToRemove;
2061 std::list<unsigned int>::iterator it_listToRemove = listToRemove.begin();
2064 std::list<unsigned int> listToAdd;
2067 listToAdd.push_back(iNewTimePoint-1);
2069 listToAdd.push_back(iNewTimePoint);
2070 listToAdd.push_back(iNewTimePoint+1);
2072 std::list<unsigned int>::iterator it_listToAdd = listToAdd.begin();
2076 std::list<unsigned int> listCommonT;
2077 while(it_listToRemove != listToRemove.end())
2079 while(it_listToAdd != listToAdd.end())
2081 if(*it_listToRemove == *it_listToAdd)
2089 listCommonT.push_back(*it_listToRemove);
2093 it_listToAdd = listToAdd.begin();
2099 std::list<unsigned int>::iterator it_listCommonT = listCommonT.begin();
2100 while(it_listCommonT != listCommonT.end())
2102 listToRemove.remove(*it_listCommonT);
2103 listToAdd.remove(*it_listCommonT);
2108 if(listToRemove.size() > 0)
2118 if(listToAdd.size() > 0)
2121 DisplayInfoAndLoadVisuContainerForAllContoursForSpecificTPs(
2125 DisplayInfoAndLoadVisuContainerForAllMeshesForSpecificTPs(
2140 std::list<unsigned int>
the QGoDBBookmarkManager manages the interactions between the user and the database for the Bookmark ...
NamesDescrContainerType GetListExistingEntities(vtkMySQLDatabase *iDatabaseConnector)
return the list of all the existing entities stored in the database
std::vector< int > GetVectorNewContourIDs()
return a vector of the IDs for the contours read from the import file and saved in the database ...
std::string toStdString() const
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 timepoi...
void SetTSListSubCellTypes(std::string iSubCellTypeToSelect="")
get the list of subcelltypes from the database, put them in the Trace Settings combobox and if the st...
void ImportContours()
get the data needed from the import file to save the contours listed in it, including the color...
void PassDBConnectionToMeshesManager()
open the connection to the database and pass it to the MeshesManager
void AddNewCellType()
call the m_CellTypeManager to add a new celltype (ask the user to enter name+description and save it ...
bool IsDatabaseUsed()
return a bool to know if the user is using the database or not
QString & append(QChar ch)
void UpdateSelectedTimePoint(int iTimePoint)
void SetTSListCellTypesWithPreviousSelectedOne()
get the list of celltypes from the database, put them in the Trace Settings combobox and the combobox...
unsigned int CreateNewLineageWithTrackRoot(vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackRoot)
create a new lineage with IDRoot in the database, add it in the TW and in the visu container ...
void SetLineagesInfoContainersForVisu(LineageContainer *iContainerForVisu, TrackContainer *iTrackContainerInfoForvisu)
set the m_LineageContainerInfoForVisu and the m_TrackContainerInfoForVisu to the iContainerForVisu an...
void CreateNewTrackFromListMeshes(std::list< unsigned int > iListMeshes)
create a new track and call the AddCheckedTracesToCollection template method to add the meshes from t...
void CheckShowRows()
if m_IsShowOnlyCurrentTimePointOn is true, call the method to show only the rows for the current time...
void CreateNewMeshFromCheckedContours(std::list< unsigned int > iListCheckedContours)
slot connected to the signal NewCollectionFromCheckedTraces() emitted by the m_ContoursManager, emit the signal NewMeshToGenerate for the visu after creating a new mesh and calling the AddCheckedTracesToCollection template method.
the QGoDBSubCellTypeManager manages the interactions between the user and the database for the SubCel...
void DeleteCheckedTracks()
slot connected to the signal TracesToDelete() emitted by the m_TracksManager
void NeedToGoToTheLocation(int XCoord, int YCoord, int ZCoord, int TCoord)
signal emitted when a signal is emitted from a m_TraceManager for "go to the trace " from the context...
void AddCheckedContoursToSelectedMesh(std::list< unsigned int > iListCheckedContours)
slot connected to the the signal CheckedTracesToAddToSelectedCollection emitted by m_ContoursManager...
std::string CheckListMeshesFromDifferentTimePoints(vtkMySQLDatabase *iDatabaseConnector, std::list< unsigned int > iListMeshIDs, std::list< unsigned int > &ioListMeshIDsToBePartOfTrack, std::list< unsigned int > &ioListMeshIDsToReassign)
check if in the iListMeshIDs, several have the same timepoint, if so, return the list of meshIDs that...
void SetMeshesManager()
create the m_MeshesManager and its SLOT/SIGNAL connection
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 ~QGoPrintDatabase()
Destructor.
virtual bool DeleteEntity(vtkMySQLDatabase *iDatabaseConnector)
show the list of the existing entities so the user can choose the ones he wants to delete...
unsigned int CreateNewMeshWithNoContourNoPoints(vtkMySQLDatabase *iDatabaseConnector)
void AddVolumes(const std::list< std::pair< unsigned int, double > > &iVolumes)
Modify volume of the given track ID.
void NeedToGoToTheRealLocation(double XCoord, double YCoord, double ZCoord, int TCoord)
bool CloseDatabaseConnection(vtkMySQLDatabase *DatabaseConnector)
return true if the connection has been closed, false if the connection was already closed ...
std::list< unsigned int > GetVisibleTimePoints()
void DeleteCheckedLineages()
slot connected to the signal TracesToDelete() emitted by the m_LineagesManager
bool m_TraceSettingsVisible
void DisplayOnlyCalculatedValuesForExistingTrack(GoFigureTrackAttributes *iTrackAttributes, unsigned int iTrackID)
display in the TW the values extracted from iTrackAttributes called when loading all tracks from data...
void setIcon(const QIcon &icon)
QString CheckExistingMeshesForTheTrack(unsigned int iTrackID, vtkMySQLDatabase *iDatabaseConnector, int iTCoord)
if the track has already a mesh assigned for the current timepoint, the track of the previous mesh wi...
QGoDBBookmarkManager * m_BookmarkManager
void SetTracksManager()
create the m_TracksManager and its SLOT/SIGNAL connection
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...
void DeleteBookmark(vtkMySQLDatabase *iDatabaseConnector)
delete the bookmarks from the database from a list the user selects and send a signal to tell that th...
void PrintVolumeAreaForMesh(GoFigureMeshAttributes *iMeshAttributes, unsigned int iMeshID)
display in the table widget the volume and area from iMeshAttributes for iMeshID
void SplitTheTrack(unsigned int iTrackID, std::list< unsigned int > iListMeshIDs)
split the checked track: a new track is created with the checked mesh and the meshes with timepoint s...
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...
void SetTSListColorsWithPreviousSelectedOne()
get the list of colors from the database, put them in the Trace Settings combobox and the combobox wi...
vtkMySQLDatabase * OpenDatabaseConnection(std::string ServerName, std::string login, std::string Password, std::string DBName)
void DeleteSubCellType()
call the m_SubCellTypeManager to delete subcelltypes (display all the subcelltypes for the user to se...
void TraceToReEdit(unsigned int)
QGoDBBookmarkManager::NamesDescrContainerType NamesDescrContainerType
std::vector< int > GetVectorNewMeshIDs()
return a vector of the IDs for the meshes read from the import file and saved in the database ...
unsigned int SaveNewContourFromVisu(int iTCoord, unsigned int iXCoordMin, unsigned int iYCoordMin, unsigned int iZCoordMin, unsigned int iXCoordMax, unsigned int iYCoordMax, unsigned int iZCoordMax, vtkPolyData *iTraceNodes, vtkMySQLDatabase *iDatabaseConnector, unsigned int iMeshID)
QGoDBMeshManager * m_MeshesManager
double GetVolume(unsigned int iMeshID)
Get volume of given mesh ID.
void CreateConnectionsForTraceSettingsWidget(QGoTraceSettingsWidget *iTraceSettingsWidget)
create all the connections between the QGoPrintDatabase and the QGoTraceSettingsWidget (TS) ...
void SetDatabaseConnection(vtkMySQLDatabase *iDatabaseConnector)
set the m_DatabaseConnection to iDatabaseConnector
std::list< std::pair< unsigned int, double > > GetListVolumes()
Get volume of checked mesh IDs.
void ChangeTrackColor()
slot connected to the TraceColorToChange() emitted by the m_MeshesManager
std::list< unsigned int > m_VisibleTimePoints
void AddListMeshesToATrack(std::list< unsigned int > iListMeshes, unsigned int iTrackID)
add the meshes to the iTrackID after checking that there are no meshes at the same timepoint in the s...
void UpdateBoundingBoxes(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTracesIDs)
update the bounding boxes for the meshes with no points
void NewMeshToGenerate(std::list< unsigned int > ListContourIDs, int iNewMeshID)
manages a map with keys matching fields of the gofiguredatabase Coordinate table and values of the ma...
void DisplayInfoAndLoadVisuContainerForAllContours(vtkMySQLDatabase *iDatabaseConnector)
get all the data from the database to load all the contours for the imagingsession into the table wid...
void SetTraceNameForTableWidget(std::string iTraceName)
update the traceSettingswidget for the trace with the corresponding list of collectionID and set the ...
QString tr(const char *sourceText, const char *disambiguation, int n)
void DisplayInfoAndLoadVisuContainerForAllTracks(vtkMySQLDatabase *iDatabaseConnector)
get all the data from the database to load all the tracks for the imagingsession into the table widge...
void FillTableFromDatabase(const unsigned int &iTreshold)
Create the QTableWidgetChild,get the columns names and the values stored in the database, display them in the QTableWidgetChild and fill the info for the contours and meshes.
void UpdateLastSelectedOneAsCollection()
void DeleteCheckedContours()
slot connected to the signal TracesToDelete() emitted by the m_ContoursManager
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 timepoi...
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...
void SplitMergeTracksWithWidget(std::list< unsigned int > iTrackIDs)
slot called after signal TrackIDToBeModifiedWithWidget sent by tracksManager, display the checked tra...
int SaveInDB(vtkMySQLDatabase *DatabaseConnector)
save the coordinate in the database and return the ID of the new created coordinate or the ID of the ...
std::list< ItemColorComboboxData > GetListCollectionIDFromDB(vtkMySQLDatabase *iDatabaseConnector, std::string &ioIDToSelect)
get the collection id with their corresponding color from the database
std::string InWhichTableAreWe()
Return the Name of the tab currently used in the table widget, which correspond to the TraceName of t...
QGoDBContourManager * m_ContoursManager
unsigned int SaveNewMeshWithNoTrackFromVisu(unsigned int iXCoordMin, unsigned int iYCoordMin, unsigned int iZCoordMin, unsigned int iXCoordMax, unsigned int iYCoordMax, unsigned int iZCoordMax, int iTShift, vtkPolyData *iTraceNodes, vtkMySQLDatabase *iDatabaseConnector, GoFigureMeshAttributes *iMeshAttributes)
void GetContentAndDisplayAllTracesInfo(vtkMySQLDatabase *iDatabaseConnector)
get the data from the database for contours, meshes and tracks, display them in the TableWidget and l...
void AddBookmark(int iXCoord, int iYCoord, int iZCoord, int iTCoord)
void DisplayInfoAndLoadVisuContainerForAllLineages(vtkMySQLDatabase *iDatabaseConnector)
get all the data from the database to load all the lineages for the imagingsession into the table wid...
void AddABookmark(int iCoordID, vtkMySQLDatabase *iDatabaseConnector)
execute the dialog asking the user to enter a name and a description, validates the name...
unsigned int SaveNewContourForMeshToContours(unsigned int iXCoordMin, unsigned int iYCoordMin, unsigned int iZCoordMin, unsigned int iXCoordMax, unsigned int iYCoordMax, unsigned int iZCoordMax, vtkPolyData *iTraceNodes)
save a new contour in the database, the TW and the container for the contours to sphere action ...
void SaveGeneratedMeshFromVisu(unsigned int iXCoordMin, unsigned int iYCoordMin, unsigned int iZCoordMin, unsigned int iXCoordMax, unsigned int iYCoordMax, unsigned int iZCoordMax, vtkPolyData *iTraceNodes, vtkMySQLDatabase *iDatabaseConnector, GoFigureMeshAttributes *iMeshAttributes)
void ShowHideTraceSettingsFromContextMenu(bool isVisible)
show/hide the Trace Settings widget depending on the checkstate of the action in the context menu of ...
void SaveMeshFromVisuInDB(unsigned int iXCoordMin, unsigned int iYCoordMin, unsigned int iZCoordMin, unsigned int iXCoordMax, unsigned int iYCoordMax, unsigned int iZCoordMax, int iTCoord, vtkPolyData *iMeshNodes, GoFigureMeshAttributes *iMeshAttributes, int iTrackID=-1)
save the mesh into the database for a mesh generated in the visualization, if the mesh is an updated ...
QString fromUtf8(const char *str, int size)
void ExportMeshes()
get all the imagingsession info,the info for the meshes with points(that can be visualized), the tracks they belong to and the lineages the previous tracks belong to from the database and put them in a text file
virtual bool DeleteEntity(vtkMySQLDatabase *iDatabaseConnector)
show the list of the existing entities so the user can choose the ones he wants to delete...
void LoadInfoVisuContainerForTrackFamilies(vtkMySQLDatabase *iDatabaseConnector)
get all the data from the database of the track family table and give the corresponding info to the t...
QStackedWidget * m_StackedTables
void DeleteCellType()
call the m_CellTypeManager to delete celltypes (display all the celltypes for the user to select the ...
void PrintMessage(QString iMessage, int iTimeOut=0)
void ChangeLineageColor()
slot connected to the TraceColorToChange() emitted by the m_MeshesManager
std::list< unsigned int > GetListTracesIDsFromThisCollectionOf(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTraces)
get the collectionOf IDs for the TracesIDs found in iListTraces
void GetContentAndDisplayAllTracesInfoFor3TPs(vtkMySQLDatabase *iDatabaseConnector)
QGoTraceSettingsWidget * GetTraceSettingsWidget()
return the TraceSettingsDockWidget
void RemoveVolumes(const std::list< std::pair< unsigned int, double > > &iVolumes)
Modify volume of the given track ID.
int * m_SelectedTimePoint
unsigned int SaveReeditedContourFromVisu(unsigned int iXCoordMin, unsigned int iYCoordMin, unsigned int iZCoordMin, unsigned int iTCoord, unsigned int iXCoordMax, unsigned int iYCoordMax, unsigned int iZCoordMax, vtkPolyData *iContourNodes, vtkMySQLDatabase *iDatabaseConnector)
update the bounding box and the points for the checked contour and return the contourid ...
void SaveNewCollectionFromTraceWidgetInDBAndTW()
Add the new collection in the database,add a row in TW and update the colorcombobox.
int toInt(bool *ok, int base) const
void DisplayOnlyVolumeAreaForExistingMesh(GoFigureMeshAttributes *iMeshAttributes, unsigned iMeshID)
display in the TW the volume and area extracted from iMeshAttributes called when loading all meshes f...
Wraps a boost::multi_index_container of ContourMeshStructure. This class is specialized for the means...
void ImportContours()
get the info from a textfile, save it into the database, update the container for visu and the TW ...
void SetCurrentTimePoint(int *iTimePoint)
set the pointer to the current timepoint
std::vector< int > ImportTracks()
get the info from a textfile, save it into the database, update the container for visu and the TW and...
void RemoveTracesFromTWAndContainerForVisuForSpecificTPs(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTPs)
void SetTSListColors(std::string iColorToSelect="")
get the data for the colorcombobox from the database, put them in the Trace Settings colorcombobox an...
QGoDBTrackManager * m_TracksManager
export the data from the database into a textfile
void SetContoursInfoContainerForVisu(ContourContainer *iContainerForVisu)
set the m_ContourContainerInfoForVisu to the iContainerForVisu
This class manages the database queries, the table widget and the data from the database in the Conta...
void CleanTWAndContainerForGivenTimePoint(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iTimePoints)
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
QGoTraceSettingsWidget::ItemColorComboboxData ItemColorComboboxData
QGoDBCellTypeManager * m_CellTypeManager
void addPixmap(const QPixmap &pixmap, Mode mode, State state)
void ExportContours()
get all the imagingsession info,the info for the contours, the meshes they belong to and the tracks t...
void ReEditTrace(unsigned int iTraceID)
emit a signal TraceToReedit and set m_ReeditMode to true
This class get the data of traces from a textfile and save them into the GoFigure Database...
void DeleteCheckedMeshes()
slot connected to the signal Traces TracesToDelete() emitted by the m_MeshesManager ...
void SetTSListCellTypes(std::string iCellTypeToSelect="")
get the list of celltypes from the database, put them in the Trace Settings combobox and if the strin...
void SetConnectionsBetweenTheInstancesOfTraceSettings()
set the tracesettings widget to be in the mainwindow toolbar and the connection between the 2 instanc...
std::list< unsigned int > GetMeshesWithTimePointInfToTheCheckedOne(unsigned int iTrackID, vtkMySQLDatabase *iDatabaseConnector, std::list< unsigned int > iListMeshesBelongingToTrack)
for the track, get the list of its meshes with a timepoint inferior than the checked mesh ...
void ChangeMeshColor()
slot connected to the TraceColorToChange() emitted by the m_MeshesManager
ItemColorComboboxData AddANewColor(vtkMySQLDatabase *iDatabaseConnector)
ask the user the color he wants, the name, description of the new color and saves it in the database...
unsigned int m_ImgSessionID
void TheTraceHasChanged(int iIndex)
slot connected to the combobox for the trace in the trace settings widget
QGoDBLineageManager * m_LineagesManager
void SetTracesManager()
set all the traces manager
void SetTracksInfoContainerForVisu(TrackContainer *iContainerForVisu)
set the m_TrackContainerInfoForVisu to the iContainerForVisu
void PassDBConnectionToLineagesManager()
open the connection to the database and pass it to the LineagesManager
void CleanTWAndContainerForGivenTimePoint(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iTimePoints)
void SaveContoursFromVisuInDB(unsigned int iXCoordMin, unsigned int iYCoordMin, unsigned int iZCoordMin, unsigned int iTCoord, unsigned int iXCoordMax, unsigned int iYCoordMax, unsigned int iZCoordMax, vtkPolyData *iContourNodes)
save a new contour from the visu into the database, update the table widget and the CurrentElement of...
void UpdateSelectedCollectionForTableWidget(std::string iTableName)
void AddVolume(const unsigned int &iTrackID, const double &iVolume)
Modify volume of the given track ID.
void SetContoursManager()
create the m_ContoursManager and its SLOT/SIGNAL connection
QGoTraceSettingsWidget * m_TraceSettingsWidgetForToolBar
bool blockSignals(bool block)
Wraps a boost multi index container of LineageStructure. This class intends to synchronize Lineage re...
void AddCheckedTracksToSelectedLineage(std::list< unsigned int > iListDaughters, unsigned int iLineageID, std::list< unsigned int > iListLineagesToDelete)
call the AddCheckedTracesToCollection template and give the info to the lineages manager to create th...
void SetContoursContainer(ContourContainer *iContoursContainer)
set the pointer m_TraceInfoForVisu of the ContoursManager to iContoursContainer
QGoDBColorManager * m_ColorManager
QGoTableWidget * GetTableWidget()
get the m_Table
vtkMySQLDatabase * m_DatabaseConnector
void AddNewColor()
call the m_ColorManager to add a new color (ask the user to choose the color +enter name+description ...
QGoTraceSettingsWidget * GetTraceSettingsWidgetForToolBar()
bool m_MeshGenerationMode
void PassDBConnectionToTracksManager()
open the connection to the database and pass it to the TracksManager
void SetLineagesContainers(LineageContainer *iContainer, TrackContainer *iTrackContainer)
set the pointer m_LineageInfoForVisu of the LineagesManager to iContainer
GoDBCoordinateRow GetCoordinateForBookmark(std::string iName)
void SetMeshesInfoContainerForVisu(MeshContainer *iContainerForVisu)
set the m_MeshContainerInfoForVisu to the iContainerForVisu
void CreateNewLineageFromTracks(std::list< unsigned int > iListCheckedTracks, unsigned int iTrackIDRoot, std::list< unsigned int > iLineagesToDelete)
slot connected to the signal NewLineageToCreateFromTracks() emitted by the m_TracksManager ...
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 CreateContextMenu(const QPoint &iPos)
std::string m_ImgSessionName
void SetField(const std::string &key, const T &value)
convert the value into a string and assign it to the key in the map
int GetNumberOfElementForTraceAndTimePoint(std::string iTrace, int iTimePoint)
Wraps a boost::multi_index_container of ContourMeshStructure. This class is specialized for the means...
void SetLineagesManager()
create the m_LineagesManager and its SLOT/SIGNAL connection
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 ...
void ImportMeshes()
get the info from a textfile, save it into the database, update the container for visu and the TW ...
the QGoDBCellTypeManager manages the interactions between the user and the database for the celltype ...
void RemoveTracesFromTWAndContainerForVisuForSpecificTPs(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTPs)
void UpdateBoundingBoxes(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTracesIDs)
QGoPrintDatabase(QWidget *iParent=0)
Constructor.
Wraps a boost multi index container of TrackStructure. This class intends to synchronize Track repres...
void AddCheckedMeshesToSelectedTrack(std::list< unsigned int > iListCheckedMeshes)
slot connected to the the signal CheckedTracesToAddToSelectedCollection emitted by m_MeshesManager...
void OpenBookmarksToUpdate()
void SetTSListCollectionID()
get a list of the IDs with their colors for the collection corresponding to the tracename, for the given timepoint if the collection is a mesh or for all timepoints for tracks and lineages, update the Trace Settings colorcombobox and select the corresponding ID in the combobox if the string is not empty
std::vector< unsigned int > GetTrackFamily(vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackID)
QGoDBSubCellTypeManager * m_SubCellTypeManager
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFlags< QFileDialog::Option > options)
void ImportMeshes()
get the data needed from the import file to save the meshes listed in it, including the color...
void AddNewSubCellType()
call the m_SubCellTypeManager to add a new subcelltype (ask the user to enter name+description and sa...
void InitializeTheComboboxesNotTraceRelated()
Initialize or reinitialized the celltype,subcelltype and color list from the database into the traceS...
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 PassDBConnectionToContoursManager()
open the connection to the database and pass it to the ContoursManager
This class manages the database queries, the table widget and the data from the database in the Conta...
void PrintCalculatedValuesForTrack(GoFigureTrackAttributes *iTrackAttributes, unsigned int iTrackID)
display in the table widget the values from iTrackAttributes for iTrackID
void PassMeshesInfoForImportedTrack(unsigned int iTrackID)
get the info needed for track from the meshcontainer, and update the points of the track container (f...
void SetSelectedColor(NameWithColorData *iColorData)
set the pointer to the current selected color
void SetSelectedCollection(NameWithColorData *iCollectionData)
set the pointer to the selected collection data
the QGoDBColorManager manages the interactions between the user and the database for the color DBTabl...
void DisplayInfoAndLoadVisuContainerForAllMeshes(vtkMySQLDatabase *iDatabaseConnector)
get all the data from the database to load all the meshes for the imagingsession into the table widge...
void SetTracksContainer(TrackContainer *iContainer)
set the pointer m_TrackInfoForVisu of the TracksManager to iTracksContainer
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFlags< QFileDialog::Option > options)
void ImportTracks()
get the data needed from the import file to save the tracks listed in it, including the color...
QGoTraceSettingsWidget * m_TraceSettingsWidget
void DeleteColor()
call the m_ColorManager to delete colors (display all the colors for the user to select the ones he w...
This class manages the database queries, the table widget and the data from the database in the Conta...
int NumberOfElementForGivenImagingSessionAndTrace(vtkMySQLDatabase *DatabaseConnector, unsigned int iImagingSession, const std::string &iTrace)
void SaveNewMeshForMeshToContours(int iNumberOfContours)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
std::vector< int > GetVectorNewTracksIDs()
return a vector of the IDs for the tracks read from the the import file and saved in the database ...
std::list< ItemColorComboboxData > GetListExistingColors(vtkMySQLDatabase *iDatabaseConnector)
get the list of the existing colors from the database
void SetSelectedSubCellType(std::string *iSubCellType)
set the m_SelectedSubCelltype to iSubCelltype
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
void SetDatabaseVariables(const std::string &iNameDB, const std::string &iServer, const std::string &iUser, const std::string &iPassword, const unsigned int &iImgSessionID, const std::string &iImgSessionName)
set all the values needed for the database
NamesDescrContainerType GetListBookmarks()
unsigned int SaveNewMeshFromVisu(unsigned int iXCoordMin, unsigned int iYCoordMin, unsigned int iZCoordMin, unsigned int iXCoordMax, unsigned int iYCoordMax, unsigned int iZCoordMax, int iTShift, vtkPolyData *iTraceNodes, vtkMySQLDatabase *iDatabaseConnector, GoFigureMeshAttributes *iMeshAttributes)
std::string AddAnEntity(vtkMySQLDatabase *iDatabaseConnector)
execute the dialog asking the user to enter a name and a description, validates the name...
void destroyed(QObject *obj)
This class manages the database queries, the table widget and the data from the database in the Conta...
void SetSelectedCellType(std::string *iCellType)
set the m_SelectedCelltype to iCelltype
bool NeedTraceSettingsToolBarVisible()
check if the tracesettingsWidget is visible, if not, return true.
QStringList getOpenFileNames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFlags< QFileDialog::Option > options)
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 SetMeshesContainer(MeshContainer *iMeshesContainer)
set the pointer m_TraceInfoForVisu of the MeshesManager to iMeshesContainer
void SetTSListSubCellTypesWithPreviousSelectedOne()
get the list of subcelltypes from the database, put them in the Trace Settings combobox and the combo...
void RemoveTracesFromListTimePoints(vtkMySQLDatabase *iDatabaseConnector, std::list< unsigned int > iListTimePoints)
int NumberOfElementForGivenImagingSessionAndTraceForGivenTimePoint(vtkMySQLDatabase *DatabaseConnector, unsigned int iImagingSession, const std::string &iTrace, int iTimePoint)
std::list< unsigned int > UpdateTableWidgetAndContainersForGivenTimePoint(const unsigned int &iNewTimePoint)
Update the table widget and the visualization container contents based on the given time point and th...