AcDbAssocDimDependencyBody.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. //
  11. // CREATED BY: Jiri Kripac June 2008
  12. //
  13. // DESCRIPTION:
  14. //
  15. // AcDbAssocDimDependencyBody derived class.
  16. //
  17. //////////////////////////////////////////////////////////////////////////////
  18. #pragma once
  19. #include "AcDbAssocDimDependencyBodyBase.h"
  20. /// <summary>
  21. /// AcDbAssocDimDependencyBody manages an AcDbDimension entity that serves
  22. /// as the graphical representation of a dimensional constaint. It inherits
  23. /// common functionality from the AcDbAssocDimDependencyBodyBase class and
  24. /// overrides the base-class pure virtual methods in which it implements the
  25. /// AcDbDimension-specific functionality.
  26. /// </summary>
  27. ///
  28. class ACDB_PORT AcDbAssocDimDependencyBody : public AcDbAssocDimDependencyBodyBase
  29. {
  30. public:
  31. ACRX_DECLARE_MEMBERS(AcDbAssocDimDependencyBody);
  32. /// <summary> Default constructor.</summary>
  33. AcDbAssocDimDependencyBody();
  34. /// <summary> Destructor. </summary>
  35. virtual ~AcDbAssocDimDependencyBody();
  36. // Implementation of pure virtual methods in the AcDbAssocDimDependencyBodyBase
  37. // class. They deal with the controlled entity that is assumed to be an
  38. /// AcDbDimension
  39. /// <summary> Returns the text of the controlled AcDimension. </summary>
  40. /// <returns> AcDbDimension text. </returns>
  41. ///
  42. virtual AcString getEntityTextOverride() const;
  43. /// <summary> Sets the text property in the controlled AcDbDimension. </summary>
  44. /// <param name="newText"> New text to set in the AcDbDimension.</param>
  45. /// <returns> Acad::eOk if successful. </returns>
  46. ///
  47. virtual Acad::ErrorStatus setEntityTextOverride(const AcString& newText);
  48. /// <summary> Gets the measurement from the controlled AcDbDimension. </summary>
  49. /// <returns> AcDbDimension measurement. </returns>
  50. ///
  51. virtual double getEntityMeasurementOverride() const;
  52. /// <summary> Returns true iff the attachment of the controlled AcDbDimension
  53. /// changed, such as the AcDbDimension has been repositioned. </summary>
  54. /// <returns> Returns true if attachment changed. </returns>
  55. ///
  56. virtual bool isEntityAttachmentChangedOverride() const;
  57. // Overridden method from the AcDbAssocDependencyBody base class
  58. /// <summary> Updates position, size and orientation of the controlled AcDbDimension.
  59. /// </summary>
  60. /// <returns> Acad::eOk if successful. </returns>
  61. ///
  62. virtual Acad::ErrorStatus updateDependentOnObjectOverride();
  63. /// <summary>
  64. /// "Pseudo constructor". Creates a new AcDbAssocDependency object owning
  65. /// a new AcDbAssocDimDependencyBody object and makes the dependent-on object
  66. /// of the new dependency to be the provided AcDbDimension. Posts both objects
  67. /// to the database of the AcDbDimension.
  68. /// </summary>
  69. /// <param name="dimId"> AcDbObjectId of the AcDbDimension. </param>
  70. /// <param name="dimDepId"> AcDbObjectId of the created AcDbAssocDependency. </param>
  71. /// <param name="dimDepBodyId"> AcDbObjectId of the created AcDbAssocDimDependencyBody. </param>
  72. /// <returns> Acad::eOk if successful. </returns>
  73. ///
  74. static Acad::ErrorStatus
  75. createAndPostToDatabase(const AcDbObjectId& dimId,
  76. AcDbObjectId& dimDepId,
  77. AcDbObjectId& dimDepBodyId);
  78. };