TexGen
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
TexGen::CDomain Class Referenceabstract

Abstract base class representing the domain in which a textile cell may lie. More...

#include <Domain.h>

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

Public Member Functions

 CDomain (void)
 
 CDomain (TiXmlElement &Element)
 
virtual ~CDomain (void)
 
virtual CDomainCopy () const =0
 
virtual void PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType=OUTPUT_STANDARD) const
 Used for saving data to XML. More...
 
vector< pair< int, int > > GetRepeatLimits (const CYarn &Yarn) const
 
vector< XYZGetTranslations (const CYarn &Yarn) const
 Get the translation vectors necessary to fully fill the domain. More...
 
virtual void ClipMeshToDomain (CMesh &Mesh, bool bFillGaps=true) const =0
 Clip the surface elements to the domain. More...
 
virtual bool ClipMeshToDomain (CMesh &Mesh, vector< CMesh > &DomainMeshes, bool bFillGaps=true) const =0
 Clip the surface elements to the domain. More...
 
virtual string GetType () const =0
 Derived class should return the class name. More...
 
const CMeshGetMesh () const
 Get the mesh representing the domain as a surface mesh. More...
 
virtual double GetVolume () const
 Get the volume of the domain. More...
 
virtual void Grow (double dDistance)=0
 Make the domain larger (used mainly for rendering purposes) More...
 
virtual void Rotate (WXYZ Rotation)=0
 Rotate the domain by given rotation quaternion. More...
 
virtual void Translate (XYZ Vector)=0
 Translate the domain by given vector. More...
 
virtual void Deform (CLinearTransformation Transformation)=0
 Deform the domain by given linear transformation. More...
 
virtual bool PointInDomain (const XYZ &Point) const =0
 Check if a point lies inside the domain. More...
 
CDomainPrismGetPrismDomain ()
 

Protected Member Functions

pair< double, double > GetLimits (XYZ RepeatVector, const CMesh &Mesh) const
 Get the limits for a single given repeat vector and surface mesh. More...
 
bool MeshIntersectsDomain (const CMesh &Mesh) const
 Determine if a mesh intersects with the domain. More...
 

Static Protected Member Functions

static vector< pair< int, int > > ConvertLimitsToInt (const vector< pair< double, double > > &RepeatLimits)
 

Protected Attributes

CMesh m_Mesh
 A mesh representing the domain as a surface mesh. More...
 

Detailed Description

Abstract base class representing the domain in which a textile cell may lie.

Definition at line 33 of file Domain.h.

Constructor & Destructor Documentation

◆ CDomain() [1/2]

CDomain::CDomain ( void  )

Definition at line 26 of file Domain.cpp.

◆ CDomain() [2/2]

CDomain::CDomain ( TiXmlElement &  Element)

Definition at line 34 of file Domain.cpp.

References m_Mesh.

◆ ~CDomain()

CDomain::~CDomain ( void  )
virtual

Definition at line 30 of file Domain.cpp.

Member Function Documentation

◆ ClipMeshToDomain() [1/2]

virtual void TexGen::CDomain::ClipMeshToDomain ( CMesh Mesh,
bool  bFillGaps = true 
) const
pure virtual

Clip the surface elements to the domain.

For surface elements (TRI and QUAD elements) the elements will be either kept, discarded or trimmed depending on their location relative to the domain. For volume elements (TET, HEX) the elements will be either kept or discarded. No trimming occurs in this case to avoid poorly shaped elements. The center of the element is used to determine whether the element should be kept or discarded. For certain finite element analyses simulations can be performed without any trimming.

Parameters
MeshThe mesh instance to be clipped, this will be modified in place
bFillGapsIf set to true the resulting holes will be filled with a triangulated mesh

Implemented in TexGen::CDomainPlanes, and TexGen::CDomainPrism.

Referenced by TexGen::CYarn::AddCentrePlaneToMesh(), TexGen::CYarn::AddSurfaceToMesh(), and TexGen::CYarn::AddVolumeToMesh().

◆ ClipMeshToDomain() [2/2]

virtual bool TexGen::CDomain::ClipMeshToDomain ( CMesh Mesh,
vector< CMesh > &  DomainMeshes,
bool  bFillGaps = true 
) const
pure virtual

Clip the surface elements to the domain.

Parameters
MeshThe mesh instance to be clipped, this will be modified in place
DomainMeshesOne mesh for each plane which domain/mesh intersection polygons are added
bFillGapsIf set to true the resulting holes will be filled with a triangulated mesh

Implemented in TexGen::CDomainPlanes, and TexGen::CDomainPrism.

◆ ConvertLimitsToInt()

vector< pair< int, int > > CDomain::ConvertLimitsToInt ( const vector< pair< double, double > > &  RepeatLimits)
staticprotected

Definition at line 59 of file Domain.cpp.

Referenced by GetRepeatLimits().

◆ Copy()

virtual CDomain * TexGen::CDomain::Copy ( ) const
pure virtual

◆ Deform()

virtual void TexGen::CDomain::Deform ( CLinearTransformation  Transformation)
pure virtual

Deform the domain by given linear transformation.

Implemented in TexGen::CDomainPlanes, and TexGen::CDomainPrism.

Referenced by TexGen::CTextileDeformer::DeformTextile().

◆ GetLimits()

pair< double, double > CDomain::GetLimits ( XYZ  RepeatVector,
const CMesh Mesh 
) const
protected

Get the limits for a single given repeat vector and surface mesh.

The limits are the points where the whole surface mesh lies outside the domain The limit is represented as the factor multiplied by the repeat vector that represents the translation of the surface mesh to the limiting case.

Parameters
RepeatVectorThe repeat vector to get limit for
MeshThe surface mesh that needs to lie behind the plane
Returns
A pair of doubles representing the upper and lower limits

Definition at line 108 of file Domain.cpp.

References TexGen::DotProduct(), TexGen::GetLength(), TexGen::CMesh::GetNodes(), m_Mesh, TexGen::CMesh::NodesBegin(), and TexGen::CMesh::NodesEnd().

Referenced by GetRepeatLimits().

◆ GetMesh()

const CMesh & TexGen::CDomain::GetMesh ( ) const
inline

◆ GetPrismDomain()

CDomainPrism * CDomain::GetPrismDomain ( )

◆ GetRepeatLimits()

vector< pair< int, int > > CDomain::GetRepeatLimits ( const CYarn Yarn) const

Get the limits associated with each repeat vector, that is the upper and lower bounds multiplied to the repeat vector for the entire yarn to lie just outside out of the domain

Definition at line 148 of file Domain.cpp.

References TexGen::CYarn::AddAABBToMesh(), ConvertLimitsToInt(), GetLimits(), TexGen::CYarn::GetRepeats(), and TGERROR.

Referenced by TexGen::CExporter::ConvertYarn(), and GetTranslations().

◆ GetTranslations()

vector< XYZ > CDomain::GetTranslations ( const CYarn Yarn) const

◆ GetType()

virtual string TexGen::CDomain::GetType ( ) const
pure virtual

◆ GetVolume()

double CDomain::GetVolume ( ) const
virtual

Get the volume of the domain.

Definition at line 70 of file Domain.cpp.

References TexGen::CMesh::CalculateVolume(), and m_Mesh.

◆ Grow()

virtual void TexGen::CDomain::Grow ( double  dDistance)
pure virtual

Make the domain larger (used mainly for rendering purposes)

Implemented in TexGen::CDomainPlanes, and TexGen::CDomainPrism.

Referenced by TexGen::CTexGenRenderer::RenderDomain().

◆ MeshIntersectsDomain()

bool CDomain::MeshIntersectsDomain ( const CMesh Mesh) const
protected

Determine if a mesh intersects with the domain.

This is a very crude approximation of whether a mesh intersects the domain or not. It is based soley on the axis aligned bounding boxes of the two regions.

Definition at line 75 of file Domain.cpp.

References TexGen::BoundingBoxIntersect(), TexGen::CMesh::GetAABB(), and m_Mesh.

Referenced by GetTranslations().

◆ PointInDomain()

virtual bool TexGen::CDomain::PointInDomain ( const XYZ Point) const
pure virtual

Check if a point lies inside the domain.

Implemented in TexGen::CDomainPlanes, and TexGen::CDomainPrism.

◆ PopulateTiXmlElement()

void CDomain::PopulateTiXmlElement ( TiXmlElement &  Element,
OUTPUT_TYPE  OutputType = OUTPUT_STANDARD 
) const
virtual

◆ Rotate()

virtual void TexGen::CDomain::Rotate ( WXYZ  Rotation)
pure virtual

Rotate the domain by given rotation quaternion.

Implemented in TexGen::CDomainPlanes, and TexGen::CDomainPrism.

◆ Translate()

virtual void TexGen::CDomain::Translate ( XYZ  Vector)
pure virtual

Translate the domain by given vector.

Implemented in TexGen::CDomainPlanes, and TexGen::CDomainPrism.

Member Data Documentation

◆ m_Mesh

CMesh TexGen::CDomain::m_Mesh
protected

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