TexGen
|
Bezier interpolation for yarn paths. More...
#include <InterpolationAdjusted.h>
Public Member Functions | |
CInterpolationAdjusted (const CInterpolation &Interpolation) | |
CInterpolationAdjusted (TiXmlElement &Element) | |
~CInterpolationAdjusted (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 | PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType) const |
Used for saving data to XML. 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... | |
void | AddAdjustment (int iIndex, double t, XYZ Vector) |
At given index and value t the position of the node should be adjusted by given vector. 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< vector< pair< double, XYZ > > > | m_Adjustments |
Represents the adjustements to the interpolation. More... | |
CObjectContainer< CInterpolation > | m_pInterpolation |
bool | m_bPeriodic |
bool | m_bForceInPlaneTangent |
bool | m_bForceMasterNodeTangent |
Bezier interpolation for yarn paths.
Definition at line 28 of file InterpolationAdjusted.h.
CInterpolationAdjusted::CInterpolationAdjusted | ( | const CInterpolation & | Interpolation | ) |
Definition at line 24 of file InterpolationAdjusted.cpp.
CInterpolationAdjusted::CInterpolationAdjusted | ( | TiXmlElement & | Element | ) |
Definition at line 34 of file InterpolationAdjusted.cpp.
References TexGen::CInterpolation::CreateInterpolation(), FOR_EACH_TIXMLELEMENT, m_Adjustments, and m_pInterpolation.
CInterpolationAdjusted::~CInterpolationAdjusted | ( | void | ) |
Definition at line 30 of file InterpolationAdjusted.cpp.
void CInterpolationAdjusted::AddAdjustment | ( | int | iIndex, |
double | t, | ||
XYZ | Vector | ||
) |
At given index and value t the position of the node should be adjusted by given vector.
Definition at line 97 of file InterpolationAdjusted.cpp.
References m_Adjustments, and TGERROR.
Referenced by TexGen::CTextileDeformer::DeformTextile().
|
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 InterpolationAdjusted.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 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 76 of file InterpolationAdjusted.cpp.
References TexGen::GetInterpedValue(), TexGen::CNode::GetPosition(), m_Adjustments, m_pInterpolation, TexGen::CNode::SetPosition(), and TGERROR.
|
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 InterpolationAdjusted.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 92 of file InterpolationAdjusted.cpp.
References m_pInterpolation.
|
staticprotectedinherited |
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().
|
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(), TexGen::CInterpolationCubic::GetNode(), and TexGen::CInterpolationLinear::GetNode().
|
virtual |
Used for saving data to XML.
Reimplemented from TexGen::CInterpolation.
Definition at line 54 of file InterpolationAdjusted.cpp.
References m_Adjustments, m_pInterpolation, TexGen::CInterpolation::PopulateTiXmlElement(), and TexGen::stringify().
|
inlineinherited |
Definition at line 86 of file Interpolation.h.
|
inlineinherited |
Definition at line 85 of file Interpolation.h.
|
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 InterpolationAdjusted.h.
Referenced by AddAdjustment(), CInterpolationAdjusted(), GetNode(), and PopulateTiXmlElement().
|
protectedinherited |
Definition at line 108 of file Interpolation.h.
Referenced by TexGen::CInterpolation::CInterpolation(), TexGen::CInterpolationBezier::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().
|
protected |
Definition at line 55 of file InterpolationAdjusted.h.
Referenced by CInterpolationAdjusted(), GetNode(), Initialise(), and PopulateTiXmlElement().