GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoDBContourManager.h
Go to the documentation of this file.
1 /*=========================================================================
2  Authors: The GoFigure Dev. Team.
3  at Megason Lab, Systems biology, Harvard Medical school, 2009-11
4 
5  Copyright (c) 2009-11, President and Fellows of Harvard College.
6  All rights reserved.
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions are met:
10 
11  Redistributions of source code must retain the above copyright notice,
12  this list of conditions and the following disclaimer.
13  Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16  Neither the name of the President and Fellows of Harvard College
17  nor the names of its contributors may be used to endorse or promote
18  products derived from this software without specific prior written
19  permission.
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
25  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 =========================================================================*/
34 
35 #ifndef __QGoDBContourManager_h
36 #define __QGoDBContourManager_h
37 
38 #include "QGoTableWidget.h"
39 #include "GoDBCollectionOfTraces.h"
41 #include "QGoDBTraceManager.h"
42 #include "ContourContainer.h"
43 #include "QGoGUILibConfigure.h"
44 
51 class QGOGUILIB_EXPORT QGoDBContourManager:public QGoDBTraceManager
52 {
53  Q_OBJECT
54 public:
55  QGoDBContourManager(int iImgSessionID, QWidget *iparent);
57  typedef std::pair< std::string, QColor > NameWithColorData;
58 
63  void SetContoursInfoContainerForVisu(ContourContainer *iContainerForVisu);
64 
65  unsigned int SaveNewContourFromVisu(int iTCoord,
66  unsigned int iXCoordMin,
67  unsigned int iYCoordMin,
68  unsigned int iZCoordMin,
69  unsigned int iXCoordMax,
70  unsigned int iYCoordMax,
71  unsigned int iZCoordMax,
72  vtkPolyData *iTraceNodes,
73  vtkMySQLDatabase *iDatabaseConnector,
74  unsigned int iMeshID);
75 
80  unsigned int SaveReeditedContourFromVisu(unsigned int iXCoordMin,
81  unsigned int iYCoordMin,
82  unsigned int iZCoordMin,
83  unsigned int iTCoord,
84  unsigned int iXCoordMax,
85  unsigned int iYCoordMax,
86  unsigned int iZCoordMax,
87  vtkPolyData *iContourNodes,
88  vtkMySQLDatabase *iDatabaseConnector);
89 
95  void DisplayInfoAndLoadVisuContainerForAllContours(vtkMySQLDatabase *iDatabaseConnector);
96 
97  void DisplayInfoAndLoadVisuContainerForAllContoursForSpecificTPs(
98  vtkMySQLDatabase *iDatabaseConnector, const std::list<unsigned int> & iListTPs);
99 
100  void AddInfoInTWAndVisuContainerForContoursForSpecificTPs(
101  vtkMySQLDatabase *iDatabaseConnector, const std::list<unsigned int> & iListTPs);
102 
103  void RemoveTracesFromTWAndContainerForVisuForSpecificTPs(
104  vtkMySQLDatabase *iDatabaseConnector,
105  const std::list<unsigned int> & iListTPs);
106 
113  void ChangeTraceColor();
114 
118  virtual std::list< unsigned int > UpdateTheTracesColor(vtkMySQLDatabase *iDatabaseConnector);
119 
120  //virtual pure method in QGoDBTraceManager
121  virtual void UpdateTWAndContainerForImportedTraces(const std::vector< int > & iVectorImportedTraces,
122  vtkMySQLDatabase *iDatabaseConnector);
123  //virtual pure method in QGoDBTraceManager
124  virtual void DeleteCheckedTraces(vtkMySQLDatabase *iDatabaseConnector);
125 
126  //virtual pure method in QGoDBTraceManager
127  virtual std::list< unsigned int > GetListHighlightedIDs();
128 
129 
130  void CleanTWAndContainerForGivenTimePoint(vtkMySQLDatabase *iDatabaseConnector,
131  const std::list<unsigned int>& iTimePoints);
132 
133 signals:
137  void TraceToReEdit(unsigned int);
138 
139 protected:
142 
143  //virtual pure method in QGoDBTraceManager
144  virtual void SetCollectionsTraceNames();
145 
146  virtual void AddActionsContextMenu(QMenu *iMenu);
147 
151  void AddActionForCreateNewCollectionFromCheckedTraces();
152 
153  virtual void DisplayInfoForLastCreatedTrace(vtkMySQLDatabase *iDatabaseConnector);
154 
155  virtual void DisplayInfoForExistingTrace(vtkMySQLDatabase *iDatabaseConnector,
156  int iTraceID);
157 
158  //virtual pure method in QGoDBTraceManager
159  virtual void DisplayInfoForAllTraces(vtkMySQLDatabase *iDatabaseConnector);
160 
161  //virtual pure method in QGoDBTraceManager
162  virtual void DisplayInfoForTracesForSpecificTPs(vtkMySQLDatabase *iDatabaseConnector,
163  const std::list<unsigned int> & iListTPs);
164 
165  void AddInfoForContoursInTWForSpecificTPs(vtkMySQLDatabase *iDatabaseConnector,
166  const std::list<unsigned int> & iListTPs);
167 
168  //virtual pure method in QGoDBTraceManager
170  vtkMySQLDatabase* iDatabaseConnector,
171  std::list<unsigned int> iListTraceIDs = std::list< unsigned int >());
172 
173  //QGoDBTraceManager method
174  virtual void AddToSelectedCollection();
175 
176  //QGoDBTraceManager method
177  virtual void CreateCorrespondingCollection();
178 
184  bool AreCheckedContoursFromCurrentTimepoint();
185 
186 protected slots:
190  void ReEditTrace();
191 
192  //virtual pure method in QGoDBTraceManager
193  virtual void UpdateHighlightedElementsInVisuContainer(int iTraceID);
194 
195  //virtual pure method in QGoDBTraceManager
196  virtual void UpdateVisibleElementsInVisuContainer(int iTraceID);
197 
198  //virtual pure method in QGoDBTraceManager
199  virtual void SetColorCoding(bool IsChecked);
200 
201 };
202 #endif
std::pair< std::string, QColor > NameWithColorData
virtual void DisplayInfoForLastCreatedTrace(vtkMySQLDatabase *iDatabaseConnector)=0
Virtual pure method: get the data needed from the database for the last created trace and display the...
virtual void CreateCorrespondingCollection()
slot called when the user click on &quot;create a collection from checked traces&quot; in the context menu...
Abstract class inherited by QGoDBContourManager,Mesh,Track,Lineage.
virtual void SetCollectionsTraceNames()=0
virtual pure method: set the std::string class members
This class describes the specificities of the GoDBTableWidgetContainer for contour and mesh...
virtual void UpdateHighlightedElementsInVisuContainer(int iTraceID)=0
modify to the opposite one the highlighted property of the corresponding trace base on traceID in the...
virtual void AddToSelectedCollection()
virtual void DisplayInfoForExistingTrace(vtkMySQLDatabase *iDatabaseConnector, int iTraceID)=0
Virtual pure method: get the data needed from the database for the existing trace with iTraceID and u...
virtual void UpdateTWAndContainerForImportedTraces(const std::vector< int > &iVectorImportedTraces, vtkMySQLDatabase *iDatabaseConnector)=0
get the data needed from the database for the imported traces,display them in new inserted rows of th...
ContourContainer * m_ContourContainerInfoForVisu
Wraps a boost::multi_index_container of ContourMeshStructure. This class is specialized for the means...
GoDBTWContainerForContourMesh * m_TWContainer
virtual void SetColorCoding(bool IsChecked)=0
ColorCode the traces in the visualization base on a selected column in the table widget.
virtual void DisplayInfoForTracesForSpecificTPs(vtkMySQLDatabase *iDatabaseConnector, const std::list< unsigned int > &iListTPs)=0
void GetTracesInfoFromDBAndModifyContainerForVisu(vtkMySQLDatabase *iDatabaseConnector, std::vector< int > iVectIDs, C *iContainerForVisu)
virtual void DeleteCheckedTraces(vtkMySQLDatabase *iDatabaseConnector)=0
delete the checked traces from the database, the TW and the container for visu
virtual std::list< unsigned int > GetListHighlightedIDs()=0
virtual std::list< unsigned int > UpdateTheTracesColor(vtkMySQLDatabase *iDatabaseConnector)=0
virtual pure. update the color of the checked traces in the database, the visu container and the TW a...
virtual void ChangeTraceColor()
is called when the user choses the change color action in the context menu, emit the signal TraceColo...
virtual void UpdateVisibleElementsInVisuContainer(int iTraceID)=0
modify to the opposite one the Visible property of the corresponding trace base on traceID in the con...
virtual void DisplayInfoForAllTraces(vtkMySQLDatabase *iDatabaseConnector)=0
Virtual pure method: get the data needed from the database and display them in the m_Table for all tr...
virtual void AddActionsContextMenu(QMenu *iMenu)
This class manages the database queries, the table widget and the data from the database in the Conta...