TexGen
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Attributes | List of all members
TexGen::CYarnSectionAdjusted Class Reference

Bezier interpolation for yarn paths. More...

#include <YarnSectionAdjusted.h>

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

Public Member Functions

 CYarnSectionAdjusted (const CYarnSection &YarnSection)
 
 CYarnSectionAdjusted (TiXmlElement &Element)
 
 ~CYarnSectionAdjusted (void)
 
CYarnSectionCopy () const
 This is a function to allow copying of derived classes correctly. More...
 
string GetType () const
 Derived class should return the class name. More...
 
void PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType) const
 Used for saving data to XML. More...
 
vector< XYGetSection (const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced=false) const
 This function must be implemented by derived classes. More...
 
CMesh GetSectionMesh (const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced) const
 This function must be implemented by derived classes. More...
 
void AddAdjustment (int iIndex, double t, const vector< pair< double, XY > > &SectionAdjust)
 At given index and value t the position of the node should be adjusted by given vector. 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
 

Protected Types

typedef vector< pair< double, XY > > SECTION_ADJUST
 
typedef vector< vector< pair< double, SECTION_ADJUST > > > YARN_ADJUST
 

Protected Attributes

YARN_ADJUST m_Adjustments
 Represents the adjustements to the interpolation. More...
 
CObjectContainer< CYarnSectionm_pYarnSection
 

Detailed Description

Bezier interpolation for yarn paths.

Definition at line 28 of file YarnSectionAdjusted.h.

Member Typedef Documentation

◆ SECTION_ADJUST

typedef vector<pair<double, XY> > TexGen::CYarnSectionAdjusted::SECTION_ADJUST
protected

Definition at line 46 of file YarnSectionAdjusted.h.

◆ YARN_ADJUST

typedef vector<vector<pair<double, SECTION_ADJUST> > > TexGen::CYarnSectionAdjusted::YARN_ADJUST
protected

Definition at line 47 of file YarnSectionAdjusted.h.

Constructor & Destructor Documentation

◆ CYarnSectionAdjusted() [1/2]

CYarnSectionAdjusted::CYarnSectionAdjusted ( const CYarnSection YarnSection)

Definition at line 25 of file YarnSectionAdjusted.cpp.

◆ CYarnSectionAdjusted() [2/2]

CYarnSectionAdjusted::CYarnSectionAdjusted ( TiXmlElement &  Element)

◆ ~CYarnSectionAdjusted()

CYarnSectionAdjusted::~CYarnSectionAdjusted ( void  )

Definition at line 30 of file YarnSectionAdjusted.cpp.

Member Function Documentation

◆ AddAdjustment()

void CYarnSectionAdjusted::AddAdjustment ( int  iIndex,
double  t,
const vector< pair< double, XY > > &  SectionAdjust 
)

At given index and value t the position of the node should be adjusted by given vector.

Definition at line 122 of file YarnSectionAdjusted.cpp.

References m_Adjustments, and TGERROR.

Referenced by TexGen::CTextileDeformer::DeformTextile().

◆ Copy()

CYarnSection * TexGen::CYarnSectionAdjusted::Copy ( ) const
inlinevirtual

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

Implements TexGen::CYarnSection.

Definition at line 35 of file YarnSectionAdjusted.h.

◆ CreateYarnSection()

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

Create a yarn section from TiXmlElement.

Definition at line 49 of file YarnSection.cpp.

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

◆ GetForceMeshLayers()

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

Definition at line 99 of file YarnSection.h.

◆ GetSection()

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

Implements TexGen::CYarnSection.

Definition at line 88 of file YarnSectionAdjusted.cpp.

References TexGen::YARN_POSITION_INFORMATION::dSectionPosition, TexGen::GetClosestValues(), TexGen::GetInterpedValue(), TexGen::YARN_POSITION_INFORMATION::iSection, m_Adjustments, m_pYarnSection, and TGERROR.

◆ GetSectionConstant()

CYarnSectionConstant * CYarnSection::GetSectionConstant ( )
inherited

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

Definition at line 96 of file YarnSection.cpp.

◆ GetSectionInterpPosition()

CYarnSectionInterpPosition * CYarnSection::GetSectionInterpPosition ( )
inherited

Definition at line 100 of file YarnSection.cpp.

◆ GetSectionMesh()

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

Implements TexGen::CYarnSection.

Definition at line 117 of file YarnSectionAdjusted.cpp.

References m_pYarnSection.

◆ GetType()

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

Derived class should return the class name.

Implements TexGen::CYarnSection.

Definition at line 36 of file YarnSectionAdjusted.h.

◆ PopulateTiXmlElement()

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

Used for saving data to XML.

Reimplemented from TexGen::CYarnSection.

Definition at line 60 of file YarnSectionAdjusted.cpp.

References m_Adjustments, m_pYarnSection, TexGen::CYarnSection::PopulateTiXmlElement(), and TexGen::stringify().

◆ SetSectionMeshLayersEqual()

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

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_Adjustments

YARN_ADJUST TexGen::CYarnSectionAdjusted::m_Adjustments
protected

Represents the adjustements to the interpolation.

The first value in the pair represents the T value (distance along the yarn), the second value represents the displacement vector.

Definition at line 54 of file YarnSectionAdjusted.h.

Referenced by AddAdjustment(), CYarnSectionAdjusted(), GetSection(), and PopulateTiXmlElement().

◆ m_bForceEqualMeshLayers

bool TexGen::CYarnSection::m_bForceEqualMeshLayers
inherited

◆ m_pYarnSection

CObjectContainer<CYarnSection> TexGen::CYarnSectionAdjusted::m_pYarnSection
protected

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