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);