TexGen
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
TexGen::CSection Class Referenceabstract

Abstract base class respresenting a yarn cross-section. More...

#include <Section.h>

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

Public Member Functions

 CSection ()
 
 CSection (TiXmlElement &Element)
 
virtual ~CSection (void)
 
virtual bool operator== (const CSection &CompareMe) const =0
 Overloaded equality operator to determine if two sections are the same. More...
 
virtual CSectionCopy () const =0
 Create a copy of the derived section and return a pointer to the newly created instance. More...
 
virtual void PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType) const
 Used for saving data to XML. More...
 
virtual const vector< XY > & GetPoints (int iNumPoints, bool bEquiSpaced=false) const
 Get a section with given number of points on the perimeter. More...
 
const CMeshGetMesh (int iNumPoints, bool bEquiSpaced=true) const
 
void AssignSectionMesh (const CSectionMesh &SectionMesh)
 Assign a mesh to the section. More...
 
virtual string GetDefaultName () const =0
 Get the default name to assign to a section. More...
 
virtual string GetType () const =0
 Derived class should return the class name. More...
 
virtual string GetBaseType () const
 
void SetSectionMeshLayers (int iNum)
 Specify number of layers for associated section mesh. More...
 
int GetSectionMeshLayers ()
 Get the number of layers for associated section mesh. More...
 
virtual XY GetPoint (double t) const =0
 Get a point lying on the perimeter correspending to parametric value t. More...
 

Static Public Member Functions

static CObjectContainer< CSectionCreateSection (TiXmlElement &Element)
 Create a section from TiXmlElement. More...
 
static double GetArea (const vector< XY > &Section)
 Get the area of a section. More...
 
static double GetCircumference (const vector< XY > &Section)
 Get the circumference of a section. More...
 

Protected Member Functions

void CreateSection (int iNumPoints) const
 Create a section with given number of points on the perimeter. More...
 
bool CreateEquiSpacedSection (int iNumPoints) const
 Same as CreateSection except all the points will be spaced the same distance apart. More...
 

Protected Attributes

vector< XYm_EdgePoints
 List of 2d points creating the outline of the cross-section. More...
 
bool m_bEquiSpaced
 Keep this variable to determine whether the section was created with equidistant points or not. More...
 
CObjectContainer< CSectionMeshm_pSectionMesh
 Pointer to a derived class of SectionMesh, this class is in charge of creating the section mesh. More...
 

Private Member Functions

void AssignDefaults ()
 

Friends

class CSectionHybrid
 
class CSectionRotated
 
class CSectionScaled
 

Detailed Description

Abstract base class respresenting a yarn cross-section.

Definition at line 30 of file Section.h.

Constructor & Destructor Documentation

◆ CSection() [1/2]

CSection::CSection ( )

Definition at line 26 of file Section.cpp.

References AssignDefaults().

◆ CSection() [2/2]

CSection::CSection ( TiXmlElement &  Element)

◆ ~CSection()

CSection::~CSection ( void  )
virtual

Definition at line 32 of file Section.cpp.

Member Function Documentation

◆ AssignDefaults()

void CSection::AssignDefaults ( )
private

Definition at line 73 of file Section.cpp.

References m_pSectionMesh.

Referenced by CSection().

◆ AssignSectionMesh()

void CSection::AssignSectionMesh ( const CSectionMesh SectionMesh)

◆ Copy()

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

◆ CreateEquiSpacedSection()

bool CSection::CreateEquiSpacedSection ( int  iNumPoints) const
protected

Same as CreateSection except all the points will be spaced the same distance apart.

This should work fine as long as the first derivative of the parametric equation with respect to t is continuous and the number of points making up the section is not too small

Definition at line 143 of file Section.cpp.

References GetDefaultName(), TexGen::GetLength(), GetPoint(), m_bEquiSpaced, m_EdgePoints, TexGen::stringify(), and TGERROR.

Referenced by GetPoints().

◆ CreateSection() [1/2]

void CSection::CreateSection ( int  iNumPoints) const
protected

Create a section with given number of points on the perimeter.

m_EdgePoints will be populated with given number of points

Parameters
iNumPointsNumber of points the section is made up of

Definition at line 129 of file Section.cpp.

References GetPoint(), m_bEquiSpaced, and m_EdgePoints.

◆ CreateSection() [2/2]

CObjectContainer< CSection > CSection::CreateSection ( TiXmlElement &  Element)
static

◆ GetArea()

double CSection::GetArea ( const vector< XY > &  Section)
static

◆ GetBaseType()

virtual string TexGen::CSection::GetBaseType ( ) const
inlinevirtual

Reimplemented in TexGen::CSectionRotated.

Definition at line 85 of file Section.h.

◆ GetCircumference()

double CSection::GetCircumference ( const vector< XY > &  Section)
static

Get the circumference of a section.

Definition at line 273 of file Section.cpp.

References TexGen::GetLength().

Referenced by TexGen::CYarn::SetResolution().

◆ GetDefaultName()

virtual string TexGen::CSection::GetDefaultName ( ) const
pure virtual

◆ GetMesh()

const CMesh & CSection::GetMesh ( int  iNumPoints,
bool  bEquiSpaced = true 
) const

Get a mesh with given number of points on the perimeter, a mesh must be assigned to the section before this function is called.

Definition at line 107 of file Section.cpp.

References GetDefaultName(), GetPoints(), m_pSectionMesh, and TGERROR.

Referenced by TexGen::CYarnSectionInterp::GetInterpedSectionMesh().

◆ GetPoint()

virtual XY TexGen::CSection::GetPoint ( double  t) const
pure virtual

Get a point lying on the perimeter correspending to parametric value t.

Each section should be defined as a parametric function where t varies from 0 to 1 the function should start from the positive x axis at t=0 and go counter-clockwise through 360 degrees returning to its original position at t=1. In order for the CreateEquiSpacedSection function to work correctly, the parametric equation's first derivative with respect to t should be continuous.

Implemented in TexGen::CSectionBezier, TexGen::CSectionEllipse, TexGen::CSectionHybrid, TexGen::CSectionLenticular, TexGen::CSectionPolygon, TexGen::CSectionPowerEllipse, TexGen::CSectionRectangle, TexGen::CSectionRotated, and TexGen::CSectionScaled.

Referenced by TexGen::CTextileOrthogonal::AddWeftNodes(), TexGen::CTextile3DWeave::AddWeftNodes(), CreateEquiSpacedSection(), and CreateSection().

◆ GetPoints()

const vector< XY > & CSection::GetPoints ( int  iNumPoints,
bool  bEquiSpaced = false 
) const
virtual

Get a section with given number of points on the perimeter.

The section is created and saved to m_EdgePoints which is then returned. If this function is called multiple times with the same parameter the section need not be recreated. Note that the returned vector is only valid until the next call to this function, a copy of the vector should be made if it needs to be kept for any period of time.

Parameters
iNumPointsNumber of points the section is made up of
bEquiSpacedIf set to true, the code will attempt to space the nodes at equal distances apart

Reimplemented in TexGen::CSectionRectangle.

Definition at line 119 of file Section.cpp.

References CreateEquiSpacedSection(), CreateSection(), m_bEquiSpaced, and m_EdgePoints.

Referenced by TexGen::CTextileOrthogonal::AdjustBinderYarnSection(), TexGen::CTextileOrthogonal::AdjustMidLayerHeights(), TexGen::CTextileOrthogonal::AdjustOuterWeftYarns(), TexGen::CTextile3DWeave::AdjustPowerEllipsePower(), TexGen::CTextile3DWeave::AdjustPowerEllipseSectionWidth(), TexGen::CShearedTextileWeave2D::AdjustSections(), TexGen::CTextileOrthogonal::AdjustWeftHeight(), TexGen::CTextileOrthogonal::AdjustWeftToFitBinderHeight(), TexGen::CTextileOrthogonal::ChangePowerEllipseSection(), TexGen::CTextileOrthogonal::CheckBinderWidths(), TexGen::CTextile3DWeave::FindPowerEllipseSectionHeight(), TexGen::CShearedTextileWeave2D::GetArea(), TexGen::CYarnSectionInterp::GetInterpedSection(), GetMesh(), and TexGen::CTextile3DWeave::ReducePowerEllipseHeight().

◆ GetSectionMeshLayers()

int CSection::GetSectionMeshLayers ( )

◆ GetType()

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

◆ operator==()

virtual bool TexGen::CSection::operator== ( const CSection CompareMe) const
pure virtual

◆ PopulateTiXmlElement()

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

◆ SetSectionMeshLayers()

void CSection::SetSectionMeshLayers ( int  iNum)

Specify number of layers for associated section mesh.

Definition at line 232 of file Section.cpp.

References m_pSectionMesh.

Referenced by TexGen::CYarnSectionInterpNode::SetSectionMeshLayersEqual(), and TexGen::CYarnSectionInterpPosition::SetSectionMeshLayersEqual().

Friends And Related Function Documentation

◆ CSectionHybrid

friend class CSectionHybrid ( void  )
friend

Definition at line 32 of file Section.h.

Referenced by CreateSection().

◆ CSectionRotated

friend class CSectionRotated
friend

Definition at line 33 of file Section.h.

Referenced by CreateSection().

◆ CSectionScaled

friend class CSectionScaled
friend

Definition at line 34 of file Section.h.

Referenced by CreateSection().

Member Data Documentation

◆ m_bEquiSpaced

bool TexGen::CSection::m_bEquiSpaced
mutableprotected

Keep this variable to determine whether the section was created with equidistant points or not.

Definition at line 122 of file Section.h.

Referenced by CreateEquiSpacedSection(), TexGen::CSectionPolygon::CreateSection(), CreateSection(), CSection(), GetPoints(), and PopulateTiXmlElement().

◆ m_EdgePoints

vector<XY> TexGen::CSection::m_EdgePoints
mutableprotected

List of 2d points creating the outline of the cross-section.

Definition at line 119 of file Section.h.

Referenced by CreateEquiSpacedSection(), TexGen::CSectionPolygon::CreateSection(), CreateSection(), CSection(), GetPoints(), TexGen::CSectionRectangle::GetPoints(), and PopulateTiXmlElement().

◆ m_pSectionMesh

CObjectContainer<CSectionMesh> TexGen::CSection::m_pSectionMesh
protected

Pointer to a derived class of SectionMesh, this class is in charge of creating the section mesh.

Definition at line 125 of file Section.h.

Referenced by AssignDefaults(), AssignSectionMesh(), CSection(), TexGen::CSectionRectangle::CSectionRectangle(), TexGen::CSectionRotated::CSectionRotated(), GetMesh(), GetSectionMeshLayers(), PopulateTiXmlElement(), and SetSectionMeshLayers().


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