CFx SDK Documentation  2020SP3
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 
OdDbDatabase
Definition: DbDatabase.h:421
OdDbIdPair::key
OdDbObjectId key() const
Definition: DbIdMapping.h:103
OdDbIdMapping::newIterator
virtual OdDbIdMappingIterPtr newIterator()=0
OdDbIdMapping::compute
virtual bool compute(OdDbIdPair &idPair) const =0
OdDbIdPair::setPrimary
void setPrimary(bool primary)
Definition: DbIdMapping.h:177
OdDb::kDcCopy
@ kDcCopy
Definition: DbIdMapping.h:210
DbObject.h
false
false
Definition: DimVarDefs.h:165
OdRxObject
Definition: RxObject.h:564
OdDbObjectId
Definition: DbObjectId.h:99
OdDbIdMappingIterPtr
OdSmartPtr< OdDbIdMappingIter > OdDbIdMappingIterPtr
Definition: DbIdMapping.h:195
source
GLsizei GLsizei GLchar * source
Definition: gles2_ext.h:282
OdDbIdPair
Definition: DbIdMapping.h:60
OdDbIdMappingPtr
OdSmartPtr< OdDbIdMapping > OdDbIdMappingPtr
Definition: DbIdMapping.h:38
OdDbIdMapping::deepCloneContext
virtual OdDb::DeepCloneType deepCloneContext() const =0
OdDb::kDcWblkObjects
@ kDcWblkObjects
Definition: DbIdMapping.h:220
TD_PackPop.h
OdDb::kDcObjects
@ kDcObjects
Definition: DbIdMapping.h:217
OdDb::kDcWblock
@ kDcWblock
Definition: DbIdMapping.h:216
OdDbIdPair::setOwnerXlated
void setOwnerXlated(bool ownerXlated)
Definition: DbIdMapping.h:184
OdDbIdPair::isCloned
bool isCloned() const
Definition: DbIdMapping.h:113
OdDbIdMappingIter
Definition: DbIdMapping.h:361
OdDbIdMapping::OdDbIdMapping
OdDbIdMapping()
Definition: DbIdMapping.h:242
OdDbIdMapping::origDb
virtual OdDbDatabase * origDb() const =0
RxObject.h
OdDbIdMappingIter::getMap
virtual void getMap(OdDbIdPair &idPair)=0
OdDbIdMappingIter::done
virtual bool done()=0
OdDbIdMapping::destDb
virtual OdDbDatabase * destDb() const =0
OdDb::kDcBlock
@ kDcBlock
Definition: DbIdMapping.h:212
OdDbIdPair::OdDbIdPair
OdDbIdPair(const OdDbObjectId &key, const OdDbObjectId &value, bool cloned=false, bool ownerXlated=true, bool primary=false)
Definition: DbIdMapping.h:87
OdDb::kDcXrefInsert
@ kDcXrefInsert
Definition: DbIdMapping.h:218
OdaDefs.h
OdSmartPtr
Definition: SmartPtr.h:58
OdDbIdPair::OdDbIdPair
OdDbIdPair(const OdDbObjectId &key)
Definition: DbIdMapping.h:80
OdDbIdMapping::assign
virtual void assign(const OdDbIdPair &idPair)=0
DbObjectId.h
OdDb::kDcInsertCopy
@ kDcInsertCopy
Definition: DbIdMapping.h:219
OdDb::kDcInsert
@ kDcInsert
Definition: DbIdMapping.h:215
OdDbIdPair::value
OdDbObjectId value() const
Definition: DbIdMapping.h:108
OdDbIdPair::isOwnerXlated
bool isOwnerXlated() const
Definition: DbIdMapping.h:123
TD_PackPush.h
OdDbIdPair::set
OdDbIdPair & set(const OdDbObjectId &key, const OdDbObjectId &value, bool cloned=false, bool ownerXlated=true, bool primary=false)
Definition: DbIdMapping.h:133
OdDbIdMapping::del
virtual bool del(const OdDbObjectId &key)=0
OdDbIdMappingIter::OdDbIdMappingIter
OdDbIdMappingIter()
Definition: DbIdMapping.h:365
OdDbIdMapping::createObject
static OdDbIdMappingPtr createObject(OdDb::DeepCloneType)
OdDbIdPair::OdDbIdPair
OdDbIdPair()
Definition: DbIdMapping.h:69
OdDbIdMapping::duplicateRecordCloning
virtual OdDb::DuplicateRecordCloning duplicateRecordCloning() const =0
OdDbIdMappingIter::next
virtual void next()=0
OdDbIdPair::setValue
void setValue(const OdDbObjectId &value)
Definition: DbIdMapping.h:161
OdDb::kDcXrefBind
@ kDcXrefBind
Definition: DbIdMapping.h:213
OdDbIdMapping::setDestDb
virtual void setDestDb(OdDbDatabase *pDb)=0
OdDbIdMappingIter::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdDbIdMappingIter)
OdDb::DeepCloneType
DeepCloneType
Definition: DbIdMapping.h:209
OdDb
Definition: Db2dPolyline.h:50
value
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
OdDbIdMapping::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdDbIdMapping)
OdDbIdPair::setKey
void setKey(const OdDbObjectId &key)
Definition: DbIdMapping.h:153
TOOLKIT_EXPORT
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdDbIdMappingIter::start
virtual void start()=0
OdDb::DuplicateRecordCloning
DuplicateRecordCloning
Definition: DbObject.h:126
OdDbIdMapping
Definition: DbIdMapping.h:238
OdDb::kDcExplode
@ kDcExplode
Definition: DbIdMapping.h:211
OdDbIdPair::isPrimary
bool isPrimary() const
Definition: DbIdMapping.h:118
OdDbIdMapping::insertingXrefBlockId
virtual OdDbObjectId insertingXrefBlockId() const =0
OdDbIdPair::setCloned
void setCloned(bool cloned)
Definition: DbIdMapping.h:169
OdDbIdPair::OdDbIdPair
OdDbIdPair(const OdDbIdPair &source)
Definition: DbIdMapping.h:72
OdDb::kDcSymTableMerge
@ kDcSymTableMerge
Definition: DbIdMapping.h:214