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

Hybrid of any number of other sections. More...

#include <SectionHybrid.h>

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

Public Member Functions

 CSectionHybrid (void)
 Empty hybrid section, parts can be added with the AddDivision and AssignSection functions. More...
 
 CSectionHybrid (const CSection &TopHalf, const CSection &BottomHalf)
 Hybrid of two sections split into the upper and lower half. More...
 
 CSectionHybrid (const CSection &TopRight, const CSection &TopLeft, const CSection &BottomLeft, const CSection &BottomRight)
 Hybrid of four sections split into four quadrants. More...
 
 CSectionHybrid (TiXmlElement &Element)
 
 ~CSectionHybrid (void)
 
bool operator== (const CSection &CompareMe) const
 Overloaded equality operator to determine if two sections are the same. More...
 
CSectionCopy () const
 Create a copy of the derived section and return a pointer to the newly created instance. More...
 
void PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType) const
 Used for saving data to XML. More...
 
string GetType () const
 Derived class should return the class name. More...
 
string GetDefaultName () const
 Get the default name to assign to a section. More...
 
void AddDivision (double dFraction)
 Add a division where the sections will transfer from one to the other. More...
 
bool AssignSection (int iIndex, const CSection &Section)
 Assign a section between divisions. More...
 
int GetNumDivisions () const
 
int GetNumSections ()
 
double GetDivision (int iIndex) const
 
const CSectionGetSection (int iIndex) const
 
XY GetPoint (double t) const
 Get a point lying on the perimeter correspending to parametric value t. 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 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...
 

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< double > m_Divisions
 
vector< CObjectContainer< CSection > > m_Sections
 
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 ()
 

Detailed Description

Hybrid of any number of other sections.

Definition at line 28 of file SectionHybrid.h.

Constructor & Destructor Documentation

◆ CSectionHybrid() [1/4]

CSectionHybrid::CSectionHybrid ( void  )

Empty hybrid section, parts can be added with the AddDivision and AssignSection functions.

Definition at line 26 of file SectionHybrid.cpp.

References m_Sections.

◆ CSectionHybrid() [2/4]

CSectionHybrid::CSectionHybrid ( const CSection TopHalf,
const CSection BottomHalf 
)

Hybrid of two sections split into the upper and lower half.

Definition at line 32 of file SectionHybrid.cpp.

References AddDivision(), and AssignSection().

◆ CSectionHybrid() [3/4]

CSectionHybrid::CSectionHybrid ( const CSection TopRight,
const CSection TopLeft,
const CSection BottomLeft,
const CSection BottomRight 
)

Hybrid of four sections split into four quadrants.

Definition at line 40 of file SectionHybrid.cpp.

References AddDivision(), and AssignSection().

◆ CSectionHybrid() [4/4]

CSectionHybrid::CSectionHybrid ( TiXmlElement &  Element)

◆ ~CSectionHybrid()

CSectionHybrid::~CSectionHybrid ( void  )

Definition at line 52 of file SectionHybrid.cpp.

Member Function Documentation

◆ AddDivision()

void CSectionHybrid::AddDivision ( double  dFraction)

Add a division where the sections will transfer from one to the other.

Definition at line 98 of file SectionHybrid.cpp.

References m_Divisions, and m_Sections.

Referenced by CSectionHybrid().

◆ AssignDefaults()

void CSection::AssignDefaults ( )
privateinherited

Definition at line 73 of file Section.cpp.

References TexGen::CSection::m_pSectionMesh.

Referenced by TexGen::CSection::CSection().

◆ AssignSection()

bool CSectionHybrid::AssignSection ( int  iIndex,
const CSection Section 
)

Assign a section between divisions.

Definition at line 105 of file SectionHybrid.cpp.

References m_Sections, and TGERROR.

Referenced by CSectionHybrid().

◆ AssignSectionMesh()

void CSection::AssignSectionMesh ( const CSectionMesh SectionMesh)
inherited

◆ Copy()

CSection * TexGen::CSectionHybrid::Copy ( ) const
inlinevirtual

Create a copy of the derived section and return a pointer to the newly created instance.

Implements TexGen::CSection.

Definition at line 41 of file SectionHybrid.h.

Referenced by GetPoint().

◆ CreateEquiSpacedSection()

bool CSection::CreateEquiSpacedSection ( int  iNumPoints) const
protectedinherited

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 TexGen::CSection::GetDefaultName(), TexGen::GetLength(), TexGen::CSection::GetPoint(), TexGen::CSection::m_bEquiSpaced, TexGen::CSection::m_EdgePoints, TexGen::stringify(), and TGERROR.

Referenced by TexGen::CSection::GetPoints().

◆ CreateSection() [1/2]

void CSection::CreateSection ( int  iNumPoints) const
protectedinherited

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 TexGen::CSection::GetPoint(), TexGen::CSection::m_bEquiSpaced, and TexGen::CSection::m_EdgePoints.

◆ CreateSection() [2/2]

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

◆ GetArea()

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

◆ GetBaseType()

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

Reimplemented in TexGen::CSectionRotated.

Definition at line 85 of file Section.h.

◆ GetCircumference()

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

Get the circumference of a section.

Definition at line 273 of file Section.cpp.

References TexGen::GetLength().

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

◆ GetDefaultName()

string CSectionHybrid::GetDefaultName ( ) const
virtual

Get the default name to assign to a section.

Implements TexGen::CSection.

Definition at line 146 of file SectionHybrid.cpp.

References m_Sections, and TexGen::stringify().

◆ GetDivision()

double CSectionHybrid::GetDivision ( int  iIndex) const

Definition at line 151 of file SectionHybrid.cpp.

References m_Divisions.

◆ GetMesh()

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

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 TexGen::CSection::GetDefaultName(), TexGen::CSection::GetPoints(), TexGen::CSection::m_pSectionMesh, and TGERROR.

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

◆ GetNumDivisions()

int TexGen::CSectionHybrid::GetNumDivisions ( ) const
inline

Definition at line 54 of file SectionHybrid.h.

◆ GetNumSections()

int TexGen::CSectionHybrid::GetNumSections ( )
inline

Definition at line 55 of file SectionHybrid.h.

◆ GetPoint()

XY CSectionHybrid::GetPoint ( double  t) const
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.

Implements TexGen::CSection.

Definition at line 116 of file SectionHybrid.cpp.

References Copy(), TexGen::CSectionRotated::GetAngle(), GetType(), m_Divisions, m_Sections, and PI.

Referenced by TexGen::CTextileOrthogonal::GetHybridHeight(), and TexGen::CTextileOrthogonal::GetHybridWidth().

◆ GetPoints()

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

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 TexGen::CSection::CreateEquiSpacedSection(), TexGen::CSection::CreateSection(), TexGen::CSection::m_bEquiSpaced, and TexGen::CSection::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(), TexGen::CSection::GetMesh(), and TexGen::CTextile3DWeave::ReducePowerEllipseHeight().

◆ GetSection()

const CSection & CSectionHybrid::GetSection ( int  iIndex) const

Definition at line 157 of file SectionHybrid.cpp.

References m_Sections.

◆ GetSectionMeshLayers()

int CSection::GetSectionMeshLayers ( )
inherited

◆ GetType()

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

Derived class should return the class name.

Implements TexGen::CSection.

Definition at line 45 of file SectionHybrid.h.

Referenced by GetPoint(), and operator==().

◆ operator==()

bool CSectionHybrid::operator== ( const CSection CompareMe) const
virtual

Overloaded equality operator to determine if two sections are the same.

Implements TexGen::CSection.

Definition at line 56 of file SectionHybrid.cpp.

References GetType(), TexGen::CSection::GetType(), m_Divisions, and m_Sections.

◆ PopulateTiXmlElement()

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

Used for saving data to XML.

Reimplemented from TexGen::CSection.

Definition at line 80 of file SectionHybrid.cpp.

References m_Divisions, m_Sections, TexGen::CSection::PopulateTiXmlElement(), and TexGen::stringify().

◆ SetSectionMeshLayers()

void CSection::SetSectionMeshLayers ( int  iNum)
inherited

Specify number of layers for associated section mesh.

Definition at line 232 of file Section.cpp.

References TexGen::CSection::m_pSectionMesh.

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

Member Data Documentation

◆ m_bEquiSpaced

bool TexGen::CSection::m_bEquiSpaced
mutableprotectedinherited

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 TexGen::CSection::CreateEquiSpacedSection(), TexGen::CSectionPolygon::CreateSection(), TexGen::CSection::CreateSection(), TexGen::CSection::CSection(), TexGen::CSection::GetPoints(), and TexGen::CSection::PopulateTiXmlElement().

◆ m_Divisions

vector<double> TexGen::CSectionHybrid::m_Divisions
protected

Definition at line 61 of file SectionHybrid.h.

Referenced by AddDivision(), GetDivision(), GetPoint(), operator==(), and PopulateTiXmlElement().

◆ m_EdgePoints

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

◆ m_pSectionMesh

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

◆ m_Sections

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

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