34 #ifndef __GoDBTraceRow_h
35 #define __GoDBTraceRow_h
41 #include "vtkSmartPointer.h"
42 #include "vtkPolyData.h"
43 #include "vtkMySQLDatabase.h"
64 GoDBTraceRow(vtkMySQLDatabase *DatabaseConnector, vtkPolyData *TraceVisu,
83 int DoesThisBoundingBoxExist(vtkMySQLDatabase *DatabaseConnector);
96 void SetColor(
unsigned int Red,
unsigned int Green,
unsigned int Blue,
97 unsigned int Alpha, std::string ColorName, vtkMySQLDatabase *DatabaseConnector);
103 std::string GetCollectionIDName();
109 std::string GetCollectionName();
120 void SetTheBoundingBox(vtkMySQLDatabase *iDatabaseConnector,
127 void SetCollectionID(
unsigned int iCollectionID);
140 virtual int SaveInDB(vtkMySQLDatabase *DatabaseConnector) = 0;
161 void SetImgSessionID(
unsigned int iImgSessionID);
171 template<
typename T >
178 if ( this->m_MapRow[this->m_TableIDName] !=
"0" )
180 SavedTraceID = UpdateOneNewObjectInTable< T >(iDatabaseConnector,
185 SavedTraceID = AddOnlyOneNewObjectInTable< T >(iDatabaseConnector,
187 this->
SetField(this->m_TableIDName, SavedTraceID);
192 template<
typename T >
194 vtkPolyData *TraceVisu,
198 this->SetTheBoundingBox(DatabaseConnector, iCoordMin, iCoordMax);
200 vtkSmartPointer< T > convert =
201 vtkSmartPointer< T >::New();
202 std::string PointsString = convert->GetMySQLText(TraceVisu);
204 this->
SetField(
"Points", PointsString);
206 if ( this->DoesThisBoundingBoxExist(DatabaseConnector) != -1)
208 std::cout <<
"The bounding box already exists for this mesh" << std::endl;
abstract class to be inherited by Contour,Mesh,Track and GoDBLineageRow
abstract class manages a map with keys matching fields of a gofiguredatabase table and values of the ...
void SetTheDataFromTheVisuTemplate(vtkMySQLDatabase *DatabaseConnector, vtkPolyData *TraceVisu, GoDBCoordinateRow iCoordMin, GoDBCoordinateRow iCoordMax)
std::string m_TableIDName
manages a map with keys matching fields of the gofiguredatabase Coordinate table and values of the ma...
virtual bool SetValuesForSpecificID(int ID, vtkMySQLDatabase *iDatabaseConnector)
get the data from the database corresponding to the specific ID and put them in the map ...
std::string m_CollectionIDName
check in the database if the Coordinate Min adn Max already exists, if yes fill the map["CoordIDMin"]...
virtual void InitializeMap()=0
virtual pure. initialize all the values of the map
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::string m_CollectionName
int SaveInDBTemplate(vtkMySQLDatabase *iDatabaseConnector, T *iTrace)
save the row in the database if the TraceID is set to "0", update the existing traceRow if the TraceI...