TexGen
|
Creates a polygonal section, where a list of points are given to form the closed polygon. More...
#include <SectionPolygon.h>
Public Member Functions | |
CSectionPolygon (const vector< XY > &PolygonPoints, bool bSingleQuadrant=false, bool bRetainPoints=false) | |
CSectionPolygon (TiXmlElement &Element) | |
~CSectionPolygon (void) | |
bool | operator== (const CSection &CompareMe) const |
Overloaded equality operator to determine if two sections are the same. More... | |
CSection * | Copy () 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... | |
XY | GetPoint (double t) const |
Get a point lying on the perimeter correspending to parametric value t. More... | |
void | Scale (XY Scale) |
Change the scale of the section by multiplying each coordinate component by the component given by this XY struct. More... | |
void | Scale (double dScale) |
Change the scale of the section by multiplying each coordinate value by a scalar. 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 CMesh & | GetMesh (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< CSection > | CreateSection (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 | CalcTValues () |
Assign t value as proportion of distance around perimeter for each point. More... | |
void | CreateSection () const |
Create section with edge points same as polygon points. More... | |
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< XY > | m_PolygonPoints |
vector< double > | m_t |
The proportion of the distance around the total perimeter range from 0 to 1 for each point. More... | |
bool | m_bRetainPoints |
Whether or not to use the polygon points to define the section edge points. More... | |
vector< XY > | m_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< CSectionMesh > | m_pSectionMesh |
Pointer to a derived class of SectionMesh, this class is in charge of creating the section mesh. More... | |
Private Member Functions | |
void | AssignDefaults () |
Creates a polygonal section, where a list of points are given to form the closed polygon.
Points are in local XY coordinates relative to the yarn centreline.
Points start at (maxX, 0) and are ordered in an anticlockwise direction \Param PolygonPoints Vector of XY points \Param bSingleQuadrant true if only giving points for one quadrant which are automatically replicated to complete section \Param bRetainPoints true if want to force edge points of section to match points exactly, otherwise creates specified number of points around section
Definition at line 35 of file SectionPolygon.h.
CSectionPolygon::CSectionPolygon | ( | const vector< XY > & | PolygonPoints, |
bool | bSingleQuadrant = false , |
||
bool | bRetainPoints = false |
||
) |
Definition at line 24 of file SectionPolygon.cpp.
References CalcTValues(), CreateSection(), m_PolygonPoints, TexGen::XY::x, and TexGen::XY::y.
CSectionPolygon::CSectionPolygon | ( | TiXmlElement & | Element | ) |
Definition at line 73 of file SectionPolygon.cpp.
References CalcTValues(), CreateSection(), FOR_EACH_TIXMLELEMENT, m_bRetainPoints, and m_PolygonPoints.
CSectionPolygon::~CSectionPolygon | ( | void | ) |
Definition at line 62 of file SectionPolygon.cpp.
|
privateinherited |
Definition at line 73 of file Section.cpp.
References TexGen::CSection::m_pSectionMesh.
Referenced by TexGen::CSection::CSection().
|
inherited |
Assign a mesh to the section.
Definition at line 227 of file Section.cpp.
References TexGen::CSection::m_pSectionMesh.
Referenced by TexGen::CTextileOrthogonal::AdjustMidLayerHeights(), TexGen::CTextileLayerToLayer::BuildLayerToLayerTextile(), TexGen::CShearedTextileWeave2D::BuildTextile(), TexGen::CTextile3DWeave::BuildTextile(), TexGen::CTextileAngleInterlock::BuildTextile(), TexGen::CTextileOffsetAngleInterlock::BuildTextile(), TexGen::CTextileOrthogonal::BuildTextile(), TexGen::CTextileWeave::BuildTextile(), TexGen::CTextileOrthogonal::BuildWeavePatternTextile(), TexGen::CTextileOrthogonal::CorrectCrimpInterference(), TexGen::CTextileWeave::CorrectInterference(), TexGen::CTextileWeave::CorrectYarnWidths(), TexGen::CShearedTextileWeave2D::ModifySection(), and TexGen::CShearedTextileWeave2D::ReplaceSection().
|
protected |
Assign t value as proportion of distance around perimeter for each point.
Definition at line 155 of file SectionPolygon.cpp.
References TexGen::GetLength(), m_PolygonPoints, and m_t.
Referenced by CSectionPolygon().
|
inlinevirtual |
Create a copy of the derived section and return a pointer to the newly created instance.
Implements TexGen::CSection.
Definition at line 43 of file SectionPolygon.h.
|
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().
|
protected |
Create section with edge points same as polygon points.
Definition at line 181 of file SectionPolygon.cpp.
References TexGen::CSection::m_bEquiSpaced, TexGen::CSection::m_EdgePoints, and m_PolygonPoints.
Referenced by CSectionPolygon().
|
protectedinherited |
Create a section with given number of points on the perimeter.
m_EdgePoints will be populated with given number of points
iNumPoints | Number 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.
|
staticinherited |
Create a section from TiXmlElement.
Definition at line 78 of file Section.cpp.
References TexGen::CSection::CSectionHybrid, TexGen::CSection::CSectionRotated, and TexGen::CSection::CSectionScaled.
Referenced by TexGen::CSectionHybrid::CSectionHybrid(), TexGen::CSectionRotated::CSectionRotated(), TexGen::CSectionScaled::CSectionScaled(), TexGen::CYarnSectionConstant::CYarnSectionConstant(), TexGen::CYarnSectionInterpNode::CYarnSectionInterpNode(), TexGen::CYarnSectionInterpPosition::CYarnSectionInterpPosition(), and TexGen::CSection::GetPoints().
|
staticinherited |
Get the area of a section.
Definition at line 261 of file Section.cpp.
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::CSectionMeshTriangulate::CreateMesh(), TexGen::CTextile3DWeave::FindPowerEllipseSectionHeight(), TexGen::CShearedTextileWeave2D::GetArea(), TexGen::CSectionMeshTriangulate::GetTriangleMesh(), TexGen::CFibreDistributionConst::IntegrateDistribution(), and TexGen::CTextile3DWeave::ReducePowerEllipseHeight().
|
inlinevirtualinherited |
Reimplemented in TexGen::CSectionRotated.
|
staticinherited |
Get the circumference of a section.
Definition at line 273 of file Section.cpp.
References TexGen::GetLength().
Referenced by TexGen::CYarn::SetResolution().
|
virtual |
Get the default name to assign to a section.
Implements TexGen::CSection.
Definition at line 131 of file SectionPolygon.cpp.
References m_PolygonPoints, and TexGen::stringify().
|
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().
|
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 110 of file SectionPolygon.cpp.
References m_PolygonPoints, and m_t.
|
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.
iNumPoints | Number of points the section is made up of |
bEquiSpaced | If 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().
|
inherited |
Get the number of layers for associated section mesh.
Definition at line 239 of file Section.cpp.
References TexGen::CSectionMeshRectangleSection::GetNumLayers(), TexGen::CSectionMeshRectangular::GetNumLayers(), and TexGen::CSection::m_pSectionMesh.
Referenced by TexGen::CYarnSectionInterpNode::SetSectionMeshLayersEqual().
|
inlinevirtual |
Derived class should return the class name.
Implements TexGen::CSection.
Definition at line 47 of file SectionPolygon.h.
Referenced by operator==().
|
virtual |
Overloaded equality operator to determine if two sections are the same.
Implements TexGen::CSection.
Definition at line 66 of file SectionPolygon.cpp.
References GetType(), TexGen::CSection::GetType(), and m_PolygonPoints.
|
virtual |
Used for saving data to XML.
Reimplemented from TexGen::CSection.
Definition at line 86 of file SectionPolygon.cpp.
References m_bRetainPoints, m_PolygonPoints, TexGen::CSection::PopulateTiXmlElement(), and TexGen::stringify().
void CSectionPolygon::Scale | ( | double | dScale | ) |
Change the scale of the section by multiplying each coordinate value by a scalar.
Definition at line 146 of file SectionPolygon.cpp.
References m_PolygonPoints.
void CSectionPolygon::Scale | ( | XY | Scale | ) |
Change the scale of the section by multiplying each coordinate component by the component given by this XY struct.
Definition at line 136 of file SectionPolygon.cpp.
References m_PolygonPoints, and Scale().
Referenced by Scale().
|
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().
|
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(), CreateSection(), TexGen::CSection::CreateSection(), TexGen::CSection::CSection(), TexGen::CSection::GetPoints(), and TexGen::CSection::PopulateTiXmlElement().
|
protected |
Whether or not to use the polygon points to define the section edge points.
Definition at line 70 of file SectionPolygon.h.
Referenced by CSectionPolygon(), and PopulateTiXmlElement().
|
mutableprotectedinherited |
List of 2d points creating the outline of the cross-section.
Definition at line 119 of file Section.h.
Referenced by TexGen::CSection::CreateEquiSpacedSection(), CreateSection(), TexGen::CSection::CreateSection(), TexGen::CSection::CSection(), TexGen::CSection::GetPoints(), TexGen::CSectionRectangle::GetPoints(), and TexGen::CSection::PopulateTiXmlElement().
|
protected |
Definition at line 65 of file SectionPolygon.h.
Referenced by CalcTValues(), CreateSection(), CSectionPolygon(), GetDefaultName(), GetPoint(), operator==(), PopulateTiXmlElement(), and Scale().
|
protectedinherited |
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 TexGen::CSection::AssignDefaults(), TexGen::CSection::AssignSectionMesh(), TexGen::CSection::CSection(), TexGen::CSectionRectangle::CSectionRectangle(), TexGen::CSectionRotated::CSectionRotated(), TexGen::CSection::GetMesh(), TexGen::CSection::GetSectionMeshLayers(), TexGen::CSection::PopulateTiXmlElement(), and TexGen::CSection::SetSectionMeshLayers().
|
protected |
The proportion of the distance around the total perimeter range from 0 to 1 for each point.
Definition at line 67 of file SectionPolygon.h.
Referenced by CalcTValues(), and GetPoint().