dbsymtb.h 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402
  1. //
  2. ////////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Copyright 2015 Autodesk, Inc. All rights reserved.
  5. //
  6. // Use of this software is subject to the terms of the Autodesk license
  7. // agreement provided at the time of installation or download, or which
  8. // otherwise accompanies this software in either electronic or hard copy form.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. //
  12. // DESCRIPTION: Exported protocol for AutoCAD's built in symbol
  13. // tables, their table specific record types, and
  14. // their iterators.
  15. #ifndef AD_DBSYMTB_H
  16. #define AD_DBSYMTB_H
  17. #include "dbmain.h"
  18. #include "dbdict.h"
  19. #include "dbdate.h"
  20. #include "dbbackground.h"
  21. #include "gevec2d.h"
  22. #include "acgiviewport.h"
  23. #include "acgivisualstyle.h"
  24. #pragma pack(push, 8)
  25. #ifdef target
  26. # undef target
  27. #endif
  28. class AcDbSortentsTable;
  29. class AcDbSymbolTableIterator;
  30. class AcDbSymbolTableRecord;
  31. class AcDbAnnotationScale;
  32. class AcGsView;
  33. class AcString;
  34. namespace Atil
  35. {
  36. class Image; // for Atil::Image
  37. }
  38. class ADESK_NO_VTABLE AcDbSymbolTable: public AcDbObject
  39. //
  40. // (... and Subclasses)
  41. //
  42. // Note that there is both overloading of functions within each
  43. // class defined by these macros and overriding of non virtual
  44. // functions between classes. The overriding of these functions
  45. // is necessary to allow some member functions to take arguments
  46. // that are appropriate for a given table.
  47. //
  48. {
  49. public:
  50. ACDB_DECLARE_MEMBERS(AcDbSymbolTable);
  51. AcDbSymbolTable();
  52. virtual ~AcDbSymbolTable();
  53. typedef AcDbSymbolTableRecord RecordType;
  54. Acad::ErrorStatus getAt (const ACHAR* entryName,
  55. AcDbSymbolTableRecord*& pRec,
  56. AcDb::OpenMode openMode,
  57. bool openErasedRec = false) const;
  58. Acad::ErrorStatus getAt (const ACHAR* entryName,
  59. AcDbObjectId& recordId,
  60. bool getErasedRecord = false) const;
  61. bool has(const ACHAR* name) const;
  62. bool has(AcDbObjectId id) const;
  63. Acad::ErrorStatus newIterator(AcDbSymbolTableIterator*& pIterator,
  64. bool atBeginning = true,
  65. bool skipDeleted = true) const;
  66. Acad::ErrorStatus add(AcDbSymbolTableRecord* pRecord);
  67. Acad::ErrorStatus add(AcDbObjectId& recordId, AcDbSymbolTableRecord* pRecord);
  68. };
  69. class AcDbBlockTableRecord;
  70. class AcDbBlockTableIterator;
  71. class AcDbBlockTable: public AcDbSymbolTable
  72. {
  73. public:
  74. ACDB_DECLARE_MEMBERS(AcDbBlockTable);
  75. AcDbBlockTable();
  76. virtual ~AcDbBlockTable();
  77. typedef AcDbBlockTableRecord RecordType;
  78. Acad::ErrorStatus getAt (const ACHAR* entryName,
  79. AcDbBlockTableRecord*& pRec,
  80. AcDb::OpenMode openMode,
  81. bool openErasedRec = false) const;
  82. Acad::ErrorStatus getAt (const ACHAR* entryName,
  83. AcDbObjectId& recordId,
  84. bool getErasedRec = false) const;
  85. bool has (const ACHAR* name) const;
  86. bool has (AcDbObjectId id) const;
  87. Acad::ErrorStatus newIterator(AcDbBlockTableIterator*& pIterator,
  88. bool atBeginning = true,
  89. bool skipDeleted = true) const;
  90. Acad::ErrorStatus add (AcDbBlockTableRecord* pRecord);
  91. Acad::ErrorStatus add (AcDbObjectId& recordId, AcDbBlockTableRecord* pRecord);
  92. protected:
  93. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  94. };
  95. class AcDbLayerTableRecord;
  96. class AcDbLayerTableIterator;
  97. class AcDbLayerTable: public AcDbSymbolTable
  98. {
  99. public:
  100. ACDB_DECLARE_MEMBERS(AcDbLayerTable);
  101. AcDbLayerTable();
  102. virtual ~AcDbLayerTable();
  103. typedef AcDbLayerTableRecord RecordType;
  104. Acad::ErrorStatus getAt(const ACHAR* entryName,
  105. AcDbLayerTableRecord*& pRec,
  106. AcDb::OpenMode openMode,
  107. bool openErasedRec = false) const;
  108. Acad::ErrorStatus getAt(const ACHAR* entryName,
  109. AcDbObjectId& recordId,
  110. bool getErasedRecord = false) const;
  111. bool has (const ACHAR* name) const;
  112. bool has (AcDbObjectId id) const;
  113. Acad::ErrorStatus newIterator(AcDbLayerTableIterator*& pIterator,
  114. bool atBeginning = true,
  115. bool skipDeleted = true) const;
  116. Acad::ErrorStatus add (AcDbLayerTableRecord* pRecord);
  117. Acad::ErrorStatus add (AcDbObjectId& recordId, AcDbLayerTableRecord* pRecord);
  118. void generateUsageData();
  119. bool hasUnreconciledLayers() const;
  120. Acad::ErrorStatus getUnreconciledLayers(AcDbObjectIdArray& idArray) const;
  121. protected:
  122. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  123. };
  124. class AcDbTextStyleTableRecord;
  125. class AcDbTextStyleTableIterator;
  126. class AcDbTextStyleTable: public AcDbSymbolTable
  127. {
  128. public:
  129. ACDB_DECLARE_MEMBERS(AcDbTextStyleTable);
  130. AcDbTextStyleTable();
  131. virtual ~AcDbTextStyleTable();
  132. typedef AcDbTextStyleTableRecord RecordType;
  133. Acad::ErrorStatus getAt(const ACHAR* entryName,
  134. AcDbTextStyleTableRecord*& pRec,
  135. AcDb::OpenMode openMode,
  136. bool openErasedRec = false) const;
  137. Acad::ErrorStatus getAt (const ACHAR* entryName,
  138. AcDbObjectId& recordId,
  139. bool getErasedRecord = false) const;
  140. bool has (const ACHAR* name) const;
  141. bool has (AcDbObjectId id) const;
  142. Acad::ErrorStatus newIterator(AcDbTextStyleTableIterator*& pIterator,
  143. bool atBeginning = true,
  144. bool skipDeleted = true) const;
  145. Acad::ErrorStatus add (AcDbTextStyleTableRecord* pRecord);
  146. Acad::ErrorStatus add (AcDbObjectId& recordId,
  147. AcDbTextStyleTableRecord* pRecord);
  148. protected:
  149. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  150. };
  151. class AcDbLinetypeTableRecord;
  152. class AcDbLinetypeTableIterator;
  153. class AcDbLinetypeTable: public AcDbSymbolTable
  154. {
  155. public:
  156. ACDB_DECLARE_MEMBERS(AcDbLinetypeTable);
  157. AcDbLinetypeTable();
  158. virtual ~AcDbLinetypeTable();
  159. typedef AcDbLinetypeTableRecord RecordType;
  160. Acad::ErrorStatus getAt(const ACHAR* entryName,
  161. AcDbLinetypeTableRecord*& pRec,
  162. AcDb::OpenMode openMode,
  163. bool openErasedRec = false) const;
  164. Acad::ErrorStatus getAt(const ACHAR* entryName,
  165. AcDbObjectId& recordId,
  166. bool getErasedRec = false) const;
  167. bool has (const ACHAR* name) const;
  168. bool has (AcDbObjectId id) const;
  169. Acad::ErrorStatus newIterator(AcDbLinetypeTableIterator*& pIterator,
  170. bool atBeginning = true,
  171. bool skipDeleted = true) const;
  172. Acad::ErrorStatus add (AcDbLinetypeTableRecord* pRecord);
  173. Acad::ErrorStatus add (AcDbObjectId& recordId,
  174. AcDbLinetypeTableRecord* pRecord);
  175. protected:
  176. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  177. };
  178. class AcDbAbstractViewTableRecord;
  179. class AcDbAbstractViewTableIterator;
  180. class ADESK_NO_VTABLE AcDbAbstractViewTable: public AcDbSymbolTable
  181. {
  182. public:
  183. ACDB_DECLARE_MEMBERS(AcDbAbstractViewTable);
  184. AcDbAbstractViewTable();
  185. virtual ~AcDbAbstractViewTable();
  186. Acad::ErrorStatus getAt(const ACHAR* entryName,
  187. AcDbAbstractViewTableRecord*& pRec,
  188. AcDb::OpenMode openMode,
  189. bool openErasedRec = false) const;
  190. Acad::ErrorStatus getAt(const ACHAR* entryName,
  191. AcDbObjectId& recordId,
  192. bool getErasedRecord = false) const;
  193. bool has (const ACHAR* name) const;
  194. bool has (AcDbObjectId id) const;
  195. Acad::ErrorStatus newIterator(AcDbAbstractViewTableIterator*& pIterator,
  196. bool atBeginning = true,
  197. bool skipDeleted = true) const;
  198. Acad::ErrorStatus add (AcDbAbstractViewTableRecord* pRecord);
  199. Acad::ErrorStatus add (AcDbObjectId& recordId,
  200. AcDbAbstractViewTableRecord* pRecord);
  201. };
  202. class AcDbViewTableRecord;
  203. class AcDbViewTableIterator;
  204. class AcDbViewTable: public AcDbAbstractViewTable
  205. {
  206. public:
  207. ACDB_DECLARE_MEMBERS(AcDbViewTable);
  208. AcDbViewTable();
  209. virtual ~AcDbViewTable();
  210. typedef AcDbViewTableRecord RecordType;
  211. Acad::ErrorStatus getAt(const ACHAR* entryName,
  212. AcDbViewTableRecord*& pRec,
  213. AcDb::OpenMode openMode,
  214. bool openErasedRec = false) const;
  215. Acad::ErrorStatus getAt(const ACHAR* entryName,
  216. AcDbObjectId& recordId,
  217. bool getErasedRec = false) const;
  218. bool has (const ACHAR* name) const;
  219. bool has (AcDbObjectId id) const;
  220. Acad::ErrorStatus newIterator(AcDbViewTableIterator*& pIterator,
  221. bool atBeginning = true,
  222. bool skipDeleted = true) const;
  223. Acad::ErrorStatus add (AcDbViewTableRecord* pRecord);
  224. Acad::ErrorStatus add (AcDbObjectId& recordId,
  225. AcDbViewTableRecord* pRecord);
  226. protected:
  227. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  228. };
  229. class AcDbUCSTableRecord;
  230. class AcDbUCSTableIterator;
  231. class AcDbUCSTable: public AcDbSymbolTable
  232. {
  233. public:
  234. ACDB_DECLARE_MEMBERS(AcDbUCSTable);
  235. AcDbUCSTable();
  236. virtual ~AcDbUCSTable();
  237. typedef AcDbUCSTableRecord RecordType;
  238. Acad::ErrorStatus getAt(const ACHAR* entryName,
  239. AcDbUCSTableRecord*& pRec,
  240. AcDb::OpenMode openMode,
  241. bool openErasedRec = false) const;
  242. Acad::ErrorStatus getAt(const ACHAR* entryName,
  243. AcDbObjectId& recordId,
  244. bool getErasedRecord = false) const;
  245. bool has (const ACHAR* name) const;
  246. bool has (AcDbObjectId id) const;
  247. Acad::ErrorStatus newIterator(AcDbUCSTableIterator*& pIterator,
  248. bool atBeginning = true,
  249. bool skipDeleted = true) const;
  250. Acad::ErrorStatus add (AcDbUCSTableRecord* pRecord);
  251. Acad::ErrorStatus add (AcDbObjectId& recordId,
  252. AcDbUCSTableRecord* pRecord);
  253. protected:
  254. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  255. };
  256. class AcDbViewportTableRecord;
  257. class AcDbViewportTableIterator;
  258. class AcDbViewportTable: public AcDbAbstractViewTable
  259. {
  260. public:
  261. ACDB_DECLARE_MEMBERS(AcDbViewportTable);
  262. AcDbViewportTable();
  263. virtual ~AcDbViewportTable();
  264. typedef AcDbViewportTableRecord RecordType;
  265. Acad::ErrorStatus getAt(const ACHAR* entryName,
  266. AcDbViewportTableRecord*& pRec,
  267. AcDb::OpenMode openMode,
  268. bool openErasedRec = false) const;
  269. Acad::ErrorStatus getAt(const ACHAR* entryName,
  270. AcDbObjectId& recordId,
  271. bool getErasedRecord = false) const;
  272. bool has (const ACHAR* name) const;
  273. bool has (AcDbObjectId id) const;
  274. Acad::ErrorStatus newIterator(AcDbViewportTableIterator*& pIterator,
  275. bool atBeginning = true,
  276. bool skipDeleted = true) const;
  277. Acad::ErrorStatus add (AcDbViewportTableRecord* pRecord);
  278. Acad::ErrorStatus add (AcDbObjectId& recordId,
  279. AcDbViewportTableRecord* pRecord);
  280. protected:
  281. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  282. };
  283. class AcDbRegAppTableRecord;
  284. class AcDbRegAppTableIterator;
  285. class AcDbRegAppTable: public AcDbSymbolTable
  286. {
  287. public:
  288. ACDB_DECLARE_MEMBERS(AcDbRegAppTable);
  289. AcDbRegAppTable();
  290. virtual ~AcDbRegAppTable();
  291. typedef AcDbRegAppTableRecord RecordType;
  292. Acad::ErrorStatus getAt(const ACHAR* entryName,
  293. AcDbRegAppTableRecord*& pRec,
  294. AcDb::OpenMode openMode,
  295. bool openErasedRec = false) const;
  296. Acad::ErrorStatus getAt(const ACHAR* entryName,
  297. AcDbObjectId& recordId,
  298. bool getErasedRec = false) const;
  299. bool has (const ACHAR* name) const;
  300. bool has (AcDbObjectId id) const;
  301. Acad::ErrorStatus newIterator(AcDbRegAppTableIterator*& pIterator,
  302. bool atBeginning = true,
  303. bool skipDeleted = true) const;
  304. Acad::ErrorStatus add (AcDbRegAppTableRecord* pRecord);
  305. Acad::ErrorStatus add (AcDbObjectId& recordId,
  306. AcDbRegAppTableRecord* pRecord);
  307. protected:
  308. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  309. };
  310. class AcDbDimStyleTableRecord;
  311. class AcDbDimStyleTableIterator;
  312. class AcDbDimStyleTable: public AcDbSymbolTable
  313. {
  314. public:
  315. ACDB_DECLARE_MEMBERS(AcDbDimStyleTable);
  316. AcDbDimStyleTable();
  317. virtual ~AcDbDimStyleTable();
  318. typedef AcDbDimStyleTableRecord RecordType;
  319. Acad::ErrorStatus getAt (const ACHAR* entryName,
  320. AcDbDimStyleTableRecord*& pRec,
  321. AcDb::OpenMode openMode,
  322. bool openErasedRec = false) const;
  323. Acad::ErrorStatus getAt (const ACHAR* entryName,
  324. AcDbObjectId& recordId,
  325. bool getErasedRec = false) const;
  326. bool has (const ACHAR* name) const;
  327. bool has (AcDbObjectId id) const;
  328. Acad::ErrorStatus newIterator(AcDbDimStyleTableIterator*& pIterator,
  329. bool atBeginning = true,
  330. bool skipDeleted = true) const;
  331. Acad::ErrorStatus add (AcDbDimStyleTableRecord* pRecord);
  332. Acad::ErrorStatus add (AcDbObjectId& recordId,
  333. AcDbDimStyleTableRecord* pRecord);
  334. protected:
  335. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  336. };
  337. ///// AcDbSymbolTableIterator
  338. //
  339. // This class is responsible for iterating over the records in a symbol
  340. // table.
  341. //
  342. // This is a completely "generic" symbol table iterator in that it can
  343. // be used to iterate over the contents of any AcDbSymbolTable subclass.
  344. // However, symbol table specific iterators are defined below.
  345. //
  346. // One major item of note. The creation of one of these iterators
  347. // requires the opening (for read) of the table being iterated over.
  348. // This read stays in effect until the iterator is destroyed.
  349. //
  350. class AcDbSymbolTableIterator
  351. {
  352. public:
  353. virtual ~AcDbSymbolTableIterator();
  354. void start (bool atBeginning = true,
  355. bool skipDeleted = true);
  356. bool done () const;
  357. Acad::ErrorStatus getRecordId(AcDbObjectId& id) const;
  358. Acad::ErrorStatus getRecord(AcDbSymbolTableRecord*& pRecord,
  359. AcDb::OpenMode openMode,
  360. bool openErasedRec = false) const;
  361. void step (bool forward = true,
  362. bool skipDeleted = true);
  363. Acad::ErrorStatus seek (AcDbObjectId id);
  364. Acad::ErrorStatus seek (const AcDbSymbolTableRecord* pRecord);
  365. protected:
  366. void* mpImp;
  367. AcDbSymbolTableIterator();
  368. friend class AcDbSymbolTable;
  369. };
  370. class AcDbBlockTableIterator : public AcDbSymbolTableIterator
  371. {
  372. public:
  373. Acad::ErrorStatus getRecord(AcDbBlockTableRecord*& pRecord,
  374. AcDb::OpenMode openMode, bool openErasedRec = false) const;
  375. Acad::ErrorStatus seek(AcDbObjectId id);
  376. Acad::ErrorStatus seek(const AcDbBlockTableRecord* pRecord);
  377. protected:
  378. AcDbBlockTableIterator();
  379. friend class AcDbBlockTable;
  380. };
  381. class AcDbLayerTableIterator : public AcDbSymbolTableIterator
  382. {
  383. public:
  384. Acad::ErrorStatus getRecord(AcDbLayerTableRecord*& pRecord,
  385. AcDb::OpenMode openMode, bool openErasedRec = false) const;
  386. Acad::ErrorStatus seek(AcDbObjectId id);
  387. Acad::ErrorStatus seek(const AcDbLayerTableRecord* pRecord);
  388. bool getSkipHidden() const;
  389. void setSkipHidden(bool value);
  390. bool getSkipReconciled() const;
  391. void setSkipReconciled(bool value);
  392. protected:
  393. AcDbLayerTableIterator();
  394. friend class AcDbLayerTable;
  395. };
  396. class AcDbTextStyleTableIterator : public AcDbSymbolTableIterator
  397. {
  398. public:
  399. Acad::ErrorStatus getRecord(AcDbTextStyleTableRecord*& pRecord,
  400. AcDb::OpenMode openMode, bool openErasedRec = false) const;
  401. Acad::ErrorStatus seek(AcDbObjectId id);
  402. Acad::ErrorStatus seek(const AcDbTextStyleTableRecord* pRecord);
  403. protected:
  404. AcDbTextStyleTableIterator();
  405. friend class AcDbTextStyleTable;
  406. };
  407. class AcDbLinetypeTableIterator : public AcDbSymbolTableIterator
  408. {
  409. public:
  410. Acad::ErrorStatus getRecord(AcDbLinetypeTableRecord*& pRecord,
  411. AcDb::OpenMode openMode, bool openErasedRec = false) const;
  412. Acad::ErrorStatus seek(AcDbObjectId id);
  413. Acad::ErrorStatus seek(const AcDbLinetypeTableRecord* pRecord);
  414. protected:
  415. AcDbLinetypeTableIterator();
  416. friend class AcDbLinetypeTable;
  417. };
  418. class AcDbAbstractViewTableIterator : public AcDbSymbolTableIterator
  419. {
  420. public:
  421. Acad::ErrorStatus getRecord(AcDbAbstractViewTableRecord*& pRecord,
  422. AcDb::OpenMode openMode, bool openErasedRec = false) const;
  423. Acad::ErrorStatus seek(AcDbObjectId id);
  424. Acad::ErrorStatus seek(const AcDbAbstractViewTableRecord* pRecord);
  425. protected:
  426. AcDbAbstractViewTableIterator();
  427. friend class AcDbAbstractViewTable;
  428. };
  429. class AcDbViewTableIterator : public AcDbAbstractViewTableIterator
  430. {
  431. public:
  432. Acad::ErrorStatus getRecord(AcDbViewTableRecord*& pRecord,
  433. AcDb::OpenMode openMode, bool openErasedRec = false) const;
  434. Acad::ErrorStatus seek(AcDbObjectId id);
  435. Acad::ErrorStatus seek(const AcDbViewTableRecord* pRecord);
  436. protected:
  437. AcDbViewTableIterator();
  438. friend class AcDbViewTable;
  439. };
  440. class AcDbUCSTableIterator : public AcDbSymbolTableIterator
  441. {
  442. public:
  443. Acad::ErrorStatus getRecord(AcDbUCSTableRecord*& pRecord,
  444. AcDb::OpenMode openMode, bool openErasedRec = false) const;
  445. Acad::ErrorStatus seek(AcDbObjectId id);
  446. Acad::ErrorStatus seek(const AcDbUCSTableRecord* pRecord);
  447. protected:
  448. AcDbUCSTableIterator();
  449. friend class AcDbUCSTable;
  450. };
  451. class AcDbViewportTableIterator : public AcDbAbstractViewTableIterator
  452. {
  453. public:
  454. Acad::ErrorStatus getRecord(AcDbViewportTableRecord*& pRecord,
  455. AcDb::OpenMode openMode, bool openErasedRec = false) const;
  456. Acad::ErrorStatus seek(AcDbObjectId id);
  457. Acad::ErrorStatus seek(const AcDbViewportTableRecord* pRecord);
  458. protected:
  459. AcDbViewportTableIterator();
  460. friend class AcDbViewportTable;
  461. };
  462. class AcDbRegAppTableIterator : public AcDbSymbolTableIterator
  463. {
  464. public:
  465. Acad::ErrorStatus getRecord(AcDbRegAppTableRecord*& pRecord,
  466. AcDb::OpenMode openMode, bool openErasedRec = false) const;
  467. Acad::ErrorStatus seek(AcDbObjectId id);
  468. Acad::ErrorStatus seek(const AcDbRegAppTableRecord* pRecord);
  469. protected:
  470. AcDbRegAppTableIterator();
  471. friend class AcDbRegAppTable;
  472. };
  473. class AcDbDimStyleTableIterator : public AcDbSymbolTableIterator
  474. {
  475. public:
  476. Acad::ErrorStatus getRecord(AcDbDimStyleTableRecord*& pRecord,
  477. AcDb::OpenMode openMode, bool openErasedRec = false) const;
  478. Acad::ErrorStatus seek(AcDbObjectId id);
  479. Acad::ErrorStatus seek(const AcDbDimStyleTableRecord* pRecord);
  480. protected:
  481. AcDbDimStyleTableIterator();
  482. friend class AcDbDimStyleTable;
  483. };
  484. class ADESK_NO_VTABLE AcDbSymbolTableRecord: public AcDbObject
  485. {
  486. public:
  487. ACDB_DECLARE_MEMBERS(AcDbSymbolTableRecord);
  488. AcDbSymbolTableRecord();
  489. virtual ~AcDbSymbolTableRecord();
  490. typedef AcDbSymbolTable TableType;
  491. Acad::ErrorStatus getName(ACHAR*& pName) const;
  492. Acad::ErrorStatus getName(AcString & sName) const;
  493. Acad::ErrorStatus getName(const ACHAR*& pName) const;
  494. Acad::ErrorStatus setName(const ACHAR* pName);
  495. bool isDependent() const;
  496. bool isResolved() const;
  497. bool isRenamable() const;
  498. };
  499. class AcDbBlockTableRecordIterator
  500. {
  501. public:
  502. virtual ~AcDbBlockTableRecordIterator();
  503. void start (bool atBeginning = true,
  504. bool skipDeleted = true);
  505. bool done () const;
  506. Acad::ErrorStatus getEntityId (AcDbObjectId& entityId) const;
  507. Acad::ErrorStatus getEntity(AcDbEntity*& pEntity, AcDb::OpenMode openMode,
  508. bool openErasedEntity = false) const;
  509. AcDbBlockTableRecord* blockTableRecord() const;
  510. void step (bool forward = true,
  511. bool skipDeleted = true);
  512. Acad::ErrorStatus seek (AcDbObjectId id);
  513. Acad::ErrorStatus seek (const AcDbEntity* pEntity);
  514. protected:
  515. class AcDbImpBlockTableRecordIterator* mpImp;
  516. private:
  517. AcDbBlockTableRecordIterator();
  518. friend class AcDbImpBlockTableRecord;
  519. };
  520. // This class will be removed in the next release. Instead, use
  521. // AcDbBlockTableRecord::getBlockReferenceIds().
  522. //
  523. class AcDbBlockReferenceIdIterator
  524. {
  525. public:
  526. ~AcDbBlockReferenceIdIterator();
  527. void start () { mPos = 0; }
  528. bool done () const { return mPos >= mAry.length(); }
  529. Acad::ErrorStatus getBlockReferenceId (AcDbObjectId& id) const;
  530. Acad::ErrorStatus getDatabase (AcDbDatabase*& pDb) const;
  531. Acad::ErrorStatus getBlockReference(AcDbBlockReference*& pBlkRef,
  532. AcDb::OpenMode openMode, bool openErasedEntity = false) const;
  533. void step () { mPos++; }
  534. Acad::ErrorStatus seek (AcDbObjectId id);
  535. private:
  536. AcDbBlockReferenceIdIterator();
  537. friend class AcDbBlockTableRecord;
  538. int mPos;
  539. AcDbObjectIdArray mAry;
  540. };
  541. class AcDbBlockTableRecord: public AcDbSymbolTableRecord
  542. {
  543. public:
  544. ACDB_DECLARE_MEMBERS(AcDbBlockTableRecord);
  545. AcDbBlockTableRecord();
  546. virtual ~AcDbBlockTableRecord();
  547. typedef AcDbBlockTable TableType;
  548. typedef AcArray<Adesk::UInt8> PreviewIcon;
  549. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;
  550. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;
  551. Acad::ErrorStatus appendAcDbEntity(AcDbEntity* pEntity);
  552. Acad::ErrorStatus appendAcDbEntity(AcDbObjectId& pOutputId,
  553. AcDbEntity* pEntity);
  554. Acad::ErrorStatus newIterator(
  555. AcDbBlockTableRecordIterator*& pIterator,
  556. bool atBeginning = true,
  557. bool skipDeleted = true) const;
  558. Acad::ErrorStatus comments(ACHAR*& pString) const;
  559. Acad::ErrorStatus comments(const ACHAR*& pString) const;
  560. Acad::ErrorStatus setComments(const ACHAR* pString);
  561. Acad::ErrorStatus pathName(ACHAR*& pPath) const;
  562. Acad::ErrorStatus pathName(const ACHAR*& pPath) const;
  563. Acad::ErrorStatus setPathName(const ACHAR* pathStr);
  564. AcGePoint3d origin() const;
  565. Acad::ErrorStatus setOrigin(const AcGePoint3d& pt);
  566. Acad::ErrorStatus openBlockBegin(AcDbBlockBegin*& pBlockBegin,
  567. AcDb::OpenMode openMode);
  568. Acad::ErrorStatus openBlockEnd(AcDbBlockEnd*& pBlockEnd,
  569. AcDb::OpenMode openMode);
  570. bool hasAttributeDefinitions() const;
  571. bool hasPreviewIcon() const;
  572. Acad::ErrorStatus getPreviewIcon(PreviewIcon &previewIcon) const;
  573. Acad::ErrorStatus setPreviewIcon(const PreviewIcon &previewIcon);
  574. bool isAnonymous() const;
  575. bool isFromExternalReference() const;
  576. bool isFromOverlayReference() const;
  577. Acad::ErrorStatus setIsFromOverlayReference(bool bIsOverlay);
  578. bool isLayout() const;
  579. AcDbObjectId getLayoutId() const;
  580. Acad::ErrorStatus setLayoutId(AcDbObjectId);
  581. Acad::ErrorStatus newBlockReferenceIdIterator(
  582. AcDbBlockReferenceIdIterator*& pIter) const;
  583. // AcDbBlockReferenceIdIterator will be going away.
  584. // Use getBlockReferenceIds() instead.
  585. //
  586. Acad::ErrorStatus getBlockReferenceIds(AcDbObjectIdArray& ids,
  587. bool bDirectOnly = true,
  588. bool bForceValidity = false) const;
  589. Acad::ErrorStatus getErasedBlockReferenceIds(AcDbObjectIdArray&);
  590. // getSortentsTable
  591. //
  592. // Returns the sortents table opened as requested, sparing the caller
  593. // the work of getting the extension dictionary and looking the sortents
  594. // table up in it.
  595. // If the dictionary is successfully opened and returned, it is the
  596. // caller's responsibility to close it.
  597. //
  598. // ErrorStatus returns errors if the sortents dictionary cannot be opened,
  599. // doesn't exist, and createIfNecessary
  600. // is false, or if createIfNecessary is true, but
  601. // the BTR is not open for write, or if its
  602. // extension dictionary could not be created or
  603. // opened.
  604. //
  605. Acad::ErrorStatus
  606. getSortentsTable(AcDbSortentsTable*& pSortents,
  607. AcDb::OpenMode openMode,
  608. bool createIfNecessary=false);
  609. AcDbDatabase* xrefDatabase(bool incUnres = false) const;
  610. bool isUnloaded() const;
  611. Acad::ErrorStatus setIsUnloaded(bool isUnloaded);
  612. AcDb::XrefStatus xrefStatus() const;
  613. // Drawable API
  614. //
  615. AcGiDrawable* drawable();
  616. virtual Acad::ErrorStatus decomposeForSave(AcDb::AcDbDwgVersion ver,
  617. AcDbObject*& replaceObj,
  618. AcDbObjectId& replaceId,
  619. Adesk::Boolean& exchangeXData);
  620. virtual Acad::ErrorStatus assumeOwnershipOf(AcArray <AcDbObjectId> entitiesToMove);
  621. // Block scaling and exploding control
  622. enum BlockScaling {
  623. kAny,
  624. kUniform
  625. };
  626. AcDbBlockTableRecord::BlockScaling blockScaling () const;
  627. Acad::ErrorStatus setBlockScaling (
  628. AcDbBlockTableRecord::BlockScaling blockScaling);
  629. Acad::ErrorStatus setExplodable (bool bExplodable);
  630. bool explodable () const;
  631. Acad::ErrorStatus setBlockInsertUnits(AcDb::UnitsValue insunits);
  632. AcDb::UnitsValue blockInsertUnits() const;
  633. Acad::ErrorStatus postProcessAnnotativeBTR(int& stripCnt, const bool bqueryOnly = false,
  634. const bool bScale = true);
  635. Acad::ErrorStatus addAnnoScalestoBlkRefs(const bool bScale = false);
  636. protected:
  637. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  638. };
  639. class AcDbLayerTableRecord: public AcDbSymbolTableRecord
  640. {
  641. public:
  642. ACDB_DECLARE_MEMBERS(AcDbLayerTableRecord);
  643. AcDbLayerTableRecord();
  644. virtual ~AcDbLayerTableRecord();
  645. typedef AcDbLayerTable TableType;
  646. bool isFrozen() const;
  647. Acad::ErrorStatus setIsFrozen(bool frozen);
  648. bool isOff() const;
  649. void setIsOff(bool off);
  650. bool VPDFLT() const;
  651. void setVPDFLT(bool frozen);
  652. bool isLocked() const;
  653. void setIsLocked(bool locked);
  654. AcCmColor color() const;
  655. void setColor(const AcCmColor &color);
  656. AcCmEntityColor entityColor(void) const;
  657. AcCmTransparency transparency(void) const;
  658. Acad::ErrorStatus setTransparency(const AcCmTransparency& trans);
  659. AcDbObjectId linetypeObjectId() const;
  660. void setLinetypeObjectId(AcDbObjectId id);
  661. AcDbObjectId materialId() const;
  662. Acad::ErrorStatus setMaterialId(AcDbObjectId id);
  663. enum { kDxfLayerPlotBit = AcDb::kDxfBool };
  664. bool isPlottable() const;
  665. Acad::ErrorStatus setIsPlottable(bool plot);
  666. AcDb::LineWeight lineWeight() const;
  667. Acad::ErrorStatus setLineWeight(AcDb::LineWeight weight);
  668. ACHAR* plotStyleName() const;
  669. AcDbObjectId plotStyleNameId() const;
  670. Acad::ErrorStatus setPlotStyleName(const ACHAR* newName);
  671. Acad::ErrorStatus setPlotStyleName(const AcDbObjectId& newId);
  672. // Drawable API
  673. //
  674. AcGiDrawable* drawable();
  675. bool isInUse() const;
  676. ACHAR* description() const;
  677. Acad::ErrorStatus setDescription(const ACHAR* description);
  678. bool isHidden() const;
  679. Acad::ErrorStatus setIsHidden(bool on);
  680. static bool isHidden(AcDbObjectId);
  681. // Property override API
  682. //
  683. AcCmColor color(const AcDbObjectId& viewportId, bool& isOverride) const;
  684. Acad::ErrorStatus setColor(const AcCmColor& color,
  685. const AcDbObjectId& viewportId);
  686. AcDbObjectId linetypeObjectId(const AcDbObjectId& viewportId, bool& isOverride) const;
  687. Acad::ErrorStatus setLinetypeObjectId(const AcDbObjectId& id,
  688. const AcDbObjectId& viewportId);
  689. AcDb::LineWeight lineWeight(const AcDbObjectId& viewportId, bool& isOverride) const;
  690. Acad::ErrorStatus setLineWeight(AcDb::LineWeight weight,
  691. const AcDbObjectId& viewportId);
  692. ACHAR* plotStyleName(const AcDbObjectId& viewportId, bool& isOverride) const;
  693. AcDbObjectId plotStyleNameId(const AcDbObjectId& viewportId, bool& isOverride) const;
  694. Acad::ErrorStatus setPlotStyleName(const ACHAR* newName,
  695. const AcDbObjectId& viewportId);
  696. Acad::ErrorStatus setPlotStyleName(const AcDbObjectId& newId,
  697. const AcDbObjectId& viewportId);
  698. AcCmTransparency transparency(const AcDbObjectId& viewportId, bool& isOvr) const;
  699. Acad::ErrorStatus setTransparency(const AcCmTransparency& trans,
  700. const AcDbObjectId& viewportId);
  701. Acad::ErrorStatus removeColorOverride(const AcDbObjectId& viewportId);
  702. Acad::ErrorStatus removeLinetypeOverride(const AcDbObjectId& viewportId);
  703. Acad::ErrorStatus removeLineWeightOverride(const AcDbObjectId& viewportId);
  704. Acad::ErrorStatus removePlotStyleOverride(const AcDbObjectId& viewportId);
  705. Acad::ErrorStatus removeTransparencyOverride(const AcDbObjectId& viewportId);
  706. Acad::ErrorStatus removeViewportOverrides(const AcDbObjectId& viewportId);
  707. Acad::ErrorStatus removeAllOverrides();
  708. bool hasOverrides(const AcDbObjectId& viewportId) const;
  709. bool hasAnyOverrides() const;
  710. bool isReconciled() const;
  711. Acad::ErrorStatus setIsReconciled(bool bReconcile = true);
  712. static bool isReconciled(const AcDbObjectId& id);
  713. protected:
  714. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  715. };
  716. // Utility for changing Layer Table Records in the Current Drawing
  717. Acad::ErrorStatus applyCurDwgLayerTableChanges();
  718. // AcDbTextStyleTableRecord:
  719. class AcDbTextStyleTableRecord: public AcDbSymbolTableRecord
  720. {
  721. public:
  722. ACDB_DECLARE_MEMBERS(AcDbTextStyleTableRecord);
  723. AcDbTextStyleTableRecord();
  724. virtual ~AcDbTextStyleTableRecord();
  725. typedef AcDbTextStyleTable TableType;
  726. Adesk::Boolean isShapeFile() const;
  727. void setIsShapeFile(Adesk::Boolean shape);
  728. Adesk::Boolean isVertical() const;
  729. void setIsVertical(Adesk::Boolean vertical);
  730. double textSize() const;
  731. Acad::ErrorStatus setTextSize(double size);
  732. double xScale() const;
  733. Acad::ErrorStatus setXScale(double xScale);
  734. double obliquingAngle() const;
  735. Acad::ErrorStatus setObliquingAngle(double obliquingAngle);
  736. Adesk::UInt8 flagBits() const;
  737. void setFlagBits(Adesk::UInt8 flagBits);
  738. double priorSize() const;
  739. Acad::ErrorStatus setPriorSize(double priorSize);
  740. Acad::ErrorStatus fileName(ACHAR*& fileName) const;
  741. Acad::ErrorStatus fileName(const ACHAR*& fileName) const;
  742. Acad::ErrorStatus setFileName(const ACHAR* fileName);
  743. Acad::ErrorStatus bigFontFileName(ACHAR*& fileName) const;
  744. Acad::ErrorStatus bigFontFileName(const ACHAR*& fileName) const;
  745. Acad::ErrorStatus setBigFontFileName(const ACHAR* fileName);
  746. Acad::ErrorStatus setFont(const ACHAR* pTypeface, Adesk::Boolean bold,
  747. Adesk::Boolean italic, int charset, int pitchAndFamily);
  748. Acad::ErrorStatus font (ACHAR*& pTypeface, Adesk::Boolean& bold, Adesk::Boolean& italic,
  749. int& charset, int& pitchAndFamily) const;
  750. protected:
  751. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  752. };
  753. class AcDbLinetypeTableRecord: public AcDbSymbolTableRecord
  754. {
  755. public:
  756. ACDB_DECLARE_MEMBERS(AcDbLinetypeTableRecord);
  757. AcDbLinetypeTableRecord();
  758. virtual ~AcDbLinetypeTableRecord();
  759. typedef AcDbLinetypeTable TableType;
  760. Acad::ErrorStatus comments(ACHAR*& pString) const;
  761. Acad::ErrorStatus comments(const ACHAR*& pString) const;
  762. Acad::ErrorStatus setComments(const ACHAR* pString);
  763. Acad::ErrorStatus asciiDescription(ACHAR*& pString) const
  764. { return comments(pString); }
  765. Acad::ErrorStatus asciiDescription(const ACHAR*& pString) const
  766. { return comments(pString); }
  767. Acad::ErrorStatus setAsciiDescription(const ACHAR* pString)
  768. { return setComments(pString); }
  769. double patternLength() const;
  770. void setPatternLength(double patternLength);
  771. int numDashes() const;
  772. void setNumDashes(int count);
  773. double dashLengthAt(int index) const;
  774. void setDashLengthAt(int index , double value);
  775. AcDbObjectId shapeStyleAt(int index) const;
  776. void setShapeStyleAt(int index, AcDbObjectId id);
  777. int shapeNumberAt(int index) const;
  778. void setShapeNumberAt(int index, int shapeNumber);
  779. AcGeVector2d shapeOffsetAt(int index) const;
  780. void setShapeOffsetAt(int index, const AcGeVector2d& offset);
  781. double shapeScaleAt(int index) const;
  782. void setShapeScaleAt(int index, double scale);
  783. bool isScaledToFit() const;
  784. void setIsScaledToFit(bool scaledToFit);
  785. bool shapeIsUcsOrientedAt(int index) const;
  786. void setShapeIsUcsOrientedAt(int index, bool isUcsOriented);
  787. bool shapeIsUprightAt(int index) const;
  788. void setShapeIsUprightAt(int index, bool isUpright);
  789. double shapeRotationAt(int index) const;
  790. void setShapeRotationAt(int index, double rotation);
  791. Acad::ErrorStatus textAt(int index, ACHAR*& text) const;
  792. Acad::ErrorStatus textAt(int index, const ACHAR*& text) const;
  793. Acad::ErrorStatus setTextAt(int index, const ACHAR* text);
  794. // Drawable API
  795. //
  796. AcGiDrawable* drawable();
  797. protected:
  798. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  799. };
  800. class ADESK_NO_VTABLE AcDbAbstractViewTableRecord: public AcDbSymbolTableRecord
  801. {
  802. public:
  803. ACDB_DECLARE_MEMBERS(AcDbAbstractViewTableRecord);
  804. AcDbAbstractViewTableRecord();
  805. virtual ~AcDbAbstractViewTableRecord();
  806. AcGePoint2d centerPoint() const;
  807. void setCenterPoint(const AcGePoint2d&);
  808. double height() const;
  809. void setHeight(double height);
  810. double width() const;
  811. void setWidth(double width);
  812. AcGePoint3d target() const;
  813. void setTarget(const AcGePoint3d& target);
  814. AcGeVector3d viewDirection() const;
  815. void setViewDirection(const AcGeVector3d& viewDirection);
  816. double viewTwist() const;
  817. void setViewTwist(double angle);
  818. double lensLength() const;
  819. void setLensLength(double length);
  820. double frontClipDistance() const;
  821. void setFrontClipDistance(double distance);
  822. double backClipDistance() const;
  823. void setBackClipDistance(double distance);
  824. bool perspectiveEnabled() const;
  825. void setPerspectiveEnabled(bool enabled);
  826. bool frontClipEnabled() const;
  827. void setFrontClipEnabled(bool enabled);
  828. bool backClipEnabled() const;
  829. void setBackClipEnabled(bool enabled);
  830. bool frontClipAtEye() const;
  831. void setFrontClipAtEye(bool atEye);
  832. // Background
  833. const AcDbObjectId& background() const;
  834. AcDbObjectId& background();
  835. Acad::ErrorStatus setBackground(const AcDbObjectId& backgroundId);
  836. // VisualStyle
  837. AcDbObjectId visualStyle() const;
  838. Acad::ErrorStatus setVisualStyle(const AcDbObjectId& visualStyleId);
  839. // Viewport Lighting
  840. //
  841. bool isDefaultLightingOn() const;
  842. Acad::ErrorStatus setDefaultLightingOn(bool on);
  843. AcGiViewportTraits::DefaultLightingType defaultLightingType() const;
  844. Acad::ErrorStatus setDefaultLightingType(AcGiViewportTraits::DefaultLightingType typ);
  845. // Brightness controls the relative intensity of lights.
  846. double brightness() const;
  847. Acad::ErrorStatus setBrightness(double);
  848. // Contrast controls intensity of ambient light, relative to other lights.
  849. double contrast() const;
  850. Acad::ErrorStatus setContrast(double);
  851. AcCmColor ambientLightColor() const;
  852. Acad::ErrorStatus setAmbientLightColor(const AcCmColor& clr);
  853. // A single sun (distant light) can be associated with each viewport.
  854. AcDbObjectId sunId() const;
  855. Acad::ErrorStatus setSun(AcDbObjectId &retId, AcDbObject *pSun);
  856. Acad::ErrorStatus setSun(AcDbObjectId &retId, AcDbObject *pSun, bool eraseOldSun);
  857. // Tone operator parameters
  858. Acad::ErrorStatus toneOperatorParameters(AcGiToneOperatorParameters& params) const;
  859. Acad::ErrorStatus setToneOperatorParameters(const AcGiToneOperatorParameters& params);
  860. // UCS query methods.
  861. //
  862. Acad::ErrorStatus getUcs ( AcGePoint3d& origin,
  863. AcGeVector3d& xAxis,
  864. AcGeVector3d& yAxis ) const;
  865. bool isUcsOrthographic ( AcDb::OrthographicView& view ) const;
  866. AcDbObjectId ucsName () const;
  867. double elevation () const;
  868. // UCS set methods.
  869. //
  870. Acad::ErrorStatus setUcs ( const AcGePoint3d& origin,
  871. const AcGeVector3d& xAxis,
  872. const AcGeVector3d& yAxis );
  873. Acad::ErrorStatus setUcs ( AcDb::OrthographicView view );
  874. Acad::ErrorStatus setUcs ( const AcDbObjectId& ucsId );
  875. Acad::ErrorStatus setUcsToWorld ();
  876. Acad::ErrorStatus setElevation ( double elev );
  877. // Orthographic view methods.
  878. //
  879. bool isViewOrthographic ( AcDb::OrthographicView& view ) const;
  880. Acad::ErrorStatus setViewDirection ( AcDb::OrthographicView view );
  881. };
  882. class AcDbViewTableRecord: public AcDbAbstractViewTableRecord
  883. {
  884. public:
  885. ACDB_DECLARE_MEMBERS(AcDbViewTableRecord);
  886. AcDbViewTableRecord();
  887. virtual ~AcDbViewTableRecord();
  888. typedef AcDbViewTable TableType;
  889. Acad::ErrorStatus setParametersFromViewport(AcDbObjectId objId);
  890. bool isPaperspaceView() const;
  891. void setIsPaperspaceView(bool pspace);
  892. bool isUcsAssociatedToView () const;
  893. Acad::ErrorStatus disassociateUcsFromView ();
  894. Acad::ErrorStatus getCategoryName(ACHAR *& categoryName) const;
  895. Acad::ErrorStatus setCategoryName(const ACHAR * categoryName);
  896. Acad::ErrorStatus getLayerState(ACHAR*& layerStateName) const;
  897. Acad::ErrorStatus setLayerState(const ACHAR *layerStateName);
  898. Acad::ErrorStatus getLayout (AcDbObjectId& layoutId) const;
  899. Acad::ErrorStatus setLayout(AcDbObjectId layoutId);
  900. bool isViewAssociatedToViewport () const;
  901. Acad::ErrorStatus setViewAssociatedToViewport (bool bVPflag);
  902. bool isCameraPlottable () const;
  903. Acad::ErrorStatus setIsCameraPlottable (bool plottable);
  904. // Live Section
  905. AcDbObjectId liveSection() const;
  906. Acad::ErrorStatus setLiveSection(const AcDbObjectId& liveSectionId);
  907. #if defined(_WINDOWS_) || defined(_ADESK_MAC_)
  908. /// <summary>
  909. /// This function provides BITMAP thumbnail of view as output
  910. /// </summary>
  911. /// <param name="thumbnail"> A reference to a pointer of Bitmap thumbnail, containing header and pixels </param>
  912. /// <returns> This will return Acad::eOk if thumbnail is successfully retrieved. It returns error status otherwise </returns>
  913. ///
  914. Acad::ErrorStatus getThumbnail (BITMAPINFO*& thumbnail) const;
  915. /// <summary>
  916. /// This function sets BITMAP thumbnail into view
  917. /// </summary>
  918. /// <param name="thumbnail"> A pointer of Bitmap thumbnail to be set into view </param>
  919. /// <returns> This will return Acad::eOk if thumbnail is successfully set. It returns error status otherwise </returns>
  920. ///
  921. Acad::ErrorStatus setThumbnail(const BITMAPINFO * thumbnail);
  922. /// <summary>
  923. /// This function provides Atil::Image thumbnail of view as output
  924. /// </summary>
  925. /// <param name="pPreviewImage"> A reference to the pointer of Atil::Image thumbnail </param>
  926. /// <returns> This will return Acad::eOk if thumbnail is successfully retrieved. It returns error status otherwise </returns>
  927. /// <remarks> Internal use only </remarks>
  928. ///
  929. Acad::ErrorStatus getPreviewImage(Atil::Image*& pPreviewImage) const;
  930. /// <summary>
  931. /// This functions sets Atil::Image thumbnail into view
  932. /// </summary>
  933. /// <param name="pPreviewImage"> A pointer of Atil::Image thumbnail to be set into view </param>
  934. /// <returns> This will return Acad::eOk if thumbnail is successfully set. It returns error status otherwise </returns>
  935. /// <remarks> Internal use only </remarks>
  936. ///
  937. Acad::ErrorStatus setPreviewImage (const Atil::Image * pPreviewImage);
  938. #endif // _WINDOWS_ || _ADESK_MAC_
  939. // Camera methods
  940. AcDbObjectId camera () const;
  941. Acad::ErrorStatus setCamera(AcDbObjectId cameraId);
  942. // Annotation scaling methods
  943. // Caller of this method will have to delete the AcDbAnnotationScale object
  944. // that is returned
  945. AcDbAnnotationScale* annotationScale() const;
  946. Acad::ErrorStatus setAnnotationScale(const AcDbAnnotationScale* pScaleObj);
  947. // A single sun (distant light) can be associated with each view.
  948. AcDbObjectId sunId() const;
  949. Acad::ErrorStatus setSun(AcDbObjectId &retId, AcDbObject *pSun);
  950. Acad::ErrorStatus setSun(AcDbObjectId &retId, AcDbObject *pSun, bool eraseOldSun);
  951. protected:
  952. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  953. };
  954. class AcDbUCSTableRecord: public AcDbSymbolTableRecord
  955. {
  956. public:
  957. ACDB_DECLARE_MEMBERS(AcDbUCSTableRecord);
  958. AcDbUCSTableRecord();
  959. virtual ~AcDbUCSTableRecord();
  960. typedef AcDbUCSTable TableType;
  961. AcGePoint3d origin() const;
  962. void setOrigin(const AcGePoint3d& newOrigin);
  963. AcGeVector3d xAxis() const;
  964. void setXAxis(const AcGeVector3d& xAxis);
  965. AcGeVector3d yAxis() const;
  966. void setYAxis(const AcGeVector3d& yAxis);
  967. AcGePoint3d ucsBaseOrigin ( AcDb::OrthographicView view ) const;
  968. Acad::ErrorStatus setUcsBaseOrigin ( const AcGePoint3d& origin,
  969. AcDb::OrthographicView view );
  970. protected:
  971. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  972. };
  973. class AcDbViewportTableRecord: public AcDbAbstractViewTableRecord
  974. {
  975. public:
  976. ACDB_DECLARE_MEMBERS(AcDbViewportTableRecord);
  977. AcDbViewportTableRecord();
  978. virtual ~AcDbViewportTableRecord();
  979. typedef AcDbViewportTable TableType;
  980. Adesk::Int16 number() const;
  981. AcGePoint2d lowerLeftCorner() const;
  982. void setLowerLeftCorner(const AcGePoint2d& pt);
  983. AcGePoint2d upperRightCorner() const;
  984. void setUpperRightCorner(const AcGePoint2d& pt);
  985. bool ucsFollowMode() const;
  986. void setUcsFollowMode(bool enabled);
  987. Adesk::UInt16 circleSides() const;
  988. void setCircleSides(Adesk::UInt16 circleSides);
  989. bool fastZoomsEnabled() const { return true; }
  990. void setFastZoomsEnabled(bool enabled)
  991. {
  992. enabled; // avoid unreferenced parameter warning
  993. }
  994. bool iconEnabled() const;
  995. void setIconEnabled(bool enabled);
  996. bool iconAtOrigin() const;
  997. void setIconAtOrigin(bool atOrigin);
  998. bool gridEnabled() const;
  999. void setGridEnabled(bool enabled);
  1000. AcGePoint2d gridIncrements() const;
  1001. void setGridIncrements(const AcGePoint2d& base);
  1002. bool snapEnabled() const;
  1003. void setSnapEnabled(bool enabled);
  1004. bool isometricSnapEnabled() const;
  1005. void setIsometricSnapEnabled(bool enabled);
  1006. Adesk::Int16 snapPair() const;
  1007. void setSnapPair(Adesk::Int16 pairType);
  1008. double snapAngle() const;
  1009. void setSnapAngle(double angle);
  1010. AcGePoint2d snapBase() const;
  1011. void setSnapBase(const AcGePoint2d& base);
  1012. AcGePoint2d snapIncrements() const;
  1013. void setSnapIncrements(const AcGePoint2d& base);
  1014. void setGsView(AcGsView* pView);
  1015. AcGsView* gsView() const;
  1016. bool isUcsSavedWithViewport () const;
  1017. void setUcsPerViewport ( bool ucsvp );
  1018. // GridDisplay
  1019. bool isGridBoundToLimits() const;
  1020. void setGridBoundToLimits(bool enabled);
  1021. bool isGridAdaptive() const;
  1022. void setGridAdaptive(bool enabled);
  1023. bool isGridSubdivisionRestricted() const;
  1024. void setGridSubdivisionRestricted(bool enabled);
  1025. bool isGridFollow() const;
  1026. void setGridFollow(bool enabled);
  1027. Adesk::Int16 gridMajor() const;
  1028. void setGridMajor(Adesk::Int16 value);
  1029. // Background
  1030. Acad::ErrorStatus setBackground(const AcDbObjectId& backgroundId);
  1031. AcDbObjectId previousBackground(AcGiDrawable::DrawableType type
  1032. = AcGiDrawable::kGeometry) const;
  1033. Acad::ErrorStatus setPreviousBackground(AcDbObjectId backgroundId,
  1034. AcGiDrawable::DrawableType type
  1035. = AcGiDrawable::kGeometry);
  1036. Acad::ErrorStatus setPreviousBackground(AcDbObjectId backgroundId,
  1037. AcGiDrawable::DrawableType type,
  1038. bool bForcedSwitch);
  1039. bool previousBackgroundForcedSwitch (void) const;
  1040. // Drawable API
  1041. //
  1042. AcGiDrawable* drawable();
  1043. protected:
  1044. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  1045. };
  1046. class AcDbRegAppTableRecord: public AcDbSymbolTableRecord
  1047. {
  1048. public:
  1049. ACDB_DECLARE_MEMBERS(AcDbRegAppTableRecord);
  1050. AcDbRegAppTableRecord();
  1051. virtual ~AcDbRegAppTableRecord();
  1052. typedef AcDbRegAppTable TableType;
  1053. protected:
  1054. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  1055. };
  1056. class AcDbDimStyleTableRecord: public AcDbSymbolTableRecord
  1057. {
  1058. public:
  1059. ACDB_DECLARE_MEMBERS(AcDbDimStyleTableRecord);
  1060. AcDbDimStyleTableRecord();
  1061. virtual ~AcDbDimStyleTableRecord();
  1062. typedef AcDbDimStyleTable TableType;
  1063. // Dimension variable api:
  1064. //
  1065. #undef DBDIMVAR_H // force the file to get read again
  1066. #include "dbdimvar.h"
  1067. AcDbObjectId arrowId(AcDb::DimArrowFlags whichArrow) const;
  1068. // DEPRECATED METHODS!
  1069. // These are supported but will be removed in future releases:
  1070. //
  1071. Acad::ErrorStatus getDimpost(ACHAR*& pOutput) const;
  1072. Acad::ErrorStatus getDimapost(ACHAR*& pOutput) const;
  1073. Acad::ErrorStatus getDimblk(ACHAR*& pOutput) const;
  1074. Acad::ErrorStatus getDimblk1(ACHAR*& pOutput) const;
  1075. Acad::ErrorStatus getDimblk2(ACHAR*& pOutput) const;
  1076. int dimfit() const;
  1077. int dimunit() const;
  1078. Acad::ErrorStatus setDimfit(int fit);
  1079. Acad::ErrorStatus setDimunit(int unit);
  1080. //
  1081. // end DEPRECATED METHODS!
  1082. bool isModifiedForRecompute() const;
  1083. protected:
  1084. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  1085. };
  1086. #pragma pack(pop)
  1087. #endif