TexGen
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
TexGen::CYarnSection Class Referenceabstract

Abstract base class used to define the sections along the length of a yarn. More...

#include <YarnSection.h>

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

Public Member Functions

 CYarnSection (bool bConstMesh=true)
 
 CYarnSection (TiXmlElement &Element)
 
virtual ~CYarnSection (void)
 
virtual CYarnSectionCopy () 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 void PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType) const
 Used for saving data to XML. More...
 
virtual vector< XYGetSection (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
 
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
 

Detailed Description

Abstract base class used to define the sections along the length of a yarn.

The section may vary in different ways, it is an abstract base class which can be derived from to implement specific types of section variations. Derived classes must implement GetSection function and provide a list of points in 2D that represent the section at a given point along the fibre. The position along the fibre is given by the YARN_POSITION_INFORMATION structure

Definition at line 57 of file YarnSection.h.

Constructor & Destructor Documentation

◆ CYarnSection() [1/2]

CYarnSection::CYarnSection ( bool  bConstMesh = true)

Definition at line 29 of file YarnSection.cpp.

◆ CYarnSection() [2/2]

CYarnSection::CYarnSection ( TiXmlElement &  Element)

Definition at line 38 of file YarnSection.cpp.

References m_bForceEqualMeshLayers, and NULL.

◆ ~CYarnSection()

CYarnSection::~CYarnSection ( void  )
virtual

Definition at line 34 of file YarnSection.cpp.

Member Function Documentation

◆ Copy()

virtual CYarnSection * TexGen::CYarnSection::Copy ( ) const
pure virtual

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

◆ CreateYarnSection()

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

Create a yarn section from TiXmlElement.

Definition at line 49 of file YarnSection.cpp.

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

◆ GetForceMeshLayers()

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

Definition at line 99 of file YarnSection.h.

◆ GetSection()

virtual vector< XY > TexGen::CYarnSection::GetSection ( const YARN_POSITION_INFORMATION  PositionInfo,
int  iNumPoints,
bool  bEquiSpaced = false 
) const
pure 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

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

◆ GetSectionConstant()

CYarnSectionConstant * CYarnSection::GetSectionConstant ( )

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

Definition at line 96 of file YarnSection.cpp.

◆ GetSectionInterpPosition()

CYarnSectionInterpPosition * CYarnSection::GetSectionInterpPosition ( )

Definition at line 100 of file YarnSection.cpp.

◆ GetSectionMesh()

virtual CMesh TexGen::CYarnSection::GetSectionMesh ( const YARN_POSITION_INFORMATION  PositionInfo,
int  iNumPoints,
bool  bEquiSpaced 
) const
pure 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

Implemented in TexGen::CYarnSectionAdjusted, TexGen::CYarnSectionConstant, TexGen::CYarnSectionInterpNode, and TexGen::CYarnSectionInterpPosition.

◆ GetType()

virtual string TexGen::CYarnSection::GetType ( ) const
pure virtual

◆ PopulateTiXmlElement()

void CYarnSection::PopulateTiXmlElement ( TiXmlElement &  Element,
OUTPUT_TYPE  OutputType 
) const
virtual

◆ SetSectionMeshLayersEqual()

virtual void TexGen::CYarnSection::SetSectionMeshLayersEqual ( int  iNumPoints) const
inlinevirtual

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.

Member Data Documentation

◆ m_bForceEqualMeshLayers

bool TexGen::CYarnSection::m_bForceEqualMeshLayers

Definition at line 63 of file YarnSection.h.

Referenced by CYarnSection(), and PopulateTiXmlElement().


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