TexGen
TexGen.h
Go to the documentation of this file.
1/*=============================================================================
2TexGen: Geometric textile modeller.
3Copyright (C) 2006 Martin Sherburn
4
5This program is free software; you can redistribute it and/or
6modify it under the terms of the GNU General Public License
7as published by the Free Software Foundation; either version 2
8of the License, or (at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18=============================================================================*/
19
20#pragma once
21#include "Misc.h"
22#include "Logger.h"
23#include "ObjectContainer.h"
24#include "Singleton.h"
25#include "Section.h"
26#include "SectionEllipse.h"
27#include "SectionPowerEllipse.h"
28#include "SectionLenticular.h"
29#include "SectionBezier.h"
30#include "SectionPolygon.h"
31#include "SectionHybrid.h"
32#include "SectionRotated.h"
33#include "SectionScaled.h"
34#include "SectionRectangle.h"
35#include "Textile.h"
36#include "TextileWeave.h"
37#include "TextileWeave2D.h"
38#include "TextileWeave3D.h"
39#include "Domain.h"
40#include "DomainPlanes.h"
41#include "DomainPrism.h"
42#include "Mesher.h"
43#include "TextileDeformer.h"
45#include "GeometrySolver.h"
46#include "Simulation.h"
47#include "SimulationAbaqus.h"
48#include "VoxelMesh.h"
50#include "ShearedVoxelMesh.h"
51#include "StaggeredVoxelMesh.h"
52#include "OctreeVoxelMesh.h"
53#include "RotatedVoxelMesh.h"
54#include "PrismVoxelMesh.h"
55#include "TetgenMesh.h"
56#include "SurfaceMesh.h"
57#include "PeriodicBoundaries.h"
58#include "Textile3DWeave.h"
59#include "TextileOrthogonal.h"
61#include "TextileLayerToLayer.h"
68#include "TextileLayered.h"
69#include "PatternDraft.h"
71#include "Materials.h"
72#include "ShellElementExport.h"
73#include "MeshDomainPlane.h"
74
76#define TEXGEN (CTexGen::GetInstance())
77
78namespace TexGen
79{
80 class CLogger;
81
82 using namespace std;
83
85 class CLASS_DECLSPEC CTexGen : public CSingleton<CTexGen>
86 {
87 public:
88
89 CTexGen(void);
90 ~CTexGen(void);
91
93
96 string GetName(const CTextile* pTextile) const;
97
99
103 CTextile* GetTextile(string TextileName = "");
105
111 bool AddTextile(string TextileName, const CTextile &Textile, bool bOverwrite = false);
113
117 string AddTextile(const CTextile &Textile);
119
123 bool DeleteTextile(string TextileName);
125 void PopulateTiXmlElement(TiXmlElement &Element, string TextileName = "", OUTPUT_TYPE OutputType = OUTPUT_STANDARD);
127 bool LoadTiXmlElement(TiXmlElement &Element);
129
134 void SaveToXML(string FileName, string TextileName = "", OUTPUT_TYPE OutputType = OUTPUT_STANDARD);
136 bool ReadFromXML(string FileName);
138 void DeleteTextiles();
140 void SetLogger(const CLogger &Logger);
142 void SetTextileCallback(void (*pTextileCallback)(string TextileName, bool bAdded));
144 string GetVersion() const;
146 void SetMessages( bool bMessagesOn, const CLogger &Logger );
148 void SetMessages( bool bMessagesOn );
150 bool GetMessagesOn( ) const { return m_bMessagesOn; }
152 void GetTextileNames( vector<string> &Names );
153
154 // Accessor methods
155 const map<string, CTextile*> &GetTextiles() const { return m_Textiles; }
156 CLogger &GetLogger() const { return *m_pLogger; }
157
158 protected:
159 map<string, CTextile*> m_Textiles;
161 bool m_bMessagesOn; // Messages on/off
162 void (*m_pTextileCallback)(string TextileName, bool bAdded);
166 };
167
168}; // namespace TexGen
169
170
#define CLASS_DECLSPEC
Definition: Misc.h:35
Abstract base class to act as an interface between texgen and the logger.
Definition: Logger.h:85
Template used as a base class for creating singletons.
Definition: Singleton.h:32
Singleton class holding the Textiles in a database.
Definition: TexGen.h:86
map< string, CTextile * > m_Textiles
List of textiles created.
Definition: TexGen.h:159
CLogger * m_pLogger
Logger used to keep track of how error messages and log messages displayed or stored.
Definition: TexGen.h:160
int m_iRevision
Definition: TexGen.h:165
int m_iMinorVersion
Definition: TexGen.h:164
bool GetMessagesOn() const
Get messages on/off.
Definition: TexGen.h:150
int m_iMajorVersion
Definition: TexGen.h:163
bool m_bMessagesOn
Definition: TexGen.h:161
CLogger & GetLogger() const
Definition: TexGen.h:156
const map< string, CTextile * > & GetTextiles() const
Definition: TexGen.h:155
Represents a textile cell containing yarns.
Definition: Textile.h:39
Namespace containing a series of customised math operations not found in the standard c++ library.
OUTPUT_TYPE
Definition: Misc.h:105
@ OUTPUT_STANDARD
Definition: Misc.h:107