GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GoDBTraceRow Class Referenceabstract

abstract class to be inherited by Contour,Mesh,Track and GoDBLineageRow More...

#include <Code/IO/GoDBRow/GoDBTraceRow.h>

Inheritance diagram for GoDBTraceRow:
Inheritance graph
[legend]
Collaboration diagram for GoDBTraceRow:
Collaboration graph
[legend]

Public Member Functions

int DoesThisBoundingBoxExist (vtkMySQLDatabase *DatabaseConnector)
 check if a trace already has the same bounding box More...
 
std::string GetCollectionIDName ()
 
std::string GetCollectionName ()
 
 GoDBTraceRow ()
 
 GoDBTraceRow (vtkMySQLDatabase *DatabaseConnector, vtkPolyData *TraceVisu, GoDBCoordinateRow Min, GoDBCoordinateRow Max, unsigned int ImgSessionID)
 fill the trace map with the values gotten from the visualization More...
 
virtual int SaveInDB (vtkMySQLDatabase *DatabaseConnector)=0
 save the row in the database if the TraceID is set to "0", update the existing traceRow if the TraceID is <> 0 More...
 
void SetCollectionID (unsigned int iCollectionID)
 set the collectionID field to iCollectionID More...
 
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 More...
 
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"] and ["CoordIDmax"] with the existing CoordinateID if not, create the coordinates in the database and fill the map with the new created ID, if the bounding box already exists, a cout is generated More...
 
bool SetValuesForSpecificID (int ID, vtkMySQLDatabase *iDatabaseConnector)
 
 ~GoDBTraceRow ()
 
- Public Member Functions inherited from GoDBRow
StringMapConstIterator ConstMapBegin ()
 
StringMapConstIterator ConstMapEnd ()
 
void DeleteFromDB (vtkMySQLDatabase *iDatabaseConnector)
 delete from the database the row which has the same TableID More...
 
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 the value if it is a string in order to get the original value. More...
 
template<typename T >
GetMapValue (const std::string &key)
 
std::string GetTableIDName ()
 
std::string GetTableName ()
 
std::vector< std::string > GetVectorColumnNames ()
 put all the keys of the map in a vector More...
 
 GoDBRow ()
 
StringMapIterator MapBegin ()
 
StringMapIterator MapEnd ()
 
std::string PrintColumnNames ()
 put all the keys of the map in a string separated by ',' More...
 
std::string PrintColumnNamesWithValues ()
 put all the keys and values of the map in a string as map[key] = value separated by ',' More...
 
std::vector< std::string > PrintColumnsAndValues ()
 
std::string PrintValues ()
 put all the values of the map in a string separated by ',' More...
 
template<typename T >
void SetField (const std::string &key, const T &value)
 convert the value into a string and assign it to the key in the map More...
 
void SetField (const std::string &key, const std::string &value)
 set value as the value of map[key] after having put " at the beginning and at the end of the string, as value is a string and it will be needed for the database queries. map[key] = " "value" " More...
 
virtual ~GoDBRow ()
 

Protected Member Functions

virtual void InitializeMap ()
 virtual pure. initialize all the values of the map More...
 
template<typename T >
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 TraceID is <> 0 More...
 
void SetImgSessionID (unsigned int iImgSessionID)
 set the ImagingSessionID field to iImgSessionID More...
 
template<typename T >
void SetTheDataFromTheVisuTemplate (vtkMySQLDatabase *DatabaseConnector, vtkPolyData *TraceVisu, GoDBCoordinateRow iCoordMin, GoDBCoordinateRow iCoordMax)
 
- Protected Member Functions inherited from GoDBRow
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 More...
 

Protected Attributes

std::string m_CollectionIDName
 check in the database if the Coordinate Min adn Max already exists, if yes fill the map["CoordIDMin"] and ["CoordIDmax"] with the existing CoordinateID if not, create the coordinates in the database and fill the map with the new created ID, if the bounding box already exists, a cout is generated More...
 
std::string m_CollectionName
 
- Protected Attributes inherited from GoDBRow
StringMapType m_MapRow
 
std::string m_TableIDName
 
std::string m_TableName
 

Additional Inherited Members

- Public Types inherited from GoDBRow
typedef
StringMapType::const_iterator 
StringMapConstIterator
 
typedef StringMapType::iterator StringMapIterator
 
typedef std::map< std::string,
std::string > 
StringMapType
 

Detailed Description

abstract class to be inherited by Contour,Mesh,Track and GoDBLineageRow

Definition at line 50 of file GoDBTraceRow.h.

Constructor & Destructor Documentation

GoDBTraceRow::GoDBTraceRow ( )

Definition at line 41 of file GoDBTraceRow.cxx.

GoDBTraceRow::GoDBTraceRow ( vtkMySQLDatabase *  DatabaseConnector,
vtkPolyData *  TraceVisu,
GoDBCoordinateRow  Min,
GoDBCoordinateRow  Max,
unsigned int  ImgSessionID 
)

fill the trace map with the values gotten from the visualization

Parameters
[in]DatabaseConnectorconnection to the database
[in]TraceVisuvtkPolyData the points will be extracted from to create a string for "Points"
[in]Mincoordinate row for the minimum of the bounding box
[in]Maxcoordinate row for the maximum of the bounding box
[in]ImgSessionIDID of the current imagingsession

Definition at line 49 of file GoDBTraceRow.cxx.

GoDBTraceRow::~GoDBTraceRow ( )
inline

Definition at line 74 of file GoDBTraceRow.h.

Member Function Documentation

int GoDBTraceRow::DoesThisBoundingBoxExist ( vtkMySQLDatabase *  DatabaseConnector)

check if a trace already has the same bounding box

Parameters
[in]DatabaseConnectorconnection to the database
Returns
the TraceID of the Trace with the same bounding box already registered in the DB or -1 if not yet created

Definition at line 115 of file GoDBTraceRow.cxx.

std::string GoDBTraceRow::GetCollectionIDName ( )
Returns
the collectionID name

Definition at line 154 of file GoDBTraceRow.cxx.

std::string GoDBTraceRow::GetCollectionName ( )
Returns
the collection name

Definition at line 162 of file GoDBTraceRow.cxx.

void GoDBTraceRow::InitializeMap ( )
protectedvirtual

virtual pure. initialize all the values of the map

Implements GoDBRow.

Reimplemented in GoDBMeshRow, GoDBTrackRow, GoDBContourRow, and GoDBLineageRow.

Definition at line 81 of file GoDBTraceRow.cxx.

virtual int GoDBTraceRow::SaveInDB ( vtkMySQLDatabase *  DatabaseConnector)
pure virtual

save the row in the database if the TraceID is set to "0", update the existing traceRow if the TraceID is <> 0

Parameters
[in]DatabaseConnectorconnection to the database
Returns
the ID of the updated or saved trace

Implemented in GoDBMeshRow, GoDBTrackRow, GoDBContourRow, and GoDBLineageRow.

template<typename T >
int GoDBTraceRow::SaveInDBTemplate ( vtkMySQLDatabase *  iDatabaseConnector,
T *  iTrace 
)
inlineprotected

save the row in the database if the TraceID is set to "0", update the existing traceRow if the TraceID is <> 0

Parameters
[in]iDatabaseConnectorconnection to the database
[in]iTracetrace to be saved
Template Parameters
Tchildren of GoDBTraceRow
Returns
the ID of the updated or saved trace

Definition at line 172 of file GoDBTraceRow.h.

void GoDBTraceRow::SetCollectionID ( unsigned int  iCollectionID)

set the collectionID field to iCollectionID

Parameters
[in]iCollectionIDcollectionID to be set to

Definition at line 170 of file GoDBTraceRow.cxx.

void GoDBTraceRow::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

Parameters
[in]Red
[in]Green
[in]Blue
[in]Alpha
[in]ColorName
[in]DatabaseConnectorconnection to the database

Definition at line 129 of file GoDBTraceRow.cxx.

void GoDBTraceRow::SetImgSessionID ( unsigned int  iImgSessionID)
protected

set the ImagingSessionID field to iImgSessionID

Parameters
[in]iImgSessionIDcollectionID to be set to

Definition at line 178 of file GoDBTraceRow.cxx.

void GoDBTraceRow::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"] and ["CoordIDmax"] with the existing CoordinateID if not, create the coordinates in the database and fill the map with the new created ID, if the bounding box already exists, a cout is generated

Parameters
[in]iDatabaseConnectorconnection to the database
[in]Mincoordinate row for the minimum of the bounding box
[in]Maxcoordinate row for the maximum of the bounding box

Definition at line 93 of file GoDBTraceRow.cxx.

template<typename T >
void GoDBTraceRow::SetTheDataFromTheVisuTemplate ( vtkMySQLDatabase *  DatabaseConnector,
vtkPolyData *  TraceVisu,
GoDBCoordinateRow  iCoordMin,
GoDBCoordinateRow  iCoordMax 
)
inlineprotected

Definition at line 193 of file GoDBTraceRow.h.

bool GoDBTraceRow::SetValuesForSpecificID ( int  ID,
vtkMySQLDatabase *  iDatabaseConnector 
)
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from GoDBRow.

Definition at line 186 of file GoDBTraceRow.cxx.

Member Data Documentation

std::string GoDBTraceRow::m_CollectionIDName
protected

check in the database if the Coordinate Min adn Max already exists, if yes fill the map["CoordIDMin"] and ["CoordIDmax"] with the existing CoordinateID if not, create the coordinates in the database and fill the map with the new created ID, if the bounding box already exists, a cout is generated

Definition at line 154 of file GoDBTraceRow.h.

std::string GoDBTraceRow::m_CollectionName
protected

Definition at line 155 of file GoDBTraceRow.h.


The documentation for this class was generated from the following files: