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

Domain implementation described using extrusion of a polygon outline. More...

#include <DomainPrism.h>

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

Public Member Functions

 CDomainPrism (const vector< XY > &Points, XYZ &start, XYZ &end)
 Constructor. More...
 
 CDomainPrism (TiXmlElement &Element)
 
 ~CDomainPrism (void)
 
CDomainCopy () const
 
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...
 
void ClipMeshToDomain (CMesh &Mesh, bool bFillGaps=true) const
 
void ClipIntersectMeshToDomain (CMesh &Mesh, bool bFillGaps=true) const
 
bool ClipMeshToDomain (CMesh &Mesh, vector< CMesh > &DomainMeshes, bool bFillGaps=true) const
 Clip the surface elements to the domain. More...
 
bool ClipIntersectMeshToDomain (CMesh &Mesh, vector< CMesh > &DomainMeshes, bool bFillGaps) const
 
string GetType () const
 Derived class should return the class name. More...
 
const vector< XY > & GetPoints () const
 
void Grow (double dDistance)
 Move all the planes by given distance along their normal. More...
 
void Rotate (WXYZ Rotation)
 Rotate the domain by given rotation quaternion. More...
 
void Translate (XYZ Vector)
 Translate the domain by given vector. More...
 
void Deform (CLinearTransformation Transformation)
 Deform the domain by given linear transformation. More...
 
bool PointInDomain (const XYZ &Point) const
 Check if a point lies within the domain. More...
 
void GeneratePlanes ()
 Generate a set of planes corresponding to the mesh elements. More...
 
void GetMeshWithPolygonEnd (CMesh &Mesh)
 
void GetPolygonLimits (XYZ &StartPoint, XYZ *SizeVecs)
 
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...
 
CDomainPrismGetPrismDomain ()
 

Protected Member Functions

void BuildMesh ()
 Get the limits for a single given repeat vector and surface mesh. More...
 
bool GetPlane (XYZ *points, PLANE &plane)
 Generate a plane from a vector of co-planar points. More...
 
void RemoveDuplicatePlanes ()
 Iterate through m_ElementPlanes to remove duplicates. More...
 
bool PlaneEqual (PLANE Plane1, PLANE Plane2)
 Test if both normal and d of two PLANE structures are equal. More...
 
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 bool FillGaps (CMesh &Mesh, const PLANE &Plane, vector< int > &Polygon, bool bMeshGaps=true)
 
static vector< pair< int, int > > ConvertLimitsToInt (const vector< pair< double, double > > &RepeatLimits)
 

Protected Attributes

CYarn m_Yarn
 Create the domain as yarn with constant polygon section and two nodes. More...
 
vector< PLANEm_ElementPlanes
 Planes corresponding to mesh elements. More...
 
vector< XYm_Points
 Prism section points. More...
 
CMesh m_Mesh
 A mesh representing the domain as a surface mesh. More...
 

Detailed Description

Domain implementation described using extrusion of a polygon outline.

Prism is described by a yarn with two nodes (to give the orientation ) and a cross-section defined by a polygon section created using the vector of points given as an input parameter

Definition at line 35 of file DomainPrism.h.

Constructor & Destructor Documentation

◆ CDomainPrism() [1/2]

CDomainPrism::CDomainPrism ( const vector< XY > &  Points,
XYZ start,
XYZ end 
)

Constructor.

Parameters
PointsVector of points defining the cross-section of the prism
startPosition of start node
endPosition of end node

Definition at line 26 of file DomainPrism.cpp.

References TexGen::CYarn::AddNode(), TexGen::CYarn::AssignSection(), BuildMesh(), GeneratePlanes(), m_Yarn, and TexGen::CYarn::SetResolution().

◆ CDomainPrism() [2/2]

CDomainPrism::CDomainPrism ( TiXmlElement &  Element)

◆ ~CDomainPrism()

CDomainPrism::~CDomainPrism ( void  )

Definition at line 42 of file DomainPrism.cpp.

Member Function Documentation

◆ BuildMesh()

void CDomainPrism::BuildMesh ( )
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 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. Populate m_PlaneIntersections and m_Mesh, note this only works for closed domains

Definition at line 67 of file DomainPrism.cpp.

References TexGen::CYarn::AddSurfaceToMesh(), TexGen::CMesh::Clear(), TexGen::CDomain::m_Mesh, m_Yarn, and TexGen::CMesh::MergeNodes().

Referenced by CDomainPrism(), GeneratePlanes(), and GetMeshWithPolygonEnd().

◆ ClipIntersectMeshToDomain() [1/2]

void CDomainPrism::ClipIntersectMeshToDomain ( CMesh Mesh,
bool  bFillGaps = true 
) const

◆ ClipIntersectMeshToDomain() [2/2]

bool CDomainPrism::ClipIntersectMeshToDomain ( CMesh Mesh,
vector< CMesh > &  DomainMeshes,
bool  bFillGaps 
) const

◆ ClipMeshToDomain() [1/2]

void CDomainPrism::ClipMeshToDomain ( CMesh Mesh,
bool  bFillGaps = true 
) const
virtual

Clips a mesh passed to the function to the domain by using the PointInsideYarn function (for the domain 'yarn') Creates intersection mesh of intersecting elements for further testing against each domain plane

Implements TexGen::CDomain.

Definition at line 697 of file DomainPrism.cpp.

References TexGen::CMesh::AddNode(), ClipIntersectMeshToDomain(), TexGen::CMesh::GetIndices(), TexGen::CMesh::GetNode(), TexGen::CMesh::GetNumNodes(), TexGen::CMesh::HEX, TexGen::CMesh::InsertMesh(), m_Yarn, NULL, TexGen::CYarn::PointInsideYarn(), TexGen::CMesh::PYRAMID, TexGen::CMesh::QUAD, TexGen::CMesh::QUADRATIC_TET, TexGen::CMesh::SaveToVTK(), TexGen::CMesh::TET, TGLOGINDENT, TOL, TexGen::CMesh::TRI, and TexGen::CMesh::WEDGE.

◆ ClipMeshToDomain() [2/2]

bool CDomainPrism::ClipMeshToDomain ( CMesh Mesh,
vector< CMesh > &  DomainMeshes,
bool  bFillGaps = true 
) const
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

Implements TexGen::CDomain.

Definition at line 873 of file DomainPrism.cpp.

References TexGen::CMesh::AddNode(), ClipIntersectMeshToDomain(), TexGen::CMesh::GetIndices(), TexGen::CMesh::GetNode(), TexGen::CMesh::GetNumNodes(), TexGen::CMesh::HEX, TexGen::CMesh::InsertMesh(), m_Yarn, NULL, TexGen::CYarn::PointInsideYarn(), TexGen::CMesh::PYRAMID, TexGen::CMesh::QUAD, TexGen::CMesh::QUADRATIC_TET, TexGen::CMesh::SaveToVTK(), TexGen::CMesh::TET, TGLOGINDENT, TOL, TexGen::CMesh::TRI, and TexGen::CMesh::WEDGE.

◆ ConvertLimitsToInt()

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

Definition at line 59 of file Domain.cpp.

Referenced by TexGen::CDomain::GetRepeatLimits().

◆ Copy()

CDomain * TexGen::CDomainPrism::Copy ( ) const
inlinevirtual

Implements TexGen::CDomain.

Definition at line 48 of file DomainPrism.h.

◆ Deform()

void TexGen::CDomainPrism::Deform ( CLinearTransformation  Transformation)
inlinevirtual

Deform the domain by given linear transformation.

Implements TexGen::CDomain.

Definition at line 79 of file DomainPrism.h.

◆ FillGaps()

bool CDomainPrism::FillGaps ( CMesh Mesh,
const PLANE Plane,
vector< int > &  Polygon,
bool  bMeshGaps = true 
)
staticprotected

Given a mesh and a plane, the holes found in the plane will be filled with triangles Intersection of mesh and plane returned as closed loop

Definition at line 1051 of file DomainPrism.cpp.

References TexGen::PLANE::d, TexGen::DotProduct(), TexGen::CMesh::GetIndices(), TexGen::CMesh::GetNode(), TexGen::CMesh::MergeNodes(), TexGen::CMesh::MeshClosedLoop(), TexGen::PLANE::Normal, TexGen::CMesh::QUAD, TexGen::CMesh::RemoveDegenerateTriangles(), TGERROR, TGLOG, TOL, and TexGen::CMesh::TRI.

Referenced by ClipIntersectMeshToDomain().

◆ GeneratePlanes()

void CDomainPrism::GeneratePlanes ( )

◆ GetLimits()

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

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(), TexGen::CDomain::m_Mesh, TexGen::CMesh::NodesBegin(), and TexGen::CMesh::NodesEnd().

Referenced by TexGen::CDomain::GetRepeatLimits().

◆ GetMesh()

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

◆ GetMeshWithPolygonEnd()

void CDomainPrism::GetMeshWithPolygonEnd ( CMesh Mesh)

◆ GetPlane()

bool CDomainPrism::GetPlane ( XYZ points,
PLANE plane 
)
protected

Generate a plane from a vector of co-planar points.

Definition at line 152 of file DomainPrism.cpp.

References TexGen::CrossProduct(), TexGen::PLANE::d, TexGen::DotProduct(), TexGen::GetLength(), TexGen::PLANE::Normal, and TexGen::Normalise().

Referenced by GeneratePlanes().

◆ GetPoints()

const vector< XY > & TexGen::CDomainPrism::GetPoints ( ) const
inline

Definition at line 70 of file DomainPrism.h.

Referenced by TexGen::CPrismVoxelMesh::GetElementMap().

◆ GetPolygonLimits()

void CDomainPrism::GetPolygonLimits ( XYZ StartPoint,
XYZ SizeVecs 
)

◆ GetPrismDomain()

CDomainPrism * CDomain::GetPrismDomain ( )
inherited

◆ GetRepeatLimits()

vector< pair< int, int > > TexGen::CDomainPrism::GetRepeatLimits ( const CYarn Yarn) const
inline

Get a vector of repeat limits for a given yarn. The number of limit pairs is the same as the number of infinite repeats in the yarn.

Definition at line 54 of file DomainPrism.h.

◆ GetTranslations()

vector< XYZ > TexGen::CDomainPrism::GetTranslations ( const CYarn Yarn) const
inline

Get the translation vectors necessary to fully fill the domain.

Definition at line 56 of file DomainPrism.h.

◆ GetType()

string TexGen::CDomainPrism::GetType ( ) const
inlinevirtual

Derived class should return the class name.

Implements TexGen::CDomain.

Definition at line 68 of file DomainPrism.h.

◆ GetVolume()

double CDomain::GetVolume ( ) const
virtualinherited

Get the volume of the domain.

Definition at line 70 of file Domain.cpp.

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

◆ Grow()

void TexGen::CDomainPrism::Grow ( double  dDistance)
inlinevirtual

Move all the planes by given distance along their normal.

Implements TexGen::CDomain.

Definition at line 73 of file DomainPrism.h.

◆ MeshIntersectsDomain()

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

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 TexGen::CDomain::m_Mesh.

Referenced by TexGen::CDomain::GetTranslations().

◆ PlaneEqual()

bool CDomainPrism::PlaneEqual ( PLANE  Plane1,
PLANE  Plane2 
)
protected

Test if both normal and d of two PLANE structures are equal.

Definition at line 183 of file DomainPrism.cpp.

References TexGen::PLANE::d, TexGen::GetLength(), and TexGen::PLANE::Normal.

Referenced by RemoveDuplicatePlanes().

◆ PointInDomain()

bool TexGen::CDomainPrism::PointInDomain ( const XYZ Point) const
inlinevirtual

Check if a point lies within the domain.

Implements TexGen::CDomain.

Definition at line 82 of file DomainPrism.h.

◆ PopulateTiXmlElement()

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

Used for saving data to XML.

Reimplemented from TexGen::CDomain.

Definition at line 59 of file DomainPrism.cpp.

References m_Yarn, TexGen::CYarn::PopulateTiXmlElement(), and TexGen::CDomain::PopulateTiXmlElement().

◆ RemoveDuplicatePlanes()

void CDomainPrism::RemoveDuplicatePlanes ( )
protected

Iterate through m_ElementPlanes to remove duplicates.

Definition at line 165 of file DomainPrism.cpp.

References m_ElementPlanes, and PlaneEqual().

Referenced by GeneratePlanes().

◆ Rotate()

void TexGen::CDomainPrism::Rotate ( WXYZ  Rotation)
inlinevirtual

Rotate the domain by given rotation quaternion.

Implements TexGen::CDomain.

Definition at line 75 of file DomainPrism.h.

◆ Translate()

void TexGen::CDomainPrism::Translate ( XYZ  Vector)
inlinevirtual

Translate the domain by given vector.

Implements TexGen::CDomain.

Definition at line 77 of file DomainPrism.h.

Member Data Documentation

◆ m_ElementPlanes

vector<PLANE> TexGen::CDomainPrism::m_ElementPlanes
protected

Planes corresponding to mesh elements.

Definition at line 127 of file DomainPrism.h.

Referenced by ClipIntersectMeshToDomain(), GeneratePlanes(), and RemoveDuplicatePlanes().

◆ m_Mesh

CMesh TexGen::CDomain::m_Mesh
protectedinherited

◆ m_Points

vector<XY> TexGen::CDomainPrism::m_Points
mutableprotected

Prism section points.

Definition at line 130 of file DomainPrism.h.

Referenced by GetMeshWithPolygonEnd(), and GetPolygonLimits().

◆ m_Yarn

CYarn TexGen::CDomainPrism::m_Yarn
mutableprotected

Create the domain as yarn with constant polygon section and two nodes.

Definition at line 124 of file DomainPrism.h.

Referenced by BuildMesh(), CDomainPrism(), ClipMeshToDomain(), GetPolygonLimits(), and PopulateTiXmlElement().


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