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

A derivation of the CNode class which contains data specific to slave nodes such as sections. More...

#include <SlaveNode.h>

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

Public Member Functions

 CSlaveNode (XYZ Position=XYZ(), XYZ Tangent=XYZ(), XYZ Up=XYZ())
 
 CSlaveNode (TiXmlElement &Element)
 
 ~CSlaveNode (void)
 
void PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType) const
 Used for saving data to XML. More...
 
void UpdateSectionPoints (const vector< XY > *p2DSectionPoints=NULL)
 Populate m_SectionPoints from m_2DSectionPoints, Setting m_2DSectionPoints at the same time. More...
 
XYZ GetPointOnSection (const XY &p2DSectionPoints)
 Calculate the 3D coordinates of a point on the cross-section. More...
 
void UpdateSectionMesh (const CMesh *p2DSectionMesh=NULL)
 Populate m_SectionMesh from m_2DSectionMesh, Setting m_2DSectionMesh at the same time. More...
 
void Rotate (WXYZ Rotation)
 Rotate the Node by given quaternion. More...
 
void Translate (XYZ Vector)
 Translate the Node by given vector. More...
 
double GetT () const
 
void SetT (double t)
 
int GetIndex () const
 
void SetIndex (int iIndex)
 
const vector< XYZ > & GetSectionPoints () const
 
const vector< XY > & Get2DSectionPoints () const
 
const CMeshGet2DSectionMesh () const
 
const CMeshGetSectionMesh () const
 
bool operator< (const CSlaveNode &right)
 
virtual void Rotate (WXYZ Rotation, XYZ Origin=XYZ(0, 0, 0))
 Rotate the Node by given quaternion. More...
 
void ProjectUp ()
 Project the Up vector such that it is perpendicular to the tangent. More...
 
XYZ GetSide () const
 Get the side vector. More...
 
XYZ GetPosition () const
 
XYZ GetTangent () const
 
XYZ GetUp () const
 
double GetAngle () const
 
XYZ GetNormal () const
 
void SetPosition (XYZ Position)
 
void SetTangent (XYZ Tangent)
 
void SetUp (XYZ Up)
 
void SetAngle (double Angle)
 

Protected Attributes

vector< XYm_2DSectionPoints
 Coordinates of the cross-section edge points in 2D. More...
 
vector< XYZm_SectionPoints
 Coordinates of the cross-section edge points in 3D. More...
 
CMeshm_2DSectionMesh
 Section mesh in 2D. More...
 
CMeshm_SectionMesh
 Section mesh in 3D. More...
 
double m_T
 T is the parameter which varies from 0 to 1 which tells us how far along the link the node is. More...
 
int m_iIndex
 Index which determines between which master nodes this slave node lies, varies from 0 to number of nodes - 1. More...
 
XYZ m_Position
 Coordinates representing the position of the node. More...
 
XYZ m_Tangent
 Unit vector tangent to the yarn path at this node. More...
 
XYZ m_Up
 Unit vector which represents the up direction (must be perpendicular to m_Tangent) More...
 
double m_Angle
 

Detailed Description

A derivation of the CNode class which contains data specific to slave nodes such as sections.

Definition at line 29 of file SlaveNode.h.

Constructor & Destructor Documentation

◆ CSlaveNode() [1/2]

CSlaveNode::CSlaveNode ( XYZ  Position = XYZ(),
XYZ  Tangent = XYZ(),
XYZ  Up = XYZ() 
)

Definition at line 24 of file SlaveNode.cpp.

◆ CSlaveNode() [2/2]

CSlaveNode::CSlaveNode ( TiXmlElement &  Element)

Definition at line 41 of file SlaveNode.cpp.

References FOR_EACH_TIXMLELEMENT, m_2DSectionPoints, m_iIndex, m_SectionPoints, and m_T.

◆ ~CSlaveNode()

CSlaveNode::~CSlaveNode ( void  )

Definition at line 33 of file SlaveNode.cpp.

References m_2DSectionMesh, m_SectionMesh, and NULL.

Member Function Documentation

◆ Get2DSectionMesh()

const CMesh & TexGen::CSlaveNode::Get2DSectionMesh ( ) const
inline

Definition at line 76 of file SlaveNode.h.

◆ Get2DSectionPoints()

const vector< XY > & TexGen::CSlaveNode::Get2DSectionPoints ( ) const
inline

Definition at line 75 of file SlaveNode.h.

Referenced by TexGen::CYarn::AddEndCapsToMesh(), and TexGen::CYarn::PointInsideYarn().

◆ GetAngle()

double TexGen::CNode::GetAngle ( ) const
inlineinherited

◆ GetIndex()

int TexGen::CSlaveNode::GetIndex ( ) const
inline

◆ GetNormal()

XYZ CNode::GetNormal ( ) const
inherited

◆ GetPointOnSection()

XYZ CSlaveNode::GetPointOnSection ( const XY p2DSectionPoints)

Calculate the 3D coordinates of a point on the cross-section.

This function is used to create the global 3D coordinates of a section point from the local 2D coordinates

Parameters
p2DSectionPointsThe point to be converted to the 3D coordinates
Returns
The 3D point calculated

Definition at line 117 of file SlaveNode.cpp.

References TexGen::CNode::GetSide(), TexGen::CNode::m_Position, TexGen::CNode::m_Up, TexGen::XY::x, and TexGen::XY::y.

◆ GetPosition()

XYZ TexGen::CNode::GetPosition ( ) const
inlineinherited

◆ GetSectionMesh()

const CMesh & TexGen::CSlaveNode::GetSectionMesh ( ) const
inline

Definition at line 77 of file SlaveNode.h.

Referenced by TexGen::CYarn::PointInsideYarn().

◆ GetSectionPoints()

const vector< XYZ > & TexGen::CSlaveNode::GetSectionPoints ( ) const
inline

Definition at line 74 of file SlaveNode.h.

Referenced by TexGen::CYarn::FindClosestSurfacePoint().

◆ GetSide()

XYZ CNode::GetSide ( ) const
inherited

◆ GetT()

double TexGen::CSlaveNode::GetT ( ) const
inline

◆ GetTangent()

XYZ TexGen::CNode::GetTangent ( ) const
inlineinherited

◆ GetUp()

XYZ TexGen::CNode::GetUp ( ) const
inlineinherited

◆ operator<()

bool TexGen::CSlaveNode::operator< ( const CSlaveNode right)
inline

Definition at line 79 of file SlaveNode.h.

References m_T.

◆ PopulateTiXmlElement()

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

Used for saving data to XML.

Reimplemented from TexGen::CNode.

Definition at line 68 of file SlaveNode.cpp.

References m_2DSectionPoints, m_iIndex, m_SectionPoints, m_T, TexGen::CNode::PopulateTiXmlElement(), and TexGen::stringify().

◆ ProjectUp()

void CNode::ProjectUp ( )
inherited

Project the Up vector such that it is perpendicular to the tangent.

Definition at line 71 of file Node.cpp.

References TexGen::DotProduct(), TexGen::GetLength(), TexGen::CNode::m_Tangent, TexGen::CNode::m_Up, TexGen::Normalise(), and TGERROR.

Referenced by TexGen::CInterpolation::InterpolateUp().

◆ Rotate() [1/2]

void CSlaveNode::Rotate ( WXYZ  Rotation)

Rotate the Node by given quaternion.

Definition at line 169 of file SlaveNode.cpp.

References m_SectionMesh, m_SectionPoints, TexGen::CMesh::Rotate(), and TexGen::CNode::Rotate().

◆ Rotate() [2/2]

void CNode::Rotate ( WXYZ  Rotation,
XYZ  Origin = XYZ(0,0,0) 
)
virtualinherited

Rotate the Node by given quaternion.

Definition at line 59 of file Node.cpp.

References TexGen::CNode::m_Position, TexGen::CNode::m_Tangent, and TexGen::CNode::m_Up.

Referenced by Rotate().

◆ SetAngle()

void TexGen::CNode::SetAngle ( double  Angle)
inlineinherited

Definition at line 65 of file Node.h.

Referenced by TexGen::CInterpolation::InterpolateAngle().

◆ SetIndex()

void TexGen::CSlaveNode::SetIndex ( int  iIndex)
inline

◆ SetPosition()

void TexGen::CNode::SetPosition ( XYZ  Position)
inlineinherited

◆ SetT()

void TexGen::CSlaveNode::SetT ( double  t)
inline

◆ SetTangent()

void TexGen::CNode::SetTangent ( XYZ  Tangent)
inlineinherited

Definition at line 63 of file Node.h.

◆ SetUp()

void TexGen::CNode::SetUp ( XYZ  Up)
inlineinherited

Definition at line 64 of file Node.h.

Referenced by TexGen::CInterpolation::InterpolateUp().

◆ Translate()

void CSlaveNode::Translate ( XYZ  Vector)
virtual

Translate the Node by given vector.

Reimplemented from TexGen::CNode.

Definition at line 180 of file SlaveNode.cpp.

References m_SectionMesh, m_SectionPoints, TexGen::CMesh::Translate(), and TexGen::CNode::Translate().

◆ UpdateSectionMesh()

void CSlaveNode::UpdateSectionMesh ( const CMesh p2DSectionMesh = NULL)

Populate m_SectionMesh from m_2DSectionMesh, Setting m_2DSectionMesh at the same time.

This function is used to create the global 3D coordinates of the section mesh from the local 2D coordinates of the section mesh

Parameters
p2DSectionMeshSet m_SectionMesh to be equal to this, or NULL to leave m_SectionMesh unmodified

Definition at line 132 of file SlaveNode.cpp.

References TexGen::CMesh::AddNode(), TexGen::CMesh::Clear(), TexGen::CMesh::GetIndices(), TexGen::CMesh::GetNodes(), TexGen::CNode::GetSide(), m_2DSectionMesh, TexGen::CNode::m_Position, m_SectionMesh, TexGen::CNode::m_Up, NULL, TexGen::CMesh::NUM_ELEMENT_TYPES, TexGen::XYZ::x, and TexGen::XYZ::y.

Referenced by TexGen::CYarn::PointInsideYarn().

◆ UpdateSectionPoints()

void CSlaveNode::UpdateSectionPoints ( const vector< XY > *  p2DSectionPoints = NULL)

Populate m_SectionPoints from m_2DSectionPoints, Setting m_2DSectionPoints at the same time.

This function is used to create the global 3D coordinates of the section points from the local 2D coordinates of the section points

Parameters
p2DSectionPointsSet m_Section to be equal to this, or NULL to leave m_Section unmodified

Definition at line 95 of file SlaveNode.cpp.

References TexGen::CNode::GetSide(), m_2DSectionPoints, TexGen::CNode::m_Position, m_SectionPoints, TexGen::CNode::m_Up, TexGen::XYZ::x, and TexGen::XYZ::y.

Referenced by TexGen::CYarn::FindClosestSurfacePoint(), and TexGen::CYarn::PointInsideYarn().

Member Data Documentation

◆ m_2DSectionMesh

CMesh* TexGen::CSlaveNode::m_2DSectionMesh
protected

Section mesh in 2D.

Definition at line 90 of file SlaveNode.h.

Referenced by UpdateSectionMesh(), and ~CSlaveNode().

◆ m_2DSectionPoints

vector<XY> TexGen::CSlaveNode::m_2DSectionPoints
protected

Coordinates of the cross-section edge points in 2D.

Definition at line 86 of file SlaveNode.h.

Referenced by CSlaveNode(), PopulateTiXmlElement(), and UpdateSectionPoints().

◆ m_Angle

double TexGen::CNode::m_Angle
protectedinherited

Definition at line 74 of file Node.h.

Referenced by TexGen::CNode::CNode(), TexGen::CNode::GetNormal(), and TexGen::CNode::GetSide().

◆ m_iIndex

int TexGen::CSlaveNode::m_iIndex
protected

Index which determines between which master nodes this slave node lies, varies from 0 to number of nodes - 1.

Definition at line 96 of file SlaveNode.h.

Referenced by CSlaveNode(), and PopulateTiXmlElement().

◆ m_Position

XYZ TexGen::CNode::m_Position
protectedinherited

Coordinates representing the position of the node.

Definition at line 69 of file Node.h.

Referenced by TexGen::CNode::CNode(), GetPointOnSection(), TexGen::CNode::Rotate(), TexGen::CNode::Translate(), UpdateSectionMesh(), and UpdateSectionPoints().

◆ m_SectionMesh

CMesh* TexGen::CSlaveNode::m_SectionMesh
protected

Section mesh in 3D.

Definition at line 92 of file SlaveNode.h.

Referenced by Rotate(), Translate(), UpdateSectionMesh(), and ~CSlaveNode().

◆ m_SectionPoints

vector<XYZ> TexGen::CSlaveNode::m_SectionPoints
protected

Coordinates of the cross-section edge points in 3D.

Definition at line 88 of file SlaveNode.h.

Referenced by CSlaveNode(), PopulateTiXmlElement(), Rotate(), Translate(), and UpdateSectionPoints().

◆ m_T

double TexGen::CSlaveNode::m_T
protected

T is the parameter which varies from 0 to 1 which tells us how far along the link the node is.

Definition at line 94 of file SlaveNode.h.

Referenced by CSlaveNode(), operator<(), and PopulateTiXmlElement().

◆ m_Tangent

XYZ TexGen::CNode::m_Tangent
protectedinherited

Unit vector tangent to the yarn path at this node.

Definition at line 71 of file Node.h.

Referenced by TexGen::CNode::CNode(), TexGen::CNode::GetNormal(), TexGen::CNode::GetSide(), TexGen::CNode::ProjectUp(), and TexGen::CNode::Rotate().

◆ m_Up

XYZ TexGen::CNode::m_Up
protectedinherited

Unit vector which represents the up direction (must be perpendicular to m_Tangent)

Definition at line 73 of file Node.h.

Referenced by TexGen::CNode::CNode(), TexGen::CNode::GetNormal(), GetPointOnSection(), TexGen::CNode::GetSide(), TexGen::CNode::ProjectUp(), TexGen::CNode::Rotate(), UpdateSectionMesh(), and UpdateSectionPoints().


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