24CSlaveNode::CSlaveNode(
XYZ Position,
XYZ Tangent,
XYZ Up)
25:
CNode(Position, Tangent, Up)
46 Element.Attribute(
"T", &
m_T);
47 Element.Attribute(
"Index", &
m_iIndex);
54 m_SectionPoints.push_back(valueify<XYZ>(pSectionPoint->Attribute(
"value")));
72 Element.SetAttribute(
"Index",
m_iIndex);
73 vector<XY>::const_iterator itXY;
76 TiXmlElement SectionPoint2D(
"SectionPoint2D");
77 SectionPoint2D.SetAttribute(
"value",
stringify(*itXY));
78 Element.InsertEndChild(SectionPoint2D);
80 vector<XYZ>::const_iterator itXYZ;
83 TiXmlElement SectionPoint(
"SectionPoint");
84 SectionPoint.SetAttribute(
"value",
stringify(*itXYZ));
85 Element.InsertEndChild(SectionPoint);
102 vector<XY>::iterator it2DSectionPoint;
108 Pos = Side * it2DSectionPoint->
x;
109 Pos +=
m_Up * it2DSectionPoint->
y;
119 vector<XY>::const_iterator it2DSectionPoint;
124 Pos = Side * p2DSectionPoint.
x;
125 Pos +=
m_Up * p2DSectionPoint.
y;
148 vector<XYZ>::iterator itNode;
153 for (itNode = MeshNodes2D.begin(); itNode != MeshNodes2D.end(); ++itNode)
156 Pos = Side * itNode->
x;
157 Pos +=
m_Up * itNode->
y;
172 vector<XYZ>::iterator itSectionPoint;
175 (*itSectionPoint) = Rotation * (*itSectionPoint);
183 vector<XYZ>::iterator itSectionPoint;
186 (*itSectionPoint) += Vector;
#define FOR_EACH_TIXMLELEMENT(CHILDELEMENT, PARENTELEMENT, ELEMENTNAME)
Macro to enable looping over tinyxml easier.
Defines the nodes and elements of a surface or volume mesh.
const vector< XYZ > & GetNodes() const
Get a const reference to the nodes.
const int AddNode(XYZ Node)
Append a node to the list of nodes, the integer returns the index of the node
void Translate(XYZ Vector)
Translate whole mesh by given vector.
const list< int > & GetIndices(ELEMENT_TYPE ElemType) const
Get the element indices of a given element type.
ELEMENT_TYPE
Each element type is represented by a unique integer value.
void Clear()
Empty mesh nodes and indices.
void Rotate(WXYZ Rotation, XYZ Origin=XYZ(0, 0, 0))
Rotate the whole mesh by given quaternion.
Represents a point on the centreline of a yarn.
XYZ m_Up
Unit vector which represents the up direction (must be perpendicular to m_Tangent)
virtual void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const
Used for saving data to XML.
virtual void Translate(XYZ Vector)
Translate the Node by given vector.
XYZ m_Position
Coordinates representing the position of the node.
XYZ GetSide() const
Get the side vector.
virtual void Rotate(WXYZ Rotation, XYZ Origin=XYZ(0, 0, 0))
Rotate the Node by given quaternion.
void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const
Used for saving data to XML.
void UpdateSectionMesh(const CMesh *p2DSectionMesh=NULL)
Populate m_SectionMesh from m_2DSectionMesh, Setting m_2DSectionMesh at the same time.
XYZ GetPointOnSection(const XY &p2DSectionPoints)
Calculate the 3D coordinates of a point on the cross-section.
CMesh * m_SectionMesh
Section mesh in 3D.
CMesh * m_2DSectionMesh
Section mesh in 2D.
vector< XYZ > m_SectionPoints
Coordinates of the cross-section edge points in 3D.
double m_T
T is the parameter which varies from 0 to 1 which tells us how far along the link the node is.
void Rotate(WXYZ Rotation)
Rotate the Node by given quaternion.
vector< XY > m_2DSectionPoints
Coordinates of the cross-section edge points in 2D.
CSlaveNode(XYZ Position=XYZ(), XYZ Tangent=XYZ(), XYZ Up=XYZ())
int m_iIndex
Index which determines between which master nodes this slave node lies, varies from 0 to number of no...
void Translate(XYZ Vector)
Translate the Node by given vector.
void UpdateSectionPoints(const vector< XY > *p2DSectionPoints=NULL)
Populate m_SectionPoints from m_2DSectionPoints, Setting m_2DSectionPoints at the same time.
Namespace containing a series of customised math operations not found in the standard c++ library.
std::string stringify(const T &x, int iPrecision=12, bool bScientific=true)
Function to convert a value (e.g. int, double, etc...) to a string.
Struct for representing a quaternion.
Struct for representing points in 2D space.
Struct for representing points in 3D space.