HScene3D.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. /***********************************************************
  2. * File generated by the HALCON-Compiler hcomp version 20.11
  3. * Usage: Interface to C++
  4. *
  5. * Software by: MVTec Software GmbH, www.mvtec.com
  6. ***********************************************************/
  7. #ifndef HCPP_HSCENE3D
  8. #define HCPP_HSCENE3D
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of a 3D graphic scene.
  12. class LIntExport HScene3D : public HHandle
  13. {
  14. public:
  15. // Copy constructor
  16. HScene3D(const HScene3D& source) : HHandle(source) {}
  17. // Copy constructor
  18. HScene3D(const HHandle& handle);
  19. // Create HScene3D from handle, taking ownership
  20. explicit HScene3D(Hlong handle);
  21. bool operator==(const HHandle& obj) const
  22. {
  23. return HHandleBase::operator==(obj);
  24. }
  25. bool operator!=(const HHandle& obj) const
  26. {
  27. return HHandleBase::operator!=(obj);
  28. }
  29. protected:
  30. // Verify matching semantic type ('scene_3d')!
  31. virtual void AssertType(Hphandle handle) const;
  32. public:
  33. /*****************************************************************************
  34. * Operator-based class constructors
  35. *****************************************************************************/
  36. // create_scene_3d: Create the data structure that is needed to visualize collections of 3D objects.
  37. explicit HScene3D();
  38. /***************************************************************************
  39. * Operators *
  40. ***************************************************************************/
  41. // Get the depth or the index of instances in a displayed 3D scene.
  42. HTuple GetDisplayScene3dInfo(const HWindow& WindowHandle, const HTuple& Row, const HTuple& Column, const HTuple& Information) const;
  43. // Get the depth or the index of instances in a displayed 3D scene.
  44. Hlong GetDisplayScene3dInfo(const HWindow& WindowHandle, double Row, double Column, const HString& Information) const;
  45. // Get the depth or the index of instances in a displayed 3D scene.
  46. Hlong GetDisplayScene3dInfo(const HWindow& WindowHandle, double Row, double Column, const char* Information) const;
  47. #ifdef _WIN32
  48. // Get the depth or the index of instances in a displayed 3D scene.
  49. Hlong GetDisplayScene3dInfo(const HWindow& WindowHandle, double Row, double Column, const wchar_t* Information) const;
  50. #endif
  51. // Set the pose of a 3D scene.
  52. void SetScene3dToWorldPose(const HPose& ToWorldPose) const;
  53. // Set parameters of a 3D scene.
  54. void SetScene3dParam(const HString& GenParamName, const HTuple& GenParamValue) const;
  55. // Set parameters of a 3D scene.
  56. void SetScene3dParam(const HString& GenParamName, const HString& GenParamValue) const;
  57. // Set parameters of a 3D scene.
  58. void SetScene3dParam(const char* GenParamName, const char* GenParamValue) const;
  59. #ifdef _WIN32
  60. // Set parameters of a 3D scene.
  61. void SetScene3dParam(const wchar_t* GenParamName, const wchar_t* GenParamValue) const;
  62. #endif
  63. // Set parameters of a light in a 3D scene.
  64. void SetScene3dLightParam(Hlong LightIndex, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  65. // Set parameters of a light in a 3D scene.
  66. void SetScene3dLightParam(Hlong LightIndex, const HString& GenParamName, const HString& GenParamValue) const;
  67. // Set parameters of a light in a 3D scene.
  68. void SetScene3dLightParam(Hlong LightIndex, const char* GenParamName, const char* GenParamValue) const;
  69. #ifdef _WIN32
  70. // Set parameters of a light in a 3D scene.
  71. void SetScene3dLightParam(Hlong LightIndex, const wchar_t* GenParamName, const wchar_t* GenParamValue) const;
  72. #endif
  73. // Set the pose of an instance in a 3D scene.
  74. void SetScene3dInstancePose(const HTuple& InstanceIndex, const HPoseArray& Pose) const;
  75. // Set the pose of an instance in a 3D scene.
  76. void SetScene3dInstancePose(Hlong InstanceIndex, const HPose& Pose) const;
  77. // Set parameters of an instance in a 3D scene.
  78. void SetScene3dInstanceParam(const HTuple& InstanceIndex, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  79. // Set parameters of an instance in a 3D scene.
  80. void SetScene3dInstanceParam(Hlong InstanceIndex, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  81. // Set the pose of a camera in a 3D scene.
  82. void SetScene3dCameraPose(Hlong CameraIndex, const HPose& Pose) const;
  83. // Render an image of a 3D scene.
  84. HImage RenderScene3d(Hlong CameraIndex) const;
  85. // Remove a light from a 3D scene.
  86. void RemoveScene3dLight(Hlong LightIndex) const;
  87. // Remove an object instance from a 3D scene.
  88. void RemoveScene3dInstance(const HTuple& InstanceIndex) const;
  89. // Remove an object instance from a 3D scene.
  90. void RemoveScene3dInstance(Hlong InstanceIndex) const;
  91. // Remove a camera from a 3D scene.
  92. void RemoveScene3dCamera(Hlong CameraIndex) const;
  93. // Display a 3D scene.
  94. void DisplayScene3d(const HWindow& WindowHandle, const HTuple& CameraIndex) const;
  95. // Display a 3D scene.
  96. void DisplayScene3d(const HWindow& WindowHandle, const HString& CameraIndex) const;
  97. // Display a 3D scene.
  98. void DisplayScene3d(const HWindow& WindowHandle, const char* CameraIndex) const;
  99. #ifdef _WIN32
  100. // Display a 3D scene.
  101. void DisplayScene3d(const HWindow& WindowHandle, const wchar_t* CameraIndex) const;
  102. #endif
  103. // Add a light source to a 3D scene.
  104. Hlong AddScene3dLight(const HTuple& LightPosition, const HString& LightKind) const;
  105. // Add a light source to a 3D scene.
  106. Hlong AddScene3dLight(const HTuple& LightPosition, const char* LightKind) const;
  107. #ifdef _WIN32
  108. // Add a light source to a 3D scene.
  109. Hlong AddScene3dLight(const HTuple& LightPosition, const wchar_t* LightKind) const;
  110. #endif
  111. // Add an instance of a 3D object model to a 3D scene.
  112. Hlong AddScene3dInstance(const HObjectModel3DArray& ObjectModel3D, const HPoseArray& Pose) const;
  113. // Add an instance of a 3D object model to a 3D scene.
  114. Hlong AddScene3dInstance(const HObjectModel3D& ObjectModel3D, const HPose& Pose) const;
  115. // Add a camera to a 3D scene.
  116. Hlong AddScene3dCamera(const HCamPar& CameraParam) const;
  117. // Delete a 3D scene and free all allocated memory.
  118. static void ClearScene3d(const HScene3DArray& Scene3D);
  119. // Delete a 3D scene and free all allocated memory.
  120. void ClearScene3d() const;
  121. // Create the data structure that is needed to visualize collections of 3D objects.
  122. void CreateScene3d();
  123. // Add a text label to a 3D scene.
  124. Hlong AddScene3dLabel(const HTuple& Text, const HTuple& ReferencePoint, const HTuple& Position, const HTuple& RelatesTo) const;
  125. // Add a text label to a 3D scene.
  126. Hlong AddScene3dLabel(const HString& Text, const HTuple& ReferencePoint, const HTuple& Position, const HTuple& RelatesTo) const;
  127. // Add a text label to a 3D scene.
  128. Hlong AddScene3dLabel(const char* Text, const HTuple& ReferencePoint, const HTuple& Position, const HTuple& RelatesTo) const;
  129. #ifdef _WIN32
  130. // Add a text label to a 3D scene.
  131. Hlong AddScene3dLabel(const wchar_t* Text, const HTuple& ReferencePoint, const HTuple& Position, const HTuple& RelatesTo) const;
  132. #endif
  133. // Remove a text label from a 3D scene.
  134. void RemoveScene3dLabel(const HTuple& LabelIndex) const;
  135. // Remove a text label from a 3D scene.
  136. void RemoveScene3dLabel(Hlong LabelIndex) const;
  137. // Set parameters of a text label in a 3D scene.
  138. void SetScene3dLabelParam(const HTuple& LabelIndex, const HString& GenParamName, const HTuple& GenParamValue) const;
  139. // Set parameters of a text label in a 3D scene.
  140. void SetScene3dLabelParam(Hlong LabelIndex, const HString& GenParamName, const HTuple& GenParamValue) const;
  141. // Set parameters of a text label in a 3D scene.
  142. void SetScene3dLabelParam(Hlong LabelIndex, const char* GenParamName, const HTuple& GenParamValue) const;
  143. #ifdef _WIN32
  144. // Set parameters of a text label in a 3D scene.
  145. void SetScene3dLabelParam(Hlong LabelIndex, const wchar_t* GenParamName, const HTuple& GenParamValue) const;
  146. #endif
  147. };
  148. // forward declarations and types for internal array implementation
  149. template<class T> class HSmartPtr;
  150. template<class T> class HHandleBaseArrayRef;
  151. typedef HHandleBaseArrayRef<HScene3D> HScene3DArrayRef;
  152. typedef HSmartPtr< HScene3DArrayRef > HScene3DArrayPtr;
  153. // Represents multiple tool instances
  154. class LIntExport HScene3DArray : public HHandleBaseArray
  155. {
  156. public:
  157. // Create empty array
  158. HScene3DArray();
  159. // Create array from native array of tool instances
  160. HScene3DArray(HScene3D* classes, Hlong length);
  161. // Copy constructor
  162. HScene3DArray(const HScene3DArray &tool_array);
  163. // Destructor
  164. virtual ~HScene3DArray();
  165. // Assignment operator
  166. HScene3DArray &operator=(const HScene3DArray &tool_array);
  167. // Clears array and all tool instances
  168. virtual void Clear();
  169. // Get array of native tool instances
  170. const HScene3D* Tools() const;
  171. // Get number of tools
  172. virtual Hlong Length() const;
  173. // Create tool array from tuple of handles
  174. virtual void SetFromTuple(const HTuple& handles);
  175. // Get tuple of handles for tool array
  176. virtual HTuple ConvertToTuple() const;
  177. protected:
  178. // Smart pointer to internal data container
  179. HScene3DArrayPtr *mArrayPtr;
  180. };
  181. }
  182. #endif