dbdim.h 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987
  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. //
  13. // DESCRIPTION: Exported dimension classes
  14. //
  15. // AcRxObject
  16. // AcDbObject
  17. // AcDbEntity
  18. // AcDbDimension
  19. // AcDbOrdinateDimension
  20. // AcDbAlignedDimension
  21. // AcDbRotatedDimension
  22. // AcDb3PointAngularDimension
  23. // AcDb2LineAngularDimension
  24. // AcDbRadialDimension
  25. // AcDbDiametricDimension
  26. // AcDbArcDimension
  27. // AcDbRadialDimensionLarge
  28. //
  29. // The AcDmUtil dimstyle utility function namespace is also here.
  30. //
  31. #ifndef AD_DBDIM_H
  32. #define AD_DBDIM_H
  33. #include "dbmain.h"
  34. #include "dbmtext.h"
  35. #include "acgi.h"
  36. // Hidden layer to accommodate dynamic dimensional constraints.
  37. #define DYNAMIC_CONSTRAINT_LAYER_OLD _T("LayerNameForDynamicConstraint")
  38. #define DYNAMIC_CONSTRAINT_LAYER_HIDDEN_OLD _T("*LayerNameForDynamicConstraint")
  39. // New names for anonymous layers.
  40. #define DYNAMIC_CONSTRAINT_LAYER _T("ADSK_CONSTRAINTS")
  41. #define DYNAMIC_CONSTRAINT_LAYER_HIDDEN _T("*ADSK_CONSTRAINTS")
  42. #pragma pack(push, 8)
  43. // ----------- Utility functions for dimensioning api: -------------------
  44. //
  45. namespace AcDmUtil
  46. {
  47. // Return R14 dimvar value given new dimvar values:
  48. //
  49. int dimfit (int dimatfit, int dimtmove);
  50. int dimunit (int dimlunit, int dimfrac );
  51. // Return R15 dimvar value, given old dimvar value:
  52. //
  53. int dimatfit(int dimfit);
  54. int dimtmove(int dimfit);
  55. int dimlunit(int dimunit);
  56. int dimfrac (int dimunit);
  57. // ------- Arrowhead management utilities: ---------
  58. // All functions will take either local or global name as input.
  59. // Arrow name utilities:
  60. // - All four name functions return the same name for user-defined
  61. // arrowheads -- the name of the block in the AcDbBlockTable.
  62. // - All four name functions return NULL if the input is not a valid
  63. // arrowhead name or block Id.
  64. // Caller is responsible for freeing the memory which is passed back.
  65. //
  66. // Given the name (or objectId) of an arrowhead, return the
  67. // globally invariant name:
  68. const ACHAR * globalArrowName(const ACHAR * pName);
  69. const ACHAR * globalArrowName(AcDbObjectId blockId);
  70. //
  71. // Given the name (or objectId) of an arrowhead, return the
  72. // local name:
  73. const ACHAR * arrowName(const ACHAR * pName);
  74. const ACHAR * arrowName(AcDbObjectId blockId);
  75. // Is this the local or global name of a built-in (pre-defined) arrowhead?
  76. bool isBuiltInArrow(const ACHAR * pName);
  77. // Is this the local or global name of a "no length" arrowhead?
  78. bool isZeroLengthArrow(const ACHAR * pName);
  79. // Both of these look up pName in the AcDbBlockTable and return the id
  80. // of the AcDbBlockTableRecord if found.
  81. //
  82. // findArrowId() returns eKeyNotFound if the block is not present:
  83. Acad::ErrorStatus findArrowId(const ACHAR * pName,
  84. AcDbObjectId& blockId,
  85. AcDbDatabase* pDb = 0);
  86. //
  87. // getArrowId() will create the block if pName is a built-in arrowhead name:
  88. Acad::ErrorStatus getArrowId(const ACHAR * pName,
  89. AcDbObjectId& blockId,
  90. AcDbDatabase* pDb = 0);
  91. };
  92. class ADESK_NO_VTABLE AcDbDimension: public AcDbEntity
  93. {
  94. protected:
  95. AcDbDimension();
  96. public:
  97. ~AcDbDimension();
  98. ACDB_DECLARE_MEMBERS(AcDbDimension);
  99. /// <summary> Get dimension text defined width and defined height from MText in dimension block
  100. /// <param name = "width"> text defined width to return </param>
  101. /// <param name = "height"> text defined height to return </param>
  102. /// <returns> void </returns>
  103. /// </summary>
  104. ACDB_PORT void textDefinedSize(double &width, double &height) const;
  105. /// <summary> Set text defined width and defined height to MText in dimension block
  106. /// <param name = "width"> text defined width </param>
  107. /// <param name = "height"> text defined height </param>
  108. /// <returns> void </returns>
  109. /// </summary>
  110. ACDB_PORT void setTextDefinedSize(double width, double height);
  111. /// <summary> Reset dimension text defined width and defined height to MText in dimension block.
  112. /// <param name = "width"> text defined width </param>
  113. /// <param name = "height"> text defined height </param>
  114. /// <returns> void </returns>
  115. /// </summary>
  116. ACDB_PORT void resetTextDefinedSize();
  117. AcGePoint3d textPosition() const;
  118. Acad::ErrorStatus setTextPosition(const AcGePoint3d&);
  119. Adesk::Boolean isUsingDefaultTextPosition() const;
  120. Acad::ErrorStatus useSetTextPosition();
  121. Acad::ErrorStatus useDefaultTextPosition();
  122. ACDB_PORT Acad::ErrorStatus setUsingDefaultTextPosition(bool);
  123. AcGeVector3d normal() const;
  124. Acad::ErrorStatus setNormal(const AcGeVector3d&);
  125. virtual Adesk::Boolean isPlanar() const { return true; }
  126. virtual Acad::ErrorStatus getPlane(AcGePlane&, AcDb::Planarity&) const;
  127. double elevation() const;
  128. Acad::ErrorStatus setElevation(double);
  129. ACHAR * dimensionText() const;
  130. Acad::ErrorStatus setDimensionText(const ACHAR *);
  131. double textRotation() const;
  132. Acad::ErrorStatus setTextRotation(double);
  133. AcDbObjectId dimensionStyle() const;
  134. Acad::ErrorStatus setDimensionStyle(AcDbObjectId);
  135. AcDbMText::AttachmentPoint textAttachment() const;
  136. Acad::ErrorStatus setTextAttachment(AcDbMText::AttachmentPoint eAtt);
  137. AcDb::LineSpacingStyle textLineSpacingStyle() const;
  138. Acad::ErrorStatus setTextLineSpacingStyle(AcDb::LineSpacingStyle eStyle);
  139. double textLineSpacingFactor() const;
  140. Acad::ErrorStatus setTextLineSpacingFactor(double dFactor);
  141. Acad::ErrorStatus getDimstyleData(AcDbDimStyleTableRecord*& pRecord) const;
  142. Acad::ErrorStatus setDimstyleData(AcDbDimStyleTableRecord* pNewData);
  143. Acad::ErrorStatus setDimstyleData(AcDbObjectId newDataId);
  144. // Note: this erased() method doesn't actually get called! The
  145. // dbObj arg is not const, so it is not really overriding the
  146. // reactor's base class method.
  147. //
  148. virtual void erased(AcDbObject* dbObj, Adesk::Boolean bErasing);
  149. virtual void objectClosed(const AcDbObjectId dbObj);
  150. virtual void dragStatus(const AcDb::DragStat status);
  151. double horizontalRotation() const;
  152. Acad::ErrorStatus setHorizontalRotation(double newVal);
  153. // Functions for accessing the Dimension's defining block
  154. //
  155. AcDbObjectId dimBlockId() const;
  156. Acad::ErrorStatus setDimBlockId(const AcDbObjectId&);
  157. AcGePoint3d dimBlockPosition() const;
  158. Acad::ErrorStatus setDimBlockPosition(const AcGePoint3d&);
  159. Acad::ErrorStatus recomputeDimBlock(bool forceUpdate = true);
  160. Acad::ErrorStatus generateLayout();
  161. Acad::ErrorStatus measurement(double &val);
  162. Acad::ErrorStatus formatMeasurement(ACHAR *MTextContentBuffer,
  163. const size_t contentBufferLen,
  164. double measurement,
  165. ACHAR *dimensionText);
  166. // Functions for Dynamic Dimensions control
  167. //
  168. bool isDynamicDimension() const;
  169. Acad::ErrorStatus setDynamicDimension(bool newVal);
  170. //new getOsnapPoints API
  171. Acad::ErrorStatus getOsnapPointsAtSubentPath(AcDb::OsnapMode osnapMode,
  172. const AcDbFullSubentPath& subentId,
  173. const AcGePoint3d& pickPoint,
  174. const AcGePoint3d& lastPoint,
  175. const AcGeMatrix3d& viewXform,
  176. AcGePoint3dArray& snapPoints,
  177. AcDbIntArray & geomIds) const;
  178. AcDbObjectId dimLineLinetype() const;
  179. Acad::ErrorStatus setDimLineLinetype(const AcDbObjectId linetype);
  180. AcDbObjectId dimExt1Linetype() const;
  181. Acad::ErrorStatus setDimExt1Linetype(const AcDbObjectId linetype);
  182. AcDbObjectId dimExt2Linetype() const;
  183. Acad::ErrorStatus setDimExt2Linetype(const AcDbObjectId linetype);
  184. Acad::ErrorStatus removeTextField();
  185. Acad::ErrorStatus fieldToMText(AcDbMText* pDimMText);
  186. Acad::ErrorStatus fieldFromMText(AcDbMText* pDimMText);
  187. // Dimension variable api:
  188. //
  189. #undef DBDIMVAR_H // force the file to get read again
  190. #include "dbdimvar.h"
  191. // DEPRECATED METHODS!
  192. // These are supported but will be removed in future releases:
  193. //
  194. int dimfit() const;
  195. int dimunit() const;
  196. Acad::ErrorStatus setDimfit (int );
  197. Acad::ErrorStatus setDimunit(int );
  198. //
  199. // end DEPRECATED METHODS!
  200. // Functions for internal use only
  201. //
  202. bool isHorizontalRefTextRotation() const;
  203. Acad::ErrorStatus setHorizontalRefTextRotation(bool newVal);
  204. // Dimension Flip Arrow Support
  205. bool getArrowFirstIsFlipped() const;
  206. bool getArrowSecondIsFlipped() const;
  207. Acad::ErrorStatus setArrowFirstIsFlipped(bool bIsFlipped);
  208. Acad::ErrorStatus setArrowSecondIsFlipped(bool bIsFlipped);
  209. AcGeMatrix3d blockTransform() const;
  210. // Spago inspection dimension enhancement
  211. enum DimInspect {
  212. kShapeRemove = 0, // Not displayed
  213. kShapeRound = 1, // Rounded end (default)
  214. kShapeAngular = 2, // Angular end
  215. kShapeNone = 4, // No bounding shape
  216. kShapeLabel = 0x10, // Label separator and alpha field displayed
  217. kShapeRate = 0x20, // Shape separator and alpha field displayed
  218. };
  219. bool inspection() const;
  220. Acad::ErrorStatus setInspection(bool val);
  221. int inspectionFrame() const;
  222. Acad::ErrorStatus setInspectionFrame(int frame);
  223. const ACHAR* inspectionLabel() const;
  224. Acad::ErrorStatus setInspectionLabel(const ACHAR* label);
  225. const ACHAR* inspectionRate() const;
  226. Acad::ErrorStatus setInspectionRate(const ACHAR* label);
  227. // Dimensional constraint support from dimension objects.
  228. bool isConstraintObject() const;
  229. bool isConstraintObject(bool &hasExpression,
  230. bool &isReferenceConstraint) const;
  231. bool isConstraintDynamic(void) const;
  232. Acad::ErrorStatus setConstraintDynamic(bool bDynamic);
  233. bool shouldParticipateInOPM(void) const;
  234. void setShouldParticipateInOPM(bool bShouldParticipate);
  235. ACDB_PORT double centerMarkSize() const;
  236. ACDB_PORT Acad::ErrorStatus prefix(AcString& sPrefix) const;
  237. ACDB_PORT Acad::ErrorStatus setPrefix(const AcString&);
  238. ACDB_PORT Acad::ErrorStatus suffix(AcString&) const;
  239. ACDB_PORT Acad::ErrorStatus setSuffix(const AcString&);
  240. ACDB_PORT Acad::ErrorStatus alternateSuffix(AcString&) const;
  241. ACDB_PORT Acad::ErrorStatus setAlternateSuffix(const AcString&);
  242. ACDB_PORT Acad::ErrorStatus alternatePrefix(AcString&) const;
  243. ACDB_PORT Acad::ErrorStatus setAlternatePrefix(const AcString&);
  244. ACDB_PORT bool suppressAngularLeadingZeros() const;
  245. ACDB_PORT Acad::ErrorStatus setSuppressAngularLeadingZeros(bool);
  246. ACDB_PORT bool suppressAngularTrailingZeros() const;
  247. ACDB_PORT Acad::ErrorStatus setSuppressAngularTrailingZeros(bool);
  248. ACDB_PORT bool altSuppressZeroInches() const;
  249. ACDB_PORT Acad::ErrorStatus setAltSuppressZeroInches(bool);
  250. ACDB_PORT bool altSuppressZeroFeet() const;
  251. ACDB_PORT Acad::ErrorStatus setAltSuppressZeroFeet(bool);
  252. ACDB_PORT bool altSuppressTrailingZeros() const;
  253. ACDB_PORT Acad::ErrorStatus setAltSuppressTrailingZeros(bool);
  254. ACDB_PORT bool altToleranceSuppressLeadingZeros() const;
  255. ACDB_PORT Acad::ErrorStatus setAltToleranceSuppressLeadingZeros(bool);
  256. ACDB_PORT bool altToleranceSuppressZeroInches() const;
  257. ACDB_PORT Acad::ErrorStatus setAltToleranceSuppressZeroInches(bool);
  258. ACDB_PORT bool altToleranceSuppressZeroFeet() const;
  259. ACDB_PORT Acad::ErrorStatus setAltToleranceSuppressZeroFeet(bool);
  260. ACDB_PORT bool altToleranceSuppressTrailingZeros() const;
  261. ACDB_PORT Acad::ErrorStatus setAltToleranceSuppressTrailingZeros(bool);
  262. ACDB_PORT bool suppressZeroFeet() const;
  263. ACDB_PORT Acad::ErrorStatus setSuppressZeroFeet(bool);
  264. ACDB_PORT bool suppressTrailingZeros() const;
  265. ACDB_PORT Acad::ErrorStatus setSuppressTrailingZeros(bool);
  266. ACDB_PORT bool suppressLeadingZeros() const;
  267. ACDB_PORT Acad::ErrorStatus setSuppressLeadingZeros(bool);
  268. ACDB_PORT bool suppressZeroInches() const;
  269. ACDB_PORT Acad::ErrorStatus setSuppressZeroInches(bool);
  270. ACDB_PORT bool altSuppressLeadingZeros() const;
  271. ACDB_PORT Acad::ErrorStatus setAltSuppressLeadingZeros(bool);
  272. ACDB_PORT bool toleranceSuppressZeroFeet() const;
  273. ACDB_PORT Acad::ErrorStatus setToleranceSuppressZeroFeet(bool);
  274. ACDB_PORT bool toleranceSuppressTrailingZeros() const;
  275. ACDB_PORT Acad::ErrorStatus setToleranceSuppressTrailingZeros(bool);
  276. ACDB_PORT bool toleranceSuppressLeadingZeros() const;
  277. ACDB_PORT Acad::ErrorStatus setToleranceSuppressLeadingZeros(bool);
  278. ACDB_PORT bool toleranceSuppressZeroInches() const;
  279. ACDB_PORT Acad::ErrorStatus setToleranceSuppressZeroInches(bool);
  280. enum CenterMarkType { kMark = 0,
  281. kLine = 1,
  282. kNone = 2 };
  283. ACDB_PORT AcDbDimension::CenterMarkType centerMarkType() const;
  284. protected:
  285. /// <summary>
  286. /// This function returns the object ID of the AcDbDimStyleTableRecord
  287. /// referenced by the dimension.
  288. /// </summary>
  289. /// <remarks>
  290. /// The text string name within the referenced DimStyleTableRecord is used
  291. /// for DXF group code 3.
  292. /// </remarks>
  293. /// <returns>
  294. /// Returns object ID of the AcDbDimStyleTableRecord referenced by the dimension.
  295. /// </returns>
  296. AcDbObjectId subDimensionStyle() const;
  297. /// <summary>
  298. /// This function sets the dimension to use the AcDbDimStyleTableRecord with
  299. /// the object ID styleId.
  300. /// </summary>
  301. /// <remarks>
  302. /// If styleId is AcDbObjectId::kNull (or just NULL), then when the dimension
  303. /// is closed it will be set to use the current default dimStyle in the
  304. /// AutoCAD editor. The text string name within the referenced
  305. /// DimStyleTableRecord is used for DXF group code 3.
  306. /// </remarks>
  307. /// <param name="dimStyleId">Input object ID to be used by AcDbDimStyleTableRecord.
  308. /// </param>
  309. /// <returns>
  310. /// Returns Acad::eOk if operation is successful.
  311. /// </returns>
  312. Acad::ErrorStatus subSetDimensionStyle(AcDbObjectId dimStyleId);
  313. /// <summary>
  314. /// This function copies the dimstyle information from the AcDbDimStyleTableRecord
  315. /// referenced by the dimension into the AcDbDimStyleTableRecord pointed to
  316. /// by pRecord. After copying the data, any dimension variable overrides currently
  317. /// applied to the dimension will be copied into the record pointed to by pRecord.
  318. /// The result is that pRecord represents the effective style settings currently
  319. /// in use by this object.
  320. /// </summary>
  321. /// <param name="pRecord">Input pointer to a pre-existing non-database-resident
  322. /// record.
  323. /// </param>
  324. /// <returns>
  325. /// This function returns Acad::eOk if successful. Acad::eInvalidInput will be
  326. /// returned if pRecord is not a valid AcDbDimStyleTableRecord.
  327. /// Acad::eInvalidDimStyle will be returned if the dimension there is an invalid
  328. /// dimension style associated with this dimension. Various open codes can be
  329. /// returned if the associated AcDbDimStyleTableRecord cannot be opened.
  330. /// Acad::eNullObjectPointer will be returned if pRecord or the associated
  331. /// AcDbDimStyleTableRecord is NULL.
  332. /// </returns>
  333. Acad::ErrorStatus subGetDimstyleData(AcDbDimStyleTableRecord*& pRecord) const;
  334. /// <summary>
  335. /// This function compares the dimstyledata in the record pointed to by
  336. /// pNewData with the data in the record referenced by the dimension,
  337. /// and applies any differences as dimension variable overrides on the
  338. /// dimension. So, when this function is finished, the combination of the
  339. /// referenced DimStyleTableRecord and the newly applied dimension variable
  340. /// overrides will make the dimension display as though it were actually
  341. /// referencing the DimStyleTableRecord pNewData.
  342. /// </summary>
  343. /// <remarks>
  344. /// The DimStyleTableRecord pointed to by pNewData may be database-resident,
  345. /// but that is not required for this function to use it. If it is
  346. /// database-resident, it can be in any database currently loaded in memory.
  347. /// </remarks>
  348. /// <param name="pNewData">Input pointer to the AcDbDimStyleTableRecord
  349. /// whose data is to be applied to this dimension.
  350. /// </param>
  351. /// <returns>
  352. /// This function returns Acad::eOk if successful. Acad::eInvalidInput
  353. /// will be returned if pRecord is not a valid AcDbDimStyleTableRecord.
  354. /// Acad::eInvalidDimStyle will be returned if the dimension there is an
  355. /// invalid dimension style associated with this dimension. Various open
  356. /// codes can be returned if the associated AcDbDimStyleTableRecord cannot
  357. /// be opened.
  358. /// </returns>
  359. Acad::ErrorStatus subSetDimstyleData(AcDbDimStyleTableRecord* pNewData);
  360. /// <summary>
  361. /// This function compares the dimstyle data in the record identified by
  362. /// newDataId with the data in the record referenced by the dimension,
  363. /// and applies any differences as dimension variable overrides on the
  364. /// dimension. So, when this function is finished, the combination of the
  365. /// referenced DimStyleTableRecord and the newly applied dimension variable
  366. /// overrides will make the dimension display as though it were actually
  367. /// referencing the DimStyleTableRecord newDataId.
  368. /// </summary>
  369. /// <remarks>
  370. /// The DimStyleTableRecord identified by newDataId can be in any database
  371. /// currently loaded in memory.
  372. /// </remarks>
  373. /// <param name="newDataId">Input object ID of the AcDbDimStyleTableRecord
  374. /// whose data is to be applied to this dimension.
  375. /// </param>
  376. /// <returns>
  377. /// This function returns Acad::eOk if successful. Acad::eInvalidInput
  378. /// will be returned if pRecord is not a valid AcDbDimStyleTableRecord.
  379. /// Acad::eInvalidDimStyle will be returned if the dimension there is an
  380. /// invalid dimension style associated with this dimension. Various open
  381. /// codes can be returned if the associated AcDbDimStyleTableRecord cannot
  382. /// be opened.
  383. /// </returns>
  384. Acad::ErrorStatus subSetDimstyleData(AcDbObjectId newDataId);
  385. friend class AcDbDimensionStyleOverrule;
  386. };
  387. class AcDbOrdinateDimension: public AcDbDimension
  388. {
  389. public:
  390. AcDbOrdinateDimension();
  391. AcDbOrdinateDimension(
  392. Adesk::Boolean useXAxis,
  393. const AcGePoint3d& definingPoint,
  394. const AcGePoint3d& leaderEndPoint,
  395. const ACHAR * dimText = NULL,
  396. AcDbObjectId dimStyle = AcDbObjectId::kNull);
  397. ~AcDbOrdinateDimension();
  398. ACDB_DECLARE_MEMBERS(AcDbOrdinateDimension);
  399. Adesk::Boolean isUsingXAxis() const;
  400. Adesk::Boolean isUsingYAxis() const;
  401. Acad::ErrorStatus useXAxis();
  402. Acad::ErrorStatus useYAxis();
  403. ACDB_PORT Acad::ErrorStatus setUsingXAxis(bool value);
  404. ACDB_PORT Acad::ErrorStatus setUsingYAxis(bool value);
  405. AcGePoint3d origin() const;
  406. Acad::ErrorStatus setOrigin(const AcGePoint3d&);
  407. AcGePoint3d definingPoint() const;
  408. Acad::ErrorStatus setDefiningPoint(const AcGePoint3d&);
  409. AcGePoint3d leaderEndPoint() const;
  410. Acad::ErrorStatus setLeaderEndPoint(const AcGePoint3d&);
  411. protected:
  412. // Get corresponding COM wrapper class ID
  413. //
  414. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  415. };
  416. class AcDbAlignedDimension: public AcDbDimension
  417. {
  418. public:
  419. AcDbAlignedDimension();
  420. AcDbAlignedDimension(
  421. const AcGePoint3d& xLine1Point,
  422. const AcGePoint3d& xLine2Point,
  423. const AcGePoint3d& dimLinePoint,
  424. const ACHAR * dimText = NULL,
  425. AcDbObjectId dimStyle = AcDbObjectId::kNull);
  426. ~AcDbAlignedDimension();
  427. ACDB_DECLARE_MEMBERS(AcDbAlignedDimension);
  428. AcGePoint3d xLine1Point() const;
  429. Acad::ErrorStatus setXLine1Point(const AcGePoint3d&);
  430. AcGePoint3d xLine2Point() const;
  431. Acad::ErrorStatus setXLine2Point(const AcGePoint3d&);
  432. AcGePoint3d dimLinePoint() const;
  433. Acad::ErrorStatus setDimLinePoint(const AcGePoint3d&);
  434. double oblique() const;
  435. Acad::ErrorStatus setOblique(double);
  436. // Aligned dimension Jog symbol
  437. bool jogSymbolOn() const;
  438. Acad::ErrorStatus setJogSymbolOn(bool value);
  439. AcGePoint3d jogSymbolPosition() const;
  440. Acad::ErrorStatus setJogSymbolPosition(const AcGePoint3d& pt);
  441. protected:
  442. // Get corresponding COM wrapper class ID
  443. //
  444. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  445. };
  446. class AcDbRotatedDimension: public AcDbDimension
  447. {
  448. public:
  449. AcDbRotatedDimension();
  450. AcDbRotatedDimension(
  451. double rotation,
  452. const AcGePoint3d& xLine1Point,
  453. const AcGePoint3d& xLine2Point,
  454. const AcGePoint3d& dimLinePoint,
  455. const ACHAR * dimText = NULL,
  456. AcDbObjectId dimStyle = AcDbObjectId::kNull);
  457. ~AcDbRotatedDimension();
  458. ACDB_DECLARE_MEMBERS(AcDbRotatedDimension);
  459. AcGePoint3d xLine1Point() const;
  460. Acad::ErrorStatus setXLine1Point(const AcGePoint3d&);
  461. AcGePoint3d xLine2Point() const;
  462. Acad::ErrorStatus setXLine2Point(const AcGePoint3d&);
  463. AcGePoint3d dimLinePoint() const;
  464. Acad::ErrorStatus setDimLinePoint(const AcGePoint3d&);
  465. double oblique() const;
  466. Acad::ErrorStatus setOblique(double);
  467. double rotation() const;
  468. Acad::ErrorStatus setRotation(double);
  469. // Rotated dimension Jog symbol
  470. bool jogSymbolOn() const;
  471. Acad::ErrorStatus setJogSymbolOn(bool value);
  472. AcGePoint3d jogSymbolPosition() const;
  473. Acad::ErrorStatus setJogSymbolPosition(const AcGePoint3d& pt);
  474. protected:
  475. // Get corresponding COM wrapper class ID
  476. //
  477. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  478. };
  479. class AcDb3PointAngularDimension: public AcDbDimension
  480. {
  481. public:
  482. AcDb3PointAngularDimension();
  483. AcDb3PointAngularDimension(
  484. const AcGePoint3d& centerPoint,
  485. const AcGePoint3d& xLine1Point,
  486. const AcGePoint3d& xLine2Point,
  487. const AcGePoint3d& arcPoint,
  488. const ACHAR * dimText = NULL,
  489. AcDbObjectId dimStyle = AcDbObjectId::kNull);
  490. ~AcDb3PointAngularDimension();
  491. ACDB_DECLARE_MEMBERS(AcDb3PointAngularDimension);
  492. AcGePoint3d arcPoint() const;
  493. Acad::ErrorStatus setArcPoint(const AcGePoint3d&);
  494. AcGePoint3d xLine1Point() const;
  495. Acad::ErrorStatus setXLine1Point(const AcGePoint3d&);
  496. AcGePoint3d xLine2Point() const;
  497. Acad::ErrorStatus setXLine2Point(const AcGePoint3d&);
  498. AcGePoint3d centerPoint() const;
  499. Acad::ErrorStatus setCenterPoint(const AcGePoint3d&);
  500. // Angular dimension extension arc for quadrant
  501. bool extArcOn() const;
  502. Acad::ErrorStatus setExtArcOn(bool value);
  503. protected:
  504. // Get corresponding COM wrapper class ID
  505. //
  506. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  507. };
  508. class AcDb2LineAngularDimension: public AcDbDimension
  509. {
  510. public:
  511. AcDb2LineAngularDimension();
  512. AcDb2LineAngularDimension(
  513. const AcGePoint3d& xLine1Start,
  514. const AcGePoint3d& xLine1End,
  515. const AcGePoint3d& xLine2Start,
  516. const AcGePoint3d& xLine2End,
  517. const AcGePoint3d& arcPoint,
  518. const ACHAR * dimText = NULL,
  519. AcDbObjectId dimStyle = AcDbObjectId::kNull);
  520. ~AcDb2LineAngularDimension();
  521. ACDB_DECLARE_MEMBERS(AcDb2LineAngularDimension);
  522. AcGePoint3d arcPoint() const;
  523. Acad::ErrorStatus setArcPoint(const AcGePoint3d&);
  524. AcGePoint3d xLine1Start() const;
  525. Acad::ErrorStatus setXLine1Start(const AcGePoint3d&);
  526. AcGePoint3d xLine1End() const;
  527. Acad::ErrorStatus setXLine1End(const AcGePoint3d&);
  528. AcGePoint3d xLine2Start() const;
  529. Acad::ErrorStatus setXLine2Start(const AcGePoint3d&);
  530. AcGePoint3d xLine2End() const;
  531. Acad::ErrorStatus setXLine2End(const AcGePoint3d&);
  532. // Angular dimension extension arc for quadrant
  533. bool extArcOn() const;
  534. Acad::ErrorStatus setExtArcOn(bool value);
  535. protected:
  536. // Get corresponding COM wrapper class ID
  537. //
  538. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  539. };
  540. class AcDbRadialDimension: public AcDbDimension
  541. {
  542. public:
  543. AcDbRadialDimension();
  544. AcDbRadialDimension(
  545. const AcGePoint3d& center,
  546. const AcGePoint3d& chordPoint,
  547. double leaderLength,
  548. const ACHAR * dimText = NULL,
  549. AcDbObjectId dimStyle = AcDbObjectId::kNull);
  550. ~AcDbRadialDimension();
  551. ACDB_DECLARE_MEMBERS(AcDbRadialDimension);
  552. double leaderLength() const;
  553. Acad::ErrorStatus setLeaderLength(double);
  554. AcGePoint3d center() const;
  555. Acad::ErrorStatus setCenter(const AcGePoint3d&);
  556. AcGePoint3d chordPoint() const;
  557. Acad::ErrorStatus setChordPoint(const AcGePoint3d&);
  558. // Radial dimension extension arc
  559. double extArcStartAngle() const;
  560. Acad::ErrorStatus setExtArcStartAngle(double newAngle);
  561. double extArcEndAngle() const;
  562. Acad::ErrorStatus setExtArcEndAngle(double newAngle);
  563. protected:
  564. // Get corresponding COM wrapper class ID
  565. //
  566. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  567. };
  568. class AcDbDiametricDimension: public AcDbDimension
  569. {
  570. public:
  571. AcDbDiametricDimension();
  572. AcDbDiametricDimension(
  573. const AcGePoint3d& chordPoint,
  574. const AcGePoint3d& farChordPoint,
  575. double leaderLength,
  576. const ACHAR * dimText = NULL,
  577. AcDbObjectId dimStyle = AcDbObjectId::kNull);
  578. ~AcDbDiametricDimension();
  579. ACDB_DECLARE_MEMBERS(AcDbDiametricDimension);
  580. double leaderLength() const;
  581. Acad::ErrorStatus setLeaderLength(double);
  582. AcGePoint3d chordPoint() const;
  583. Acad::ErrorStatus setChordPoint(const AcGePoint3d&);
  584. AcGePoint3d farChordPoint() const;
  585. Acad::ErrorStatus setFarChordPoint(const AcGePoint3d&);
  586. // Diametric dimension extension arc
  587. double extArcStartAngle() const;
  588. Acad::ErrorStatus setExtArcStartAngle(double newAngle);
  589. double extArcEndAngle() const;
  590. Acad::ErrorStatus setExtArcEndAngle(double newAngle);
  591. protected:
  592. // Get corresponding COM wrapper class ID
  593. //
  594. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  595. };
  596. // Arc length dimension class
  597. class AcDbArcDimension: public AcDbDimension
  598. {
  599. public:
  600. // Default constructor
  601. AcDbArcDimension();
  602. // Primary constructor
  603. AcDbArcDimension(
  604. const AcGePoint3d& centerPoint,
  605. const AcGePoint3d& xLine1Point,
  606. const AcGePoint3d& xLine2Point,
  607. const AcGePoint3d& arcPoint,
  608. const ACHAR * dimText = NULL,
  609. AcDbObjectId dimStyle = AcDbObjectId::kNull);
  610. // Default destructor
  611. ~AcDbArcDimension();
  612. ACDB_DECLARE_MEMBERS(AcDbArcDimension);
  613. // Query method which returns a point on the arc length dimension's dimension arc.
  614. AcGePoint3d arcPoint() const;
  615. // Set method to set the point which the arc length dimension's dimension arc passes through.
  616. Acad::ErrorStatus setArcPoint(const AcGePoint3d & arcPt);
  617. // Query method which returns the start point for the arc length dimension's first extension line.
  618. AcGePoint3d xLine1Point() const;
  619. // Set method which sets the start point for the arc length dimension's first extension line.
  620. Acad::ErrorStatus setXLine1Point(const AcGePoint3d & xLine1Pt);
  621. // Query method which returns the start point for the arc length dimension's second extension line.
  622. AcGePoint3d xLine2Point() const;
  623. // Set method which sets the start point for the arc length dimension's second extension line.
  624. Acad::ErrorStatus setXLine2Point(const AcGePoint3d & xLine2Pt);
  625. // Query method which returns the center point of the arc dimensioned by the arc length dimension.
  626. AcGePoint3d centerPoint() const;
  627. // Set method which sets the center point of the arc dimensioned by the arc length dimension.
  628. Acad::ErrorStatus setCenterPoint(const AcGePoint3d & ctrPt);
  629. // Query method which returns true if this arc length dimension was specified using two points along the arc,
  630. // false if the arc length dimension dimensions the entire arc segment.
  631. bool isPartial() const;
  632. // Set method if passed true, the arc length dimension was specified using the entire arc segment,
  633. // if passed false the arc length dimension arc length dimension was specified using two points along the arc.
  634. Acad::ErrorStatus setIsPartial(const bool & partial);
  635. // Query method which returns the parameter of the arc being dimensioned cooresponding to the arc length dimension's first definiton point.
  636. double arcStartParam() const;
  637. // Set method which sets the parameter of the arc being dimensioned cooresponding to the arc length dimension's first definiton point.
  638. Acad::ErrorStatus setArcStartParam(const double & arcParam);
  639. // Query method which returns the parameter of the arc being dimensioned cooresponding to the arc length dimension's second definiton point.
  640. double arcEndParam() const;
  641. // Set method which sets the parameter of the arc being dimensioned cooresponding to the arc length dimension's second definiton point.
  642. Acad::ErrorStatus setArcEndParam(const double & arcParam);
  643. // Query method which returns true if this arc length dimension has an extra leader drawn to resolve ambiguity, false if the arc length dimension has no extra leader drawn.
  644. bool hasLeader() const;
  645. // Set method if passed true, the arc length dimension has an extra leader drawn to resolve ambiguity, if passed false the arc length dimension has no extra leader drawn.
  646. Acad::ErrorStatus setHasLeader(const bool & leaderVal);
  647. // Query method which returns the start point for the arc length dimension's extra leader, if drawn.
  648. AcGePoint3d leader1Point() const;
  649. // Set method which sets the start point for the arc length dimension's extra leader, if drawn.
  650. Acad::ErrorStatus setLeader1Point(const AcGePoint3d & ldr1Pt);
  651. // Query method which returns the end point for the arc length dimension's extra leader, if drawn.
  652. AcGePoint3d leader2Point() const;
  653. // Set method which sets the end point for the arc length dimension's extra leader, if drawn.
  654. Acad::ErrorStatus setLeader2Point(const AcGePoint3d & ldr2Pt);
  655. // Query method which returns the type of symbol used within the arc length dimension's text string:
  656. // 0 - Arc symbol precedes text, 1 - Arc symbol is above text, 2 - No arc symbol is used.
  657. int arcSymbolType() const;
  658. // Set method which sets the type of symbol to use within the arc length dimension's text string:
  659. // 0 - Arc symbol precedes text, 1 - Arc symbol is above text, 2 - No arc symbol is used.
  660. // This overrides the setting of this value in the dimension's style.
  661. Acad::ErrorStatus setArcSymbolType(const int symbol);
  662. protected:
  663. // Get corresponding COM wrapper class ID
  664. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  665. };
  666. class AcDbRadialDimensionLarge: public AcDbDimension
  667. {
  668. public:
  669. // Default constructor
  670. AcDbRadialDimensionLarge();
  671. // Primary constructor
  672. AcDbRadialDimensionLarge(
  673. const AcGePoint3d& center,
  674. const AcGePoint3d& chordPoint,
  675. const AcGePoint3d& overrideCenter,
  676. const AcGePoint3d& jogPoint,
  677. double jogAngle,
  678. const ACHAR * dimText = NULL,
  679. AcDbObjectId dimStyle = AcDbObjectId::kNull);
  680. // Default destructor
  681. ~AcDbRadialDimensionLarge();
  682. ACDB_DECLARE_MEMBERS(AcDbRadialDimensionLarge);
  683. // Query method which returns the center point of the arc dimensioned by the jogged radius dimension.
  684. AcGePoint3d center() const;
  685. // Set method which sets the center point of the arc dimensioned by the jogged radius dimension.
  686. Acad::ErrorStatus setCenter(const AcGePoint3d & centerPoint);
  687. // Query method which returns the chord point on the arc dimensioned by the jogged radius dimension.
  688. AcGePoint3d chordPoint() const;
  689. // Set method which sets the chord point on the arc dimensioned by the jogged radius dimension.
  690. Acad::ErrorStatus setChordPoint(const AcGePoint3d & chordPoint);
  691. // Query method which returns the overidden center point used by the jogged radius dimension.
  692. AcGePoint3d overrideCenter() const;
  693. // Set method which sets the overidden center point to use for the jogged radius dimension.
  694. Acad::ErrorStatus setOverrideCenter(const AcGePoint3d & overrideCenterPoint);
  695. // Query method which returns the jog point used by the jogged radius dimension.
  696. AcGePoint3d jogPoint() const;
  697. // Set method which sets the jog point used by the jogged radius dimension.
  698. Acad::ErrorStatus setJogPoint(const AcGePoint3d & jogPoint);
  699. // Query method which returns the jog angle used by the jogged radius dimension.
  700. double jogAngle() const;
  701. // Set method which sets the jog angle used by the jogged radius dimension.
  702. Acad::ErrorStatus setJogAngle(double jogAngle);
  703. // Used exclusively by property palette
  704. // This function is required because once the jogged radius dimension's defining points are updated, all the other defining points need to be updated too.
  705. Acad::ErrorStatus setOverrideCenterPP(const AcGePoint3d & overrideCenterPointPP);
  706. // Used exclusively by property palette
  707. // This function is required because once the jogged radius dimension's defining points are updated, all the other defining points need to be updated too.
  708. Acad::ErrorStatus setJogPointPP(const AcGePoint3d & jogPointPP);
  709. // Used exclusively by property palette
  710. // This function is required because once the jogged radius dimension's defining points are updated, all the other defining points need to be updated too.
  711. Acad::ErrorStatus setTextPositionPP(const AcGePoint3d & textPointPP);
  712. // Radial large dimension extension arc
  713. double extArcStartAngle() const;
  714. Acad::ErrorStatus setExtArcStartAngle(double newAngle);
  715. double extArcEndAngle() const;
  716. Acad::ErrorStatus setExtArcEndAngle(double newAngle);
  717. protected:
  718. // Get corresponding COM wrapper class ID
  719. virtual Acad::ErrorStatus subGetClassID(CLSID * pClsid) const;
  720. };
  721. /// <property name="versionspecific" value="=18.1.0.0" />
  722. ///
  723. /// <summary>
  724. /// AcDbDimensionStyleOverrule overrules a subset of dimension style related
  725. /// operations that AcDbDimension class specifies. It is intended
  726. /// as a base class for clients who want to alter some or all
  727. /// behavior of a given AcDbDimension-derived class. At the base
  728. /// level, each default implementation simply calls the
  729. /// corresponding method in the target class.
  730. /// </summary>
  731. class AcDbDimensionStyleOverrule : public AcRxOverrule
  732. {
  733. public:
  734. ACRX_DECLARE_MEMBERS(AcDbDimensionStyleOverrule);
  735. ACDB_PORT AcDbDimensionStyleOverrule();
  736. /// <property name="versionspecific" value="=18.1.0.0" />
  737. ///
  738. /// <summary>
  739. /// Overrules AcDbDimension::dimensionStyle method.
  740. /// </summary>
  741. /// <remarks>
  742. /// The default implementation of
  743. /// AcDbDimensionStyleOverrule::dimensionStyle calls
  744. /// AcDbDimension::subDimensionStyle.
  745. /// </remarks>
  746. /// <param name="pSubject">Pointer to an AcDbDimension that this
  747. /// overrule is applied against.</param>
  748. /// <returns>
  749. /// Returns object ID of the AcDbDimStyleTableRecord referenced by the dimension.
  750. /// </returns>
  751. ACDB_PORT virtual AcDbObjectId dimensionStyle (const AcDbDimension* pSubject);
  752. /// <property name="versionspecific" value="=18.1.0.0" />
  753. ///
  754. /// <summary>
  755. /// Overrules AcDbDimension::setDimensionStyle.
  756. /// </summary>
  757. /// <param name="pSubject">Pointer to an AcDbDimension that this
  758. /// overrule is applied against.</param>
  759. /// <param name="dimStyleId">Input object ID of the desired AcDbDimStyleTableRecord
  760. /// to be used by dimension</param>
  761. /// <remarks>
  762. /// The default implementation of AcDbDimensionStyleOverrule::setDimensionStyle
  763. /// calls the protected AcDbDimension::subSetDimensionStyle method.
  764. /// </remarks>
  765. /// <returns>
  766. /// Returns Acad::eOk if operation is successful.
  767. /// </returns>
  768. ACDB_PORT virtual Acad::ErrorStatus setDimensionStyle (AcDbDimension* pSubject,
  769. AcDbObjectId dimStyleId);
  770. /// <property name="versionspecific" value="=18.1.0.0" />
  771. ///
  772. /// <summary>
  773. /// Overrules AcDbDimension::getDimstyleData method.
  774. /// </summary>
  775. /// <param name="pSubject">Pointer to an AcDbDimension that this
  776. /// overrule is applied against.</param>
  777. /// <param name="pRecord">Input pointer to an existing AcDbDimStyleTableRecord
  778. /// to which the dimension variable data will be copied.</param>
  779. /// <remarks>
  780. /// Default implementation of AcDbDimensionStyleOverrule::getDimstyleData
  781. /// calls protected AcDbDimension::subGetDimstyleData method.
  782. ///
  783. /// </remarks>
  784. /// <returns>
  785. /// Returns Acad::eOk if operation is successful.
  786. /// </returns>
  787. ACDB_PORT virtual Acad::ErrorStatus getDimstyleData (const AcDbDimension* pSubject,
  788. AcDbDimStyleTableRecord*& pRecord);
  789. /// <property name="versionspecific" value="=18.1.0.0" />
  790. ///
  791. /// <summary>
  792. /// Overrules AcDbDimension::setDimstyleData method.
  793. /// </summary>
  794. /// <param name="pSubject">Pointer to an AcDbDimension that this
  795. /// overrule is applied against.</param>
  796. /// <param name="pRecord">Input pointer to AcDbDimStyleTableRecord
  797. /// from which to copy dimension variable information.</param>
  798. /// <remarks>
  799. /// Default implementation of AcDbDimensionStyleOverrule::setDimstyleData
  800. /// calls protected AcDbDimension::subSetDimstyleData method.
  801. ///
  802. /// </remarks>
  803. /// <returns>
  804. /// Returns Acad::eOk if operation is successful.
  805. /// </returns>
  806. ACDB_PORT virtual Acad::ErrorStatus setDimstyleData (AcDbDimension* pSubject,
  807. AcDbDimStyleTableRecord* pRecord);
  808. /// <property name="versionspecific" value="=18.1.0.0" />
  809. ///
  810. /// <summary>
  811. /// Overrules AcDbDimension::setDimstyleData method.
  812. /// </summary>
  813. /// <param name="pSubject">Pointer to an AcDbDimension that this
  814. /// overrule is applied against.</param>
  815. /// <param name="dimstyleId">Input object ID of AcDbDimStyleTableRecord
  816. /// from which to copy dimension variable information</param>
  817. /// <remarks>
  818. /// Default implementation of AcDbDimensionStyleOverrule::setDimstyleData
  819. /// calls protected AcDbDimension::subSetDimstyleData method.
  820. ///
  821. /// </remarks>
  822. /// <returns>
  823. /// Returns Acad::eOk if operation is successful.
  824. /// </returns>
  825. ACDB_PORT virtual Acad::ErrorStatus setDimstyleData (AcDbDimension* pSubject,
  826. AcDbObjectId dimstyleId);
  827. };
  828. #pragma pack(pop)
  829. #endif