TexGen
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
TexGen::CInterpolationCubic Class Reference

Cubic spline interpolation for yarn paths. More...

#include <InterpolationCubic.h>

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

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)
 
CInterpolationCopy () 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< CSlaveNodeGetSlaveNodes (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< CInterpolationCreateInterpolation (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< CSlaveNodeCalcSlaveNodePositions (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< CUBICEQUATIONm_XCubics
 
vector< CUBICEQUATIONm_YCubics
 
vector< CUBICEQUATIONm_ZCubics
 
bool m_bPeriodic
 
bool m_bForceInPlaneTangent
 
bool m_bForceMasterNodeTangent
 

Detailed Description

Cubic spline interpolation for yarn paths.

Definition at line 28 of file InterpolationCubic.h.

Constructor & Destructor Documentation

◆ CInterpolationCubic() [1/2]

CInterpolationCubic::CInterpolationCubic ( bool  bPeriodic = true,
bool  bForceInPlaneTangent = false,
bool  bForceMasterNodeTangent = false 
)

Definition at line 25 of file InterpolationCubic.cpp.

◆ CInterpolationCubic() [2/2]

CInterpolationCubic::CInterpolationCubic ( TiXmlElement &  Element)

Definition at line 34 of file InterpolationCubic.cpp.

◆ ~CInterpolationCubic()

CInterpolationCubic::~CInterpolationCubic ( void  )

Definition at line 30 of file InterpolationCubic.cpp.

Member Function Documentation

◆ CalcSlaveNodePositions()

vector< CSlaveNode > CInterpolation::CalcSlaveNodePositions ( const vector< CNode > &  MasterNodes,
vector< double > &  LValues,
vector< double > &  TValues,
double  dL,
int  iNumNodes,
int  iNumPoints 
) const
protectedinherited

◆ CalculateNodeCoordinateSystem()

void CInterpolation::CalculateNodeCoordinateSystem ( const vector< CNode > &  MasterNodes,
vector< XYZ > &  Tangents 
) const
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().

◆ Copy()

CInterpolation * TexGen::CInterpolationCubic::Copy ( ) const
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.

◆ CreateEquiSpacedSlaveNodes()

bool CInterpolation::CreateEquiSpacedSlaveNodes ( vector< CSlaveNode > &  SlaveNodes,
const vector< CNode > &  MasterNodes,
int  iNumPoints 
) const
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().

◆ CreateInterpolation()

CObjectContainer< CInterpolation > CInterpolation::CreateInterpolation ( TiXmlElement &  Element)
staticinherited

Create an interpolation from TiXmlElement.

Definition at line 64 of file Interpolation.cpp.

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

◆ CreateSlaveNodes()

void CInterpolation::CreateSlaveNodes ( vector< CSlaveNode > &  SlaveNodes,
const vector< CNode > &  MasterNodes,
int  iNumPoints 
) const
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().

◆ GetForceInPlaneTangent()

bool TexGen::CInterpolation::GetForceInPlaneTangent ( ) const
inlineinherited

Definition at line 88 of file Interpolation.h.

◆ GetNaturalCubicSplines()

void CInterpolationCubic::GetNaturalCubicSplines ( const vector< double > &  Knots,
vector< CUBICEQUATION > &  Cubics 
)
staticprotected

Definition at line 183 of file InterpolationCubic.cpp.

References TexGen::CMatrix::EqualsMultiple(), and TexGen::CMatrix::GetInverse().

Referenced by Initialise().

◆ GetNode() [1/2]

CSlaveNode CInterpolation::GetNode ( const vector< CNode > &  MasterNodes,
double  t 
) const
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.

Parameters
MasterNodesThe nodes which need to be interpolated
tThe 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().

◆ GetNode() [2/2]

CSlaveNode CInterpolationCubic::GetNode ( const vector< CNode > &  MasterNodes,
int  iIndex,
double  t 
) const
virtual

◆ GetPeriodic()

bool TexGen::CInterpolation::GetPeriodic ( ) const
inlineinherited

Definition at line 87 of file Interpolation.h.

◆ GetPeriodicCubicSplines()

void CInterpolationCubic::GetPeriodicCubicSplines ( const vector< double > &  Knots,
vector< CUBICEQUATION > &  Cubics 
)
staticprotected

Definition at line 107 of file InterpolationCubic.cpp.

References TexGen::CMatrix::EqualsMultiple(), and TexGen::CMatrix::GetInverse().

Referenced by Initialise().

◆ GetSlaveNodes()

vector< CSlaveNode > CInterpolation::GetSlaveNodes ( const vector< CNode > &  MasterNodes,
int  iNumPoints,
bool  bEquiSpaced = true 
) const
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().

◆ GetType()

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

Derived class should return the class name.

Implements TexGen::CInterpolation.

Definition at line 36 of file InterpolationCubic.h.

◆ Initialise()

void CInterpolationCubic::Initialise ( const vector< CNode > &  MasterNodes) const
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.

◆ InterpolateAngle()

void CInterpolation::InterpolateAngle ( const CNode Node1,
const CNode Node2,
CSlaveNode SlaveNode,
double  t 
)
staticprotectedinherited

◆ InterpolateUp()

void CInterpolation::InterpolateUp ( const CNode Node1,
const CNode Node2,
CSlaveNode SlaveNode,
double  t 
)
staticprotectedinherited

◆ PopulateTiXmlElement()

void CInterpolation::PopulateTiXmlElement ( TiXmlElement &  Element,
OUTPUT_TYPE  OutputType 
) const
virtualinherited

◆ SetForceInPlaneTangent()

void TexGen::CInterpolation::SetForceInPlaneTangent ( bool  bForceInPlaneTangent)
inlineinherited

Definition at line 86 of file Interpolation.h.

◆ SetPeriodic()

void TexGen::CInterpolation::SetPeriodic ( bool  bPeriodic)
inlineinherited

Definition at line 85 of file Interpolation.h.

Member Data Documentation

◆ m_bForceInPlaneTangent

bool TexGen::CInterpolation::m_bForceInPlaneTangent
protectedinherited

◆ m_bForceMasterNodeTangent

bool TexGen::CInterpolation::m_bForceMasterNodeTangent
protectedinherited

◆ m_bPeriodic

bool TexGen::CInterpolation::m_bPeriodic
protectedinherited

◆ m_XCubics

vector<CUBICEQUATION> TexGen::CInterpolationCubic::m_XCubics
mutableprotected

Definition at line 73 of file InterpolationCubic.h.

Referenced by GetNode(), and Initialise().

◆ m_YCubics

vector<CUBICEQUATION> TexGen::CInterpolationCubic::m_YCubics
mutableprotected

Definition at line 74 of file InterpolationCubic.h.

Referenced by GetNode(), and Initialise().

◆ m_ZCubics

vector<CUBICEQUATION> TexGen::CInterpolationCubic::m_ZCubics
mutableprotected

Definition at line 75 of file InterpolationCubic.h.

Referenced by GetNode(), and Initialise().


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