AcDbPointCloudCropStateManager.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. #pragma once
  11. class AcDbPointCloudCropStateManagerImp;
  12. class AcDbPointCloudEx;
  13. /// <summary>
  14. /// This class includes all the crop states functions for point cloud.
  15. /// From the class you can get the saved crop states name, save current crops,
  16. /// delete a crop state, rename a crop state and get the current active crop state.
  17. /// The crop state manager is per point cloud object, you can get its pointer
  18. /// from AcDbPointCloudEx::cropStatesManager() or AcDbPointCloudEx::cropStatesManagerConst().
  19. /// </summary>
  20. class ACDB_PORT AcDbPointCloudCropStateManager
  21. {
  22. public:
  23. /// <summary>
  24. /// Restore the crop state.
  25. /// </summary>
  26. /// <param name="name">
  27. /// The name of the crop state.
  28. /// </param>
  29. /// <returns>
  30. /// Return Acad::eOk if it success to restore the crop state.
  31. /// Return Acad::eNotApplicable if there is no this "name" crop state.
  32. /// </returns>
  33. Acad::ErrorStatus restoreCropState(const AcString& name);
  34. /// <summary>
  35. /// Get all the crop states name.
  36. /// </summary>
  37. /// <param name="states">
  38. /// The output parameter to hold all the crop states name.
  39. /// </param>
  40. /// <returns>
  41. /// Return Acad::eOk if it success.
  42. /// Return Acad::eNotApplicable if it meets errors.
  43. /// </returns>
  44. Acad::ErrorStatus getAllCropStates(AcArray<AcString>& states) const;
  45. /// <summary>
  46. /// Remove the specified crop state.
  47. /// </summary>
  48. /// <param name="name">
  49. /// The name of the crop state.
  50. /// </param>
  51. /// <returns>
  52. /// Return Acad::eOk if it success to restore the crop state.
  53. /// Return Acad::eNotApplicable if there is no this "name" crop state.
  54. /// </returns>
  55. Acad::ErrorStatus removeCropState(const AcString& name);
  56. /// <summary>
  57. /// Rename the specified crop state. Note that the name should honor the rules for symbol names.
  58. /// These general rules are:
  59. /// Names may be as long as you need them to be (longer than 32 characters, as defined by previous versions of AutoCAD).
  60. /// Names may contain additional characters, such as the space character (' '), the apostrophe ('''), and so on.
  61. /// Names are treated case-insensitively.
  62. /// Names can not contain the following illegal characters:
  63. /// vertical bar ('|')
  64. /// asterisk ('*'), except as noted above
  65. /// backslash ('')
  66. /// colon (':')
  67. /// semicolon (';')
  68. /// angle brackets ('>', '<')
  69. /// question mark ('?')
  70. /// double quote ('"')
  71. /// comma (',')
  72. /// equal sign ('=')
  73. /// grave accent ('`')
  74. /// </summary>
  75. /// <param name="oldName">
  76. /// The old name of the crop state.
  77. /// </param>
  78. /// <param name="newName">
  79. /// The new name you want to set.
  80. /// </param>
  81. /// <returns>
  82. /// Return Acad::eOk if it success to restore the crop state.
  83. /// Return Acad::eNotApplicable if there is no this "name" crop state.
  84. /// </returns>
  85. Acad::ErrorStatus renameCropState(const AcString& oldName, const AcString& newName);
  86. /// <summary>
  87. /// Save the current crop, and specify a name. It honors the rules for symbol names.
  88. /// These general rules are:
  89. /// Names may be as long as you need them to be (longer than 32 characters, as defined by previous versions of AutoCAD).
  90. /// Names may contain additional characters, such as the space character (' '), the apostrophe ('''), and so on.
  91. /// Names are treated case-insensitively.
  92. /// Names can not contain the following illegal characters:
  93. /// vertical bar ('|')
  94. /// asterisk ('*'), except as noted above
  95. /// backslash ('')
  96. /// colon (':')
  97. /// semicolon (';')
  98. /// angle brackets ('>', '<')
  99. /// question mark ('?')
  100. /// double quote ('"')
  101. /// comma (',')
  102. /// equal sign ('=')
  103. /// grave accent ('`')
  104. /// </summary>
  105. /// <param name="state">
  106. /// The name of the crop state you specified.
  107. /// </param>
  108. /// <returns>
  109. /// Return Acad::eOk if it success to add the crop state.
  110. /// Return Acad::eDuplicateRecordName if it has this "name" crop states.
  111. /// </returns>
  112. Acad::ErrorStatus addCropState(const AcString& state);
  113. /// <summary>
  114. /// Get the current crop state name.
  115. /// </summary>
  116. /// <returns>
  117. /// Return the name of the current crop state. If there is no current
  118. /// crop state, it returns empty string. If you changed crop properties,
  119. /// or change the invisible scans/regions, it also return empty string.
  120. /// </returns>
  121. AcString currentCropState() const;
  122. private:
  123. AcDbPointCloudCropStateManager();
  124. AcDbPointCloudCropStateManager(AcDbPointCloudEx* pCloud);
  125. virtual ~AcDbPointCloudCropStateManager();
  126. AcDbPointCloudCropStateManagerImp* m_pImpCropStatesManager;
  127. friend class PointCloudExImp;
  128. friend class PointCloudCropStateRoundtripManager;
  129. };