CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GeGbl.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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-2022 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
28#include "Ge/GeTol.h"
29
30#include "Ge/Ge.h"
31#include "OdArrayPreDef.h"
33#include "Ge/GePoint3dArray.h"
34
35class OdGeSurface;
36class OdGeVector3d;
37class OdGePlane;
38class OdGeCurve3d;
39class OdGeNurbCurve2d;
40class OdGeNurbCurve3d;
41class OdGePoint3d;
42class OdGePoint2d;
43class OdGeCurve2d;
44
45#include "TD_PackPush.h"
46
47#define STL_USING_ALGORITHM
48#include <OdaSTL.h>
49
59{
66
73
79 GE_STATIC_EXPORT static void (*gErrorFunc)(OdResult);
80
103 GE_STATIC_EXPORT static void (*gOrthoVector) (const OdGeVector3d& vect, OdGeVector3d& orthoVector);
104
112 GE_STATIC_EXPORT static void* (*gAllocMem) (unsigned long size);
113
114
123 GE_STATIC_EXPORT static void (*gFreeMem) (void* memBlock);
124};
125
135{
136public:
141 {
147 kLInner
148 };
157 OdGeLoopCtx(const OdGeSurface* pSurface, const OdArray<std::pair<const OdGeCurve2d*, bool> >& arrCoedges, const OdArray<const OdGeCurve3d*>& arrEdges, bool bFaceReversed)
158 : m_bFaceReversed(bFaceReversed)
159 , m_pSurface(pSurface)
160 , m_arrCoedges(arrCoedges)
161 , m_arrEdges(arrEdges)
162 {}
163
175 LoopType getLoopType(double dTol);
176private:
178 const OdArray<const OdGeCurve3d*>& m_arrEdges;
179 bool m_bFaceReversed;
180 const OdGeSurface* m_pSurface;
181};
182
196 const OdGePoint3dArray& points,
197 bool& isValid,
198 const OdGeTol& tol = OdGeContext::gTol);
199
214 const OdGePoint3dArray& points,
215 double& volume,
216 const OdGePoint3d* basePoint);
217
237 const OdGePoint3dArray& points,
238 OdGeVector3d* pNormal,
239 const OdGeTol& tol = OdGeContext::gTol);
240
261 const OdGePoint3d* points,
262 OdUInt32 numPoints,
263 OdGeVector3d* pNormal,
264 const OdGeTol& tol = OdGeContext::gTol);
265
266// Same with previous functions, but retrieves result as plane
267
289 const OdGePoint3dArray& points,
290 OdGePlane& plane,
292 bool validateCoplanar = true);
293
316 const OdGePoint3d* points,
317 OdUInt32 numPoints,
318 OdGePlane& plane,
320 bool validateCoplanar = true);
321
346 const OdGeCurve3d* const* curves,
347 OdUInt32 numCurves,
348 OdGePlane& plane,
350 bool validateCoplanar = true);
351
363 const OdGeNurbCurve3d& nurb3d,
364 OdGePlane& plane,
365 OdGeNurbCurve2d& nurb2d,
366 const OdGeTol& tol = OdGeContext::gTol);
367
382 const OdGeSurface& pS,
385 const OdGeTol& tol);
386
387// was moved from Examples\Common\toString
397
413 const OdGeSurface* pSurf,
414 const OdGeCurve3d* pCurve,
415 const OdGeCurve2d* pParamCurve,
416 bool& isCoincide,
417 const OdGeTol& tol = OdGeContext::gTol);
418
427
443GE_TOOLKIT_EXPORT bool isPolygonOutOfRect2d(OdUInt32 numPt, const OdGePoint2d* pPoints, const OdGePoint2d& minPt, const OdGePoint2d& maxPt);
444
445#include "TD_PackPop.h"
446
447inline void GE_ERROR(OdResult res)
448{
449 (*OdGeContext::gErrorFunc)(res);
450}
451
458{
459public:
461};
462
463#define GE_NOT_IMPL(pGeEnt) \
464{ \
465 try \
466 { \
467 (*OdGeContext::gErrorFunc)(eNotImplemented); \
468 } \
469 catch (const OdError& err) \
470 { \
471 if (err.code() == eNotImplemented) \
472 { \
473 OdString sFunc(TD_FUNC); \
474 OdString sMessage; \
475 sMessage.format(OD_T("%s method %s for Ge type %s"), \
476 OD_T("%s"), \
477 sFunc.c_str(), \
478 geToString(pGeEnt->type()).c_str()); \
479 throw OdError_GeNotImplemted(sMessage); \
480 } \
481 throw; \
482 } \
483}
484
485#endif // OD_GEGBL_H
486
tol
Definition: DimVarDefs.h:2287
#define GE_TOOLKIT_EXPORT
Definition: GeExport.h:49
#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)
GE_TOOLKIT_EXPORT OdGeError geValidSolid(const OdGePoint3dArray &points, bool &isValid, const OdGeTol &tol=OdGeContext::gTol)
GE_TOOLKIT_EXPORT double getSignedArea(const OdArray< OdGePoint2d, OdMemoryAllocator< OdGePoint2d > > &arrPoints)
void GE_ERROR(OdResult res)
Definition: GeGbl.h:447
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)
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:157
@ kLOuter
Definition: GeGbl.h:145
@ kLUndefined
Definition: GeGbl.h:143
Definition: GeTol.h:49
GLsizeiptr size
Definition: gles2_ext.h:182
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)
static GE_STATIC_EXPORT OdGeTol gTol
Definition: GeGbl.h:65
static GE_STATIC_EXPORT OdGeTol gZeroTol
Definition: GeGbl.h:72
ErrorCondition
Definition: Ge.h:413
EntityId
Definition: Ge.h:62
NurbSurfaceProperties
Definition: Ge.h:292