zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
 
 
 
 
#ifndef _ODDBXOBJECT_INCLUDED_
#define _ODDBXOBJECT_INCLUDED_ /*!DOM*/
 
#include "TD_PackPush.h"
 
#include "Gi/GiDrawable.h"
#include "DbObjectId.h"
#include "OdString.h"
#include "DbObjectReactor.h"
#include "IdArrays.h"
#include "ResBuf.h"
#include "DebugStuff.h"
 
class OdDbFiler;
class OdDbDwgFiler;
class OdDbDxfFiler;
class OdGiDrawableTraits;
class OdGiWorldDraw;
class OdGiViewportDraw;
class OdGsCache;
class OdDbObjectImpl;
class OdDbEntity;
class OdDbDatabase;
class OdDbIdMapping;
class OdDbAuditInfo;
class OdGeMatrix3d;
class OdDbObjStorage;
class OdString;
class OdGePoint3d;
class OdBinaryData;
class OdDbIdPair;
class OdDbField;
class OdDbDictionary;
class OdDbXrecord;
 
/** \details
  This template class is a specialization of the OdSmartPtr class for OdDbXrecord object pointers.
 
  \sa
  <link smart_pointers.html, Working with Smart Pointers>
*/
typedef OdSmartPtr<OdDbXrecord> OdDbXrecordPtr;
 
/** \details
    Declares the member functions for classes derived from OdDbObject. 
        
    \param ClassName [in]  Name of the derived class.
    
    \remarks
    Classes derived 
    from OdDbObject should invoke this macro in their class definitions, 
    passing the name of the derived class.
*/
#define ODDB_DECLARE_MEMBERS(ClassName)\
protected:                                \
  ClassName(OdDbObjectImpl* pImpl);       \
public:                                   \
ODRX_DECLARE_MEMBERS (ClassName)
 
/** \details
  Creates a new instance of a derived class,
  and returns a SmartPointer to it, without
  incrementing the reference count of the new
  object.
  
  \param ClassName [in]  Name of the derived class.
*/
#define DBOBJECT_CONSTR(ClassName) OdSmartPtr<ClassName> (new ClassName, kOdRxObjAttach)
 
 
/** \details
    This class implements OdError objects with Result codes of eXdataSizeExceeded,
    and the Object IDs of the objects related to the errors.
    
    Library: TD_Db
    <group Error_Classes> 
*/
class TOOLKIT_EXPORT OdError_XdataSizeExceeded : public OdError
{
public:
  /** \param objectId [in]  Object ID of the object with the error.
  */
  OdError_XdataSizeExceeded(
    const OdDbObjectId& objectId);
};
                            
 
/** \details
  <group TD_Namespaces>
  {noAutoLink}
*/
namespace OdDb
  /** \details
    \note
    The file OdaDefs.h contains const definitions of DuplicateRecordCloning values
    that do not require the "OdDb::" scope resolution qualifier. They should be
    used only if there will be no naming conflicts.
  */
  enum DuplicateRecordCloning
  {
    kDrcNotApplicable  = 0,   // Not applicable to the object.
    kDrcIgnore         = 1,   // If a duplicate record exists, use the existing record
                              // in the *database*, and ignore the clone.
    kDrcReplace        = 2,   // If a duplicate record exists, replace it with the cloned record.
    kDrcXrefMangleName = 3,   // Incoming record names are mangled with <Xref>$0$<name>
    kDrcMangleName     = 4,   // Incoming record names are mangled with $0$<name>
    kDrcUnmangleName   = 5,   // Unmangle the names mangled by kDrcMangleName, then default to kDrcIgnore.
                              // Typically used by RefEdit when checking records into the original *database*.  
    kDrcMax            = kDrcUnmangleName //  The maximum value of this enum.
  };
 
  /** \note
    The file OdaDefs.h contains const definitions of Visibility values
    that do not require the "OdDb::" scope resolution qualifier. They should be
    used only if there will be no naming conflicts.
  */
  enum Visibility
  {
    kInvisible = 1,
    kVisible = 0
  };
 
  enum SaveType
  {
    kDwg   = 0,   // Save as .dwg file
    kDxf   = 1,   // Save as .dxf file
    kDxb   = 2,   // Save as binary .dxf file
    kUnknown = -1 // Database was created from scratch
  };
}
 
 
/** \details
    This class is the base class for all objects contained in an OdDbDatabase instance (OdDb objects).
 
    \remarks
    
    Creating and Deleting Database Objects
    
    * Database objects are normally created by calling OdDbXXXXX::createObject().
       When an object is created, it will be in kOpenForWrite mode.  The delete
       operator should never be called on database objects.  Instead, erase()
       should be called, which marks the object as erased.
    * OdDbObject instances should be created by calling the createObject() method.
    * OdDbObject instances are created in kOpenForWrite mode.  
    * Depending on other OdDbObject instances while constructing or deleting instances is prohibited.
    * OdDbObject instances should be deleted from an OdDbDatabase with erase().
    * Never access a pointer to a closed object.
    * The delete operator must never be called on OdDbObject instances. Instead, the erase() method
       should be called, which marks this object as erased.
    
    Accessing Database Objects
    
    * Database objects must be opened before they can be accessed.  
    * Given a valid OdDbObjectId, a database object is opened by calling OdDbObjectId::safeOpenObject().  
    * Database objects should be opened in the most restrictive mode possible, and should be released 
       immediately when access is no longer needed.
       
    Object may be opened in any one of the following modes:
    
    <table>
    Mode              Description
    OdDb::kForRead    Allows operations that do not modify this object.  
                      A database object can be opened in this mode any number of times (simultaneously), 
                      if has not open in OdDb::kForWrite or OdDb::kForNotify mode.  
                      An exception will be thrown if any type of write operation is attempted 
                      on an object open in this mode.
    OdDb::kForWrite   Allows read and write operations to be performed on this object.  
                      An database object can be opened in this mode only if it is not
                      already open in any mode.
    OdDb::kForNotify  This object is opened for notification purposes.  
                      A database object can be opened in this mode so long as it is 
                      not already open in kNotify mode.
    </table>
    
    \sa
    * OdDbObjectId
    * OdDbDatabase
 
    Library: TD_Db
 
    <group OdDb_Classes>
*/
class TOOLKIT_EXPORT OdDbObject : public OdGiDrawable
{
public:
  ODDB_DECLARE_MEMBERS(OdDbObject);
 
protected:
  OdDbObject();
public:
  ~OdDbObject();
  
  /** \details
    Increments the reference count of this object.
  */
  void addRef();
 
  /** \details
    Decrements the reference count of this object.
    \remarks
    This object is deleted when the reference count reaches zero.
  */
  void release();
 
  /** \details
      Returns the reference count of this object.
  */
  long numRefs() const;
  
  /** \details
    Returns the Object ID of this object.
    
    \remarks
    Returns a null ID if this object has not been added to a database.
  */
  OdDbObjectId objectId() const;
  
  /** \details
    Returns the persistent handle of this database object.
  */
  OdDbHandle getDbHandle() const;
  
  /** \details
    Returns the persistent handle of this database object.
  */
  OdDbHandle handle() const 
  { return getDbHandle (); }
  
  /** \details
    Returns the Object ID of this object's owner.
    
    \remarks
    Returns a null ID if this object has not been added to a database,
    or if OdDbObject::setOwnerId has not been called.
    
    Throws:
    <table>
    Exception        Cause
    eNotInDatabase   objectId().isNull()
    </table>
  */
  OdDbObjectId ownerId() const;
  
  /** \details
    Sets this object's ownerId data member. 
    
    \param ownerId [in]  Owner's objectId.
    
    \remarks
    This function lets this object know its owner; it does not
    notify the owner. 
    
    Throws:
    <table>
    Exception             Cause
    eNotInDatabase        Owner is not in the database.
    </table>
  */
  virtual void setOwnerId(
    OdDbObjectId ownerId);
    
  /** \details
    Returns the OdDbDatabase that contains this object.
  */
  OdDbDatabase* database() const;
  
  /** \details
    Creates an OdDbDictionary extension dictionary of this object.
 
    \remarks
    If this object's extension dictionary has been erased, it will
    be unerased.  
    
    An object owns its extension dictionary.
  */
  void createExtensionDictionary();
  
  /** \details
    Returns the Object ID of this object's extension dictionary.  
    
    \remarks
    Returns a null ID if this object does not have an extension dictionary, 
    or if its extension dictionary has been erased.
  */
  OdDbObjectId extensionDictionary() const;
  
  /** \details
    Releases and erases this object's extension dictionary if it exists and is empty. 
    
    \remarks
    Returns true if and only if either the dictionary did not exist or was released.
  */
  bool releaseExtensionDictionary();  
 
  // Opens/creates/unerases Xdictionary, and retrieves/creates Xrecord for the given name
  //
  
  /** \details
    Creates or retrieves the specified Xrecord in this object's extension dictionary.
 
    \param xrecordName [in]  Xrecord name.
    \param style [in]  Merge style.
    
    \remarks
    Returns a SmartPointer to the specified Xrecord.
    
    * If the extension dictionary has been erased, it is unerased.
    * If the extension dictionary does not exist, it is created.
    * If the specified Xrecord does not exist, it is created.
  */
  OdDbXrecordPtr createXrecord(
    const OdString& xrecordName, 
    OdDb::DuplicateRecordCloning style = OdDb::kDrcIgnore);
 
  /** \details
    Upgrades this object from OdDb::kForRead to OdDb::kForWrite.
  */
  void upgradeOpen();
  
  /** \details
    Downgrades this object from OdDb::kForWrite to OdDb::kForRead
     
    \remarks
    Any pending changes to this object are committed to the database. 
  */
  void downgradeOpen();
    
  /** \details
    Notification function called by the Teigha framework immediately before an object is opened. 
 
    \param mode [in]  Mode in which the object is being opened.
    
    \remarks
    This function is notified just before an object is to be opened; giving this function
    the ability to cancel the object being opened.
         
    Returns eOk if and only if open() is to continue.
 
    Overriding this function in a child class allows a child instance to be notified each time an
    object is opened.
 
    When overriding this function:
    
    1)  If the OdDbObject's state is incorrect, return 
        something other than eOk.
    
    2)  If the parent class's subOpen() returns anything
        other than eOk, immediately return it. 
    
    3)  If other actions are required before open, do them.
    
    4)  Return eOk.
    
    The default implementation of this function does nothing but return eOk.  This function can be
    overridden in custom classes.
  */
  virtual OdResult subOpen(
    OdDb::OpenMode mode);
    
 
  /** \details
    Called as the first operation as this object is being closed, for
    database -resident objects only. 
    
    \remarks
    This function is notified just before the current open operation is to be closed, giving this function
    the ability to perform necessary operatons.
    
    When overriding this function:
    
    1)  If the OdDbObject's state is incorrect, throw exception.
    
    2)  Call parent class's subClose().
    
    3)  If other actions are required before close, do them.
    
    The default implementation of this function does nothing.
    This function can be overridden in custom classes.
  */
  virtual void subClose();
  
  /** \details
    Sets the erased mode of this object. 
    
    \param eraseIt [in]  Boolean to specify if object is to be erased or unerased.
                
    \remarks
    Erased objects are not deleted from the database or from memory.
    
    Erased objects are not filed when the database is saved or sent to a DXF file.
  */
  OdResult erase(
    bool eraseIt = true);
  
  /** \details
    Called as the first operation as this object is being erased or unerased. 
 
    \param erasing [in]  A copy of the erasing argument passed to erase().
 
    \remarks
    This function is notified just before the current object is to be erased, giving this function
    the ability to cancel the erase.
         
    Returns eOk if and only if erase() is to continue.
 
    When overriding this function:
    
    1)  If the OdDbObject's state is incorrect, return 
        something other than eOk.
    
    2)  If the parent class's subErase() returns anything
        other than eOk, immediately return it. 
    
    3)  If other actions are required before erase, do them.
    
    4)  Return eOk.
 
    If you must make changes to this object's state, either make them after
    step 2, or roll them back if step 2 returns other than eOk. 
    
    The default implementation of this function does nothing but return eOk.  This function can be
    overridden in custom classes.
    
  */
  virtual OdResult subErase(
    bool erasing);
  
  /** \details
    Replaces this database -resident (DBRO) object with the specified non- database -resident (NDBRO) object,
    while retaining this object's objectId, handle, owner, and reactor list.
   
    \param pNewObject [in]  Pointer to the object with which to replace this object in the database.
    \param keepXData [in]  This object's XData will be retained if and only if keepXData is true.
    \param keepExtDict [in]  This object's extension dictionary will be retained if and only if keepExtDict is true.
                    
    \remarks
    This object must be open OdDb::kForWrite. 
    
    The replacement object will opened OdDb::kForWrite, and must be closed.
    
    It is up to the caller to delete the replaced (this) object.
    
    Throws:
    <table>
    Exception               Cause
    eIllegalReplacement     This object is NDBRO or NewObject is DBRO.
    </table>
  */
  void handOverTo(
    OdDbObject* pNewObject, 
    bool keepXData = true, bool 
    keepExtDict = true);
  
  /** \details
    Called as the first operation of the handOverTo function.  
    
    \param pNewObject [in]  Pointer to the object with which to replace this object in the database.
 
    \remarks
    This function allows custom classes to populate the new object.
 
    \remarks
    Overriding this function in a child class allows a child instance to be notified each time an
    object is handed over.
    
    This function is notified just before an object is to be handed over; giving this function
    the ability to cancel the handover.
         
    When overriding this function:
    
    1)  If the OdDbObject's state is incorrect, throw exception.
    
    2)  Call parent class's subHandover().
    
    3)  If other actions are required before handover, do them.
    
    The default implementation of this function does nothing.  This function can be
    overridden in custom classes.
 
  */
  virtual void subHandOverTo(
    OdDbObject* pNewObject);
  
  /** \details
    Swaps the objectIDs, handles, XData,and extension dictionary between
    this object and another object.
 
    \param otherId [in]  Object ID of object with which to swap.
    \param swapXdata [in]  XData will be swapped if and only if swapXData is true.
    \param swapExtDict [in]  Extension dictionaries will be swapped if and only if swapExtDict is true.
    
    Throws:
    <table>
    Exception               Cause
    eIllegalReplacement     Either object is NDBRO.
    </table>
  */
  void swapIdWith(
    OdDbObjectId otherId, 
    bool swapXdata = false, 
    bool swapExtDict = false);
  
  /** \details
    Called as the first operation of swapIdWith
 
    \param otherId [in]  Object ID to be swapped with this object's Object ID.
    \param swapXdata [in]  If and only if true, extended data are swapped.
    \param swapExtDict [in]  If and only if true, extension dictionaries are swapped.
 
    \remarks
    This function is notified just before an object is to be opened; giving this function
    the ability to cancel the object being swapped or perform necessary actions.
         
    When overriding this function:
    
    1)  If the OdDbObject's state is incorrect, throw exception.
    
    2)  Call parent class's subSwapIdWith().
    
    3)  If other actions are required before swapping IDs, do them.
    
    The default implementation of this function does nothing.  This function can be
    overridden in custom classes.
 
  */
  virtual void subSwapIdWith(
    const OdDbObjectId& otherId, 
    bool swapXdata = false, 
    bool swapExtDict = false);
    
  /** \details
    Perform an audit operation on this object.
 
    \param pAuditInfo [in]  Pointer to an OdDbAuditInfo object.
    
    \remarks
    The specified OdDbAuditInfo object controls the audit, and receives the audit status.
    
    When overriding this function for a custom class, first call OdDbObject::audit(pAuditInfo) 
    to validate the audit operation.
  */
  virtual void audit(
    OdDbAuditInfo* pAuditInfo);
  
  /** \details
    Reads the .dwg file format data of this object from the specified file.
       
    \param pFiler [in]  Pointer to the filer from which the data are to be read.
    
    \remarks
    This function calls dwgInFields(pFiler),
    then loads any Xdata associated with this object.
  */
  void dwgIn(
    OdDbDwgFiler* pFiler);
  
  /** \details
    Writes the .dwg file format data of this object to the specified filer. 
    
    \param pFiler [in]  Pointer to the filer to which the data are to be written.
    
    \remarks
    This function calls this object's dwgOutFields() function,
    writes loads any Xdata associated with this object.
  */
  void dwgOut(
    OdDbDwgFiler* pFiler) const;
  
  /** \details
    Reads the DXF format data of this object from the specified filer. 
    
    \param pFiler [in]  Pointer to the filer from which the data are to be read.
    
    \remarks
    Returns the filer status.
 
    This function calls this object's dxfInFields(pFiler),
    then loads any Xdata associated with this object.
  */
  virtual OdResult dxfIn(
    OdDbDxfFiler* pFiler);
  
  /** \details
    Writes the DXF format data of this object to the specified filer. 
    
    \param pFiler [in]  Pointer to the filer to which the data are to be written.
    
    \remarks
    This function calls this object's dxfOutFields(pFiler) function,
    writes any Xdata associated with this object.
  */
  virtual void dxfOut(
    OdDbDxfFiler* pFiler) const;
  
  /** \details
    Reads the .dwg file data of this object. 
 
    \param pFiler [in]  Filer object from which data are read.
    
    \remarks
    Returns the filer status.
    
    This function is called by dwgIn() to allow the object to read its data.
 
    When overriding this function:
     
    
    1)  Call assertWriteEnabled(). 
    2)  Call the parent class's dwgInFields(pFiler). 
    3)  If it returns eOK, continue; otherwise return whatever the parent's dwgInFields(pFiler) returned. 
    4)  Call the OdDbDwgFiler(pFiler) methods to read each of the object's data items in the order they were written.
    5)  Return pFiler->filerStatus().
  */
  virtual OdResult dwgInFields(
    OdDbDwgFiler* pFiler);
  
  /** \details
    Writes the .dwg file data of this object. 
 
    \param pFiler [in]  Pointer to the filer to which data are written.
    
    \remarks
   
    This function is called by dwgIn() to allow the object to write its data.
 
    When overriding this function:
     
    
    1)  Call assertReadEnabled(). 
    2)  Call the parent class's dwgOutFields(pFiler). 
    3)  Call the OdDbDwgFiler(pFiler) methods to write each of the object's data items in the order they were written.
  */
  virtual void dwgOutFields(
    OdDbDwgFiler* pFiler) const;
  
  /** \details
    Reads the DXF data of this object. 
    
    \param pFiler [in]  Pointer to the filer from which data are read.
    
    \remarks
    Returns the filer status.
    
    This function is called by dxfIn() to allow the object to read its data.
 
    When overriding this function:
     
    
    1)  Call assertWriteEnabled(). 
    2)  Call the parent class's dwgInFields(pFiler). 
    3)  If it returns eOK, continue; otherwise return whatever the parent's dxfInFields(pFiler) returned. 
    4)  Call the OdDbDxfFiler(pFiler) methods to read each of the object's data items in the order they were written.
    5)  Return pFiler->filerStatus().
  */
  virtual OdResult dxfInFields(
    OdDbDxfFiler* pFiler);
  
  /** \details
    Writes the DXF data of this object.
 
    \param pFiler [in]  Pointer to the filer to which data are to be written.
    
    \remarks
    
    This function is called by dxfOut() to allow the object to write its data.
 
    When overriding this function:
     
    
    1)  Call assertReadEnabled(). 
    2)  Call the parent class's dxfOutFields(pFiler). 
    4)  Use pFiler to call the OdDbDxfFiler methods to write each of the object's data items in the order they were written.
  */
  virtual void dxfOutFields(
    OdDbDxfFiler* pFiler) const;
  
  /** \details
    Reads the DXF R12 format data of this object. 
 
    \param pFiler [in]  Pointer to the filer from which data are to be read.
    
    \remarks
    Returns the filer status.
 
    This function is called by dxfIn() to allow the object to read its data.
 
    When overriding this function:
    
    1)  Call assertWriteEnabled(). 
    2)  Call the parent class's dxfInFields_R12(pFiler). 
    3)  If it returns eOK, continue; otherwise return whatever the parent's dxfOutFields_R12(pFiler) returned. 
    4)  Call the OdDbDxfFiler(pFiler) methods to read each of the object's data items in the order they were written.
    5)  Return pFiler->filerStatus().
  */
  virtual OdResult dxfInFields_R12(
    OdDbDxfFiler* pFiler);
  
  /** \details
    Writes the DXF data of this object. 
 
    \param pFiler [in]  Pointer to the filer to which data are to be written.
    
    \remarks
    Returns the filer status.
 
    This function is called by dxfOut() to allow the object to write its data.
 
    When overriding this function:
     
    
    1)  Call assertReadEnabled(). 
    2)  Call the parent class's dxfOutFields(pFiler). 
    3)  Use pFiler to call the OdDbDxfFiler methods to write each of the object's data items in the order they were written.
  */
  virtual void dxfOutFields_R12(
    OdDbDxfFiler* pFiler) const;
  
  /** \details
    Returns the merge style of this object.
  */
  virtual OdDb::DuplicateRecordCloning mergeStyle() const;
  
  /** \details
    Returns a linked list of ResBufs containing
    a copy of the XData of this object.
 
    \param regappName [in]  Registered application for which to return XData. 
 
    \remarks
    If regappName is empty, all XData of this object will be returned.
 
    If regappName is not empty, XData for only that application will be
    returned.
 
    Returns a null SmartPointer if there are no XData.
  */
  virtual OdResBufPtr xData(
    const OdString& regappName = OdString::kEmpty) const;
 
  
  /** \details
    Sets the XData of this object.
    
    \param pRb [in]  A pointer to the ResBuf list containing the XData.
    
    \remarks
    The sublist for each RegApp, and the ResBuf list itself, must begin with a ResBuf with 
    resbuf.restype == kDxfRegAppName and resbuf.rstring == a valid regAppName string. 
    
    Any existing XData for the specified regAppName will be replaced.
    
    To remove the regAppName and its XData, just provide the regAppName with no data. 
    
    If you override this method, you should supermessage this classes parent class
    to add add the XData to the object.
  */
  virtual void setXData(
    const OdResBuf* pRb);
     
  /** \details
    Returns true if and only if this object's erased status has been toggled since it was opened.
  */
  bool isEraseStatusToggled() const;
  
  /** \details
    Returns true if and only if this object is marked as erased.
  */
  bool isErased() const;
  
  /** \details
    Returns true if and only if this object is open OdDb::kForRead.
  */
  bool isReadEnabled() const;
  
  /** \details
    Returns true if and only if this object is open OdDb::kForWrite.
  */
  bool isWriteEnabled() const;
  
  /** \details
    Returns true if and only if this object is open OdDb::kForNotify.
  */
  bool isNotifyEnabled() const;
  
  /** \details
    Returns true if and only if this object's assertWriteEnabled() has been called since 
    it was opened.
  */
  bool isModified() const;
 
  /** \details
  */
//  void setModified (bool bModified);
  
  /** \details
    Returns true if and only this object's assertWriteEnabled() and setXData() have been called since it was opened.
  */
  bool isModifiedXData() const;
  
  /** \details
    Returns true if and only if an object derived from OdDbEntity has been modified.
    
    \remarks
    
    This function returns true if and only if an object derived from OdDbEntity
    either
    
        1) Calls assertWriteEnabled()
        
        2) Calls recordGraphicsModified(true).
  */
  bool isModifiedGraphics() const;
   
  /** \details
    Returns true if and only if this object has not been closed since it was created.
  */
  bool isNewObject() const;
  
  /** \details
    Returns true if and only if this object is sending notification.
  */
  bool isNotifying() const;
  
  /** \details
    Returns true if and only if this object is taking part in an Undo operation.
  */
  bool isUndoing() const;
  
//  bool isCancelling() const;
 
  /** \details
    Returns true if and only if a call to close would completely close this object at this time.
    
    \remarks
    Returns true if and only if a this object is open OdDb::kForRead with only one reader, and is not
    in a transaction.
  */
    bool isReallyClosing() const;
  
  /** \details
    Returns true if and only this object is a database -resident object.
  */
  bool isDBRO() const;
    
  /** \details
    Throws an exception if this object is not open OdDb::kForRead.
    
    \remarks
    This function should be used only inside member functions that do not modify this object. 
    It should be the first function called by these functions.
    
    Throws:
    <table>
    Exception             Cause
    eNotOpenForRead       !isReadEnabled()
    </table>
  */
  void assertReadEnabled() const;
  
  /** \details
    Throws an exception if this object is not open OdDb::kForWrite,
    and controls automatic undo and notification of modifications.
    
    \param autoUndo [in]  Specifies if automatic undo should be done.
    \param recordModified [in]  Specifies if graphics are to be updated, and
                        "openedForModify", "modified" and "modifiedGraphics"
                        notifications are to be sent. 
    
    \remarks
    This function should be used only inside member functions that modify this object. 
    It should be the first function called by these functions.
    
    Throws:
    <table>
    Exception             Cause
    eNotOpenForWrite     !isWriteEnabled()
    </table>
  */
  void assertWriteEnabled(
    bool autoUndo = true, 
    bool recordModified = true);
  
  /** \details
    Throws an exception if this object is not open OdDb::kForNotify.
    
    \remarks
    This function should be used only inside member functions that are used only when this object
    is open OdDb::kForNotify. It should be the first function called by these functions.
    
    Throws:
    <table>
    Exception            Cause
    eInvalidOpenState    !isNotifyEnabled()
    </table>
  */
  void assertNotifyEnabled() const;
  
  /** \details
    Controls the undo recording of this object in OdDbDatabase.
 
    \param disable [in]  Boolean to control undo recording.
    
    \remarks
    Disabling undo recording does not erase the undo recording; it merely suspends it.
    Undo recording is initially off for newly created OdDbDatabase objects.
  */
  void disableUndoRecording(
    bool disable);
  
  /** \details
    Returns the undo filer associated with this object.
    
    \remarks
    This function is typically used by custom classes using partial Undo
    to add Undo information to the filer that would be used by this
    object applyPartialUndo().
    
    Throws:
    <table>
    Exception           Cause
    eNotOpenForWrite    !isWriteEnabled()
    </table>
  */
  OdDbDwgFiler* undoFiler();
  
  /** \details
    Notification function called each time an Undo operation is performed 
    this object is using partial Undo.
    
    \param pUndoFiler [in]  A pointer to the undo filer with the partial undo information.
    \param pClassObj [in] A pointer to the OdRxClass object for the class that will handle the Undo.
    
    \remarks
    An object indicates it's using the partial undo mechanism, if and only if
    it has set autoUndo false in all calls to assertWriteEnabled().
    
    This member function must know which types of fields to scan, 
    and must stop after reading what it it needs.
 
    If the class type specified by pClassObj does not matches the class of this object,
    this member function must call the parent class's applyPartialUndo() 
    and return whatever it returns.
 
    If it does match the class of this object, this member function must use pUndoFiler to read the undo data, 
    then typically use this object's set() method.
    
    Throws:
    <table>
    Exception                   Cause
    eNotThatKindOfClass         pClassObj != OdDbObject::desc()
    </table>
  */
  virtual void applyPartialUndo(
    OdDbDwgFiler* pUndoFiler, 
    OdRxClass* pClassObj);
  
  /** \details
    Adds the specified transient reactor to this object's reactor list.
 
    \param pReactor [in]  Pointer to the transient reactor object.
 
    \remarks
    An object must be open either OdDb::kForRead or OdDb::kForWrite in order to add a transient reactor.
  */
  void addReactor(
    OdDbObjectReactor* pReactor) const;
  
  /** \details
    Removes the specified transient reactor from this object's reactor list.
 
    \param pReactor [in]  Pointer to the transient reactor object.
 
    \remarks
    An object must be open either OdDb::kForRead or OdDb::kForWrite in order to remove a transient reactor.
  */
  void removeReactor(
    OdDbObjectReactor* pReactor) const;
  
  /** \details
    Adds the specified persistent reactor to this object's reactor list.
 
    \param objId [in]  Object ID of the persistent reactor.
 
    \remarks
    An object must be open OdDb::kForWrite in order to add a persistent reactor.
 
    If the persistent reactor does not have an owner, 
    it isn't saved with the drawing. Non-graphical objects used as persistent 
    reactors are typically stored in a dictionary in the Named Objects Dictionary 
    or in an extension dictionary associated with some object.
  */
  virtual void addPersistentReactor(
    const OdDbObjectId& objId);
  
  /** \details
    Removes the specified persistent reactor from this object's reactor list.
 
    \param objId [in]  Object ID of the persistent reactor.
 
    \remarks
    An object must be open OdDb::kForWrite in order to remove one of its persistent reactors.
  */
  virtual void removePersistentReactor(
    const OdDbObjectId& objId);
  
  /** \details
    This method returns true if objId is the Object ID of a reactor attached to this object. Otherwise, it returns false.
 
    \param objId [in]  Object ID of the persistent reactor.
  */
  bool hasPersistentReactor(
    const OdDbObjectId& objId) const;
 
  /** \details
    Returns Object IDs of this object's persistent reactors.
  */
  OdDbObjectIdArray getPersistentReactors() const;
 
  /** \details
    Returns this object's transient reactors.
  */
  OdDbObjectReactorArray getTransientReactors() const;
  
  /** \details
    Allows a subobject of a complex object to notify its root object that it has been changed. 
    
    \param pSubObj [in]  Pointer to the modifiedsubobject.
 
    \remarks
    Here's how it's supposed to work:
    
    1)  The subobject class's close() calls its triggers a "modified" notification which
        calls its xmitPropagateModify().
    2)  The subobject class calls the its parent's recvPropagateModify() its object's pointer.
    3)  The owner's class's recvPropagateModify() sends a "modified" notification to the top of its class.
    
    The default implementation of this function does nothing. This function can be overridden in custom classes.
  */
  virtual void recvPropagateModify(
    const OdDbObject* pSubObj);
  
  /** \details
    Allows a subobject of a complex object to notify its root object that it has been changed. 
 
    \remarks
    This function must be called within an subobject's close() method.
    
    The owner can then propagate the notification that it has been been modified.
    
    The default implementation of this function inform the database 
    in which the owner resides has been modified; triggering any
    OdDbDatabaseReactors attached to it. This function can be
    overridden in custom classes.
 
    When overriding this function, it should: 
   
    \remarks
    Here's how it's supposed to work:
    
    1)  The subobject class's close() calls its triggers a "modified" notification which
        calls its xmitPropagateModify().
    2)  The subobject class calls the its owner's recvPropagateModify() its object's pointer.
    3)  This owner's class's recvPropagateModify() sends a "modified" notification to the top of its class.
  */
  virtual void xmitPropagateModify() const;
  
  /** \details
    Performs a deep clone of this object.
    
    \param ownerIdMap [in]  Owner's ID map.
 
    \remarks
    Returns a SmartPointer to the newly created clone,
    and adds a record to the specified ID map. 
 
    If the cloning operation fails, a null SmartPointer is returned.
    
    A deep clone is a clone of this object and everything it owns.
    
    This function should not be called by client code; use OdDbDatabase::deepCloneObjects() instead.
 
    This function can be overridden in custom classes.
 
    The default implementation of this function appends the cloned object to the specified owner object.   
  */
  ODRX_SEALED_VIRTUAL OdDbObjectPtr deepClone(OdDbIdMapping& ownerIdMap, OdDbObject* pOwner, bool bPrimary = true) const ODRX_SEALED;
  
  /** \details
    Performs a shallow clone of this object. 
    
    \param ownerIdMap [in/out] Owner's ID map.
 
    \remarks
    Returns a SmartPointer to the newly created clone,
    and adds a record to the specified ID map. 
    If the cloning operation fails, a null SmartPointer is returned.
   
    A shallow clone is a clone of only this object.
    
    This function should not be called by client code; use OdDbDatabase::wblockCloneObjects() instead.
 
    The default implementation of this function calls subWblockClone() for all objects hard-referenced by this object.
    This function can be overridden in custom classes.
    
    \sa
    subDeepClone()
 
  */
        ODRX_SEALED_VIRTUAL OdDbObjectPtr wblockClone(OdDbIdMapping& ownerIdMap, OdDbObject* pOwner, bool bPrimary = true) const ODRX_SEALED;
  
  
  /** \details
    This function appends this object to the specified owner object.
    
    \param idPair [in]  ID pair to append.
    \param pOwnerObject [in]  Pointer to the owner object.
    \param ownerIdMap [in/out] Owner's ID map.
    
    \remarks
    Adds a record to the specified ID map.     
    
    This function is used internally to subDeepClone() and subWblockClone().
    
    Throws:
    <table>
    Exception              Cause
    eInvalidOwnerObject    !pOwnerObject->get()
    </table>
    
  */
  virtual void appendToOwner(
    OdDbIdPair& idPair, 
    OdDbObject* pOwnerObject, 
    OdDbIdMapping& ownerIdMap);
 
  /** \details
    Called on a new created cloned object to indicate that its Object ID is not valid. 
    
    \remarks
    The flags are cleared when the OdDbObject::subDeepClone or OdDbObject::subWblockClone() operation has been completed.
  */
  void setOdDbObjectIdsInFlux();
  
  /** \details
      Returns true if and only if this object's Object ID is not valid because
      the OdDbObject::subDeepClone or OdDbObject::subWblockClone() have yet to be completed.
  */
  bool isOdDbObjectIdsInFlux() const;
  
  /** \details
    Notification function called whenever the notifying object has had its clone() member function called. 
    
    \param pObject [in]  Pointer to the notifying object.
    \param pNewObject [in]  Pointer to the object resulting from the copy.
 
    \remarks
    The default implementation of this function does nothing.  This function can be
    overridden in custom classes.
  */
  virtual void copied(
    const OdDbObject* pObject, 
    const OdDbObject* pNewObject);
  
 
  /** \details
    Notification function called whenever an object has been erased or unerased.
 
    \param pObject [in]  Pointer to the object that was erased/unerased.
    \param erasing [in]  True if and only if this object is being erased.
    
    \remarks
    The default implementation of this function does nothing.  This function can be
    overridden in custom classes.
  */
  virtual void erased(
    const OdDbObject* pObject, 
    bool erasing = true);
  
  /** \details
    Notification function called just before an object is deleted from memory. 
 
    \param pObject [in]  Pointer to the object that is being deleted.
 
    \remarks
    An object is deleted when its reference count reaches 0.
 
    The default implementation of this function does nothing.  This function can be
    overridden in custom classes.
  */
  virtual void goodbye(
    const OdDbObject* pObject);
    
  /** \details
    Notification function called whenever an object is opened for modify OdDb::kForWrite.
 
    \param pObject [in]  Pointer to the object that is being opened.
 
    \remarks
    The default implementation of this function does nothing.  This function can be
    overridden in custom classes.
  */
  virtual void openedForModify(
    const OdDbObject* pObject);
  
  /** \details
      Notification function called whenever an object is opened OdDb::kForWrite, a function
      has been called that could modify the contents of this object, and this object is now being
      closed.
 
      \param pObject [in]  Pointer to the object that is being closed after being modified.
 
      \remarks
      The default implementation of this function does nothing.  This function can be
      overridden in custom classes.
  */
  virtual void modified(
    const OdDbObject* pObject);
 
  /** \details
    Notification function called whenever a method of the
    specified subobject has called assertWriteEnabled()
    
    \param pObject [in]  Pointer to the notifying object.
    \param pSubObj [in]  A pointer to the subobject owned by pObject.
    
    \remarks
    Notification is made upon pObject->close() or pObject->cancel(). 
 
    \note
    This function is called only for the modification of the following:
       
    * Vertices of OdDb2dPolylines, OdDb3dPolylines, OdDbPolygonMeshs, and OdDbPolyFaceMeshes
    * OdDbFaceRecords of OdDbPolyFaceMeshs 
    * OdDbAttributes owned by OdDbBlockReferences, classes derived from OdDbBlockReference, and OdDbMInsertBlocks
  */
  virtual void subObjModified(
    const OdDbObject* pObject, 
    const OdDbObject* pSubObj);
  
  /** \details
    Notification function called whenever the notifying
    object is in the midst an Undo operation that
    is undoing modifications.
    
    \param pObject [in]  Pointer to the notifying object.
    
    \remarks
    The notifying object is open OdDb::kForRead.
    
    The default implementation of this function does nothing.  This function can be
    overridden in custom classes.
  */
  virtual void modifyUndone(
    const OdDbObject* pObject);
  
  /** \details
    Notification function called whenever the XData has been written
    to the notifying object.
    
    \param pObject [in]  Pointer to the notifying object.
    
    \remarks
    Notification is made upon pObject->close() or pObject->cancel(). 
 
    The notifying object is open OdDb::kForRead.
    
    The default implementation of this function does nothing.  This function can be
    overridden in custom classes.
  */
  virtual void modifiedXData(
    const OdDbObject* pObject);
  
  /** \details
    Notification function called whenever the Undo process
    processes the appending of the notifying object to the database.
    
    \param pObject [in]  Pointer to the notifying object.
    
    \remarks
    The notifying object is marked as erased. It is not removed the database, and can be unerased,
    even 'before' it was created. 
    
    The default implementation of this function does nothing.  This function can be
    overridden in custom classes.
  */
  virtual void unappended(
    const OdDbObject* pObject);
  
  
  /** \details
    Notification function called whenever a Redo process
    processes the reappending of the notifying object to the database.
    
    \param pObject [in]  Pointer to the notifying object.
    
    \remarks
    
    The default implementation of this function does nothing.  This function can be
    overridden in custom classes.
  */
  virtual void reappended(
    const OdDbObject* pObject);
  
  /** \details
    Returns true if and only if this object is a proxy object or entity.
  */
  bool isAProxy() const;  
 
  /** \details
    Notification function called immediately before an object is closed.
 
    \param objectId [in]  Object ID of the object that is being closed.
 
    \remarks
    The default implementation of this function does nothing.  This function can be
    overridden in custom classes.
  */
  virtual void objectClosed(
    const OdDbObjectId& objectId);
  
  
  /** \details
    Notification function called whenever an object derived from OdDbEntity is modified.
    
    \param pObject [in]  Pointer to the modified object.
    
    \remarks
    The default implementation of this function does nothing.  This function can be
    overridden in custom classes.
    
    This function is called whenever the following has occurred.
    
    1)  The calling object is opened OdDb::kForWrite.
    
    2)  One of its member functions either
    
        a Calls its assertWriteEnabled with recordModified == true.
        
        b Calls its recordGraphicsModified(true).
    
    3) The calling object is being closed.
    
    This function is called whenever the object as been modified. It therefore
    indicates only that the graphics for it may have changed.
            
  */
  virtual void modifiedGraphics(
    const OdDbObject* pObject);
    
  /** \details
    Copies the contents of the specified object into this object when possible.
 
    \param pSource [in]  Pointer to the source object.
 
    \remarks
    The source object and this object need not be of the same type.  
    This function is meaningful only when implemented by custom classes.
    
    Throws:
    <table>
    Exception           Cause
    eNullObjectPointer  pSource->isNull()
    </table>
  */
  virtual void copyFrom(
    const OdRxObject* pSource);
 
  /** \details
    Returns true if and only if this object has its
    bit set to override the filer version.
  */
       bool hasSaveVersionOverride() const;
  
  /** \details
    Controls the flag specifying that this object
    overrides the save filer version.
    
    \param hasSaveVersionOverride [in]  Has save version override.
               
    \remarks
    By default, objects are saved in the highest of the your object's birth version and the filer version.
  */
       void setHasSaveVersionOverride(
    bool hasSaveVersionOverride);
  
  /** \details
    Returns the drawing and maintenance release version into which this object must be stored.
 
    \param pFiler [in]  Pointer to the DWG/DXF filer to be used.
    \param pMaintVer [out]  Receives the maintenance version. 
 
    \remarks
    The default implementation of this function returns filer->dwgVersion().  This function can be
    overridden in custom classes.
    
    Do not use filer->dwgVersion() with dwg/dxf(in/out)Fields(); use self()->getObjectSaveVersion() instead. 
  */
  virtual OdDb::DwgVersion getObjectSaveVersion(
    const OdDbFiler* pFiler,
    OdDb::MaintReleaseVer* pMaintVer = 0) const;
      
  /** \details
    Determines the behavior for custom objects when saving to .dwg or .dxf file. 
    
    \param format [in]  File type.
    \param ver [in]  Drawing version to save as.
    \param replaceId [out]  Object ID of the object replacing this object.
    \param exchangeXData [out]  Set to true if and only if this function did not add XData to the replacement object.
 
    \remarks
    This function either
    
    * Returns an OdDbObjectPtr for a non- database -resident (NDBRO) replacement object, setting replaceId to OdDbObjectId::kNull.
    * Returns NULL, setting replaceId for a database -resident (DBRO) replacement object.
    
    Custom objects can decompose themselves into other objects, adding additional XData as required. Teigha 
    transfers XData from this object to the replacement object if and only if exchangeXData is true.
    
    The default implementation returns NULL and sets replaceId to OdDbObjectId::kNull.  This function can be
    overridden in custom classes.
 
    The method is not intended to be called by client code. For processing owned objects use *convertForSave()*
    method.
  */
  virtual OdDbObjectPtr decomposeForSave(
    OdDb::DwgVersion ver, 
    OdDbObjectId& replaceId, 
    bool& exchangeXData);
 
  virtual OdDbObjectPtr decomposeForSave(
    OdDb::SaveType format, 
    OdDb::DwgVersion ver, 
    OdDbObjectId& replaceId, 
    bool& exchangeXData);
 
  /** \details
    The method should be called from *decomposeForSave()* of custom container objects for owned child objects.
    It calls child's decomposeForSave() method plus performs other required actions
    (handOverTo, exchanging XData, etc.)
    
    \param ver [in]  Drawing version to save as.
 
    \remarks
  */
  void convertForSave(OdDb::DwgVersion ver);
 
  /** \details
    After loading from file, performs necessary actions which require accessing other Database objects.
    For example, processing round-trip data.
    
    \param format [in]  File type.
    \param version [in]  Drawing version of file loaded.
    \param pAuditInfo [in]  Pointer to an OdDbAuditInfo object. Can be Null. Not Null if drawing is being loaded in Recover mode.
    If so, audit() will be called later.
 
    \remarks
    If an object in its dwgInFields() method accesses other database objects, it's non-thread-safe.
    Such objects can't be loaded in MT mode. To enable MT loading of custom objects, its dwgInFields()
    should not access other database objects. Such actions should be performed in composeForLoad().
    composeForLoad() is called in single-thread mode after all thread-safe objects are loaded (their dwgInFields()
    were called in MT mode).
 
    Being overridden in custom classes, the function first should call the parent class method.
    Parent class implementation takes care of parent class round-trip data and other actions which require
    access to other objects.
  */
  virtual void composeForLoad(OdDb::SaveType format, OdDb::DwgVersion version, OdDbAuditInfo* pAuditInfo);
 
  /** \details
    Returns a pointer to the OdGiDrawable for the object. If the object doesn't have an associated OdGiDrawable object, this function returns NULL. 
  */
  virtual OdGiDrawable* drawable();
 
  /** \details
    Sets the values of this object's subentity traits, and returns with the calling object's subentity traits.
 
    \param pTraits [in]  Pointer to the OdGiDrawableTraits object to be set.
    
    \remarks
    When overriding subSetAttributes(), you must OR (|) the return value 
    of <base class>::subSetAttributes(pTraits) with any flags you add. 
    
    A derived class may not remove flags for any reason.
    
    The default implementation does nothing but returns kDrawableNone. This function can be
    overridden in custom classes.
  */
  virtual OdUInt32 subSetAttributes(
    OdGiDrawableTraits* pTraits) const;
  
  virtual bool subWorldDraw(
    OdGiWorldDraw* pWd) const;
  
  virtual void subViewportDraw(
    OdGiViewportDraw* pVd) const;
  
  /** \details
    Return true if and only if this object is database -resident (DBRO).
    
    \remarks
    Persistent objects belong to an object that must be opened and closed.
 
    Non-persistent objects can be accessed through their pointers.
  */
    virtual bool isPersistent() const;
  
  /** Returns the database ID corresponding to this object.
  */
  virtual OdDbStub* id() const;
    
  /** \details
    Returns the CLSID value associated with this object.
    
    \param pClsid [out]  Pointer to the CLSID value.
    
    \remarks
    Valid only on Windows with Teigha built as a DLL.
  */
  ODRX_SEALED_VIRTUAL OdResult getClassID(void* pClsid) const ODRX_SEALED;
 
  // Override of OdGiDrawable
  
  /** \details
    Assigns the specified OdGsCache to the calling object.
 
    \param pNode [in]  Pointer to the OdGsCache object.
  */
  void setGsNode(OdGsCache* pNode);
 
  // Override of OdGiDrawable
  
  /** \details
    Returns the OdGsCache of an OdGiDrawable object.
  */
  OdGsCache* gsNode() const;
 
  /*
    void upgradeFromNotify (bool& wasWritable);
    void downgradeToNotify (bool wasWritable);
    OdResult closeAndPage (bool onlyWhenClean = true);
    virtual void swapReferences (const OdDbIdMapping& idMap);
    virtual OdGiDrawable* drawable ();
    OdDbObjPtrArray* reactors (); 
    virtual OdRxObjectPtr clone (OdDbIdMapping& ownerIdMap) const;
  */
  
  /** \details
    Applies the 3D transformation matrix to the XData of this object.
    
    \param xfm [in]  3D transformation matrix.
    
    \remarks
    Applies the transformation matrix to only the following XData data types:
    
    <table>
    Name                Value
    kDxfXdWorldXCoord   1011   
    kDxfXdWorldYCoord   1021   
    kDxfXdWorldZCoord   1031   
    kDxfXdWorldXDisp    1012   
    kDxfXdWorldYDisp    1022   
    kDxfXdWorldZDisp    1032   
    kDxfXdWorldXDir     1013   
    kDxfXdWorldYDir     1023   
    kDxfXdWorldZDir     1033   
    kDxfXdDist          1041   
    kDxfXdScale         1042   
    </table>
  */
  void xDataTransformBy(
    const OdGeMatrix3d& xfm);
 
  /** \details
    Returns true if and only if this object has fields.
  */
  bool hasFields() const;
  
  /** \details
    Returns, and optionally opens, the specified field object from the field dictionary of this object.
    
    \param fieldName [in]  Name (key) for the new entry.
    \param mode [in]  Open mode.
  */
  OdDbObjectId getField(
    const OdString& fieldName) const;
  OdDbObjectPtr getField(
    const OdString& fieldName, 
    OdDb::OpenMode mode) const;
 
  /** \details
    Adds the specified field to the field dictionary of this object.
    
    \param fieldName [in]  Name (key) for the new entry.
    \param pField [in]  Pointer to the field object.
    
    \remarks
    Returns the Object ID of the new entry.
  */
  virtual OdDbObjectId setField(
    const OdString& fieldName, 
    OdDbField* pField);
 
  /** \details
    Removes the specified field from the field dictionary of this object.
    
    \param fieldName [in]  Name (key) for the entry.
    \param fieldId [in]  Object ID for the field.
    
    \remarks
    If fieldId is specified, returns eOk if successful, or an appropriate error code if not.
    
    If fieldName is specified, returns the Object ID of the removed field if successful, 
    or a null Object ID if not.
  */
  virtual OdResult removeField(
    OdDbObjectId fieldId);
  virtual OdDbObjectId removeField(
    const OdString& fieldName);
 
  /** \details
    Returns, and optionally opens, the field dictionary of this Object.
    \param mode [in]  Open mode.
    \remarks
  */
  OdDbObjectId getFieldDictionary() const;
  OdDbObjectPtr getFieldDictionary(
    OdDb::OpenMode mode) const;
 
 
  /** \details
      For Teigha internal use only
  */
  
  /*!DOM*/
  virtual OdRxClass* saveAsClass(
    OdRxClass* pClass) const;
 
protected: // overridables
  virtual OdResult subGetClassID(void* pClsid) const;
  virtual OdDbObjectPtr subDeepClone(OdDbIdMapping& ownerIdMap, OdDbObject* pOwner, bool bPrimary) const;
  virtual OdDbObjectPtr subWblockClone(OdDbIdMapping& ownerIdMap, OdDbObject* pOwner, bool bPrimary) const;
 
  friend class OdDbSystemInternals;
  friend class OdDbObjectOverrule;
  friend class OdDbPropertiesOverrule;
  friend class OdDbObjectImpl;
  OdDbObjectImpl* m_pImpl;
};
 
/** \details
  This template class is a specialization of the OdSmartPtr class for all objects contained 
  in the database.
 
  \sa
  <link smart_pointers.html, Working with Smart Pointers>
*/
typedef OdSmartPtr<OdDbObject> OdDbObjectPtr;
 
 
/** \details
    Returns the data for the specified object.
        
    \param id [in]  Object ID of the object.
    \param pObj [in]  Pointer to the object.
    \param regapps [in]  Registered application name to retrieve extended data for. 
                May be a wildcard or comma separated list. If empty - no XData is returned.
    
    \remarks
    Each OdResBuf in the list contains a single DXF group code and data value pertaining 
    to the object.
    
    The object is opened in kForRead mode, and the returned list of data
    is independent of the original object (it may be modified or deleted without 
    affecting the original object).  To affect changes in the original object
    via the returned OdResBuf data, oddbEntMod must be called.
 
    throws:
    An OdError exception will be thrown if the passed in object cannot be opened.
*/
TOOLKIT_EXPORT OdResBufPtr oddbEntGet( const OdDbObject* pObj, const OdString& regapps = OdString::kEmpty );
 
inline OdResBufPtr oddbEntGet( const OdDbObjectId& id, const OdString& regapps = OdString::kEmpty )
{
  return oddbEntGet(id.safeOpenObject(), regapps);
}
 
 
/** \details
    Sets the data for the specified object.
        
    \param id [in]  Object ID of the object.
    \param pObj [in]  Pointer to the object.
    
    \remarks
    Each OdResBuf in the list contains a single DXF group code and data value pertaining 
    to the object.
    
    throws:
    An OdError exception will be thrown if the passed in object cannot be opened in kForWrite
    mode.
*/
TOOLKIT_EXPORT OdResult oddbEntMod( OdDbObject* pObj, OdResBuf* pRb );
 
inline OdResult oddbEntMod( const OdDbObjectId& id, OdResBuf* pRb )
{
  return oddbEntMod(id.safeOpenObject(OdDb::kForWrite), pRb);
}
 
TOOLKIT_EXPORT OdDbObjectId oddbEntNext(OdDbObjectId id, OdDbDatabase* db);
TOOLKIT_EXPORT OdDbObjectId oddbEntLast(OdDbDatabase* db);
 
TOOLKIT_EXPORT OdResult oddbEntMake(OdDbDatabase* pDb, OdResBuf* pRb, OdDbObjectPtr& pObj);
TOOLKIT_EXPORT OdResult oddbEntMakeX(OdDbDatabase* pDb, OdResBuf* pRb, OdDbObjectPtr& pObj);
 
 
 
#include "TD_PackPop.h"
 
#endif //_ODDBXOBJECT_INCLUDED_