internal.pyi 100 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404
  1. ###############################################################################
  2. # This file is a part of Dear ImGui Bundle, NOT a part of ImPlot
  3. # -----------------------------------------------------------------------------
  4. # implot/internal.pyi is the equivalent of implot_internal.h, using the
  5. # bindings provided by Dear ImGui Bundle.
  6. #
  7. # It is automatically generated (using https://pthom.github.io/litgen/),
  8. # and is generally very close to the C++ version. Comments, docs are identical.
  9. ###############################################################################
  10. # ruff: noqa: E741, B008
  11. from typing import Any, Optional, Tuple, overload
  12. import numpy as np
  13. import enum
  14. from imgui_bundle.imgui import ImVec2, ImVec4, ImU32, ImDrawList, Storage, TextBuffer, ImVec2Like, ImVec4Like
  15. from imgui_bundle.imgui.internal import ImRect
  16. from imgui_bundle import imgui
  17. from imgui_bundle.implot import (
  18. Range,
  19. ImAxis,
  20. Cond,
  21. Scale,
  22. ItemFlags,
  23. Point,
  24. Location,
  25. AxisFlags,
  26. LegendFlags,
  27. Flags,
  28. MouseTextFlags,
  29. SubplotFlags,
  30. Marker,
  31. Style,
  32. InputMap,
  33. Spec
  34. )
  35. from imgui_bundle.imgui import (
  36. ImVector_ImU32,
  37. ImVector_float,
  38. ImVector_int,
  39. ImVector_ColorMod,
  40. ImVector_StyleMod
  41. )
  42. ImGui_Context = imgui.internal.Context
  43. Colormap = int
  44. ID = int
  45. TimeUnit = int # enum TimeUnit_
  46. TimeFmt = int # enum TimeFmt_
  47. DateFmt = int # enum DateFmt_
  48. Col = int # enum ImPlotCol_
  49. Bin = int # enum ImPlotBin_
  50. time_t = int
  51. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AUTOGENERATED CODE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  52. # <litgen_stub> // Autogenerated code below! Do not edit!
  53. #################### <generated_from:implot_internal.h> ####################
  54. # MIT License
  55. # Copyright (c) 2020-2024 Evan Pezent
  56. # Copyright (c) 2025-2026 Breno Cunha Queiroz
  57. # Permission is hereby granted, free of charge, to any person obtaining a copy
  58. # of this software and associated documentation files (the "Software"), to deal
  59. # in the Software without restriction, including without limitation the rights
  60. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  61. # copies of the Software, and to permit persons to whom the Software is
  62. # furnished to do so, subject to the following conditions:
  63. # The above copyright notice and this permission notice shall be included in all
  64. # copies or substantial portions of the Software.
  65. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  66. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  67. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  68. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  69. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  70. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  71. # SOFTWARE.
  72. # ImPlot v1.1 WIP
  73. # You may use this file to debug, understand or extend ImPlot features but we
  74. # don't provide any guarantee of forward compatibility!
  75. #-----------------------------------------------------------------------------
  76. # [SECTION] Header Mess
  77. #-----------------------------------------------------------------------------
  78. # #ifndef IMGUI_DISABLE
  79. #
  80. # Support for pre-1.84 versions. ImPool's GetSize() -> GetBufSize()
  81. # #ifdef IMGUI_BUNDLE_PYTHON_API
  82. #
  83. # #endif
  84. #
  85. #-----------------------------------------------------------------------------
  86. # [SECTION] Constants
  87. #-----------------------------------------------------------------------------
  88. # Constants can be changed unless stated otherwise. We may move some of these
  89. # to ImPlotStyleVar_ over time.
  90. #-----------------------------------------------------------------------------
  91. # [SECTION] Macros
  92. #-----------------------------------------------------------------------------
  93. #-----------------------------------------------------------------------------
  94. # [SECTION] Forward Declarations
  95. #-----------------------------------------------------------------------------
  96. #-----------------------------------------------------------------------------
  97. # [SECTION] Context Pointer
  98. #-----------------------------------------------------------------------------
  99. #-----------------------------------------------------------------------------
  100. # [SECTION] Generic Helpers
  101. #-----------------------------------------------------------------------------
  102. # Computes the common (base-10) logarithm
  103. # static inline float ImLog10(float x) { return log10f(x); } /* original C++ signature */
  104. def im_log10(x: float) -> float:
  105. """(private API)"""
  106. pass
  107. # static inline float ImSinh(float x) { return sinhf(x); } /* original C++ signature */
  108. def im_sinh(x: float) -> float:
  109. """(private API)"""
  110. pass
  111. # static inline float ImAsinh(float x) { return asinhf(x); } /* original C++ signature */
  112. def im_asinh(x: float) -> float:
  113. """(private API)"""
  114. pass
  115. # static inline int ImPosMod(int l, int r) { return (l % r + r) % r; } /* original C++ signature */
  116. def im_pos_mod(l: int, r: int) -> int:
  117. """ Returns always positive modulo (assumes r != 0)
  118. (private API)
  119. """
  120. pass
  121. # static inline bool ImNan(double val) { return isnan(val); } /* original C++ signature */
  122. def im_nan(val: float) -> bool:
  123. """ Returns True if val is NAN
  124. (private API)
  125. """
  126. pass
  127. # static inline bool ImNanOrInf(double val) { return !(val >= -DBL_MAX && val <= DBL_MAX) || ImNan(val); } /* original C++ signature */
  128. def im_nan_or_inf(val: float) -> bool:
  129. """ Returns True if val is NAN or INFINITY
  130. (private API)
  131. """
  132. pass
  133. # static inline double ImConstrainNan(double val) { return ImNan(val) ? 0 : val; } /* original C++ signature */
  134. def im_constrain_nan(val: float) -> float:
  135. """ Turns NANs to 0s
  136. (private API)
  137. """
  138. pass
  139. # static inline double ImConstrainInf(double val) { return val >= DBL_MAX ? DBL_MAX : val <= -DBL_MAX ? - DBL_MAX : val; } /* original C++ signature */
  140. def im_constrain_inf(val: float) -> float:
  141. """ Turns infinity to floating point maximums
  142. (private API)
  143. """
  144. pass
  145. # static inline double ImConstrainLog(double val) { return val <= 0 ? 0.001f : val; } /* original C++ signature */
  146. def im_constrain_log(val: float) -> float:
  147. """ Turns numbers less than or equal to 0 to 0.001 (sort of arbitrary, is there a better way?)
  148. (private API)
  149. """
  150. pass
  151. # static inline double ImConstrainTime(double val) { return val < IMPLOT_MIN_TIME ? IMPLOT_MIN_TIME : (val > IMPLOT_MAX_TIME ? IMPLOT_MAX_TIME : val); } /* original C++ signature */
  152. def im_constrain_time(val: float) -> float:
  153. """ Turns numbers less than 0 to zero
  154. (private API)
  155. """
  156. pass
  157. # static inline bool ImAlmostEqual(double v1, double v2, int ulp = 2) { return ImAbs(v1-v2) < DBL_EPSILON * ImAbs(v1+v2) * ulp || ImAbs(v1-v2) < DBL_MIN; } /* original C++ signature */
  158. def im_almost_equal(v1: float, v2: float, ulp: int = 2) -> bool:
  159. """ True if two numbers are approximately equal using units in the last place.
  160. (private API)
  161. """
  162. pass
  163. # static inline ImU32 ImMixU32(ImU32 a, ImU32 b, ImU32 s) { /* original C++ signature */
  164. # #ifdef IMPLOT_MIX64
  165. # const ImU32 af = 256-s;
  166. # const ImU32 bf = s;
  167. # const ImU64 al = (a & 0x00ff00ff) | (((ImU64)(a & 0xff00ff00)) << 24);
  168. # const ImU64 bl = (b & 0x00ff00ff) | (((ImU64)(b & 0xff00ff00)) << 24);
  169. # const ImU64 mix = (al * af + bl * bf);
  170. # return ((mix >> 32) & 0xff00ff00) | ((mix & 0xff00ff00) >> 8);
  171. # #else
  172. # const ImU32 af = 256-s;
  173. # const ImU32 bf = s;
  174. # const ImU32 al = (a & 0x00ff00ff);
  175. # const ImU32 ah = (a & 0xff00ff00) >> 8;
  176. # const ImU32 bl = (b & 0x00ff00ff);
  177. # const ImU32 bh = (b & 0xff00ff00) >> 8;
  178. # const ImU32 ml = (al * af + bl * bf);
  179. # const ImU32 mh = (ah * af + bh * bf);
  180. # return (mh & 0xff00ff00) | ((ml & 0xff00ff00) >> 8);
  181. # #endif
  182. # }
  183. def im_mix_u32(a: ImU32, b: ImU32, s: ImU32) -> ImU32:
  184. """ Mix color a and b by factor s in [0 256]
  185. (private API)
  186. """
  187. pass
  188. # static inline ImU32 ImLerpU32(const ImU32* colors, int size, float t) { /* original C++ signature */
  189. # int i1 = (int)((size - 1 ) * t);
  190. # int i2 = i1 + 1;
  191. # if (i2 == size || size == 1)
  192. # return colors[i1];
  193. # float den = 1.0f / (size - 1);
  194. # float t1 = i1 * den;
  195. # float t2 = i2 * den;
  196. # float tr = ImRemap01(t, t1, t2);
  197. # return ImMixU32(colors[i1], colors[i2], (ImU32)(tr*256));
  198. # }
  199. def im_lerp_u32(colors: ImU32, size: int, t: float) -> ImU32:
  200. """ Lerp across an array of 32-bit colors given t in [0.0 1.0]
  201. (private API)
  202. """
  203. pass
  204. # static inline ImU32 ImAlphaU32(ImU32 col, float alpha) { /* original C++ signature */
  205. # return col & ~((ImU32)((1.0f-alpha)*255)<<IM_COL32_A_SHIFT);
  206. # }
  207. def im_alpha_u32(col: ImU32, alpha: float) -> ImU32:
  208. """ Set alpha channel of 32-bit color from float in range [0.0 1.0]
  209. (private API)
  210. """
  211. pass
  212. #-----------------------------------------------------------------------------
  213. # [SECTION] ImPlot Enums
  214. #-----------------------------------------------------------------------------
  215. class TimeUnit_(enum.IntFlag):
  216. # ImPlotTimeUnit_Us, /* original C++ signature */
  217. us = enum.auto() # (= 0) # microsecond
  218. # ImPlotTimeUnit_Ms, /* original C++ signature */
  219. ms = enum.auto() # (= 1) # millisecond
  220. # ImPlotTimeUnit_S, /* original C++ signature */
  221. s = enum.auto() # (= 2) # second
  222. # ImPlotTimeUnit_Min, /* original C++ signature */
  223. min = enum.auto() # (= 3) # minute
  224. # ImPlotTimeUnit_Hr, /* original C++ signature */
  225. hr = enum.auto() # (= 4) # hour
  226. # ImPlotTimeUnit_Day, /* original C++ signature */
  227. day = enum.auto() # (= 5) # day
  228. # ImPlotTimeUnit_Mo, /* original C++ signature */
  229. mo = enum.auto() # (= 6) # month
  230. # ImPlotTimeUnit_Yr, /* original C++ signature */
  231. yr = enum.auto() # (= 7) # year
  232. # ImPlotTimeUnit_COUNT /* original C++ signature */
  233. # }
  234. count = enum.auto() # (= 8)
  235. class DateFmt_(enum.IntFlag):
  236. # default [ ISO 8601 ]
  237. # ImPlotDateFmt_None = 0, /* original C++ signature */
  238. none = enum.auto() # (= 0)
  239. # ImPlotDateFmt_DayMo, /* original C++ signature */
  240. day_mo = enum.auto() # (= 1) # 10/3 [ --10-03 ]
  241. # ImPlotDateFmt_DayMoYr, /* original C++ signature */
  242. day_mo_yr = enum.auto() # (= 2) # 10/3/91 [ 1991-10-03 ]
  243. # ImPlotDateFmt_MoYr, /* original C++ signature */
  244. mo_yr = enum.auto() # (= 3) # Oct 1991 [ 1991-10 ]
  245. # ImPlotDateFmt_Mo, /* original C++ signature */
  246. mo = enum.auto() # (= 4) # Oct [ --10 ]
  247. # ImPlotDateFmt_Yr /* original C++ signature */
  248. yr = enum.auto() # (= 5) # 1991 [ 1991 ]
  249. class TimeFmt_(enum.IntFlag):
  250. # default [ 24 Hour Clock ]
  251. # ImPlotTimeFmt_None = 0, /* original C++ signature */
  252. none = enum.auto() # (= 0)
  253. # ImPlotTimeFmt_Us, /* original C++ signature */
  254. us = enum.auto() # (= 1) # .428 552 [ .428 552 ]
  255. # ImPlotTimeFmt_SUs, /* original C++ signature */
  256. s_us = enum.auto() # (= 2) # :29.428 552 [ :29.428 552 ]
  257. # ImPlotTimeFmt_SMs, /* original C++ signature */
  258. s_ms = enum.auto() # (= 3) # :29.428 [ :29.428 ]
  259. # ImPlotTimeFmt_S, /* original C++ signature */
  260. s = enum.auto() # (= 4) # :29 [ :29 ]
  261. # ImPlotTimeFmt_MinSMs, /* original C++ signature */
  262. min_s_ms = enum.auto() # (= 5) # 21:29.428 [ 21:29.428 ]
  263. # ImPlotTimeFmt_HrMinSMs, /* original C++ signature */
  264. hr_min_s_ms = enum.auto() # (= 6) # 7:21:29.428pm [ 19:21:29.428 ]
  265. # ImPlotTimeFmt_HrMinS, /* original C++ signature */
  266. hr_min_s = enum.auto() # (= 7) # 7:21:29pm [ 19:21:29 ]
  267. # ImPlotTimeFmt_HrMin, /* original C++ signature */
  268. hr_min = enum.auto() # (= 8) # 7:21pm [ 19:21 ]
  269. # ImPlotTimeFmt_Hr /* original C++ signature */
  270. hr = enum.auto() # (= 9) # 7pm [ 19:00 ]
  271. class MarkerInternal_(enum.IntFlag):
  272. # ImPlotMarker_Invalid = -3 /* original C++ signature */
  273. # }
  274. im_plot_marker_invalid = enum.auto() # (= -3)
  275. #-----------------------------------------------------------------------------
  276. # [SECTION] Callbacks
  277. #-----------------------------------------------------------------------------
  278. #-----------------------------------------------------------------------------
  279. # [SECTION] Structs
  280. #-----------------------------------------------------------------------------
  281. class DateTimeSpec:
  282. """ Combined date/time format spec"""
  283. # ImPlotDateTimeSpec() {} /* original C++ signature */
  284. @overload
  285. def __init__(self) -> None:
  286. pass
  287. # ImPlotDateTimeSpec(ImPlotDateFmt date_fmt, ImPlotTimeFmt time_fmt, bool use_24_hr_clk = false, bool use_iso_8601 = false) { /* original C++ signature */
  288. # Date = date_fmt;
  289. # Time = time_fmt;
  290. # UseISO8601 = use_iso_8601;
  291. # Use24HourClock = use_24_hr_clk;
  292. # }
  293. @overload
  294. def __init__(self, date_fmt: DateFmt, time_fmt: TimeFmt, use_24_hr_clk: bool = False, use_iso_8601: bool = False) -> None:
  295. pass
  296. # ImPlotDateFmt Date; /* original C++ signature */
  297. date: DateFmt
  298. # ImPlotTimeFmt Time; /* original C++ signature */
  299. time: TimeFmt
  300. # bool UseISO8601; /* original C++ signature */
  301. use_iso8601: bool
  302. # bool Use24HourClock; /* original C++ signature */
  303. use24_hour_clock: bool
  304. class Time:
  305. """ Two part timestamp struct."""
  306. # time_t S; /* original C++ signature */
  307. s: time_t # second part
  308. # int Us; /* original C++ signature */
  309. us: int # microsecond part
  310. # ImPlotTime() { S = 0; Us = 0; } /* original C++ signature */
  311. @overload
  312. def __init__(self) -> None:
  313. pass
  314. # ImPlotTime(time_t s, int us = 0) { S = s + us / 1000000; Us = us % 1000000; } /* original C++ signature */
  315. @overload
  316. def __init__(self, s: time_t, us: int = 0) -> None:
  317. pass
  318. # void RollOver() { S = S + Us / 1000000; Us = Us % 1000000; } /* original C++ signature */
  319. def roll_over(self) -> None:
  320. """(private API)"""
  321. pass
  322. # double ToDouble() const { return (double)S + (double)Us / 1000000.0; } /* original C++ signature */
  323. def to_double(self) -> float:
  324. """(private API)"""
  325. pass
  326. # static ImPlotTime FromDouble(double t) { return ImPlotTime((time_t)t, (int)(t * 1000000 - floor(t) * 1000000)); } /* original C++ signature */
  327. @staticmethod
  328. def from_double(t: float) -> Time:
  329. """(private API)"""
  330. pass
  331. class ColormapData:
  332. """ Colormap data storage"""
  333. # ImVector<ImU32> Keys; /* original C++ signature */
  334. keys: ImVector_ImU32
  335. # ImVector<int> KeyCounts; /* original C++ signature */
  336. key_counts: ImVector_int
  337. # ImVector<int> KeyOffsets; /* original C++ signature */
  338. key_offsets: ImVector_int
  339. # ImVector<ImU32> Tables; /* original C++ signature */
  340. tables: ImVector_ImU32
  341. # ImVector<int> TableSizes; /* original C++ signature */
  342. table_sizes: ImVector_int
  343. # ImVector<int> TableOffsets; /* original C++ signature */
  344. table_offsets: ImVector_int
  345. # ImGuiTextBuffer Text; /* original C++ signature */
  346. text: TextBuffer
  347. # ImVector<int> TextOffsets; /* original C++ signature */
  348. text_offsets: ImVector_int
  349. # ImGuiStorage Map; /* original C++ signature */
  350. map: Storage
  351. # int Count; /* original C++ signature */
  352. count: int
  353. # ImPlotColormapData() { Count = 0; } /* original C++ signature */
  354. def __init__(self) -> None:
  355. pass
  356. # int Append(const char* name, const ImU32* keys, int count, bool qual) { /* original C++ signature */
  357. # if (GetIndex(name) != -1)
  358. # return -1;
  359. # KeyOffsets.push_back(Keys.size());
  360. # KeyCounts.push_back(count);
  361. # Keys.reserve(Keys.size()+count);
  362. # for (int i = 0; i < count; ++i)
  363. # Keys.push_back(keys[i]);
  364. # TextOffsets.push_back(Text.size());
  365. # Text.append(name, name + strlen(name) + 1);
  366. # Quals.push_back(qual);
  367. # ImGuiID id = ImHashStr(name);
  368. # int idx = Count++;
  369. # Map.SetInt(id,idx);
  370. # _AppendTable(idx);
  371. # return idx;
  372. # }
  373. def append(self, name: str, keys: ImU32, count: int, qual: bool) -> int:
  374. """(private API)"""
  375. pass
  376. # void _AppendTable(ImPlotColormap cmap) { /* original C++ signature */
  377. # int key_count = GetKeyCount(cmap);
  378. # const ImU32* keys = GetKeys(cmap);
  379. # int off = Tables.size();
  380. # TableOffsets.push_back(off);
  381. # if (IsQual(cmap)) {
  382. # Tables.reserve(key_count);
  383. # for (int i = 0; i < key_count; ++i)
  384. # Tables.push_back(keys[i]);
  385. # TableSizes.push_back(key_count);
  386. # }
  387. # else {
  388. # int max_size = 255 * (key_count-1) + 1;
  389. # Tables.reserve(off + max_size);
  390. # // ImU32 last = keys[0];
  391. # // Tables.push_back(last);
  392. # // int n = 1;
  393. # for (int i = 0; i < key_count-1; ++i) {
  394. # for (int s = 0; s < 255; ++s) {
  395. # ImU32 a = keys[i];
  396. # ImU32 b = keys[i+1];
  397. # ImU32 c = ImMixU32(a,b,s);
  398. # // if (c != last) {
  399. # Tables.push_back(c);
  400. # // last = c;
  401. # // n++;
  402. # // }
  403. # }
  404. # }
  405. # ImU32 c = keys[key_count-1];
  406. # // if (c != last) {
  407. # Tables.push_back(c);
  408. # // n++;
  409. # // }
  410. # // TableSizes.push_back(n);
  411. # TableSizes.push_back(max_size);
  412. # }
  413. # }
  414. def _append_table(self, cmap: Colormap) -> None:
  415. """(private API)"""
  416. pass
  417. # void RebuildTables() { /* original C++ signature */
  418. # Tables.resize(0);
  419. # TableSizes.resize(0);
  420. # TableOffsets.resize(0);
  421. # for (int i = 0; i < Count; ++i)
  422. # _AppendTable(i);
  423. # }
  424. def rebuild_tables(self) -> None:
  425. """(private API)"""
  426. pass
  427. # inline bool IsQual(ImPlotColormap cmap) const { return Quals[cmap]; } /* original C++ signature */
  428. def is_qual(self, cmap: Colormap) -> bool:
  429. """(private API)"""
  430. pass
  431. # inline const char* GetName(ImPlotColormap cmap) const { return cmap < Count ? Text.Buf.Data + TextOffsets[cmap] : nullptr; } /* original C++ signature */
  432. def get_name(self, cmap: Colormap) -> str:
  433. """(private API)"""
  434. pass
  435. # inline ImPlotColormap GetIndex(const char* name) const { ImGuiID key = ImHashStr(name); return Map.GetInt(key,-1); } /* original C++ signature */
  436. def get_index(self, name: str) -> Colormap:
  437. """(private API)"""
  438. pass
  439. # inline const ImU32* GetKeys(ImPlotColormap cmap) const { return &Keys[KeyOffsets[cmap]]; } /* original C++ signature */
  440. def get_keys(self, cmap: Colormap) -> ImU32:
  441. """(private API)"""
  442. pass
  443. # inline int GetKeyCount(ImPlotColormap cmap) const { return KeyCounts[cmap]; } /* original C++ signature */
  444. def get_key_count(self, cmap: Colormap) -> int:
  445. """(private API)"""
  446. pass
  447. # inline ImU32 GetKeyColor(ImPlotColormap cmap, int idx) const { return Keys[KeyOffsets[cmap]+idx]; } /* original C++ signature */
  448. def get_key_color(self, cmap: Colormap, idx: int) -> ImU32:
  449. """(private API)"""
  450. pass
  451. # inline void SetKeyColor(ImPlotColormap cmap, int idx, ImU32 value) { Keys[KeyOffsets[cmap]+idx] = value; RebuildTables(); } /* original C++ signature */
  452. def set_key_color(self, cmap: Colormap, idx: int, value: ImU32) -> None:
  453. """(private API)"""
  454. pass
  455. # inline const ImU32* GetTable(ImPlotColormap cmap) const { return &Tables[TableOffsets[cmap]]; } /* original C++ signature */
  456. def get_table(self, cmap: Colormap) -> ImU32:
  457. """(private API)"""
  458. pass
  459. # inline int GetTableSize(ImPlotColormap cmap) const { return TableSizes[cmap]; } /* original C++ signature */
  460. def get_table_size(self, cmap: Colormap) -> int:
  461. """(private API)"""
  462. pass
  463. # inline ImU32 GetTableColor(ImPlotColormap cmap, int idx) const { return Tables[TableOffsets[cmap]+idx]; } /* original C++ signature */
  464. def get_table_color(self, cmap: Colormap, idx: int) -> ImU32:
  465. """(private API)"""
  466. pass
  467. # inline ImU32 LerpTable(ImPlotColormap cmap, float t) const { /* original C++ signature */
  468. # int off = TableOffsets[cmap];
  469. # int siz = TableSizes[cmap];
  470. # int idx = Quals[cmap] ? ImClamp((int)(siz*t),0,siz-1) : (int)((siz - 1) * t + 0.5f);
  471. # return Tables[off + idx];
  472. # }
  473. def lerp_table(self, cmap: Colormap, t: float) -> ImU32:
  474. """(private API)"""
  475. pass
  476. class PointError:
  477. """ ImPlotPoint with positive/negative error values"""
  478. # double X, /* original C++ signature */
  479. x: float
  480. # Y, /* original C++ signature */
  481. y: float
  482. # Neg, /* original C++ signature */
  483. neg: float
  484. # Pos; /* original C++ signature */
  485. pos: float
  486. # ImPlotPointError() { X = 0; Y = 0; Neg = 0; Pos = 0; } /* original C++ signature */
  487. @overload
  488. def __init__(self) -> None:
  489. pass
  490. # ImPlotPointError(double x, double y, double neg, double pos) { /* original C++ signature */
  491. # X = x; Y = y; Neg = neg; Pos = pos;
  492. # }
  493. @overload
  494. def __init__(self, x: float, y: float, neg: float, pos: float) -> None:
  495. pass
  496. class Annotation:
  497. """ Interior plot label/annotation"""
  498. # ImVec2 Pos; /* original C++ signature */
  499. pos: ImVec2
  500. # ImVec2 Offset; /* original C++ signature */
  501. offset: ImVec2
  502. # ImU32 ColorBg; /* original C++ signature */
  503. color_bg: ImU32
  504. # ImU32 ColorFg; /* original C++ signature */
  505. color_fg: ImU32
  506. # int TextOffset; /* original C++ signature */
  507. text_offset: int
  508. # bool Clamp; /* original C++ signature */
  509. clamp: bool
  510. # ImPlotAnnotation() { /* original C++ signature */
  511. # ColorBg = ColorFg = 0;
  512. # TextOffset = 0;
  513. # Clamp = false;
  514. # }
  515. def __init__(self) -> None:
  516. pass
  517. class AnnotationCollection:
  518. """ Collection of plot labels"""
  519. # ImGuiTextBuffer TextBuffer; /* original C++ signature */
  520. text_buffer: TextBuffer
  521. # int Size; /* original C++ signature */
  522. size: int
  523. # ImPlotAnnotationCollection() { Reset(); } /* original C++ signature */
  524. def __init__(self) -> None:
  525. pass
  526. # void Append(const ImVec2& pos, const ImVec2& off, ImU32 bg, ImU32 fg, bool clamp, const char* fmt, ...) { /* original C++ signature */
  527. # va_list args;
  528. # va_start(args, fmt);
  529. # AppendV(pos, off, bg, fg, clamp, fmt, args);
  530. # va_end(args);
  531. # }
  532. def append(self, pos: ImVec2Like, off: ImVec2Like, bg: ImU32, fg: ImU32, clamp: bool, fmt: str) -> None:
  533. """(private API)"""
  534. pass
  535. # const char* GetText(int idx) { /* original C++ signature */
  536. # return TextBuffer.Buf.Data + Annotations[idx].TextOffset;
  537. # }
  538. def get_text(self, idx: int) -> str:
  539. """(private API)"""
  540. pass
  541. # void Reset() { /* original C++ signature */
  542. # Annotations.shrink(0);
  543. # TextBuffer.Buf.shrink(0);
  544. # Size = 0;
  545. # }
  546. def reset(self) -> None:
  547. """(private API)"""
  548. pass
  549. class Tag:
  550. # ImAxis Axis; /* original C++ signature */
  551. axis: ImAxis
  552. # double Value; /* original C++ signature */
  553. value: float
  554. # ImU32 ColorBg; /* original C++ signature */
  555. color_bg: ImU32
  556. # ImU32 ColorFg; /* original C++ signature */
  557. color_fg: ImU32
  558. # int TextOffset; /* original C++ signature */
  559. text_offset: int
  560. # ImPlotTag() { /* original C++ signature */
  561. # Axis = 0;
  562. # Value = 0;
  563. # ColorBg = 0;
  564. # ColorFg = 0;
  565. # TextOffset = 0;
  566. # }
  567. def __init__(self) -> None:
  568. pass
  569. class TagCollection:
  570. # ImGuiTextBuffer TextBuffer; /* original C++ signature */
  571. text_buffer: TextBuffer
  572. # int Size; /* original C++ signature */
  573. size: int
  574. # ImPlotTagCollection() { Reset(); } /* original C++ signature */
  575. def __init__(self) -> None:
  576. pass
  577. # void Append(ImAxis axis, double value, ImU32 bg, ImU32 fg, const char* fmt, ...) { /* original C++ signature */
  578. # va_list args;
  579. # va_start(args, fmt);
  580. # AppendV(axis, value, bg, fg, fmt, args);
  581. # va_end(args);
  582. # }
  583. def append(self, axis: ImAxis, value: float, bg: ImU32, fg: ImU32, fmt: str) -> None:
  584. """(private API)"""
  585. pass
  586. # const char* GetText(int idx) { /* original C++ signature */
  587. # return TextBuffer.Buf.Data + Tags[idx].TextOffset;
  588. # }
  589. def get_text(self, idx: int) -> str:
  590. """(private API)"""
  591. pass
  592. # void Reset() { /* original C++ signature */
  593. # Tags.shrink(0);
  594. # TextBuffer.Buf.shrink(0);
  595. # Size = 0;
  596. # }
  597. def reset(self) -> None:
  598. """(private API)"""
  599. pass
  600. class Tick:
  601. """ Tick mark info"""
  602. # double PlotPos; /* original C++ signature */
  603. plot_pos: float
  604. # float PixelPos; /* original C++ signature */
  605. pixel_pos: float
  606. # ImVec2 LabelSize; /* original C++ signature */
  607. label_size: ImVec2
  608. # int TextOffset; /* original C++ signature */
  609. text_offset: int
  610. # bool Major; /* original C++ signature */
  611. major: bool
  612. # bool ShowLabel; /* original C++ signature */
  613. show_label: bool
  614. # int Level; /* original C++ signature */
  615. level: int
  616. # int Idx; /* original C++ signature */
  617. idx: int
  618. # ImPlotTick() { /* original C++ signature */
  619. # PlotPos = 0;
  620. # PixelPos = 0;
  621. # LabelSize = ImVec2(0,0);
  622. # TextOffset = -1;
  623. # Major = false;
  624. # ShowLabel = false;
  625. # Level = 0;
  626. # Idx = -1;
  627. # }
  628. @overload
  629. def __init__(self) -> None:
  630. pass
  631. # ImPlotTick(double value, bool major, int level, bool show_label) { /* original C++ signature */
  632. # PixelPos = 0;
  633. # PlotPos = value;
  634. # Major = major;
  635. # ShowLabel = show_label;
  636. # Level = level;
  637. # TextOffset = -1;
  638. # }
  639. @overload
  640. def __init__(self, value: float, major: bool, level: int, show_label: bool) -> None:
  641. pass
  642. class Ticker:
  643. """ Collection of ticks"""
  644. # ImGuiTextBuffer TextBuffer; /* original C++ signature */
  645. text_buffer: TextBuffer
  646. # ImVec2 MaxSize; /* original C++ signature */
  647. max_size: ImVec2
  648. # ImVec2 LateSize; /* original C++ signature */
  649. late_size: ImVec2
  650. # int Levels; /* original C++ signature */
  651. levels: int
  652. # ImPlotTicker() { /* original C++ signature */
  653. # Reset();
  654. # }
  655. def __init__(self) -> None:
  656. pass
  657. # ImPlotTick& AddTick(double value, bool major, int level, bool show_label, const char* label) { /* original C++ signature */
  658. # ImPlotTick tick(value, major, level, show_label);
  659. # if (show_label && label != nullptr) {
  660. # tick.TextOffset = TextBuffer.size();
  661. # TextBuffer.append(label, label + strlen(label) + 1);
  662. # tick.LabelSize = ImGui::CalcTextSize(TextBuffer.Buf.Data + tick.TextOffset);
  663. # }
  664. # return AddTick(tick);
  665. # }
  666. @overload
  667. def add_tick(self, value: float, major: bool, level: int, show_label: bool, label: str) -> Tick:
  668. """(private API)"""
  669. pass
  670. # inline ImPlotTick& AddTick(ImPlotTick tick) { /* original C++ signature */
  671. # if (tick.ShowLabel) {
  672. # MaxSize.x = tick.LabelSize.x > MaxSize.x ? tick.LabelSize.x : MaxSize.x;
  673. # MaxSize.y = tick.LabelSize.y > MaxSize.y ? tick.LabelSize.y : MaxSize.y;
  674. # }
  675. # tick.Idx = Ticks.size();
  676. # Ticks.push_back(tick);
  677. # return Ticks.back();
  678. # }
  679. @overload
  680. def add_tick(self, tick: Tick) -> Tick:
  681. """(private API)"""
  682. pass
  683. # const char* GetText(int idx) const { /* original C++ signature */
  684. # return TextBuffer.Buf.Data + Ticks[idx].TextOffset;
  685. # }
  686. @overload
  687. def get_text(self, idx: int) -> str:
  688. """(private API)"""
  689. pass
  690. # const char* GetText(const ImPlotTick& tick) { /* original C++ signature */
  691. # return GetText(tick.Idx);
  692. # }
  693. @overload
  694. def get_text(self, tick: Tick) -> str:
  695. """(private API)"""
  696. pass
  697. # void OverrideSizeLate(const ImVec2& size) { /* original C++ signature */
  698. # LateSize.x = size.x > LateSize.x ? size.x : LateSize.x;
  699. # LateSize.y = size.y > LateSize.y ? size.y : LateSize.y;
  700. # }
  701. def override_size_late(self, size: ImVec2Like) -> None:
  702. """(private API)"""
  703. pass
  704. # void Reset() { /* original C++ signature */
  705. # Ticks.shrink(0);
  706. # TextBuffer.Buf.shrink(0);
  707. # MaxSize = LateSize;
  708. # LateSize = ImVec2(0,0);
  709. # Levels = 1;
  710. # }
  711. def reset(self) -> None:
  712. """(private API)"""
  713. pass
  714. # int TickCount() const { /* original C++ signature */
  715. # return Ticks.Size;
  716. # }
  717. def tick_count(self) -> int:
  718. """(private API)"""
  719. pass
  720. class Axis:
  721. """ Axis state information that must persist after EndPlot"""
  722. # ImGuiID ID; /* original C++ signature */
  723. id_: ID
  724. # ImPlotAxisFlags Flags; /* original C++ signature */
  725. flags: AxisFlags
  726. # ImPlotAxisFlags PreviousFlags; /* original C++ signature */
  727. previous_flags: AxisFlags
  728. # ImPlotRange Range; /* original C++ signature */
  729. range: Range
  730. # ImPlotCond RangeCond; /* original C++ signature */
  731. range_cond: Cond
  732. # ImPlotScale Scale; /* original C++ signature */
  733. scale: Scale
  734. # ImPlotRange FitExtents; /* original C++ signature */
  735. fit_extents: Range
  736. # ImPlotAxis* OrthoAxis; /* original C++ signature */
  737. ortho_axis: Axis
  738. # ImPlotRange ConstraintRange; /* original C++ signature */
  739. constraint_range: Range
  740. # ImPlotRange ConstraintZoom; /* original C++ signature */
  741. constraint_zoom: Range
  742. # ImPlotTicker Ticker; /* original C++ signature */
  743. ticker: Ticker
  744. # void* FormatterData; /* original C++ signature */
  745. formatter_data: Any
  746. # double* LinkedMin; /* original C++ signature */
  747. linked_min: float
  748. # double* LinkedMax; /* original C++ signature */
  749. linked_max: float
  750. # int PickerLevel; /* original C++ signature */
  751. picker_level: int
  752. # ImPlotTime PickerTimeMin, /* original C++ signature */
  753. picker_time_min: Time
  754. # PickerTimeMax; /* original C++ signature */
  755. picker_time_max: Time
  756. # void* TransformData; /* original C++ signature */
  757. transform_data: Any
  758. # float PixelMin, /* original C++ signature */
  759. pixel_min: float
  760. # PixelMax; /* original C++ signature */
  761. pixel_max: float
  762. # double ScaleMin, /* original C++ signature */
  763. scale_min: float
  764. # ScaleMax; /* original C++ signature */
  765. scale_max: float
  766. # double ScaleToPixel; /* original C++ signature */
  767. scale_to_pixel: float
  768. # float Datum1, /* original C++ signature */
  769. datum1: float
  770. # Datum2; /* original C++ signature */
  771. datum2: float
  772. # ImRect HoverRect; /* original C++ signature */
  773. hover_rect: ImRect
  774. # int LabelOffset; /* original C++ signature */
  775. label_offset: int
  776. # ImU32 ColorMaj, /* original C++ signature */
  777. color_maj: ImU32
  778. # ColorMin, /* original C++ signature */
  779. color_min: ImU32
  780. # ColorTick, /* original C++ signature */
  781. color_tick: ImU32
  782. # ColorTxt, /* original C++ signature */
  783. color_txt: ImU32
  784. # ColorBg, /* original C++ signature */
  785. color_bg: ImU32
  786. # ColorHov, /* original C++ signature */
  787. color_hov: ImU32
  788. # ColorAct, /* original C++ signature */
  789. color_act: ImU32
  790. # ColorHiLi; /* original C++ signature */
  791. color_hi_li: ImU32
  792. # bool Enabled; /* original C++ signature */
  793. enabled: bool
  794. # bool Vertical; /* original C++ signature */
  795. vertical: bool
  796. # bool FitThisFrame; /* original C++ signature */
  797. fit_this_frame: bool
  798. # bool HasRange; /* original C++ signature */
  799. has_range: bool
  800. # bool HasFormatSpec; /* original C++ signature */
  801. has_format_spec: bool
  802. # bool ShowDefaultTicks; /* original C++ signature */
  803. show_default_ticks: bool
  804. # bool Hovered; /* original C++ signature */
  805. hovered: bool
  806. # bool Held; /* original C++ signature */
  807. held: bool
  808. # ImPlotAxis() { /* original C++ signature */
  809. # ID = 0;
  810. # Flags = PreviousFlags = ImPlotAxisFlags_None;
  811. # Range.Min = 0;
  812. # Range.Max = 1;
  813. # Scale = ImPlotScale_Linear;
  814. # TransformForward = TransformInverse = nullptr;
  815. # TransformData = nullptr;
  816. # FitExtents.Min = HUGE_VAL;
  817. # FitExtents.Max = -HUGE_VAL;
  818. # OrthoAxis = nullptr;
  819. # ConstraintRange = ImPlotRange(-INFINITY,INFINITY);
  820. # ConstraintZoom = ImPlotRange(DBL_MIN,INFINITY);
  821. # LinkedMin = LinkedMax = nullptr;
  822. # PickerLevel = 0;
  823. # Datum1 = Datum2 = 0;
  824. # PixelMin = PixelMax = 0;
  825. # LabelOffset = -1;
  826. # ColorMaj = ColorMin = ColorTick = ColorTxt = ColorBg = ColorHov = ColorAct = 0;
  827. # ColorHiLi = IM_COL32_BLACK_TRANS;
  828. # Formatter = nullptr;
  829. # FormatterData = nullptr;
  830. # Locator = nullptr;
  831. # Enabled = Hovered = Held = FitThisFrame = HasRange = HasFormatSpec = false;
  832. # ShowDefaultTicks = true;
  833. # }
  834. def __init__(self) -> None:
  835. pass
  836. # inline void Reset() { /* original C++ signature */
  837. # Enabled = false;
  838. # Scale = ImPlotScale_Linear;
  839. # TransformForward = TransformInverse = nullptr;
  840. # TransformData = nullptr;
  841. # LabelOffset = -1;
  842. # HasFormatSpec = false;
  843. # Formatter = nullptr;
  844. # FormatterData = nullptr;
  845. # Locator = nullptr;
  846. # ShowDefaultTicks = true;
  847. # FitThisFrame = false;
  848. # FitExtents.Min = HUGE_VAL;
  849. # FitExtents.Max = -HUGE_VAL;
  850. # OrthoAxis = nullptr;
  851. # ConstraintRange = ImPlotRange(-INFINITY,INFINITY);
  852. # ConstraintZoom = ImPlotRange(DBL_MIN,INFINITY);
  853. # Ticker.Reset();
  854. # }
  855. def reset(self) -> None:
  856. """(private API)"""
  857. pass
  858. # inline bool SetMin(double _min, bool force=false) { /* original C++ signature */
  859. # if (!force && IsLockedMin())
  860. # return false;
  861. # _min = ImConstrainNan(ImConstrainInf(_min));
  862. # if (_min < ConstraintRange.Min)
  863. # _min = ConstraintRange.Min;
  864. # double z = Range.Max - _min;
  865. # if (z < ConstraintZoom.Min)
  866. # _min = Range.Max - ConstraintZoom.Min;
  867. # if (z > ConstraintZoom.Max)
  868. # _min = Range.Max - ConstraintZoom.Max;
  869. # if (_min >= Range.Max)
  870. # return false;
  871. # Range.Min = _min;
  872. # PickerTimeMin = ImPlotTime::FromDouble(Range.Min);
  873. # UpdateTransformCache();
  874. # return true;
  875. # }
  876. def set_min(self, _min: float, force: bool = False) -> bool:
  877. """(private API)"""
  878. pass
  879. # inline bool SetMax(double _max, bool force=false) { /* original C++ signature */
  880. # if (!force && IsLockedMax())
  881. # return false;
  882. # _max = ImConstrainNan(ImConstrainInf(_max));
  883. # if (_max > ConstraintRange.Max)
  884. # _max = ConstraintRange.Max;
  885. # double z = _max - Range.Min;
  886. # if (z < ConstraintZoom.Min)
  887. # _max = Range.Min + ConstraintZoom.Min;
  888. # if (z > ConstraintZoom.Max)
  889. # _max = Range.Min + ConstraintZoom.Max;
  890. # if (_max <= Range.Min)
  891. # return false;
  892. # Range.Max = _max;
  893. # PickerTimeMax = ImPlotTime::FromDouble(Range.Max);
  894. # UpdateTransformCache();
  895. # return true;
  896. # }
  897. def set_max(self, _max: float, force: bool = False) -> bool:
  898. """(private API)"""
  899. pass
  900. # inline void SetRange(double v1, double v2) { /* original C++ signature */
  901. # Range.Min = ImMin(v1,v2);
  902. # Range.Max = ImMax(v1,v2);
  903. # Constrain();
  904. # PickerTimeMin = ImPlotTime::FromDouble(Range.Min);
  905. # PickerTimeMax = ImPlotTime::FromDouble(Range.Max);
  906. # UpdateTransformCache();
  907. # }
  908. @overload
  909. def set_range(self, v1: float, v2: float) -> None:
  910. """(private API)"""
  911. pass
  912. # inline void SetRange(const ImPlotRange& range) { /* original C++ signature */
  913. # SetRange(range.Min, range.Max);
  914. # }
  915. @overload
  916. def set_range(self, range: Range) -> None:
  917. """(private API)"""
  918. pass
  919. # inline void SetAspect(double unit_per_pix) { /* original C++ signature */
  920. # double new_size = unit_per_pix * PixelSize();
  921. # double delta = (new_size - Range.Size()) * 0.5;
  922. # if (IsLocked())
  923. # return;
  924. # else if (IsLockedMin() && !IsLockedMax())
  925. # SetRange(Range.Min, Range.Max + 2*delta);
  926. # else if (!IsLockedMin() && IsLockedMax())
  927. # SetRange(Range.Min - 2*delta, Range.Max);
  928. # else
  929. # SetRange(Range.Min - delta, Range.Max + delta);
  930. # }
  931. def set_aspect(self, unit_per_pix: float) -> None:
  932. """(private API)"""
  933. pass
  934. # inline float PixelSize() const { return ImAbs(PixelMax - PixelMin); } /* original C++ signature */
  935. def pixel_size(self) -> float:
  936. """(private API)"""
  937. pass
  938. # inline double GetAspect() const { return Range.Size() / PixelSize(); } /* original C++ signature */
  939. def get_aspect(self) -> float:
  940. """(private API)"""
  941. pass
  942. # inline void Constrain() { /* original C++ signature */
  943. # Range.Min = ImConstrainNan(ImConstrainInf(Range.Min));
  944. # Range.Max = ImConstrainNan(ImConstrainInf(Range.Max));
  945. # if (Range.Min < ConstraintRange.Min)
  946. # Range.Min = ConstraintRange.Min;
  947. # if (Range.Max > ConstraintRange.Max)
  948. # Range.Max = ConstraintRange.Max;
  949. # double z = Range.Size();
  950. # if (z < ConstraintZoom.Min) {
  951. # double delta = (ConstraintZoom.Min - z) * 0.5;
  952. # Range.Min -= delta;
  953. # Range.Max += delta;
  954. # }
  955. # if (z > ConstraintZoom.Max) {
  956. # double delta = (z - ConstraintZoom.Max) * 0.5;
  957. # Range.Min += delta;
  958. # Range.Max -= delta;
  959. # }
  960. # if (Range.Max <= Range.Min)
  961. # Range.Max = Range.Min + DBL_EPSILON;
  962. # }
  963. def constrain(self) -> None:
  964. """(private API)"""
  965. pass
  966. # inline void UpdateTransformCache() { /* original C++ signature */
  967. # ScaleToPixel = (PixelMax - PixelMin) / Range.Size();
  968. # if (TransformForward != nullptr) {
  969. # ScaleMin = TransformForward(Range.Min, TransformData);
  970. # ScaleMax = TransformForward(Range.Max, TransformData);
  971. # }
  972. # else {
  973. # ScaleMin = Range.Min;
  974. # ScaleMax = Range.Max;
  975. # }
  976. # }
  977. def update_transform_cache(self) -> None:
  978. """(private API)"""
  979. pass
  980. # inline float PlotToPixels(double plt) const { /* original C++ signature */
  981. # if (TransformForward != nullptr) {
  982. # double s = TransformForward(plt, TransformData);
  983. # double t = (s - ScaleMin) / (ScaleMax - ScaleMin);
  984. # plt = Range.Min + Range.Size() * t;
  985. # }
  986. # return (float)(PixelMin + ScaleToPixel * (plt - Range.Min));
  987. # }
  988. def plot_to_pixels(self, plt: float) -> float:
  989. """(private API)"""
  990. pass
  991. # inline double PixelsToPlot(float pix) const { /* original C++ signature */
  992. # double plt = (pix - PixelMin) / ScaleToPixel + Range.Min;
  993. # if (TransformInverse != nullptr) {
  994. # double t = (plt - Range.Min) / Range.Size();
  995. # double s = t * (ScaleMax - ScaleMin) + ScaleMin;
  996. # plt = TransformInverse(s, TransformData);
  997. # }
  998. # return plt;
  999. # }
  1000. def pixels_to_plot(self, pix: float) -> float:
  1001. """(private API)"""
  1002. pass
  1003. # inline void ExtendFit(double v) { /* original C++ signature */
  1004. # if (!ImNanOrInf(v) && v >= ConstraintRange.Min && v <= ConstraintRange.Max) {
  1005. # FitExtents.Min = v < FitExtents.Min ? v : FitExtents.Min;
  1006. # FitExtents.Max = v > FitExtents.Max ? v : FitExtents.Max;
  1007. # }
  1008. # }
  1009. def extend_fit(self, v: float) -> None:
  1010. """(private API)"""
  1011. pass
  1012. # inline void ExtendFitWith(ImPlotAxis& alt, double v, double v_alt) { /* original C++ signature */
  1013. # if (ImHasFlag(Flags, ImPlotAxisFlags_RangeFit) && !alt.Range.Contains(v_alt))
  1014. # return;
  1015. # if (!ImNanOrInf(v) && v >= ConstraintRange.Min && v <= ConstraintRange.Max) {
  1016. # FitExtents.Min = v < FitExtents.Min ? v : FitExtents.Min;
  1017. # FitExtents.Max = v > FitExtents.Max ? v : FitExtents.Max;
  1018. # }
  1019. # }
  1020. def extend_fit_with(self, alt: Axis, v: float, v_alt: float) -> None:
  1021. """(private API)"""
  1022. pass
  1023. # inline void ApplyFit(float padding) { /* original C++ signature */
  1024. # const double ext_size = FitExtents.Size() * 0.5;
  1025. # FitExtents.Min -= ext_size * padding;
  1026. # FitExtents.Max += ext_size * padding;
  1027. # if (!IsLockedMin() && !ImNanOrInf(FitExtents.Min))
  1028. # Range.Min = FitExtents.Min;
  1029. # if (!IsLockedMax() && !ImNanOrInf(FitExtents.Max))
  1030. # Range.Max = FitExtents.Max;
  1031. # if (ImAlmostEqual(Range.Min, Range.Max)) {
  1032. # Range.Max += 0.5;
  1033. # Range.Min -= 0.5;
  1034. # }
  1035. # Constrain();
  1036. # UpdateTransformCache();
  1037. # }
  1038. def apply_fit(self, padding: float) -> None:
  1039. """(private API)"""
  1040. pass
  1041. # inline bool HasLabel() const { return LabelOffset != -1 && !ImHasFlag(Flags, ImPlotAxisFlags_NoLabel); } /* original C++ signature */
  1042. def has_label(self) -> bool:
  1043. """(private API)"""
  1044. pass
  1045. # inline bool HasGridLines() const { return !ImHasFlag(Flags, ImPlotAxisFlags_NoGridLines); } /* original C++ signature */
  1046. def has_grid_lines(self) -> bool:
  1047. """(private API)"""
  1048. pass
  1049. # inline bool HasTickLabels() const { return !ImHasFlag(Flags, ImPlotAxisFlags_NoTickLabels); } /* original C++ signature */
  1050. def has_tick_labels(self) -> bool:
  1051. """(private API)"""
  1052. pass
  1053. # inline bool HasTickMarks() const { return !ImHasFlag(Flags, ImPlotAxisFlags_NoTickMarks); } /* original C++ signature */
  1054. def has_tick_marks(self) -> bool:
  1055. """(private API)"""
  1056. pass
  1057. # inline bool WillRender() const { return Enabled && (HasGridLines() || HasTickLabels() || HasTickMarks()); } /* original C++ signature */
  1058. def will_render(self) -> bool:
  1059. """(private API)"""
  1060. pass
  1061. # inline bool IsOpposite() const { return ImHasFlag(Flags, ImPlotAxisFlags_Opposite); } /* original C++ signature */
  1062. def is_opposite(self) -> bool:
  1063. """(private API)"""
  1064. pass
  1065. # inline bool IsInverted() const { return ImHasFlag(Flags, ImPlotAxisFlags_Invert); } /* original C++ signature */
  1066. def is_inverted(self) -> bool:
  1067. """(private API)"""
  1068. pass
  1069. # inline bool IsForeground() const { return ImHasFlag(Flags, ImPlotAxisFlags_Foreground); } /* original C++ signature */
  1070. def is_foreground(self) -> bool:
  1071. """(private API)"""
  1072. pass
  1073. # inline bool IsAutoFitting() const { return ImHasFlag(Flags, ImPlotAxisFlags_AutoFit); } /* original C++ signature */
  1074. def is_auto_fitting(self) -> bool:
  1075. """(private API)"""
  1076. pass
  1077. # inline bool CanInitFit() const { return !ImHasFlag(Flags, ImPlotAxisFlags_NoInitialFit) && !HasRange && !LinkedMin && !LinkedMax; } /* original C++ signature */
  1078. def can_init_fit(self) -> bool:
  1079. """(private API)"""
  1080. pass
  1081. # inline bool IsRangeLocked() const { return HasRange && RangeCond == ImPlotCond_Always; } /* original C++ signature */
  1082. def is_range_locked(self) -> bool:
  1083. """(private API)"""
  1084. pass
  1085. # inline bool IsLockedMin() const { return !Enabled || IsRangeLocked() || ImHasFlag(Flags, ImPlotAxisFlags_LockMin); } /* original C++ signature */
  1086. def is_locked_min(self) -> bool:
  1087. """(private API)"""
  1088. pass
  1089. # inline bool IsLockedMax() const { return !Enabled || IsRangeLocked() || ImHasFlag(Flags, ImPlotAxisFlags_LockMax); } /* original C++ signature */
  1090. def is_locked_max(self) -> bool:
  1091. """(private API)"""
  1092. pass
  1093. # inline bool IsLocked() const { return IsLockedMin() && IsLockedMax(); } /* original C++ signature */
  1094. def is_locked(self) -> bool:
  1095. """(private API)"""
  1096. pass
  1097. # inline bool IsInputLockedMin() const { return IsLockedMin() || IsAutoFitting(); } /* original C++ signature */
  1098. def is_input_locked_min(self) -> bool:
  1099. """(private API)"""
  1100. pass
  1101. # inline bool IsInputLockedMax() const { return IsLockedMax() || IsAutoFitting(); } /* original C++ signature */
  1102. def is_input_locked_max(self) -> bool:
  1103. """(private API)"""
  1104. pass
  1105. # inline bool IsInputLocked() const { return IsLocked() || IsAutoFitting(); } /* original C++ signature */
  1106. def is_input_locked(self) -> bool:
  1107. """(private API)"""
  1108. pass
  1109. # inline bool HasMenus() const { return !ImHasFlag(Flags, ImPlotAxisFlags_NoMenus); } /* original C++ signature */
  1110. def has_menus(self) -> bool:
  1111. """(private API)"""
  1112. pass
  1113. # inline bool IsPanLocked(bool increasing) { /* original C++ signature */
  1114. # if (ImHasFlag(Flags, ImPlotAxisFlags_PanStretch)) {
  1115. # return IsInputLocked();
  1116. # }
  1117. # else {
  1118. # if (IsLockedMin() || IsLockedMax() || IsAutoFitting())
  1119. # return false;
  1120. # if (increasing)
  1121. # return Range.Max == ConstraintRange.Max;
  1122. # else
  1123. # return Range.Min == ConstraintRange.Min;
  1124. # }
  1125. # }
  1126. def is_pan_locked(self, increasing: bool) -> bool:
  1127. """(private API)"""
  1128. pass
  1129. # void PushLinks() { /* original C++ signature */
  1130. # if (LinkedMin) { *LinkedMin = Range.Min; }
  1131. # if (LinkedMax) { *LinkedMax = Range.Max; }
  1132. # }
  1133. def push_links(self) -> None:
  1134. """(private API)"""
  1135. pass
  1136. # void PullLinks() { /* original C++ signature */
  1137. # if (LinkedMin && LinkedMax) { SetRange(*LinkedMin, *LinkedMax); }
  1138. # else if (LinkedMin) { SetMin(*LinkedMin,true); }
  1139. # else if (LinkedMax) { SetMax(*LinkedMax,true); }
  1140. # }
  1141. def pull_links(self) -> None:
  1142. """(private API)"""
  1143. pass
  1144. class AlignmentData:
  1145. """ Align plots group data"""
  1146. # bool Vertical; /* original C++ signature */
  1147. vertical: bool
  1148. # float PadA; /* original C++ signature */
  1149. pad_a: float
  1150. # float PadB; /* original C++ signature */
  1151. pad_b: float
  1152. # float PadAMax; /* original C++ signature */
  1153. pad_a_max: float
  1154. # float PadBMax; /* original C++ signature */
  1155. pad_b_max: float
  1156. # ImPlotAlignmentData() { /* original C++ signature */
  1157. # Vertical = true;
  1158. # PadA = PadB = PadAMax = PadBMax = 0;
  1159. # }
  1160. def __init__(self) -> None:
  1161. pass
  1162. # void Begin() { PadAMax = PadBMax = 0; } /* original C++ signature */
  1163. def begin(self) -> None:
  1164. """(private API)"""
  1165. pass
  1166. # void Update(float& pad_a, float& pad_b, float& delta_a, float& delta_b) { /* original C++ signature */
  1167. # float bak_a = pad_a; float bak_b = pad_b;
  1168. # if (PadAMax < pad_a) { PadAMax = pad_a; }
  1169. # if (PadBMax < pad_b) { PadBMax = pad_b; }
  1170. # if (pad_a < PadA) { pad_a = PadA; delta_a = pad_a - bak_a; } else { delta_a = 0; }
  1171. # if (pad_b < PadB) { pad_b = PadB; delta_b = pad_b - bak_b; } else { delta_b = 0; }
  1172. # }
  1173. def update(self, pad_a: float, pad_b: float, delta_a: float, delta_b: float) -> Tuple[float, float, float, float]:
  1174. """(private API)"""
  1175. pass
  1176. # void End() { PadA = PadAMax; PadB = PadBMax; } /* original C++ signature */
  1177. def end(self) -> None:
  1178. """(private API)"""
  1179. pass
  1180. # void Reset() { PadA = PadB = PadAMax = PadBMax = 0; } /* original C++ signature */
  1181. def reset(self) -> None:
  1182. """(private API)"""
  1183. pass
  1184. class Item:
  1185. """ State information for Plot items"""
  1186. # ImGuiID ID; /* original C++ signature */
  1187. id_: ID
  1188. # ImU32 Color; /* original C++ signature */
  1189. color: ImU32
  1190. # ImPlotMarker Marker; /* original C++ signature */
  1191. marker: Marker
  1192. # ImRect LegendHoverRect; /* original C++ signature */
  1193. legend_hover_rect: ImRect
  1194. # int NameOffset; /* original C++ signature */
  1195. name_offset: int
  1196. # bool Show; /* original C++ signature */
  1197. show: bool
  1198. # bool LegendHovered; /* original C++ signature */
  1199. legend_hovered: bool
  1200. # bool SeenThisFrame; /* original C++ signature */
  1201. seen_this_frame: bool
  1202. # ImPlotItem() { /* original C++ signature */
  1203. # ID = 0;
  1204. # Color = IM_COL32_WHITE;
  1205. # Marker = ImPlotMarker_None;
  1206. # NameOffset = -1;
  1207. # Show = true;
  1208. # SeenThisFrame = false;
  1209. # LegendHovered = false;
  1210. # }
  1211. def __init__(self) -> None:
  1212. pass
  1213. class Legend:
  1214. """ Holds Legend state"""
  1215. # ImPlotLegendFlags Flags; /* original C++ signature */
  1216. flags: LegendFlags
  1217. # ImPlotLegendFlags PreviousFlags; /* original C++ signature */
  1218. previous_flags: LegendFlags
  1219. # ImPlotLocation Location; /* original C++ signature */
  1220. location: Location
  1221. # ImPlotLocation PreviousLocation; /* original C++ signature */
  1222. previous_location: Location
  1223. # ImVec2 Scroll; /* original C++ signature */
  1224. scroll: ImVec2
  1225. # ImVector<int> Indices; /* original C++ signature */
  1226. indices: ImVector_int
  1227. # ImGuiTextBuffer Labels; /* original C++ signature */
  1228. labels: TextBuffer
  1229. # ImRect Rect; /* original C++ signature */
  1230. rect: ImRect
  1231. # ImRect RectClamped; /* original C++ signature */
  1232. rect_clamped: ImRect
  1233. # bool Hovered; /* original C++ signature */
  1234. hovered: bool
  1235. # bool Held; /* original C++ signature */
  1236. held: bool
  1237. # bool CanGoInside; /* original C++ signature */
  1238. can_go_inside: bool
  1239. # ImPlotLegend() { /* original C++ signature */
  1240. # Flags = PreviousFlags = ImPlotLegendFlags_None;
  1241. # CanGoInside = true;
  1242. # Hovered = Held = false;
  1243. # Location = PreviousLocation = ImPlotLocation_NorthWest;
  1244. # Scroll = ImVec2(0,0);
  1245. # }
  1246. def __init__(self) -> None:
  1247. pass
  1248. # void Reset() { Indices.shrink(0); Labels.Buf.shrink(0); } /* original C++ signature */
  1249. def reset(self) -> None:
  1250. """(private API)"""
  1251. pass
  1252. class ItemGroup:
  1253. """ Holds Items and Legend data"""
  1254. # ImGuiID ID; /* original C++ signature */
  1255. id_: ID
  1256. # ImPlotLegend Legend; /* original C++ signature */
  1257. legend: Legend
  1258. # int ColormapIdx; /* original C++ signature */
  1259. colormap_idx: int
  1260. # ImPlotMarker MarkerIdx; /* original C++ signature */
  1261. marker_idx: Marker
  1262. # ImPlotItemGroup() { ID = 0; ColormapIdx = 0; MarkerIdx = 0; } /* original C++ signature */
  1263. def __init__(self) -> None:
  1264. pass
  1265. # int GetItemCount() const { return ItemPool.GetBufSize(); } /* original C++ signature */
  1266. def get_item_count(self) -> int:
  1267. """(private API)"""
  1268. pass
  1269. # ImGuiID GetItemID(const char* label_id) { return ImGui::GetID(label_id); /* GetIDWithSeed */ } /* original C++ signature */
  1270. def get_item_id(self, label_id: str) -> ID:
  1271. """(private API)"""
  1272. pass
  1273. # ImPlotItem* GetItem(ImGuiID id) { return ItemPool.GetByKey(id); } /* original C++ signature */
  1274. @overload
  1275. def get_item(self, id_: ID) -> Item:
  1276. """(private API)"""
  1277. pass
  1278. # ImPlotItem* GetItem(const char* label_id) { return GetItem(GetItemID(label_id)); } /* original C++ signature */
  1279. @overload
  1280. def get_item(self, label_id: str) -> Item:
  1281. """(private API)"""
  1282. pass
  1283. # ImPlotItem* GetOrAddItem(ImGuiID id) { return ItemPool.GetOrAddByKey(id); } /* original C++ signature */
  1284. def get_or_add_item(self, id_: ID) -> Item:
  1285. """(private API)"""
  1286. pass
  1287. # ImPlotItem* GetItemByIndex(int i) { return ItemPool.GetByIndex(i); } /* original C++ signature */
  1288. def get_item_by_index(self, i: int) -> Item:
  1289. """(private API)"""
  1290. pass
  1291. # int GetItemIndex(ImPlotItem* item) { return ItemPool.GetIndex(item); } /* original C++ signature */
  1292. def get_item_index(self, item: Item) -> int:
  1293. """(private API)"""
  1294. pass
  1295. # int GetLegendCount() const { return Legend.Indices.size(); } /* original C++ signature */
  1296. def get_legend_count(self) -> int:
  1297. """(private API)"""
  1298. pass
  1299. # ImPlotItem* GetLegendItem(int i) { return ItemPool.GetByIndex(Legend.Indices[i]); } /* original C++ signature */
  1300. def get_legend_item(self, i: int) -> Item:
  1301. """(private API)"""
  1302. pass
  1303. # const char* GetLegendLabel(int i) { return Legend.Labels.Buf.Data + GetLegendItem(i)->NameOffset; } /* original C++ signature */
  1304. def get_legend_label(self, i: int) -> str:
  1305. """(private API)"""
  1306. pass
  1307. # void Reset() { ItemPool.Clear(); Legend.Reset(); ColormapIdx = 0; } /* original C++ signature */
  1308. def reset(self) -> None:
  1309. """(private API)"""
  1310. pass
  1311. class Plot:
  1312. """ Holds Plot state information that must persist after EndPlot"""
  1313. # ImGuiID ID; /* original C++ signature */
  1314. id_: ID
  1315. # ImPlotFlags Flags; /* original C++ signature */
  1316. flags: Flags
  1317. # ImPlotFlags PreviousFlags; /* original C++ signature */
  1318. previous_flags: Flags
  1319. # ImPlotLocation MouseTextLocation; /* original C++ signature */
  1320. mouse_text_location: Location
  1321. # ImPlotMouseTextFlags MouseTextFlags; /* original C++ signature */
  1322. mouse_text_flags: MouseTextFlags
  1323. # ImGuiTextBuffer TextBuffer; /* original C++ signature */
  1324. text_buffer: TextBuffer
  1325. # ImPlotItemGroup Items; /* original C++ signature */
  1326. items: ItemGroup
  1327. # ImAxis CurrentX; /* original C++ signature */
  1328. current_x: ImAxis
  1329. # ImAxis CurrentY; /* original C++ signature */
  1330. current_y: ImAxis
  1331. # ImRect FrameRect; /* original C++ signature */
  1332. frame_rect: ImRect
  1333. # ImRect CanvasRect; /* original C++ signature */
  1334. canvas_rect: ImRect
  1335. # ImRect PlotRect; /* original C++ signature */
  1336. plot_rect: ImRect
  1337. # ImRect AxesRect; /* original C++ signature */
  1338. axes_rect: ImRect
  1339. # ImRect SelectRect; /* original C++ signature */
  1340. select_rect: ImRect
  1341. # ImVec2 SelectStart; /* original C++ signature */
  1342. select_start: ImVec2
  1343. # int TitleOffset; /* original C++ signature */
  1344. title_offset: int
  1345. # bool JustCreated; /* original C++ signature */
  1346. just_created: bool
  1347. # bool Initialized; /* original C++ signature */
  1348. initialized: bool
  1349. # bool SetupLocked; /* original C++ signature */
  1350. setup_locked: bool
  1351. # bool FitThisFrame; /* original C++ signature */
  1352. fit_this_frame: bool
  1353. # bool Hovered; /* original C++ signature */
  1354. hovered: bool
  1355. # bool Held; /* original C++ signature */
  1356. held: bool
  1357. # bool Selecting; /* original C++ signature */
  1358. selecting: bool
  1359. # bool Selected; /* original C++ signature */
  1360. selected: bool
  1361. # bool ContextLocked; /* original C++ signature */
  1362. context_locked: bool
  1363. # ImPlotPlot() { /* original C++ signature */
  1364. # Flags = PreviousFlags = ImPlotFlags_None;
  1365. # for (int i = 0; i < IMPLOT_NUM_X_AXES; ++i)
  1366. # XAxis(i).Vertical = false;
  1367. # for (int i = 0; i < IMPLOT_NUM_Y_AXES; ++i)
  1368. # YAxis(i).Vertical = true;
  1369. # SelectStart = ImVec2(0,0);
  1370. # CurrentX = ImAxis_X1;
  1371. # CurrentY = ImAxis_Y1;
  1372. # MouseTextLocation = ImPlotLocation_South | ImPlotLocation_East;
  1373. # MouseTextFlags = ImPlotMouseTextFlags_None;
  1374. # TitleOffset = -1;
  1375. # JustCreated = true;
  1376. # Initialized = SetupLocked = FitThisFrame = false;
  1377. # Hovered = Held = Selected = Selecting = ContextLocked = false;
  1378. # }
  1379. def __init__(self) -> None:
  1380. pass
  1381. # inline bool IsInputLocked() const { /* original C++ signature */
  1382. # for (int i = 0; i < IMPLOT_NUM_X_AXES; ++i) {
  1383. # if (!XAxis(i).IsInputLocked())
  1384. # return false;
  1385. # }
  1386. # for (int i = 0; i < IMPLOT_NUM_Y_AXES; ++i) {
  1387. # if (!YAxis(i).IsInputLocked())
  1388. # return false;
  1389. # }
  1390. # return true;
  1391. # }
  1392. def is_input_locked(self) -> bool:
  1393. """(private API)"""
  1394. pass
  1395. # inline void ClearTextBuffer() { TextBuffer.Buf.shrink(0); } /* original C++ signature */
  1396. def clear_text_buffer(self) -> None:
  1397. """(private API)"""
  1398. pass
  1399. # inline void SetTitle(const char* title) { /* original C++ signature */
  1400. # if (title && ImGui::FindRenderedTextEnd(title, nullptr) != title) {
  1401. # TitleOffset = TextBuffer.size();
  1402. # TextBuffer.append(title, title + strlen(title) + 1);
  1403. # }
  1404. # else {
  1405. # TitleOffset = -1;
  1406. # }
  1407. # }
  1408. def set_title(self, title: str) -> None:
  1409. """(private API)"""
  1410. pass
  1411. # inline bool HasTitle() const { return TitleOffset != -1 && !ImHasFlag(Flags, ImPlotFlags_NoTitle); } /* original C++ signature */
  1412. def has_title(self) -> bool:
  1413. """(private API)"""
  1414. pass
  1415. # inline const char* GetTitle() const { return TextBuffer.Buf.Data + TitleOffset; } /* original C++ signature */
  1416. def get_title(self) -> str:
  1417. """(private API)"""
  1418. pass
  1419. # inline ImPlotAxis& XAxis(int i) { return Axes[ImAxis_X1 + i]; } /* original C++ signature */
  1420. def x_axis(self, i: int) -> Axis:
  1421. """(private API)"""
  1422. pass
  1423. # inline ImPlotAxis& YAxis(int i) { return Axes[ImAxis_Y1 + i]; } /* original C++ signature */
  1424. def y_axis(self, i: int) -> Axis:
  1425. """(private API)"""
  1426. pass
  1427. # inline int EnabledAxesX() { /* original C++ signature */
  1428. # int cnt = 0;
  1429. # for (int i = 0; i < IMPLOT_NUM_X_AXES; ++i)
  1430. # cnt += XAxis(i).Enabled;
  1431. # return cnt;
  1432. # }
  1433. def enabled_axes_x(self) -> int:
  1434. """(private API)"""
  1435. pass
  1436. # inline int EnabledAxesY() { /* original C++ signature */
  1437. # int cnt = 0;
  1438. # for (int i = 0; i < IMPLOT_NUM_Y_AXES; ++i)
  1439. # cnt += YAxis(i).Enabled;
  1440. # return cnt;
  1441. # }
  1442. def enabled_axes_y(self) -> int:
  1443. """(private API)"""
  1444. pass
  1445. # inline void SetAxisLabel(ImPlotAxis& axis, const char* label) { /* original C++ signature */
  1446. # if (label && ImGui::FindRenderedTextEnd(label, nullptr) != label) {
  1447. # axis.LabelOffset = TextBuffer.size();
  1448. # TextBuffer.append(label, label + strlen(label) + 1);
  1449. # }
  1450. # else {
  1451. # axis.LabelOffset = -1;
  1452. # }
  1453. # }
  1454. def set_axis_label(self, axis: Axis, label: str) -> None:
  1455. """(private API)"""
  1456. pass
  1457. # inline const char* GetAxisLabel(const ImPlotAxis& axis) const { return TextBuffer.Buf.Data + axis.LabelOffset; } /* original C++ signature */
  1458. def get_axis_label(self, axis: Axis) -> str:
  1459. """(private API)"""
  1460. pass
  1461. class Subplot:
  1462. """ Holds subplot data that must persist after EndSubplot"""
  1463. # ImGuiID ID; /* original C++ signature */
  1464. id_: ID
  1465. # ImPlotSubplotFlags Flags; /* original C++ signature */
  1466. flags: SubplotFlags
  1467. # ImPlotSubplotFlags PreviousFlags; /* original C++ signature */
  1468. previous_flags: SubplotFlags
  1469. # ImPlotItemGroup Items; /* original C++ signature */
  1470. items: ItemGroup
  1471. # int Rows; /* original C++ signature */
  1472. rows: int
  1473. # int Cols; /* original C++ signature */
  1474. cols: int
  1475. # int CurrentIdx; /* original C++ signature */
  1476. current_idx: int
  1477. # ImRect FrameRect; /* original C++ signature */
  1478. frame_rect: ImRect
  1479. # ImRect GridRect; /* original C++ signature */
  1480. grid_rect: ImRect
  1481. # ImVec2 CellSize; /* original C++ signature */
  1482. cell_size: ImVec2
  1483. # ImVector<float> RowRatios; /* original C++ signature */
  1484. row_ratios: ImVector_float
  1485. # ImVector<float> ColRatios; /* original C++ signature */
  1486. col_ratios: ImVector_float
  1487. # float TempSizes[2]; /* original C++ signature */
  1488. temp_sizes: np.ndarray # ndarray[type=float, size=2]
  1489. # bool FrameHovered; /* original C++ signature */
  1490. frame_hovered: bool
  1491. # bool HasTitle; /* original C++ signature */
  1492. has_title: bool
  1493. # ImPlotSubplot() { /* original C++ signature */
  1494. # ID = 0;
  1495. # Flags = PreviousFlags = ImPlotSubplotFlags_None;
  1496. # Rows = Cols = CurrentIdx = 0;
  1497. # Items.Legend.Location = ImPlotLocation_North;
  1498. # Items.Legend.Flags = ImPlotLegendFlags_Horizontal|ImPlotLegendFlags_Outside;
  1499. # Items.Legend.CanGoInside = false;
  1500. # TempSizes[0] = TempSizes[1] = 0;
  1501. # FrameHovered = false;
  1502. # HasTitle = false;
  1503. # }
  1504. def __init__(self) -> None:
  1505. pass
  1506. class NextPlotData:
  1507. """ Temporary data storage for upcoming plot"""
  1508. # ImPlotNextPlotData() { Reset(); } /* original C++ signature */
  1509. def __init__(self) -> None:
  1510. pass
  1511. # void Reset() { /* original C++ signature */
  1512. # for (int i = 0; i < ImAxis_COUNT; ++i) {
  1513. # HasRange[i] = false;
  1514. # Fit[i] = false;
  1515. # LinkedMin[i] = LinkedMax[i] = nullptr;
  1516. # }
  1517. # }
  1518. def reset(self) -> None:
  1519. """(private API)"""
  1520. pass
  1521. class NextItemData:
  1522. """ Temporary data storage for upcoming item"""
  1523. # ImPlotSpec Spec; /* original C++ signature */
  1524. spec: Spec
  1525. # bool RenderLine; /* original C++ signature */
  1526. render_line: bool
  1527. # bool RenderFill; /* original C++ signature */
  1528. render_fill: bool
  1529. # bool RenderMarkerLine; /* original C++ signature */
  1530. render_marker_line: bool
  1531. # bool RenderMarkerFill; /* original C++ signature */
  1532. render_marker_fill: bool
  1533. # bool RenderMarkers; /* original C++ signature */
  1534. render_markers: bool
  1535. # bool HasHidden; /* original C++ signature */
  1536. has_hidden: bool
  1537. # bool Hidden; /* original C++ signature */
  1538. hidden: bool
  1539. # ImPlotCond HiddenCond; /* original C++ signature */
  1540. hidden_cond: Cond
  1541. # ImPlotNextItemData() { Reset(); } /* original C++ signature */
  1542. def __init__(self) -> None:
  1543. pass
  1544. # void Reset() { /* original C++ signature */
  1545. # Spec = ImPlotSpec();
  1546. # HasHidden = Hidden = false;
  1547. # HiddenCond = ImPlotCond_None;
  1548. # }
  1549. def reset(self) -> None:
  1550. """(private API)"""
  1551. pass
  1552. class Context:
  1553. """ Holds state information that must persist between calls to BeginPlot()/EndPlot()"""
  1554. # Plot States
  1555. # ImPlotPlot* CurrentPlot; /* original C++ signature */
  1556. current_plot: Plot
  1557. # ImPlotSubplot* CurrentSubplot; /* original C++ signature */
  1558. current_subplot: Subplot
  1559. # ImPlotItemGroup* CurrentItems; /* original C++ signature */
  1560. current_items: ItemGroup
  1561. # ImPlotItem* CurrentItem; /* original C++ signature */
  1562. current_item: Item
  1563. # ImPlotItem* PreviousItem; /* original C++ signature */
  1564. previous_item: Item
  1565. # ImPlotTicker CTicker; /* original C++ signature */
  1566. # Tick Marks and Labels
  1567. c_ticker: Ticker
  1568. # Annotation and Tabs
  1569. # ImPlotAnnotationCollection Annotations; /* original C++ signature */
  1570. annotations: AnnotationCollection
  1571. # ImPlotTagCollection Tags; /* original C++ signature */
  1572. tags: TagCollection
  1573. # Style and Colormaps
  1574. # ImPlotStyle Style; /* original C++ signature */
  1575. style: Style
  1576. # ImVector<ImGuiColorMod> ColorModifiers; /* original C++ signature */
  1577. color_modifiers: ImVector_ColorMod
  1578. # ImVector<ImGuiStyleMod> StyleModifiers; /* original C++ signature */
  1579. style_modifiers: ImVector_StyleMod
  1580. # ImPlotColormapData ColormapData; /* original C++ signature */
  1581. colormap_data: ColormapData
  1582. # Temp data for general use
  1583. # ImVector<int> TempInt1; /* original C++ signature */
  1584. temp_int1: ImVector_int
  1585. # Misc
  1586. # int DigitalPlotItemCnt; /* original C++ signature */
  1587. digital_plot_item_cnt: int
  1588. # int DigitalPlotOffset; /* original C++ signature */
  1589. digital_plot_offset: int
  1590. # ImPlotNextPlotData NextPlotData; /* original C++ signature */
  1591. next_plot_data: NextPlotData
  1592. # ImPlotNextItemData NextItemData; /* original C++ signature */
  1593. next_item_data: NextItemData
  1594. # ImPlotInputMap InputMap; /* original C++ signature */
  1595. input_map: InputMap
  1596. # bool OpenContextThisFrame; /* original C++ signature */
  1597. open_context_this_frame: bool
  1598. # ImGuiTextBuffer MousePosStringBuilder; /* original C++ signature */
  1599. mouse_pos_string_builder: TextBuffer
  1600. # ImPlotItemGroup* SortItems; /* original C++ signature */
  1601. sort_items: ItemGroup
  1602. # Align plots
  1603. # ImPlotAlignmentData* CurrentAlignmentH; /* original C++ signature */
  1604. current_alignment_h: AlignmentData
  1605. # ImPlotAlignmentData* CurrentAlignmentV; /* original C++ signature */
  1606. current_alignment_v: AlignmentData
  1607. # bool CanDragPlotInNodeEditor = false; /* original C++ signature */
  1608. # Specific to ImGui Bundle, when used inside imgui-node-editor
  1609. can_drag_plot_in_node_editor: bool = False
  1610. # ImPlotContext(ImPlotTicker CTicker = ImPlotTicker(), ImPlotAnnotationCollection Annotations = ImPlotAnnotationCollection(), ImPlotTagCollection Tags = ImPlotTagCollection(), ImPlotStyle Style = ImPlotStyle(), ImVector<ImGuiColorMod> ColorModifiers = ImVector<ImGuiColorMod>(), ImVector<ImGuiStyleMod> StyleModifiers = ImVector<ImGuiStyleMod>(), ImPlotColormapData ColormapData = ImPlotColormapData(), ImVector<int> TempInt1 = ImVector<int>(), int DigitalPlotItemCnt = int(), int DigitalPlotOffset = int(), ImPlotNextPlotData NextPlotData = ImPlotNextPlotData(), ImPlotNextItemData NextItemData = ImPlotNextItemData(), ImPlotInputMap InputMap = ImPlotInputMap(), bool OpenContextThisFrame = bool(), ImGuiTextBuffer MousePosStringBuilder = ImGuiTextBuffer(), bool CanDragPlotInNodeEditor = false); /* original C++ signature */
  1611. def __init__(self, c_ticker: Optional[Ticker] = None, annotations: Optional[AnnotationCollection] = None, tags: Optional[TagCollection] = None, style: Optional[Style] = None, color_modifiers: Optional[ImVector_ColorMod] = None, style_modifiers: Optional[ImVector_StyleMod] = None, colormap_data: Optional[ColormapData] = None, temp_int1: Optional[ImVector_int] = None, digital_plot_item_cnt: int = int(), digital_plot_offset: int = int(), next_plot_data: Optional[NextPlotData] = None, next_item_data: Optional[NextItemData] = None, input_map: Optional[InputMap] = None, open_context_this_frame: bool = bool(), mouse_pos_string_builder: Optional[TextBuffer] = None, can_drag_plot_in_node_editor: bool = False) -> None:
  1612. """Auto-generated default constructor with named params
  1613. Python bindings defaults:
  1614. If any of the params below is None, then its default value below will be used:
  1615. * CTicker: Ticker()
  1616. * Annotations: AnnotationCollection()
  1617. * Tags: TagCollection()
  1618. * Style: Style()
  1619. * ColorModifiers: ImVector_ColorMod()
  1620. * StyleModifiers: ImVector_StyleMod()
  1621. * ColormapData: ColormapData()
  1622. * TempInt1: ImVector_int()
  1623. * NextPlotData: NextPlotData()
  1624. * NextItemData: NextItemData()
  1625. * InputMap: InputMap()
  1626. * MousePosStringBuilder: TextBuffer()
  1627. """
  1628. pass
  1629. #-----------------------------------------------------------------------------
  1630. # [SECTION] Internal API
  1631. # No guarantee of forward compatibility here!
  1632. #-----------------------------------------------------------------------------
  1633. #-----------------------------------------------------------------------------
  1634. # [SECTION] Context Utils
  1635. #-----------------------------------------------------------------------------
  1636. # IMPLOT_API void Initialize(ImPlotContext* ctx); /* original C++ signature */
  1637. def initialize(ctx: Context) -> None:
  1638. """ Initializes an ImPlotContext"""
  1639. pass
  1640. # IMPLOT_API void ResetCtxForNextPlot(ImPlotContext* ctx); /* original C++ signature */
  1641. def reset_ctx_for_next_plot(ctx: Context) -> None:
  1642. """ Resets an ImPlot context for the next call to BeginPlot"""
  1643. pass
  1644. # IMPLOT_API void ResetCtxForNextAlignedPlots(ImPlotContext* ctx); /* original C++ signature */
  1645. def reset_ctx_for_next_aligned_plots(ctx: Context) -> None:
  1646. """ Resets an ImPlot context for the next call to BeginAlignedPlots"""
  1647. pass
  1648. # IMPLOT_API void ResetCtxForNextSubplot(ImPlotContext* ctx); /* original C++ signature */
  1649. def reset_ctx_for_next_subplot(ctx: Context) -> None:
  1650. """ Resets an ImPlot context for the next call to BeginSubplot"""
  1651. pass
  1652. #-----------------------------------------------------------------------------
  1653. # [SECTION] Plot Utils
  1654. #-----------------------------------------------------------------------------
  1655. # IMPLOT_API ImPlotPlot* GetPlot(const char* title); /* original C++ signature */
  1656. def get_plot(title: str) -> Plot:
  1657. """ Gets a plot from the current ImPlotContext"""
  1658. pass
  1659. # IMPLOT_API ImPlotPlot* GetCurrentPlot(); /* original C++ signature */
  1660. def get_current_plot() -> Plot:
  1661. """ Gets the current plot from the current ImPlotContext"""
  1662. pass
  1663. # IMPLOT_API void BustPlotCache(); /* original C++ signature */
  1664. def bust_plot_cache() -> None:
  1665. """ Busts the cache for every plot in the current context"""
  1666. pass
  1667. # IMPLOT_API void ShowPlotContextMenu(ImPlotPlot& plot); /* original C++ signature */
  1668. def show_plot_context_menu(plot: Plot) -> None:
  1669. """ Shows a plot's context menu."""
  1670. pass
  1671. #-----------------------------------------------------------------------------
  1672. # [SECTION] Setup Utils
  1673. #-----------------------------------------------------------------------------
  1674. # static inline void SetupLock() { /* original C++ signature */
  1675. # ImPlotContext& gp = *GImPlot;
  1676. # if (!gp.CurrentPlot->SetupLocked)
  1677. # SetupFinish();
  1678. # gp.CurrentPlot->SetupLocked = true;
  1679. # }
  1680. def setup_lock() -> None:
  1681. """ Lock Setup and call SetupFinish if necessary.
  1682. (private API)
  1683. """
  1684. pass
  1685. #-----------------------------------------------------------------------------
  1686. # [SECTION] Subplot Utils
  1687. #-----------------------------------------------------------------------------
  1688. # IMPLOT_API void SubplotNextCell(); /* original C++ signature */
  1689. def subplot_next_cell() -> None:
  1690. """ Advances to next subplot"""
  1691. pass
  1692. # IMPLOT_API void ShowSubplotsContextMenu(ImPlotSubplot& subplot); /* original C++ signature */
  1693. def show_subplots_context_menu(subplot: Subplot) -> None:
  1694. """ Shows a subplot's context menu."""
  1695. pass
  1696. #-----------------------------------------------------------------------------
  1697. # [SECTION] Item Utils
  1698. #-----------------------------------------------------------------------------
  1699. # IMPLOT_API bool BeginItem(const char* label_id, const ImPlotSpec& spec = ImPlotSpec(), const ImVec4& item_col = IMPLOT_AUTO_COL, ImPlotMarker item_mkr = ImPlotMarker_Invalid); /* original C++ signature */
  1700. def begin_item(label_id: str, spec: Optional[Spec] = None, item_col: Optional[ImVec4Like] = None, item_mkr: Optional[Marker] = None) -> bool:
  1701. """ Begins a new item. Returns False if the item should not be plotted. Pushes PlotClipRect.
  1702. Python bindings defaults:
  1703. If any of the params below is None, then its default value below will be used:
  1704. * spec: Spec()
  1705. * item_col: IMPLOT_AUTO_COL
  1706. * item_mkr: Marker_Invalid
  1707. """
  1708. pass
  1709. # IMPLOT_API void EndItem(); /* original C++ signature */
  1710. def end_item() -> None:
  1711. """ Ends an item (call only if BeginItem returns True). Pops PlotClipRect."""
  1712. pass
  1713. # IMPLOT_API ImPlotItem* RegisterOrGetItem(const char* label_id, ImPlotItemFlags flags, bool* just_created = nullptr); /* original C++ signature */
  1714. def register_or_get_item(label_id: str, flags: ItemFlags, just_created: Optional[bool] = None) -> Tuple[Item , Optional[bool]]:
  1715. """ Register or get an existing item from the current plot."""
  1716. pass
  1717. # IMPLOT_API ImPlotItem* GetItem(const char* label_id); /* original C++ signature */
  1718. def get_item(label_id: str) -> Item:
  1719. """ Get a plot item from the current plot."""
  1720. pass
  1721. # IMPLOT_API ImPlotItem* GetCurrentItem(); /* original C++ signature */
  1722. def get_current_item() -> Item:
  1723. """ Gets the current item."""
  1724. pass
  1725. # IMPLOT_API void BustItemCache(); /* original C++ signature */
  1726. def bust_item_cache() -> None:
  1727. """ Busts the cache for every item for every plot in the current context."""
  1728. pass
  1729. #-----------------------------------------------------------------------------
  1730. # [SECTION] Axis Utils
  1731. #-----------------------------------------------------------------------------
  1732. # static inline bool AnyAxesInputLocked(ImPlotAxis* axes, int count) { /* original C++ signature */
  1733. # for (int i = 0; i < count; ++i) {
  1734. # if (axes[i].Enabled && axes[i].IsInputLocked())
  1735. # return true;
  1736. # }
  1737. # return false;
  1738. # }
  1739. def any_axes_input_locked(axes: Axis, count: int) -> bool:
  1740. """ Returns True if any enabled axis is locked from user input.
  1741. (private API)
  1742. """
  1743. pass
  1744. # static inline bool AllAxesInputLocked(ImPlotAxis* axes, int count) { /* original C++ signature */
  1745. # for (int i = 0; i < count; ++i) {
  1746. # if (axes[i].Enabled && !axes[i].IsInputLocked())
  1747. # return false;
  1748. # }
  1749. # return true;
  1750. # }
  1751. def all_axes_input_locked(axes: Axis, count: int) -> bool:
  1752. """ Returns True if all enabled axes are locked from user input.
  1753. (private API)
  1754. """
  1755. pass
  1756. # static inline bool AnyAxesHeld(ImPlotAxis* axes, int count) { /* original C++ signature */
  1757. # for (int i = 0; i < count; ++i) {
  1758. # if (axes[i].Enabled && axes[i].Held)
  1759. # return true;
  1760. # }
  1761. # return false;
  1762. # }
  1763. def any_axes_held(axes: Axis, count: int) -> bool:
  1764. """(private API)"""
  1765. pass
  1766. # static inline bool AnyAxesHovered(ImPlotAxis* axes, int count) { /* original C++ signature */
  1767. # for (int i = 0; i < count; ++i) {
  1768. # if (axes[i].Enabled && axes[i].Hovered)
  1769. # return true;
  1770. # }
  1771. # return false;
  1772. # }
  1773. def any_axes_hovered(axes: Axis, count: int) -> bool:
  1774. """(private API)"""
  1775. pass
  1776. # static inline bool FitThisFrame() { /* original C++ signature */
  1777. # return GImPlot->CurrentPlot->FitThisFrame;
  1778. # }
  1779. def fit_this_frame() -> bool:
  1780. """ Returns True if the user has requested data to be fit.
  1781. (private API)
  1782. """
  1783. pass
  1784. # static inline void FitPointX(double x) { /* original C++ signature */
  1785. # ImPlotPlot& plot = *GetCurrentPlot();
  1786. # ImPlotAxis& x_axis = plot.Axes[plot.CurrentX];
  1787. # x_axis.ExtendFit(x);
  1788. # }
  1789. def fit_point_x(x: float) -> None:
  1790. """ Extends the current plot's axes so that it encompasses a vertical line at x
  1791. (private API)
  1792. """
  1793. pass
  1794. # static inline void FitPointY(double y) { /* original C++ signature */
  1795. # ImPlotPlot& plot = *GetCurrentPlot();
  1796. # ImPlotAxis& y_axis = plot.Axes[plot.CurrentY];
  1797. # y_axis.ExtendFit(y);
  1798. # }
  1799. def fit_point_y(y: float) -> None:
  1800. """ Extends the current plot's axes so that it encompasses a horizontal line at y
  1801. (private API)
  1802. """
  1803. pass
  1804. # static inline void FitPoint(const ImPlotPoint& p) { /* original C++ signature */
  1805. # ImPlotPlot& plot = *GetCurrentPlot();
  1806. # ImPlotAxis& x_axis = plot.Axes[plot.CurrentX];
  1807. # ImPlotAxis& y_axis = plot.Axes[plot.CurrentY];
  1808. # x_axis.ExtendFitWith(y_axis, p.x, p.y);
  1809. # y_axis.ExtendFitWith(x_axis, p.y, p.x);
  1810. # }
  1811. def fit_point(p: Point) -> None:
  1812. """ Extends the current plot's axes so that it encompasses point p
  1813. (private API)
  1814. """
  1815. pass
  1816. # static inline bool RangesOverlap(const ImPlotRange& r1, const ImPlotRange& r2) /* original C++ signature */
  1817. # { return r1.Min <= r2.Max && r2.Min <= r1.Max; }
  1818. def ranges_overlap(r1: Range, r2: Range) -> bool:
  1819. """ Returns True if two ranges overlap
  1820. (private API)
  1821. """
  1822. pass
  1823. # IMPLOT_API void ShowAxisContextMenu(ImPlotAxis& axis, ImPlotAxis* equal_axis, bool time_allowed = false); /* original C++ signature */
  1824. def show_axis_context_menu(axis: Axis, equal_axis: Axis, time_allowed: bool = False) -> None:
  1825. """ Shows an axis's context menu."""
  1826. pass
  1827. #-----------------------------------------------------------------------------
  1828. # [SECTION] Legend Utils
  1829. #-----------------------------------------------------------------------------
  1830. # IMPLOT_API ImVec2 GetLocationPos(const ImRect& outer_rect, const ImVec2& inner_size, ImPlotLocation location, const ImVec2& pad = ImVec2(0,0)); /* original C++ signature */
  1831. def get_location_pos(outer_rect: ImRect, inner_size: ImVec2Like, location: Location, pad: Optional[ImVec2Like] = None) -> ImVec2:
  1832. """ Gets the position of an inner rect that is located inside of an outer rect according to an ImPlotLocation and padding amount.
  1833. Python bindings defaults:
  1834. If pad is None, then its default value will be: ImVec2(0,0)
  1835. """
  1836. pass
  1837. # IMPLOT_API ImVec2 CalcLegendSize(ImPlotItemGroup& items, const ImVec2& pad, const ImVec2& spacing, bool vertical); /* original C++ signature */
  1838. def calc_legend_size(items: ItemGroup, pad: ImVec2Like, spacing: ImVec2Like, vertical: bool) -> ImVec2:
  1839. """ Calculates the bounding box size of a legend _before_ clipping."""
  1840. pass
  1841. # IMPLOT_API bool ClampLegendRect(ImRect& legend_rect, const ImRect& outer_rect, const ImVec2& pad); /* original C++ signature */
  1842. def clamp_legend_rect(legend_rect: ImRect, outer_rect: ImRect, pad: ImVec2Like) -> bool:
  1843. """ Clips calculated legend size"""
  1844. pass
  1845. # IMPLOT_API bool ShowLegendEntries(ImPlotItemGroup& items, const ImRect& legend_bb, bool interactable, const ImVec2& pad, const ImVec2& spacing, bool vertical, ImDrawList& DrawList); /* original C++ signature */
  1846. def show_legend_entries(items: ItemGroup, legend_bb: ImRect, interactable: bool, pad: ImVec2Like, spacing: ImVec2Like, vertical: bool, draw_list: ImDrawList) -> bool:
  1847. """ Renders legend entries into a bounding box"""
  1848. pass
  1849. # IMPLOT_API void ShowAltLegend(const char* title_id, bool vertical = true, const ImVec2 size = ImVec2(0,0), bool interactable = true); /* original C++ signature */
  1850. def show_alt_legend(title_id: str, vertical: bool = True, size: Optional[ImVec2Like] = None, interactable: bool = True) -> None:
  1851. """ Shows an alternate legend for the plot identified by #title_id, outside of the plot frame (can be called before or after of Begin/EndPlot but must occur in the same ImGui window! This is not thoroughly tested nor scrollable!).
  1852. Python bindings defaults:
  1853. If size is None, then its default value will be: ImVec2(0,0)
  1854. """
  1855. pass
  1856. # IMPLOT_API bool ShowLegendContextMenu(ImPlotLegend& legend, bool visible); /* original C++ signature */
  1857. def show_legend_context_menu(legend: Legend, visible: bool) -> bool:
  1858. """ Shows a legend's context menu."""
  1859. pass
  1860. #-----------------------------------------------------------------------------
  1861. # [SECTION] Label Utils
  1862. #-----------------------------------------------------------------------------
  1863. #-----------------------------------------------------------------------------
  1864. # [SECTION] Styling Utils
  1865. #-----------------------------------------------------------------------------
  1866. # static inline const ImPlotNextItemData& GetItemData() { return GImPlot->NextItemData; } /* original C++ signature */
  1867. def get_item_data() -> NextItemData:
  1868. """ Get styling data for next item (call between Begin/EndItem)
  1869. (private API)
  1870. """
  1871. pass
  1872. # static inline bool IsColorAuto(const ImVec4& col) { return col.w == -1; } /* original C++ signature */
  1873. @overload
  1874. def is_color_auto(col: ImVec4Like) -> bool:
  1875. """ Returns True if a color is set to be automatically determined
  1876. (private API)
  1877. """
  1878. pass
  1879. # static inline bool IsColorAuto(ImPlotCol idx) { return IsColorAuto(GImPlot->Style.Colors[idx]); } /* original C++ signature */
  1880. @overload
  1881. def is_color_auto(idx: Col) -> bool:
  1882. """ Returns True if a style color is set to be automatically determined
  1883. (private API)
  1884. """
  1885. pass
  1886. # IMPLOT_API ImVec4 GetAutoColor(ImPlotCol idx); /* original C++ signature */
  1887. def get_auto_color(idx: Col) -> ImVec4:
  1888. """ Returns the automatically deduced style color"""
  1889. pass
  1890. # Returns the style color whether it is automatic or custom set
  1891. # static inline ImVec4 GetStyleColorVec4(ImPlotCol idx) { return IsColorAuto(idx) ? GetAutoColor(idx) : GImPlot->Style.Colors[idx]; } /* original C++ signature */
  1892. def get_style_color_vec4(idx: Col) -> ImVec4:
  1893. """(private API)"""
  1894. pass
  1895. # static inline ImU32 GetStyleColorU32(ImPlotCol idx) { return ImGui::ColorConvertFloat4ToU32(GetStyleColorVec4(idx)); } /* original C++ signature */
  1896. def get_style_color_u32(idx: Col) -> ImU32:
  1897. """(private API)"""
  1898. pass
  1899. # IMPLOT_API void AddTextVertical(ImDrawList *DrawList, ImVec2 pos, ImU32 col, const char* text_begin, const char* text_end = nullptr); /* original C++ signature */
  1900. def add_text_vertical(draw_list: ImDrawList, pos: ImVec2Like, col: ImU32, text_begin: str, text_end: Optional[str] = None) -> None:
  1901. """ Draws vertical text. The position is the bottom left of the text rect."""
  1902. pass
  1903. # IMPLOT_API void AddTextCentered(ImDrawList* DrawList, ImVec2 top_center, ImU32 col, const char* text_begin, const char* text_end = nullptr); /* original C++ signature */
  1904. def add_text_centered(draw_list: ImDrawList, top_center: ImVec2Like, col: ImU32, text_begin: str, text_end: Optional[str] = None) -> None:
  1905. """ Draws multiline horizontal text centered."""
  1906. pass
  1907. # static inline ImVec2 CalcTextSizeVertical(const char *text) { /* original C++ signature */
  1908. # ImVec2 sz = ImGui::CalcTextSize(text);
  1909. # return ImVec2(sz.y, sz.x);
  1910. # }
  1911. def calc_text_size_vertical(text: str) -> ImVec2:
  1912. """ Calculates the size of vertical text
  1913. (private API)
  1914. """
  1915. pass
  1916. # Returns white or black text given background color
  1917. # static inline ImU32 CalcTextColor(const ImVec4& bg) { return (bg.x * 0.299f + bg.y * 0.587f + bg.z * 0.114f) > 0.5f ? IM_COL32_BLACK : IM_COL32_WHITE; } /* original C++ signature */
  1918. @overload
  1919. def calc_text_color(bg: ImVec4Like) -> ImU32:
  1920. """(private API)"""
  1921. pass
  1922. # static inline ImU32 CalcTextColor(ImU32 bg) { return CalcTextColor(ImGui::ColorConvertU32ToFloat4(bg)); } /* original C++ signature */
  1923. @overload
  1924. def calc_text_color(bg: ImU32) -> ImU32:
  1925. """(private API)"""
  1926. pass
  1927. # static inline ImU32 CalcHoverColor(ImU32 col) { return ImMixU32(col, CalcTextColor(col), 32); } /* original C++ signature */
  1928. def calc_hover_color(col: ImU32) -> ImU32:
  1929. """ Lightens or darkens a color for hover
  1930. (private API)
  1931. """
  1932. pass
  1933. # static inline ImVec2 ClampLabelPos(ImVec2 pos, const ImVec2& size, const ImVec2& Min, const ImVec2& Max) { /* original C++ signature */
  1934. # if (pos.x < Min.x) pos.x = Min.x;
  1935. # if (pos.y < Min.y) pos.y = Min.y;
  1936. # if ((pos.x + size.x) > Max.x) pos.x = Max.x - size.x;
  1937. # if ((pos.y + size.y) > Max.y) pos.y = Max.y - size.y;
  1938. # return pos;
  1939. # }
  1940. def clamp_label_pos(pos: ImVec2Like, size: ImVec2Like, min: ImVec2Like, max: ImVec2Like) -> ImVec2:
  1941. """ Clamps a label position so that it fits a rect defined by Min/Max
  1942. (private API)
  1943. """
  1944. pass
  1945. # IMPLOT_API ImU32 GetColormapColorU32(int idx, ImPlotColormap cmap); /* original C++ signature */
  1946. def get_colormap_color_u32(idx: int, cmap: Colormap) -> ImU32:
  1947. """ Returns a color from the Color map given an index >= 0 (modulo will be performed)."""
  1948. pass
  1949. # IMPLOT_API ImU32 NextColormapColorU32(); /* original C++ signature */
  1950. def next_colormap_color_u32() -> ImU32:
  1951. """ Returns the next unused colormap color and advances the colormap. Can be used to skip colors if desired."""
  1952. pass
  1953. # IMPLOT_API ImU32 SampleColormapU32(float t, ImPlotColormap cmap); /* original C++ signature */
  1954. def sample_colormap_u32(t: float, cmap: Colormap) -> ImU32:
  1955. """ Linearly interpolates a color from the current colormap given t between 0 and 1."""
  1956. pass
  1957. # IMPLOT_API void RenderColorBar(const ImU32* colors, int size, ImDrawList& DrawList, const ImRect& bounds, bool vert, bool reversed, bool continuous); /* original C++ signature */
  1958. def render_color_bar(colors: ImU32, size: int, draw_list: ImDrawList, bounds: ImRect, vert: bool, reversed: bool, continuous: bool) -> None:
  1959. """ Render a colormap bar"""
  1960. pass
  1961. #-----------------------------------------------------------------------------
  1962. # [SECTION] Math and Misc Utils
  1963. #-----------------------------------------------------------------------------
  1964. # IMPLOT_API double NiceNum(double x, bool round); /* original C++ signature */
  1965. def nice_num(x: float, round: bool) -> float:
  1966. """ Rounds x to powers of 2,5 and 10 for generating axis labels (from Graphics Gems 1 Chapter 11.2)"""
  1967. pass
  1968. # static inline int OrderOfMagnitude(double val) { return val == 0 ? 0 : (int)(floor(log10(fabs(val)))); } /* original C++ signature */
  1969. def order_of_magnitude(val: float) -> int:
  1970. """ Computes order of magnitude of double.
  1971. (private API)
  1972. """
  1973. pass
  1974. # static inline int OrderToPrecision(int order) { return order > 0 ? 0 : 1 - order; } /* original C++ signature */
  1975. def order_to_precision(order: int) -> int:
  1976. """ Returns the precision required for a order of magnitude.
  1977. (private API)
  1978. """
  1979. pass
  1980. # static inline int Precision(double val) { return OrderToPrecision(OrderOfMagnitude(val)); } /* original C++ signature */
  1981. def precision(val: float) -> int:
  1982. """ Returns a floating point precision to use given a value
  1983. (private API)
  1984. """
  1985. pass
  1986. # static inline double RoundTo(double val, int prec) { double p = pow(10,(double)prec); return floor(val*p+0.5)/p; } /* original C++ signature */
  1987. def round_to(val: float, prec: int) -> float:
  1988. """ Round a value to a given precision
  1989. (private API)
  1990. """
  1991. pass
  1992. # static inline ImVec2 Intersection(const ImVec2& a1, const ImVec2& a2, const ImVec2& b1, const ImVec2& b2) { /* original C++ signature */
  1993. # float v1 = (a1.x * a2.y - a1.y * a2.x); float v2 = (b1.x * b2.y - b1.y * b2.x);
  1994. # float v3 = ((a1.x - a2.x) * (b1.y - b2.y) - (a1.y - a2.y) * (b1.x - b2.x));
  1995. # return ImVec2((v1 * (b1.x - b2.x) - v2 * (a1.x - a2.x)) / v3, (v1 * (b1.y - b2.y) - v2 * (a1.y - a2.y)) / v3);
  1996. # }
  1997. def intersection(a1: ImVec2Like, a2: ImVec2Like, b1: ImVec2Like, b2: ImVec2Like) -> ImVec2:
  1998. """ Returns the intersection point of two lines A and B (assumes they are not parallel!)
  1999. (private API)
  2000. """
  2001. pass
  2002. #-----------------------------------------------------------------------------
  2003. # Time Utils
  2004. #-----------------------------------------------------------------------------
  2005. # static inline bool IsLeapYear(int year) { /* original C++ signature */
  2006. # return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
  2007. # }
  2008. def is_leap_year(year: int) -> bool:
  2009. """ Returns True if year is leap year (366 days long)
  2010. (private API)
  2011. """
  2012. pass
  2013. # static inline int GetDaysInMonth(int year, int month) { /* original C++ signature */
  2014. # constexpr int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  2015. # return days[month] + (int)(month == 1 && IsLeapYear(year));
  2016. # }
  2017. def get_days_in_month(year: int, month: int) -> int:
  2018. """ Returns the number of days in a month, accounting for Feb. leap years. #month is zero indexed.
  2019. (private API)
  2020. """
  2021. pass
  2022. # NB: The following functions only work if there is a current ImPlotContext because the
  2023. # internal tm struct is owned by the context! They are aware of ImPlotStyle.UseLocalTime.
  2024. # IMPLOT_API ImPlotTime MakeTime(int year, int month = 0, int day = 1, int hour = 0, int min = 0, int sec = 0, int us = 0); /* original C++ signature */
  2025. def make_time(year: int, month: int = 0, day: int = 1, hour: int = 0, min: int = 0, sec: int = 0, us: int = 0) -> Time:
  2026. """ Make a timestamp from time components.
  2027. year[1970-3000], month[0-11], day[1-31], hour[0-23], min[0-59], sec[0-59], us[0,999999]
  2028. """
  2029. pass
  2030. # IMPLOT_API int GetYear(const ImPlotTime& t); /* original C++ signature */
  2031. def get_year(t: Time) -> int:
  2032. """ Get year component from timestamp [1970-3000]"""
  2033. pass
  2034. # IMPLOT_API int GetMonth(const ImPlotTime& t); /* original C++ signature */
  2035. def get_month(t: Time) -> int:
  2036. """ Get month component from timestamp [0-11]"""
  2037. pass
  2038. # IMPLOT_API ImPlotTime AddTime(const ImPlotTime& t, ImPlotTimeUnit unit, int count); /* original C++ signature */
  2039. def add_time(t: Time, unit: TimeUnit, count: int) -> Time:
  2040. """ Adds or subtracts time from a timestamp. #count > 0 to add, < 0 to subtract."""
  2041. pass
  2042. # IMPLOT_API ImPlotTime FloorTime(const ImPlotTime& t, ImPlotTimeUnit unit); /* original C++ signature */
  2043. def floor_time(t: Time, unit: TimeUnit) -> Time:
  2044. """ Rounds a timestamp down to nearest unit."""
  2045. pass
  2046. # IMPLOT_API ImPlotTime CeilTime(const ImPlotTime& t, ImPlotTimeUnit unit); /* original C++ signature */
  2047. def ceil_time(t: Time, unit: TimeUnit) -> Time:
  2048. """ Rounds a timestamp up to the nearest unit."""
  2049. pass
  2050. # IMPLOT_API ImPlotTime RoundTime(const ImPlotTime& t, ImPlotTimeUnit unit); /* original C++ signature */
  2051. def round_time(t: Time, unit: TimeUnit) -> Time:
  2052. """ Rounds a timestamp up or down to the nearest unit."""
  2053. pass
  2054. # IMPLOT_API ImPlotTime CombineDateTime(const ImPlotTime& date_part, const ImPlotTime& time_part); /* original C++ signature */
  2055. def combine_date_time(date_part: Time, time_part: Time) -> Time:
  2056. """ Combines the date of one timestamp with the time-of-day of another timestamp."""
  2057. pass
  2058. # static inline ImPlotTime Now() { return ImPlotTime::FromDouble((double)time(nullptr)); } /* original C++ signature */
  2059. def now() -> Time:
  2060. """ Get the current time as a timestamp.
  2061. (private API)
  2062. """
  2063. pass
  2064. # static inline ImPlotTime Today() { return ImPlot::FloorTime(Now(), ImPlotTimeUnit_Day); } /* original C++ signature */
  2065. def today() -> Time:
  2066. """ Get the current date as a timestamp.
  2067. (private API)
  2068. """
  2069. pass
  2070. # #ifdef IMGUI_BUNDLE_PYTHON_API
  2071. #
  2072. # IMPLOT_API std::string FormatTimeStr(const ImPlotTime& t, ImPlotTimeFmt fmt, bool use_24_hr_clk); /* original C++ signature */
  2073. def format_time_str(t: Time, fmt: TimeFmt, use_24_hr_clk: bool) -> str:
  2074. """ Formats the time part of timestamp t into a buffer according to #fmt"""
  2075. pass
  2076. # IMPLOT_API std::string FormatDateStr(const ImPlotTime& t, ImPlotDateFmt fmt, bool use_iso_8601); /* original C++ signature */
  2077. def format_date_str(t: Time, fmt: DateFmt, use_iso_8601: bool) -> str:
  2078. """ Formats the date part of timestamp t into a buffer according to #fmt"""
  2079. pass
  2080. # IMPLOT_API std::string FormatDateTimeStr(const ImPlotTime& t, ImPlotDateTimeSpec fmt); /* original C++ signature */
  2081. def format_date_time_str(t: Time, fmt: DateTimeSpec) -> str:
  2082. """ Formats the time and/or date parts of a timestamp t into a buffer according to #fmt"""
  2083. pass
  2084. # #endif
  2085. #
  2086. # IMPLOT_API bool ShowDatePicker(const char* id, int* level, ImPlotTime* t, const ImPlotTime* t1 = nullptr, const ImPlotTime* t2 = nullptr); /* original C++ signature */
  2087. def show_date_picker(id_: str, level: int, t: Time, t1: Optional[Time] = None, t2: Optional[Time] = None) -> Tuple[bool, int]:
  2088. """ Shows a date picker widget block (year/month/day).
  2089. #level = 0 for day, 1 for month, 2 for year. Modified by user interaction.
  2090. #t will be set when a day is clicked and the function will return True.
  2091. #t1 and #t2 are optional dates to highlight.
  2092. """
  2093. pass
  2094. # IMPLOT_API bool ShowTimePicker(const char* id, ImPlotTime* t); /* original C++ signature */
  2095. def show_time_picker(id_: str, t: Time) -> bool:
  2096. """ Shows a time picker widget block (hour/min/sec).
  2097. #t will be set when a new hour, minute, or sec is selected or am/pm is toggled, and the function will return True.
  2098. """
  2099. pass
  2100. #-----------------------------------------------------------------------------
  2101. # [SECTION] Transforms
  2102. #-----------------------------------------------------------------------------
  2103. # static inline double TransformForward_Log10(double v, void*) { /* original C++ signature */
  2104. # v = v <= 0.0 ? DBL_MIN : v;
  2105. # return ImLog10(v);
  2106. # }
  2107. def transform_forward_log10(v: float, param_1: Any) -> float:
  2108. """(private API)"""
  2109. pass
  2110. # static inline double TransformInverse_Log10(double v, void*) { /* original C++ signature */
  2111. # return ImPow(10, v);
  2112. # }
  2113. def transform_inverse_log10(v: float, param_1: Any) -> float:
  2114. """(private API)"""
  2115. pass
  2116. # static inline double TransformForward_SymLog(double v, void*) { /* original C++ signature */
  2117. # return 2.0 * ImAsinh(v / 2.0);
  2118. # }
  2119. def transform_forward_sym_log(v: float, param_1: Any) -> float:
  2120. """(private API)"""
  2121. pass
  2122. # static inline double TransformInverse_SymLog(double v, void*) { /* original C++ signature */
  2123. # return 2.0 * ImSinh(v / 2.0);
  2124. # }
  2125. def transform_inverse_sym_log(v: float, param_1: Any) -> float:
  2126. """(private API)"""
  2127. pass
  2128. # static inline double TransformForward_Logit(double v, void*) { /* original C++ signature */
  2129. # v = ImClamp(v, DBL_MIN, 1.0 - DBL_EPSILON);
  2130. # return ImLog10(v / (1 - v));
  2131. # }
  2132. def transform_forward_logit(v: float, param_1: Any) -> float:
  2133. """(private API)"""
  2134. pass
  2135. # static inline double TransformInverse_Logit(double v, void*) { /* original C++ signature */
  2136. # return 1.0 / (1.0 + ImPow(10,-v));
  2137. # }
  2138. def transform_inverse_logit(v: float, param_1: Any) -> float:
  2139. """(private API)"""
  2140. pass
  2141. #-----------------------------------------------------------------------------
  2142. # [SECTION] Formatters
  2143. #-----------------------------------------------------------------------------
  2144. class Formatter_Time_Data:
  2145. # ImPlotTime Time; /* original C++ signature */
  2146. time: Time
  2147. # ImPlotDateTimeSpec Spec; /* original C++ signature */
  2148. spec: DateTimeSpec
  2149. # void* UserFormatterData; /* original C++ signature */
  2150. user_formatter_data: Any
  2151. # Formatter_Time_Data(ImPlotTime Time = ImPlotTime(), ImPlotDateTimeSpec Spec = ImPlotDateTimeSpec()); /* original C++ signature */
  2152. def __init__(self, time: Optional[Time] = None, spec: Optional[DateTimeSpec] = None) -> None:
  2153. """Auto-generated default constructor with named params
  2154. Python bindings defaults:
  2155. If any of the params below is None, then its default value below will be used:
  2156. * Time: Time()
  2157. * Spec: DateTimeSpec()
  2158. """
  2159. pass
  2160. #------------------------------------------------------------------------------
  2161. # [SECTION] Locator
  2162. #------------------------------------------------------------------------------
  2163. # #endif
  2164. #################### </generated_from:implot_internal.h> ####################
  2165. # </litgen_stub>
  2166. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AUTOGENERATED CODE END !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!