AcPointCloudItem.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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. #pragma once
  12. #include "acarray.h"
  13. #include "adsdef.h"
  14. //////////////////////////////////////////////////////////////////////////
  15. class AcPointCloudItem;
  16. typedef AcPointCloudItem* PPointCloudItem;
  17. typedef AcArray<AcPointCloudItem*> AcPointCloudItemArray;
  18. /// <summary>
  19. /// Class point cloud item, which presents different type of point cloud elements
  20. /// e.g. project, scan, region, etc.
  21. /// </summary>
  22. class ACDB_PORT AcPointCloudItem
  23. {
  24. public:
  25. /// <summary>
  26. /// Describes the type of point cloud item
  27. /// </summary>
  28. enum AcPointCloudItemType
  29. {
  30. /// <summary>
  31. /// Legacy point cloud (load from a .pcg, .isd file).
  32. /// </summary>
  33. kLegacyPointCloud = 0,
  34. /// <summary>
  35. /// Point cloud project (load from a .rcp file which contains several .rcs files).
  36. /// </summary>
  37. kPointCloudProject,
  38. /// <summary>
  39. /// Individual scan (load from a .rcs file directly).
  40. /// </summary>
  41. kIndividualScan,
  42. /// <summary>
  43. /// Scan (a scan file included in a point cloud project file).
  44. /// </summary>
  45. kScan,
  46. /// <summary>
  47. /// A region is a Non-overlapping area that are defined in a point cloud for the purpose of filtering the display of meaningful volumes in the scene.
  48. /// </summary>
  49. kRegion,
  50. /// <summary>
  51. /// Folder to contain all scan items.
  52. /// </summary>
  53. kScanRootGroup,
  54. /// <summary>
  55. /// Folder to contain all region items.
  56. /// </summary>
  57. kRegionRootGroup,
  58. /// <summary>
  59. /// Points which are not assigned to any region.
  60. /// </summary>
  61. kUnassignedPoint
  62. };
  63. /// <summary>
  64. /// Default constructor
  65. /// </summary>
  66. AcPointCloudItem();
  67. /// <summary>
  68. /// Destructor
  69. /// </summary>
  70. ~AcPointCloudItem() {}
  71. /// <summary>
  72. /// Constructor
  73. /// </summary>
  74. /// <param name="name"> name of the item. </param>
  75. /// <param name="projectname"> project name which the item belongs to. </param>
  76. /// <param name="objectid"> index where the item is in the list. </param>
  77. /// <param name="categoryid"> category id which the item belongs to. </param>
  78. /// <param name="visibility"> specify if the item is visible. </param>
  79. /// <param name="highlight"> specify if the item is highlighted. </param>
  80. /// <param name="guid"> GUID of the item </param>
  81. AcPointCloudItem(const AcString& name, const AcString& projectname, int objectid, AcPointCloudItemType categoryid, bool visibility = true, bool highlight = false, AcString guid = L"");
  82. /// <summary>
  83. /// Copy constructor
  84. /// </summary>
  85. /// <param name="item"> the item which will be copied. </param>
  86. AcPointCloudItem(const AcPointCloudItem& item);
  87. /// <summary>
  88. /// Assign operator
  89. /// </summary>
  90. /// <param name="other"> the item which will be assigned to current item. </param>
  91. /// <returns>Returns a reference of current item.</returns>
  92. AcPointCloudItem& operator = (const AcPointCloudItem& other);
  93. /// <summary>
  94. /// Parse a string and assign the value to a new created item
  95. /// </summary>
  96. /// <param name="cmd">The string which needs to be parsed.
  97. /// The format is [ads name1:ads name2]|[name]|[guid]|[id]|[type]|[true|false].
  98. /// For example: 8796086754688:8796056998051|Room|{1CD49BCD_32FC_4A2E_92EA_C6ED69672F4E}|2|Scan|True
  99. /// </param>
  100. /// <returns>new created point cloud item</returns>
  101. static AcPointCloudItem* CreateFromCmdString(const ACHAR* cmd);
  102. public:
  103. /// <summary>
  104. /// Sets the name of item.
  105. /// </summary>
  106. /// <param name="val">item name</param>
  107. void setName(const AcString& val);
  108. /// <summary>
  109. /// Gets the name of item.
  110. /// </summary>
  111. /// <returns>item name</returns>
  112. /// <remarks>default value of name is set to empty string in default constructor</remarks>
  113. AcString name() const;
  114. /// <summary>
  115. /// Sets the name of project which current item belongs to
  116. /// </summary>
  117. /// <param name="val">project name</param>
  118. void setProjectName(const AcString& val);
  119. /// <summary>
  120. /// Gets the name of project which current item belongs to.
  121. /// </summary>
  122. /// <returns>project name</returns>
  123. /// <remarks>default value of project name is set to empty string in default constructor</remarks>
  124. AcString projectName() const;
  125. /// <summary>
  126. /// Sets the GUID of item
  127. /// </summary>
  128. /// <param name="val">GUID value</param>
  129. void setGuid(const AcString& val);
  130. /// <summary>
  131. /// Gets the GUID of item
  132. /// </summary>
  133. /// <returns>GUID of item</returns>
  134. /// <remarks>default value of GUID is set to empty string in default constructor</remarks>
  135. const AcString& guid() const;
  136. /// <summary>
  137. /// Sets id of item.
  138. /// </summary>
  139. /// <param name="val">id of item</param>
  140. /// <remarks>
  141. /// Basically, the id is the index where the item in the list, the value is read from ReCap SDK.
  142. /// If the type of item is kScan, id is the index in the list.
  143. /// If the type of item is kRegion, then id is the value of layer id defined in ReCap SDK
  144. /// </remarks>
  145. void setId(int val);
  146. /// <summary>
  147. /// Gets id of item.
  148. /// </summary>
  149. /// <returns>id of item</returns>
  150. /// <remarks>default value is set to 0 in default constructor</remarks>
  151. int id() const;
  152. /// <summary>
  153. /// Sets the visibility of item.
  154. /// </summary>
  155. /// <param name="val"> the item is visible or not.</param>
  156. void setVisibility(bool val);
  157. /// <summary>
  158. /// Gets the visibility of item.
  159. /// </summary>
  160. /// <returns>Returns true if the item is visible or false otherwise.</returns>
  161. /// <remarks>default value of visibility is set to true in default constructor</remarks>
  162. bool visibility() const;
  163. /// <summary>
  164. /// Sets the highlight of item.
  165. /// </summary>
  166. /// <param name="val">The val showing whether the item is highlighted or not.</param>
  167. void setHighlight(bool val);
  168. /// <summary>
  169. /// Gets the highlight of item.
  170. /// </summary>
  171. /// <returns>Returns true if the item is highlighted or false otherwise.</returns>
  172. /// <remarks>default value of highlight is set to false in default constructor</remarks>
  173. bool highlight() const;
  174. /// <summary>
  175. /// Sets the color which is used to highlight item
  176. /// </summary>
  177. /// <param name="red">value of red color.</param>
  178. /// <param name="green">value of green color.</param>
  179. /// <param name="blue">value of blue color.</param>
  180. void setColor(float red, float green, float blue);
  181. /// <summary>
  182. /// Gets the value of red color
  183. /// </summary>
  184. /// <returns>value of red color</returns>
  185. /// <remarks>default value of red color is set to 0.0 in default constructor</remarks>
  186. float red() const;
  187. /// <summary>
  188. /// Gets the value of green color
  189. /// </summary>
  190. /// <returns>value of green color</returns>
  191. /// <remarks>default value of green color is set to 0.0 in default constructor</remarks>
  192. float green() const;
  193. /// <summary>
  194. /// Gets the value of blue color
  195. /// </summary>
  196. /// <returns>value of blue color</returns>
  197. /// <remarks>default value of blue color is set to 0.0 in default constructor</remarks>
  198. float blue() const;
  199. /// <summary>
  200. /// Sets the ADS name of AcDbPointCloudEx which the item belongs to
  201. /// </summary>
  202. /// <param name="val">ADS name.</param>
  203. /// <remarks>
  204. /// ADS name is transformed from ObjectId of AcDbPointCloudEx
  205. /// </remarks>
  206. void setAdsName(const ads_name& val);
  207. /// <summary>
  208. /// Gets the ADS name of AcDbPointCloudEx which the item belongs to
  209. /// </summary>
  210. /// <returns>ADS name</returns>
  211. /// <remarks>default value of ADS name is set to 0 in default constructor</remarks>
  212. const ads_name& adsName() const;
  213. /// <summary>
  214. /// Sets the type of the item.
  215. /// </summary>
  216. /// <param name="val">type of the item.</param>
  217. void setItemType(AcPointCloudItemType val);
  218. /// <summary>
  219. /// Gets the type of the item.
  220. /// </summary>
  221. /// <returns>type of the item.</returns>
  222. /// <remarks>default value of item type is set to kPointCloudProject in default constructor</remarks>
  223. AcPointCloudItemType itemType() const;
  224. private:
  225. void copyItem(const AcPointCloudItem& other);
  226. private:
  227. // data fields
  228. AcString m_name;
  229. AcString m_projectName;
  230. AcString m_guid;
  231. int m_id;
  232. bool m_visibility;
  233. bool m_highlight;
  234. ads_name m_adsName;
  235. float m_red;
  236. float m_green;
  237. float m_blue;
  238. AcPointCloudItemType m_itemType;
  239. };