MeshLink
Computational geometry access
|
Provide computational geometry access using the Geode kernel. More...
#include <GeomKernel_Geode.h>
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 |
Provide computational geometry access using the Geode kernel.
Definition at line 70 of file GeomKernel_Geode.h.
GeometryKernelGeode::GeometryKernelGeode | ( | ) |
GeometryKernelGeode::~GeometryKernelGeode | ( | ) |
|
private |
Construct map of entity names to Geode entities.
|
privatevirtual |
Delete (and free) a point projection data object.
Reimplemented from GeometryKernel.
bool GeometryKernelGeode::entityExists | ( | const char * | name | ) | const |
Determine if entity matching name exists.
|
virtual |
Determine entity type.
Reimplemented from GeometryKernel.
|
virtual |
Evaluate the curvature on a curve entity at the parametric coordinates.
Defined by kernel implementation.
[in] | UV | the parametric coordinate (U) location to evaluate |
[in] | entityName | the name of the geometric entity to evaluate |
[out] | XYZ | the evaluated location in model space |
[out] | Tangent | the evaluated tangent vector |
[out] | PrincipalNormal | the evaluated principal normal vector |
[out] | Binormal | the binormal vector (Tangent X PrincipalNormal) |
[out] | Curvature | evaluated 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] | Linear | true if curve is linear and has no unique normal vector |
Reimplemented from GeometryKernel.
|
virtual |
Evaluate the curvature on a surface entity at the parametric coordinates.
Defined by kernel implementation.
[in] | UV | the parametric coordinate (UV) location to evaluate |
[in] | entityName | the name of the geometric entity to evaluate |
[out] | XYZ | the evaluated location in model space |
[out] | dXYZdU,dXYZdV | first partial derivatives |
[out] | d2XYZdU2,d2XYZdUdV,d2XYZdV2 | second partial derivatives |
[out] | surfaceNormal | normalized surface normal vector (unit vector) |
[out] | principalV | Unit 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,maxCurvature | minimum 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] | avg | average curvature; average or mean curvature is defined as : avg = (min + max) / 2 |
[out] | gauss | Guassian curvature; Gaussian curvature is defined as : gauss = min * max |
[out] | orientation | orientation of the surface in the model |
Reimplemented from GeometryKernel.
|
virtual |
Evaluate the parametric derivatives on a curve entity at the parametric coordinates.
Defined by kernel implementation.
[in] | UV | the parametric coordinate (U) location to evaluate |
[in] | entityName | the name of the geometric entity to evaluate |
[out] | XYZ | the evaluated location in model space |
[out] | dXYZdU | first derivative |
[out] | d2XYZdU2 | second derivative |
Reimplemented from GeometryKernel.
|
virtual |
Evaluate the radius of curvature at the entity parametric coordinates.
Defined by kernel implementation.
For a curve entity, min and max are equal.
[in] | UV | the parametric coordinate location to evaluate |
[in] | entityName | the name of the geometric entity to evaluate |
[out] | minRadiusOfCurvature,maxRadiusOfCurvature | the minimum and maximum radius of curvature at the given coordinate |
Reimplemented from GeometryKernel.
|
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.
[in] | entityName | the name of the geometric entity to evaluate |
[out] | minTolerance,maxTolerance | minimum and maximum model assembly tolerance used to make the model watertight at the shared boundary vertices and edges. |
Reimplemented from GeometryKernel.
bool GeometryKernelGeode::evalXYZ | ( | MLVector3D | UV, |
const std::string & | entityName, | ||
MLVector3D | xyz | ||
) |
|
private |
Get a projection BSPTree for the geometry group
Create if necessary and add to map.
|
private |
|
virtual |
Return the geometry model size.
Reimplemented from GeometryKernel.
|
inlinevirtual |
Return the name of the geometry kernel.
Reimplemented from GeometryKernel.
Definition at line 80 of file GeomKernel_Geode.h.
|
privatevirtual |
Construct a point projection data object for use by the geometry kernel.
Reimplemented from GeometryKernel.
|
virtual |
Return the projection distance.
[in] | projectionData | the projection data from which to extract |
[out] | distance | the distance between the original point and the projected point |
Reimplemented from GeometryKernel.
|
virtual |
Return the projection hit entity name.
[in] | projectionData | the projection data from which to extract |
[out] | name | the geometric entity name |
Reimplemented from GeometryKernel.
|
virtual |
Return the projection tolerance.
Defined by kernel implementation, the projection tolerance typically indicates local error tolerance within the geometry or solid topology.
[in] | projectionData | the projection data from which to extract |
[out] | tolerance | the maximum error tolerance of the projection result |
Reimplemented from GeometryKernel.
|
virtual |
Return the projection hit entity parametric coordinates.
[in] | projectionData | the projection data from which to extract |
[out] | UV | the projection parametric coordinate result |
Reimplemented from GeometryKernel.
|
virtual |
Return the projection hit Cartesian coordinates.
[in] | projectionData | the projection data from which to extract |
[out] | point | the projection coordinate result |
Reimplemented from GeometryKernel.
|
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.
group | the GeometryGroup to project upon | |
point | the point to project | |
[out] | projectionData | the projection result data |
Reimplemented from GeometryKernel.
|
virtual |
Read the geometry data file.
Defined by kernel implementation.
filename | the name (path) of the geometry file |
Reimplemented from GeometryKernel.
|
virtual |
Set the model size of the geometry.
Reimplemented from GeometryKernel.
|
friend |
Definition at line 72 of file GeomKernel_Geode.h.
|
private |
Definition at line 202 of file GeomKernel_Geode.h.
|
private |
Definition at line 199 of file GeomKernel_Geode.h.
|
private |
Definition at line 198 of file GeomKernel_Geode.h.
|
private |
Definition at line 200 of file GeomKernel_Geode.h.
|
private |
Definition at line 201 of file GeomKernel_Geode.h.