29CYarnSection::CYarnSection(
bool bConstMesh)
30: m_bForceEqualMeshLayers(bConstMesh)
40 const char* result = Element.Attribute(
"ConstMesh");
51 const string* pType = Element.Attribute(
string(
"type"));
54 if (*pType ==
"CYarnSectionConstant")
56 else if (*pType ==
"CYarnSectionInterpNode")
58 else if (*pType ==
"CYarnSectionInterpPosition")
60 else if (*pType ==
"CYarnSectionAdjusted")
70 Element.SetAttribute(
"type",
GetType());
80 TGERROR(
"Unable to get yarn position, yarn section index out of range: " <<
iSection);
#define TGERROR(MESSAGE)
Macros used to report the file name and line number to the TexGenError and TexGenLog functions.
Object container to help handle memory management issues.
Bezier interpolation for yarn paths.
Creates a section which is constant all along the yarn.
CYarnSectionConstant * GetSectionConstant()
Get a pointer of that the inherited class.
CYarnSection(bool bConstMesh=true)
bool m_bForceEqualMeshLayers
CYarnSectionInterpNode * GetSectionInterpNode()
virtual string GetType() const =0
Derived class should return the class name.
virtual ~CYarnSection(void)
CYarnSectionInterpPosition * GetSectionInterpPosition()
virtual void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const
Used for saving data to XML.
static CObjectContainer< CYarnSection > CreateYarnSection(TiXmlElement &Element)
Create a yarn section from TiXmlElement.
Creates a section which is linearly interpolated between sections defined at the nodes.
Interpolate sections between arbritrary positions along the length of the yarn.
Namespace containing a series of customised math operations not found in the standard c++ library.
std::string stringify(const T &x, int iPrecision=12, bool bScientific=true)
Function to convert a value (e.g. int, double, etc...) to a string.
double dSectionPosition
This variables varies linearly with distance from 0 to 1 from the start to the end of the current lin...
int iSection
This variable represents the index of the current section (where a section is defined as the part bet...
vector< double > SectionLengths
This contains a list of lengths representing the length of each section.
double GetYarnPosition() const