GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
GoDBImport Class Reference

This class get the data of traces from a textfile and save them into the GoFigure Database. More...

#include <Code/IO/GoDBImport.h>

Collaboration diagram for GoDBImport:
Collaboration graph
[legend]

Public Member Functions

ContourMeshContainerGetNewContourInfo ()
 return a vector of the info needed to add in the visu the contours read from the import file and saved in the database More...
 
std::vector< int > GetVectorNewContourIDs ()
 return a vector of the IDs for the contours read from the import file and saved in the database More...
 
std::vector< int > GetVectorNewMeshIDs ()
 return a vector of the IDs for the meshes read from the import file and saved in the database More...
 
std::vector< int > GetVectorNewTracksIDs ()
 return a vector of the IDs for the tracks read from the the import file and saved in the database More...
 
 GoDBImport (const std::string &iServerName, const std::string &iLogin, const std::string &iPassword, int iImagingSessionID, const std::string &iFilename, int iCurrentTimePoint)
 
void ImportContours ()
 get the data needed from the import file to save the contours listed in it, including the color, the mesh they belong to, the tracks the previous meshes belong to, etc...and fill the vectors of new IDs and the needed info for the visu to add these new contours More...
 
void ImportMeshes ()
 get the data needed from the import file to save the meshes listed in it, including the color,their intensities,the tracks they belong to, the lineages the previous tracks belong to, etc...and fill the vectors of new IDs and the needed info for the visu to add these new meshes More...
 
void ImportTracks ()
 get the data needed from the import file to save the tracks listed in it, including the color,their meshes and intensities,the lineages they belong to etc... and fill the vectors of new IDs and the needed info for the visu to add these new tracks and meshes. More...
 
virtual ~GoDBImport ()
 

Private Types

typedef std::map< int, int > IntMapType
 

Private Member Functions

void CloseDBConnection ()
 
std::string FindFieldName (const std::string &iLine)
 Return the name of the field contained in the line. More...
 
std::string GetValueForTheLine (const std::string &iLine)
 Return the value contained in the line and "NoValueOnTheLine" if the line doesn't contain any. More...
 
template<typename T >
std::string GetValuesFromInfile (T &ioEntityToFill)
 Get the values from the import File to fill the corresponding GoDBRow. More...
 
bool IsLineForNumberOfEntities (const std::string &iLine)
 Return true if the line containes "Number Of". More...
 
void OpenDBConnection ()
 
template<typename T >
void ReplaceCommonFieldsForTraces (T &ioEntityToSave, const IntMapType &iMapColorIDs, const IntMapType &iMapCoordIDs, const IntMapType &iMapCollectionIDs)
 replace old IDs found in the import file with new created IDs in the trace to be saved for common fields for the 4 traces: colorID, coordIDMin, CoordIDMax and CollectionID More...
 
template<typename T >
void ReplaceTheFieldWithNewIDs (const IntMapType &iMapIDs, std::string iFieldName, T &ioEntity)
 replace in the entity to be saved the fieldname with the new IDs created that matches the old one in the iMapIDs More...
 
template<typename T >
std::string SaveImportedEntitiesInDatabase (int iNumberOfEntities, IntMapType &ioMapMatchingIDs)
 get the values from the import file,save the corresponding number of entities in the database, return the last line content from the import file and update the matchingIDs with the new ones matching the old ones written in the import file More...
 
void SaveIntensityForMesh (std::string &ioLineContent, const IntMapType &iMapMeshIDs, const IntMapType &iMapColorIDs)
 fill the info needed for the new imported contours to add them in the visu More...
 
std::string SaveNoTracesEntities (IntMapType &ioMapColorIDs, IntMapType &ioMapCellTypeIDs, IntMapType &ioMapSubCellTypeIDs, IntMapType &ioMapCoordIDs)
 Get the values from the Infile, save the non traces entities, fill the matching map for old and new IDs and return the current line content. More...
 
template<typename T >
void SaveTraces (const IntMapType &iMapColorIDs, const IntMapType &iMapCoordIDs, const IntMapType &iMapCollectionIDs, std::string &ioLineContent, std::vector< int > &ioNewTracesIDs, IntMapType &ioMapTraceIDs, const IntMapType &iMapIDsSpecificOne, const IntMapType &iMapIDsSpecificTwo)
 
template<>
void SaveTraces (const IntMapType &iMapColorIDs, const IntMapType &iMapCoordIDs, const IntMapType &iMapCollectionIDs, std::string &ioLineContent, std::vector< int > &ioNewTracesIDs, IntMapType &ioMapTraceIDs, const IntMapType &iMapIDsSpecificOne, const IntMapType &iMapIDsSpecificTwo)
 
template<>
void SaveTraces (const IntMapType &iMapColorIDs, const IntMapType &iMapCoordIDs, const IntMapType &iMapCollectionIDs, std::string &ioLineContent, std::vector< int > &ioNewTracesIDs, IntMapType &ioMapTraceIDs, const IntMapType &iMapIDsSpecificOne, const IntMapType &iMapIDsSpecificTwo)
 
void SaveTracesEntities (const IntMapType &iMapColorIDs, const IntMapType &iMapCoordIDs, const std::string &iLineContent, const IntMapType &iMapCellTypeIDs, const IntMapType &iMapSubCellTypeIDs, bool SaveIntensities=false)
 Get the info for the traces from the import file and from the matching IDs maps previously filled, then save them in the database if their bounding box doesn't match any existing ones and save the intensities for the meshes if SaveIntensities is set to true. More...
 
void SaveTrackFamilyEntities (const IntMapType &iMapTrackIDs, IntMapType &ioMapTrackFamilyIDs, std::string &ioLineContent)
 

Private Attributes

int m_CurrentTimePoint
 
vtkMySQLDatabase * m_DatabaseConnector
 
int m_ImagingSessionID
 
std::ifstream m_InFile
 
std::string m_Login
 
std::vector< int > m_NewContourIDs
 
ContourMeshContainerm_NewContourInfoForVisu
 
std::vector< int > m_NewLineageIDs
 
std::vector< int > m_NewMeshIDs
 
ContourMeshContainerm_NewMeshInfoForVisu
 
std::vector< int > m_NewTracksIDs
 
std::string m_Password
 
std::string m_ServerName
 

Detailed Description

This class get the data of traces from a textfile and save them into the GoFigure Database.

Definition at line 54 of file GoDBImport.h.

Member Typedef Documentation

typedef std::map< int, int > GoDBImport::IntMapType
private

Definition at line 134 of file GoDBImport.h.

Constructor & Destructor Documentation

GoDBImport::GoDBImport ( const std::string &  iServerName,
const std::string &  iLogin,
const std::string &  iPassword,
int  iImagingSessionID,
const std::string &  iFilename,
int  iCurrentTimePoint 
)

Definition at line 52 of file GoDBImport.cxx.

GoDBImport::~GoDBImport ( )
virtual

Definition at line 65 of file GoDBImport.cxx.

Member Function Documentation

void GoDBImport::CloseDBConnection ( )
private

Definition at line 239 of file GoDBImport.cxx.

std::string GoDBImport::FindFieldName ( const std::string &  iLine)
private

Return the name of the field contained in the line.

Definition at line 187 of file GoDBImport.cxx.

ContourMeshContainer* GoDBImport::GetNewContourInfo ( )
inline

return a vector of the info needed to add in the visu the contours read from the import file and saved in the database

Definition at line 114 of file GoDBImport.h.

std::string GoDBImport::GetValueForTheLine ( const std::string &  iLine)
private

Return the value contained in the line and "NoValueOnTheLine" if the line doesn't contain any.

Definition at line 204 of file GoDBImport.cxx.

template<typename T >
std::string GoDBImport::GetValuesFromInfile ( T &  ioEntityToFill)
inlineprivate

Get the values from the import File to fill the corresponding GoDBRow.

Definition at line 208 of file GoDBImport.h.

std::vector< int > GoDBImport::GetVectorNewContourIDs ( )
inline

return a vector of the IDs for the contours read from the import file and saved in the database

Definition at line 99 of file GoDBImport.h.

std::vector< int > GoDBImport::GetVectorNewMeshIDs ( )
inline

return a vector of the IDs for the meshes read from the import file and saved in the database

Definition at line 92 of file GoDBImport.h.

std::vector< int > GoDBImport::GetVectorNewTracksIDs ( )
inline

return a vector of the IDs for the tracks read from the the import file and saved in the database

Definition at line 106 of file GoDBImport.h.

void GoDBImport::ImportContours ( )

get the data needed from the import file to save the contours listed in it, including the color, the mesh they belong to, the tracks the previous meshes belong to, etc...and fill the vectors of new IDs and the needed info for the visu to add these new contours

Definition at line 72 of file GoDBImport.cxx.

void GoDBImport::ImportMeshes ( )

get the data needed from the import file to save the meshes listed in it, including the color,their intensities,the tracks they belong to, the lineages the previous tracks belong to, etc...and fill the vectors of new IDs and the needed info for the visu to add these new meshes

Definition at line 93 of file GoDBImport.cxx.

void GoDBImport::ImportTracks ( )

get the data needed from the import file to save the tracks listed in it, including the color,their meshes and intensities,the lineages they belong to etc... and fill the vectors of new IDs and the needed info for the visu to add these new tracks and meshes.

Definition at line 114 of file GoDBImport.cxx.

bool GoDBImport::IsLineForNumberOfEntities ( const std::string &  iLine)
private

Return true if the line containes "Number Of".

Definition at line 220 of file GoDBImport.cxx.

void GoDBImport::OpenDBConnection ( )
private

Definition at line 230 of file GoDBImport.cxx.

template<typename T >
void GoDBImport::ReplaceCommonFieldsForTraces ( T &  ioEntityToSave,
const IntMapType iMapColorIDs,
const IntMapType iMapCoordIDs,
const IntMapType iMapCollectionIDs 
)
inlineprivate

replace old IDs found in the import file with new created IDs in the trace to be saved for common fields for the 4 traces: colorID, coordIDMin, CoordIDMax and CollectionID

Definition at line 253 of file GoDBImport.h.

template<typename T >
void GoDBImport::ReplaceTheFieldWithNewIDs ( const IntMapType iMapIDs,
std::string  iFieldName,
T &  ioEntity 
)
inlineprivate

replace in the entity to be saved the fieldname with the new IDs created that matches the old one in the iMapIDs

Definition at line 231 of file GoDBImport.h.

template<typename T >
std::string GoDBImport::SaveImportedEntitiesInDatabase ( int  iNumberOfEntities,
IntMapType ioMapMatchingIDs 
)
inlineprivate

get the values from the import file,save the corresponding number of entities in the database, return the last line content from the import file and update the matchingIDs with the new ones matching the old ones written in the import file

Definition at line 185 of file GoDBImport.h.

void GoDBImport::SaveIntensityForMesh ( std::string &  ioLineContent,
const IntMapType iMapMeshIDs,
const IntMapType iMapColorIDs 
)
private

fill the info needed for the new imported contours to add them in the visu

Definition at line 247 of file GoDBImport.cxx.

std::string GoDBImport::SaveNoTracesEntities ( IntMapType ioMapColorIDs,
IntMapType ioMapCellTypeIDs,
IntMapType ioMapSubCellTypeIDs,
IntMapType ioMapCoordIDs 
)
private

Get the values from the Infile, save the non traces entities, fill the matching map for old and new IDs and return the current line content.

Definition at line 122 of file GoDBImport.cxx.

template<typename T >
void GoDBImport::SaveTraces ( const IntMapType iMapColorIDs,
const IntMapType iMapCoordIDs,
const IntMapType iMapCollectionIDs,
std::string &  ioLineContent,
std::vector< int > &  ioNewTracesIDs,
IntMapType ioMapTraceIDs,
const IntMapType iMapIDsSpecificOne,
const IntMapType iMapIDsSpecificTwo 
)
inlineprivate
brief save all the entities in the database for a given

trace

Definition at line 277 of file GoDBImport.h.

template<>
void GoDBImport::SaveTraces ( const IntMapType iMapColorIDs,
const IntMapType iMapCoordIDs,
const IntMapType iMapCollectionIDs,
std::string &  ioLineContent,
std::vector< int > &  ioNewTracesIDs,
IntMapType ioMapTraceIDs,
const IntMapType iMapIDsSpecificOne,
const IntMapType iMapIDsSpecificTwo 
)
private

Definition at line 327 of file GoDBImport.cxx.

template<>
void GoDBImport::SaveTraces ( const IntMapType iMapColorIDs,
const IntMapType iMapCoordIDs,
const IntMapType iMapCollectionIDs,
std::string &  ioLineContent,
std::vector< int > &  ioNewTracesIDs,
IntMapType ioMapTraceIDs,
const IntMapType iMapIDsSpecificOne,
const IntMapType iMapIDsSpecificTwo 
)
private

Definition at line 389 of file GoDBImport.cxx.

void GoDBImport::SaveTracesEntities ( const IntMapType iMapColorIDs,
const IntMapType iMapCoordIDs,
const std::string &  iLineContent,
const IntMapType iMapCellTypeIDs,
const IntMapType iMapSubCellTypeIDs,
bool  SaveIntensities = false 
)
private

Get the info for the traces from the import file and from the matching IDs maps previously filled, then save them in the database if their bounding box doesn't match any existing ones and save the intensities for the meshes if SaveIntensities is set to true.

Definition at line 490 of file GoDBImport.cxx.

void GoDBImport::SaveTrackFamilyEntities ( const IntMapType iMapTrackIDs,
IntMapType ioMapTrackFamilyIDs,
std::string &  ioLineContent 
)
private

Definition at line 441 of file GoDBImport.cxx.

Member Data Documentation

int GoDBImport::m_CurrentTimePoint
private

Definition at line 125 of file GoDBImport.h.

vtkMySQLDatabase* GoDBImport::m_DatabaseConnector
private

Definition at line 120 of file GoDBImport.h.

int GoDBImport::m_ImagingSessionID
private

Definition at line 124 of file GoDBImport.h.

std::ifstream GoDBImport::m_InFile
private

Definition at line 126 of file GoDBImport.h.

std::string GoDBImport::m_Login
private

Definition at line 123 of file GoDBImport.h.

std::vector< int > GoDBImport::m_NewContourIDs
private

Definition at line 128 of file GoDBImport.h.

ContourMeshContainer* GoDBImport::m_NewContourInfoForVisu
private

Definition at line 131 of file GoDBImport.h.

std::vector< int > GoDBImport::m_NewLineageIDs
private

Definition at line 130 of file GoDBImport.h.

std::vector< int > GoDBImport::m_NewMeshIDs
private

Definition at line 127 of file GoDBImport.h.

ContourMeshContainer* GoDBImport::m_NewMeshInfoForVisu
private

Definition at line 132 of file GoDBImport.h.

std::vector< int > GoDBImport::m_NewTracksIDs
private

Definition at line 129 of file GoDBImport.h.

std::string GoDBImport::m_Password
private

Definition at line 122 of file GoDBImport.h.

std::string GoDBImport::m_ServerName
private

Definition at line 121 of file GoDBImport.h.


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