TexGen
|
Interpolate sections between arbritrary positions along the length of the yarn. More...
#include <YarnSectionInterpPosition.h>
Public Member Functions | |
CYarnSectionInterpPosition (bool bRamped=true, bool bPolar=false, bool bConstMesh=true) | |
CYarnSectionInterpPosition (TiXmlElement &Element) | |
~CYarnSectionInterpPosition (void) | |
vector< XY > | GetSection (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... | |
CYarnSection * | 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 | 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 CSection & | GetSection (int iIndex) const |
double | GetSectionPosition (int iIndex) const |
bool | GetRamped () |
bool | GetPolar () |
bool | GetForceMeshLayers () const |
CYarnSectionConstant * | GetSectionConstant () |
Get a pointer of that the inherited class. More... | |
CYarnSectionInterpNode * | GetSectionInterpNode () |
CYarnSectionInterpPosition * | GetSectionInterpPosition () |
Static Public Member Functions | |
static CObjectContainer< CYarnSection > | CreateYarnSection (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 |
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.
CYarnSectionInterpPosition::CYarnSectionInterpPosition | ( | bool | bRamped = true , |
bool | bPolar = false , |
||
bool | bConstMesh = true |
||
) |
bRamped,bPolar | Specify 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. |
bConstMesh | Defines 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::CYarnSectionInterpPosition | ( | TiXmlElement & | Element | ) |
Definition at line 34 of file YarnSectionInterpPosition.cpp.
References TexGen::CSection::CreateSection(), FOR_EACH_TIXMLELEMENT, and m_Sections.
CYarnSectionInterpPosition::~CYarnSectionInterpPosition | ( | void | ) |
Definition at line 30 of file YarnSectionInterpPosition.cpp.
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.
dPosition | Represents the position along the length of the yarn where the section is to be applied, this value should vary between 0 and 1 |
Section | The section to be applied at that position |
Definition at line 174 of file YarnSectionInterpPosition.cpp.
References m_Sections.
Referenced by TexGen::CAdjustMeshInterference::AdjustSectionMeshes().
|
protectedinherited |
Definition at line 147 of file YarnSectionInterp.cpp.
References TexGen::XY::x, and TexGen::XY::y.
Referenced by TexGen::CYarnSectionInterpNode::SetSectionMeshLayersEqual(), and SetSectionMeshLayersEqual().
|
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.
|
staticinherited |
Create a yarn section from TiXmlElement.
Definition at line 49 of file YarnSection.cpp.
Referenced by TexGen::CYarn::CYarn(), and TexGen::CYarnSectionAdjusted::CYarnSectionAdjusted().
|
inlineinherited |
Definition at line 99 of file YarnSection.h.
|
protectedinherited |
Definition at line 49 of file YarnSectionInterp.cpp.
References TexGen::CSection::GetPoints(), and TexGen::CYarnSectionInterp::InterpolatePoints().
Referenced by TexGen::CYarnSectionInterpNode::GetSection(), and GetSection().
|
protectedinherited |
Definition at line 72 of file YarnSectionInterp.cpp.
References TexGen::CMesh::AddNode(), TexGen::CMesh::Clear(), TexGen::CSection::GetDefaultName(), TexGen::CMesh::GetIndices(), TexGen::CSection::GetMesh(), TexGen::CMesh::GetNode(), TexGen::CMesh::GetNumNodes(), TexGen::CYarnSectionInterp::InterpolatePoints(), TexGen::CMesh::NUM_ELEMENT_TYPES, TGERROR, TexGen::XYZ::x, TexGen::XY::x, TexGen::XYZ::y, and TexGen::XY::y.
Referenced by TexGen::CYarnSectionInterpNode::GetSectionMesh(), and GetSectionMesh().
|
inline |
Definition at line 67 of file YarnSectionInterpPosition.h.
|
inlineinherited |
Definition at line 48 of file YarnSectionInterp.h.
|
inlineinherited |
Definition at line 47 of file YarnSectionInterp.h.
|
virtual |
This function must be implemented by derived classes.
PositionInfo | Structure which contains information about the position along the yarn |
iNumPoints | Number of points on the perimeter of the section to return |
bEquiSpaced | Create 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.
const CSection & CYarnSectionInterpPosition::GetSection | ( | int | iIndex | ) | const |
Definition at line 180 of file YarnSectionInterpPosition.cpp.
References m_Sections.
|
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.
|
inherited |
Definition at line 96 of file YarnSection.cpp.
|
inherited |
Definition at line 100 of file YarnSection.cpp.
|
virtual |
This function must be implemented by derived classes.
PositionInfo | Structure which contains information about the position along the yarn |
iNumPoints | Number of points on the perimeter of the section to return |
bEquiSpaced | Create 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.
double CYarnSectionInterpPosition::GetSectionPosition | ( | int | iIndex | ) | const |
Definition at line 186 of file YarnSectionInterpPosition.cpp.
References m_Sections.
|
inlinevirtual |
Derived class should return the class name.
Implements TexGen::CYarnSection.
Definition at line 50 of file YarnSectionInterpPosition.h.
Definition at line 117 of file YarnSectionInterp.cpp.
References TexGen::GetLength(), TexGen::CYarnSectionInterp::m_bPolar, TexGen::CYarnSectionInterp::m_bRamped, PI, TexGen::XY::x, and TexGen::XY::y.
Referenced by TexGen::CYarnSectionInterp::GetInterpedSection(), and TexGen::CYarnSectionInterp::GetInterpedSectionMesh().
|
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().
|
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().
|
inherited |
Definition at line 63 of file YarnSection.h.
Referenced by TexGen::CYarnSection::CYarnSection(), and TexGen::CYarnSection::PopulateTiXmlElement().
|
protectedinherited |
Definition at line 58 of file YarnSectionInterp.h.
Referenced by TexGen::CYarnSectionInterp::CYarnSectionInterp(), TexGen::CYarnSectionInterp::InterpolatePoints(), and TexGen::CYarnSectionInterp::PopulateTiXmlElement().
|
protectedinherited |
Definition at line 58 of file YarnSectionInterp.h.
Referenced by TexGen::CYarnSectionInterp::CYarnSectionInterp(), TexGen::CYarnSectionInterp::InterpolatePoints(), and TexGen::CYarnSectionInterp::PopulateTiXmlElement().
|
protected |
Definition at line 72 of file YarnSectionInterpPosition.h.
Referenced by AddSection(), CYarnSectionInterpPosition(), GetSection(), GetSectionMesh(), GetSectionPosition(), PopulateTiXmlElement(), and SetSectionMeshLayersEqual().