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

Rectangle section. More...

#include <SectionRectangle.h>

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

Public Member Functions

 CSectionRectangle (double dWidth, double dHeight)
 
 CSectionRectangle (TiXmlElement &Element)
 
 ~CSectionRectangle (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...
 
virtual const vector< XY > & GetPoints (int iNumPoints, bool bEquiSpaced=false) const
 Get a section with given number of points on the perimeter. 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...
 
double GetWidth () const
 
double GetHeight () const
 
void SetWidth (double dWidth)
 
void SetHeight (double dHeight)
 
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

double m_dWidth
 
double m_dHeight
 
double m_XSpacing
 
double m_YSpacing
 
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

Rectangle section.

Creates a rectangular section where points around perimeter are spaced as evenly as possible along sides within constraint of having a point at each corner.

Definition at line 33 of file SectionRectangle.h.

Constructor & Destructor Documentation

◆ CSectionRectangle() [1/2]

CSectionRectangle::CSectionRectangle ( double  dWidth,
double  dHeight 
)

Definition at line 24 of file SectionRectangle.cpp.

References TexGen::CSection::m_pSectionMesh.

◆ CSectionRectangle() [2/2]

CSectionRectangle::CSectionRectangle ( TiXmlElement &  Element)

Definition at line 43 of file SectionRectangle.cpp.

References m_dHeight, and m_dWidth.

◆ ~CSectionRectangle()

CSectionRectangle::~CSectionRectangle ( void  )

Definition at line 31 of file SectionRectangle.cpp.

Member Function Documentation

◆ AssignDefaults()

void CSection::AssignDefaults ( )
privateinherited

Definition at line 73 of file Section.cpp.

References TexGen::CSection::m_pSectionMesh.

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

◆ AssignSectionMesh()

void CSection::AssignSectionMesh ( const CSectionMesh SectionMesh)
inherited

◆ Copy()

CSection * TexGen::CSectionRectangle::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 SectionRectangle.h.

◆ 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 CSectionRectangle::GetDefaultName ( ) const
virtual

Get the default name to assign to a section.

Implements TexGen::CSection.

Definition at line 84 of file SectionRectangle.cpp.

References m_dHeight, m_dWidth, and TexGen::stringify().

◆ GetHeight()

double TexGen::CSectionRectangle::GetHeight ( ) const
inline

Definition at line 55 of file SectionRectangle.h.

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

◆ GetPoint()

XY CSectionRectangle::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 57 of file SectionRectangle.cpp.

References m_dHeight, and m_dWidth.

◆ GetPoints()

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

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

Reimplemented from TexGen::CSection.

Definition at line 89 of file SectionRectangle.cpp.

References m_dHeight, m_dWidth, TexGen::CSection::m_EdgePoints, TexGen::XY::x, and TexGen::XY::y.

◆ GetSectionMeshLayers()

int CSection::GetSectionMeshLayers ( )
inherited

◆ GetType()

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

Derived class should return the class name.

Implements TexGen::CSection.

Definition at line 48 of file SectionRectangle.h.

Referenced by operator==().

◆ GetWidth()

double TexGen::CSectionRectangle::GetWidth ( ) const
inline

Definition at line 54 of file SectionRectangle.h.

◆ operator==()

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

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

Implements TexGen::CSection.

Definition at line 35 of file SectionRectangle.cpp.

References GetType(), TexGen::CSection::GetType(), m_dHeight, and m_dWidth.

◆ PopulateTiXmlElement()

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

Used for saving data to XML.

Reimplemented from TexGen::CSection.

Definition at line 50 of file SectionRectangle.cpp.

References m_dHeight, m_dWidth, TexGen::CSection::PopulateTiXmlElement(), and TexGen::stringify().

◆ SetHeight()

void TexGen::CSectionRectangle::SetHeight ( double  dHeight)
inline

Definition at line 57 of file SectionRectangle.h.

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

◆ SetWidth()

void TexGen::CSectionRectangle::SetWidth ( double  dWidth)
inline

Definition at line 56 of file SectionRectangle.h.

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_dHeight

double TexGen::CSectionRectangle::m_dHeight
protected

◆ m_dWidth

double TexGen::CSectionRectangle::m_dWidth
protected

◆ m_EdgePoints

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

◆ m_pSectionMesh

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

◆ m_XSpacing

double TexGen::CSectionRectangle::m_XSpacing
protected

Definition at line 61 of file SectionRectangle.h.

◆ m_YSpacing

double TexGen::CSectionRectangle::m_YSpacing
protected

Definition at line 61 of file SectionRectangle.h.


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