53 CYarn(TiXmlElement &Element);
62 ALL = LINE | SURFACE | VOLUME,
67 void PopulateTiXmlElement(TiXmlElement &Element,
OUTPUT_TYPE OutputType);
73 void AddNode(
const CNode &Node);
81 bool InsertNode(
const CNode &Node,
const CNode* pBefore);
89 bool InsertNode(
const CNode &Node,
int iIndex);
97 bool ReplaceNode(
int iIndex,
CNode NewNode);
104 bool DeleteNode(
int iIndex);
107 const CNode* GetNode(
int iIndex)
const;
110 void SetNodes(
const vector<CNode> &Nodes);
127 void SetResolution(
int iNumSlaveNodes,
int iNumSectionPoints);
137 bool SetResolution(
int iNumSectionPoints);
146 void SetEquiSpacedSectionMesh(
bool bEquiSpacedSectionMesh);
152 void Rotate(
WXYZ Rotation,
XYZ Origin =
XYZ(0,0,0));
155 void Translate(
XYZ Vector);
158 bool AddAABBToMesh(
CMesh &Mesh)
const;
161 bool AddAABBToMesh(
CMesh &Mesh,
const vector<pair<int, int> > &RepeatLimits)
const;
164 bool AddNodesToMesh(
CMesh &Mesh)
const;
167 bool AddPathToMesh(
CMesh &Mesh)
const;
174 bool AddSurfaceToMesh(
CMesh &Mesh,
bool bAddEndCaps =
true)
const;
182 bool AddSurfaceToMesh(
CMesh &Mesh,
const vector<pair<int, int> > &RepeatLimits)
const;
190 bool AddSurfaceToMesh(
CMesh &Mesh,
const vector<XYZ> &TranslationVectors,
bool bAddEndCaps =
true)
const;
198 bool AddSurfaceToMesh(
CMesh &Mesh,
const CDomain &Domain,
bool bAddEndCaps =
true,
bool bFillGaps =
true)
const;
206 bool AddSurfaceToMesh(
CMesh &Mesh,
const CDomain &Domain, vector<CMesh> &DomainMeshes )
const;
212 bool AddVolumeToMesh(
CMesh &Mesh)
const;
220 bool AddVolumeToMesh(
CMesh &Mesh,
const vector<pair<int, int> > &RepeatLimits)
const;
227 bool AddVolumeToMesh(
CMesh &Mesh,
const vector<XYZ> &TranslationVectors)
const;
234 bool AddVolumeToMesh(
CMesh &Mesh,
const CDomain &Domain)
const;
240 bool AddCentrePlaneToMesh(
CMesh &Mesh)
const;
247 bool AddCentrePlaneToMesh(
CMesh &Mesh,
const vector<XYZ> &TranslationVectors)
const;
254 bool AddCentrePlaneToMesh(
CMesh &Mesh,
const CDomain &Domain)
const;
257 void AddRepeat(
XYZ Repeat);
263 void SetRepeats(
const vector<XYZ> &Repeats);
270 bool RepeatMatchesEnds(
XYZ Repeat)
const;
273 void ClearMasterNodeOrientations();
281 bool PointInsideYarn(
const XYZ &Point,
XYZ *pTangent =
NULL,
XY *pLoc =
NULL,
double *pVolumeFraction =
NULL,
double* pDistanceToSurface =
NULL,
double dTolerance = 1e-9,
XYZ *pOrientation =
NULL,
XYZ *pUp =
NULL,
bool bSurface =
false )
const;
295 bool PointInsideYarn(
const XYZ &Point,
const vector<XYZ> &Translations,
XYZ *pTangent =
NULL,
XY* pLoc =
NULL,
double* pVolumeFraction =
NULL,
double* pDistanceToSurface =
NULL,
double dTolerance = 1e-9,
XYZ *pOrientation =
NULL,
XYZ *pUp =
NULL,
bool bSurface =
false)
const;
303 bool FindPlaneContainingPoint(
const XYZ &Point,
double &u,
double dTolerance,
int iSeg)
const;
314 double FindClosestSurfacePoint(
const XYZ &Point,
XYZ &SurfacePoint,
int iNumSectionPoints,
double dTolerance = 1e-9);
326 bool FindClosestSurfacePoint(
const XYZ &Point,
const vector<XYZ> &Translations,
XYZ &SurfacePoint,
int iNumSectionPoints,
double dTolerance = 1e-9);
336 void StraightenYarn(
double dStraightness = 1);
339 pair<XYZ, XYZ> GetAABB()
const;
342 pair<XYZ, XYZ> GetSectionAABB(
int iIndex)
const;
348 double GetRawYarnLength()
const;
354 double GetRawYarnSectionLength(
int iIndex)
const;
360 double GetRawYarnVolume()
const;
368 double GetRawRepeatArea()
const;
371 vector<double> GetYarnSectionLengths()
const;
380 const vector<CSlaveNode> &GetSlaveNodes(BUILD_TYPE Usage)
const;
389 double GetRealYarnLength(
string Units =
"m")
const;
397 double GetYarnLengthPerUnitArea(
string Units =
"/m")
const;
405 double GetRealYarnVolume(
string Units =
"m^3")
const;
415 double GetYarnVolumePerUnitArea(
string Units =
"m")
const;
421 double GetFibreVolume(
string Units =
"m^3")
const;
428 double GetFibreVolumePerUnitArea(
string Units =
"m")
const;
434 double GetFibreYarnVolumeFraction()
const;
444 bool ConvertToInterpNodes();
479 bool BuildYarnIfNeeded(
int iBuildType)
const;
481 bool BuildSlaveNodes()
const;
482 bool BuildSections()
const;
483 bool BuildSectionMeshes()
const;
486 void AddEndCapsToMesh(
CMesh &Mesh)
const;
489 void CreateSectionAABBs()
const;
492 void SetParent(
const CTextile *pParent);
505 double FindClosestEdgeDistance(
XY &Loc,
const vector<XY> &SectionPoints,
double dTolerance )
const;
543 void AssignDefaults();
Abstract base class representing the domain in which a textile cell may lie.
Abstract base class that defines how the fibres are distributed within a yarn.
Abstract base class for describing the yarn path interpolations.
Defines the nodes and elements of a surface or volume mesh.
ELEMENT_TYPE
Each element type is represented by a unique integer value.
Represents a point on the centreline of a yarn.
Object container to help handle memory management issues.
Class to store properties related to a textile.
Represents a textile cell containing yarns.
Weak pointer that acts as normal pointer except when copied.
Represents a yarn consisting of master nodes, section and interpolation function.
bool m_bEquiSpacedSectionMesh
Whether or not volume meshes of the yarn should be equispaced.
vector< XYZ > m_Repeats
List of infinite repeat vectors, yarns will be repeated to infinite displaced by the specified vector...
CWeakPointer< const CTextile > m_pParent
Stores a pointer to the CTextile it belongs to.
const CInterpolation * GetInterpolation() const
vector< CNode > m_MasterNodes
Ordered list of nodes belonging to this Yarn.
int m_iNumSlaveNodes
Number of slave nodes to create.
int m_iNeedsBuilding
Variable used to keep track of wether the yarn needs to be rebuilt or not and what part needs rebuild...
CObjectContainer< CInterpolation > m_pInterpolation
Interpolation applied to smooth the yarn paths.
vector< double > m_SectionLengths
The length of each of the sections in the yarn.
const CFibreDistribution * GetFibreDistribution() const
CObjectContainer< CYarnSection > m_pYarnSection
Section applied to this yarn, with possibility of a varying cross-section.
int GetNumSlaveNodes() const
Get number of slave nodes.
vector< pair< XYZ, XYZ > > m_SectionAABBs
An axis aligned bounding box containing each section of the yarn.
const CYarnSection * GetYarnSection() const
CObjectContainer< CFibreDistribution > m_pFibreDistribution
Fibre distribution given to the yarn, used for getting Fibre Volume Fraction.
pair< XYZ, XYZ > m_AABB
An axis aligned bounding box containing the full unrepeated yarn.
const vector< XYZ > & GetRepeats() const
vector< CSlaveNode > m_SlaveNodes
Ordered list of interpolated slave nodes belonging to this Yarn.
int m_iNumSectionPoints
Number of section points to create.
const vector< CNode > & GetMasterNodes() const
vector< double > GetSectionLengths() const
int GetNumSectionPoints() const
Get number of section points.
Abstract base class used to define the sections along the length of a yarn.
Namespace containing a series of customised math operations not found in the standard c++ library.
Struct for representing a quaternion.
Struct for representing points in 2D space.
Struct for representing points in 3D space.