CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DbPartialViewing.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 _DBVIEWERSTREAMER_API_H_
26#define _DBVIEWERSTREAMER_API_H_
27
28#include "RxObject.h"
29#include "DbIndex.h"
30#include "Si/SiSpatialIndex.h"
31#include "Gs/GsSpatialQuery.h"
32#include "Gs/Gs.h"
33
34#include "TD_PackPush.h"
35
36#include "DbObjectIterator.h"
37#include "DbBlockIterator.h"
38
44public:
45 struct Entry : OdSiEntity {
51
53 extents.set(pt1, pt2);
54 return extents.isValidExtents();
55 }
56
57 static Entry* cast(OdSiEntity *siEntity) {
58 return static_cast<Entry*>(siEntity);
59 }
60
62 {
63 pNext[ 0 ] = NULL; pNext[ 1 ] = NULL;
64 pPrev[ 0 ] = NULL; pPrev[ 1 ] = NULL;
65 }
66 };
67
68private:
70 bool isPlanar;
72
73 void compute(OdDbBlockTableRecord* pBlock);
74
75 void reset(OdUInt32 n, bool isPlanar = false) {
76 buffer.clear();
77 buffer.resize(n);
78 if (si.isNull() || this->isPlanar != isPlanar)
79 si = OdSiSpatialIndex::createObject(isPlanar, n);
80 else
81 si->clear();
82 this->isPlanar = isPlanar;
83 }
84
85 void clear() {
86 buffer.clear();
87 if (si.get())
88 si->clear();
89 isPlanar = false;
90 }
91public:
93
95
97
98 virtual void rebuildFull(OdDbIndexUpdateData* pIdxData);
100
102
103 virtual void dwgOutFields(OdDbDwgFiler* pFiler) const;
104
105 void query(const OdSiShape& query, OdSiVisitor& visitor);
106
107 inline bool getWorldExtents(OdGeExtents3d& ext) const {
108 return si->extents(ext);
109 }
110
111 virtual void extend( OdDbObjectId entId, const OdGeExtents3d& extents );
112};
113
115
121 OdGsViewPtr view;
122public:
124
126
127 virtual OdRxClass* indexClass() const;
128
129 void set(const OdGsView* view);
130
131 const OdGsView* get() const;
132};
133
135
136
142public:
143 class DataManagerContext;
144
162
164 public:
166 virtual void manageData(OdDbObjectIterator& willBeShown, OdDbObjectIterator& mayBeUnloaded) = 0;
167 virtual OdMutex* accessMutex() { return NULL; }
168 };
170
171 virtual void filterViewingData(OdGsDevice* filterSettings,
172 DataManagerContext* dataManager, OdArray<OdDbFilterPtr>* pFilters = 0,
173 bool bForceCreateIndexes = false, bool bEnableUnload = true ) = 0;
174
175 virtual void addIndex(OdGsDevice* filterSettings) = 0;
176
177 virtual void addIndex(OdDbBlockTableRecord* pBTR, bool bUpdate = true) = 0;
178
179 virtual bool hasIndex(OdDbBlockTableRecord *pBTR, bool bCheckExtents = false) = 0;
180
181 virtual void extendIndex( OdDbBlockTableRecord* pBTR, OdDbStub* id, const OdGeExtents3d& ext ) = 0;
182
184
185 virtual OdDbObjectIteratorPtr filterCustomViewingData( OdDbObjectId blockId, OdDbDatabase* pDb, OdGsView* pGsView, const OdGeMatrix3d& transformMatrix, bool bForceCreateIndexes = false ) = 0;
186
187 virtual OdUInt64 countUnloadedEntries( OdGsDevice* filterSettings ) = 0;
189};
190
192
193
194#include "TD_PackPop.h"
195
196#endif // _DBVIEWERSTREAMER_API_H_
OdSmartPtr< OdDbPartialViewingIndex > OdDbPartialViewingIndexPtr
OdSmartPtr< OdDbPartialViewingFilter > OdDbPartialViewingFilterPtr
OdSmartPtr< OdDbPartialViewingModule > OdDbPartialViewingModulePtr
unsigned int OdUInt32
OdResult
Definition: OdResult.h:29
bool isNull() const
Definition: BaseObjectPtr.h:86
ODDB_DECLARE_MEMBERS(OdDbPartialViewingFilter)
const OdGsView * get() const
void set(const OdGsView *view)
virtual OdRxClass * indexClass() const
ODDB_DECLARE_MEMBERS(OdDbPartialViewingIndex)
virtual void rebuildFull(OdDbIndexUpdateData *pIdxData)
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
bool getWorldExtents(OdGeExtents3d &ext) const
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
void query(const OdSiShape &query, OdSiVisitor &visitor)
virtual OdDbFilteredBlockIteratorPtr newIterator(const OdDbFilter *pFilter) const
virtual void extend(OdDbObjectId entId, const OdGeExtents3d &extents)
virtual void rebuildModified(OdDbBlockChangeIterator *iterator)
virtual void manageData(OdDbObjectIterator &willBeShown, OdDbObjectIterator &mayBeUnloaded)=0
virtual OdDbObjectIteratorPtr currentSet()=0
virtual OdDbObjectIteratorPtr getUnloadedObjects(OdDbObjectIterator &objects)=0
virtual OdDbObjectIteratorPtr filterCustomViewingData(OdDbObjectId blockId, OdDbDatabase *pDb, OdGsView *pGsView, const OdGeMatrix3d &transformMatrix, bool bForceCreateIndexes=false)=0
virtual void extendIndex(OdDbBlockTableRecord *pBTR, OdDbStub *id, const OdGeExtents3d &ext)=0
OdSmartPtr< DataManagerContext > DataManagerContextPtr
virtual void filterViewingData(OdGsDevice *filterSettings, DataManagerContext *dataManager, OdArray< OdDbFilterPtr > *pFilters=0, bool bForceCreateIndexes=false, bool bEnableUnload=true)=0
virtual bool hasIndex(OdDbBlockTableRecord *pBTR, bool bCheckExtents=false)=0
virtual void addIndex(OdGsDevice *filterSettings)=0
virtual OdUInt64 countUnloadedEntries(OdGsDevice *filterSettings)=0
virtual void addIndex(OdDbBlockTableRecord *pBTR, bool bUpdate=true)=0
virtual OdUInt64 countUnloadedEntries(OdDbBlockTableRecord *pBTR)=0
virtual OdGsDevicePtr attachDataManagerTo(OdGsDevice *gs, DataManagerContext *mgrCtx)=0
Definition: Gs.h:140
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 bool extents(OdGeExtents3d &extents) const =0
const T * get() const
Definition: SmartPtr.h:339
GLuint buffer
Definition: gles2_ext.h:178
OdGePoint3d pt2
OdGePoint3d pt1
OdUInt32 dataSize
static Entry * cast(OdSiEntity *siEntity)
bool extents(OdGeExtents3d &extents) const
Entry * pNext[2]
Entry()
OdDbObjectId dbentity
Entry * pPrev[2]