CFx SDK Documentation  2020SP3
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
OdSiShape::~OdSiShape
virtual ~OdSiShape()
Definition: SiSpatialIndex.h:67
OdSiSpatialIndex
Definition: SiSpatialIndex.h:118
OdSiShape::clone
virtual OdSiShape * clone() const
Definition: SiSpatialIndex.h:68
OdSiSpatialIndex::insert
virtual void insert(OdSiEntity *entity)=0
OdSi
Definition: SiVolume.h:34
tol
tol
Definition: DimVarDefs.h:2287
OdRxObject
Definition: RxObject.h:564
GeExtents3d.h
OdSiSpatialIndex::setTolerance
virtual void setTolerance(const OdGeTol &tol)=0
OdSiVisitor::visit
virtual void visit(OdSiEntity *entity, bool completelyInside)=0
TD_PackPop.h
OdSiSpatialIndex::remove
virtual bool remove(OdSiEntity *entity)=0
ODSI_API_STATIC
#define ODSI_API_STATIC
Definition: SiSpatialIndex.h:34
RxObject.h
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdSiEntity
Definition: SiSpatialIndex.h:81
OdSmartPtr< OdSiSpatialIndex >
OdSiSpatialIndex::setMaxNodeSize
virtual void setMaxNodeSize(unsigned char maxCount)=0
OdSiSpatialIndex::tolerance
virtual const OdGeTol & tolerance() const =0
OdSiSpatialIndexPtr
OdSmartPtr< OdSiSpatialIndex > OdSiSpatialIndexPtr
Definition: SiSpatialIndex.h:110
maxCount
GLsizei maxCount
Definition: gles2_ext.h:276
OdSiShape::kOverallSpace
static ODSI_API_STATIC const OdSiShape & kOverallSpace
Definition: SiSpatialIndex.h:69
OdSiSpatialIndex::query
virtual void query(const OdSiShape &shape, OdSiVisitor &visitor) const =0
OdSiSpatialIndex::setMaxTreeDepth
virtual void setMaxTreeDepth(unsigned char maxDepth)=0
OdSiSpatialIndex::createObject
static OdSiSpatialIndexPtr createObject(OdUInt32 flags, unsigned int initialNumEntity, unsigned int maxDepth=30, unsigned int maxCount=20, double eps=1e-10)
OdPlatformSettings.h
GeExtents2d.h
TD_PackPush.h
OdSiVisitor
Definition: SiSpatialIndex.h:98
OdSiShape
Definition: SiSpatialIndex.h:51
ODSI_API
#define ODSI_API
Definition: SiSpatialIndex.h:33
OdSiSpatialIndex::CreationFlags
CreationFlags
Definition: SiSpatialIndex.h:126
OdSiShape::contains
virtual bool contains(const OdGeExtents3d &extents, bool planar, const OdGeTol &tol=OdGeContext::gTol) const =0
OdSiSpatialIndex::clear
virtual void clear()=0
OdSiSpatialIndex::maxTreeDepth
virtual unsigned maxTreeDepth() const =0
OdGeContext::gTol
static GE_STATIC_EXPORT OdGeTol gTol
Definition: GeGbl.h:60
OdGeExtents3d
Definition: GeExtents3d.h:45
OdSiSpatialIndex::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdSiSpatialIndex)
OdSiSpatialIndex::extents
virtual bool extents(OdGeExtents3d &extents) const =0
OdSiSpatialIndex::maxNodeSize
virtual unsigned maxNodeSize() const =0
OdSiShape::intersects
virtual bool intersects(const OdGeExtents3d &extents, bool planar, const OdGeTol &tol=OdGeContext::gTol) const =0
OdSiShape::kNoSpace
static ODSI_API_STATIC const OdSiShape & kNoSpace
Definition: SiSpatialIndex.h:72
OdSiShape::transform
virtual void transform(const OdGeMatrix3d &)
Definition: SiSpatialIndex.h:69
OdGeTol
Definition: GeTol.h:49
OdSiEntity::extents
virtual bool extents(OdGeExtents3d &extents) const =0
OdSi::properExtents
bool ODSI_API properExtents(const OdGeExtents3d &ext)