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

Bezier interpolation for yarn paths. More...

#include <InterpolationAdjusted.h>

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

Public Member Functions

 CInterpolationAdjusted (const CInterpolation &Interpolation)
 
 CInterpolationAdjusted (TiXmlElement &Element)
 
 ~CInterpolationAdjusted (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 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< 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 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< CInterpolationm_pInterpolation
 
bool m_bPeriodic
 
bool m_bForceInPlaneTangent
 
bool m_bForceMasterNodeTangent
 

Detailed Description

Bezier interpolation for yarn paths.

Definition at line 28 of file InterpolationAdjusted.h.

Constructor & Destructor Documentation

◆ CInterpolationAdjusted() [1/2]

CInterpolationAdjusted::CInterpolationAdjusted ( const CInterpolation Interpolation)

Definition at line 24 of file InterpolationAdjusted.cpp.

◆ CInterpolationAdjusted() [2/2]

CInterpolationAdjusted::CInterpolationAdjusted ( TiXmlElement &  Element)

◆ ~CInterpolationAdjusted()

CInterpolationAdjusted::~CInterpolationAdjusted ( void  )

Definition at line 30 of file InterpolationAdjusted.cpp.

Member Function Documentation

◆ AddAdjustment()

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

◆ 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::CInterpolationAdjusted::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 InterpolationAdjusted.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 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.

◆ 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 CInterpolationAdjusted::GetNode ( const vector< CNode > &  MasterNodes,
int  iIndex,
double  t 
) const
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.

◆ GetPeriodic()

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

Definition at line 87 of file Interpolation.h.

◆ 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::CInterpolationAdjusted::GetType ( ) const
inlinevirtual

Derived class should return the class name.

Implements TexGen::CInterpolation.

Definition at line 36 of file InterpolationAdjusted.h.

◆ Initialise()

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

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

◆ 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_Adjustments

vector<vector<pair<double, XYZ> > > TexGen::CInterpolationAdjusted::m_Adjustments
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().

◆ 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_pInterpolation

CObjectContainer<CInterpolation> TexGen::CInterpolationAdjusted::m_pInterpolation
protected

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