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

Interpolate sections between arbritrary positions along the length of the yarn. More...

#include <YarnSectionInterpPosition.h>

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

Public Member Functions

 CYarnSectionInterpPosition (bool bRamped=true, bool bPolar=false, bool bConstMesh=true)
 
 CYarnSectionInterpPosition (TiXmlElement &Element)
 
 ~CYarnSectionInterpPosition (void)
 
vector< XYGetSection (const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced=false) const
 This function must be implemented by derived classes. More...
 
CMesh GetSectionMesh (const YARN_POSITION_INFORMATION PositionInfo, int iNumPoints, bool bEquiSpaced) const
 This function must be implemented by derived classes. More...
 
CYarnSectionCopy () 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 AddSection (double dPosition, const CSection &Section)
 Add a section at a specific point along the path of the yarn. More...
 
void SetSectionMeshLayersEqual (int iNumPoints) const
 Function to set the number of layers equal for all sections in a given yarn. More...
 
int GetNumNodeSections () const
 
const CSectionGetSection (int iIndex) const
 
double GetSectionPosition (int iIndex) const
 
bool GetRamped ()
 
bool GetPolar ()
 
bool GetForceMeshLayers () const
 
CYarnSectionConstantGetSectionConstant ()
 Get a pointer of that the inherited class. More...
 
CYarnSectionInterpNodeGetSectionInterpNode ()
 
CYarnSectionInterpPositionGetSectionInterpPosition ()
 

Static Public Member Functions

static CObjectContainer< CYarnSectionCreateYarnSection (TiXmlElement &Element)
 Create a yarn section from TiXmlElement. More...
 

Public Attributes

bool m_bForceEqualMeshLayers
 

Protected Member Functions

bool GetInterpedSection (const CSection &Section1, const CSection &Section2, double u, int iNumPoints, bool bEquiSpaced, vector< XY > &Points) const
 
bool GetInterpedSectionMesh (const CSection &Section1, const CSection &Section2, double u, int iNumPoints, bool bEquiSpaced, CMesh &Mesh) const
 
XY InterpolatePoints (XY P1, XY P2, double u) const
 
int CalculateNumberofLayers (const vector< XY > &Section) const
 

Protected Attributes

vector< pair< double, CObjectContainer< CSection > > > m_Sections
 
bool m_bRamped
 
bool m_bPolar
 

Detailed Description

Interpolate sections between arbritrary positions along the length of the yarn.

Sections should be added to the class by use of the AddSection function.

Definition at line 31 of file YarnSectionInterpPosition.h.

Constructor & Destructor Documentation

◆ CYarnSectionInterpPosition() [1/2]

CYarnSectionInterpPosition::CYarnSectionInterpPosition ( bool  bRamped = true,
bool  bPolar = false,
bool  bConstMesh = true 
)
Parameters
bRamped,bPolarSpecify how points are interpolated between master nodes using CYarnSectionInterp::InterpolatePoints() If bRamped is set to true, the interpolation fraction given to functions in GetInterpedSection and GetInterpedSectionMesh will be ramped using a cubic equation. Where du = 0 at u = 0, and du = 0 at u = 1. This provides a smoother transition between sections when the interpolation begins and ends.
bConstMeshDefines whether all section meshes are forced to have same configuration ie number of rows and columns in mesh

Definition at line 25 of file YarnSectionInterpPosition.cpp.

◆ CYarnSectionInterpPosition() [2/2]

CYarnSectionInterpPosition::CYarnSectionInterpPosition ( TiXmlElement &  Element)

◆ ~CYarnSectionInterpPosition()

CYarnSectionInterpPosition::~CYarnSectionInterpPosition ( void  )

Definition at line 30 of file YarnSectionInterpPosition.cpp.

Member Function Documentation

◆ AddSection()

void CYarnSectionInterpPosition::AddSection ( double  dPosition,
const CSection Section 
)

Add a section at a specific point along the path of the yarn.

Positions in between specified sections will be interpolated. If no section is specified at the start and end then the sections are applied periodically.

Parameters
dPositionRepresents the position along the length of the yarn where the section is to be applied, this value should vary between 0 and 1
SectionThe section to be applied at that position

Definition at line 174 of file YarnSectionInterpPosition.cpp.

References m_Sections.

Referenced by TexGen::CAdjustMeshInterference::AdjustSectionMeshes().

◆ CalculateNumberofLayers()

int CYarnSectionInterp::CalculateNumberofLayers ( const vector< XY > &  Section) const
protectedinherited

◆ Copy()

CYarnSection * TexGen::CYarnSectionInterpPosition::Copy ( ) const
inlinevirtual

This is a function to allow copying of derived classes correctly.

Derived classes should implement this as CYarnSection* Copy() const { return new CYarnSectionDerived(*this); } where CYarnSectionDerived should be replaced by the name of the derived class

Implements TexGen::CYarnSection.

Definition at line 49 of file YarnSectionInterpPosition.h.

◆ CreateYarnSection()

CObjectContainer< CYarnSection > CYarnSection::CreateYarnSection ( TiXmlElement &  Element)
staticinherited

Create a yarn section from TiXmlElement.

Definition at line 49 of file YarnSection.cpp.

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

◆ GetForceMeshLayers()

bool TexGen::CYarnSection::GetForceMeshLayers ( ) const
inlineinherited

Definition at line 99 of file YarnSection.h.

◆ GetInterpedSection()

bool CYarnSectionInterp::GetInterpedSection ( const CSection Section1,
const CSection Section2,
double  u,
int  iNumPoints,
bool  bEquiSpaced,
vector< XY > &  Points 
) const
protectedinherited

◆ GetInterpedSectionMesh()

bool CYarnSectionInterp::GetInterpedSectionMesh ( const CSection Section1,
const CSection Section2,
double  u,
int  iNumPoints,
bool  bEquiSpaced,
CMesh Mesh 
) const
protectedinherited

◆ GetNumNodeSections()

int TexGen::CYarnSectionInterpPosition::GetNumNodeSections ( ) const
inline

Definition at line 67 of file YarnSectionInterpPosition.h.

◆ GetPolar()

bool TexGen::CYarnSectionInterp::GetPolar ( )
inlineinherited

Definition at line 48 of file YarnSectionInterp.h.

◆ GetRamped()

bool TexGen::CYarnSectionInterp::GetRamped ( )
inlineinherited

Definition at line 47 of file YarnSectionInterp.h.

◆ GetSection() [1/2]

vector< XY > CYarnSectionInterpPosition::GetSection ( const YARN_POSITION_INFORMATION  PositionInfo,
int  iNumPoints,
bool  bEquiSpaced = false 
) const
virtual

This function must be implemented by derived classes.

Parameters
PositionInfoStructure which contains information about the position along the yarn
iNumPointsNumber of points on the perimeter of the section to return
bEquiSpacedCreate the points such that they are all equispaced or not

Implements TexGen::CYarnSection.

Definition at line 66 of file YarnSectionInterpPosition.cpp.

References TexGen::CYarnSectionInterp::GetInterpedSection(), TexGen::YARN_POSITION_INFORMATION::GetYarnPosition(), m_Sections, and TGERROR.

◆ GetSection() [2/2]

const CSection & CYarnSectionInterpPosition::GetSection ( int  iIndex) const

Definition at line 180 of file YarnSectionInterpPosition.cpp.

References m_Sections.

◆ GetSectionConstant()

CYarnSectionConstant * CYarnSection::GetSectionConstant ( )
inherited

Get a pointer of that the inherited class.

Internally the function just returns dynamic_cast<CYarnSectionConstant*>(this) etc This is mainly useful in the python interface because type casting is not supported in this language.

Definition at line 91 of file YarnSection.cpp.

◆ GetSectionInterpNode()

CYarnSectionInterpNode * CYarnSection::GetSectionInterpNode ( )
inherited

Definition at line 96 of file YarnSection.cpp.

◆ GetSectionInterpPosition()

CYarnSectionInterpPosition * CYarnSection::GetSectionInterpPosition ( )
inherited

Definition at line 100 of file YarnSection.cpp.

◆ GetSectionMesh()

CMesh CYarnSectionInterpPosition::GetSectionMesh ( const YARN_POSITION_INFORMATION  PositionInfo,
int  iNumPoints,
bool  bEquiSpaced 
) const
virtual

This function must be implemented by derived classes.

Parameters
PositionInfoStructure which contains information about the position along the yarn
iNumPointsNumber of points on the perimeter of the section to return
bEquiSpacedCreate the points such that they are all equispaced or not

Implements TexGen::CYarnSection.

Definition at line 118 of file YarnSectionInterpPosition.cpp.

References TexGen::CYarnSectionInterp::GetInterpedSectionMesh(), TexGen::YARN_POSITION_INFORMATION::GetYarnPosition(), m_Sections, and TGERROR.

◆ GetSectionPosition()

double CYarnSectionInterpPosition::GetSectionPosition ( int  iIndex) const

Definition at line 186 of file YarnSectionInterpPosition.cpp.

References m_Sections.

◆ GetType()

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

Derived class should return the class name.

Implements TexGen::CYarnSection.

Definition at line 50 of file YarnSectionInterpPosition.h.

◆ InterpolatePoints()

XY CYarnSectionInterp::InterpolatePoints ( XY  P1,
XY  P2,
double  u 
) const
protectedinherited

◆ PopulateTiXmlElement()

void CYarnSectionInterpPosition::PopulateTiXmlElement ( TiXmlElement &  Element,
OUTPUT_TYPE  OutputType 
) const
virtual

Used for saving data to XML.

Reimplemented from TexGen::CYarnSectionInterp.

Definition at line 50 of file YarnSectionInterpPosition.cpp.

References m_Sections, TexGen::CYarnSectionInterp::PopulateTiXmlElement(), and TexGen::stringify().

◆ SetSectionMeshLayersEqual()

void CYarnSectionInterpPosition::SetSectionMeshLayersEqual ( int  iNumPoints) const
virtual

Function to set the number of layers equal for all sections in a given yarn.

Reimplemented from TexGen::CYarnSection.

Definition at line 192 of file YarnSectionInterpPosition.cpp.

References TexGen::CYarnSectionInterp::CalculateNumberofLayers(), m_Sections, and TexGen::CSection::SetSectionMeshLayers().

Member Data Documentation

◆ m_bForceEqualMeshLayers

bool TexGen::CYarnSection::m_bForceEqualMeshLayers
inherited

◆ m_bPolar

bool TexGen::CYarnSectionInterp::m_bPolar
protectedinherited

◆ m_bRamped

bool TexGen::CYarnSectionInterp::m_bRamped
protectedinherited

◆ m_Sections

vector<pair<double, CObjectContainer<CSection> > > TexGen::CYarnSectionInterpPosition::m_Sections
protected

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