41 #include "vtkSmartPointer.h"
78 this->
m_MapRow[
"ImagingSessionID"] = ConvertToString< int >(ImagingSessionID);
85 vtkMySQLDatabase *iDatabaseConnector) :
113 vtkPolyData *TraceVisu,
118 this->SetTheDataFromTheVisuTemplate< vtkPolyDataMySQLMeshWriter >(
119 DatabaseConnector, TraceVisu, iCoordMin, iCoordMax);
123 if ( iMeshAttributes )
139 this->
SetField(iRowIt->first, iRowIt->second);
155 this->
m_MapRow[
"CellTypeID"] = std::string(
"0" );
156 this->
m_MapRow[
"SubCellularID"] = std::string(
"0" );
157 this->
m_MapRow[
"trackID"] = std::string(
"0" );
165 int SavedMeshID = GoDBTraceRow::SaveInDBTemplate< GoDBMeshRow >(DatabaseConnector,
this);
180 std::string iCellTypeName)
182 return FindOneID(iDatabaseConnector,
"celltype",
"CellTypeID",
183 "Name", iCellTypeName);
190 std::string iCellTypeName)
192 if ( iCellTypeName !=
"Add a new celltype..."
193 && iCellTypeName !=
"Delete a celltype" )
195 this->SetField< int >(
"CellTypeID",
204 std::string iSubCellTypeName)
206 return FindOneID(iDatabaseConnector,
"subcellulartype",
"SubCellularID",
207 "Name", iSubCellTypeName);
214 std::string iSubCellTypeName)
216 if ( iSubCellTypeName !=
"Add a new subcelltype..."
217 && iSubCellTypeName !=
"Delete a subcelltype" )
219 this->SetField< int >(
"SubCellularID",
228 vtkMySQLDatabase *DatabaseConnector,
229 boost::unordered_map< std::string, int > iNameChannelWithValues)
233 std::cout <<
"The mesh needs to be saved before" << std::endl;
236 if ( this->
GetMapValue(
"ImagingSessionID") ==
"0" )
238 std::cout <<
"The imagingSession hasn't been entered for the mesh" << std::endl;
241 boost::unordered_map< std::string, int >::iterator iter = iNameChannelWithValues.begin();
242 while ( iter != iNameChannelWithValues.end() )
244 std::vector< FieldWithValue > Conditions;
247 Conditions.push_back(Name);
248 int ChannelID =
FindOneID(DatabaseConnector,
"channel",
"ChannelID", Conditions);
251 NewIntensity.
SetField(
"ChannelID", ChannelID);
252 NewIntensity.
SetField(
"Value", iter->second);
253 std::string strMeshID = this->
GetMapValue(
"meshID");
255 NewIntensity.
SaveInDB(DatabaseConnector);
void SafeDownCast(GoDBTraceRow &iRow)
convert a GoDBTraceRow in GoDBMeshRow
manages a map with keys matching fields of the gofiguredatabase Intensity table and values of the map...
abstract class to be inherited by Contour,Mesh,Track and GoDBLineageRow
StringMapConstIterator ConstMapBegin()
boost::unordered_map< std::string, int > m_NameChannelWithValues
void SetTheDataFromTheVisu(vtkMySQLDatabase *DatabaseConnector, vtkPolyData *TraceVisu, GoDBCoordinateRow iCoordMin, GoDBCoordinateRow iCoordMax, GoFigureMeshAttributes *iMeshAttributes)
std::string m_TableIDName
static int GetSubCellTypeID(vtkMySQLDatabase *iDatabaseConnector, std::string iSubCellTypeName)
static method.get the SubCellTypeID base on the name of the subcelltype
int SaveInDB(vtkMySQLDatabase *DatabaseConnector)
manages a map with keys matching fields of the gofiguredatabase Coordinate table and values of the ma...
virtual void InitializeMap()
virtual pure. initialize all the values of the map
bool SetValuesForSpecificID(int ID, vtkMySQLDatabase *iDatabaseConnector)
void SaveInDBTotalIntensityPerChannel(vtkMySQLDatabase *DatabaseConnector, boost::unordered_map< std::string, int > iNameChannelWithValues)
create the intensities per channel based on the channel names and values contained in iNameChannelWit...
StringMapType::const_iterator StringMapConstIterator
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.
StringMapConstIterator ConstMapEnd()
std::string m_CollectionIDName
check in the database if the Coordinate Min adn Max already exists, if yes fill the map["CoordIDMin"]...
void SetSubCellType(vtkMySQLDatabase *DatabaseConnector, std::string SubCellTypeName)
put the value of map["SubCelltype"] to SubCellTypeName
void SetCellType(vtkMySQLDatabase *DatabaseConnector, std::string CellTypeName)
put the value of map["Celltype"] to CellTypeName
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
static int GetCellTypeID(vtkMySQLDatabase *iDatabaseConnector, std::string iCellTypeName)
static method.get the CellTypeID base on the name of the celltype
this class manages the map with the keys matching the fields of the Mesh gofiguredatabase table and v...
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 ...
virtual int SaveInDB(vtkMySQLDatabase *DatabaseConnector)
save the row in the database if the TraceID is set to "0", update the existing traceRow if the TraceI...
virtual void InitializeMap()
virtual pure. initialize all the values of the map
std::string GetMapValue(const std::string &key)
return the value for the field map[key] after having removed the " at the beginning and at the end of...