CFx SDK Documentation  2022 SP0
DbIdMapping.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 
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 
37 class OdDbDatabase;
38 class OdDbIdMapping;
39 
44 
60 {
61 public:
70  : m_bCloned(false), m_bOwnerXlated(false), m_bPrimary(false) { }
71 
73  const OdDbIdPair& source)
74  : m_Key(source.key())
75  , m_Value(source.value())
76  , m_bCloned(source.isCloned())
77  , m_bOwnerXlated(source.isOwnerXlated())
78  , m_bPrimary(source.isPrimary()){ }
79 
81  const OdDbObjectId& key)
82  : m_Key(key)
83  , m_bCloned(false)
84  , m_bOwnerXlated(false)
85  , m_bPrimary(false){ }
86 
88  const OdDbObjectId& key,
89  const OdDbObjectId& value,
90  bool cloned = false,
91  bool ownerXlated = true,
92  bool primary = false)
93  : m_Key(key)
94  , m_Value(value)
95  , m_bCloned(cloned)
96  , m_bOwnerXlated(ownerXlated)
97  , m_bPrimary(primary) { }
98 
99 
103  OdDbObjectId key() const { return m_Key; }
104 
108  OdDbObjectId value() const { return m_Value; }
109 
113  inline bool isCloned() const { return m_bCloned; }
114 
118  inline bool isPrimary() const { return m_bPrimary; }
119 
123  inline bool isOwnerXlated() const { return m_bOwnerXlated; }
124 
134  const OdDbObjectId& key,
135  const OdDbObjectId& value,
136  bool cloned = false,
137  bool ownerXlated = true,
138  bool primary = false)
139  {
140  setKey(key);
141  setValue(value);
142  setCloned(cloned);
143  setOwnerXlated(ownerXlated);
144  return *this;
145  }
146 
147 
153  void setKey(
154  const OdDbObjectId& key) { m_Key = key; }
155 
161  void setValue(
162  const OdDbObjectId& value) { m_Value = value; }
163 
169  void setCloned(
170  bool cloned) { m_bCloned = cloned; }
171 
177  void setPrimary(bool primary) { m_bPrimary = primary; }
178 
185  bool ownerXlated) { m_bOwnerXlated = ownerXlated; }
186 
187 private:
188  OdDbObjectId m_Key;
189  OdDbObjectId m_Value;
190  bool m_bCloned;
191  bool m_bOwnerXlated;
192  bool m_bPrimary;
193 };
194 
195 class OdDbIdMappingIter;
196 
201 
206 namespace OdDb
207 {
209  {
210  kDcCopy = 0, // Copy, Array, Mirror
211  kDcExplode = 1, // Explode
212  kDcBlock = 2, // Block definition
213  kDcXrefBind = 3, // Xref Bind
214  kDcSymTableMerge = 4, // Xref Attach, DxfIn, IgesIn
215  kDcInsert = 6, // Insert of a .dwg file
216  kDcWblock = 7, // Wblock
217  kDcObjects = 8, // OdDbDatabase::deepCloneObjects()
218  kDcXrefInsert = 9, // Xref Insert, Xref BInd
219  kDcInsertCopy = 10, // Insert()
220  kDcWblkObjects = 11 // Wblock objects
221  };
222 }
223 
238 {
239 public:
241 
243 
245 
251  virtual void assign(
252  const OdDbIdPair& idPair) = 0;
253 
263  virtual bool compute(
264  OdDbIdPair& idPair) const = 0;
270  virtual bool del(
271  const OdDbObjectId& key) = 0;
272 
277 
281  virtual OdDbDatabase* destDb() const = 0;
282 
288  virtual void setDestDb(
289  OdDbDatabase* pDb) = 0;
290 
294  virtual OdDbDatabase* origDb() const = 0;
295 
302  virtual OdDbObjectId insertingXrefBlockId() const = 0;
303 
327 
346 };
347 
361 {
362 public:
364 
366 
373  virtual void start() = 0;
374 
380  virtual void getMap(
381  OdDbIdPair& idPair) = 0;
382 
386  virtual void next() = 0;
387 
391  virtual bool done() = 0;
392 };
393 
394 
395 #include "TD_PackPop.h"
396 
397 #endif // __ODDBIDMAPPING_INCLUDED__
398 
399 
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbIdMappingIter > OdDbIdMappingIterPtr
Definition: DbIdMapping.h:195
OdSmartPtr< OdDbIdMapping > OdDbIdMappingPtr
Definition: DbIdMapping.h:38
false
Definition: DimVarDefs.h:165
virtual OdDbDatabase * destDb() const =0
virtual OdDb::DuplicateRecordCloning duplicateRecordCloning() 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:153
OdDbObjectId key() const
Definition: DbIdMapping.h:103
void setPrimary(bool primary)
Definition: DbIdMapping.h:177
void setCloned(bool cloned)
Definition: DbIdMapping.h:169
OdDbIdPair(const OdDbIdPair &source)
Definition: DbIdMapping.h:72
bool isOwnerXlated() const
Definition: DbIdMapping.h:123
void setOwnerXlated(bool ownerXlated)
Definition: DbIdMapping.h:184
bool isPrimary() const
Definition: DbIdMapping.h:118
OdDbIdPair & set(const OdDbObjectId &key, const OdDbObjectId &value, bool cloned=false, bool ownerXlated=true, bool primary=false)
Definition: DbIdMapping.h:133
void setValue(const OdDbObjectId &value)
Definition: DbIdMapping.h:161
bool isCloned() const
Definition: DbIdMapping.h:113
OdDbIdPair(const OdDbObjectId &key, const OdDbObjectId &value, bool cloned=false, bool ownerXlated=true, bool primary=false)
Definition: DbIdMapping.h:87
OdDbIdPair(const OdDbObjectId &key)
Definition: DbIdMapping.h:80
OdDbObjectId value() const
Definition: DbIdMapping.h:108
GLsizei GLsizei GLchar * source
Definition: gles2_ext.h:282
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
DeepCloneType
Definition: DbIdMapping.h:209
@ kDcInsertCopy
Definition: DbIdMapping.h:219
@ kDcObjects
Definition: DbIdMapping.h:217
@ kDcSymTableMerge
Definition: DbIdMapping.h:214
@ kDcXrefBind
Definition: DbIdMapping.h:213
@ kDcBlock
Definition: DbIdMapping.h:212
@ kDcWblock
Definition: DbIdMapping.h:216
@ kDcCopy
Definition: DbIdMapping.h:210
@ kDcExplode
Definition: DbIdMapping.h:211
@ kDcInsert
Definition: DbIdMapping.h:215
@ kDcXrefInsert
Definition: DbIdMapping.h:218
@ kDcWblkObjects
Definition: DbIdMapping.h:220
DuplicateRecordCloning
Definition: DbObject.h:126