TexGen
|
Bezier interpolation for yarn paths. More...
#include <InterpolationBezier.h>
Public Member Functions | |
CInterpolationBezier (bool bPeriodic=true, bool bForceInPlaneTangent=false, bool bForceMasterNodeTangent=false) | |
CInterpolationBezier (TiXmlElement &Element) | |
~CInterpolationBezier (void) | |
CInterpolation * | Copy () 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 | Initialise (const vector< CNode > &MasterNodes) const |
Calculate the node tangents (use node tangents of they exist) and store them in m_Tangents. More... | |
CSlaveNode | GetNode (const vector< CNode > &MasterNodes, int iIndex, double t) const |
Get a node from parametric function where t is specified. 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... | |
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 | |
vector< XYZ > | m_Tangents |
bool | m_bPeriodic |
bool | m_bForceInPlaneTangent |
bool | m_bForceMasterNodeTangent |
Bezier interpolation for yarn paths.
Definition at line 28 of file InterpolationBezier.h.
CInterpolationBezier::CInterpolationBezier | ( | bool | bPeriodic = true , |
bool | bForceInPlaneTangent = false , |
||
bool | bForceMasterNodeTangent = false |
||
) |
Definition at line 24 of file InterpolationBezier.cpp.
CInterpolationBezier::CInterpolationBezier | ( | TiXmlElement & | Element | ) |
Definition at line 33 of file InterpolationBezier.cpp.
CInterpolationBezier::~CInterpolationBezier | ( | void | ) |
Definition at line 29 of file InterpolationBezier.cpp.
|
protectedinherited |
Definition at line 315 of file Interpolation.cpp.
References TexGen::CInterpolation::GetNode().
Referenced by TexGen::CInterpolation::CreateEquiSpacedSlaveNodes().
|
protectedinherited |
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(), TexGen::CInterpolation::m_bForceMasterNodeTangent, TexGen::CInterpolation::m_bPeriodic, TexGen::Normalise(), TGERROR, and TexGen::XYZ::z.
Referenced by Initialise(), and TexGen::CInterpolationLinear::Initialise().
|
inlinevirtual |
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
Implements TexGen::CInterpolation.
Definition at line 35 of file InterpolationBezier.h.
|
protectedinherited |
Create slave nodes equispaced with total specified number of points.
Definition at line 167 of file Interpolation.cpp.
References TexGen::CInterpolation::CalcSlaveNodePositions(), TexGen::GetLength(), and TGERROR.
Referenced by TexGen::CInterpolation::GetSlaveNodes().
|
staticinherited |
Create an interpolation from TiXmlElement.
Definition at line 64 of file Interpolation.cpp.
Referenced by TexGen::CInterpolationAdjusted::CInterpolationAdjusted(), and TexGen::CYarn::CYarn().
|
protectedinherited |
Create slave nodes with specified number of points between master nodes.
Definition at line 155 of file Interpolation.cpp.
References TexGen::CInterpolation::GetNode().
Referenced by TexGen::CInterpolation::GetSlaveNodes().
|
inlineinherited |
Definition at line 88 of file Interpolation.h.
|
inherited |
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 TexGen::CInterpolation::GetNode().
|
virtual |
Get a node from parametric function where t is specified.
Implements TexGen::CInterpolation.
Definition at line 44 of file InterpolationBezier.cpp.
References TexGen::CalculateBezierPoint(), TexGen::CalculateBezierTangent(), TexGen::GetLength(), TexGen::CNode::GetPosition(), Initialise(), TexGen::CInterpolation::InterpolateAngle(), TexGen::CInterpolation::InterpolateUp(), TexGen::CInterpolation::m_bForceInPlaneTangent, m_Tangents, TexGen::Normalise(), TexGen::CSlaveNode::SetIndex(), TexGen::CSlaveNode::SetT(), and TexGen::XYZ::z.
|
inlineinherited |
Definition at line 87 of file Interpolation.h.
|
inherited |
Get a list of nodes along the centre line of the yarn.
Definition at line 146 of file Interpolation.cpp.
References TexGen::CInterpolation::CreateEquiSpacedSlaveNodes(), TexGen::CInterpolation::CreateSlaveNodes(), and TexGen::CInterpolation::Initialise().
|
inlinevirtual |
Derived class should return the class name.
Implements TexGen::CInterpolation.
Definition at line 36 of file InterpolationBezier.h.
|
virtual |
Calculate the node tangents (use node tangents of they exist) and store them in m_Tangents.
Reimplemented from TexGen::CInterpolation.
Definition at line 105 of file InterpolationBezier.cpp.
References TexGen::CInterpolation::CalculateNodeCoordinateSystem(), and m_Tangents.
Referenced by GetNode().
|
staticprotectedinherited |
Definition at line 98 of file Interpolation.cpp.
References TexGen::CNode::GetAngle(), and TexGen::CNode::SetAngle().
Referenced by GetNode(), TexGen::CInterpolationCubic::GetNode(), and TexGen::CInterpolationLinear::GetNode().
|
staticprotectedinherited |
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 GetNode(), TexGen::CInterpolationCubic::GetNode(), and TexGen::CInterpolationLinear::GetNode().
|
virtualinherited |
Used for saving data to XML.
Reimplemented in TexGen::CInterpolationAdjusted.
Definition at line 56 of file Interpolation.cpp.
References TexGen::CInterpolation::GetType(), TexGen::CInterpolation::m_bForceInPlaneTangent, TexGen::CInterpolation::m_bForceMasterNodeTangent, and TexGen::CInterpolation::m_bPeriodic.
Referenced by TexGen::CInterpolationAdjusted::PopulateTiXmlElement().
|
inlineinherited |
Definition at line 86 of file Interpolation.h.
|
inlineinherited |
Definition at line 85 of file Interpolation.h.
|
protectedinherited |
Definition at line 108 of file Interpolation.h.
Referenced by TexGen::CInterpolation::CInterpolation(), GetNode(), TexGen::CInterpolationCubic::GetNode(), TexGen::CInterpolationLinear::GetNode(), and TexGen::CInterpolation::PopulateTiXmlElement().
|
protectedinherited |
Definition at line 109 of file Interpolation.h.
Referenced by TexGen::CInterpolation::CalculateNodeCoordinateSystem(), TexGen::CInterpolation::CInterpolation(), and TexGen::CInterpolation::PopulateTiXmlElement().
|
protectedinherited |
Definition at line 107 of file Interpolation.h.
Referenced by TexGen::CInterpolation::CalculateNodeCoordinateSystem(), TexGen::CInterpolation::CInterpolation(), TexGen::CInterpolationCubic::Initialise(), and TexGen::CInterpolation::PopulateTiXmlElement().
|
mutableprotected |
Definition at line 46 of file InterpolationBezier.h.
Referenced by GetNode(), and Initialise().