GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoDBLineageManager.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 __QGoDBLineageManager_h
36 #define __QGoDBLineageManager_h
37 
38 #include "QGoTableWidget.h"
39 #include "GoDBCollectionOfTraces.h"
41 #include "QGoDBTraceManager.h"
42 #include "QGoGUILibConfigure.h"
43 #include "LineageContainer.h"
44 #include "TrackContainer.h"
45 
52 class QGOGUILIB_EXPORT QGoDBLineageManager:public QGoDBTraceManager
53 {
54  Q_OBJECT
55 public:
56  QGoDBLineageManager(int iImgSessionID, QWidget *iparent);
58 
59  virtual void DisplayInfoForLastCreatedTrace(vtkMySQLDatabase *iDatabaseConnector);
60 
61  virtual void DisplayInfoForExistingTrace(vtkMySQLDatabase *iDatabaseConnector,
62  int iTraceID);
63 
70  void SetLineagesInfoContainersForVisu( LineageContainer *iContainerForVisu,
71  TrackContainer *iTrackContainerInfoForvisu);
72 
78  void DisplayInfoAndLoadVisuContainerForAllLineages(
79  vtkMySQLDatabase *iDatabaseConnector);
80 
88  unsigned int CreateNewLineageWithTrackRoot(
89  vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackRoot);
90 
91  //virtual pure method in QGoDBTraceManager
92  std::list< unsigned int > UpdateTheTracesColor(vtkMySQLDatabase *iDatabaseConnector);
93 
94  //virtual pure method in QGoDBTraceManager
96  const std::vector< int > & iVectorImportedTraces,
97  vtkMySQLDatabase *iDatabaseConnector);
98 
105  void DeleteListTraces(vtkMySQLDatabase *iDatabaseConnector,
106  const std::list<unsigned int> & iListTraces);
107 
108  //virtual pure method in QGoDBTraceManager
109  virtual void DeleteCheckedTraces( vtkMySQLDatabase *iDatabaseConnector);
110 
111  //virtual pure method in QGoDBTraceManager
112  virtual std::list< unsigned int > GetListHighlightedIDs();
113 
114  virtual void UpdateBoundingBoxes(vtkMySQLDatabase *iDatabaseConnector,
115  const std::list< unsigned int > & iListTracesIDs,
116  bool UpdateTW = true);
117 
118 public slots:
119 
120  void UpdateElementHighlighting(unsigned int);
121 
122  /*
123  * \brief Export all the lineages to vtkTree into the folder chosen by the user.
124  * Those trees can be read with the lineageViewer.
125  */
126  void ExportLineages();
127 
128 protected:
132 
133  //virtual pure method in QGoDBTraceManager
134  virtual void SetCollectionsTraceNames();
135 
136  //virtual pure method in QGoDBTraceManager
137  virtual void DisplayInfoForAllTraces(vtkMySQLDatabase *iDatabaseConnector);
138 
139  //virtual pure method in QGoDBTraceManager
141  vtkMySQLDatabase *iDatabaseConnector,
142  const std::list<unsigned int> & iListTPs);
143 
144  //virtual pure method in QGoDBTraceManager
146  vtkMySQLDatabase* iDatabaseConnector,
147  std::list<unsigned int> iListTraceIDs = std::list< unsigned int >());
148 
149  void InsertLineageInTW(vtkMySQLDatabase *iDatabaseConnector,
150  unsigned int iTraceID);
151 
158  void UpdateTrackRootSelectedLineage(vtkMySQLDatabase* iDatabaseConnector,
159  unsigned int iLineageID, unsigned int iTrackIDRoot);
160 
161  /*
162  * \brief Update the scalars and colors for all the divisions of a
163  lineage in the trackContainer for the visu
164  */
165  void UpdateDivisionsInTrackContainer(unsigned int iLineageID);
166 
170  void DeleteDivisionsForLineages(
171  vtkMySQLDatabase *iDatabaseConnector,
172  const std::list<unsigned int> & iLineageID);
173 
174  void DeleteADivision(
175  vtkMySQLDatabase *iDatabaseConnector, unsigned int iTrackFamilyID);
176 
177 protected slots:
178  //virtual pure method in QGoDBTraceManager
179  virtual void UpdateHighlightedElementsInVisuContainer(int iTraceID);
180 
181  //virtual pure method in QGoDBTraceManager
182  virtual void UpdateVisibleElementsInVisuContainer(int iTraceID);
183 
184  //virtual pure method in QGoDBTraceManager
185  virtual void SetColorCoding(bool IsChecked);
186 
187  virtual void DeleteTracesFromContextMenu();
188 
189 };
190 #endif
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 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...
Abstract class inherited by QGoDBContourManager,Mesh,Track,Lineage.
virtual void SetCollectionsTraceNames()=0
virtual pure method: set the std::string class members
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 DisplayInfoForExistingTrace(vtkMySQLDatabase *iDatabaseConnector, int iTraceID)=0
Virtual pure method: get the data needed from the database for the existing trace with iTraceID and u...
GoDBTWContainerForLineage * m_TWContainer
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...
Wraps a boost multi index container of LineageStructure. This class intends to synchronize Lineage re...
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)
TrackContainer * m_TrackContainerInfoForVisu
virtual void DeleteCheckedTraces(vtkMySQLDatabase *iDatabaseConnector)=0
delete the checked traces from the database, the TW and the container for visu
Wraps a boost multi index container of TrackStructure. This class intends to synchronize Track repres...
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...
LineageContainer * m_LineageContainerInfoForVisu
virtual void UpdateVisibleElementsInVisuContainer(int iTraceID)=0
modify to the opposite one the Visible property of the corresponding trace base on traceID in the con...
This class manages the database queries, the table widget and the data from the database in the Conta...
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...
This class describes the specificities of the GoDBTWContainerForTrackLineage for lineage.