MeshLink
Computational geometry access
GeometryKernelGeode Class Reference

Provide computational geometry access using the Geode kernel. More...

#include <GeomKernel_Geode.h>

Inheritance diagram for GeometryKernelGeode:

Public Member Functions

 GeometryKernelGeode ()
 
 ~GeometryKernelGeode ()
 
bool read (const char *filename)
 Read the geometry data file. More...
 
const char * getName () const
 Return the name of the geometry kernel. More...
 
bool projectPoint (const GeometryGroup *group, const MLVector3D point, ProjectionData &projectionData)
 Project a Cartesian point onto the Geometry group. More...
 
bool getProjectionXYZ (ProjectionData &projectionData, MLVector3D point)
 Return the projection hit Cartesian coordinates. More...
 
bool getProjectionUV (ProjectionData &projectionData, MLVector2D UV)
 Return the projection hit entity parametric coordinates. More...
 
bool getProjectionEntityName (ProjectionData &projectionData, std::string &name)
 Return the projection hit entity name. More...
 
bool getProjectionTolerance (ProjectionData &projectionData, MLREAL &tolerance)
 Return the projection tolerance. More...
 
bool getProjectionDistance (ProjectionData &projectionData, MLREAL &distance)
 Return the projection distance. More...
 
bool evalXYZ (MLVector3D UV, const std::string &entityName, MLVector3D xyz)
 
bool evalRadiusOfCurvature (MLVector2D UV, const std::string &entityName, MLREAL *minRadiusOfCurvature, MLREAL *maxRadiusOfCurvature)
 Evaluate the radius of curvature at the entity parametric coordinates. More...
 
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...
 
bool evalSurfaceTolerance (const std::string &entityName, MLREAL &minTolerance, MLREAL &maxTolerance)
 Evaluate the model assembly tolerance on a surface entity. More...
 
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...
 
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...
 
MLTYPE entityType (const char *name)
 Determine entity type. More...
 
bool entityExists (const char *name) const
 Determine if entity matching name exists. More...
 
void setModelSize (MLREAL size)
 Set the model size of the geometry. More...
 
MLREAL getModelSize () const
 Return the geometry model size. More...
 
- Public Member Functions inherited from GeometryKernel
virtual bool evalXYZ (MLVector2D UV, const std::string &entityName, MLVector3D xyz)
 Evaluate the Cartesian coordinates at the entity parametric coordinates. More...
 
virtual bool entityExists (const char *name)
 Determine if an entity exists in the geometry kernel database. More...
 
 GeometryKernel ()
 Default constructor sets model size to 1000.0. More...
 
 ~GeometryKernel ()
 Destructor. More...
 

Private Member Functions

ProjectionDataObj getProjectionDataObject ()
 Construct a point projection data object for use by the geometry kernel. More...
 
void deleteProjectionDataObject (ProjectionDataObj projectionData)
 Delete (and free) a point projection data object. More...
 
GE::Entity * getEntity (const std::string &name) const
 
void buildEntityMap ()
 Construct map of entity names to Geode entities. More...
 
GE::ProjectionBSPTree * getBSPTree (const GeometryGroup *group)
 

Private Attributes

GeodeErrorHandler errorHandler_
 
GE::Database database_
 
GE::EntityList< GE::Entity > usable_entities_
 
std::map< std::string, GE::Entity * > usable_entity_map_
 
std::map< const GeometryGroup *, GE::ProjectionBSPTree * > BSPTreeMap_
 

Friends

class ProjectionData
 

Detailed Description

Provide computational geometry access using the Geode kernel.

Definition at line 70 of file GeomKernel_Geode.h.

Constructor & Destructor Documentation

◆ GeometryKernelGeode()

GeometryKernelGeode::GeometryKernelGeode ( )

◆ ~GeometryKernelGeode()

GeometryKernelGeode::~GeometryKernelGeode ( )

Member Function Documentation

◆ buildEntityMap()

void GeometryKernelGeode::buildEntityMap ( )
private

Construct map of entity names to Geode entities.

◆ deleteProjectionDataObject()

void GeometryKernelGeode::deleteProjectionDataObject ( ProjectionDataObj  projectionData)
privatevirtual

Delete (and free) a point projection data object.

Reimplemented from GeometryKernel.

◆ entityExists()

bool GeometryKernelGeode::entityExists ( const char *  name) const

Determine if entity matching name exists.

◆ entityType()

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

Determine entity type.

Reimplemented from GeometryKernel.

◆ evalCurvatureOnCurve()

bool GeometryKernelGeode::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 from GeometryKernel.

◆ evalCurvatureOnSurface()

bool GeometryKernelGeode::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 from GeometryKernel.

◆ evalDerivativesOnCurve()

bool GeometryKernelGeode::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 from GeometryKernel.

◆ evalRadiusOfCurvature()

bool GeometryKernelGeode::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 from GeometryKernel.

◆ evalSurfaceTolerance()

bool GeometryKernelGeode::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 from GeometryKernel.

◆ evalXYZ()

bool GeometryKernelGeode::evalXYZ ( MLVector3D  UV,
const std::string &  entityName,
MLVector3D  xyz 
)

◆ getBSPTree()

GE::ProjectionBSPTree* GeometryKernelGeode::getBSPTree ( const GeometryGroup group)
private

Get a projection BSPTree for the geometry group

Create if necessary and add to map.

◆ getEntity()

GE::Entity* GeometryKernelGeode::getEntity ( const std::string &  name) const
private

◆ getModelSize()

MLREAL GeometryKernelGeode::getModelSize ( ) const
virtual

Return the geometry model size.

Reimplemented from GeometryKernel.

◆ getName()

const char* GeometryKernelGeode::getName ( ) const
inlinevirtual

Return the name of the geometry kernel.

Reimplemented from GeometryKernel.

Definition at line 80 of file GeomKernel_Geode.h.

◆ getProjectionDataObject()

ProjectionDataObj GeometryKernelGeode::getProjectionDataObject ( )
privatevirtual

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

Reimplemented from GeometryKernel.

◆ getProjectionDistance()

bool GeometryKernelGeode::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 from GeometryKernel.

◆ getProjectionEntityName()

bool GeometryKernelGeode::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 from GeometryKernel.

◆ getProjectionTolerance()

bool GeometryKernelGeode::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 from GeometryKernel.

◆ getProjectionUV()

bool GeometryKernelGeode::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 from GeometryKernel.

◆ getProjectionXYZ()

bool GeometryKernelGeode::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 from GeometryKernel.

◆ projectPoint()

bool GeometryKernelGeode::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 from GeometryKernel.

◆ read()

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

Read the geometry data file.

Defined by kernel implementation.

Parameters
filenamethe name (path) of the geometry file

Reimplemented from GeometryKernel.

◆ setModelSize()

void GeometryKernelGeode::setModelSize ( MLREAL  size)
virtual

Set the model size of the geometry.

Reimplemented from GeometryKernel.

Friends And Related Function Documentation

◆ ProjectionData

friend class ProjectionData
friend

Definition at line 72 of file GeomKernel_Geode.h.

Member Data Documentation

◆ BSPTreeMap_

std::map<const GeometryGroup *, GE::ProjectionBSPTree *> GeometryKernelGeode::BSPTreeMap_
private

Definition at line 202 of file GeomKernel_Geode.h.

◆ database_

GE::Database GeometryKernelGeode::database_
private

Definition at line 199 of file GeomKernel_Geode.h.

◆ errorHandler_

GeodeErrorHandler GeometryKernelGeode::errorHandler_
private

Definition at line 198 of file GeomKernel_Geode.h.

◆ usable_entities_

GE::EntityList<GE::Entity> GeometryKernelGeode::usable_entities_
private

Definition at line 200 of file GeomKernel_Geode.h.

◆ usable_entity_map_

std::map<std::string, GE::Entity*> GeometryKernelGeode::usable_entity_map_
private

Definition at line 201 of file GeomKernel_Geode.h.


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