TexGen
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
TexGen::CYarnSectionInterpNode Class Reference

Creates a section which is linearly interpolated between sections defined at the nodes. More...

#include <YarnSectionInterpNode.h>

Inheritance diagram for TexGen::CYarnSectionInterpNode:
Inheritance graph
[legend]

Public Member Functions

 CYarnSectionInterpNode (bool bRamped=true, bool bPolar=false, bool bConstMesh=true)
 
 CYarnSectionInterpNode (TiXmlElement &Element)
 
 ~CYarnSectionInterpNode (void)
 
vector< XYGetSection (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...
 
CYarnSectionCopy () 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 CSectionGetNodeSection (int iIndex) const
 
int GetNumMidNodeSections (int iIndex) const
 
double GetMidNodeSectionPos (int iNodeIndex, int iIndex) const
 
bool GetRamped ()
 
bool GetPolar ()
 
bool GetForceMeshLayers () const
 
CYarnSectionConstantGetSectionConstant ()
 Get a pointer of that the inherited class. More...
 
CYarnSectionInterpNodeGetSectionInterpNode ()
 
CYarnSectionInterpPositionGetSectionInterpPosition ()
 

Static Public Member Functions

static CObjectContainer< CYarnSectionCreateYarnSection (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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CYarnSectionInterpNode() [1/2]

CYarnSectionInterpNode::CYarnSectionInterpNode ( bool  bRamped = true,
bool  bPolar = false,
bool  bConstMesh = true 
)
Parameters
bRamped,bPolarSpecify 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.
bConstMeshDefines 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() [2/2]

CYarnSectionInterpNode::CYarnSectionInterpNode ( TiXmlElement &  Element)

◆ ~CYarnSectionInterpNode()

CYarnSectionInterpNode::~CYarnSectionInterpNode ( void  )

Definition at line 31 of file YarnSectionInterpNode.cpp.

Member Function Documentation

◆ AddSection()

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().

◆ CalculateNumberofLayers()

int CYarnSectionInterp::CalculateNumberofLayers ( const vector< XY > &  Section) const
protectedinherited

◆ Copy()

CYarnSection * TexGen::CYarnSectionInterpNode::Copy ( ) const
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.

◆ CreateYarnSection()

CObjectContainer< CYarnSection > CYarnSection::CreateYarnSection ( TiXmlElement &  Element)
staticinherited

Create a yarn section from TiXmlElement.

Definition at line 49 of file YarnSection.cpp.

Referenced by TexGen::CYarn::CYarn(), and TexGen::CYarnSectionAdjusted::CYarnSectionAdjusted().

◆ DeleteSection()

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().

◆ GetForceMeshLayers()

bool TexGen::CYarnSection::GetForceMeshLayers ( ) const
inlineinherited

Definition at line 99 of file YarnSection.h.

◆ GetInterpedSection()

bool CYarnSectionInterp::GetInterpedSection ( const CSection Section1,
const CSection Section2,
double  u,
int  iNumPoints,
bool  bEquiSpaced,
vector< XY > &  Points 
) const
protectedinherited

◆ GetInterpedSectionMesh()

bool CYarnSectionInterp::GetInterpedSectionMesh ( const CSection Section1,
const CSection Section2,
double  u,
int  iNumPoints,
bool  bEquiSpaced,
CMesh Mesh 
) const
protectedinherited

◆ GetMidNodeSectionPos()

double CYarnSectionInterpNode::GetMidNodeSectionPos ( int  iNodeIndex,
int  iIndex 
) const

◆ GetNodeSection()

const CSection & CYarnSectionInterpNode::GetNodeSection ( int  iIndex) const

◆ GetNumMidNodeSections()

int CYarnSectionInterpNode::GetNumMidNodeSections ( int  iIndex) const

◆ GetNumNodeSections()

int TexGen::CYarnSectionInterpNode::GetNumNodeSections ( ) const
inline

◆ GetPolar()

bool TexGen::CYarnSectionInterp::GetPolar ( )
inlineinherited

Definition at line 48 of file YarnSectionInterp.h.

◆ GetRamped()

bool TexGen::CYarnSectionInterp::GetRamped ( )
inlineinherited

Definition at line 47 of file YarnSectionInterp.h.

◆ GetSection()

vector< XY > CYarnSectionInterpNode::GetSection ( const YARN_POSITION_INFORMATION  PositionInfo,
int  iNumPoints,
bool  bEquiSpaced = false 
) const
virtual

This function must be implemented by derived classes.

Parameters
PositionInfoStructure which contains information about the position along the yarn
iNumPointsNumber of points on the perimeter of the section to return
bEquiSpacedCreate 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().

◆ GetSectionConstant()

CYarnSectionConstant * CYarnSection::GetSectionConstant ( )
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.

◆ GetSectionInterpNode()

CYarnSectionInterpNode * CYarnSection::GetSectionInterpNode ( )
inherited

Definition at line 96 of file YarnSection.cpp.

◆ GetSectionInterpPosition()

CYarnSectionInterpPosition * CYarnSection::GetSectionInterpPosition ( )
inherited

Definition at line 100 of file YarnSection.cpp.

◆ GetSectionMesh()

CMesh CYarnSectionInterpNode::GetSectionMesh ( const YARN_POSITION_INFORMATION  PositionInfo,
int  iNumPoints,
bool  bEquiSpaced 
) const
virtual

This function must be implemented by derived classes.

Parameters
PositionInfoStructure which contains information about the position along the yarn
iNumPointsNumber of points on the perimeter of the section to return
bEquiSpacedCreate 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.

◆ GetSectionsToInterp()

void CYarnSectionInterpNode::GetSectionsToInterp ( const YARN_POSITION_INFORMATION  PositionInfo,
const CSection *&  pSection1,
const CSection *&  pSection2,
double &  u 
) const
protected

◆ GetType()

string TexGen::CYarnSectionInterpNode::GetType ( ) const
inlinevirtual

Derived class should return the class name.

Implements TexGen::CYarnSection.

Definition at line 51 of file YarnSectionInterpNode.h.

◆ InsertSection() [1/2]

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().

◆ InsertSection() [2/2]

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

Parameters
iIndexThe index of the segment between two nodes
uThe position between the two nodes where to add the section 0 < u < 1
SectionThe section to add at this point

Definition at line 150 of file YarnSectionInterpNode.cpp.

References m_MidNodeSections, and TGERROR.

◆ InterpolatePoints()

XY CYarnSectionInterp::InterpolatePoints ( XY  P1,
XY  P2,
double  u 
) const
protectedinherited

◆ PopulateTiXmlElement()

void CYarnSectionInterpNode::PopulateTiXmlElement ( TiXmlElement &  Element,
OUTPUT_TYPE  OutputType 
) const
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().

◆ ReplaceMidSection()

void CYarnSectionInterpNode::ReplaceMidSection ( int  iNodeIndex,
int  iIndex,
const CSection Section 
)

◆ ReplaceSection()

void CYarnSectionInterpNode::ReplaceSection ( int  iIndex,
const CSection Section 
)

◆ SetSectionMeshLayersEqual()

void CYarnSectionInterpNode::SetSectionMeshLayersEqual ( int  iNumPoints) const
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().

Member Data Documentation

◆ m_bForceEqualMeshLayers

bool TexGen::CYarnSection::m_bForceEqualMeshLayers
inherited

◆ m_bPolar

bool TexGen::CYarnSectionInterp::m_bPolar
protectedinherited

◆ m_bRamped

bool TexGen::CYarnSectionInterp::m_bRamped
protectedinherited

◆ m_MidNodeSections

vector<vector<pair<double, CObjectContainer<CSection> > > > TexGen::CYarnSectionInterpNode::m_MidNodeSections
protected

◆ m_Sections

vector<CObjectContainer<CSection> > TexGen::CYarnSectionInterpNode::m_Sections
protected

The documentation for this class was generated from the following files: