MeshLink
Computational geometry access
GeometryKernel Class Reference

Base class for geometry kernel interface. More...

#include <GeometryKernel.h>

Inheritance diagram for GeometryKernel:

Public Member Functions

virtual bool read (const char *filename)
 Read the geometry data file. More...
 
virtual bool projectPoint (const GeometryGroup *group, const MLVector3D point, ProjectionData &projectionData)
 Project a Cartesian point onto the Geometry group. More...
 
virtual bool getProjectionXYZ (ProjectionData &projectionData, MLVector3D point)
 Return the projection hit Cartesian coordinates. More...
 
virtual bool getProjectionUV (ProjectionData &projectionData, MLVector2D UV)
 Return the projection hit entity parametric coordinates. More...
 
virtual bool getProjectionEntityName (ProjectionData &projectionData, std::string &name)
 Return the projection hit entity name. More...
 
virtual bool getProjectionDistance (ProjectionData &projectionData, MLREAL &distance)
 Return the projection distance. More...
 
virtual bool getProjectionTolerance (ProjectionData &projectionData, MLREAL &tolerance)
 Return the projection tolerance. More...
 
virtual bool evalXYZ (MLVector2D UV, const std::string &entityName, MLVector3D xyz)
 Evaluate the Cartesian coordinates at the entity parametric coordinates. More...
 
virtual bool evalRadiusOfCurvature (MLVector2D UV, const std::string &entityName, MLREAL *minRadiusOfCurvature, MLREAL *maxRadiusOfCurvature)
 Evaluate the radius of curvature at the entity parametric coordinates. More...
 
virtual bool evalCurvatureOnCurve (MLVector2D UV, const std::string &entityName, MLVector3D XYZ, MLVector3D Tangent, MLVector3D PrincipalNormal, MLVector3D Binormal, MLREAL *Curvature, bool *Linear)
 Evaluate the curvature on a curve entity at the parametric coordinates. More...
 
virtual bool evalDerivativesOnCurve (MLVector2D UV, const std::string &entityName, MLVector3D XYZ, MLVector3D dXYZdU, MLVector3D d2XYZdU2)
 Evaluate the parametric derivatives on a curve entity at the parametric coordinates. More...
 
virtual bool evalCurvatureOnSurface (MLVector2D UV, const std::string &entityName, MLVector3D XYZ, MLVector3D dXYZdU, MLVector3D dXYZdV, MLVector3D d2XYZdU2, MLVector3D d2XYZdUdV, MLVector3D d2XYZdV2, MLVector3D surfaceNormal, MLVector3D principalV, MLREAL *minCurvature, MLREAL *maxCurvature, MLREAL *avg, MLREAL *gauss, MLORIENT *orientation)
 Evaluate the curvature on a surface entity at the parametric coordinates. More...
 
virtual bool evalSurfaceTolerance (const std::string &entityName, MLREAL &minTolerance, MLREAL &maxTolerance)
 Evaluate the model assembly tolerance on a surface entity. More...
 
virtual MLTYPE entityType (const char *name)
 Determine entity type. More...
 
virtual bool entityExists (const char *name)
 Determine if an entity exists in the geometry kernel database. More...
 
virtual const char * getName () const
 Return the name of the geometry kernel. More...
 
virtual void setModelSize (MLREAL size)
 Set the model size of the geometry. More...
 
virtual MLREAL getModelSize () const
 Return the geometry model size. More...
 
 GeometryKernel ()
 Default constructor sets model size to 1000.0. More...
 
 ~GeometryKernel ()
 Destructor. More...
 

Private Member Functions

virtual ProjectionDataObj getProjectionDataObject ()
 Construct a point projection data object for use by the geometry kernel. More...
 
virtual void deleteProjectionDataObject (ProjectionDataObj projectionData)
 Delete (and free) a kernel point projection data object. More...
 

Private Attributes

MLREAL modelsize_
 model size More...
 

Friends

class ProjectionData
 

Detailed Description

Base class for geometry kernel interface.

Provides a neutral interface for interaction with geometry stored in wrapped geometry kernels. The geometry kernel is application-defined, and performs all geometric operations as provided by this interface.

Definition at line 91 of file GeometryKernel.h.

Constructor & Destructor Documentation

◆ GeometryKernel()

GeometryKernel::GeometryKernel ( )
inline

Default constructor sets model size to 1000.0.

Definition at line 302 of file GeometryKernel.h.

◆ ~GeometryKernel()

GeometryKernel::~GeometryKernel ( )
inline

Destructor.

Definition at line 308 of file GeometryKernel.h.

Member Function Documentation

◆ deleteProjectionDataObject()

virtual void GeometryKernel::deleteProjectionDataObject ( ProjectionDataObj  projectionData)
privatevirtual

Delete (and free) a kernel point projection data object.

Reimplemented in GeometryKernelGeode.

◆ entityExists()

virtual bool GeometryKernel::entityExists ( const char *  name)
virtual

Determine if an entity exists in the geometry kernel database.

Parameters
[in]namethe name of the entity

◆ entityType()

virtual MLTYPE GeometryKernel::entityType ( const char *  name)
virtual

Determine entity type.

Parameters
[in]namethe name of the entity

Reimplemented in GeometryKernelGeode.

◆ evalCurvatureOnCurve()

virtual bool GeometryKernel::evalCurvatureOnCurve ( MLVector2D  UV,
const std::string &  entityName,
MLVector3D  XYZ,
MLVector3D  Tangent,
MLVector3D  PrincipalNormal,
MLVector3D  Binormal,
MLREAL Curvature,
bool *  Linear 
)
virtual

Evaluate the curvature on a curve entity at the parametric coordinates.

Defined by kernel implementation.

Parameters
[in]UVthe parametric coordinate (U) location to evaluate
[in]entityNamethe name of the geometric entity to evaluate
[out]XYZthe evaluated location in model space
[out]Tangentthe evaluated tangent vector
[out]PrincipalNormalthe evaluated principal normal vector
[out]Binormalthe binormal vector (Tangent X PrincipalNormal)
[out]Curvatureevaluated curvature in radians per unit length. This is ALWAYS non-negative and in the direction of the principal normal vector. Radius of curvature is computed as 1 / Curvature.
[out]Lineartrue if curve is linear and has no unique normal vector

Reimplemented in GeometryKernelGeode.

◆ evalCurvatureOnSurface()

virtual bool GeometryKernel::evalCurvatureOnSurface ( MLVector2D  UV,
const std::string &  entityName,
MLVector3D  XYZ,
MLVector3D  dXYZdU,
MLVector3D  dXYZdV,
MLVector3D  d2XYZdU2,
MLVector3D  d2XYZdUdV,
MLVector3D  d2XYZdV2,
MLVector3D  surfaceNormal,
MLVector3D  principalV,
MLREAL minCurvature,
MLREAL maxCurvature,
MLREAL avg,
MLREAL gauss,
MLORIENT orientation 
)
virtual

Evaluate the curvature on a surface entity at the parametric coordinates.

Defined by kernel implementation.

Parameters
[in]UVthe parametric coordinate (UV) location to evaluate
[in]entityNamethe name of the geometric entity to evaluate
[out]XYZthe evaluated location in model space
[out]dXYZdU,dXYZdVfirst partial derivatives
[out]d2XYZdU2,d2XYZdUdV,d2XYZdV2second partial derivatives
[out]surfaceNormalnormalized surface normal vector (unit vector)
[out]principalVUnit vector tangent to surface where curvature = min; surfaceNormal cross principalV yields the direction where curvature = max; if the surface is locally planar (min and max are 0.0) or if the surface is locally spherical (min and max are equal), this will be an arbitrary vector tangent to the surface
[out]minCurvature,maxCurvatureminimum and maximum curvature, in radians per unit length; defined so that positive values indicate the surface bends in the direction of surfaceNormal, and negative values indicate the surface bends away from surfaceNormal
[out]avgaverage curvature; average or mean curvature is defined as : avg = (min + max) / 2
[out]gaussGuassian curvature; Gaussian curvature is defined as : gauss = min * max
[out]orientationorientation of the surface in the model

Reimplemented in GeometryKernelGeode.

◆ evalDerivativesOnCurve()

virtual bool GeometryKernel::evalDerivativesOnCurve ( MLVector2D  UV,
const std::string &  entityName,
MLVector3D  XYZ,
MLVector3D  dXYZdU,
MLVector3D  d2XYZdU2 
)
virtual

Evaluate the parametric derivatives on a curve entity at the parametric coordinates.

Defined by kernel implementation.

Parameters
[in]UVthe parametric coordinate (U) location to evaluate
[in]entityNamethe name of the geometric entity to evaluate
[out]XYZthe evaluated location in model space
[out]dXYZdUfirst derivative
[out]d2XYZdU2second derivative

Reimplemented in GeometryKernelGeode.

◆ evalRadiusOfCurvature()

virtual bool GeometryKernel::evalRadiusOfCurvature ( MLVector2D  UV,
const std::string &  entityName,
MLREAL minRadiusOfCurvature,
MLREAL maxRadiusOfCurvature 
)
virtual

Evaluate the radius of curvature at the entity parametric coordinates.

Defined by kernel implementation.

For a curve entity, min and max are equal.

Parameters
[in]UVthe parametric coordinate location to evaluate
[in]entityNamethe name of the geometric entity to evaluate
[out]minRadiusOfCurvature,maxRadiusOfCurvaturethe minimum and maximum radius of curvature at the given coordinate

Reimplemented in GeometryKernelGeode.

◆ evalSurfaceTolerance()

virtual bool GeometryKernel::evalSurfaceTolerance ( const std::string &  entityName,
MLREAL minTolerance,
MLREAL maxTolerance 
)
virtual

Evaluate the model assembly tolerance on a surface entity.

Defined by kernel implementation, but in general: If the surface name given matches a model face, then the face's boundary edges and vertices will be querried for the assembly tolerance used to close the model.

Parameters
[in]entityNamethe name of the geometric entity to evaluate
[out]minTolerance,maxToleranceminimum and maximum model assembly tolerance used to make the model watertight at the shared boundary vertices and edges.
Returns
true if model assembly tolerance is available for the surface

Reimplemented in GeometryKernelGeode.

◆ evalXYZ()

virtual bool GeometryKernel::evalXYZ ( MLVector2D  UV,
const std::string &  entityName,
MLVector3D  xyz 
)
virtual

Evaluate the Cartesian coordinates at the entity parametric coordinates.

Defined by kernel implementation.

Parameters
[in]UVthe parametric coordinate location to evaluate
[in]entityNamethe name of the geometric entity to evaluate
[out]xyzthe evaluated location in model space

◆ getModelSize()

virtual MLREAL GeometryKernel::getModelSize ( ) const
virtual

Return the geometry model size.

Reimplemented in GeometryKernelGeode.

◆ getName()

virtual const char* GeometryKernel::getName ( ) const
virtual

Return the name of the geometry kernel.

Reimplemented in GeometryKernelGeode.

◆ getProjectionDataObject()

virtual ProjectionDataObj GeometryKernel::getProjectionDataObject ( )
privatevirtual

Construct a point projection data object for use by the geometry kernel.

Reimplemented in GeometryKernelGeode.

◆ getProjectionDistance()

virtual bool GeometryKernel::getProjectionDistance ( ProjectionData projectionData,
MLREAL distance 
)
virtual

Return the projection distance.

Parameters
[in]projectionDatathe projection data from which to extract
[out]distancethe distance between the original point and the projected point

Reimplemented in GeometryKernelGeode.

◆ getProjectionEntityName()

virtual bool GeometryKernel::getProjectionEntityName ( ProjectionData projectionData,
std::string &  name 
)
virtual

Return the projection hit entity name.

Parameters
[in]projectionDatathe projection data from which to extract
[out]namethe geometric entity name

Reimplemented in GeometryKernelGeode.

◆ getProjectionTolerance()

virtual bool GeometryKernel::getProjectionTolerance ( ProjectionData projectionData,
MLREAL tolerance 
)
virtual

Return the projection tolerance.

Defined by kernel implementation, the projection tolerance typically indicates local error tolerance within the geometry or solid topology.

Parameters
[in]projectionDatathe projection data from which to extract
[out]tolerancethe maximum error tolerance of the projection result

Reimplemented in GeometryKernelGeode.

◆ getProjectionUV()

virtual bool GeometryKernel::getProjectionUV ( ProjectionData projectionData,
MLVector2D  UV 
)
virtual

Return the projection hit entity parametric coordinates.

Parameters
[in]projectionDatathe projection data from which to extract
[out]UVthe projection parametric coordinate result

Reimplemented in GeometryKernelGeode.

◆ getProjectionXYZ()

virtual bool GeometryKernel::getProjectionXYZ ( ProjectionData projectionData,
MLVector3D  point 
)
virtual

Return the projection hit Cartesian coordinates.

Parameters
[in]projectionDatathe projection data from which to extract
[out]pointthe projection coordinate result

Reimplemented in GeometryKernelGeode.

◆ projectPoint()

virtual bool GeometryKernel::projectPoint ( const GeometryGroup group,
const MLVector3D  point,
ProjectionData projectionData 
)
virtual

Project a Cartesian point onto the Geometry group.

Defined by kernel implementation.

Closest point projection of point onto the geometric entities in the GeometryGroup. Data is returned in the ProjectionData object.

Parameters
groupthe GeometryGroup to project upon
pointthe point to project
[out]projectionDatathe projection result data
Returns
true if the projection was successful

Reimplemented in GeometryKernelGeode.

◆ read()

virtual bool GeometryKernel::read ( const char *  filename)
virtual

Read the geometry data file.

Defined by kernel implementation.

Parameters
filenamethe name (path) of the geometry file

Reimplemented in GeometryKernelGeode.

◆ setModelSize()

virtual void GeometryKernel::setModelSize ( MLREAL  size)
virtual

Set the model size of the geometry.

Used to define tolerances within the geometry kernel

Parameters
[in]sizethe model size to set

Reimplemented in GeometryKernelGeode.

Friends And Related Function Documentation

◆ ProjectionData

friend class ProjectionData
friend

Definition at line 93 of file GeometryKernel.h.

Member Data Documentation

◆ modelsize_

MLREAL GeometryKernel::modelsize_
private

model size

Definition at line 314 of file GeometryKernel.h.


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