CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DbIdMapping.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
26
27#ifndef __ODDBIDMAPPING_INCLUDED__
28#define __ODDBIDMAPPING_INCLUDED__
29
30#include "TD_PackPush.h"
31
32#include "OdaDefs.h"
33#include "DbObjectId.h"
34#include "DbObject.h"
35#include "RxObject.h"
36
37class OdDbDatabase;
38class OdDbIdMapping;
39
44
57{
58public:
67 : m_bCloned(false), m_bOwnerXlated(false), m_bPrimary(false) { }
68
70 const OdDbIdPair& source)
71 : m_Key(source.key())
72 , m_Value(source.value())
73 , m_bCloned(source.isCloned())
74 , m_bOwnerXlated(source.isOwnerXlated())
75 , m_bPrimary(source.isPrimary()){ }
76
78 const OdDbObjectId& key)
79 : m_Key(key)
80 , m_bCloned(false)
81 , m_bOwnerXlated(false)
82 , m_bPrimary(false){ }
83
85 const OdDbObjectId& key,
86 const OdDbObjectId& value,
87 bool cloned = false,
88 bool ownerXlated = true,
89 bool primary = false)
90 : m_Key(key)
91 , m_Value(value)
92 , m_bCloned(cloned)
93 , m_bOwnerXlated(ownerXlated)
94 , m_bPrimary(primary) { }
95
96
100 OdDbObjectId key() const { return m_Key; }
101
105 OdDbObjectId value() const { return m_Value; }
106
110 inline bool isCloned() const { return m_bCloned; }
111
115 inline bool isPrimary() const { return m_bPrimary; }
116
120 inline bool isOwnerXlated() const { return m_bOwnerXlated; }
121
131 const OdDbObjectId& key,
132 const OdDbObjectId& value,
133 bool cloned = false,
134 bool ownerXlated = true,
135 bool primary = false)
136 {
137 setKey(key);
139 setCloned(cloned);
140 setOwnerXlated(ownerXlated);
141 return *this;
142 }
143
144
150 void setKey(
151 const OdDbObjectId& key) { m_Key = key; }
152
159 const OdDbObjectId& value) { m_Value = value; }
160
167 bool cloned) { m_bCloned = cloned; }
168
174 void setPrimary(bool primary) { m_bPrimary = primary; }
175
182 bool ownerXlated) { m_bOwnerXlated = ownerXlated; }
183
184private:
185 OdDbObjectId m_Key;
186 OdDbObjectId m_Value;
187 bool m_bCloned;
188 bool m_bOwnerXlated;
189 bool m_bPrimary;
190};
191
193
198
203namespace OdDb
204{
206 {
207 kDcCopy = 0, // Copy, Array, Mirror
208 kDcExplode = 1, // Explode
209 kDcBlock = 2, // Block definition
210 kDcXrefBind = 3, // Xref Bind
211 kDcSymTableMerge = 4, // Xref Attach, DxfIn, IgesIn
212 kDcInsert = 6, // Insert of a .dwg file
213 kDcWblock = 7, // Wblock
214 kDcObjects = 8, // OdDbDatabase::deepCloneObjects()
215 kDcXrefInsert = 9, // Xref Insert, Xref BInd
216 kDcInsertCopy = 10, // Insert()
217 kDcWblkObjects = 11 // Wblock objects
218 };
219}
220
232{
233public:
235
237
239
245 virtual void assign(
246 const OdDbIdPair& idPair) = 0;
247
257 virtual bool compute(
258 OdDbIdPair& idPair) const = 0;
264 virtual bool del(
265 const OdDbObjectId& key) = 0;
266
271
275 virtual OdDbDatabase* destDb() const = 0;
276
282 virtual void setDestDb(
283 OdDbDatabase* pDb) = 0;
284
288 virtual OdDbDatabase* origDb() const = 0;
289
297
321
340};
341
352{
353public:
355
357
364 virtual void start() = 0;
365
371 virtual void getMap(
372 OdDbIdPair& idPair) = 0;
373
377 virtual void next() = 0;
378
382 virtual bool done() = 0;
383};
384
385
386#include "TD_PackPop.h"
387
388#endif // __ODDBIDMAPPING_INCLUDED__
389
390
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbIdMappingIter > OdDbIdMappingIterPtr
Definition: DbIdMapping.h:197
OdSmartPtr< OdDbIdMapping > OdDbIdMappingPtr
Definition: DbIdMapping.h:43
false
Definition: DimVarDefs.h:165
virtual OdDb::DuplicateRecordCloning duplicateRecordCloning() const =0
virtual OdDbDatabase * destDb() const =0
static OdDbIdMappingPtr createObject(OdDb::DeepCloneType)
virtual bool del(const OdDbObjectId &key)=0
virtual OdDb::DeepCloneType deepCloneContext() const =0
virtual OdDbIdMappingIterPtr newIterator()=0
virtual OdDbObjectId insertingXrefBlockId() const =0
virtual OdDbDatabase * origDb() const =0
virtual void assign(const OdDbIdPair &idPair)=0
virtual void setDestDb(OdDbDatabase *pDb)=0
virtual bool compute(OdDbIdPair &idPair) const =0
ODRX_DECLARE_MEMBERS(OdDbIdMapping)
virtual bool done()=0
ODRX_DECLARE_MEMBERS(OdDbIdMappingIter)
virtual void start()=0
virtual void getMap(OdDbIdPair &idPair)=0
virtual void next()=0
void setKey(const OdDbObjectId &key)
Definition: DbIdMapping.h:150
OdDbObjectId key() const
Definition: DbIdMapping.h:100
void setPrimary(bool primary)
Definition: DbIdMapping.h:174
void setCloned(bool cloned)
Definition: DbIdMapping.h:166
OdDbIdPair(const OdDbIdPair &source)
Definition: DbIdMapping.h:69
bool isOwnerXlated() const
Definition: DbIdMapping.h:120
void setOwnerXlated(bool ownerXlated)
Definition: DbIdMapping.h:181
bool isPrimary() const
Definition: DbIdMapping.h:115
void setValue(const OdDbObjectId &value)
Definition: DbIdMapping.h:158
bool isCloned() const
Definition: DbIdMapping.h:110
OdDbIdPair & set(const OdDbObjectId &key, const OdDbObjectId &value, bool cloned=false, bool ownerXlated=true, bool primary=false)
Definition: DbIdMapping.h:130
OdDbIdPair(const OdDbObjectId &key, const OdDbObjectId &value, bool cloned=false, bool ownerXlated=true, bool primary=false)
Definition: DbIdMapping.h:84
OdDbIdPair(const OdDbObjectId &key)
Definition: DbIdMapping.h:77
OdDbObjectId value() const
Definition: DbIdMapping.h:105
GLsizei GLsizei GLchar * source
Definition: gles2_ext.h:282
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
DeepCloneType
Definition: DbIdMapping.h:206
@ kDcInsertCopy
Definition: DbIdMapping.h:216
@ kDcObjects
Definition: DbIdMapping.h:214
@ kDcSymTableMerge
Definition: DbIdMapping.h:211
@ kDcXrefBind
Definition: DbIdMapping.h:210
@ kDcBlock
Definition: DbIdMapping.h:209
@ kDcWblock
Definition: DbIdMapping.h:213
@ kDcCopy
Definition: DbIdMapping.h:207
@ kDcExplode
Definition: DbIdMapping.h:208
@ kDcInsert
Definition: DbIdMapping.h:212
@ kDcXrefInsert
Definition: DbIdMapping.h:215
@ kDcWblkObjects
Definition: DbIdMapping.h:217
DuplicateRecordCloning
Definition: DbObject.h:128