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

Represents a point on the centreline of a yarn. More...

#include <Node.h>

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

Public Member Functions

 CNode (XYZ Position=XYZ(), XYZ Tangent=XYZ(), XYZ Up=XYZ(0, 0, 1), double Angle=0.0)
 Create a node. More...
 
 CNode (TiXmlElement &Element)
 
virtual ~CNode (void)
 
virtual void PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType) const
 Used for saving data to XML. More...
 
virtual void Rotate (WXYZ Rotation, XYZ Origin=XYZ(0, 0, 0))
 Rotate the Node by given quaternion. More...
 
virtual void Translate (XYZ Vector)
 Translate the Node by given vector. 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

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

Represents a point on the centreline of a yarn.

Definition at line 27 of file Node.h.

Constructor & Destructor Documentation

◆ CNode() [1/2]

CNode::CNode ( XYZ  Position = XYZ(),
XYZ  Tangent = XYZ(),
XYZ  Up = XYZ(0, 0, 1),
double  Angle = 0.0 
)

Create a node.

Parameters
PositionPosition of the node
TangentTangent of the node
UpUp vector of the node

Definition at line 24 of file Node.cpp.

References TexGen::GetLength(), m_Tangent, and m_Up.

◆ CNode() [2/2]

CNode::CNode ( TiXmlElement &  Element)

Definition at line 43 of file Node.cpp.

References m_Angle, m_Position, m_Tangent, and m_Up.

◆ ~CNode()

CNode::~CNode ( void  )
virtual

Definition at line 39 of file Node.cpp.

Member Function Documentation

◆ GetAngle()

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

◆ GetNormal()

XYZ CNode::GetNormal ( ) const

Definition at line 94 of file Node.cpp.

References m_Angle, m_Tangent, and m_Up.

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

◆ GetPosition()

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

◆ GetSide()

XYZ CNode::GetSide ( ) const

◆ GetTangent()

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

◆ GetUp()

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

◆ PopulateTiXmlElement()

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

Used for saving data to XML.

Reimplemented in TexGen::CSlaveNode.

Definition at line 51 of file Node.cpp.

References GetAngle(), GetPosition(), GetTangent(), GetUp(), and TexGen::stringify().

Referenced by TexGen::CSlaveNode::PopulateTiXmlElement().

◆ ProjectUp()

void CNode::ProjectUp ( )

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(), m_Tangent, m_Up, TexGen::Normalise(), and TGERROR.

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

◆ Rotate()

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

Rotate the Node by given quaternion.

Definition at line 59 of file Node.cpp.

References m_Position, m_Tangent, and m_Up.

Referenced by TexGen::CSlaveNode::Rotate().

◆ SetAngle()

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

Definition at line 65 of file Node.h.

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

◆ SetPosition()

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

◆ SetTangent()

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

Definition at line 63 of file Node.h.

◆ SetUp()

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

Definition at line 64 of file Node.h.

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

◆ Translate()

void CNode::Translate ( XYZ  Vector)
virtual

Translate the Node by given vector.

Reimplemented in TexGen::CSlaveNode.

Definition at line 66 of file Node.cpp.

References m_Position.

Referenced by TexGen::CSlaveNode::Translate().

Member Data Documentation

◆ m_Angle

double TexGen::CNode::m_Angle
protected

Definition at line 74 of file Node.h.

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

◆ m_Position

XYZ TexGen::CNode::m_Position
protected

Coordinates representing the position of the node.

Definition at line 69 of file Node.h.

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

◆ m_Tangent

XYZ TexGen::CNode::m_Tangent
protected

Unit vector tangent to the yarn path at this node.

Definition at line 71 of file Node.h.

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

◆ m_Up

XYZ TexGen::CNode::m_Up
protected

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

Definition at line 73 of file Node.h.

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


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