39 #include "vtkSmartPointer.h"
51 unsigned int ImgSessionID)
56 (void)DatabaseConnector;
60 ConvertToString< unsigned int >(ImgSessionID);
83 this->
m_MapRow[
"ImagingSessionID"] = std::string(
"0" );
84 this->
m_MapRow[
"ColorID"] = std::string(
"1" );
85 this->
m_MapRow[
"CoordIDMax"] = std::string(
"0" );
86 this->
m_MapRow[
"CoordIDMin"] = std::string(
"0" );
87 this->
m_MapRow[
"Points"] = std::string(
"0" );
100 CoordMin = Min.
SaveInDB(DatabaseConnector);
102 this->
m_MapRow[
"CoordIDMin"] = ConvertToString< int >(CoordMin);
105 if ( CoordMax == -1 )
107 CoordMax = Max.
SaveInDB(DatabaseConnector);
109 this->
m_MapRow[
"CoordIDMax"] = ConvertToString< int >(CoordMax);
116 vtkMySQLDatabase *DatabaseConnector)
118 std::vector< FieldWithValue > Conditions;
130 unsigned int Blue,
unsigned int Alpha, std::string ColorName,
131 vtkMySQLDatabase *DatabaseConnector)
135 ColorRow.
SetField<
int >(
"Red", Red);
136 ColorRow.
SetField<
int >(
"Green", Green);
137 ColorRow.
SetField<
int >(
"Blue", Blue);
138 ColorRow.
SetField<
int >(
"Alpha", Alpha);
139 ColorRow.
SetField(
"Name", ColorName);
143 this->
m_MapRow[
"ColorID"] = ConvertToString< int >( ColorRow.
SaveInDB(DatabaseConnector) );
147 this->SetField< int >(
"ColorID", ColorID);
180 this->SetField< int >(
"ImagingSessionID", iImgSessionID);
virtual int DoesThisEntityAlreadyExists(vtkMySQLDatabase *iDatabaseConnector)
Pure Virtual :check if the entity already exists in the database based on its own uniqueness definiti...
std::string GetCollectionIDName()
std::string m_TableIDName
void SetCollectionID(unsigned int iCollectionID)
set the collectionID field to iCollectionID
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 GetCollectionName()
this class manages the map with the keys matching the fields of the Color gofiguredatabase table and ...
int SaveInDB(vtkMySQLDatabase *DatabaseConnector)
save the coordinate in the database and return the ID of the new created coordinate or the ID of the ...
int DoesThisCoordinateExist(vtkMySQLDatabase *DatabaseConnector)
return the CoordID of the coordinate with the same attributes already registered in the DB or -1 if n...
virtual int SaveInDB(vtkMySQLDatabase *iDatabaseConnector)
Pure Virtual :check if the entity already exists in the DB, if yes, return the existing ID...
bool SetValuesForSpecificID(int ID, vtkMySQLDatabase *iDatabaseConnector)
int DoesThisBoundingBoxExist(vtkMySQLDatabase *DatabaseConnector)
check if a trace already has the same bounding box
int FindOneID(vtkMySQLDatabase *DatabaseConnector, const std::string &TableName, const std::string &ColumnName, const std::string &field, const std::string &value)
SELECT ColumnName FROM TableName WHERE field = value.
void SetColor(unsigned int Red, unsigned int Green, unsigned int Blue, unsigned int Alpha, std::string ColorName, vtkMySQLDatabase *DatabaseConnector)
get the colorID corresponding to the rgba values and set the colorID field of the trace with it ...
std::string m_CollectionIDName
check in the database if the Coordinate Min adn Max already exists, if yes fill the map["CoordIDMin"]...
void SetImgSessionID(unsigned int iImgSessionID)
set the ImagingSessionID field to iImgSessionID
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
void AddConditions(const std::string &iNameOfField, std::vector< FieldWithValue > &ioFieldWithValue)
add as an element of ioFieldWithValue the name and value of the map with the key iNameOfField ...
void SetTheBoundingBox(vtkMySQLDatabase *iDatabaseConnector, GoDBCoordinateRow Min, GoDBCoordinateRow Max)
check in the database if the Coordinate Min and Max already exists, if yes fill the map["CoordIDMin"]...
virtual void InitializeMap()
virtual pure. initialize all the values of the map