Plot2d.cs 16 KB

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