HWindow.h 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  1. /***********************************************************
  2. * File generated by the HALCON-Compiler hcomp version 22.05
  3. * Usage: Interface to C++
  4. *
  5. * Software by: MVTec Software GmbH, www.mvtec.com
  6. ***********************************************************/
  7. #ifndef HCPP_HWINDOW
  8. #define HCPP_HWINDOW
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of a HALCON window.
  12. class LIntExport HWindow : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HWindow():HHandle() {}
  17. // Copy constructor
  18. HWindow(const HWindow& source) : HHandle(source) {}
  19. // Copy constructor
  20. HWindow(const HHandle& handle);
  21. // Create HWindow from handle, taking ownership
  22. explicit HWindow(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 ('window')!
  33. virtual void AssertType(Hphandle handle) const;
  34. public:
  35. /*****************************************************************************
  36. * Operator-based class constructors
  37. *****************************************************************************/
  38. // open_window: Open a graphics window.
  39. explicit HWindow(Hlong Row, Hlong Column, Hlong Width, Hlong Height, const HTuple& FatherWindow, const HString& Mode, const HString& Machine);
  40. // open_window: Open a graphics window.
  41. explicit HWindow(Hlong Row, Hlong Column, Hlong Width, Hlong Height, void* FatherWindow, const HString& Mode, const HString& Machine);
  42. // open_window: Open a graphics window.
  43. explicit HWindow(Hlong Row, Hlong Column, Hlong Width, Hlong Height, void* FatherWindow, const char* Mode, const char* Machine);
  44. #ifdef _WIN32
  45. // open_window: Open a graphics window.
  46. explicit HWindow(Hlong Row, Hlong Column, Hlong Width, Hlong Height, void* FatherWindow, const wchar_t* Mode, const wchar_t* Machine);
  47. #endif
  48. /*****************************************************************************
  49. * Non-generic convenience members *
  50. *****************************************************************************/
  51. // open_window: Open a graphics window.
  52. HWindow(Hlong Row, Hlong Column, Hlong Width, Hlong Height);
  53. // Click: Wait until mouse click in window occurs
  54. void Click() const;
  55. /***************************************************************************
  56. * Operators *
  57. ***************************************************************************/
  58. // Display an XLD object.
  59. void DispXld(const HXLD& XLDObject) const;
  60. // Gets a copy of the background image of the HALCON window.
  61. HImage GetWindowBackgroundImage() const;
  62. // Detach the background image from a HALCON window.
  63. void DetachBackgroundFromWindow() const;
  64. // Attach a background image to a HALCON window.
  65. void AttachBackgroundToWindow(const HImage& Image) const;
  66. // Detach an existing drawing object from a HALCON window.
  67. void DetachDrawingObjectFromWindow(const HDrawingObject& DrawHandle) const;
  68. // Attach an existing drawing object to a HALCON window.
  69. void AttachDrawingObjectToWindow(const HDrawingObject& DrawHandle) const;
  70. // Modify the pose of a 3D plot.
  71. void UpdateWindowPose(const HTuple& LastRow, const HTuple& LastCol, const HTuple& CurrentRow, const HTuple& CurrentCol, const HString& Mode) const;
  72. // Modify the pose of a 3D plot.
  73. void UpdateWindowPose(double LastRow, double LastCol, double CurrentRow, double CurrentCol, const HString& Mode) const;
  74. // Modify the pose of a 3D plot.
  75. void UpdateWindowPose(double LastRow, double LastCol, double CurrentRow, double CurrentCol, const char* Mode) const;
  76. #ifdef _WIN32
  77. // Modify the pose of a 3D plot.
  78. void UpdateWindowPose(double LastRow, double LastCol, double CurrentRow, double CurrentCol, const wchar_t* Mode) const;
  79. #endif
  80. // Calculates image coordinates for a point in a 3D plot window.
  81. void UnprojectCoordinates(const HImage& Image, const HTuple& Row, const HTuple& Column, Hlong* ImageRow, Hlong* ImageColumn, HTuple* Height) const;
  82. // Calculates image coordinates for a point in a 3D plot window.
  83. void UnprojectCoordinates(const HImage& Image, double Row, double Column, Hlong* ImageRow, Hlong* ImageColumn, Hlong* Height) const;
  84. // Get the operating system window handle.
  85. void* GetOsWindowHandle(void** OSDisplayHandle) const;
  86. // Set the device context of a virtual graphics window (Windows NT).
  87. void SetWindowDc(void* WINHDC) const;
  88. // Create a virtual graphics window under Windows.
  89. void NewExternWindow(void* WINHWnd, Hlong Row, Hlong Column, Hlong Width, Hlong Height);
  90. // Interactive output from two window buffers.
  91. void SlideImage(const HWindow& WindowHandleSource2, const HWindow& WindowHandle) const;
  92. // Modify position and size of a window.
  93. void SetWindowExtents(Hlong Row, Hlong Column, Hlong Width, Hlong Height) const;
  94. // Open a graphics window.
  95. void OpenWindow(Hlong Row, Hlong Column, Hlong Width, Hlong Height, const HTuple& FatherWindow, const HString& Mode, const HString& Machine);
  96. // Open a graphics window.
  97. void OpenWindow(Hlong Row, Hlong Column, Hlong Width, Hlong Height, void* FatherWindow, const HString& Mode, const HString& Machine);
  98. // Open a graphics window.
  99. void OpenWindow(Hlong Row, Hlong Column, Hlong Width, Hlong Height, void* FatherWindow, const char* Mode, const char* Machine);
  100. #ifdef _WIN32
  101. // Open a graphics window.
  102. void OpenWindow(Hlong Row, Hlong Column, Hlong Width, Hlong Height, void* FatherWindow, const wchar_t* Mode, const wchar_t* Machine);
  103. #endif
  104. // Open a textual window.
  105. void OpenTextwindow(Hlong Row, Hlong Column, Hlong Width, Hlong Height, Hlong BorderWidth, const HString& BorderColor, const HString& BackgroundColor, const HTuple& FatherWindow, const HString& Mode, const HString& Machine);
  106. // Open a textual window.
  107. void OpenTextwindow(Hlong Row, Hlong Column, Hlong Width, Hlong Height, Hlong BorderWidth, const HString& BorderColor, const HString& BackgroundColor, void* FatherWindow, const HString& Mode, const HString& Machine);
  108. // Open a textual window.
  109. void OpenTextwindow(Hlong Row, Hlong Column, Hlong Width, Hlong Height, Hlong BorderWidth, const char* BorderColor, const char* BackgroundColor, void* FatherWindow, const char* Mode, const char* Machine);
  110. #ifdef _WIN32
  111. // Open a textual window.
  112. void OpenTextwindow(Hlong Row, Hlong Column, Hlong Width, Hlong Height, Hlong BorderWidth, const wchar_t* BorderColor, const wchar_t* BackgroundColor, void* FatherWindow, const wchar_t* Mode, const wchar_t* Machine);
  113. #endif
  114. // Copy inside an output window.
  115. void MoveRectangle(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, const HTuple& DestRow, const HTuple& DestColumn) const;
  116. // Copy inside an output window.
  117. void MoveRectangle(Hlong Row1, Hlong Column1, Hlong Row2, Hlong Column2, Hlong DestRow, Hlong DestColumn) const;
  118. // Get the window type.
  119. HString GetWindowType() const;
  120. // Access to a window's pixel data.
  121. void GetWindowPointer3(Hlong* ImageRed, Hlong* ImageGreen, Hlong* ImageBlue, Hlong* Width, Hlong* Height) const;
  122. // Information about a window's size and position.
  123. void GetWindowExtents(Hlong* Row, Hlong* Column, Hlong* Width, Hlong* Height) const;
  124. // Write the window content in an image object.
  125. HImage DumpWindowImage() const;
  126. // Write the window content to a file.
  127. void DumpWindow(const HTuple& Device, const HString& FileName) const;
  128. // Write the window content to a file.
  129. void DumpWindow(const HString& Device, const HString& FileName) const;
  130. // Write the window content to a file.
  131. void DumpWindow(const char* Device, const char* FileName) const;
  132. #ifdef _WIN32
  133. // Write the window content to a file.
  134. void DumpWindow(const wchar_t* Device, const wchar_t* FileName) const;
  135. #endif
  136. // Copy all pixels within rectangles between output windows.
  137. void CopyRectangle(const HWindow& WindowHandleDestination, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, const HTuple& DestRow, const HTuple& DestColumn) const;
  138. // Copy all pixels within rectangles between output windows.
  139. void CopyRectangle(const HWindow& WindowHandleDestination, Hlong Row1, Hlong Column1, Hlong Row2, Hlong Column2, Hlong DestRow, Hlong DestColumn) const;
  140. // Close an output window.
  141. static void CloseWindow(const HWindowArray& WindowHandle);
  142. // Close an output window.
  143. void CloseWindow() const;
  144. // Delete the contents of an output window.
  145. void ClearWindow() const;
  146. // Delete a rectangle on the output window.
  147. void ClearRectangle(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2) const;
  148. // Delete a rectangle on the output window.
  149. void ClearRectangle(Hlong Row1, Hlong Column1, Hlong Row2, Hlong Column2) const;
  150. // Print text in a window.
  151. void WriteString(const HTuple& String) const;
  152. // Print text in a window.
  153. void WriteString(const HString& String) const;
  154. // Print text in a window.
  155. void WriteString(const char* String) const;
  156. #ifdef _WIN32
  157. // Print text in a window.
  158. void WriteString(const wchar_t* String) const;
  159. #endif
  160. // Set the shape of the text cursor.
  161. void SetTshape(const HString& TextCursor) const;
  162. // Set the shape of the text cursor.
  163. void SetTshape(const char* TextCursor) const;
  164. #ifdef _WIN32
  165. // Set the shape of the text cursor.
  166. void SetTshape(const wchar_t* TextCursor) const;
  167. #endif
  168. // Set the position of the text cursor.
  169. void SetTposition(Hlong Row, Hlong Column) const;
  170. // Read a string in a text window.
  171. HString ReadString(const HString& InString, Hlong Length) const;
  172. // Read a string in a text window.
  173. HString ReadString(const char* InString, Hlong Length) const;
  174. #ifdef _WIN32
  175. // Read a string in a text window.
  176. HString ReadString(const wchar_t* InString, Hlong Length) const;
  177. #endif
  178. // Read a character from a window.
  179. HString ReadChar(HString* Code) const;
  180. // Set the position of the text cursor to the beginning of the next line.
  181. void NewLine() const;
  182. // Get the shape of the text cursor.
  183. HString GetTshape() const;
  184. // Get cursor position.
  185. void GetTposition(Hlong* Row, Hlong* Column) const;
  186. // Get the maximum size of all characters of a font.
  187. HTuple GetFontExtents(HTuple* MaxDescent, HTuple* MaxWidth, HTuple* MaxHeight) const;
  188. // Get the maximum size of all characters of a font.
  189. Hlong GetFontExtents(Hlong* MaxDescent, Hlong* MaxWidth, Hlong* MaxHeight) const;
  190. // Get the spatial size of a string.
  191. HTuple GetStringExtents(const HTuple& Values, HTuple* Descent, HTuple* Width, HTuple* Height) const;
  192. // Get the spatial size of a string.
  193. Hlong GetStringExtents(const HString& Values, Hlong* Descent, Hlong* Width, Hlong* Height) const;
  194. // Get the spatial size of a string.
  195. Hlong GetStringExtents(const char* Values, Hlong* Descent, Hlong* Width, Hlong* Height) const;
  196. #ifdef _WIN32
  197. // Get the spatial size of a string.
  198. Hlong GetStringExtents(const wchar_t* Values, Hlong* Descent, Hlong* Width, Hlong* Height) const;
  199. #endif
  200. // Query the available fonts.
  201. HTuple QueryFont() const;
  202. // Query all shapes available for text cursors.
  203. HTuple QueryTshape() const;
  204. // Set the font used for text output.
  205. void SetFont(const HString& Font) const;
  206. // Set the font used for text output.
  207. void SetFont(const char* Font) const;
  208. #ifdef _WIN32
  209. // Set the font used for text output.
  210. void SetFont(const wchar_t* Font) const;
  211. #endif
  212. // Get the current font.
  213. HString GetFont() const;
  214. // Get window parameters.
  215. HTuple GetWindowParam(const HString& Param) const;
  216. // Get window parameters.
  217. HTuple GetWindowParam(const char* Param) const;
  218. #ifdef _WIN32
  219. // Get window parameters.
  220. HTuple GetWindowParam(const wchar_t* Param) const;
  221. #endif
  222. // Set window parameters.
  223. void SetWindowParam(const HString& Param, const HTuple& Value) const;
  224. // Set window parameters.
  225. void SetWindowParam(const HString& Param, const HString& Value) const;
  226. // Set window parameters.
  227. void SetWindowParam(const char* Param, const char* Value) const;
  228. #ifdef _WIN32
  229. // Set window parameters.
  230. void SetWindowParam(const wchar_t* Param, const wchar_t* Value) const;
  231. #endif
  232. // Define the region output shape.
  233. void SetShape(const HString& Shape) const;
  234. // Define the region output shape.
  235. void SetShape(const char* Shape) const;
  236. #ifdef _WIN32
  237. // Define the region output shape.
  238. void SetShape(const wchar_t* Shape) const;
  239. #endif
  240. // Set the color definition via RGB values.
  241. void SetRgb(const HTuple& Red, const HTuple& Green, const HTuple& Blue) const;
  242. // Set the color definition via RGB values.
  243. void SetRgb(Hlong Red, Hlong Green, Hlong Blue) const;
  244. // Define a color lookup table index.
  245. void SetPixel(const HTuple& Pixel) const;
  246. // Define a color lookup table index.
  247. void SetPixel(Hlong Pixel) const;
  248. // Define an interpolation method for gray value output.
  249. void SetPartStyle(Hlong Style) const;
  250. // Modify the displayed image part.
  251. void SetPart(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2) const;
  252. // Modify the displayed image part.
  253. void SetPart(Hlong Row1, Hlong Column1, Hlong Row2, Hlong Column2) const;
  254. // Define the gray value output mode.
  255. void SetPaint(const HTuple& Mode) const;
  256. // Define the line width for region contour output.
  257. void SetLineWidth(double Width) const;
  258. // Define a contour output pattern.
  259. void SetLineStyle(const HTuple& Style) const;
  260. // Define the approximation error for contour display.
  261. void SetLineApprox(Hlong Approximation) const;
  262. // Define the pixel output function.
  263. void SetInsert(const HString& Mode) const;
  264. // Define the pixel output function.
  265. void SetInsert(const char* Mode) const;
  266. #ifdef _WIN32
  267. // Define the pixel output function.
  268. void SetInsert(const wchar_t* Mode) const;
  269. #endif
  270. // Define output colors (HSI-coded).
  271. void SetHsi(const HTuple& Hue, const HTuple& Saturation, const HTuple& Intensity) const;
  272. // Define output colors (HSI-coded).
  273. void SetHsi(Hlong Hue, Hlong Saturation, Hlong Intensity) const;
  274. // Define gray values for region output.
  275. void SetGray(const HTuple& GrayValues) const;
  276. // Define gray values for region output.
  277. void SetGray(Hlong GrayValues) const;
  278. // Define the region fill mode.
  279. void SetDraw(const HString& Mode) const;
  280. // Define the region fill mode.
  281. void SetDraw(const char* Mode) const;
  282. #ifdef _WIN32
  283. // Define the region fill mode.
  284. void SetDraw(const wchar_t* Mode) const;
  285. #endif
  286. // Define the image matrix output clipping.
  287. void SetComprise(const HString& Mode) const;
  288. // Define the image matrix output clipping.
  289. void SetComprise(const char* Mode) const;
  290. #ifdef _WIN32
  291. // Define the image matrix output clipping.
  292. void SetComprise(const wchar_t* Mode) const;
  293. #endif
  294. // Set multiple output colors.
  295. void SetColored(Hlong NumberOfColors) const;
  296. // Set output color.
  297. void SetColor(const HTuple& Color) const;
  298. // Set output color.
  299. void SetColor(const HString& Color) const;
  300. // Set output color.
  301. void SetColor(const char* Color) const;
  302. #ifdef _WIN32
  303. // Set output color.
  304. void SetColor(const wchar_t* Color) const;
  305. #endif
  306. // Get the current region output shape.
  307. HString GetShape() const;
  308. // Get the current color in RGB-coding.
  309. void GetRgb(HTuple* Red, HTuple* Green, HTuple* Blue) const;
  310. // Get the current color lookup table index.
  311. HTuple GetPixel() const;
  312. // Get the current interpolation mode for gray value display.
  313. Hlong GetPartStyle() const;
  314. // Get the image part.
  315. void GetPart(HTuple* Row1, HTuple* Column1, HTuple* Row2, HTuple* Column2) const;
  316. // Get the image part.
  317. void GetPart(Hlong* Row1, Hlong* Column1, Hlong* Row2, Hlong* Column2) const;
  318. // Get the current display mode for gray values.
  319. HTuple GetPaint() const;
  320. // Get the current line width for contour display.
  321. double GetLineWidth() const;
  322. // Get the current graphic mode for contours.
  323. HTuple GetLineStyle() const;
  324. // Get the current approximation error for contour display.
  325. Hlong GetLineApprox() const;
  326. // Get the current display mode.
  327. HString GetInsert() const;
  328. // Get the HSI coding of the current color.
  329. HTuple GetHsi(HTuple* Saturation, HTuple* Intensity) const;
  330. // Get the current region fill mode.
  331. HString GetDraw() const;
  332. // Query the gray value display modes.
  333. HTuple QueryPaint() const;
  334. // Query the possible graphic modes.
  335. HTuple QueryInsert() const;
  336. // Query the displayable gray values.
  337. HTuple QueryGray() const;
  338. // Query all color names.
  339. HTuple QueryAllColors() const;
  340. // Query all color names displayable in the window.
  341. HTuple QueryColor() const;
  342. // Query the icon for region output
  343. HRegion GetIcon() const;
  344. // Icon definition for region output.
  345. void SetIcon(const HRegion& Icon) const;
  346. // Displays regions in a window.
  347. void DispRegion(const HRegion& DispRegions) const;
  348. // Displays arbitrarily oriented rectangles.
  349. void DispRectangle2(const HTuple& CenterRow, const HTuple& CenterCol, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2) const;
  350. // Displays arbitrarily oriented rectangles.
  351. void DispRectangle2(double CenterRow, double CenterCol, double Phi, double Length1, double Length2) const;
  352. // Display of rectangles aligned to the coordinate axes.
  353. void DispRectangle1(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2) const;
  354. // Display of rectangles aligned to the coordinate axes.
  355. void DispRectangle1(double Row1, double Column1, double Row2, double Column2) const;
  356. // Displays a polyline.
  357. void DispPolygon(const HTuple& Row, const HTuple& Column) const;
  358. // Draws lines in a window.
  359. void DispLine(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2) const;
  360. // Draws lines in a window.
  361. void DispLine(double Row1, double Column1, double Row2, double Column2) const;
  362. // Displays crosses in a window.
  363. void DispCross(const HTuple& Row, const HTuple& Column, double Size, double Angle) const;
  364. // Displays crosses in a window.
  365. void DispCross(double Row, double Column, double Size, double Angle) const;
  366. // Displays gray value images.
  367. void DispImage(const HImage& Image) const;
  368. // Displays images with several channels.
  369. void DispChannel(const HImage& MultichannelImage, const HTuple& Channel) const;
  370. // Displays images with several channels.
  371. void DispChannel(const HImage& MultichannelImage, Hlong Channel) const;
  372. // Displays a color (RGB) image
  373. void DispColor(const HImage& ColorImage) const;
  374. // Displays ellipses.
  375. void DispEllipse(const HTuple& CenterRow, const HTuple& CenterCol, const HTuple& Phi, const HTuple& Radius1, const HTuple& Radius2) const;
  376. // Displays ellipses.
  377. void DispEllipse(Hlong CenterRow, Hlong CenterCol, double Phi, double Radius1, double Radius2) const;
  378. // Displays a noise distribution.
  379. void DispDistribution(const HTuple& Distribution, Hlong Row, Hlong Column, Hlong Scale) const;
  380. // Displays circles in a window.
  381. void DispCircle(const HTuple& Row, const HTuple& Column, const HTuple& Radius) const;
  382. // Displays circles in a window.
  383. void DispCircle(double Row, double Column, double Radius) const;
  384. // Displays arrows in a window.
  385. void DispArrow(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, const HTuple& Size) const;
  386. // Displays arrows in a window.
  387. void DispArrow(double Row1, double Column1, double Row2, double Column2, double Size) const;
  388. // Displays circular arcs in a window.
  389. void DispArc(const HTuple& CenterRow, const HTuple& CenterCol, const HTuple& Angle, const HTuple& BeginRow, const HTuple& BeginCol) const;
  390. // Displays circular arcs in a window.
  391. void DispArc(double CenterRow, double CenterCol, double Angle, Hlong BeginRow, Hlong BeginCol) const;
  392. // Displays image objects (image, region, XLD).
  393. void DispObj(const HObject& Object) const;
  394. // Set the current mouse pointer shape.
  395. void SetMshape(const HString& Cursor) const;
  396. // Set the current mouse pointer shape.
  397. void SetMshape(const char* Cursor) const;
  398. #ifdef _WIN32
  399. // Set the current mouse pointer shape.
  400. void SetMshape(const wchar_t* Cursor) const;
  401. #endif
  402. // Query the current mouse pointer shape.
  403. HString GetMshape() const;
  404. // Query all available mouse pointer shapes.
  405. HTuple QueryMshape() const;
  406. // Query the subpixel mouse position.
  407. void GetMpositionSubPix(double* Row, double* Column, Hlong* Button) const;
  408. // Query the mouse position.
  409. void GetMposition(Hlong* Row, Hlong* Column, Hlong* Button) const;
  410. // Wait until a mouse button is pressed and get the subpixel mouse position.
  411. void GetMbuttonSubPix(double* Row, double* Column, Hlong* Button) const;
  412. // Wait until a mouse button is pressed.
  413. void GetMbutton(Hlong* Row, Hlong* Column, Hlong* Button) const;
  414. // Write look-up-table (lut) as file.
  415. void WriteLut(const HString& FileName) const;
  416. // Write look-up-table (lut) as file.
  417. void WriteLut(const char* FileName) const;
  418. #ifdef _WIN32
  419. // Write look-up-table (lut) as file.
  420. void WriteLut(const wchar_t* FileName) const;
  421. #endif
  422. // Graphical view of the look-up-table (lut).
  423. void DispLut(Hlong Row, Hlong Column, Hlong Scale) const;
  424. // Query all available look-up-tables (lut).
  425. HTuple QueryLut() const;
  426. // Get modification parameters of look-up-table (lut).
  427. double GetLutStyle(double* Saturation, double* Intensity) const;
  428. // Changing the look-up-table (lut).
  429. void SetLutStyle(double Hue, double Saturation, double Intensity) const;
  430. // Get current look-up-table (lut).
  431. HTuple GetLut() const;
  432. // Set "`look-up-table"' (lut).
  433. void SetLut(const HTuple& LookUpTable) const;
  434. // Set "`look-up-table"' (lut).
  435. void SetLut(const HString& LookUpTable) const;
  436. // Set "`look-up-table"' (lut).
  437. void SetLut(const char* LookUpTable) const;
  438. #ifdef _WIN32
  439. // Set "`look-up-table"' (lut).
  440. void SetLut(const wchar_t* LookUpTable) const;
  441. #endif
  442. // Get mode of fixing of current look-up-table (lut).
  443. HString GetFix() const;
  444. // Set fixing of "`look-up-table"' (lut)
  445. void SetFix(const HString& Mode) const;
  446. // Set fixing of "`look-up-table"' (lut)
  447. void SetFix(const char* Mode) const;
  448. #ifdef _WIN32
  449. // Set fixing of "`look-up-table"' (lut)
  450. void SetFix(const wchar_t* Mode) const;
  451. #endif
  452. // Get fixing of "`look-up-table"' (lut) for "`real color images"'
  453. HString GetFixedLut() const;
  454. // Fix "`look-up-table"' (lut) for "`real color images"'.
  455. void SetFixedLut(const HString& Mode) const;
  456. // Fix "`look-up-table"' (lut) for "`real color images"'.
  457. void SetFixedLut(const char* Mode) const;
  458. #ifdef _WIN32
  459. // Fix "`look-up-table"' (lut) for "`real color images"'.
  460. void SetFixedLut(const wchar_t* Mode) const;
  461. #endif
  462. // Interactive movement of a region with restriction of positions.
  463. HRegion DragRegion3(const HRegion& SourceRegion, const HRegion& MaskRegion, Hlong Row, Hlong Column) const;
  464. // Interactive movement of a region with fixpoint specification.
  465. HRegion DragRegion2(const HRegion& SourceRegion, Hlong Row, Hlong Column) const;
  466. // Interactive moving of a region.
  467. HRegion DragRegion1(const HRegion& SourceRegion) const;
  468. // Interactive modification of a NURBS curve using interpolation.
  469. HXLDCont DrawNurbsInterpMod(const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, const HString& Edit, Hlong Degree, const HTuple& RowsIn, const HTuple& ColsIn, const HTuple& TangentsIn, HTuple* ControlRows, HTuple* ControlCols, HTuple* Knots, HTuple* Rows, HTuple* Cols, HTuple* Tangents) const;
  470. // Interactive modification of a NURBS curve using interpolation.
  471. HXLDCont DrawNurbsInterpMod(const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, const char* Edit, Hlong Degree, const HTuple& RowsIn, const HTuple& ColsIn, const HTuple& TangentsIn, HTuple* ControlRows, HTuple* ControlCols, HTuple* Knots, HTuple* Rows, HTuple* Cols, HTuple* Tangents) const;
  472. #ifdef _WIN32
  473. // Interactive modification of a NURBS curve using interpolation.
  474. HXLDCont DrawNurbsInterpMod(const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, const wchar_t* Edit, Hlong Degree, const HTuple& RowsIn, const HTuple& ColsIn, const HTuple& TangentsIn, HTuple* ControlRows, HTuple* ControlCols, HTuple* Knots, HTuple* Rows, HTuple* Cols, HTuple* Tangents) const;
  475. #endif
  476. // Interactive drawing of a NURBS curve using interpolation.
  477. HXLDCont DrawNurbsInterp(const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, Hlong Degree, HTuple* ControlRows, HTuple* ControlCols, HTuple* Knots, HTuple* Rows, HTuple* Cols, HTuple* Tangents) const;
  478. // Interactive drawing of a NURBS curve using interpolation.
  479. HXLDCont DrawNurbsInterp(const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, Hlong Degree, HTuple* ControlRows, HTuple* ControlCols, HTuple* Knots, HTuple* Rows, HTuple* Cols, HTuple* Tangents) const;
  480. #ifdef _WIN32
  481. // Interactive drawing of a NURBS curve using interpolation.
  482. HXLDCont DrawNurbsInterp(const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, Hlong Degree, HTuple* ControlRows, HTuple* ControlCols, HTuple* Knots, HTuple* Rows, HTuple* Cols, HTuple* Tangents) const;
  483. #endif
  484. // Interactive modification of a NURBS curve.
  485. HXLDCont DrawNurbsMod(const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, const HString& Edit, Hlong Degree, const HTuple& RowsIn, const HTuple& ColsIn, const HTuple& WeightsIn, HTuple* Rows, HTuple* Cols, HTuple* Weights) const;
  486. // Interactive modification of a NURBS curve.
  487. HXLDCont DrawNurbsMod(const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, const char* Edit, Hlong Degree, const HTuple& RowsIn, const HTuple& ColsIn, const HTuple& WeightsIn, HTuple* Rows, HTuple* Cols, HTuple* Weights) const;
  488. #ifdef _WIN32
  489. // Interactive modification of a NURBS curve.
  490. HXLDCont DrawNurbsMod(const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, const wchar_t* Edit, Hlong Degree, const HTuple& RowsIn, const HTuple& ColsIn, const HTuple& WeightsIn, HTuple* Rows, HTuple* Cols, HTuple* Weights) const;
  491. #endif
  492. // Interactive drawing of a NURBS curve.
  493. HXLDCont DrawNurbs(const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights) const;
  494. // Interactive drawing of a NURBS curve.
  495. HXLDCont DrawNurbs(const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights) const;
  496. #ifdef _WIN32
  497. // Interactive drawing of a NURBS curve.
  498. HXLDCont DrawNurbs(const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, Hlong Degree, HTuple* Rows, HTuple* Cols, HTuple* Weights) const;
  499. #endif
  500. // Interactive modification of a contour.
  501. HXLDCont DrawXldMod(const HXLDCont& ContIn, const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio, const HString& Edit) const;
  502. // Interactive modification of a contour.
  503. HXLDCont DrawXldMod(const HXLDCont& ContIn, const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio, const char* Edit) const;
  504. #ifdef _WIN32
  505. // Interactive modification of a contour.
  506. HXLDCont DrawXldMod(const HXLDCont& ContIn, const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio, const wchar_t* Edit) const;
  507. #endif
  508. // Interactive drawing of a contour.
  509. HXLDCont DrawXld(const HString& Rotate, const HString& Move, const HString& Scale, const HString& KeepRatio) const;
  510. // Interactive drawing of a contour.
  511. HXLDCont DrawXld(const char* Rotate, const char* Move, const char* Scale, const char* KeepRatio) const;
  512. #ifdef _WIN32
  513. // Interactive drawing of a contour.
  514. HXLDCont DrawXld(const wchar_t* Rotate, const wchar_t* Move, const wchar_t* Scale, const wchar_t* KeepRatio) const;
  515. #endif
  516. // Interactive drawing of any orientated rectangle.
  517. void DrawRectangle2Mod(double RowIn, double ColumnIn, double PhiIn, double Length1In, double Length2In, double* Row, double* Column, double* Phi, double* Length1, double* Length2) const;
  518. // Interactive drawing of any orientated rectangle.
  519. void DrawRectangle2(double* Row, double* Column, double* Phi, double* Length1, double* Length2) const;
  520. // Draw a rectangle parallel to the coordinate axis.
  521. void DrawRectangle1Mod(double Row1In, double Column1In, double Row2In, double Column2In, double* Row1, double* Column1, double* Row2, double* Column2) const;
  522. // Draw a rectangle parallel to the coordinate axis.
  523. void DrawRectangle1(double* Row1, double* Column1, double* Row2, double* Column2) const;
  524. // Draw a point.
  525. void DrawPointMod(double RowIn, double ColumnIn, double* Row, double* Column) const;
  526. // Draw a point.
  527. void DrawPoint(double* Row, double* Column) const;
  528. // Draw a line.
  529. void DrawLineMod(double Row1In, double Column1In, double Row2In, double Column2In, double* Row1, double* Column1, double* Row2, double* Column2) const;
  530. // Draw a line.
  531. void DrawLine(double* Row1, double* Column1, double* Row2, double* Column2) const;
  532. // Interactive drawing of an ellipse.
  533. void DrawEllipseMod(double RowIn, double ColumnIn, double PhiIn, double Radius1In, double Radius2In, double* Row, double* Column, double* Phi, double* Radius1, double* Radius2) const;
  534. // Interactive drawing of an ellipse.
  535. void DrawEllipse(double* Row, double* Column, double* Phi, double* Radius1, double* Radius2) const;
  536. // Interactive drawing of a circle.
  537. void DrawCircleMod(double RowIn, double ColumnIn, double RadiusIn, double* Row, double* Column, double* Radius) const;
  538. // Interactive drawing of a circle.
  539. void DrawCircle(double* Row, double* Column, double* Radius) const;
  540. // Interactive drawing of a closed region.
  541. HRegion DrawRegion() const;
  542. // Interactive drawing of a polygon row.
  543. HRegion DrawPolygon() const;
  544. // Project and visualize the 3D model of the calibration plate in the image.
  545. void DispCaltab(const HString& CalPlateDescr, const HCamPar& CameraParam, const HPose& CalPlatePose, double ScaleFac) const;
  546. // Project and visualize the 3D model of the calibration plate in the image.
  547. void DispCaltab(const char* CalPlateDescr, const HCamPar& CameraParam, const HPose& CalPlatePose, double ScaleFac) const;
  548. #ifdef _WIN32
  549. // Project and visualize the 3D model of the calibration plate in the image.
  550. void DispCaltab(const wchar_t* CalPlateDescr, const HCamPar& CameraParam, const HPose& CalPlatePose, double ScaleFac) const;
  551. #endif
  552. // Convert image coordinates to window coordinates
  553. void ConvertCoordinatesImageToWindow(const HTuple& RowImage, const HTuple& ColumnImage, HTuple* RowWindow, HTuple* ColumnWindow) const;
  554. // Convert image coordinates to window coordinates
  555. void ConvertCoordinatesImageToWindow(double RowImage, double ColumnImage, double* RowWindow, double* ColumnWindow) const;
  556. // Convert window coordinates to image coordinates
  557. void ConvertCoordinatesWindowToImage(const HTuple& RowWindow, const HTuple& ColumnWindow, HTuple* RowImage, HTuple* ColumnImage) const;
  558. // Convert window coordinates to image coordinates
  559. void ConvertCoordinatesWindowToImage(double RowWindow, double ColumnWindow, double* RowImage, double* ColumnImage) const;
  560. // Display text in a window.
  561. void DispText(const HTuple& String, const HString& CoordSystem, const HTuple& Row, const HTuple& Column, const HTuple& Color, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  562. // Display text in a window.
  563. void DispText(const HString& String, const HString& CoordSystem, Hlong Row, Hlong Column, const HString& Color, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  564. // Display text in a window.
  565. void DispText(const char* String, const char* CoordSystem, Hlong Row, Hlong Column, const char* Color, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  566. #ifdef _WIN32
  567. // Display text in a window.
  568. void DispText(const wchar_t* String, const wchar_t* CoordSystem, Hlong Row, Hlong Column, const wchar_t* Color, const HTuple& GenParamName, const HTuple& GenParamValue) const;
  569. #endif
  570. // Flush the contents of a window.
  571. void FlushBuffer() const;
  572. // Get the current color in RGBA-coding.
  573. void GetRgba(HTuple* Red, HTuple* Green, HTuple* Blue, HTuple* Alpha) const;
  574. // Send an event to a buffer window signaling a mouse double click event.
  575. HString SendMouseDoubleClickEvent(const HTuple& Row, const HTuple& Column, Hlong Button) const;
  576. // Send an event to a buffer window signaling a mouse double click event.
  577. HString SendMouseDoubleClickEvent(Hlong Row, Hlong Column, Hlong Button) const;
  578. // Send an event to a window buffer signaling a mouse down event.
  579. HString SendMouseDownEvent(const HTuple& Row, const HTuple& Column, Hlong Button) const;
  580. // Send an event to a window buffer signaling a mouse down event.
  581. HString SendMouseDownEvent(Hlong Row, Hlong Column, Hlong Button) const;
  582. // Send an event to a buffer window signaling a mouse drag event.
  583. HString SendMouseDragEvent(const HTuple& Row, const HTuple& Column, Hlong Button) const;
  584. // Send an event to a buffer window signaling a mouse drag event.
  585. HString SendMouseDragEvent(Hlong Row, Hlong Column, Hlong Button) const;
  586. // Send an event to a buffer window signaling a mouse up event.
  587. HString SendMouseUpEvent(const HTuple& Row, const HTuple& Column, Hlong Button) const;
  588. // Send an event to a buffer window signaling a mouse up event.
  589. HString SendMouseUpEvent(Hlong Row, Hlong Column, Hlong Button) const;
  590. // Sets the callback for content updates in buffer window.
  591. void SetContentUpdateCallback(void* CallbackFunction, const HTuple& CallbackContext) const;
  592. // Sets the callback for content updates in buffer window.
  593. void SetContentUpdateCallback(void* CallbackFunction, void* CallbackContext) const;
  594. // Set the color definition via RGBA values.
  595. void SetRgba(const HTuple& Red, const HTuple& Green, const HTuple& Blue, const HTuple& Alpha) const;
  596. // Set the color definition via RGBA values.
  597. void SetRgba(Hlong Red, Hlong Green, Hlong Blue, Hlong Alpha) const;
  598. // Get the current contour display fill style.
  599. HString GetContourStyle() const;
  600. // Define the contour display fill style.
  601. void SetContourStyle(const HString& Style) const;
  602. // Define the contour display fill style.
  603. void SetContourStyle(const char* Style) const;
  604. #ifdef _WIN32
  605. // Define the contour display fill style.
  606. void SetContourStyle(const wchar_t* Style) const;
  607. #endif
  608. };
  609. // forward declarations and types for internal array implementation
  610. template<class T> class HSmartPtr;
  611. template<class T> class HHandleBaseArrayRef;
  612. typedef HHandleBaseArrayRef<HWindow> HWindowArrayRef;
  613. typedef HSmartPtr< HWindowArrayRef > HWindowArrayPtr;
  614. // Represents multiple tool instances
  615. class LIntExport HWindowArray : public HHandleBaseArray
  616. {
  617. public:
  618. // Create empty array
  619. HWindowArray();
  620. // Create array from native array of tool instances
  621. HWindowArray(const HWindow* classes, Hlong length);
  622. // Copy constructor
  623. HWindowArray(const HWindowArray &tool_array);
  624. // Destructor
  625. virtual ~HWindowArray();
  626. // Assignment operator
  627. HWindowArray &operator=(const HWindowArray &tool_array);
  628. // Clears array and all tool instances
  629. virtual void Clear();
  630. // Get array of native tool instances
  631. const HWindow* Tools() const;
  632. // Get number of tools
  633. virtual Hlong Length() const;
  634. // Create tool array from tuple of handles
  635. virtual void SetFromTuple(const HTuple& handles);
  636. // Get tuple of handles for tool array
  637. virtual HTuple ConvertToTuple() const;
  638. protected:
  639. // Smart pointer to internal data container
  640. HWindowArrayPtr *mArrayPtr;
  641. };
  642. }
  643. #endif