TexGen
|
Domain implementation described using extrusion of a polygon outline. More...
#include <DomainPrism.h>
Public Member Functions | |
CDomainPrism (const vector< XY > &Points, XYZ &start, XYZ &end) | |
Constructor. More... | |
CDomainPrism (TiXmlElement &Element) | |
~CDomainPrism (void) | |
CDomain * | Copy () 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< XYZ > | GetTranslations (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 CMesh & | GetMesh () const |
Get the mesh representing the domain as a surface mesh. More... | |
virtual double | GetVolume () const |
Get the volume of the domain. More... | |
CDomainPrism * | GetPrismDomain () |
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< PLANE > | m_ElementPlanes |
Planes corresponding to mesh elements. More... | |
vector< XY > | m_Points |
Prism section points. More... | |
CMesh | m_Mesh |
A mesh representing the domain as a surface mesh. More... | |
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.
Points | Vector of points defining the cross-section of the prism |
start | Position of start node |
end | Position 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::CDomainPrism | ( | TiXmlElement & | Element | ) |
Definition at line 46 of file DomainPrism.cpp.
References BuildMesh(), GeneratePlanes(), TexGen::CMesh::GetNumNodes(), TexGen::CDomain::m_Mesh, and m_Yarn.
CDomainPrism::~CDomainPrism | ( | void | ) |
Definition at line 42 of file DomainPrism.cpp.
|
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.
RepeatVector | The repeat vector to get limit for |
Mesh | The surface mesh that needs to lie behind the plane |
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().
void CDomainPrism::ClipIntersectMeshToDomain | ( | CMesh & | Mesh, |
bool | bFillGaps = true |
||
) | const |
Clip mesh elements which are known to intersect with the domain Checks each mesh element against each domain plane
Definition at line 192 of file DomainPrism.cpp.
References TexGen::CMesh::AddNode(), TexGen::CMesh::ConvertQuadtoTriangles(), TexGen::DotProduct(), FillGaps(), TexGen::CMesh::GetIndices(), TexGen::CMesh::GetNode(), TexGen::CMesh::GetNumNodes(), m_ElementPlanes, TexGen::CMesh::QUAD, TexGen::CMesh::RemoveUnreferencedNodes(), TGLOGINDENT, TOL, and TexGen::CMesh::TRI.
Referenced by ClipMeshToDomain().
bool CDomainPrism::ClipIntersectMeshToDomain | ( | CMesh & | Mesh, |
vector< CMesh > & | DomainMeshes, | ||
bool | bFillGaps | ||
) | const |
Definition at line 419 of file DomainPrism.cpp.
References TexGen::CMesh::AddNode(), TexGen::CMesh::ConvertQuadtoTriangles(), TexGen::CrossProduct(), TexGen::DotProduct(), FillGaps(), TexGen::CMesh::GetIndices(), TexGen::CMesh::GetNode(), TexGen::CMesh::GetNumNodes(), m_ElementPlanes, TexGen::CMesh::POLYGON, TexGen::CMesh::QUAD, TexGen::CMesh::RemoveUnreferencedNodes(), TGLOGINDENT, TOL, and TexGen::CMesh::TRI.
|
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.
|
virtual |
Clip the surface elements to the domain.
Mesh | The mesh instance to be clipped, this will be modified in place |
DomainMeshes | One mesh for each plane which domain/mesh intersection polygons are added |
bFillGaps | If 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.
|
staticprotectedinherited |
Definition at line 59 of file Domain.cpp.
Referenced by TexGen::CDomain::GetRepeatLimits().
|
inlinevirtual |
Implements TexGen::CDomain.
Definition at line 48 of file DomainPrism.h.
|
inlinevirtual |
Deform the domain by given linear transformation.
Implements TexGen::CDomain.
Definition at line 79 of file DomainPrism.h.
|
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().
void CDomainPrism::GeneratePlanes | ( | ) |
Generate a set of planes corresponding to the mesh elements.
Definition at line 76 of file DomainPrism.cpp.
References BuildMesh(), TexGen::CMesh::GetIndices(), TexGen::CMesh::GetNode(), TexGen::CMesh::GetNumNodes(), GetPlane(), m_ElementPlanes, TexGen::CDomain::m_Mesh, TexGen::CMesh::POLYGON, TexGen::CMesh::QUAD, RemoveDuplicatePlanes(), and TexGen::CMesh::TRI.
Referenced by CDomainPrism().
|
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.
RepeatVector | The repeat vector to get limit for |
Mesh | The surface mesh that needs to lie behind the plane |
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().
|
inlineinherited |
Get the mesh representing the domain as a surface mesh.
Definition at line 73 of file Domain.h.
Referenced by TexGen::CRectangularVoxelMesh::CalculateVoxelSizes(), TexGen::CRotatedVoxelMesh::CalculateVoxelSizes(), TexGen::CShearedVoxelMesh::CalculateVoxelSizes(), TexGen::CExporter::ConvertDomain(), TexGen::CBasicVolumes::CreateBasicVolumes(), TexGen::CSimulationAbaqus::CreatePeriodicBoundaries(), TexGen::CGeometrySolver::CreateSystem(), TexGen::CShearedTextileWeave2D::CreateTopAndBottomMeshes(), TexGen::COctreeVoxelMesh::OutputPeriodicBoundaries(), TexGen::CStaggeredVoxelMesh::OutputPeriodicBoundaries(), TexGen::CVoxelMesh::OutputPeriodicBoundaries(), TexGen::CTexGenRenderer::RenderDomain(), TexGen::CTexGenRenderer::RenderDomainAxes(), TexGen::CTexGenRenderer::RenderGrid(), TexGen::CTexGenRenderer::SaveTextileToVTK(), TexGen::CMesher::SaveVolumeMeshToABAQUS(), and TexGen::COctreeVoxelMesh::SaveVoxelMesh().
void CDomainPrism::GetMeshWithPolygonEnd | ( | CMesh & | Mesh | ) |
Definition at line 1339 of file DomainPrism.cpp.
References TexGen::CMesh::AddElement(), BuildMesh(), TexGen::CMesh::GetNumNodes(), TexGen::CDomain::m_Mesh, m_Points, TexGen::CMesh::POLYGON, TexGen::CMesh::RemoveElementType(), and TexGen::CMesh::TRI.
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().
|
inline |
Definition at line 70 of file DomainPrism.h.
Referenced by TexGen::CPrismVoxelMesh::GetElementMap().
Definition at line 1302 of file DomainPrism.cpp.
References TexGen::GetMinMaxXY(), TexGen::CYarn::GetNode(), TexGen::CNode::GetPosition(), TexGen::CYarn::GetSlaveNodes(), m_Points, m_Yarn, TexGen::CYarn::SURFACE, TexGen::XYZ::x, TexGen::XY::x, TexGen::XYZ::y, and TexGen::XY::y.
Referenced by TexGen::CPrismVoxelMesh::CalculateVoxelSizes().
|
inherited |
Definition at line 54 of file Domain.cpp.
Referenced by TexGen::CPrismVoxelMesh::CalculateVoxelSizes(), and TexGen::CPrismVoxelMesh::GetElementMap().
|
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.
Get the translation vectors necessary to fully fill the domain.
Definition at line 56 of file DomainPrism.h.
|
inlinevirtual |
Derived class should return the class name.
Implements TexGen::CDomain.
Definition at line 68 of file DomainPrism.h.
|
virtualinherited |
Get the volume of the domain.
Definition at line 70 of file Domain.cpp.
References TexGen::CMesh::CalculateVolume(), and TexGen::CDomain::m_Mesh.
|
inlinevirtual |
Move all the planes by given distance along their normal.
Implements TexGen::CDomain.
Definition at line 73 of file DomainPrism.h.
|
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().
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().
|
inlinevirtual |
Check if a point lies within the domain.
Implements TexGen::CDomain.
Definition at line 82 of file DomainPrism.h.
|
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().
|
protected |
Iterate through m_ElementPlanes to remove duplicates.
Definition at line 165 of file DomainPrism.cpp.
References m_ElementPlanes, and PlaneEqual().
Referenced by GeneratePlanes().
|
inlinevirtual |
Rotate the domain by given rotation quaternion.
Implements TexGen::CDomain.
Definition at line 75 of file DomainPrism.h.
|
inlinevirtual |
Translate the domain by given vector.
Implements TexGen::CDomain.
Definition at line 77 of file DomainPrism.h.
|
protected |
Planes corresponding to mesh elements.
Definition at line 127 of file DomainPrism.h.
Referenced by ClipIntersectMeshToDomain(), GeneratePlanes(), and RemoveDuplicatePlanes().
|
protectedinherited |
A mesh representing the domain as a surface mesh.
Definition at line 112 of file Domain.h.
Referenced by TexGen::CDomainPlanes::BuildMesh(), BuildMesh(), TexGen::CDomain::CDomain(), TexGen::CDomainPlanes::CDomainPlanes(), CDomainPrism(), GeneratePlanes(), TexGen::CDomain::GetLimits(), GetMeshWithPolygonEnd(), TexGen::CDomain::GetVolume(), TexGen::CDomain::MeshIntersectsDomain(), and TexGen::CDomain::PopulateTiXmlElement().
|
mutableprotected |
Prism section points.
Definition at line 130 of file DomainPrism.h.
Referenced by GetMeshWithPolygonEnd(), and GetPolygonLimits().
|
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().