TexGen
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
TexGen::CInterpolation Class Referenceabstract

Abstract base class for describing the yarn path interpolations. More...

#include <Interpolation.h>

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

Public Member Functions

 CInterpolation (bool bPeriodic, bool bForceInPlaneTangent, bool bForceMasterNodeTangent)
 
 CInterpolation (TiXmlElement &Element)
 
virtual ~CInterpolation (void)
 
virtual CInterpolationCopy () 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< CSlaveNodeGetSlaveNodes (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< 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 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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CInterpolation() [1/2]

CInterpolation::CInterpolation ( bool  bPeriodic,
bool  bForceInPlaneTangent,
bool  bForceMasterNodeTangent 
)

Definition at line 29 of file Interpolation.cpp.

◆ CInterpolation() [2/2]

CInterpolation::CInterpolation ( TiXmlElement &  Element)

Definition at line 40 of file Interpolation.cpp.

References m_bForceInPlaneTangent, m_bForceMasterNodeTangent, and m_bPeriodic.

◆ ~CInterpolation()

CInterpolation::~CInterpolation ( void  )
virtual

Definition at line 36 of file Interpolation.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
protected

Definition at line 315 of file Interpolation.cpp.

References GetNode().

Referenced by CreateEquiSpacedSlaveNodes().

◆ CalculateNodeCoordinateSystem()

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

◆ Copy()

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

◆ CreateEquiSpacedSlaveNodes()

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

◆ CreateInterpolation()

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

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
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().

◆ GetForceInPlaneTangent()

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

Definition at line 88 of file Interpolation.h.

◆ GetNode() [1/2]

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.

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 GetNode().

◆ GetNode() [2/2]

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

Parameters
MasterNodesThe nodes which need to be interpolated
iIndexThe section between which the interpolation should be made
tThe 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().

◆ GetPeriodic()

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

Definition at line 87 of file Interpolation.h.

◆ GetSlaveNodes()

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().

◆ GetType()

virtual string TexGen::CInterpolation::GetType ( ) const
pure virtual

◆ Initialise()

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

◆ InterpolateAngle()

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

◆ InterpolateUp()

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

◆ PopulateTiXmlElement()

void CInterpolation::PopulateTiXmlElement ( TiXmlElement &  Element,
OUTPUT_TYPE  OutputType 
) const
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().

◆ SetForceInPlaneTangent()

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

Definition at line 86 of file Interpolation.h.

◆ SetPeriodic()

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

Definition at line 85 of file Interpolation.h.

Member Data Documentation

◆ m_bForceInPlaneTangent

bool TexGen::CInterpolation::m_bForceInPlaneTangent
protected

◆ m_bForceMasterNodeTangent

bool TexGen::CInterpolation::m_bForceMasterNodeTangent
protected

◆ m_bPeriodic

bool TexGen::CInterpolation::m_bPeriodic
protected

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