gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
SurfaceProjector Class Reference

Class to project 3D points on a triangulated surface. If a parametrization is available, the UV are interpolated at the triangle projection. Not associated to the mesh elements of a GEntity, so it can be used on mesh sub-patches or on background mesh. More...

#include <meshOctreeLibOL.h>

Collaboration diagram for SurfaceProjector:

Public Member Functions

 SurfaceProjector ()
 
 SurfaceProjector (GFace *gf)
 
 SurfaceProjector (SurfaceProjector const &)=delete
 
SurfaceProjectoroperator= (SurfaceProjector const &)=delete
 
 ~SurfaceProjector ()
 
bool initialize (GFace *gf, const std::vector< MTriangle * > &triangles, bool useCADStl=false)
 Fill the triangles and uvs from the triangles, then build the octree. Overwrite existing triangulation/octree if there is one. More...
 
void clear ()
 Clear the triangulation and delete the octree. More...
 
bool setAnalyticalProjection (GFace *gf)
 The SurfaceProjector can project with an analytical formula instead of a triangulation and a octree Supported shapes: Sphere. More...
 
GPoint closestPoint (const double query[3], bool evalOnCAD=false, bool projectOnCAD=false) const
 Get the query closest point on the triangulated surface. More...
 

Public Attributes

GFacegf
 

Protected Attributes

std::vector< std::array< double, 3 > > points
 
std::vector< std::array< int32_t, 3 > > triangles
 
std::vector< std::array< std::array< double, 2 >, 3 > > triangle_uvs
 
std::vector< bool > triangle_no_uv_eval
 
int64_t OctIdx
 
bool useAnalyticalFormula = false
 
GFace::GeomType analyticalShape = GFace::GeomType::Unknown
 
std::array< double, 10 > analyticalParameters
 

Detailed Description

Class to project 3D points on a triangulated surface. If a parametrization is available, the UV are interpolated at the triangle projection. Not associated to the mesh elements of a GEntity, so it can be used on mesh sub-patches or on background mesh.

Definition at line 24 of file meshOctreeLibOL.h.

Constructor & Destructor Documentation

◆ SurfaceProjector() [1/3]

SurfaceProjector::SurfaceProjector ( )
inline

Definition at line 26 of file meshOctreeLibOL.h.

◆ SurfaceProjector() [2/3]

SurfaceProjector::SurfaceProjector ( GFace gf)

Definition at line 317 of file meshOctreeLibOL.cpp.

Here is the call graph for this function:

◆ SurfaceProjector() [3/3]

SurfaceProjector::SurfaceProjector ( SurfaceProjector const &  )
delete

◆ ~SurfaceProjector()

SurfaceProjector::~SurfaceProjector ( )

Definition at line 341 of file meshOctreeLibOL.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void SurfaceProjector::clear ( )

Clear the triangulation and delete the octree.

Definition at line 329 of file meshOctreeLibOL.cpp.

Referenced by initialize(), and ~SurfaceProjector().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ closestPoint()

GPoint SurfaceProjector::closestPoint ( const double  query[3],
bool  evalOnCAD = false,
bool  projectOnCAD = false 
) const

Get the query closest point on the triangulated surface.

Parameters
query[3]3D coordinates of the query point
evalOnCADIf param available, evaluate the face CAD mapping at the interpolated UV
projectOnCADIf param available, call closestPoint from the CAD geometry engine, with the interpolated UV as initial guess
Returns
the projection, check GPoint::succeeded() for projection success / failure

Definition at line 567 of file meshOctreeLibOL.cpp.

Here is the call graph for this function:

◆ initialize()

bool SurfaceProjector::initialize ( GFace gf,
const std::vector< MTriangle * > &  triangles,
bool  useCADStl = false 
)

Fill the triangles and uvs from the triangles, then build the octree. Overwrite existing triangulation/octree if there is one.

Parameters
gfThe CAD face containing the triangles
trianglesThe triangles used to build the triangulated geometry support
useCADStlIf true, build and use the STL of the CAD face
Returns
true if success

Definition at line 364 of file meshOctreeLibOL.cpp.

Referenced by SurfaceProjector().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

SurfaceProjector& SurfaceProjector::operator= ( SurfaceProjector const &  )
delete

◆ setAnalyticalProjection()

bool SurfaceProjector::setAnalyticalProjection ( GFace gf)

The SurfaceProjector can project with an analytical formula instead of a triangulation and a octree Supported shapes: Sphere.

Parameters
gfThe face containing the analytical parameters
Returns
true if success

Definition at line 343 of file meshOctreeLibOL.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ analyticalParameters

std::array<double, 10> SurfaceProjector::analyticalParameters
protected

Definition at line 88 of file meshOctreeLibOL.h.

Referenced by closestPoint(), and setAnalyticalProjection().

◆ analyticalShape

GFace::GeomType SurfaceProjector::analyticalShape = GFace::GeomType::Unknown
protected

Definition at line 87 of file meshOctreeLibOL.h.

Referenced by closestPoint(), and setAnalyticalProjection().

◆ gf

GFace* SurfaceProjector::gf

◆ OctIdx

int64_t SurfaceProjector::OctIdx
protected

Definition at line 83 of file meshOctreeLibOL.h.

Referenced by clear(), closestPoint(), and initialize().

◆ points

std::vector<std::array<double, 3> > SurfaceProjector::points
protected

Definition at line 79 of file meshOctreeLibOL.h.

Referenced by clear(), closestPoint(), and initialize().

◆ triangle_no_uv_eval

std::vector<bool> SurfaceProjector::triangle_no_uv_eval
protected

Definition at line 82 of file meshOctreeLibOL.h.

Referenced by closestPoint(), and initialize().

◆ triangle_uvs

std::vector<std::array<std::array<double, 2>, 3> > SurfaceProjector::triangle_uvs
protected

Definition at line 81 of file meshOctreeLibOL.h.

Referenced by clear(), closestPoint(), and initialize().

◆ triangles

std::vector<std::array<int32_t, 3> > SurfaceProjector::triangles
protected

Definition at line 80 of file meshOctreeLibOL.h.

Referenced by clear(), closestPoint(), initialize(), and SurfaceProjector().

◆ useAnalyticalFormula

bool SurfaceProjector::useAnalyticalFormula = false
protected

Definition at line 86 of file meshOctreeLibOL.h.

Referenced by closestPoint(), and setAnalyticalProjection().


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