39 #include <QMessageBox>
46 this->
SetInfo(iImgSessionID, iparent);
68 this->SetTracesInfoContainerForVisuTemplate< ContourContainer >(
86 vtkMySQLDatabase *iDatabaseConnector)
88 this->DisplayInfoAndLoadVisuContainerWithAllTraces< GoDBTWContainerForContourMesh >
96 vtkMySQLDatabase *iDatabaseConnector,
const std::list<unsigned int> & iListTPs)
98 this->DisplayInfoAndLoadVisuContainerWithAllTracesForSpecificTPs< ContourMeshContainer >
106 vtkMySQLDatabase *iDatabaseConnector,
const std::list<unsigned int> & iListTPs)
112 std::list<unsigned int> ListIDs =
114 iDatabaseConnector, iListTPs);
115 std::list<ContourMeshContainer::MultiIndexContainerElementType> list_of_traces =
117 GetListStructureFromDB<ContourMeshContainer::MultiIndexContainerElementType>(
128 const std::list<unsigned int> & iListTPs)
152 vtkMySQLDatabase *iDatabaseConnector)
157 this->DisplayInfoForAllTracesTemplate< GoDBTWContainerForContourMesh >(
158 this->
m_TWContainer, iDatabaseConnector, Qt::Unchecked, IndexShowColumn);
165 vtkMySQLDatabase *iDatabaseConnector,
166 const std::list<unsigned int> & iListTPs)
169 this->DisplayInfoForTracesForSpecificTPsTemplate< GoDBTWContainerForContourMesh >(
170 this->
m_TWContainer, iDatabaseConnector, Qt::Unchecked, iListTPs,
178 vtkMySQLDatabase *iDatabaseConnector)
180 this->DisplayInfoForLastCreatedTraceTemplate< GoDBTWContainerForContourMesh >(
188 vtkMySQLDatabase *iDatabaseConnector,
int iTraceID)
190 this->DisplayInfoForExistingTraceTemplate< GoDBTWContainerForContourMesh >(
199 vtkMySQLDatabase *iDatabaseConnector,
200 const std::list<unsigned int> & iListTPs)
202 this->RemoveTracesFromTWAndContainerForVisuForSpecificTPsTemplate< ContourMeshContainer >
224 tr(
"Generate a new mesh from checked contours"),
243 vtkMySQLDatabase *iDatabaseConnector)
245 return this->UpdateTheTracesColorTemplate< GoDBContourRow, ContourMeshContainer >(
254 unsigned int iXCoordMin,
unsigned int iYCoordMin,
unsigned int iZCoordMin,
255 unsigned int iXCoordMax,
unsigned int iYCoordMax,
256 unsigned int iZCoordMax, vtkPolyData *iTraceNodes,
257 vtkMySQLDatabase *iDatabaseConnector,
258 unsigned int iMeshID)
269 int NewContourID = this->CreateNewTraceInDBFromVisu< GoDBContourRow >(
270 iXCoordMin, iYCoordMin, iZCoordMin, iTCoord,
271 iXCoordMax, iYCoordMax, iZCoordMax, iTraceNodes,
273 iDatabaseConnector, NewContour, iMeshID);
288 unsigned int iYCoordMin,
289 unsigned int iZCoordMin,
290 unsigned int iTCoord,
291 unsigned int iXCoordMax,
292 unsigned int iYCoordMax,
293 unsigned int iZCoordMax,
294 vtkPolyData *iContourNodes,
295 vtkMySQLDatabase *iDatabaseConnector)
297 unsigned int TraceID =
303 iYCoordMax, iZCoordMax, iContourNodes, iDatabaseConnector,
305 ReeditedContour.
SaveInDB(iDatabaseConnector);
315 std::list< unsigned int > ListCheckedTraces =
317 if ( ListCheckedTraces.empty() )
321 tr(
"Please select the %1 you want to reedit")
327 if ( ListCheckedTraces.size() != 1 )
331 tr(
"Please select only one %1 to reedit")
346 const std::vector< int > & iVectorImportedTraces,
347 vtkMySQLDatabase *iDatabaseConnector)
351 this->
m_TWContainer, iVectorImportedTraces, iDatabaseConnector);
354 UpdateVisualizationForGivenIDs< std::vector< int > >(
355 iVectorImportedTraces);
363 this->DeleteTracesTemplate< ContourMeshContainer >(iDatabaseConnector,
382 UpdateElementHighlightingWithGivenTraceID(iTraceID);
391 UpdateElementVisibilityWithGivenTraceID(iTraceID);
398 vtkMySQLDatabase *iDatabaseConnector,
399 std::list< unsigned int > iListTraceIDs)
401 this->GetTracesInfoFromDBAndModifyContainerForVisuTemplate< ContourContainer >(
410 this->SetColorCodingTemplate< ContourMeshContainer >(
441 std::list< unsigned int > ListCheckedContours =
443 if ( !ListCheckedContours.empty() )
446 std::list< unsigned int >::iterator iter = ListCheckedContours.begin();
448 while ( iter != ListCheckedContours.end() )
450 unsigned int TimepointContour =
453 if ( TimepointContour !=
458 "To see only the contours from the current timepoint in the table, right click on the table and select 'Show only in the table the contours for the current timepoint' ") );
462 tr(
"Please select only contours from the current timepoint: %1 !!")
480 const std::list<unsigned int>& iTimePoints)
482 this->RemoveTracesFromTWAndContainerForVisuForSpecificTPsTemplate<ContourContainer>(
virtual void SetCollectionsTraceNames()
virtual pure method: set the std::string class members
void AddInfoForContoursInTWForSpecificTPs(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTPs)
void TraceToReEdit(unsigned int)
signal emitted when the user clicks on "Reedit contour" in the context menu
virtual void AddActionsContextMenu(QMenu *iMenu)
void AddInfoInTWAndVisuContainerForContoursForSpecificTPs(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTPs)
void UpdateCurrentElementFromDB(unsigned int iTraceID, double irgba[4], bool IsVisible=false)
Update Current Element from te database.
void ChangeTraceColor()
is called when the user choses the change color action in the context menu,emit signals to get the da...
virtual void DisplayInfoForLastCreatedTrace(vtkMySQLDatabase *iDatabaseConnector)
Virtual pure method: get the data needed from the database for the last created trace and display the...
std::string m_CollectionName
unsigned int GetBoundedBoxTimePoint(vtkMySQLDatabase *iDatabaseConnector, unsigned int iTraceID, bool MinTimePoint=true)
get the timepoint min or max for the trace
virtual void CreateCorrespondingCollection()
slot called when the user click on "create a collection from checked traces" in the context menu...
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...
Abstract class inherited by QGoDBContourManager,Mesh,Track,Lineage.
int GetIndexShowColumn()
return the index of the column in the RowContainer corresponding to the show/hide column ...
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)
This class describes the specificities of the GoDBTableWidgetContainer for contour and mesh...
void AddSpecificActionsForContourMesh(QMenu *iMenu)
NameWithColorData * m_SelectedColorData
virtual void AddToSelectedCollection()
virtual std::list< unsigned int > UpdateTheTracesColor(vtkMySQLDatabase *iDatabaseConnector)
virtual pure method in QGoDBTraceManager
void DisplayInfoAndLoadVisuContainerForAllContours(vtkMySQLDatabase *iDatabaseConnector)
get all the data from the database to load all the contours for the imagingsession into the table wid...
QString tr(const char *sourceText, const char *disambiguation, int n)
std::string m_CollectionOf
virtual void UpdateHighlightedElementsInVisuContainer(int iTraceID)
QGoDBContourManager(int iImgSessionID, QWidget *iparent)
virtual void AddToSelectedCollection()
NameWithColorData * m_SelectedCollectionData
std::list< unsigned int > GetTraceIDsBelongingToListTimePoints(vtkMySQLDatabase *iDatabaseConnector, std::list< unsigned int > iListTPs)
void DisplayInfoAndLoadVisuContainerForAllContoursForSpecificTPs(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTPs)
virtual void DeleteCheckedTraces(vtkMySQLDatabase *iDatabaseConnector)
delete the checked traces from the database, the TW and the container for visu
double * GetVectorFromQColor(QColor iColor)
return a double rgba[4] from a QColor
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...
bool SetValuesForSpecificID(int ID, vtkMySQLDatabase *iDatabaseConnector)
ContourContainer * m_ContourContainerInfoForVisu
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 ...
std::list< unsigned int > GetHighlightedElementsTraceID()
Get the list of highlighted elements TraceID.
Wraps a boost::multi_index_container of ContourMeshStructure. This class is specialized for the means...
void setText(const QString &text)
virtual void CreateCorrespondingCollection()
slot called when the user click on "create a collection from checked traces" in the context menu...
void SetContoursInfoContainerForVisu(ContourContainer *iContainerForVisu)
set the m_ContourContainerInfoForVisu to the iContainerForVisu
void CleanTWAndContainerForGivenTimePoint(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iTimePoints)
virtual void DisplayInfoForTracesForSpecificTPs(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTPs)
void SetInfo(unsigned int iImgSessionID, QWidget *iParent)
set the variables class members
GoDBTWContainerForContourMesh * m_TWContainer
void NeedToGetDatabaseConnection()
void PrintMessage(QString iMessage, int iTimeOut=0)
void ReEditTrace()
emit TraceToReEdit if one and only one contour is checked in the TW
bool AreCheckedContoursFromCurrentTimepoint()
check that all the highlighted contours belong to the current timepoint, if not display a message to ...
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)
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...
MultiIndexContainerElementType m_CurrentElement
Current Element of the trace type.
virtual int SaveInDB(vtkMySQLDatabase *DatabaseConnector)
fill the contour map with the values gotten from the visualization
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
void RemoveTracesFromTWAndContainerForVisuForSpecificTPs(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTPs)
virtual void UpdateVisibleElementsInVisuContainer(int iTraceID)
this class manages the map with the keys matching the fields of the Contour gofiguredatabase table an...
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...
void AddActionForCreateNewCollectionFromCheckedTraces()
add the action "generate a mesh from contours" in the context menu
GoDBTableWidgetContainer::TWContainerType TWContainerType
virtual void SetColorCoding(bool IsChecked)
QMenu * m_CheckedTracesMenu
vtkMySQLDatabase * m_DatabaseConnector
void DBConnectionNotNeededAnymore()
virtual std::list< unsigned int > GetListHighlightedIDs()
virtual void AddActionsContextMenu(QMenu *iMenu)
GoDBCollectionOfTraces * m_CollectionOfTraces