25CYarnSectionInterpPosition::CYarnSectionInterpPosition(
bool bRamped,
bool bPolar,
bool bConstMesh)
39 TiXmlElement* pSection = pPositionSection->FirstChildElement(
"Section");
43 valueify<double>(pPositionSection->Attribute(
"t")),
57 TiXmlElement PositionSection(
"PositionSection");
59 TiXmlElement Section(
"Section");
60 m_Sections[i].second->PopulateTiXmlElement(Section, OutputType);
61 PositionSection.InsertEndChild(Section);
62 Element.InsertEndChild(PositionSection);
78 if (
m_Sections[i].first >= dYarnPosition && iSection2 == -1)
82 if (iSection1 == -1 && iSection2 == -1)
84 TGERROR(
"Unable to get section, no sections specified");
90 if (iSection1 != -1 && iSection2 != -1)
95 else if (iSection1 == -1)
110 u = (dYarnPosition-du1)/(du2 - du1);
130 if (
m_Sections[i].first >= dYarnPosition && iSection2 == -1)
134 if (iSection1 == -1 && iSection2 == -1)
136 TGERROR(
"Unable to get section mesh, no sections specified");
142 if (iSection1 != -1 && iSection2 != -1)
147 else if (iSection1 == -1)
161 if ( (iSection1 != -1 && iSection2 != -1) && (du1 == du2) )
163 Mesh =
m_Sections[iSection1].second->GetMesh(iNumPoints, bEquiSpaced);
167 u = (dYarnPosition-du1)/(du2 - du1);
182 assert(iIndex >= 0 && iIndex < (
int)
m_Sections.size());
188 assert(iIndex >= 0 && iIndex < (
int)
m_Sections.size());
195 for (
int i = 0; i < (int)
m_Sections.size(); ++i )
199 if ( iNumLayers > iMaxLayers )
200 iMaxLayers = iNumLayers;
202 if ( iMaxLayers != -1 )
204 for (
int i = 0; i < (int)
m_Sections.size(); ++i )
#define TGERROR(MESSAGE)
Macros used to report the file name and line number to the TexGenError and TexGenLog functions.
#define FOR_EACH_TIXMLELEMENT(CHILDELEMENT, PARENTELEMENT, ELEMENTNAME)
Macro to enable looping over tinyxml easier.
Defines the nodes and elements of a surface or volume mesh.
Object container to help handle memory management issues.
Abstract base class respresenting a yarn cross-section.
static CObjectContainer< CSection > CreateSection(TiXmlElement &Element)
Create a section from TiXmlElement.
void SetSectionMeshLayers(int iNum)
Specify number of layers for associated section mesh.
Abstract base class to handle interpolation for derived classes.
virtual void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const
Used for saving data to XML.
int CalculateNumberofLayers(const vector< XY > &Section) const
bool GetInterpedSection(const CSection &Section1, const CSection &Section2, double u, int iNumPoints, bool bEquiSpaced, vector< XY > &Points) const
bool GetInterpedSectionMesh(const CSection &Section1, const CSection &Section2, double u, int iNumPoints, bool bEquiSpaced, CMesh &Mesh) const
CYarnSectionInterpPosition(bool bRamped=true, bool bPolar=false, bool bConstMesh=true)
double GetSectionPosition(int iIndex) const
vector< pair< double, CObjectContainer< CSection > > > m_Sections
void SetSectionMeshLayersEqual(int iNumPoints) const
Function to set the number of layers equal for all sections in a given yarn.
void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const
Used for saving data to XML.
vector< XY > GetSection(const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced=false) const
This function must be implemented by derived classes.
void AddSection(double dPosition, const CSection &Section)
Add a section at a specific point along the path of the yarn.
~CYarnSectionInterpPosition(void)
CMesh GetSectionMesh(const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced) const
This function must be implemented by derived classes.
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.
Used to sort double-objectref pairs.
Structure used to represent the position along the length of a yarn.
double GetYarnPosition() const