TexGen
|
Creates a section which is linearly interpolated between sections defined at the nodes. More...
#include <YarnSectionInterpNode.h>
Public Member Functions | |
CYarnSectionInterpNode (bool bRamped=true, bool bPolar=false, bool bConstMesh=true) | |
CYarnSectionInterpNode (TiXmlElement &Element) | |
~CYarnSectionInterpNode (void) | |
vector< XY > | GetSection (const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced=false) const |
This function must be implemented by derived classes. More... | |
CMesh | GetSectionMesh (const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced) const |
This function must be implemented by derived classes. More... | |
CYarnSection * | Copy () const |
This is a function to allow copying of derived classes correctly. More... | |
string | GetType () const |
Derived class should return the class name. More... | |
void | PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType) const |
Used for saving data to XML. More... | |
void | AddSection (const CSection &Section) |
Add a section at a node. More... | |
void | InsertSection (int iIndex, const CSection &Section) |
Insert a section at a node. More... | |
void | ReplaceSection (int iIndex, const CSection &Section) |
Replace a section at a node. More... | |
void | ReplaceMidSection (int iNodeIndex, int iIndex, const CSection &Section) |
Replace a mid node section. More... | |
void | DeleteSection (int iIndex) |
Delete a section at a node. More... | |
void | InsertSection (int iIndex, double u, const CSection &Section) |
Insert a section in between two nodes. More... | |
void | SetSectionMeshLayersEqual (int iNumPoints) const |
Function to set the number of layers equal for all sections in a given yarn. More... | |
int | GetNumNodeSections () const |
const CSection & | GetNodeSection (int iIndex) const |
int | GetNumMidNodeSections (int iIndex) const |
double | GetMidNodeSectionPos (int iNodeIndex, int iIndex) const |
bool | GetRamped () |
bool | GetPolar () |
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 | |
void | GetSectionsToInterp (const YARN_POSITION_INFORMATION PositionInfo, const CSection *&pSection1, const CSection *&pSection2, double &u) 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 |
XY | InterpolatePoints (XY P1, XY P2, double u) const |
int | CalculateNumberofLayers (const vector< XY > &Section) const |
Protected Attributes | |
vector< CObjectContainer< CSection > > | m_Sections |
vector< vector< pair< double, CObjectContainer< CSection > > > > | m_MidNodeSections |
bool | m_bRamped |
bool | m_bPolar |
Creates a section which is linearly interpolated between sections defined at the nodes.
Additional sections can be defined between the nodes using the AddSection function. If sections need not be defined at the nodes then CYarnSectionInterpPosition should be used instead.
Definition at line 32 of file YarnSectionInterpNode.h.
CYarnSectionInterpNode::CYarnSectionInterpNode | ( | bool | bRamped = true , |
bool | bPolar = false , |
||
bool | bConstMesh = true |
||
) |
bRamped,bPolar | Specify how points are interpolated between master nodes using CYarnSectionInterp::InterpolatePoints() 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 26 of file YarnSectionInterpNode.cpp.
CYarnSectionInterpNode::CYarnSectionInterpNode | ( | TiXmlElement & | Element | ) |
Definition at line 35 of file YarnSectionInterpNode.cpp.
References TexGen::CSection::CreateSection(), FOR_EACH_TIXMLELEMENT, m_MidNodeSections, and m_Sections.
CYarnSectionInterpNode::~CYarnSectionInterpNode | ( | void | ) |
Definition at line 31 of file YarnSectionInterpNode.cpp.
void CYarnSectionInterpNode::AddSection | ( | const CSection & | Section | ) |
Add a section at a node.
Nodes should be added sequentially, one for each master node, the number of nodes must be equal to the number of nodes on the yarn it is applied to
Definition at line 133 of file YarnSectionInterpNode.cpp.
References m_MidNodeSections, and m_Sections.
Referenced by TexGen::CTextileOrthogonal::BuildTextile(), TexGen::CTextileOrthogonal::BuildWeavePatternTextile(), TexGen::CYarn::ConvertToInterpNodes(), TexGen::CTextileWeave::CorrectEdgeInterference(), and TexGen::CTextileWeave::CorrectInterference().
|
protectedinherited |
Definition at line 147 of file YarnSectionInterp.cpp.
References TexGen::XY::x, and TexGen::XY::y.
Referenced by SetSectionMeshLayersEqual(), and TexGen::CYarnSectionInterpPosition::SetSectionMeshLayersEqual().
|
inlinevirtual |
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
Implements TexGen::CYarnSection.
Definition at line 50 of file YarnSectionInterpNode.h.
|
staticinherited |
Create a yarn section from TiXmlElement.
Definition at line 49 of file YarnSection.cpp.
Referenced by TexGen::CYarn::CYarn(), and TexGen::CYarnSectionAdjusted::CYarnSectionAdjusted().
void CYarnSectionInterpNode::DeleteSection | ( | int | iIndex | ) |
Delete a section at a node.
Definition at line 302 of file YarnSectionInterpNode.cpp.
References m_MidNodeSections, m_Sections, and TGERROR.
Referenced by TexGen::CYarn::DeleteNode().
|
inlineinherited |
Definition at line 99 of file YarnSection.h.
|
protectedinherited |
Definition at line 49 of file YarnSectionInterp.cpp.
References TexGen::CSection::GetPoints(), and TexGen::CYarnSectionInterp::InterpolatePoints().
Referenced by GetSection(), and TexGen::CYarnSectionInterpPosition::GetSection().
|
protectedinherited |
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(), TexGen::CYarnSectionInterp::InterpolatePoints(), TexGen::CMesh::NUM_ELEMENT_TYPES, TGERROR, TexGen::XYZ::x, TexGen::XY::x, TexGen::XYZ::y, and TexGen::XY::y.
Referenced by GetSectionMesh(), and TexGen::CYarnSectionInterpPosition::GetSectionMesh().
double CYarnSectionInterpNode::GetMidNodeSectionPos | ( | int | iNodeIndex, |
int | iIndex | ||
) | const |
Definition at line 323 of file YarnSectionInterpNode.cpp.
References m_MidNodeSections, and m_Sections.
Referenced by TexGen::CShearedTextileWeave2D::AdjustSections(), and TexGen::CShearedTextileWeave2D::CorrectInterference().
const CSection & CYarnSectionInterpNode::GetNodeSection | ( | int | iIndex | ) | const |
Definition at line 171 of file YarnSectionInterpNode.cpp.
References m_Sections.
Referenced by TexGen::CTextileOrthogonal::AdjustMidLayerHeights(), TexGen::CTextileOrthogonal::AdjustOuterWeftYarns(), TexGen::CShearedTextileWeave2D::AdjustSections(), TexGen::CShearedTextileWeave2D::AdjustSectionsForRotation(), TexGen::CTextileWeave2D::AdjustSectionsForRotation(), TexGen::CTextileWeave::CorrectEdgeInterference(), TexGen::CTextileWeave::CorrectInterference(), TexGen::CShearedTextileWeave2D::CorrectInterference(), TexGen::CTextile3DWeave::GetCrossSection(), TexGen::CTextileOrthogonal::GetHybridSectionWidth(), and TexGen::CYarn::InsertNode().
int CYarnSectionInterpNode::GetNumMidNodeSections | ( | int | iIndex | ) | const |
Definition at line 313 of file YarnSectionInterpNode.cpp.
References m_MidNodeSections, m_Sections, and TGERROR.
Referenced by TexGen::CShearedTextileWeave2D::CorrectInterference().
|
inline |
Definition at line 94 of file YarnSectionInterpNode.h.
Referenced by TexGen::CTextileOrthogonal::AdjustMidLayerHeights(), TexGen::CShearedTextileWeave2D::AdjustSections(), and TexGen::CShearedTextileWeave2D::CorrectInterference().
|
inlineinherited |
Definition at line 48 of file YarnSectionInterp.h.
|
inlineinherited |
Definition at line 47 of file YarnSectionInterp.h.
|
virtual |
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 |
Implements TexGen::CYarnSection.
Definition at line 93 of file YarnSectionInterpNode.cpp.
References TexGen::CYarnSectionInterp::GetInterpedSection(), GetSectionsToInterp(), m_Sections, TexGen::YARN_POSITION_INFORMATION::SectionLengths, and TGERROR.
Referenced by TexGen::CTextileWeave::FlattenYarns(), and TexGen::CShearedTextileWeave2D::ModifySection().
|
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.
|
virtual |
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 |
Implements TexGen::CYarnSection.
Definition at line 113 of file YarnSectionInterpNode.cpp.
References TexGen::CYarnSectionInterp::GetInterpedSectionMesh(), GetSectionsToInterp(), m_Sections, TexGen::YARN_POSITION_INFORMATION::SectionLengths, and TGERROR.
|
protected |
Definition at line 190 of file YarnSectionInterpNode.cpp.
References TexGen::YARN_POSITION_INFORMATION::dSectionPosition, TexGen::YARN_POSITION_INFORMATION::iSection, m_MidNodeSections, and m_Sections.
Referenced by GetSection(), and GetSectionMesh().
|
inlinevirtual |
Derived class should return the class name.
Implements TexGen::CYarnSection.
Definition at line 51 of file YarnSectionInterpNode.h.
void CYarnSectionInterpNode::InsertSection | ( | int | iIndex, |
const CSection & | Section | ||
) |
Insert a section at a node.
If a node is added to the yarn after, it may be necessary to insert a section at a specific index. The section will be added at the given index, and all other sections will be pushed back.
Definition at line 139 of file YarnSectionInterpNode.cpp.
References m_MidNodeSections, m_Sections, and TGERROR.
Referenced by TexGen::CShearedTextileWeave2D::AdjustSectionsForRotation(), TexGen::CTextileOrthogonal::CorrectCrimpInterference(), TexGen::CTextileWeave::CorrectInterference(), and TexGen::CYarn::InsertNode().
void CYarnSectionInterpNode::InsertSection | ( | int | iIndex, |
double | u, | ||
const CSection & | Section | ||
) |
Insert a section in between two nodes.
The sections must be added at the nodes before midnode sections are added
iIndex | The index of the segment between two nodes |
u | The position between the two nodes where to add the section 0 < u < 1 |
Section | The section to add at this point |
Definition at line 150 of file YarnSectionInterpNode.cpp.
References m_MidNodeSections, and TGERROR.
Definition at line 117 of file YarnSectionInterp.cpp.
References TexGen::GetLength(), TexGen::CYarnSectionInterp::m_bPolar, TexGen::CYarnSectionInterp::m_bRamped, PI, TexGen::XY::x, and TexGen::XY::y.
Referenced by TexGen::CYarnSectionInterp::GetInterpedSection(), and TexGen::CYarnSectionInterp::GetInterpedSectionMesh().
|
virtual |
Used for saving data to XML.
Reimplemented from TexGen::CYarnSectionInterp.
Definition at line 64 of file YarnSectionInterpNode.cpp.
References m_MidNodeSections, m_Sections, TexGen::CYarnSectionInterp::PopulateTiXmlElement(), and TexGen::stringify().
void CYarnSectionInterpNode::ReplaceMidSection | ( | int | iNodeIndex, |
int | iIndex, | ||
const CSection & | Section | ||
) |
Replace a mid node section.
Definition at line 331 of file YarnSectionInterpNode.cpp.
References m_MidNodeSections, m_Sections, and TGERROR.
Referenced by TexGen::CShearedTextileWeave2D::ModifySection(), and TexGen::CShearedTextileWeave2D::ReplaceSection().
void CYarnSectionInterpNode::ReplaceSection | ( | int | iIndex, |
const CSection & | Section | ||
) |
Replace a section at a node.
Replace an existing section at the node. Note that the old one will not be deleted until the YarnSectionInterpNode is deleted.
Definition at line 161 of file YarnSectionInterpNode.cpp.
References m_Sections, and TGERROR.
Referenced by TexGen::CTextileOrthogonal::AdjustMidLayerHeights(), TexGen::CShearedTextileWeave2D::AdjustSections(), TexGen::CShearedTextileWeave2D::AdjustSectionsForRotation(), TexGen::CTextileWeave2D::AdjustSectionsForRotation(), TexGen::CTextileOrthogonal::ChangeBinderSection(), TexGen::CTextileOrthogonal::ChangeWeftSection(), TexGen::CTextileOrthogonal::CorrectCrimpInterference(), TexGen::CShearedTextileWeave2D::CorrectInterference(), TexGen::CTextileWeave::FlattenYarns(), TexGen::CShearedTextileWeave2D::ModifySection(), TexGen::CShearedTextileWeave2D::ReplaceSection(), and TexGen::CTextileOrthogonal::ReplaceYarnSection().
|
virtual |
Function to set the number of layers equal for all sections in a given yarn.
Reimplemented from TexGen::CYarnSection.
Definition at line 233 of file YarnSectionInterpNode.cpp.
References TexGen::CYarnSectionInterp::CalculateNumberofLayers(), TexGen::CSection::GetSectionMeshLayers(), m_MidNodeSections, m_Sections, and TexGen::CSection::SetSectionMeshLayers().
|
inherited |
Definition at line 63 of file YarnSection.h.
Referenced by TexGen::CYarnSection::CYarnSection(), and TexGen::CYarnSection::PopulateTiXmlElement().
|
protectedinherited |
Definition at line 58 of file YarnSectionInterp.h.
Referenced by TexGen::CYarnSectionInterp::CYarnSectionInterp(), TexGen::CYarnSectionInterp::InterpolatePoints(), and TexGen::CYarnSectionInterp::PopulateTiXmlElement().
|
protectedinherited |
Definition at line 58 of file YarnSectionInterp.h.
Referenced by TexGen::CYarnSectionInterp::CYarnSectionInterp(), TexGen::CYarnSectionInterp::InterpolatePoints(), and TexGen::CYarnSectionInterp::PopulateTiXmlElement().
|
protected |
Definition at line 103 of file YarnSectionInterpNode.h.
Referenced by AddSection(), CYarnSectionInterpNode(), DeleteSection(), GetMidNodeSectionPos(), GetNumMidNodeSections(), GetSectionsToInterp(), InsertSection(), PopulateTiXmlElement(), ReplaceMidSection(), and SetSectionMeshLayersEqual().
|
protected |
Definition at line 102 of file YarnSectionInterpNode.h.
Referenced by AddSection(), CYarnSectionInterpNode(), DeleteSection(), GetMidNodeSectionPos(), GetNodeSection(), GetNumMidNodeSections(), GetSection(), GetSectionMesh(), GetSectionsToInterp(), InsertSection(), PopulateTiXmlElement(), ReplaceMidSection(), ReplaceSection(), and SetSectionMeshLayersEqual().