HDeformableSurfaceModel.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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_HDEFORMABLESURFACEMODEL
  8. #define HCPP_HDEFORMABLESURFACEMODEL
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of a deformable surface model.
  12. class LIntExport HDeformableSurfaceModel : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HDeformableSurfaceModel():HHandle() {}
  17. // Copy constructor
  18. HDeformableSurfaceModel(const HDeformableSurfaceModel& source) : HHandle(source) {}
  19. // Copy constructor
  20. HDeformableSurfaceModel(const HHandle& handle);
  21. // Create HDeformableSurfaceModel from handle, taking ownership
  22. explicit HDeformableSurfaceModel(Hlong handle);
  23. bool operator==(const HHandle& obj) const
  24. {
  25. return HHandleBase::operator==(obj);
  26. }
  27. bool operator!=(const HHandle& obj) const
  28. {
  29. return HHandleBase::operator!=(obj);
  30. }
  31. protected:
  32. // Verify matching semantic type ('deformable_surface_model')!
  33. virtual void AssertType(Hphandle handle) const;
  34. public:
  35. // Deep copy of all data represented by this object instance
  36. HDeformableSurfaceModel Clone() const;
  37. /*****************************************************************************
  38. * Operator-based class constructors
  39. *****************************************************************************/
  40. // read_deformable_surface_model: Read a deformable surface model from a file.
  41. explicit HDeformableSurfaceModel(const HString& FileName);
  42. // read_deformable_surface_model: Read a deformable surface model from a file.
  43. explicit HDeformableSurfaceModel(const char* FileName);
  44. #ifdef _WIN32
  45. // read_deformable_surface_model: Read a deformable surface model from a file.
  46. explicit HDeformableSurfaceModel(const wchar_t* FileName);
  47. #endif
  48. // create_deformable_surface_model: Create the data structure needed to perform deformable surface-based matching.
  49. explicit HDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HTuple& GenParamName, const HTuple& GenParamValue);
  50. // create_deformable_surface_model: Create the data structure needed to perform deformable surface-based matching.
  51. explicit HDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HString& GenParamName, const HString& GenParamValue);
  52. // create_deformable_surface_model: Create the data structure needed to perform deformable surface-based matching.
  53. explicit HDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const char* GenParamName, const char* GenParamValue);
  54. #ifdef _WIN32
  55. // create_deformable_surface_model: Create the data structure needed to perform deformable surface-based matching.
  56. explicit HDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const wchar_t* GenParamName, const wchar_t* GenParamValue);
  57. #endif
  58. /***************************************************************************
  59. * Operators *
  60. ***************************************************************************/
  61. // Free the memory of a deformable surface model.
  62. static void ClearDeformableSurfaceModel(const HDeformableSurfaceModelArray& DeformableSurfaceModel);
  63. // Free the memory of a deformable surface model.
  64. void ClearDeformableSurfaceModel() const;
  65. // Deserialize a deformable surface model.
  66. void DeserializeDeformableSurfaceModel(const HSerializedItem& SerializedItemHandle);
  67. // Serialize a deformable surface_model.
  68. HSerializedItem SerializeDeformableSurfaceModel() const;
  69. // Read a deformable surface model from a file.
  70. void ReadDeformableSurfaceModel(const HString& FileName);
  71. // Read a deformable surface model from a file.
  72. void ReadDeformableSurfaceModel(const char* FileName);
  73. #ifdef _WIN32
  74. // Read a deformable surface model from a file.
  75. void ReadDeformableSurfaceModel(const wchar_t* FileName);
  76. #endif
  77. // Write a deformable surface model to a file.
  78. void WriteDeformableSurfaceModel(const HString& FileName) const;
  79. // Write a deformable surface model to a file.
  80. void WriteDeformableSurfaceModel(const char* FileName) const;
  81. #ifdef _WIN32
  82. // Write a deformable surface model to a file.
  83. void WriteDeformableSurfaceModel(const wchar_t* FileName) const;
  84. #endif
  85. // Refine the position and deformation of a deformable surface model in a 3D scene.
  86. HTuple RefineDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HObjectModel3D& InitialDeformationObjectModel3D, const HTuple& GenParamName, const HTuple& GenParamValue, HDeformableSurfaceMatchingResultArray* DeformableSurfaceMatchingResult) const;
  87. // Refine the position and deformation of a deformable surface model in a 3D scene.
  88. double RefineDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HObjectModel3D& InitialDeformationObjectModel3D, const HString& GenParamName, const HString& GenParamValue, HDeformableSurfaceMatchingResult* DeformableSurfaceMatchingResult) const;
  89. // Refine the position and deformation of a deformable surface model in a 3D scene.
  90. double RefineDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HObjectModel3D& InitialDeformationObjectModel3D, const char* GenParamName, const char* GenParamValue, HDeformableSurfaceMatchingResult* DeformableSurfaceMatchingResult) const;
  91. #ifdef _WIN32
  92. // Refine the position and deformation of a deformable surface model in a 3D scene.
  93. double RefineDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HObjectModel3D& InitialDeformationObjectModel3D, const wchar_t* GenParamName, const wchar_t* GenParamValue, HDeformableSurfaceMatchingResult* DeformableSurfaceMatchingResult) const;
  94. #endif
  95. // Find the best match of a deformable surface model in a 3D scene.
  96. HTuple FindDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HTuple& MinScore, const HTuple& GenParamName, const HTuple& GenParamValue, HDeformableSurfaceMatchingResultArray* DeformableSurfaceMatchingResult) const;
  97. // Find the best match of a deformable surface model in a 3D scene.
  98. double FindDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, double MinScore, const HTuple& GenParamName, const HTuple& GenParamValue, HDeformableSurfaceMatchingResult* DeformableSurfaceMatchingResult) const;
  99. // Return the parameters and properties of a deformable surface model.
  100. HTuple GetDeformableSurfaceModelParam(const HTuple& GenParamName) const;
  101. // Return the parameters and properties of a deformable surface model.
  102. HTuple GetDeformableSurfaceModelParam(const HString& GenParamName) const;
  103. // Return the parameters and properties of a deformable surface model.
  104. HTuple GetDeformableSurfaceModelParam(const char* GenParamName) const;
  105. #ifdef _WIN32
  106. // Return the parameters and properties of a deformable surface model.
  107. HTuple GetDeformableSurfaceModelParam(const wchar_t* GenParamName) const;
  108. #endif
  109. // Add a reference point to a deformable surface model.
  110. HTuple AddDeformableSurfaceModelReferencePoint(const HTuple& ReferencePointX, const HTuple& ReferencePointY, const HTuple& ReferencePointZ) const;
  111. // Add a reference point to a deformable surface model.
  112. Hlong AddDeformableSurfaceModelReferencePoint(double ReferencePointX, double ReferencePointY, double ReferencePointZ) const;
  113. // Add a sample deformation to a deformable surface model
  114. void AddDeformableSurfaceModelSample(const HObjectModel3DArray& ObjectModel3D) const;
  115. // Add a sample deformation to a deformable surface model
  116. void AddDeformableSurfaceModelSample(const HObjectModel3D& ObjectModel3D) const;
  117. // Create the data structure needed to perform deformable surface-based matching.
  118. void CreateDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HTuple& GenParamName, const HTuple& GenParamValue);
  119. // Create the data structure needed to perform deformable surface-based matching.
  120. void CreateDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const HString& GenParamName, const HString& GenParamValue);
  121. // Create the data structure needed to perform deformable surface-based matching.
  122. void CreateDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const char* GenParamName, const char* GenParamValue);
  123. #ifdef _WIN32
  124. // Create the data structure needed to perform deformable surface-based matching.
  125. void CreateDeformableSurfaceModel(const HObjectModel3D& ObjectModel3D, double RelSamplingDistance, const wchar_t* GenParamName, const wchar_t* GenParamValue);
  126. #endif
  127. };
  128. // forward declarations and types for internal array implementation
  129. template<class T> class HSmartPtr;
  130. template<class T> class HHandleBaseArrayRef;
  131. typedef HHandleBaseArrayRef<HDeformableSurfaceModel> HDeformableSurfaceModelArrayRef;
  132. typedef HSmartPtr< HDeformableSurfaceModelArrayRef > HDeformableSurfaceModelArrayPtr;
  133. // Represents multiple tool instances
  134. class LIntExport HDeformableSurfaceModelArray : public HHandleBaseArray
  135. {
  136. public:
  137. // Create empty array
  138. HDeformableSurfaceModelArray();
  139. // Create array from native array of tool instances
  140. HDeformableSurfaceModelArray(HDeformableSurfaceModel* classes, Hlong length);
  141. // Copy constructor
  142. HDeformableSurfaceModelArray(const HDeformableSurfaceModelArray &tool_array);
  143. // Destructor
  144. virtual ~HDeformableSurfaceModelArray();
  145. // Assignment operator
  146. HDeformableSurfaceModelArray &operator=(const HDeformableSurfaceModelArray &tool_array);
  147. // Clears array and all tool instances
  148. virtual void Clear();
  149. // Get array of native tool instances
  150. const HDeformableSurfaceModel* Tools() const;
  151. // Get number of tools
  152. virtual Hlong Length() const;
  153. // Create tool array from tuple of handles
  154. virtual void SetFromTuple(const HTuple& handles);
  155. // Get tuple of handles for tool array
  156. virtual HTuple ConvertToTuple() const;
  157. protected:
  158. // Smart pointer to internal data container
  159. HDeformableSurfaceModelArrayPtr *mArrayPtr;
  160. };
  161. }
  162. #endif