dbDetailViewStyle.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. //
  2. //
  3. //////////////////////////////////////////////////////////////////////////////
  4. //
  5. // Copyright 2015 Autodesk, Inc. All rights reserved.
  6. //
  7. // Use of this software is subject to the terms of the Autodesk license
  8. // agreement provided at the time of installation or download, or which
  9. // otherwise accompanies this software in either electronic or hard copy form.
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12. //
  13. #ifndef __ACDBDETAILVIEWSTYLE_H__
  14. #define __ACDBDETAILVIEWSTYLE_H__
  15. #pragma once
  16. #include "dbModelDocViewStyle.h"
  17. class ACDB_PORT AcDbDetailViewStyle : public AcDbModelDocViewStyle
  18. {
  19. public:
  20. /// <summary>
  21. /// Enumeration defining label and identifier placement
  22. /// </summary>
  23. enum IdentifierPlacement {
  24. kOutsideBoundary=0,
  25. kOutsideBoundaryWithLeader,
  26. kOnBoundary,
  27. kOnBoundaryWithLeader,
  28. };
  29. enum ModelEdge {
  30. kSmooth = 0,
  31. kSmoothWithBorder,
  32. kSmoothWithConnectionLine,
  33. kJagged,
  34. };
  35. AcDbDetailViewStyle();
  36. ~AcDbDetailViewStyle();
  37. ACDB_DECLARE_MEMBERS(AcDbDetailViewStyle);
  38. /// <summary>
  39. /// Returns the text style objectId of the identifier.
  40. /// </summary>
  41. ///
  42. /// <returns>
  43. /// Returns the text style objectId of the identifier.
  44. /// </returns>
  45. AcDbObjectId identifierStyleId () const;
  46. /// <summary>
  47. /// Sets the identifier to use specified text style.
  48. /// </summary>
  49. ///
  50. /// <param name="objId">
  51. /// ObjectId of text style to use for the identifier.
  52. /// </param>
  53. ///
  54. /// <returns>
  55. /// Return Acad::eOk if Successful
  56. /// </returns>
  57. Acad::ErrorStatus setIdentifierStyleId (const AcDbObjectId &objId);
  58. /// <summary>
  59. /// Returns the color of the identifier.
  60. /// </summary>
  61. ///
  62. /// <returns>
  63. /// Returns the color of the identifier.
  64. /// </returns>
  65. AcCmColor identifierColor () const;
  66. /// <summary>
  67. /// Sets the identifier to use specified color.
  68. /// </summary>
  69. ///
  70. /// <param name="color">
  71. /// Color to use for the identifier.
  72. /// </param>
  73. ///
  74. /// <returns>
  75. /// Return Acad::eOk if Successful
  76. /// </returns>
  77. Acad::ErrorStatus setIdentifierColor (const AcCmColor& color);
  78. /// <summary>
  79. /// Returns the height of the identifier.
  80. /// </summary>
  81. ///
  82. /// <returns>
  83. /// Returns the height of the identifier.
  84. /// </returns>
  85. double identifierHeight () const;
  86. /// <summary>
  87. /// Sets the text height the identifier.
  88. /// </summary>
  89. ///
  90. /// <param name="height">
  91. /// Text height to use for the identifier.
  92. /// </param>
  93. ///
  94. /// <returns>
  95. /// Return Acad::eOk if Successful
  96. /// </returns>
  97. Acad::ErrorStatus setIdentifierHeight (double height);
  98. /// <summary>
  99. /// Returns the offset between arrow line and extension line.
  100. /// The value is relative in range &lt0, 1&gt, where 0 means that
  101. /// arrow touches extension line at beginning and 1.0 means
  102. /// means that arrow touches the extension line at the end.
  103. /// </summary>
  104. ///
  105. /// <returns>
  106. /// Returns the offset between arrow line and extension line in
  107. /// relative form.
  108. /// </returns>
  109. double identifierOffset () const;
  110. /// <summary>
  111. /// Sets the offset between arrow line and extension line.
  112. /// The value is relative in range &lt0, 1&gt, where 0 means that
  113. /// arrow touches extension line at beginning and 1.0 means
  114. /// means that arrow touches the extension line at the end.
  115. /// </summary>
  116. ///
  117. /// <returns>
  118. /// Sets the offset between arrow line and extension line in relative
  119. /// form.
  120. /// </returns>
  121. Acad::ErrorStatus setIdentifierOffset (double offset);
  122. /// <summary>
  123. /// Returns the label and identifier placement flags.
  124. /// </summary>
  125. ///
  126. /// <returns>
  127. /// Returns the bit coded flags defining label and identifier placement.
  128. /// </returns>
  129. AcDbDetailViewStyle::IdentifierPlacement identifierPlacement () const;
  130. /// <summary>
  131. /// Sets the label and identifier placement flags.
  132. /// Use bit coded flags defined by identifierPlacement enumeration.
  133. /// </summary>
  134. ///
  135. /// <param name="placement">
  136. /// Bit coded flags defining label and identifier placement.
  137. /// </param>
  138. ///
  139. /// <returns>
  140. /// Return Acad::eOk if Successful
  141. /// </returns>
  142. Acad::ErrorStatus setIdentifierPlacement (AcDbDetailViewStyle::IdentifierPlacement placement);
  143. /// <summary>
  144. /// Returns the objectId of arrow start symbol.
  145. /// </summary>
  146. ///
  147. /// <returns>
  148. /// Returns the objectId of arrow start symbol.
  149. /// </returns>
  150. AcDbObjectId arrowSymbolId () const;
  151. /// <summary>
  152. /// Sets the arrow start symbol to use specified block table record.
  153. /// </summary>
  154. ///
  155. /// <param name="objId">
  156. /// ObjectId of block table record to use for arrow start symbol
  157. /// </param>
  158. ///
  159. /// <returns>
  160. /// Return Acad::eOk if Successful
  161. /// </returns>
  162. Acad::ErrorStatus setArrowSymbolId (const AcDbObjectId &arrowSymbolId);
  163. /// <summary>
  164. /// Returns the color of arrow symbol.
  165. /// </summary>
  166. ///
  167. /// <returns>
  168. /// Returns the color of arrow symbol.
  169. /// </returns>
  170. AcCmColor arrowSymbolColor () const;
  171. /// <summary>
  172. /// Sets the arrow symbol to use specified color.
  173. /// </summary>
  174. ///
  175. /// <param name="color">
  176. /// Color to use for arrow symbol
  177. /// </param>
  178. ///
  179. /// <returns>
  180. /// Return Acad::eOk if Successful
  181. /// </returns>
  182. Acad::ErrorStatus setArrowSymbolColor (const AcCmColor& color);
  183. /// <summary>
  184. /// Returns the size of arrow symbol.
  185. /// </summary>
  186. ///
  187. /// <returns>
  188. /// Returns the size of arrow symbol.
  189. /// </returns>
  190. double arrowSymbolSize () const;
  191. /// <summary>
  192. /// Sets the size of arrow symbol.
  193. /// </summary>
  194. ///
  195. /// <param name="size">
  196. /// Size of arrow symbol
  197. /// </param>
  198. ///
  199. /// <returns>
  200. /// Return Acad::eOk if Successful
  201. /// </returns>
  202. Acad::ErrorStatus setArrowSymbolSize (double size);
  203. /// <summary>
  204. /// Returns boolean value indicating if to show arrowheads.
  205. /// </summary>
  206. ///
  207. /// <returns>
  208. /// true if to show arrowheads is on, false otherwise.
  209. /// </returns>
  210. bool showArrows () const;
  211. Acad::ErrorStatus setShowArrows (bool bValue);
  212. /// <summary>
  213. /// Returns the line weight of Boundary line.
  214. /// </summary>
  215. ///
  216. /// <returns>
  217. /// Returns the line weight of Boundary line.
  218. /// </returns>
  219. AcDb::LineWeight boundaryLineWeight () const;
  220. /// <summary>
  221. /// Sets the Boundary line to use specified line weight.
  222. /// </summary>
  223. ///
  224. /// <param name="color">
  225. /// Line weight to use.for Boundary.line
  226. /// </param>
  227. ///
  228. /// <returns>
  229. /// Return Acad::eOk if Successful
  230. /// </returns>
  231. Acad::ErrorStatus setBoundaryLineWeight (AcDb::LineWeight lineweight);
  232. /// <summary>
  233. /// Returns the color of Boundary line.
  234. /// </summary>
  235. ///
  236. /// <returns>
  237. /// Returns the color of Boundary line.
  238. /// </returns>
  239. AcCmColor boundaryLineColor () const;
  240. /// <summary>
  241. /// Sets the Boundary line to use specified color.
  242. /// </summary>
  243. ///
  244. /// <param name="color">
  245. /// Color to use for Boundary.line
  246. /// </param>
  247. ///
  248. /// <returns>
  249. /// Return Acad::eOk if Successful
  250. /// </returns>
  251. Acad::ErrorStatus setBoundaryLineColor (const AcCmColor& color);
  252. /// <summary>
  253. /// Returns the linetype objectId of Boundary line.
  254. /// </summary>
  255. ///
  256. /// <returns>
  257. /// Returns the linetype objectId of Boundary line.
  258. /// </returns>
  259. AcDbObjectId boundaryLineTypeId () const;
  260. /// <summary>
  261. /// Sets the Boundary line to use specified linetype.
  262. /// </summary>
  263. ///
  264. /// <param name="objId">
  265. /// ObjectId of the linetype to use.for Boundary.line
  266. /// </param>
  267. ///
  268. /// <returns>
  269. /// Return Acad::eOk if Successful
  270. /// </returns>
  271. Acad::ErrorStatus setBoundaryLineTypeId (const AcDbObjectId &objId);
  272. /// <summary>
  273. /// Returns the line weight of Connection line.
  274. /// </summary>
  275. ///
  276. /// <returns>
  277. /// Returns the line weight of Connection line.
  278. /// </returns>
  279. AcDb::LineWeight connectionLineWeight () const;
  280. /// <summary>
  281. /// Sets the Connection line to use specified line weight.
  282. /// </summary>
  283. ///
  284. /// <param name="color">
  285. /// Line weight to use.for Connection.line
  286. /// </param>
  287. ///
  288. /// <returns>
  289. /// Return Acad::eOk if Successful
  290. /// </returns>
  291. Acad::ErrorStatus setConnectionLineWeight (AcDb::LineWeight lineweight);
  292. /// <summary>
  293. /// Returns the color of Connection line.
  294. /// </summary>
  295. ///
  296. /// <returns>
  297. /// Returns the color of Connection line.
  298. /// </returns>
  299. AcCmColor connectionLineColor () const;
  300. /// <summary>
  301. /// Sets the Connection line to use specified color.
  302. /// </summary>
  303. ///
  304. /// <param name="color">
  305. /// Color to use for Connection.line
  306. /// </param>
  307. ///
  308. /// <returns>
  309. /// Return Acad::eOk if Successful
  310. /// </returns>
  311. Acad::ErrorStatus setConnectionLineColor (const AcCmColor& color);
  312. /// <summary>
  313. /// Returns the linetype objectId of Connection line.
  314. /// </summary>
  315. ///
  316. /// <returns>
  317. /// Returns the linetype objectId of Connection line.
  318. /// </returns>
  319. AcDbObjectId connectionLineTypeId () const;
  320. /// <summary>
  321. /// Sets the Connection line to use specified linetype.
  322. /// </summary>
  323. ///
  324. /// <param name="objId">
  325. /// ObjectId of the linetype to use.for Connection.line
  326. /// </param>
  327. ///
  328. /// <returns>
  329. /// Return Acad::eOk if Successful
  330. /// </returns>
  331. Acad::ErrorStatus setConnectionLineTypeId (const AcDbObjectId &objId);
  332. /// <summary>
  333. /// Returns the text style objectId of view label.
  334. /// </summary>
  335. ///
  336. /// <returns>
  337. /// Returns the text style objectId of view label.
  338. /// </returns>
  339. AcDbObjectId viewLabelTextStyleId () const;
  340. /// <summary>
  341. /// Sets the text style of the view label text.
  342. /// </summary>
  343. ///
  344. /// <param name="objId">
  345. /// length of end and bend line.
  346. /// </param>
  347. ///
  348. /// <returns>
  349. /// Return Acad::eOk if Successful
  350. /// </returns>
  351. Acad::ErrorStatus setViewLabelTextStyleId (const AcDbObjectId &objId);
  352. /// <summary>
  353. /// Returns the color of view label.
  354. /// </summary>
  355. ///
  356. /// <returns>
  357. /// Returns the color of view label.
  358. /// </returns>
  359. AcCmColor viewLabelTextColor () const;
  360. /// <summary>
  361. /// Sets the view label to use specified color.
  362. /// </summary>
  363. ///
  364. /// <param name="color">
  365. /// Color to use for view label
  366. /// </param>
  367. ///
  368. /// <returns>
  369. /// Return Acad::eOk if Successful
  370. /// </returns>
  371. Acad::ErrorStatus setViewLabelTextColor (const AcCmColor& color);
  372. /// <summary>
  373. /// Returns the text height of view label.
  374. /// </summary>
  375. ///
  376. /// <returns>
  377. /// Returns the text height of view label.
  378. /// </returns>
  379. double viewLabelTextHeight () const;
  380. Acad::ErrorStatus setViewLabelTextHeight (double height);
  381. /// <summary>
  382. /// Returns the offset of view label.
  383. /// </summary>
  384. ///
  385. /// <returns>
  386. /// Returns the offset of view label.
  387. /// </returns>
  388. double viewLabelOffset () const;
  389. /// <summary>
  390. /// Sets the offset for view label.
  391. /// </summary>
  392. ///
  393. /// <param name="offset">
  394. /// offset for view label
  395. /// </param>
  396. ///
  397. /// <returns>
  398. /// Return Acad::eOk if Successful
  399. /// </returns>
  400. Acad::ErrorStatus setViewLabelOffset (double offset);
  401. /// <summary>
  402. /// Returns the attachment of view label.
  403. /// </summary>
  404. ///
  405. /// <returns>
  406. /// Returns the attachment of view label.
  407. /// </returns>
  408. AcDbModelDocViewStyle::AttachmentPoint viewLabelAttachment () const;
  409. /// <summary>
  410. /// Sets the attachment for view label.
  411. /// </summary>
  412. ///
  413. /// <param name="attachment">
  414. /// attachment of view label
  415. /// </param>
  416. ///
  417. /// <returns>
  418. /// Return Acad::eOk if Successful
  419. /// </returns>
  420. Acad::ErrorStatus setViewLabelAttachment (AcDbModelDocViewStyle::AttachmentPoint attachment);
  421. /// <summary>
  422. /// Returns the text alignment of view label.
  423. /// </summary>
  424. ///
  425. /// <returns>
  426. /// Returns the text alignment of view label.
  427. /// </returns>
  428. AcDbModelDocViewStyle::TextAlignment viewLabelAlignment () const;
  429. /// <summary>
  430. /// Sets the text alignment for view label.
  431. /// </summary>
  432. ///
  433. /// <param name="attachment">
  434. /// text alignment for view label
  435. /// </param>
  436. ///
  437. /// <returns>
  438. /// Return Acad::eOk if Successful
  439. /// </returns>
  440. Acad::ErrorStatus setViewLabelAlignment (AcDbModelDocViewStyle::TextAlignment alignment);
  441. /// <summary>
  442. /// Returns the pattern of view label.
  443. /// </summary>
  444. ///
  445. /// <returns>
  446. /// Returns the pattern of view label.
  447. /// </returns>
  448. const ACHAR * viewLabelPattern () const;
  449. /// <summary>
  450. /// Gets the pattern for view label. If 'pField' parameter is specified and label
  451. /// pattern is currently using fields, the master field will be copied to 'pField'
  452. /// including child fields.
  453. /// </summary>
  454. ///
  455. /// <param name="pattern">
  456. /// pattern for view label
  457. /// </param>
  458. /// <param name="pField">
  459. /// If this optional parameter is specified and the pattern label is currently
  460. /// using fields, the master field will be copied to 'pField'. Child fields
  461. /// are also copied.
  462. /// </param>
  463. ///
  464. /// <returns>
  465. /// Return Acad::eOk if Successful
  466. /// </returns>
  467. Acad::ErrorStatus getViewLabelPattern (AcString &pattern,
  468. AcDbField *pField = NULL) const;
  469. /// <summary>
  470. /// Sets the pattern for view label. If 'pField' parameter is specified and
  471. /// contains child fields, then label pattern will be acquired from the field.
  472. /// Otherwise 'pattern' is used.
  473. /// </summary>
  474. ///
  475. /// <param name="pattern"> pattern for view label
  476. /// </param>
  477. /// <param name="pField">
  478. /// If 'pField' parameter is specified and contains child fields, then label
  479. /// pattern will be acquired from the field, rather than from 'pattern'.
  480. /// The master field including child fields are also copied to view style's field.
  481. /// </param>
  482. ///
  483. /// <returns>
  484. /// Return Acad::eOk if Successful
  485. /// </returns>
  486. Acad::ErrorStatus setViewLabelPattern (const ACHAR* pattern,
  487. const AcDbField *pField = NULL);
  488. /// <summary>
  489. /// Returns boolean value indicating if to show view label.
  490. /// </summary>
  491. ///
  492. /// <returns>
  493. /// true if to show view label is on, false otherwise.
  494. /// </returns>
  495. bool showViewLabel () const;
  496. Acad::ErrorStatus setShowViewLabel (bool bValue);
  497. /// <summary>
  498. /// Returns the label and model edge flags.
  499. /// </summary>
  500. ///
  501. /// <returns>
  502. /// Returns the bit coded flags defining label and identifier placement.
  503. /// </returns>
  504. AcDbDetailViewStyle::ModelEdge modelEdge () const;
  505. /// <summary>
  506. /// Sets the label and identifier placement flags.
  507. /// Use bit coded flags defined by modelEdge enumeration.
  508. /// </summary>
  509. ///
  510. /// <param name="placement">
  511. /// Bit coded flags defining label and identifier placement.
  512. /// </param>
  513. ///
  514. /// <returns>
  515. /// Return Acad::eOk if Successful
  516. /// </returns>
  517. Acad::ErrorStatus setModelEdge (AcDbDetailViewStyle::ModelEdge placement);
  518. /// <summary>
  519. /// Returns the line weight of Border line.
  520. /// </summary>
  521. ///
  522. /// <returns>
  523. /// Returns the line weight of Border line.
  524. /// </returns>
  525. AcDb::LineWeight borderLineWeight () const;
  526. /// <summary>
  527. /// Sets the Border line to use specified line weight.
  528. /// </summary>
  529. ///
  530. /// <param name="color">
  531. /// Line weight to use.for Border.line
  532. /// </param>
  533. ///
  534. /// <returns>
  535. /// Return Acad::eOk if Successful
  536. /// </returns>
  537. Acad::ErrorStatus setBorderLineWeight (AcDb::LineWeight lineweight);
  538. /// <summary>
  539. /// Returns the color of Border line.
  540. /// </summary>
  541. ///
  542. /// <returns>
  543. /// Returns the color of Border line.
  544. /// </returns>
  545. AcCmColor borderLineColor () const;
  546. /// <summary>
  547. /// Sets the Border line to use specified color.
  548. /// </summary>
  549. ///
  550. /// <param name="color">
  551. /// Color to use for Border.line
  552. /// </param>
  553. ///
  554. /// <returns>
  555. /// Return Acad::eOk if Successful
  556. /// </returns>
  557. Acad::ErrorStatus setBorderLineColor (const AcCmColor& color);
  558. /// <summary>
  559. /// Returns the linetype objectId of Border line.
  560. /// </summary>
  561. ///
  562. /// <returns>
  563. /// Returns the linetype objectId of Border line.
  564. /// </returns>
  565. AcDbObjectId borderLineTypeId () const;
  566. /// <summary>
  567. /// Sets the Border line to use specified linetype.
  568. /// </summary>
  569. ///
  570. /// <param name="objId">
  571. /// ObjectId of the linetype to use.for Border.line
  572. /// </param>
  573. ///
  574. /// <returns>
  575. /// Return Acad::eOk if Successful
  576. /// </returns>
  577. Acad::ErrorStatus setBorderLineTypeId (const AcDbObjectId &objId);
  578. protected:
  579. // For internal use only
  580. virtual Acad::ErrorStatus subDeepClone(AcDbObject* pOwner, AcDbObject*& pClonedObject,
  581. AcDbIdMapping& idMap, Adesk::Boolean isPrimary = true) const;
  582. virtual Acad::ErrorStatus subWblockClone(AcRxObject* pOwner, AcDbObject*& pClonedObject,
  583. AcDbIdMapping& idMap, Adesk::Boolean isPrimary = true) const;
  584. };
  585. #endif //__ACDBDETAILVIEWSTYLE_H__