Plot2d.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. 
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.UtilsModule;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Runtime.InteropServices;
  7. namespace OpenCVForUnity.PlotModule {
  8. // C++: class Plot2d
  9. //javadoc: Plot2d
  10. public class Plot2d : Algorithm {
  11. protected override void Dispose(bool disposing) {
  12. #if (UNITY_ANDROID && !UNITY_EDITOR)
  13. try {
  14. if (disposing) {
  15. }
  16. if (IsEnabledDispose) {
  17. if (nativeObj != IntPtr.Zero)
  18. plot_Plot2d_delete(nativeObj);
  19. nativeObj = IntPtr.Zero;
  20. }
  21. } finally {
  22. base.Dispose(disposing);
  23. }
  24. #else
  25. return;
  26. #endif
  27. }
  28. protected internal Plot2d(IntPtr addr) : base(addr) { }
  29. // internal usage only
  30. public static new Plot2d __fromPtr__(IntPtr addr) { return new Plot2d(addr); }
  31. //
  32. // C++: static Ptr_Plot2d cv::plot::Plot2d::create(Mat data)
  33. //
  34. //javadoc: Plot2d::create(data)
  35. public static Plot2d create(Mat data) {
  36. if (data != null) data.ThrowIfDisposed();
  37. #if (UNITY_ANDROID && !UNITY_EDITOR)
  38. Plot2d retVal = Plot2d.__fromPtr__(plot_Plot2d_create_10(data.nativeObj));
  39. return retVal;
  40. #else
  41. return null;
  42. #endif
  43. }
  44. //
  45. // C++: static Ptr_Plot2d cv::plot::Plot2d::create(Mat dataX, Mat dataY)
  46. //
  47. //javadoc: Plot2d::create(dataX, dataY)
  48. public static Plot2d create(Mat dataX, Mat dataY) {
  49. if (dataX != null) dataX.ThrowIfDisposed();
  50. if (dataY != null) dataY.ThrowIfDisposed();
  51. #if (UNITY_ANDROID && !UNITY_EDITOR)
  52. Plot2d retVal = Plot2d.__fromPtr__(plot_Plot2d_create_11(dataX.nativeObj, dataY.nativeObj));
  53. return retVal;
  54. #else
  55. return null;
  56. #endif
  57. }
  58. //
  59. // C++: void cv::plot::Plot2d::render(Mat& _plotResult)
  60. //
  61. //javadoc: Plot2d::render(_plotResult)
  62. public void render(Mat _plotResult) {
  63. ThrowIfDisposed();
  64. if (_plotResult != null) _plotResult.ThrowIfDisposed();
  65. #if (UNITY_ANDROID && !UNITY_EDITOR)
  66. plot_Plot2d_render_10(nativeObj, _plotResult.nativeObj);
  67. return;
  68. #else
  69. return;
  70. #endif
  71. }
  72. //
  73. // C++: void cv::plot::Plot2d::setGridLinesNumber(int gridLinesNumber)
  74. //
  75. //javadoc: Plot2d::setGridLinesNumber(gridLinesNumber)
  76. public void setGridLinesNumber(int gridLinesNumber) {
  77. ThrowIfDisposed();
  78. #if (UNITY_ANDROID && !UNITY_EDITOR)
  79. plot_Plot2d_setGridLinesNumber_10(nativeObj, gridLinesNumber);
  80. return;
  81. #else
  82. return;
  83. #endif
  84. }
  85. //
  86. // C++: void cv::plot::Plot2d::setInvertOrientation(bool _invertOrientation)
  87. //
  88. //javadoc: Plot2d::setInvertOrientation(_invertOrientation)
  89. public void setInvertOrientation(bool _invertOrientation) {
  90. ThrowIfDisposed();
  91. #if (UNITY_ANDROID && !UNITY_EDITOR)
  92. plot_Plot2d_setInvertOrientation_10(nativeObj, _invertOrientation);
  93. return;
  94. #else
  95. return;
  96. #endif
  97. }
  98. //
  99. // C++: void cv::plot::Plot2d::setMaxX(double _plotMaxX)
  100. //
  101. //javadoc: Plot2d::setMaxX(_plotMaxX)
  102. public void setMaxX(double _plotMaxX) {
  103. ThrowIfDisposed();
  104. #if (UNITY_ANDROID && !UNITY_EDITOR)
  105. plot_Plot2d_setMaxX_10(nativeObj, _plotMaxX);
  106. return;
  107. #else
  108. return;
  109. #endif
  110. }
  111. //
  112. // C++: void cv::plot::Plot2d::setMaxY(double _plotMaxY)
  113. //
  114. //javadoc: Plot2d::setMaxY(_plotMaxY)
  115. public void setMaxY(double _plotMaxY) {
  116. ThrowIfDisposed();
  117. #if (UNITY_ANDROID && !UNITY_EDITOR)
  118. plot_Plot2d_setMaxY_10(nativeObj, _plotMaxY);
  119. return;
  120. #else
  121. return;
  122. #endif
  123. }
  124. //
  125. // C++: void cv::plot::Plot2d::setMinX(double _plotMinX)
  126. //
  127. //javadoc: Plot2d::setMinX(_plotMinX)
  128. public void setMinX(double _plotMinX) {
  129. ThrowIfDisposed();
  130. #if (UNITY_ANDROID && !UNITY_EDITOR)
  131. plot_Plot2d_setMinX_10(nativeObj, _plotMinX);
  132. return;
  133. #else
  134. return;
  135. #endif
  136. }
  137. //
  138. // C++: void cv::plot::Plot2d::setMinY(double _plotMinY)
  139. //
  140. //javadoc: Plot2d::setMinY(_plotMinY)
  141. public void setMinY(double _plotMinY) {
  142. ThrowIfDisposed();
  143. #if (UNITY_ANDROID && !UNITY_EDITOR)
  144. plot_Plot2d_setMinY_10(nativeObj, _plotMinY);
  145. return;
  146. #else
  147. return;
  148. #endif
  149. }
  150. //
  151. // C++: void cv::plot::Plot2d::setNeedPlotLine(bool _needPlotLine)
  152. //
  153. //javadoc: Plot2d::setNeedPlotLine(_needPlotLine)
  154. public void setNeedPlotLine(bool _needPlotLine) {
  155. ThrowIfDisposed();
  156. #if (UNITY_ANDROID && !UNITY_EDITOR)
  157. plot_Plot2d_setNeedPlotLine_10(nativeObj, _needPlotLine);
  158. return;
  159. #else
  160. return;
  161. #endif
  162. }
  163. //
  164. // C++: void cv::plot::Plot2d::setPlotAxisColor(Scalar _plotAxisColor)
  165. //
  166. //javadoc: Plot2d::setPlotAxisColor(_plotAxisColor)
  167. public void setPlotAxisColor(Scalar _plotAxisColor) {
  168. ThrowIfDisposed();
  169. #if (UNITY_ANDROID && !UNITY_EDITOR)
  170. plot_Plot2d_setPlotAxisColor_10(nativeObj, _plotAxisColor.val[0], _plotAxisColor.val[1], _plotAxisColor.val[2], _plotAxisColor.val[3]);
  171. return;
  172. #else
  173. return;
  174. #endif
  175. }
  176. //
  177. // C++: void cv::plot::Plot2d::setPlotBackgroundColor(Scalar _plotBackgroundColor)
  178. //
  179. //javadoc: Plot2d::setPlotBackgroundColor(_plotBackgroundColor)
  180. public void setPlotBackgroundColor(Scalar _plotBackgroundColor) {
  181. ThrowIfDisposed();
  182. #if (UNITY_ANDROID && !UNITY_EDITOR)
  183. plot_Plot2d_setPlotBackgroundColor_10(nativeObj, _plotBackgroundColor.val[0], _plotBackgroundColor.val[1], _plotBackgroundColor.val[2], _plotBackgroundColor.val[3]);
  184. return;
  185. #else
  186. return;
  187. #endif
  188. }
  189. //
  190. // C++: void cv::plot::Plot2d::setPlotGridColor(Scalar _plotGridColor)
  191. //
  192. //javadoc: Plot2d::setPlotGridColor(_plotGridColor)
  193. public void setPlotGridColor(Scalar _plotGridColor) {
  194. ThrowIfDisposed();
  195. #if (UNITY_ANDROID && !UNITY_EDITOR)
  196. plot_Plot2d_setPlotGridColor_10(nativeObj, _plotGridColor.val[0], _plotGridColor.val[1], _plotGridColor.val[2], _plotGridColor.val[3]);
  197. return;
  198. #else
  199. return;
  200. #endif
  201. }
  202. //
  203. // C++: void cv::plot::Plot2d::setPlotLineColor(Scalar _plotLineColor)
  204. //
  205. //javadoc: Plot2d::setPlotLineColor(_plotLineColor)
  206. public void setPlotLineColor(Scalar _plotLineColor) {
  207. ThrowIfDisposed();
  208. #if (UNITY_ANDROID && !UNITY_EDITOR)
  209. plot_Plot2d_setPlotLineColor_10(nativeObj, _plotLineColor.val[0], _plotLineColor.val[1], _plotLineColor.val[2], _plotLineColor.val[3]);
  210. return;
  211. #else
  212. return;
  213. #endif
  214. }
  215. //
  216. // C++: void cv::plot::Plot2d::setPlotLineWidth(int _plotLineWidth)
  217. //
  218. //javadoc: Plot2d::setPlotLineWidth(_plotLineWidth)
  219. public void setPlotLineWidth(int _plotLineWidth) {
  220. ThrowIfDisposed();
  221. #if (UNITY_ANDROID && !UNITY_EDITOR)
  222. plot_Plot2d_setPlotLineWidth_10(nativeObj, _plotLineWidth);
  223. return;
  224. #else
  225. return;
  226. #endif
  227. }
  228. //
  229. // C++: void cv::plot::Plot2d::setPlotSize(int _plotSizeWidth, int _plotSizeHeight)
  230. //
  231. //javadoc: Plot2d::setPlotSize(_plotSizeWidth, _plotSizeHeight)
  232. public void setPlotSize(int _plotSizeWidth, int _plotSizeHeight) {
  233. ThrowIfDisposed();
  234. #if (UNITY_ANDROID && !UNITY_EDITOR)
  235. plot_Plot2d_setPlotSize_10(nativeObj, _plotSizeWidth, _plotSizeHeight);
  236. return;
  237. #else
  238. return;
  239. #endif
  240. }
  241. //
  242. // C++: void cv::plot::Plot2d::setPlotTextColor(Scalar _plotTextColor)
  243. //
  244. //javadoc: Plot2d::setPlotTextColor(_plotTextColor)
  245. public void setPlotTextColor(Scalar _plotTextColor) {
  246. ThrowIfDisposed();
  247. #if (UNITY_ANDROID && !UNITY_EDITOR)
  248. plot_Plot2d_setPlotTextColor_10(nativeObj, _plotTextColor.val[0], _plotTextColor.val[1], _plotTextColor.val[2], _plotTextColor.val[3]);
  249. return;
  250. #else
  251. return;
  252. #endif
  253. }
  254. //
  255. // C++: void cv::plot::Plot2d::setPointIdxToPrint(int pointIdx)
  256. //
  257. //javadoc: Plot2d::setPointIdxToPrint(pointIdx)
  258. public void setPointIdxToPrint(int pointIdx) {
  259. ThrowIfDisposed();
  260. #if (UNITY_ANDROID && !UNITY_EDITOR)
  261. plot_Plot2d_setPointIdxToPrint_10(nativeObj, pointIdx);
  262. return;
  263. #else
  264. return;
  265. #endif
  266. }
  267. //
  268. // C++: void cv::plot::Plot2d::setShowGrid(bool needShowGrid)
  269. //
  270. //javadoc: Plot2d::setShowGrid(needShowGrid)
  271. public void setShowGrid(bool needShowGrid) {
  272. ThrowIfDisposed();
  273. #if (UNITY_ANDROID && !UNITY_EDITOR)
  274. plot_Plot2d_setShowGrid_10(nativeObj, needShowGrid);
  275. return;
  276. #else
  277. return;
  278. #endif
  279. }
  280. //
  281. // C++: void cv::plot::Plot2d::setShowText(bool needShowText)
  282. //
  283. //javadoc: Plot2d::setShowText(needShowText)
  284. public void setShowText(bool needShowText) {
  285. ThrowIfDisposed();
  286. #if (UNITY_ANDROID && !UNITY_EDITOR)
  287. plot_Plot2d_setShowText_10(nativeObj, needShowText);
  288. return;
  289. #else
  290. return;
  291. #endif
  292. }
  293. #if (UNITY_ANDROID && !UNITY_EDITOR)
  294. const string LIBNAME = "opencvforunity";
  295. // C++: static Ptr_Plot2d cv::plot::Plot2d::create(Mat data)
  296. [DllImport(LIBNAME)]
  297. private static extern IntPtr plot_Plot2d_create_10(IntPtr data_nativeObj);
  298. // C++: static Ptr_Plot2d cv::plot::Plot2d::create(Mat dataX, Mat dataY)
  299. [DllImport(LIBNAME)]
  300. private static extern IntPtr plot_Plot2d_create_11(IntPtr dataX_nativeObj, IntPtr dataY_nativeObj);
  301. // C++: void cv::plot::Plot2d::render(Mat& _plotResult)
  302. [DllImport(LIBNAME)]
  303. private static extern void plot_Plot2d_render_10(IntPtr nativeObj, IntPtr _plotResult_nativeObj);
  304. // C++: void cv::plot::Plot2d::setGridLinesNumber(int gridLinesNumber)
  305. [DllImport(LIBNAME)]
  306. private static extern void plot_Plot2d_setGridLinesNumber_10(IntPtr nativeObj, int gridLinesNumber);
  307. // C++: void cv::plot::Plot2d::setInvertOrientation(bool _invertOrientation)
  308. [DllImport(LIBNAME)]
  309. private static extern void plot_Plot2d_setInvertOrientation_10(IntPtr nativeObj, bool _invertOrientation);
  310. // C++: void cv::plot::Plot2d::setMaxX(double _plotMaxX)
  311. [DllImport(LIBNAME)]
  312. private static extern void plot_Plot2d_setMaxX_10(IntPtr nativeObj, double _plotMaxX);
  313. // C++: void cv::plot::Plot2d::setMaxY(double _plotMaxY)
  314. [DllImport(LIBNAME)]
  315. private static extern void plot_Plot2d_setMaxY_10(IntPtr nativeObj, double _plotMaxY);
  316. // C++: void cv::plot::Plot2d::setMinX(double _plotMinX)
  317. [DllImport(LIBNAME)]
  318. private static extern void plot_Plot2d_setMinX_10(IntPtr nativeObj, double _plotMinX);
  319. // C++: void cv::plot::Plot2d::setMinY(double _plotMinY)
  320. [DllImport(LIBNAME)]
  321. private static extern void plot_Plot2d_setMinY_10(IntPtr nativeObj, double _plotMinY);
  322. // C++: void cv::plot::Plot2d::setNeedPlotLine(bool _needPlotLine)
  323. [DllImport(LIBNAME)]
  324. private static extern void plot_Plot2d_setNeedPlotLine_10(IntPtr nativeObj, bool _needPlotLine);
  325. // C++: void cv::plot::Plot2d::setPlotAxisColor(Scalar _plotAxisColor)
  326. [DllImport(LIBNAME)]
  327. private static extern void plot_Plot2d_setPlotAxisColor_10(IntPtr nativeObj, double _plotAxisColor_val0, double _plotAxisColor_val1, double _plotAxisColor_val2, double _plotAxisColor_val3);
  328. // C++: void cv::plot::Plot2d::setPlotBackgroundColor(Scalar _plotBackgroundColor)
  329. [DllImport(LIBNAME)]
  330. private static extern void plot_Plot2d_setPlotBackgroundColor_10(IntPtr nativeObj, double _plotBackgroundColor_val0, double _plotBackgroundColor_val1, double _plotBackgroundColor_val2, double _plotBackgroundColor_val3);
  331. // C++: void cv::plot::Plot2d::setPlotGridColor(Scalar _plotGridColor)
  332. [DllImport(LIBNAME)]
  333. private static extern void plot_Plot2d_setPlotGridColor_10(IntPtr nativeObj, double _plotGridColor_val0, double _plotGridColor_val1, double _plotGridColor_val2, double _plotGridColor_val3);
  334. // C++: void cv::plot::Plot2d::setPlotLineColor(Scalar _plotLineColor)
  335. [DllImport(LIBNAME)]
  336. private static extern void plot_Plot2d_setPlotLineColor_10(IntPtr nativeObj, double _plotLineColor_val0, double _plotLineColor_val1, double _plotLineColor_val2, double _plotLineColor_val3);
  337. // C++: void cv::plot::Plot2d::setPlotLineWidth(int _plotLineWidth)
  338. [DllImport(LIBNAME)]
  339. private static extern void plot_Plot2d_setPlotLineWidth_10(IntPtr nativeObj, int _plotLineWidth);
  340. // C++: void cv::plot::Plot2d::setPlotSize(int _plotSizeWidth, int _plotSizeHeight)
  341. [DllImport(LIBNAME)]
  342. private static extern void plot_Plot2d_setPlotSize_10(IntPtr nativeObj, int _plotSizeWidth, int _plotSizeHeight);
  343. // C++: void cv::plot::Plot2d::setPlotTextColor(Scalar _plotTextColor)
  344. [DllImport(LIBNAME)]
  345. private static extern void plot_Plot2d_setPlotTextColor_10(IntPtr nativeObj, double _plotTextColor_val0, double _plotTextColor_val1, double _plotTextColor_val2, double _plotTextColor_val3);
  346. // C++: void cv::plot::Plot2d::setPointIdxToPrint(int pointIdx)
  347. [DllImport(LIBNAME)]
  348. private static extern void plot_Plot2d_setPointIdxToPrint_10(IntPtr nativeObj, int pointIdx);
  349. // C++: void cv::plot::Plot2d::setShowGrid(bool needShowGrid)
  350. [DllImport(LIBNAME)]
  351. private static extern void plot_Plot2d_setShowGrid_10(IntPtr nativeObj, bool needShowGrid);
  352. // C++: void cv::plot::Plot2d::setShowText(bool needShowText)
  353. [DllImport(LIBNAME)]
  354. private static extern void plot_Plot2d_setShowText_10(IntPtr nativeObj, bool needShowText);
  355. // native support for java finalize()
  356. [DllImport(LIBNAME)]
  357. private static extern void plot_Plot2d_delete(IntPtr nativeObj);
  358. #endif
  359. }
  360. }