AcDbAssocArrayModifyActionBody.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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: Sharad Jaiswal May 2010
  12. //
  13. // DESCRIPTION:
  14. //
  15. //////////////////////////////////////////////////////////////////////////////
  16. #pragma once
  17. #include "AcDbAssocArrayActionBody.h"
  18. class AcDbVertexRef;
  19. /// <summary><para>
  20. /// AcDbAssocArrayModifyActionBody class is an associative action which modify
  21. /// or override items of an associative array. This class and its derived class
  22. /// in general manage item specific modification on an associative array. This
  23. /// class inparticular is responsible for replacing some items with a set of
  24. /// source objects.
  25. /// </para><para>
  26. /// This class may be derived to support any modification action specific to
  27. /// array items.
  28. /// </para></summary>
  29. /// <remarks> Deriving from this class is not supported. </remarks>
  30. ///
  31. class ACDB_PORT AcDbAssocArrayModifyActionBody : public AcDbAssocArrayActionBody
  32. {
  33. public:
  34. ACDB_DECLARE_MEMBERS(AcDbAssocArrayModifyActionBody);
  35. /// <summary> Default constructor. </summary>
  36. /// <param name="createImpObject"> See AcDbAssocCreateImpObject. </param>
  37. ///
  38. explicit AcDbAssocArrayModifyActionBody(AcDbAssocCreateImpObject createImpObject = kAcDbAssocCreateImpObject);
  39. /// <summary> Destructor. </summary>
  40. ///
  41. ~AcDbAssocArrayModifyActionBody(void);
  42. /// <summary> Obtains list of items which are being overriden by this
  43. /// action. </summary>
  44. /// <param name="indices"> The output list of spatial indices. </param>
  45. /// <returns> Acad::ErrorStatus. </returns>
  46. ///
  47. Acad::ErrorStatus getOverridenItems(AcArray<AcDbItemLocator>& indices) const;
  48. /// <summary> Sets the list of items which are to be overriden by this
  49. /// action. </summary>
  50. /// <param name="indices"> The input list of spatial indices. </param>
  51. /// <returns> Acad::ErrorStatus. </returns>
  52. ///
  53. Acad::ErrorStatus setOverridenItems(const AcArray<AcDbItemLocator>& indices);
  54. /// <summary> Checks whether an item at given index is controlled by this
  55. /// action. This method returns true if this item is being overridden by
  56. /// this action.</summary>
  57. /// <param name="item"> The input reference of array item. </param>
  58. /// <returns> true, if the item is controlled by this action. </returns>
  59. ///
  60. virtual bool controlsItem(const AcDbAssocArrayItem& item) const ADESK_OVERRIDE;
  61. /// <summary><para> Creates associative array modification action body to
  62. /// override given set of items from the array. This method is also
  63. /// responsible for creating action and attaching appropriate dependencies.
  64. /// </para><para> The item indices can be obtained from subent ids using
  65. /// static method AcDbAssocArrayActionBody::getArrayItemLocators(). </para>
  66. /// </summary>
  67. /// <param name="arrayId"> The input array object id. </param>
  68. /// <param name="indices"> The input list of item locators. </param>
  69. /// <param name="substEntities"> The input list of entities to be used as source for replacement. </param>
  70. /// <param name="basePoint"> The input vertex ref to define base point.
  71. /// </param>
  72. /// <param name="actionBodyId"> The returned array action body id. </param>
  73. /// <returns> Acad::ErrorStatus </returns>
  74. ///
  75. static Acad::ErrorStatus createInstance(AcDbObjectId arrayId,
  76. const AcArray<AcDbItemLocator>& indices,
  77. const AcDbObjectIdArray& substEntities,
  78. AcDbVertexRef& basePoint,
  79. AcDbObjectId& actionBodyId);
  80. };