TexGen
|
Singleton class holding the Textiles in a database. More...
#include <TexGen.h>
Public Member Functions | |
CTexGen (void) | |
~CTexGen (void) | |
string | GetName (const CTextile *pTextile) const |
Get the name of the textile with given pointer. More... | |
CTextile * | GetTextile (string TextileName="") |
Get a textile with given name. More... | |
bool | AddTextile (string TextileName, const CTextile &Textile, bool bOverwrite=false) |
Add Textile. More... | |
string | AddTextile (const CTextile &Textile) |
Add Textile. More... | |
bool | DeleteTextile (string TextileName) |
Delete a textile. More... | |
void | PopulateTiXmlElement (TiXmlElement &Element, string TextileName="", OUTPUT_TYPE OutputType=OUTPUT_STANDARD) |
Used for saving data to XML. More... | |
bool | LoadTiXmlElement (TiXmlElement &Element) |
Used for loading data from XML. More... | |
void | SaveToXML (string FileName, string TextileName="", OUTPUT_TYPE OutputType=OUTPUT_STANDARD) |
Save TexGen XML file. More... | |
bool | ReadFromXML (string FileName) |
Read TexGen XML file. More... | |
void | DeleteTextiles () |
Clear Textiles. More... | |
void | SetLogger (const CLogger &Logger) |
Set the logger. More... | |
void | SetTextileCallback (void(*pTextileCallback)(string TextileName, bool bAdded)) |
Set the callback function when a textile is added or deleted. More... | |
string | GetVersion () const |
Get the version of TexGen. More... | |
void | SetMessages (bool bMessagesOn, const CLogger &Logger) |
Switch messages on/off. More... | |
void | SetMessages (bool bMessagesOn) |
Switch messages on/off - use from scripts. More... | |
bool | GetMessagesOn () const |
Get messages on/off. More... | |
void | GetTextileNames (vector< string > &Names) |
Get list of textile names. More... | |
const map< string, CTextile * > & | GetTextiles () const |
CLogger & | GetLogger () const |
Static Public Member Functions | |
static CTexGen & | GetInstance () |
Protected Attributes | |
map< string, CTextile * > | m_Textiles |
List of textiles created. More... | |
CLogger * | m_pLogger |
Logger used to keep track of how error messages and log messages displayed or stored. More... | |
bool | m_bMessagesOn |
void(* | m_pTextileCallback )(string TextileName, bool bAdded) |
int | m_iMajorVersion |
int | m_iMinorVersion |
int | m_iRevision |
Static Protected Attributes | |
static CTexGen | m_SingleInstance |
CTexGen::CTexGen | ( | void | ) |
Definition at line 28 of file TexGen.cpp.
References TexGen::AddNewUnits(), and SetLogger().
CTexGen::~CTexGen | ( | void | ) |
Definition at line 41 of file TexGen.cpp.
References DeleteTextiles(), and m_pLogger.
string CTexGen::AddTextile | ( | const CTextile & | Textile | ) |
Add Textile.
Textile | Textile object to add, a copy of it will be created and stored |
Definition at line 117 of file TexGen.cpp.
References TexGen::CTextile::Copy(), TexGen::CTextile::GetDefaultName(), m_pTextileCallback, m_Textiles, TexGen::stringify(), and TGLOG.
bool CTexGen::AddTextile | ( | string | TextileName, |
const CTextile & | Textile, | ||
bool | bOverwrite = false |
||
) |
Add Textile.
TextileName | Name assigned to the textile, it must be unique |
Textile | Textile object to add, a copy of it will be created and stored |
bOverwrite | If true an existing textile with the same name will be overwritten |
Definition at line 83 of file TexGen.cpp.
References TexGen::CTextile::Copy(), m_pTextileCallback, m_Textiles, TGERROR, and TGLOG.
Referenced by LoadTiXmlElement().
bool CTexGen::DeleteTextile | ( | string | TextileName | ) |
Delete a textile.
TextileName | Name of the textile to delete |
Definition at line 134 of file TexGen.cpp.
References m_pTextileCallback, m_Textiles, TGERROR, and TGLOG.
Referenced by DeleteTextiles().
void CTexGen::DeleteTextiles | ( | ) |
Clear Textiles.
Definition at line 261 of file TexGen.cpp.
References DeleteTextile(), and m_Textiles.
Referenced by ~CTexGen().
|
inlinestaticinherited |
Definition at line 40 of file Singleton.h.
|
inline |
string CTexGen::GetName | ( | const CTextile * | pTextile | ) | const |
Get the name of the textile with given pointer.
Definition at line 48 of file TexGen.cpp.
References m_Textiles.
CTextile * CTexGen::GetTextile | ( | string | TextileName = "" | ) |
Get a textile with given name.
TextileName | Name of the textile to return return Pointer to the textile or NULL if the textile doesn't exist |
Definition at line 59 of file TexGen.cpp.
References m_Textiles, NULL, and TGERROR.
Referenced by TexGen::CExporter::OutputTextileToIGES(), TexGen::CExporter::OutputTextileToSTEP(), PopulateTiXmlElement(), TexGen::CTexGenRenderer::RenderDomain(), TexGen::CTexGenRenderer::RenderDomainAxes(), TexGen::CTexGenRenderer::RenderGrid(), TexGen::CTexGenRenderer::RenderInterference(), TexGen::CTexGenRenderer::RenderMesh(), TexGen::CTexGenRenderer::RenderNodes(), TexGen::CTexGenRenderer::RenderPaths(), and TexGen::CTexGenRenderer::RenderTextile().
void CTexGen::GetTextileNames | ( | vector< string > & | Names | ) |
|
inline |
Definition at line 155 of file TexGen.h.
Referenced by TexGen::CTexGenRenderer::RenderDomain(), TexGen::CTexGenRenderer::RenderDomainAxes(), TexGen::CTexGenRenderer::RenderGrid(), TexGen::CTexGenRenderer::RenderInterference(), TexGen::CTexGenRenderer::RenderMesh(), TexGen::CTexGenRenderer::RenderNodes(), TexGen::CTexGenRenderer::RenderPaths(), and TexGen::CTexGenRenderer::RenderTextile().
string CTexGen::GetVersion | ( | ) | const |
Get the version of TexGen.
Definition at line 281 of file TexGen.cpp.
References m_iMajorVersion, m_iMinorVersion, m_iRevision, and TexGen::stringify().
Referenced by ReadFromXML(), and SaveToXML().
bool CTexGen::LoadTiXmlElement | ( | TiXmlElement & | Element | ) |
Used for loading data from XML.
Definition at line 177 of file TexGen.cpp.
References AddTextile(), and FOR_EACH_TIXMLELEMENT.
Referenced by ReadFromXML().
void CTexGen::PopulateTiXmlElement | ( | TiXmlElement & | Element, |
string | TextileName = "" , |
||
OUTPUT_TYPE | OutputType = OUTPUT_STANDARD |
||
) |
Used for saving data to XML.
Definition at line 151 of file TexGen.cpp.
References GetTextile(), m_Textiles, and TexGen::CTextile::PopulateTiXmlElement().
Referenced by SaveToXML().
bool CTexGen::ReadFromXML | ( | string | FileName | ) |
Read TexGen XML file.
Definition at line 234 of file TexGen.cpp.
References GetVersion(), LoadTiXmlElement(), TGERROR, TGLOG, and TGLOGINDENT.
void CTexGen::SaveToXML | ( | string | FileName, |
string | TextileName = "" , |
||
OUTPUT_TYPE | OutputType = OUTPUT_STANDARD |
||
) |
Save TexGen XML file.
FileName | The name of the XML file on disk |
TextileName | The name of the textile to save, if left blank will save all textiles |
OutputType | The amount of information to save to disk |
Definition at line 215 of file TexGen.cpp.
References GetVersion(), PopulateTiXmlElement(), TGERROR, and TGLOG.
void CTexGen::SetLogger | ( | const CLogger & | Logger | ) |
Set the logger.
Definition at line 269 of file TexGen.cpp.
References TexGen::CLogger::Copy(), and m_pLogger.
Referenced by CTexGen(), and SetMessages().
void CTexGen::SetMessages | ( | bool | bMessagesOn | ) |
Switch messages on/off - use from scripts.
Definition at line 292 of file TexGen.cpp.
References m_bMessagesOn, and SetLogger().
void CTexGen::SetMessages | ( | bool | bMessagesOn, |
const CLogger & | Logger | ||
) |
Switch messages on/off.
Definition at line 286 of file TexGen.cpp.
References m_bMessagesOn, and SetLogger().
void CTexGen::SetTextileCallback | ( | void(*)(string TextileName, bool bAdded) | pTextileCallback | ) |
Set the callback function when a textile is added or deleted.
Definition at line 276 of file TexGen.cpp.
References m_pTextileCallback.
|
protected |
Definition at line 161 of file TexGen.h.
Referenced by SetMessages().
|
protected |
Definition at line 163 of file TexGen.h.
Referenced by GetVersion().
|
protected |
Definition at line 164 of file TexGen.h.
Referenced by GetVersion().
|
protected |
Definition at line 165 of file TexGen.h.
Referenced by GetVersion().
|
protected |
Logger used to keep track of how error messages and log messages displayed or stored.
Definition at line 160 of file TexGen.h.
Referenced by SetLogger(), and ~CTexGen().
|
protected |
Definition at line 162 of file TexGen.h.
Referenced by AddTextile(), DeleteTextile(), and SetTextileCallback().
|
staticprotectedinherited |
Definition at line 45 of file Singleton.h.
|
protected |
List of textiles created.
Definition at line 159 of file TexGen.h.
Referenced by AddTextile(), DeleteTextile(), DeleteTextiles(), GetName(), GetTextile(), GetTextileNames(), and PopulateTiXmlElement().