CFx SDK Documentation  2022 SP0
DbSurface.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 _DBSURFACE_H_INCLUDED_
26 #define _DBSURFACE_H_INCLUDED_
27 // This application incorporates Teigha(R) software pursuant to a license
28 // agreement with Open Design Alliance.
29 // Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance.
30 // All rights reserved.
31 //
32 // By use of this software, its documentation or related materials, you
33 
34 #include "TD_PackPush.h"
35 #include "ModelerDefs.h"
36 #include "DbEntity.h"
37 #include "Db3dSolid.h"
38 
39 class OdModelerGeometry;
40 class OdStreamBuf;
41 class OdBrBrep;
42 
43 class OdDbSurface;
44 class OdDbNurbSurface;
45 
50 
55 
60 {
62  kExtendEdge = 0x00,
64  kStretchEdge = 0x01,
65 };
66 
76 {
77 public:
80 
84  virtual OdUInt16 uIsolineDensity() const;
85 
91  virtual void setUIsolineDensity(OdUInt16 numIsolines);
92 
96  virtual OdUInt16 vIsolineDensity() const;
97 
103  virtual void setVIsolineDensity(OdUInt16 numIsolines);
104 
118  static OdResult createFrom ( const OdDbEntity* pFromEntity, OdDbSurfacePtr& pNewSurface );
119 
135 
152  virtual OdResult thicken(double thickness, bool bBothSides, OdDb3dSolidPtr& pSolid) const;
153 
167  virtual OdResult getArea(double& area) const;
168 
172  bool isNull() const;
173 
184  OdStreamBuf* pStreamBuf,
185  AfTypeVer typeVer = kAfTypeVerAny);
186 
199  OdStreamBuf* pStreamBuf,
200  AfTypeVer *pTypeVer = 0);
201 
206  void brep( OdBrBrep& brep );
207 
209  OdDb::DwgVersion ver,
210  OdDbObjectId& replaceId,
211  bool& exchangeXData);
212 
214  OdRxObjectPtrArray& entitySet) const;
215 
217  const OdGeMatrix3d& xfm );
218 
226  virtual OdResult setBody( const void* pGeometry );
227 
231  virtual void *body( ) const;
232 
233  // OdDbObject methods
235  OdDbDwgFiler* pFiler);
236 
237  virtual void dwgOutFields(
238  OdDbDwgFiler* pFiler) const;
239 
241  OdDbDxfFiler* pFiler);
242 
243  virtual void dxfOutFields(
244  OdDbDxfFiler* pFiler) const;
245 
246  virtual bool subWorldDraw(
247  OdGiWorldDraw* pWd) const;
248 
250  void* pClsid) const;
251 
255  virtual OdDbSubentId internalSubentId(void* ent) const;
259  virtual void* internalSubentPtr(const OdDbSubentId& id) const;
260 
281  OdDbEntityPtr pEntity,
282  unsigned int flags ) const;
283 
298  virtual OdResult booleanUnion(const OdDbSurfacePtr pSurface, OdDbSurfacePtr& pNewSurface);
299 
315  virtual OdResult booleanSubtract(const OdDbSurfacePtr pSurface, OdDbSurfacePtr& pNewSurface);
316 
332  virtual OdResult booleanSubtract(const OdDb3dSolidPtr pSolid, OdDbSurfacePtr& pNewSurface);
333 
350  virtual OdResult booleanIntersect(const OdDbSurfacePtr pSurface2, OdDbEntityPtrArray& intersectionEntities);
351 
368  virtual OdResult booleanIntersect(const OdDb3dSolidPtr pSolid, OdDbEntityPtrArray& intersectionEntities);
369 
385  virtual OdResult imprintEntity(const OdDbEntityPtr pEntity);
386 
402  virtual OdResult createSectionObjects(const OdGePlane& sectionPlane, OdDbEntityPtrArray& sectionObjects) const;
403 
417  virtual OdResult sliceByPlane(const OdGePlane& slicePlane,
418  OdDbSurfacePtr& pNegHalfSurface,
419  OdDbSurfacePtr& pNewSurface);
435  virtual OdResult sliceBySurface(const OdDbSurfacePtr pSlicingSurface,
436  OdDbSurfacePtr& pNegHalfSurface,
437  OdDbSurfacePtr& pNewSurface);
438 
453  virtual OdResult chamferEdges(const OdArray<OdDbSubentId *> &edgeSubentIds,
454  const OdDbSubentId& baseFaceSubentId,
455  double baseDist,
456  double otherDist);
457 
472  virtual OdResult filletEdges( const OdArray<OdDbSubentId *> &edgeSubentIds,
473  const OdGeDoubleArray& radius,
474  const OdGeDoubleArray& startSetback,
475  const OdGeDoubleArray& endSetback);
476 
477  virtual OdResult setSubentColor(const OdDbSubentId& subentId, const OdCmColor& color);
478  virtual OdResult getSubentColor(const OdDbSubentId& subentId, OdCmColor& color) const;
479  virtual OdResult setSubentMaterial(const OdDbSubentId& subentId, const OdDbObjectId& matId);
480  virtual OdResult getSubentMaterial(const OdDbSubentId& subentId, OdDbObjectId& matId) const;
481  virtual OdResult setSubentMaterialMapper(const OdDbSubentId& subentId, const OdGiMapper& mapper);
482  virtual OdResult getSubentMaterialMapper(const OdDbSubentId& subentId, OdGiMapper& mapper) const;
483 
485  OdGsMarkerArray& gsMarkers) const;
486 
488  OdGsMarker gsMark,
489  const OdGePoint3d& pickPoint,
490  const OdGeMatrix3d& viewXform,
491  OdDbFullSubentPathArray& subentPaths,
492  const OdDbObjectIdArray* pEntAndInsertStack = 0) const;
493 
494  virtual OdResult subGetTransformedCopy(const OdGeMatrix3d& mat, OdDbEntityPtr& pCopy) const;
495 
510 
512 
532  static OdResult trimSurface(const OdDbObjectId& blankSurfaceId,
533  const OdDbObjectIdArray& toolIds,
534  const OdDbObjectIdArray& toolCurveIds,
535  const OdGeVector3dArray& projVectors,
536  const OdGePoint3d& pickPoint,
537  const OdGeVector3d& viewVector,
538  bool bAutoExtend,
539  bool bAssociativeEnabled);
540 
556  OdResult projectOnToSurface(const OdDbEntity* pEntityToProject,
557  const OdGeVector3d& projectionDirection,
558  OdDbEntityPtrArray& projectedEntities) const;
559 
571  OdResult getPerimeter(double&) const;
572 
588  OdResult rayTest( const OdGePoint3d& rayBasePoint,
589  const OdGeVector3d& rayDir,
590  double rayRadius,
591  OdArray<OdDbSubentId> & subEntIds,
592  OdGeDoubleArray& parameters) const;
593 
608  static OdResult createOffsetSurface ( OdDbEntity* pInputSurface,
609  double dOffsetDistance,
610  OdDbEntityPtr& offsetSurface);
611 
627  static OdResult createOffsetSurface ( OdDbEntity* pInputSurface,
628  double dOffsetDistance,
629  bool bAssociativeEnabled,
630  OdDbObjectId& offsetSurfaceId);
631 
635  static OdResult createFilletSurface ( const OdDbObjectId& surfId1,
636  const OdGePoint3d& pickPt1,
637  const OdDbObjectId& surfId2,
638  const OdGePoint3d& pickPt2,
639  double dRadius,
640  OdDb::FilletTrimMode trimMode,
641  const OdGeVector3d& projDir,
642  OdDbSurface*& filletSurface);
643 
647  static OdResult createFilletSurface ( const OdDbObjectId& surfId1,
648  const OdGePoint3d& pickPt1,
649  const OdDbObjectId& surfId2,
650  const OdGePoint3d& pickPt2,
651  double dRadius,
652  OdDb::FilletTrimMode trimMode,
653  const OdGeVector3d& projDir,
654  bool bAssociativeEnabled,
655  OdDbObjectId& filletSurfaceId);
656 
660  static OdResult createExtendSurface ( OdDbObjectId sourceSurface,
661  const OdArray<OdDbSubentId>& edgesId,
662  double dExtDist,
663  EdgeExtensionType extOption,
664  bool bAssociativeEnabled,
665  OdDbObjectId& newExtendSurfaceId );
666 
671  double dExtDist,
672  EdgeExtensionType extOption,
673  bool bAssociativeEnabled );
674 
675  virtual OdResult subGetGeomExtents( OdGeExtents3d& extents) const;
676 };
677 
678 #include "TD_PackPop.h"
679 #endif //_DBSURFACE_H_INCLUDED_
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbSurface > OdDbSurfacePtr
Definition: DbSurface.h:54
OdArray< OdDbNurbSurface *, OdMemoryAllocator< OdDbNurbSurface * > > OdDbNurbSurfaceArray
Definition: DbSurface.h:44
EdgeExtensionType
Definition: DbSurface.h:60
@ kStretchEdge
Definition: DbSurface.h:64
@ kExtendEdge
Definition: DbSurface.h:62
@ kAfTypeVerAny
Definition: ModelerDefs.h:80
int AfTypeVer
Definition: ModelerDefs.h:29
ptrdiff_t OdGsMarker
unsigned int OdUInt32
unsigned short OdUInt16
OdResult
Definition: OdResult.h:29
virtual OdResult convertToRegion(OdDbEntityPtrArray &regions)
static OdResult createFilletSurface(const OdDbObjectId &surfId1, const OdGePoint3d &pickPt1, const OdDbObjectId &surfId2, const OdGePoint3d &pickPt2, double dRadius, OdDb::FilletTrimMode trimMode, const OdGeVector3d &projDir, bool bAssociativeEnabled, OdDbObjectId &filletSurfaceId)
OdResult acisIn(OdStreamBuf *pStreamBuf, AfTypeVer *pTypeVer=0)
virtual OdResult subGetSubentPathsAtGsMarker(OdDb::SubentType type, OdGsMarker gsMark, const OdGePoint3d &pickPoint, const OdGeMatrix3d &viewXform, OdDbFullSubentPathArray &subentPaths, const OdDbObjectIdArray *pEntAndInsertStack=0) const
static OdResult createExtendSurface(OdDbObjectId sourceSurface, const OdArray< OdDbSubentId > &edgesId, double dExtDist, EdgeExtensionType extOption, bool bAssociativeEnabled, OdDbObjectId &newExtendSurfaceId)
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
virtual OdResult imprintEntity(const OdDbEntityPtr pEntity)
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
virtual OdResult booleanIntersect(const OdDb3dSolidPtr pSolid, OdDbEntityPtrArray &intersectionEntities)
static OdResult createOffsetSurface(OdDbEntity *pInputSurface, double dOffsetDistance, bool bAssociativeEnabled, OdDbObjectId &offsetSurfaceId)
virtual OdResult booleanSubtract(const OdDbSurfacePtr pSurface, OdDbSurfacePtr &pNewSurface)
OdResult projectOnToSurface(const OdDbEntity *pEntityToProject, const OdGeVector3d &projectionDirection, OdDbEntityPtrArray &projectedEntities) const
virtual OdResult filletEdges(const OdArray< OdDbSubentId * > &edgeSubentIds, const OdGeDoubleArray &radius, const OdGeDoubleArray &startSetback, const OdGeDoubleArray &endSetback)
virtual void setVIsolineDensity(OdUInt16 numIsolines)
virtual OdUInt32 subSetAttributes(OdGiDrawableTraits *pTraits) const
virtual OdResult getSubentMaterial(const OdDbSubentId &subentId, OdDbObjectId &matId) const
virtual OdResult getSubentMaterialMapper(const OdDbSubentId &subentId, OdGiMapper &mapper) const
virtual void setUIsolineDensity(OdUInt16 numIsolines)
virtual OdResult getSubentColor(const OdDbSubentId &subentId, OdCmColor &color) const
virtual OdResult setSubentMaterialMapper(const OdDbSubentId &subentId, const OdGiMapper &mapper)
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm)
virtual OdResult booleanIntersect(const OdDbSurfacePtr pSurface2, OdDbEntityPtrArray &intersectionEntities)
virtual void * body() const
virtual OdResult subGetGeomExtents(OdGeExtents3d &extents) const
virtual OdResult chamferEdges(const OdArray< OdDbSubentId * > &edgeSubentIds, const OdDbSubentId &baseFaceSubentId, double baseDist, double otherDist)
static OdResult trimSurface(const OdDbObjectId &blankSurfaceId, const OdDbObjectIdArray &toolIds, const OdDbObjectIdArray &toolCurveIds, const OdGeVector3dArray &projVectors, const OdGePoint3d &pickPoint, const OdGeVector3d &viewVector, bool bAutoExtend, bool bAssociativeEnabled)
virtual OdResult getArea(double &area) const
virtual void * internalSubentPtr(const OdDbSubentId &id) const
virtual OdUInt16 uIsolineDensity() const
virtual OdResult createInterferenceObjects(OdDbEntityPtrArray &interferenceObjects, OdDbEntityPtr pEntity, unsigned int flags) const
virtual OdResult setSubentMaterial(const OdDbSubentId &subentId, const OdDbObjectId &matId)
virtual OdResult booleanSubtract(const OdDb3dSolidPtr pSolid, OdDbSurfacePtr &pNewSurface)
virtual OdResult sliceBySurface(const OdDbSurfacePtr pSlicingSurface, OdDbSurfacePtr &pNegHalfSurface, OdDbSurfacePtr &pNewSurface)
static OdResult createOffsetSurface(OdDbEntity *pInputSurface, double dOffsetDistance, OdDbEntityPtr &offsetSurface)
virtual OdDbSubentId internalSubentId(void *ent) const
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
OdResult acisOut(OdStreamBuf *pStreamBuf, AfTypeVer typeVer=kAfTypeVerAny)
virtual OdResult subGetGsMarkersAtSubentPath(const OdDbFullSubentPath &subPath, OdGsMarkerArray &gsMarkers) const
OdResult getPerimeter(double &) const
void brep(OdBrBrep &brep)
OdResult rayTest(const OdGePoint3d &rayBasePoint, const OdGeVector3d &rayDir, double rayRadius, OdArray< OdDbSubentId > &subEntIds, OdGeDoubleArray &parameters) const
virtual OdDbObjectPtr decomposeForSave(OdDb::DwgVersion ver, OdDbObjectId &replaceId, bool &exchangeXData)
static OdResult createFrom(const OdDbEntity *pFromEntity, OdDbSurfacePtr &pNewSurface)
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const
virtual OdResult setSubentColor(const OdDbSubentId &subentId, const OdCmColor &color)
virtual OdResult convertToNurbSurface(OdDbNurbSurfaceArray &nurbSurfaceArray)
virtual OdResult subExplode(OdRxObjectPtrArray &entitySet) const
OdResult extendEdges(OdDbFullSubentPathArray &edgesId, double dExtDist, EdgeExtensionType extOption, bool bAssociativeEnabled)
virtual OdResult setBody(const void *pGeometry)
virtual OdResult createSectionObjects(const OdGePlane &sectionPlane, OdDbEntityPtrArray &sectionObjects) const
ODDB_DECLARE_MEMBERS(OdDbSurface)
virtual OdResult sliceByPlane(const OdGePlane &slicePlane, OdDbSurfacePtr &pNegHalfSurface, OdDbSurfacePtr &pNewSurface)
virtual OdUInt16 vIsolineDensity() const
bool isNull() const
virtual OdResult subGetClassID(void *pClsid) const
virtual OdResult thicken(double thickness, bool bBothSides, OdDb3dSolidPtr &pSolid) const
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
virtual OdDbEntityPtr subSubentPtr(const OdDbFullSubentPath &id) const
virtual OdResult subGetTransformedCopy(const OdGeMatrix3d &mat, OdDbEntityPtr &pCopy) const
virtual OdResult booleanUnion(const OdDbSurfacePtr pSurface, OdDbSurfacePtr &pNewSurface)
static OdResult createFilletSurface(const OdDbObjectId &surfId1, const OdGePoint3d &pickPt1, const OdDbObjectId &surfId2, const OdGePoint3d &pickPt2, double dRadius, OdDb::FilletTrimMode trimMode, const OdGeVector3d &projDir, OdDbSurface *&filletSurface)
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
FilletTrimMode
Definition: DbDatabase.h:379
DwgVersion
Definition: OdaDefs.h:46