TexGen
|
Abstract base class to handle interpolation for derived classes. More...
#include <YarnSectionInterp.h>
Public Member Functions | |
CYarnSectionInterp (bool bRamped, bool bPolar, bool bConstMesh=true) | |
CYarnSectionInterp (TiXmlElement &Element) | |
virtual | ~CYarnSectionInterp (void) |
virtual void | PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType) const |
Used for saving data to XML. More... | |
bool | GetRamped () |
bool | GetPolar () |
virtual CYarnSection * | Copy () const =0 |
This is a function to allow copying of derived classes correctly. More... | |
virtual string | GetType () const =0 |
Derived class should return the class name. More... | |
virtual vector< XY > | GetSection (const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced=false) const =0 |
This function must be implemented by derived classes. More... | |
virtual CMesh | GetSectionMesh (const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced) const =0 |
This function must be implemented by derived classes. More... | |
virtual void | SetSectionMeshLayersEqual (int iNumPoints) const |
Find max value for iNumLayers in section meshes and set iNumLayers to that value. More... | |
bool | GetForceMeshLayers () const |
CYarnSectionConstant * | GetSectionConstant () |
Get a pointer of that the inherited class. More... | |
CYarnSectionInterpNode * | GetSectionInterpNode () |
CYarnSectionInterpPosition * | GetSectionInterpPosition () |
Static Public Member Functions | |
static CObjectContainer< CYarnSection > | CreateYarnSection (TiXmlElement &Element) |
Create a yarn section from TiXmlElement. More... | |
Public Attributes | |
bool | m_bForceEqualMeshLayers |
Protected Member Functions | |
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 |
XY | InterpolatePoints (XY P1, XY P2, double u) const |
int | CalculateNumberofLayers (const vector< XY > &Section) const |
Protected Attributes | |
bool | m_bRamped |
bool | m_bPolar |
Abstract base class to handle interpolation for derived classes.
Definition at line 30 of file YarnSectionInterp.h.
CYarnSectionInterp::CYarnSectionInterp | ( | bool | bRamped, |
bool | bPolar, | ||
bool | bConstMesh = true |
||
) |
If bRamped is set to true, the interpolation fraction given to functions in GetInterpedSection and GetInterpedSectionMesh will be ramped using a cubic equation. Where du = 0 at u = 0, and du = 0 at u = 1. This provides a smoother transition between sections when the interpolation begins and ends.
bConstMesh | Defines whether all section meshes are forced to have same configuration ie number of rows and columns in mesh |
Definition at line 24 of file YarnSectionInterp.cpp.
CYarnSectionInterp::CYarnSectionInterp | ( | TiXmlElement & | Element | ) |
Definition at line 35 of file YarnSectionInterp.cpp.
|
virtual |
Definition at line 31 of file YarnSectionInterp.cpp.
|
protected |
Definition at line 147 of file YarnSectionInterp.cpp.
References TexGen::XY::x, and TexGen::XY::y.
Referenced by TexGen::CYarnSectionInterpNode::SetSectionMeshLayersEqual(), and TexGen::CYarnSectionInterpPosition::SetSectionMeshLayersEqual().
|
pure virtualinherited |
This is a function to allow copying of derived classes correctly.
Derived classes should implement this as CYarnSection* Copy() const { return new CYarnSectionDerived(*this); } where CYarnSectionDerived should be replaced by the name of the derived class
Implemented in TexGen::CYarnSectionAdjusted, TexGen::CYarnSectionConstant, TexGen::CYarnSectionInterpNode, and TexGen::CYarnSectionInterpPosition.
Referenced by TexGen::CShearedTextileWeave2D::AdjustSectionsForRotation(), TexGen::CTextileWeave2D::AdjustSectionsForRotation(), TexGen::CYarn::ConvertToInterpNodes(), and TexGen::CTextileWeave::CorrectEdgeInterference().
|
staticinherited |
Create a yarn section from TiXmlElement.
Definition at line 49 of file YarnSection.cpp.
Referenced by TexGen::CYarn::CYarn(), and TexGen::CYarnSectionAdjusted::CYarnSectionAdjusted().
|
inlineinherited |
Definition at line 99 of file YarnSection.h.
|
protected |
Definition at line 49 of file YarnSectionInterp.cpp.
References TexGen::CSection::GetPoints(), and InterpolatePoints().
Referenced by TexGen::CYarnSectionInterpNode::GetSection(), and TexGen::CYarnSectionInterpPosition::GetSection().
|
protected |
Definition at line 72 of file YarnSectionInterp.cpp.
References TexGen::CMesh::AddNode(), TexGen::CMesh::Clear(), TexGen::CSection::GetDefaultName(), TexGen::CMesh::GetIndices(), TexGen::CSection::GetMesh(), TexGen::CMesh::GetNode(), TexGen::CMesh::GetNumNodes(), InterpolatePoints(), TexGen::CMesh::NUM_ELEMENT_TYPES, TGERROR, TexGen::XYZ::x, TexGen::XY::x, TexGen::XYZ::y, and TexGen::XY::y.
Referenced by TexGen::CYarnSectionInterpNode::GetSectionMesh(), and TexGen::CYarnSectionInterpPosition::GetSectionMesh().
|
inline |
Definition at line 48 of file YarnSectionInterp.h.
|
inline |
Definition at line 47 of file YarnSectionInterp.h.
|
pure virtualinherited |
This function must be implemented by derived classes.
PositionInfo | Structure which contains information about the position along the yarn |
iNumPoints | Number of points on the perimeter of the section to return |
bEquiSpaced | Create the points such that they are all equispaced or not |
Implemented in TexGen::CYarnSectionAdjusted, TexGen::CYarnSectionConstant, TexGen::CYarnSectionInterpNode, and TexGen::CYarnSectionInterpPosition.
Referenced by TexGen::CShearedTextileWeave2D::CalculateModifiers(), TexGen::CTextileOrthogonal::CorrectCrimpInterference(), TexGen::CTextileWeave::CorrectInterference(), and TexGen::CTextileWeave::CorrectYarnWidths().
|
inherited |
Get a pointer of that the inherited class.
Internally the function just returns dynamic_cast<CYarnSectionConstant*>(this) etc This is mainly useful in the python interface because type casting is not supported in this language.
Definition at line 91 of file YarnSection.cpp.
|
inherited |
Definition at line 96 of file YarnSection.cpp.
|
inherited |
Definition at line 100 of file YarnSection.cpp.
|
pure virtualinherited |
This function must be implemented by derived classes.
PositionInfo | Structure which contains information about the position along the yarn |
iNumPoints | Number of points on the perimeter of the section to return |
bEquiSpaced | Create the points such that they are all equispaced or not |
Implemented in TexGen::CYarnSectionAdjusted, TexGen::CYarnSectionConstant, TexGen::CYarnSectionInterpNode, and TexGen::CYarnSectionInterpPosition.
|
pure virtualinherited |
Derived class should return the class name.
Implemented in TexGen::CYarnSectionAdjusted, TexGen::CYarnSectionConstant, TexGen::CYarnSectionInterpNode, and TexGen::CYarnSectionInterpPosition.
Referenced by TexGen::CShearedTextileWeave2D::AdjustSectionsForRotation(), TexGen::CTextileWeave2D::AdjustSectionsForRotation(), TexGen::CYarn::ConvertToInterpNodes(), TexGen::CTextileWeave::FlattenYarns(), and TexGen::CYarnSection::PopulateTiXmlElement().
Definition at line 117 of file YarnSectionInterp.cpp.
References TexGen::GetLength(), m_bPolar, m_bRamped, PI, TexGen::XY::x, and TexGen::XY::y.
Referenced by GetInterpedSection(), and GetInterpedSectionMesh().
|
virtual |
Used for saving data to XML.
Reimplemented from TexGen::CYarnSection.
Reimplemented in TexGen::CYarnSectionInterpNode, and TexGen::CYarnSectionInterpPosition.
Definition at line 42 of file YarnSectionInterp.cpp.
References m_bPolar, m_bRamped, TexGen::CYarnSection::PopulateTiXmlElement(), and TexGen::stringify().
Referenced by TexGen::CYarnSectionInterpNode::PopulateTiXmlElement(), and TexGen::CYarnSectionInterpPosition::PopulateTiXmlElement().
|
inlinevirtualinherited |
Find max value for iNumLayers in section meshes and set iNumLayers to that value.
Reimplemented in TexGen::CYarnSectionInterpNode, and TexGen::CYarnSectionInterpPosition.
Definition at line 97 of file YarnSection.h.
|
inherited |
Definition at line 63 of file YarnSection.h.
Referenced by TexGen::CYarnSection::CYarnSection(), and TexGen::CYarnSection::PopulateTiXmlElement().
|
protected |
Definition at line 58 of file YarnSectionInterp.h.
Referenced by CYarnSectionInterp(), InterpolatePoints(), and PopulateTiXmlElement().
|
protected |
Definition at line 58 of file YarnSectionInterp.h.
Referenced by CYarnSectionInterp(), InterpolatePoints(), and PopulateTiXmlElement().