CFx SDK Documentation  2022 SP0
SiSpatialIndex.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 #ifndef _SpatialIndex_h_Included_
25 #define _SpatialIndex_h_Included_
26 
27 #include "OdPlatformSettings.h"
28 
29 #ifdef SPATIALINDEX_DLL_EXPORTS
30  #define ODSI_API OD_TOOLKIT_EXPORT
31  #define ODSI_API_STATIC OD_STATIC_EXPORT
32 #else
33  #define ODSI_API OD_TOOLKIT_IMPORT
34  #define ODSI_API_STATIC OD_STATIC_IMPORT
35 #endif
36 
38 
39 #include "RxObject.h"
40 #include "Ge/GeExtents3d.h"
41 #include "Ge/GeExtents2d.h"
42 
43 #include "TD_PackPush.h"
44 
51 {
58  virtual bool contains( const OdGeExtents3d& extents, bool planar, const OdGeTol& tol = OdGeContext::gTol ) const = 0;
65  virtual bool intersects( const OdGeExtents3d& extents, bool planar, const OdGeTol& tol = OdGeContext::gTol ) const = 0;
66 
67  virtual ~OdSiShape() {};
68  virtual OdSiShape* clone() const { return 0; }
69  virtual void transform(const OdGeMatrix3d&) {};
70 
73 };
80 struct OdSiEntity
81 {
89  virtual bool extents(OdGeExtents3d& extents) const = 0;
90 };
91 
98 {
103  virtual void visit( OdSiEntity* entity, bool completelyInside ) = 0;
104 };
105 
111 
118 {
119 public:
121 
126  {
127  kSiNoFlags = 0,
128 
129  kSiPlanar = (1 << 0), // Create 2D Spatial Index.
130  kSiModifyMtAware = (1 << 1), // Protect insert/remove/clear by mutex object.
131  kSiAccessMtAware = (1 << 2), // Protect query/extents/tolerance by mutex object.
132 
133  kSiFullMtAware = (kSiModifyMtAware | kSiAccessMtAware)
134  };
135 
148  static OdSiSpatialIndexPtr createObject( OdUInt32 flags, unsigned int initialNumEntity, unsigned int maxDepth = 30, unsigned int maxCount = 20, double eps = 1e-10 );
149 
154  virtual void insert( OdSiEntity* entity ) = 0;
161  virtual bool remove( OdSiEntity* entity ) = 0;
162 
167  virtual void query( const OdSiShape& shape, OdSiVisitor& visitor ) const = 0;
171  virtual void clear() = 0;
178  virtual void setMaxTreeDepth( unsigned char maxDepth ) = 0;
183  virtual void setMaxNodeSize( unsigned char maxCount ) = 0;
191  virtual bool extents(OdGeExtents3d& extents) const = 0;
192 
198  virtual unsigned maxTreeDepth() const = 0;
199 
203  virtual unsigned maxNodeSize() const = 0;
204 
211  virtual const OdGeTol& tolerance() const = 0;
212 
213  virtual void setTolerance(const OdGeTol& tol) = 0;
214 };
215 
216 namespace OdSi
217 {
219 }
220 
221 #include "TD_PackPop.h"
222 
223 #endif
tol
Definition: DimVarDefs.h:2287
unsigned int OdUInt32
#define ODSI_API
#define ODSI_API_STATIC
OdSmartPtr< OdSiSpatialIndex > OdSiSpatialIndexPtr
Definition: GeTol.h:49
virtual void clear()=0
static OdSiSpatialIndexPtr createObject(OdUInt32 flags, unsigned int initialNumEntity, unsigned int maxDepth=30, unsigned int maxCount=20, double eps=1e-10)
virtual void setTolerance(const OdGeTol &tol)=0
virtual void insert(OdSiEntity *entity)=0
virtual void setMaxNodeSize(unsigned char maxCount)=0
virtual unsigned maxNodeSize() const =0
ODRX_DECLARE_MEMBERS(OdSiSpatialIndex)
virtual unsigned maxTreeDepth() const =0
virtual void query(const OdSiShape &shape, OdSiVisitor &visitor) const =0
virtual bool remove(OdSiEntity *entity)=0
virtual bool extents(OdGeExtents3d &extents) const =0
virtual void setMaxTreeDepth(unsigned char maxDepth)=0
virtual const OdGeTol & tolerance() const =0
GLsizei maxCount
Definition: gles2_ext.h:276
Definition: SiVolume.h:34
bool ODSI_API properExtents(const OdGeExtents3d &ext)
static GE_STATIC_EXPORT OdGeTol gTol
Definition: GeGbl.h:60
virtual bool extents(OdGeExtents3d &extents) const =0
virtual ~OdSiShape()
virtual OdSiShape * clone() const
static ODSI_API_STATIC const OdSiShape & kOverallSpace
virtual bool contains(const OdGeExtents3d &extents, bool planar, const OdGeTol &tol=OdGeContext::gTol) const =0
virtual bool intersects(const OdGeExtents3d &extents, bool planar, const OdGeTol &tol=OdGeContext::gTol) const =0
virtual void transform(const OdGeMatrix3d &)
static ODSI_API_STATIC const OdSiShape & kNoSpace
virtual void visit(OdSiEntity *entity, bool completelyInside)=0