TexGen
|
Cubic spline interpolation for yarn paths. More...
#include <InterpolationCubic.h>
Classes | |
struct | CUBICEQUATION |
Struct to represent a cubic equation. More... | |
Public Member Functions | |
CInterpolationCubic (bool bPeriodic=true, bool bForceInPlaneTangent=false, bool bForceMasterNodeTangent=false) | |
CInterpolationCubic (TiXmlElement &Element) | |
~CInterpolationCubic (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 |
Create the spline cubic equations and store them in m_?Cubics. 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 | GetPeriodicCubicSplines (const vector< double > &Knots, vector< CUBICEQUATION > &Cubics) |
static void | GetNaturalCubicSplines (const vector< double > &Knots, vector< CUBICEQUATION > &Cubics) |
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< CUBICEQUATION > | m_XCubics |
vector< CUBICEQUATION > | m_YCubics |
vector< CUBICEQUATION > | m_ZCubics |
bool | m_bPeriodic |
bool | m_bForceInPlaneTangent |
bool | m_bForceMasterNodeTangent |
Cubic spline interpolation for yarn paths.
Definition at line 28 of file InterpolationCubic.h.
CInterpolationCubic::CInterpolationCubic | ( | bool | bPeriodic = true , |
bool | bForceInPlaneTangent = false , |
||
bool | bForceMasterNodeTangent = false |
||
) |
Definition at line 25 of file InterpolationCubic.cpp.
CInterpolationCubic::CInterpolationCubic | ( | TiXmlElement & | Element | ) |
Definition at line 34 of file InterpolationCubic.cpp.
CInterpolationCubic::~CInterpolationCubic | ( | void | ) |
Definition at line 30 of file InterpolationCubic.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 TexGen::CInterpolationBezier::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 InterpolationCubic.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.
|
staticprotected |
Definition at line 183 of file InterpolationCubic.cpp.
References TexGen::CMatrix::EqualsMultiple(), and TexGen::CMatrix::GetInverse().
Referenced by Initialise().
|
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 45 of file InterpolationCubic.cpp.
References TexGen::CInterpolation::InterpolateAngle(), TexGen::CInterpolation::InterpolateUp(), TexGen::CInterpolation::m_bForceInPlaneTangent, m_XCubics, m_YCubics, m_ZCubics, TexGen::Normalise(), TexGen::CSlaveNode::SetIndex(), TexGen::CSlaveNode::SetT(), TexGen::XYZ::x, TexGen::XYZ::y, and TexGen::XYZ::z.
|
inlineinherited |
Definition at line 87 of file Interpolation.h.
|
staticprotected |
Definition at line 107 of file InterpolationCubic.cpp.
References TexGen::CMatrix::EqualsMultiple(), and TexGen::CMatrix::GetInverse().
Referenced by Initialise().
|
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 InterpolationCubic.h.
|
virtual |
Create the spline cubic equations and store them in m_?Cubics.
Reimplemented from TexGen::CInterpolation.
Definition at line 81 of file InterpolationCubic.cpp.
References GetNaturalCubicSplines(), GetPeriodicCubicSplines(), TexGen::CInterpolation::m_bPeriodic, m_XCubics, m_YCubics, and m_ZCubics.
|
staticprotectedinherited |
Definition at line 98 of file Interpolation.cpp.
References TexGen::CNode::GetAngle(), and TexGen::CNode::SetAngle().
Referenced by TexGen::CInterpolationBezier::GetNode(), 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 TexGen::CInterpolationBezier::GetNode(), 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(), TexGen::CInterpolationBezier::GetNode(), 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(), Initialise(), and TexGen::CInterpolation::PopulateTiXmlElement().
|
mutableprotected |
Definition at line 73 of file InterpolationCubic.h.
Referenced by GetNode(), and Initialise().
|
mutableprotected |
Definition at line 74 of file InterpolationCubic.h.
Referenced by GetNode(), and Initialise().
|
mutableprotected |
Definition at line 75 of file InterpolationCubic.h.
Referenced by GetNode(), and Initialise().