CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
GeGbl.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24
25#ifndef OD_GEGBL_H
26#define OD_GEGBL_H
27
28#include "Ge/GeTol.h"
29
30#include "Ge/Ge.h"
31#include "OdArrayPreDef.h"
33
34class OdGeSurface;
35class OdGeVector3d;
36class OdGePlane;
37class OdGeCurve3d;
38class OdGeNurbCurve2d;
39class OdGeNurbCurve3d;
40class OdGePoint3d;
41class OdGePoint2d;
42class OdGeCurve2d;
43
46
47#include "TD_PackPush.h"
48
49#define STL_USING_ALGORITHM
50#include <OdaSTL.h>
51
61{
68
75
82
105 GE_STATIC_EXPORT static void (*gOrthoVector) (const OdGeVector3d& vect, OdGeVector3d& orthoVector);
106
114 GE_STATIC_EXPORT static void* (*gAllocMem) (unsigned long size);
115
116
125 GE_STATIC_EXPORT static void (*gFreeMem) (void* memBlock);
126};
127
137{
138public:
151
159 OdGeLoopCtx(const OdGeSurface* pSurface, const OdArray<std::pair<const OdGeCurve2d*, bool>>& arrCoedges, const OdArray<const OdGeCurve3d*>& arrEdges, bool bFaceReversed)
160 : m_pSurface(pSurface)
161 , m_arrCoedges(arrCoedges)
162 , m_arrEdges(arrEdges)
163 , m_bFaceReversed(bFaceReversed)
164 {}
165
177 LoopType getLoopType(double dTol);
178private:
179 const OdGeSurface* m_pSurface;
181 const OdArray<const OdGeCurve3d*>& m_arrEdges;
182 bool m_bFaceReversed;
183};
184
198 const OdGePoint3dArray& points,
199 bool& isValid,
200 const OdGeTol& tol = OdGeContext::gTol);
201
216 const OdGePoint3dArray& points,
217 double& volume,
218 const OdGePoint3d* basePoint);
219
239 const OdGePoint3dArray& points,
240 OdGeVector3d* pNormal,
241 const OdGeTol& tol = OdGeContext::gTol);
242
263 const OdGePoint3d* points,
264 OdUInt32 numPoints,
265 OdGeVector3d* pNormal,
266 const OdGeTol& tol = OdGeContext::gTol);
267
268// Same with previous functions, but retrieves result as plane
269
291 const OdGePoint3dArray& points,
292 OdGePlane& plane,
294 bool validateCoplanar = true);
295
316
318 const OdGePoint3d* points,
319 OdUInt32 numPoints,
320 OdGePlane& plane,
322 bool validateCoplanar = true);
323
348 const OdGeCurve3d* const* curves,
349 OdUInt32 numCurves,
350 OdGePlane& plane,
352 bool validateCoplanar = true);
353
379 const OdGeCurve3d* const* curves,
380 const bool* reverseFlags,
381 OdUInt32 numCurves,
382 OdGePlane& plane,
384 bool validateCoplanar = true);
385
397 const OdGeNurbCurve3d& nurb3d,
398 OdGePlane& plane,
399 OdGeNurbCurve2d& nurb2d,
400 const OdGeTol& tol = OdGeContext::gTol);
401
416 const OdGeSurface& pS,
419 const OdGeTol& tol);
420
421// was moved from Examples\Common\toString
431
447 const OdGeSurface* pSurf,
448 const OdGeCurve3d* pCurve,
449 const OdGeCurve2d* pParamCurve,
450 bool& isCoincide,
451 const OdGeTol& tol = OdGeContext::gTol);
452
461
477GE_TOOLKIT_EXPORT bool isPolygonOutOfRect2d(OdUInt32 numPt, const OdGePoint2d* pPoints, const OdGePoint2d& minPt, const OdGePoint2d& maxPt);
478
479#include "TD_PackPop.h"
480
481inline void GE_ERROR(OdResult res)
482{
483 (*OdGeContext::gErrorFunc)(res);
484}
485
492{
493public:
495};
496
497#define GE_NOT_IMPL(pGeEnt) \
498{ \
499 try \
500 { \
501 (*OdGeContext::gErrorFunc)(eNotImplemented); \
502 } \
503 catch (const OdError& err) \
504 { \
505 if (err.code() == eNotImplemented) \
506 { \
507 OdString sFunc(TD_FUNC); \
508 OdString sMessage; \
509 sMessage.format(OD_T("%s method %s for Ge type %s"), \
510 OD_T("%s"), \
511 sFunc.c_str(), \
512 geToString(pGeEnt->type()).c_str()); \
513 throw OdError_GeNotImplemted(sMessage); \
514 } \
515 throw; \
516 } \
517}
518
519#endif // OD_GEGBL_H
520
OdArray< OdGePoint3d, OdMemoryAllocator< OdGePoint3d > > OdGePoint3dArray
tol
OdGe::ErrorCondition OdGeError
Definition Ge.h:535
#define GE_TOOLKIT_EXPORT
Definition GeExport.h:35
#define GE_STATIC_EXPORT
Definition GeExport.h:52
GE_TOOLKIT_EXPORT bool geSurfaceProp(const OdGeSurface &pS, OdGe::NurbSurfaceProperties &propU, OdGe::NurbSurfaceProperties &propV, const OdGeTol &tol)
GE_TOOLKIT_EXPORT bool isPolygonOutOfRect2d(OdUInt32 numPt, const OdGePoint2d *pPoints, const OdGePoint2d &minPt, const OdGePoint2d &maxPt)
GE_TOOLKIT_EXPORT OdString geToString(const OdGe::EntityId val)
OdArray< OdGePoint2d, OdMemoryAllocator< OdGePoint2d > > OdGePoint2dArray
Definition GeGbl.h:45
GE_TOOLKIT_EXPORT double getSignedArea(const OdGePoint2dArray &arrPoints)
GE_TOOLKIT_EXPORT OdGeError geValidSolid(const OdGePoint3dArray &points, bool &isValid, const OdGeTol &tol=OdGeContext::gTol)
void GE_ERROR(OdResult res)
Definition GeGbl.h:481
GE_TOOLKIT_EXPORT OdGeError geCalculateNormal(const OdGePoint3dArray &points, OdGeVector3d *pNormal, const OdGeTol &tol=OdGeContext::gTol)
GE_TOOLKIT_EXPORT OdGeError geSolidSignedVolume(const OdGePoint3dArray &points, double &volume, const OdGePoint3d *basePoint)
GE_TOOLKIT_EXPORT OdGeError geCalculatePlane(const OdGePoint3dArray &points, OdGePlane &plane, const OdGeTol &tol=OdGeContext::gTol, bool validateCoplanar=true)
GE_TOOLKIT_EXPORT OdResult geIsDir2dOnSurfCoincide3d(const OdGeSurface *pSurf, const OdGeCurve3d *pCurve, const OdGeCurve2d *pParamCurve, bool &isCoincide, const OdGeTol &tol=OdGeContext::gTol)
GE_TOOLKIT_EXPORT bool geNurb3dTo2d(const OdGeNurbCurve3d &nurb3d, OdGePlane &plane, OdGeNurbCurve2d &nurb2d, const OdGeTol &tol=OdGeContext::gTol)
unsigned int OdUInt32
OdResult
Definition OdResult.h:29
OdError_GeNotImplemted(const OdString &sMessage)
OdError(OdResult code)
LoopType getLoopType(double dTol)
OdGeLoopCtx(const OdGeSurface *pSurface, const OdArray< std::pair< const OdGeCurve2d *, bool > > &arrCoedges, const OdArray< const OdGeCurve3d * > &arrEdges, bool bFaceReversed)
Definition GeGbl.h:159
@ kLUndefined
Definition GeGbl.h:145
GLsizeiptr size
Definition gles2_ext.h:182
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)
static GE_STATIC_EXPORT OdGeTol gTol
Definition GeGbl.h:67
static GE_STATIC_EXPORT void(* gFreeMem)(void *memBlock)
Definition GeGbl.h:125
static GE_STATIC_EXPORT void(* gOrthoVector)(const OdGeVector3d &vect, OdGeVector3d &orthoVector)
Definition GeGbl.h:105
static GE_STATIC_EXPORT void(* gErrorFunc)(OdResult)
Definition GeGbl.h:81
static GE_STATIC_EXPORT OdGeTol gZeroTol
Definition GeGbl.h:74
EntityId
Definition Ge.h:62
NurbSurfaceProperties
Definition Ge.h:294