xmsmesh  1.0
xms::MeRefinePtsToPolysImpl Class Reference

Creates polygons from refine point input. More...

Inheritance diagram for xms::MeRefinePtsToPolysImpl:
xms::MeRefinePtsToPolys

Public Member Functions

virtual void SetRefinePoints (const std::vector< MeRefinePoint > &a_pts, double a_tol) override
 Sets the refine points. More...
 
virtual void RefPtsAsPolys (int a_polyId, const std::vector< Pt3d > &a_outPoly, const std::vector< std::vector< Pt3d >> &a_inPolys, std::vector< std::vector< Pt3d >> &a_newInPolys, std::vector< Pt3d > &a_refMeshPts, std::vector< Pt3d > &a_refPtsTooClose) override
 Creates new inside polygons from refine points that are inside of the polygon being considered. More...
 
void FindPtsInsidePolygon (const std::vector< Pt3d > &a_outPoly, const std::vector< std::vector< Pt3d >> &a_inPolys, std::vector< Pt3d > &a_refPtsTooClose)
 Finds the refine points that are inside of the polygon. More...
 
void CheckRefPtsTooCloseToOtherRefPts (std::multimap< double, size_t > &a_mapSizeIdx, std::vector< Pt3d > &a_refPtsTooClose)
 Checks on refine points that are inside of the polygon to make sure that they are not too close to one another. Points are sorted based on the refinement size so that preference is given to the smallest refinement size. More...
 
void CreateNewInsidePolygons (std::vector< std::vector< Pt3d >> &a_newInPolys, std::vector< Pt3d > &a_refMeshPts, std::vector< Pt3d > &a_refPtsProcessed)
 Creates new inside polygons from the refine points and appends these polygons to the current vector of inside polys. More...
 
std::vector< Pt3dTriPolyAtPoint (const Pt3d &a_pt, double a_size)
 Creates a triangle polygon that surrounds a refine point. The refine point itself will NOT be included in the mesh. More...
 
std::vector< Pt3dHexPolyAtPoint (const Pt3d &a_pt, double a_size)
 Creates a hexagon polygon that surrounds a refine point. The refine point itself WILL be included in the mesh. More...
 

Public Attributes

double m_TwoTimesSqrtThree
 precalculated constant
 
double m_SqrtThree
 precalculated constant
 
double m_SqrtThreeOverTwo
 precalculated constant
 
double m_xyTol
 tolerance used for geometric comparison
 
std::vector< MeRefinePointm_pts
 the refine points
 
std::vector< size_t > m_ptsInsidePoly
 
int m_polyId
 id of the polygon
 

Additional Inherited Members

- Static Public Member Functions inherited from xms::MeRefinePtsToPolys
static BSHP< MeRefinePtsToPolysNew ()
 Creates a new instance of this class. More...
 

Detailed Description

Creates polygons from refine point input.

Definition at line 46 of file MeRefinePtsToPolys.cpp.

Member Function Documentation

◆ CheckRefPtsTooCloseToOtherRefPts()

void xms::MeRefinePtsToPolysImpl::CheckRefPtsTooCloseToOtherRefPts ( std::multimap< double, size_t > &  a_mapSizeIdx,
std::vector< Pt3d > &  a_refPtsProcessed 
)

Checks on refine points that are inside of the polygon to make sure that they are not too close to one another. Points are sorted based on the refinement size so that preference is given to the smallest refinement size.

Parameters
a_mapSizeIdxA map containing the refinement size and the index to the point.
a_refPtsProcessedVector of point locations that have been process by the meshing algorithm.

Definition at line 204 of file MeRefinePtsToPolys.cpp.

References xmlog::error, m_polyId, m_pts, m_ptsInsidePoly, Mdist(), xms::meModifyMessageWithPolygonId(), xms::Pt3< T >::x, XM_LOG, and xms::Pt3< T >::y.

Referenced by FindPtsInsidePolygon().

◆ CreateNewInsidePolygons()

void xms::MeRefinePtsToPolysImpl::CreateNewInsidePolygons ( std::vector< std::vector< Pt3d >> &  a_newInPolys,
std::vector< Pt3d > &  a_refMeshPts,
std::vector< Pt3d > &  a_refPtsProcessed 
)

Creates new inside polygons from the refine points and appends these polygons to the current vector of inside polys.

Parameters
a_newInPolysNew inside polygons with refine points included.
a_refMeshPtsVector of refine point locations that are included in the final mesh by the meshing algorithm.
a_refPtsProcessedVector of point locations that have been processed by the meshing algorithm but are not represented by mesh nodes in the final mesh.

Definition at line 257 of file MeRefinePtsToPolys.cpp.

References HexPolyAtPoint(), m_pts, m_ptsInsidePoly, m_xyTol, and TriPolyAtPoint().

Referenced by RefPtsAsPolys().

◆ FindPtsInsidePolygon()

void xms::MeRefinePtsToPolysImpl::FindPtsInsidePolygon ( const std::vector< Pt3d > &  a_outPoly,
const std::vector< std::vector< Pt3d >> &  a_inPolys,
std::vector< Pt3d > &  a_refPtsProcessed 
)

Finds the refine points that are inside of the polygon.

Parameters
a_outPolyThe points defining the outer loop of the polygon. Clockwise. 1st pt != last pt.
a_inPolysThe points defining inner loops inside the outer loop of the polygon. Can be empty. Counter clockwise. 1st pt != last pt.
a_refPtsProcessedVector of point locations that have been process by the meshing algorithm.

Definition at line 158 of file MeRefinePtsToPolys.cpp.

References CheckRefPtsTooCloseToOtherRefPts(), xmlog::error, m_polyId, m_pts, xms::meModifyMessageWithPolygonId(), xms::GmPolygon::New(), and XM_LOG.

Referenced by RefPtsAsPolys().

◆ HexPolyAtPoint()

std::vector< Pt3d > xms::MeRefinePtsToPolysImpl::HexPolyAtPoint ( const Pt3d a_pt,
double  a_size 
)

Creates a hexagon polygon that surrounds a refine point. The refine point itself WILL be included in the mesh.

Parameters
a_ptThe location of the refine point.
a_sizeThe element edge size a the refine point.
Returns
A polygon for a_pt refine point.

Definition at line 331 of file MeRefinePtsToPolys.cpp.

References m_SqrtThreeOverTwo.

Referenced by CreateNewInsidePolygons(), and MeRefinePtsToPolysUnitTests::testHexPolyAtPoint().

◆ RefPtsAsPolys()

void xms::MeRefinePtsToPolysImpl::RefPtsAsPolys ( int  a_polyId,
const std::vector< Pt3d > &  a_outPoly,
const std::vector< std::vector< Pt3d >> &  a_inPolys,
std::vector< std::vector< Pt3d >> &  a_newInPolys,
std::vector< Pt3d > &  a_refMeshPts,
std::vector< Pt3d > &  a_refPtsProcessed 
)
overridevirtual

Creates new inside polygons from refine points that are inside of the polygon being considered.

Parameters
[in]a_polyIdThe id of the polygon
[in]a_outPolyThe points making up the outside polygon
[in]a_inPolysInner boundaries for the a_outPoly
[out]a_newInPolysNew inside polygons created from refine points
[out]a_refMeshPtsLocations of refine points that are also mesh node locations.
[out]a_refPtsProcessedLocations of other refine points that are not also mesh nodes.

Definition at line 134 of file MeRefinePtsToPolys.cpp.

References CreateNewInsidePolygons(), FindPtsInsidePolygon(), m_polyId, and m_ptsInsidePoly.

Referenced by MeRefinePtsToPolysUnitTests::testRefinePtsTooCloseToBoundary(), and MeRefinePtsToPolysUnitTests::testRefPtsAsPolys().

◆ SetRefinePoints()

virtual void xms::MeRefinePtsToPolysImpl::SetRefinePoints ( const std::vector< MeRefinePoint > &  a_pts,
double  a_tol 
)
inlineoverridevirtual

Sets the refine points.

Parameters
[in]a_ptsThe refine points.
[in]a_tolThe xy tolerance.

Definition at line 63 of file MeRefinePtsToPolys.cpp.

References m_pts, and m_xyTol.

Referenced by MeRefinePtsToPolysUnitTests::testRefinePtsTooCloseToBoundary(), and MeRefinePtsToPolysUnitTests::testRefPtsAsPolys().

◆ TriPolyAtPoint()

std::vector< Pt3d > xms::MeRefinePtsToPolysImpl::TriPolyAtPoint ( const Pt3d a_pt,
double  a_size 
)

Creates a triangle polygon that surrounds a refine point. The refine point itself will NOT be included in the mesh.

Parameters
a_ptThe location of the refine point.
a_sizeThe element edge size a the refine point.
Returns
A polygon for a_pt refine point.

Definition at line 290 of file MeRefinePtsToPolys.cpp.

References m_SqrtThree, and m_TwoTimesSqrtThree.

Referenced by CreateNewInsidePolygons(), and MeRefinePtsToPolysUnitTests::testTriPolyAtPoint().

Member Data Documentation

◆ m_ptsInsidePoly

std::vector<size_t> xms::MeRefinePtsToPolysImpl::m_ptsInsidePoly

indexes to the refine point that are inside of the current polygon being considered

Definition at line 92 of file MeRefinePtsToPolys.cpp.

Referenced by CheckRefPtsTooCloseToOtherRefPts(), CreateNewInsidePolygons(), and RefPtsAsPolys().


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