TexGen
Properties.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
22#include "Property.h"
23
24namespace TexGen
25{
26 using namespace std;
27
29
102 {
103 public:
104 CProperties();
105 CProperties(TiXmlElement &Element);
106 virtual ~CProperties(void);
107
109 virtual void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType);
110
112
115 void SetYarnLinearDensity(double dValue, string Units = "kg/m");
116
118 void SetFibreDensity(double dValue, string Units = "kg/m^3");
119
121 void SetFibreDiameter(double dValue, string Units = "m");
122
124 void SetFibresPerYarn(int iValue);
125
127 void SetYoungsModulus( double dValue, string Units = "MPa"); // Set x,y,z equal. Left in for backward compatibility
128 void SetYoungsModulusX( double dValue, string Units = "MPa");
129 void SetYoungsModulusY( double dValue, string Units = "MPa");
130 void SetYoungsModulusZ( double dValue, string Units = "MPa");
131
133 void SetShearModulusXY( double dValue, string Units = "MPa");
134 void SetShearModulusXZ( double dValue, string Units = "MPa");
135 void SetShearModulusYZ( double dValue, string Units = "MPa");
136
138 void SetPoissonsRatio( double dValue ); // Set x,y,z equal. Left in for backward compatibility
139 void SetPoissonsRatioX( double dValue );
140 void SetPoissonsRatioY( double dValue );
141 void SetPoissonsRatioZ( double dValue );
142
144 void SetAlphaX( double dValue, string Units = "/K");
145 void SetAlphaY( double dValue, string Units = "/K");
146 void SetAlphaZ( double dValue, string Units = "/K");
147
149
152 void SetFibreArea(double dValue, string Units = "m^2");
153
154 void ResetYarnLinearDensity() { m_YarnLinearDensity.Reset(); }
155 void ResetFibreDensity() { m_FibreDensity.Reset(); }
156 void ResetFibreDiameter() { m_FibreDiameter.Reset(); }
157 void ResetFibresPerYarn() { m_iFibresPerYarn = 0; }
158 void ResetFibreArea() { m_FibreArea.Reset(); }
159 void ResetYoungsModulusX() { m_YoungsModulusX.Reset(); }
160 void ResetYoungsModulusY() { m_YoungsModulusY.Reset(); }
161 void ResetYoungsModulusZ() { m_YoungsModulusZ.Reset(); }
162 void ResetShearModulusXY() { m_ShearModulusXY.Reset(); }
163 void ResetShearModulusXZ() { m_ShearModulusXZ.Reset(); }
164 void ResetShearModulusYZ() { m_ShearModulusYZ.Reset(); }
165 void ResetAlphaX() { m_AlphaX.Reset(); }
166 void ResetAlphaY() { m_AlphaY.Reset(); }
167 void ResetAlphaZ() { m_AlphaZ.Reset(); }
168 void ResetPoissonsRatioX() { m_PoissonsRatioX = 0.0; }
169 void ResetPoissonsRatioY() { m_PoissonsRatioY = 0.0; }
170 void ResetPoissonsRatioZ() { m_PoissonsRatioZ = 0.0; }
171
172
173 double GetYarnLinearDensity(string Units = "kg/m") const;
174 double GetFibreDensity(string Units = "kg/m^3") const;
175 double GetFibreDiameter(string Units = "m") const;
176 int GetFibresPerYarn() const;
178
183 double GetFibreArea(string Units = "m^2") const;
184 double GetYoungsModulusX( string Units = "MPa") const;
185 double GetYoungsModulusY( string Units = "MPa") const;
186 double GetYoungsModulusZ( string Units = "MPa") const;
187 double GetShearModulusXY( string Units = "MPa") const;
188 double GetShearModulusXZ( string Units = "MPa") const;
189 double GetShearModulusYZ( string Units = "MPa") const;
190 double GetAlphaX( string Units = "/K") const;
191 double GetAlphaY( string Units = "/K") const;
192 double GetAlphaZ( string Units = "/K") const;
193
194 double GetPoissonsRatioX() const;
195 double GetPoissonsRatioY() const;
196 double GetPoissonsRatioZ() const;
197
212
213 protected:
218
220 void SetDefaultProperties();
221 };
222}; // namespace TexGen
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
#define CLASS_DECLSPEC
Definition: Misc.h:35
Class to store properties related to a textile and/or yarn.
Definition: Properties.h:102
void ResetYoungsModulusY()
Definition: Properties.h:160
CProperty m_AlphaX
Definition: Properties.h:208
void ResetFibresPerYarn()
Definition: Properties.h:157
CProperty m_AlphaY
Definition: Properties.h:209
void ResetShearModulusYZ()
Definition: Properties.h:164
void ResetYoungsModulusX()
Definition: Properties.h:159
void ResetPoissonsRatioX()
Definition: Properties.h:168
void ResetShearModulusXZ()
Definition: Properties.h:163
void ResetPoissonsRatioZ()
Definition: Properties.h:170
CProperty m_YoungsModulusX
Definition: Properties.h:202
CProperty m_YoungsModulusZ
Definition: Properties.h:204
void ResetPoissonsRatioY()
Definition: Properties.h:169
CProperty m_FibreDiameter
Definition: Properties.h:201
CProperty m_YarnLinearDensity
Definition: Properties.h:198
void ResetFibreDiameter()
Definition: Properties.h:156
CProperty m_FibreDensity
Definition: Properties.h:199
CProperty m_CalculatedArea
Definition: Properties.h:211
void ResetFibreDensity()
Definition: Properties.h:155
CProperty m_ShearModulusXY
Definition: Properties.h:205
void ResetShearModulusXY()
Definition: Properties.h:162
CProperty m_ShearModulusYZ
Definition: Properties.h:207
CProperty m_AlphaZ
Definition: Properties.h:210
CProperty m_FibreArea
Definition: Properties.h:200
void ResetYoungsModulusZ()
Definition: Properties.h:161
void ResetYarnLinearDensity()
Definition: Properties.h:154
CProperty m_YoungsModulusY
Definition: Properties.h:203
CProperty m_ShearModulusXZ
Definition: Properties.h:206
Namespace containing a series of customised math operations not found in the standard c++ library.
OUTPUT_TYPE
Definition: Misc.h:105