CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Classes | Macros | Functions
GeGbl.h File Reference
#include "Ge/GeTol.h"
#include "Ge/Ge.h"
#include "OdArrayPreDef.h"
#include "Ge/GeSurfacePtrArray.h"
#include "Ge/GePoint3dArray.h"
#include "TD_PackPush.h"
#include <OdaSTL.h>
#include "TD_PackPop.h"

Go to the source code of this file.

Classes

struct  OdGeContext
 
class  OdGeLoopCtx
 
class  OdError_GeNotImplemted
 

Macros

#define OD_GEGBL_H   /*!DOM*/
 
#define STL_USING_ALGORITHM
 
#define GE_NOT_IMPL(pGeEnt)
 

Functions

GE_TOOLKIT_EXPORT OdGeError geValidSolid (const OdGePoint3dArray &points, bool &isValid, const OdGeTol &tol=OdGeContext::gTol)
 
GE_TOOLKIT_EXPORT OdGeError geSolidSignedVolume (const OdGePoint3dArray &points, double &volume, const OdGePoint3d *basePoint)
 
GE_TOOLKIT_EXPORT OdGeError geCalculateNormal (const OdGePoint3dArray &points, OdGeVector3d *pNormal, const OdGeTol &tol=OdGeContext::gTol)
 
GE_TOOLKIT_EXPORT OdGeError geCalculateNormal (const OdGePoint3d *points, OdUInt32 numPoints, OdGeVector3d *pNormal, const OdGeTol &tol=OdGeContext::gTol)
 
GE_TOOLKIT_EXPORT OdGeError geCalculatePlane (const OdGePoint3dArray &points, OdGePlane &plane, const OdGeTol &tol=OdGeContext::gTol, bool validateCoplanar=true)
 
GE_TOOLKIT_EXPORT OdGeError geCalculatePlane (const OdGePoint3d *points, OdUInt32 numPoints, OdGePlane &plane, const OdGeTol &tol=OdGeContext::gTol, bool validateCoplanar=true)
 
GE_TOOLKIT_EXPORT OdGeError geCalculatePlane (const OdGeCurve3d *const *curves, OdUInt32 numCurves, OdGePlane &plane, const OdGeTol &tol=OdGeContext::gTol, bool validateCoplanar=true)
 
GE_TOOLKIT_EXPORT bool geNurb3dTo2d (const OdGeNurbCurve3d &nurb3d, OdGePlane &plane, OdGeNurbCurve2d &nurb2d, const OdGeTol &tol=OdGeContext::gTol)
 
GE_TOOLKIT_EXPORT bool geSurfaceProp (const OdGeSurface &pS, OdGe::NurbSurfaceProperties &propU, OdGe::NurbSurfaceProperties &propV, const OdGeTol &tol)
 
GE_TOOLKIT_EXPORT OdString geToString (const OdGe::EntityId val)
 
GE_TOOLKIT_EXPORT OdResult geIsDir2dOnSurfCoincide3d (const OdGeSurface *pSurf, const OdGeCurve3d *pCurve, const OdGeCurve2d *pParamCurve, bool &isCoincide, const OdGeTol &tol=OdGeContext::gTol)
 
GE_TOOLKIT_EXPORT double getSignedArea (const OdArray< OdGePoint2d, OdMemoryAllocator< OdGePoint2d > > &arrPoints)
 
GE_TOOLKIT_EXPORT bool isPolygonOutOfRect2d (OdUInt32 numPt, const OdGePoint2d *pPoints, const OdGePoint2d &minPt, const OdGePoint2d &maxPt)
 
void GE_ERROR (OdResult res)
 

Macro Definition Documentation

◆ GE_NOT_IMPL

#define GE_NOT_IMPL (   pGeEnt)
Value:
{ \
try \
{ \
(*OdGeContext::gErrorFunc)(eNotImplemented); \
} \
catch (const OdError& err) \
{ \
if (err.code() == eNotImplemented) \
{ \
OdString sFunc(TD_FUNC); \
OdString sMessage; \
sMessage.format(OD_T("%s method %s for Ge type %s"), \
OD_T("%s"), \
sFunc.c_str(), \
geToString(pGeEnt->type()).c_str()); \
throw OdError_GeNotImplemted(sMessage); \
} \
throw; \
} \
}
#define eNotImplemented
GE_TOOLKIT_EXPORT OdString geToString(const OdGe::EntityId val)
#define OD_T(x)
#define TD_FUNC
OdString & format(const OdChar *formatString,...)
const OdChar * c_str() const
Definition: OdString.h:203

Definition at line 463 of file GeGbl.h.

◆ OD_GEGBL_H

#define OD_GEGBL_H   /*!DOM*/

Definition at line 26 of file GeGbl.h.

◆ STL_USING_ALGORITHM

#define STL_USING_ALGORITHM

Definition at line 47 of file GeGbl.h.

Function Documentation

◆ GE_ERROR()

void GE_ERROR ( OdResult  res)
inline

Definition at line 447 of file GeGbl.h.

◆ geCalculateNormal() [1/2]

GE_TOOLKIT_EXPORT OdGeError geCalculateNormal ( const OdGePoint3d points,
OdUInt32  numPoints,
OdGeVector3d pNormal,
const OdGeTol tol = OdGeContext::gTol 
)

Returns the normal to the plane defined by the specified points.

Parameters
points[in] Array of 3D points.
numPoints[in] Number of points.
pNormal[out] Receives the normal to the calculated plane.
tol[in] Geometric tolerance.
Remarks
Possible return values are as follows:

@untitled table kOk kNonCoplanarGeometry kDegenerateGeometry kSingularPoint

Corresponding C++ library: TD_Ge

◆ geCalculateNormal() [2/2]

GE_TOOLKIT_EXPORT OdGeError geCalculateNormal ( const OdGePoint3dArray points,
OdGeVector3d pNormal,
const OdGeTol tol = OdGeContext::gTol 
)

Returns the normal to the plane defined by the specified points.

Parameters
points[in] Array of 3D points.
pNormal[out] Receives the normal to the calculated plane.
tol[in] Geometric tolerance.
Returns
Possible return values are as follows:

@untitled table kOk kNonCoplanarGeometry kDegenerateGeometry kSingularPoint

Corresponding C++ library: TD_Ge

◆ geCalculatePlane() [1/3]

GE_TOOLKIT_EXPORT OdGeError geCalculatePlane ( const OdGeCurve3d *const *  curves,
OdUInt32  numCurves,
OdGePlane plane,
const OdGeTol tol = OdGeContext::gTol,
bool  validateCoplanar = true 
)

Returns the plane defined by the specified points.

Parameters
curves[in] Array of 3D curves.
numCurves[in] Number of curves.
plane[out] Receives the calculated plane.
tol[in] Geometric tolerance.
validateCoplanar[in] Check whether curves/points are coplanar (set false only if curves/points are complanar).
Returns
Possible return values are as follows:

@untitled table kOk kNonCoplanarGeometry kDegenerateGeometry kSingularPoint

Remarks
Supported curves are OdGeCircArc3d, OdGeEllipArc3d, OdGeNurbCurve3d, and OdGeLineSeg3d.

Corresponding C++ library: TD_Ge

◆ geCalculatePlane() [2/3]

GE_TOOLKIT_EXPORT OdGeError geCalculatePlane ( const OdGePoint3d points,
OdUInt32  numPoints,
OdGePlane plane,
const OdGeTol tol = OdGeContext::gTol,
bool  validateCoplanar = true 
)

Returns the plane defined by the specified points.

Parameters
points[in] Array of 3D points.
numPoints[in] Number of points.
plane[out] Receives the calculated plane.
tol[in] Geometric tolerance.
validateCoplanar[in] Check whether curves/points are coplanar (set false only if curves/points are complanar).
Returns
Possible return values are as follows:

@untitled table kOk kNonCoplanarGeometry kDegenerateGeometry kSingularPoint

Corresponding C++ library: TD_Ge

◆ geCalculatePlane() [3/3]

GE_TOOLKIT_EXPORT OdGeError geCalculatePlane ( const OdGePoint3dArray points,
OdGePlane plane,
const OdGeTol tol = OdGeContext::gTol,
bool  validateCoplanar = true 
)

Returns the plane defined by the specified points.

Parameters
points[in] Array of 3D points.
plane[out] Receives the calculated plane.
tol[in] Geometric tolerance.
validateCoplanar[in] Check whether curves/points are coplanar (set false only if curves/points are coplanar).
Returns

Possible return values are as follows:

@untitled table kOk kNonCoplanarGeometry kDegenerateGeometry kSingularPoint

Corresponding C++ library: TD_Ge

◆ geIsDir2dOnSurfCoincide3d()

GE_TOOLKIT_EXPORT OdResult geIsDir2dOnSurfCoincide3d ( const OdGeSurface pSurf,
const OdGeCurve3d pCurve,
const OdGeCurve2d pParamCurve,
bool &  isCoincide,
const OdGeTol tol = OdGeContext::gTol 
)

Determine is direction of 3d curve is the same as direction of curve on surface that can be gotten via 2d parametric curve.

Parameters
pSurf[in] Surface.
pCurve[in] 3d curve that lie on pSurf.
pParamCurve[in] 2d parametric curve which corresponds to pCurve on pSurf.
isCoincide[out] Coincide flag.
tol[in] Geometric tolerance.
Remarks
3d curve should lie on surface with tolerance tol.

Corresponding C++ library: TD_Ge

◆ geNurb3dTo2d()

GE_TOOLKIT_EXPORT bool geNurb3dTo2d ( const OdGeNurbCurve3d nurb3d,
OdGePlane plane,
OdGeNurbCurve2d nurb2d,
const OdGeTol tol = OdGeContext::gTol 
)

Converts a 3D NURBS curve to a 2D NURBS curve by projecting it onto the specified plane.

Parameters
nurb3d[in] Any 3D NURBS curve.
plane[in] Projection plane.
nurb2d[out] Receives the 2D NURBS curve.
tol[in] Geometric tolerance.

Corresponding C++ library: TD_Ge

◆ geSolidSignedVolume()

GE_TOOLKIT_EXPORT OdGeError geSolidSignedVolume ( const OdGePoint3dArray points,
double &  volume,
const OdGePoint3d basePoint 
)

Calculates signed volume of a triangulated solid.

Parameters
points[in] Array of 3D points (in order of the triangles they form).
volume[out] Receives the volume value.
basePoint[in] Point to replace (0,0,0) for calculation purposes.
Remarks
Array of points should be divided by 3 without remainder. Negative sign of volume means that triangles in the solid are ordered clockwise.

Corresponding C++ library: TD_Ge

◆ geSurfaceProp()

GE_TOOLKIT_EXPORT bool geSurfaceProp ( const OdGeSurface pS,
OdGe::NurbSurfaceProperties propU,
OdGe::NurbSurfaceProperties propV,
const OdGeTol tol 
)

Calculates a properties for a specified surface.

Parameters
pS[in] Any surface.
propU[out] Receives the properties for the U parameter.
propV[out] Receives the properties for the V parameter.
tol[in] Geometric tolerance.

Corresponding C++ library: TD_Ge

Remarks
Rational state valid only for NURB surfaces.

◆ geToString()

GE_TOOLKIT_EXPORT OdString geToString ( const OdGe::EntityId  val)

Convert the specified value to an OdGe::EntityId string.

Parameters
val[in] OdGe::EntityId value.
Returns
OdString representation of val.

◆ getSignedArea()

GE_TOOLKIT_EXPORT double getSignedArea ( const OdArray< OdGePoint2d, OdMemoryAllocator< OdGePoint2d > > &  arrPoints)

Determine signed area defined by arrPoints array.

Parameters
arrPoints[in] array of 2d points.

Corresponding C++ library: TD_Ge

◆ geValidSolid()

GE_TOOLKIT_EXPORT OdGeError geValidSolid ( const OdGePoint3dArray points,
bool &  isValid,
const OdGeTol tol = OdGeContext::gTol 
)

Checks topology of a triangulated solid.

Parameters
points[in] Array of 3D points (in order of the triangles they form).
isValid[out] Receives the validation result.
tol[in] Geometric tolerance.
Remarks
Array of points should be divided by 3 without remainder.

Corresponding C++ library: TD_Ge

◆ isPolygonOutOfRect2d()

GE_TOOLKIT_EXPORT bool isPolygonOutOfRect2d ( OdUInt32  numPt,
const OdGePoint2d pPoints,
const OdGePoint2d minPt,
const OdGePoint2d maxPt 
)

Determines whether the polygon is out of the specified rectangle.

Parameters
numPt[in] Count of polygon points.
pPoints[in] Pointer to an array of polygon points.
minPt[in] Minimum extents point.
maxPt[in] Maximum extents point.
Returns
true if polygon is out of the rectangle or if polygon contains a rectangle. This method returns false if the polygon is inside the specified rectangle or if they intersect.
Remarks
Corresponding C++ library: TD_Ge