HObject.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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_HOBJECT
  8. #define HCPP_HOBJECT
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of an iconic object(-array). Base class for images, regions and XLDs
  12. class LIntExport HObject : public HObjectBase
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HObject():HObjectBase() {}
  17. // Copy constructor
  18. HObject(const HObject& source) : HObjectBase(source) {}
  19. // Create HObject from object id. For copy=false takes
  20. // over management of input key. Type of key must match!
  21. explicit HObject(Hkey key, bool copy=true);
  22. // Access of object tuple element
  23. const HObject operator [] (Hlong index) const;
  24. // Deep copy of all data represented by this object instance
  25. HObject Clone() const;
  26. /***************************************************************************
  27. * Operators *
  28. ***************************************************************************/
  29. // Calculate the difference of two object tuples.
  30. HObject ObjDiff(const HObject& ObjectsSub) const;
  31. // Convert an "integer number" into an iconic object.
  32. void IntegerToObj(const HTuple& SurrogateTuple);
  33. // Convert an "integer number" into an iconic object.
  34. void IntegerToObj(void* SurrogateTuple);
  35. // Convert an iconic object into an "integer number."
  36. HTuple ObjToInteger(Hlong Index, Hlong Number) const;
  37. // Copy an iconic object in the HALCON database.
  38. HObject CopyObj(Hlong Index, Hlong NumObj) const;
  39. // Concatenate two iconic object tuples.
  40. HObject ConcatObj(const HObject& Objects2) const;
  41. // Select objects from an object tuple.
  42. HObject SelectObj(const HTuple& Index) const;
  43. // Select objects from an object tuple.
  44. HObject SelectObj(Hlong Index) const;
  45. // Compare iconic objects regarding equality.
  46. Hlong CompareObj(const HObject& Objects2, const HTuple& Epsilon) const;
  47. // Compare iconic objects regarding equality.
  48. Hlong CompareObj(const HObject& Objects2, double Epsilon) const;
  49. // Compare image objects regarding equality.
  50. Hlong TestEqualObj(const HObject& Objects2) const;
  51. // Number of objects in a tuple.
  52. Hlong CountObj() const;
  53. // Information about the components of an image object.
  54. HTuple GetChannelInfo(const HString& Request, const HTuple& Channel) const;
  55. // Information about the components of an image object.
  56. HString GetChannelInfo(const HString& Request, Hlong Channel) const;
  57. // Information about the components of an image object.
  58. HString GetChannelInfo(const char* Request, Hlong Channel) const;
  59. #ifdef _WIN32
  60. // Information about the components of an image object.
  61. HString GetChannelInfo(const wchar_t* Request, Hlong Channel) const;
  62. #endif
  63. // Name of the class of an image object.
  64. HTuple GetObjClass() const;
  65. // Create an empty object tuple.
  66. void GenEmptyObj();
  67. // Displays image objects (image, region, XLD).
  68. void DispObj(const HWindow& WindowHandle) const;
  69. // Read an iconic object.
  70. void ReadObject(const HString& FileName);
  71. // Read an iconic object.
  72. void ReadObject(const char* FileName);
  73. #ifdef _WIN32
  74. // Read an iconic object.
  75. void ReadObject(const wchar_t* FileName);
  76. #endif
  77. // Write an iconic object.
  78. void WriteObject(const HString& FileName) const;
  79. // Write an iconic object.
  80. void WriteObject(const char* FileName) const;
  81. #ifdef _WIN32
  82. // Write an iconic object.
  83. void WriteObject(const wchar_t* FileName) const;
  84. #endif
  85. // Deserialize a serialized iconic object.
  86. void DeserializeObject(const HSerializedItem& SerializedItemHandle);
  87. // Serialize an iconic object.
  88. HSerializedItem SerializeObject() const;
  89. // Insert objects into an iconic object tuple.
  90. HObject InsertObj(const HObject& ObjectsInsert, Hlong Index) const;
  91. // Remove objects from an iconic object tuple.
  92. HObject RemoveObj(const HTuple& Index) const;
  93. // Remove objects from an iconic object tuple.
  94. HObject RemoveObj(Hlong Index) const;
  95. // Replaces one or more elements of an iconic object tuple.
  96. HObject ReplaceObj(const HObject& ObjectsReplace, const HTuple& Index) const;
  97. // Replaces one or more elements of an iconic object tuple.
  98. HObject ReplaceObj(const HObject& ObjectsReplace, Hlong Index) const;
  99. private:
  100. // Verify matching semantic type ('object')!
  101. void AssertObjectClass();
  102. };
  103. }
  104. #endif