CFx SDK Documentation  2022 SP0
GeGbl.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 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"
32 #include "Ge/GeSurfacePtrArray.h"
33 #include "Ge/GePoint3dArray.h"
34 
35 class OdGeSurface;
36 class OdGeVector3d;
37 class OdGePlane;
38 class OdGeCurve3d;
39 class OdGeNurbCurve2d;
40 class OdGeNurbCurve3d;
41 class OdGePoint3d;
42 
43 #include "TD_PackPush.h"
44 
54 {
61 
68 
74  GE_STATIC_EXPORT static void (*gErrorFunc)(OdResult);
75 
95  GE_STATIC_EXPORT static void (*gOrthoVector) (const OdGeVector3d& vect, OdGeVector3d& orthoVector);
96 
104  GE_STATIC_EXPORT static void* (*gAllocMem) (unsigned long size);
105 
106 
115  GE_STATIC_EXPORT static void (*gFreeMem) (void* memBlock);
116 };
117 
131  const OdGePoint3dArray &points,
132  bool &isValid,
133  const OdGeTol &tol = OdGeContext::gTol);
134 
149  const OdGePoint3dArray &points,
150  double &volume,
151  const OdGePoint3d *basePoint);
152 
173  const OdGePoint3dArray& points,
174  OdGeVector3d * pNormal,
175  const OdGeTol& tol = OdGeContext::gTol);
176 
178  const OdGePoint3d *points,
179  OdUInt32 numPoints,
180  OdGeVector3d * pNormal,
181  const OdGeTol& tol = OdGeContext::gTol);
182 
183 // Same with previous functions, but returns result as plane
184 
209  const OdGePoint3dArray& points,
210  OdGePlane& plane,
211  const OdGeTol& tol = OdGeContext::gTol);
212 
214  const OdGePoint3d *points,
215  OdUInt32 numPoints,
216  OdGePlane& plane,
217  const OdGeTol& tol = OdGeContext::gTol);
218 
220  const OdGeCurve3d * const* curves,
221  OdUInt32 numCurves,
222  OdGePlane& plane,
223  const OdGeTol& tol = OdGeContext::gTol);
224 
236  const OdGeNurbCurve3d &nurb3d,
237  OdGePlane& plane,
238  OdGeNurbCurve2d &nurb2d,
239  const OdGeTol& tol = OdGeContext::gTol);
240 
254  const OdGeSurface &pS,
257  const OdGeTol& tol);
258 
259 // was moved from Examples\Common\toString
262 
263 #include "TD_PackPop.h"
264 
265 inline void GE_ERROR(OdResult res)
266 {
267  (*OdGeContext::gErrorFunc)(res);
268 }
269 
276 {
277 public:
279 };
280 
281 #define GE_NOT_IMPL(pGeEnt) \
282 { \
283  try \
284  { \
285  (*OdGeContext::gErrorFunc)(eNotImplemented); \
286  } \
287  catch (OdError &err) \
288  { \
289  if (err.code() == eNotImplemented) \
290  { \
291  OdString sFunc(TD_FUNC); \
292  OdString sMessage; \
293  sMessage.format(OD_T("%s method %s for Ge type %s"), \
294  OD_T("%s"), \
295  sFunc.c_str(), \
296  geToString(pGeEnt->type()).c_str()); \
297  throw OdError_GeNotImplemted(sMessage); \
298  } \
299  throw; \
300  } \
301 }
302 
303 #endif // OD_GEGBL_H
304 
tol
Definition: DimVarDefs.h:2287
#define GE_TOOLKIT_EXPORT
Definition: GeExport.h:49
#define GE_STATIC_EXPORT
Definition: GeExport.h:53
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)
Convert the specified value to an OdGe::EntityId string.
GE_TOOLKIT_EXPORT OdGeError geCalculatePlane(const OdGePoint3dArray &points, OdGePlane &plane, const OdGeTol &tol=OdGeContext::gTol)
GE_TOOLKIT_EXPORT OdGeError geValidSolid(const OdGePoint3dArray &points, bool &isValid, const OdGeTol &tol=OdGeContext::gTol)
void GE_ERROR(OdResult res)
Definition: GeGbl.h:265
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 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)
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:60
static GE_STATIC_EXPORT OdGeTol gZeroTol
Definition: GeGbl.h:67
ErrorCondition
Definition: Ge.h:228
EntityId
Definition: Ge.h:53
NurbSurfaceProperties
Definition: Ge.h:166