TexGen
|
Abstract base class for describing the yarn path interpolations. More...
#include <Interpolation.h>
Public Member Functions | |
CInterpolation (bool bPeriodic, bool bForceInPlaneTangent, bool bForceMasterNodeTangent) | |
CInterpolation (TiXmlElement &Element) | |
virtual | ~CInterpolation (void) |
virtual CInterpolation * | Copy () const =0 |
This is a function to allow copying of derived classes correctly. More... | |
virtual string | GetType () const =0 |
Derived class should return the class name. More... | |
virtual void | PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType) const |
Used for saving data to XML. More... | |
vector< CSlaveNode > | GetSlaveNodes (const vector< CNode > &MasterNodes, int iNumPoints, bool bEquiSpaced=true) const |
Get a list of nodes along the centre line of the yarn. More... | |
virtual void | Initialise (const vector< CNode > &MasterNodes) const |
virtual CSlaveNode | GetNode (const vector< CNode > &MasterNodes, int iIndex, double t) const =0 |
Get a node from parametric function. Initialise should be called first. More... | |
CSlaveNode | GetNode (const vector< CNode > &MasterNodes, double t) const |
Get a node from parametric function. Initialise should be called first. More... | |
void | SetPeriodic (bool bPeriodic) |
void | SetForceInPlaneTangent (bool bForceInPlaneTangent) |
bool | GetPeriodic () const |
bool | GetForceInPlaneTangent () const |
Static Public Member Functions | |
static CObjectContainer< CInterpolation > | CreateInterpolation (TiXmlElement &Element) |
Create an interpolation from TiXmlElement. More... | |
Protected Member Functions | |
void | CreateSlaveNodes (vector< CSlaveNode > &SlaveNodes, const vector< CNode > &MasterNodes, int iNumPoints) const |
Create slave nodes with specified number of points between master nodes. More... | |
bool | CreateEquiSpacedSlaveNodes (vector< CSlaveNode > &SlaveNodes, const vector< CNode > &MasterNodes, int iNumPoints) const |
Create slave nodes equispaced with total specified number of points. More... | |
void | CalculateNodeCoordinateSystem (const vector< CNode > &MasterNodes, vector< XYZ > &Tangents) const |
vector< CSlaveNode > | CalcSlaveNodePositions (const vector< CNode > &MasterNodes, vector< double > &LValues, vector< double > &TValues, double dL, int iNumNodes, int iNumPoints) const |
Static Protected Member Functions | |
static void | InterpolateUp (const CNode &Node1, const CNode &Node2, CSlaveNode &SlaveNode, double t) |
static void | InterpolateAngle (const CNode &Node1, const CNode &Node2, CSlaveNode &SlaveNode, double t) |
Protected Attributes | |
bool | m_bPeriodic |
bool | m_bForceInPlaneTangent |
bool | m_bForceMasterNodeTangent |
Abstract base class for describing the yarn path interpolations.
Given the master nodes of a yarn, this class should be able to interpolated points along the path of the yarn that contain the tangent and up vector
Definition at line 32 of file Interpolation.h.
CInterpolation::CInterpolation | ( | bool | bPeriodic, |
bool | bForceInPlaneTangent, | ||
bool | bForceMasterNodeTangent | ||
) |
Definition at line 29 of file Interpolation.cpp.
CInterpolation::CInterpolation | ( | TiXmlElement & | Element | ) |
Definition at line 40 of file Interpolation.cpp.
References m_bForceInPlaneTangent, m_bForceMasterNodeTangent, and m_bPeriodic.
|
virtual |
Definition at line 36 of file Interpolation.cpp.
|
protected |
Definition at line 315 of file Interpolation.cpp.
References GetNode().
Referenced by CreateEquiSpacedSlaveNodes().
|
protected |
This function will calculate the Tangent and Up vectors automatically to sensible values without user input for the parent nodes within the current yarn. It may be desirable to give more control to the user.
Definition at line 261 of file Interpolation.cpp.
References TexGen::GetLength(), m_bForceMasterNodeTangent, m_bPeriodic, TexGen::Normalise(), TGERROR, and TexGen::XYZ::z.
Referenced by TexGen::CInterpolationBezier::Initialise(), and TexGen::CInterpolationLinear::Initialise().
|
pure virtual |
This is a function to allow copying of derived classes correctly.
Derived classes should implement this as CInterpolation* Copy() const { return new CInterpolationDerived(*this); } where CInterpolationDerived should be replaced by the name of the derived class
Implemented in TexGen::CInterpolationAdjusted, TexGen::CInterpolationBezier, TexGen::CInterpolationCubic, and TexGen::CInterpolationLinear.
|
protected |
Create slave nodes equispaced with total specified number of points.
Definition at line 167 of file Interpolation.cpp.
References CalcSlaveNodePositions(), TexGen::GetLength(), and TGERROR.
Referenced by GetSlaveNodes().
|
static |
Create an interpolation from TiXmlElement.
Definition at line 64 of file Interpolation.cpp.
Referenced by TexGen::CInterpolationAdjusted::CInterpolationAdjusted(), and TexGen::CYarn::CYarn().
|
protected |
Create slave nodes with specified number of points between master nodes.
Definition at line 155 of file Interpolation.cpp.
References GetNode().
Referenced by GetSlaveNodes().
|
inline |
Definition at line 88 of file Interpolation.h.
CSlaveNode CInterpolation::GetNode | ( | const vector< CNode > & | MasterNodes, |
double | t | ||
) | const |
Get a node from parametric function. Initialise should be called first.
Any function which calls this needs to make sure the yarn has been initialised first or trouble will ensue.
MasterNodes | The nodes which need to be interpolated |
t | The interpolation parameter which is 0 to 1 from the start of the yarn to the end of the yarn |
Definition at line 132 of file Interpolation.cpp.
References GetNode().
|
pure virtual |
Get a node from parametric function. Initialise should be called first.
Any function which calls this needs to make sure the yarn has been initialised first or trouble will ensue.
MasterNodes | The nodes which need to be interpolated |
iIndex | The section between which the interpolation should be made |
t | The interpolation parameter which is 0 to 1 from the start of the section to the end of the section |
Implemented in TexGen::CInterpolationAdjusted, TexGen::CInterpolationBezier, TexGen::CInterpolationCubic, and TexGen::CInterpolationLinear.
Referenced by CalcSlaveNodePositions(), TexGen::CShearedTextileWeave2D::CalculateModifiers(), TexGen::CTextileOrthogonal::CorrectCrimpInterference(), TexGen::CTextileWeave::CorrectInterference(), TexGen::CTextileWeave::CorrectYarnWidths(), CreateSlaveNodes(), and GetNode().
|
inline |
Definition at line 87 of file Interpolation.h.
vector< CSlaveNode > CInterpolation::GetSlaveNodes | ( | const vector< CNode > & | MasterNodes, |
int | iNumPoints, | ||
bool | bEquiSpaced = true |
||
) | const |
Get a list of nodes along the centre line of the yarn.
Definition at line 146 of file Interpolation.cpp.
References CreateEquiSpacedSlaveNodes(), CreateSlaveNodes(), and Initialise().
|
pure virtual |
Derived class should return the class name.
Implemented in TexGen::CInterpolationAdjusted, TexGen::CInterpolationBezier, TexGen::CInterpolationCubic, and TexGen::CInterpolationLinear.
Referenced by PopulateTiXmlElement(), and TexGen::CTextileWeave2D::SetInPlaneTangents().
|
inlinevirtual |
If the interpolation function needs to calculate some things just once for the whole yarn it should be done here
Reimplemented in TexGen::CInterpolationAdjusted, TexGen::CInterpolationBezier, TexGen::CInterpolationCubic, and TexGen::CInterpolationLinear.
Definition at line 60 of file Interpolation.h.
Referenced by GetSlaveNodes().
|
staticprotected |
Definition at line 98 of file Interpolation.cpp.
References TexGen::CNode::GetAngle(), and TexGen::CNode::SetAngle().
Referenced by TexGen::CInterpolationBezier::GetNode(), TexGen::CInterpolationCubic::GetNode(), and TexGen::CInterpolationLinear::GetNode().
|
staticprotected |
Definition at line 83 of file Interpolation.cpp.
References TexGen::CNode::GetUp(), TexGen::Normalise(), TexGen::CNode::ProjectUp(), TexGen::CNode::SetUp(), and TexGen::XYZ::z.
Referenced by TexGen::CInterpolationBezier::GetNode(), TexGen::CInterpolationCubic::GetNode(), and TexGen::CInterpolationLinear::GetNode().
|
virtual |
Used for saving data to XML.
Reimplemented in TexGen::CInterpolationAdjusted.
Definition at line 56 of file Interpolation.cpp.
References GetType(), m_bForceInPlaneTangent, m_bForceMasterNodeTangent, and m_bPeriodic.
Referenced by TexGen::CInterpolationAdjusted::PopulateTiXmlElement().
|
inline |
Definition at line 86 of file Interpolation.h.
|
inline |
Definition at line 85 of file Interpolation.h.
|
protected |
Definition at line 108 of file Interpolation.h.
Referenced by CInterpolation(), TexGen::CInterpolationBezier::GetNode(), TexGen::CInterpolationCubic::GetNode(), TexGen::CInterpolationLinear::GetNode(), and PopulateTiXmlElement().
|
protected |
Definition at line 109 of file Interpolation.h.
Referenced by CalculateNodeCoordinateSystem(), CInterpolation(), and PopulateTiXmlElement().
|
protected |
Definition at line 107 of file Interpolation.h.
Referenced by CalculateNodeCoordinateSystem(), CInterpolation(), TexGen::CInterpolationCubic::Initialise(), and PopulateTiXmlElement().