internal.pyi 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310
  1. ###############################################################################
  2. # This file is a part of Dear ImGui Bundle, NOT a part of ImPlot3D
  3. # -----------------------------------------------------------------------------
  4. # implot3d/internal.pyi is the equivalent of implot3d_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 enum
  13. from imgui_bundle.imgui import ImVec2, ImVec4, ImU32, ID, ImVec2Like, ImVec4Like, ImDrawList
  14. from imgui_bundle.imgui.internal import ImRect
  15. from imgui_bundle.implot3d import (
  16. Colormap, Marker, Flags, Col, Point, LegendFlags, AxisFlags, Location,
  17. Quat, Ray, Range, Cond, Style, ItemFlags, ImAxis3D, Spec, Scale
  18. )
  19. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AUTOGENERATED CODE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  20. # <litgen_stub> // Autogenerated code below! Do not edit!
  21. #################### <generated_from:implot3d_internal.h> ####################
  22. # SPDX-License-Identifier: MIT
  23. # SPDX-FileCopyrightText: 2024-2026 Breno Cunha Queiroz
  24. # ImPlot3D v0.5 WIP
  25. # Acknowledgments:
  26. # ImPlot3D is heavily inspired by ImPlot
  27. # (https://github.com/epezent/implot) by Evan Pezent,
  28. # and follows a similar code style and structure to
  29. # maintain consistency with ImPlot's API.
  30. # Table of Contents:
  31. # [SECTION] Constants
  32. # [SECTION] Generic Helpers
  33. # [SECTION] Internal Enumerations
  34. # [SECTION] Forward Declarations
  35. # [SECTION] Callbacks
  36. # [SECTION] Structs
  37. # [SECTION] Context Pointer
  38. # [SECTION] Context Utils
  39. # [SECTION] Style Utils
  40. # [SECTION] Item Utils
  41. # [SECTION] Plot Utils
  42. # [SECTION] Setup Utils
  43. # [SECTION] Formatter
  44. # [SECTION] Locator
  45. # #ifndef IMGUI_DISABLE
  46. #
  47. #-----------------------------------------------------------------------------
  48. # [SECTION] Constants
  49. #-----------------------------------------------------------------------------
  50. #-----------------------------------------------------------------------------
  51. # [SECTION] Generic Helpers
  52. #-----------------------------------------------------------------------------
  53. # static inline double ImLog10(double x) { return log10(x); } /* original C++ signature */
  54. def im_log10(x: float) -> float:
  55. """ Computes the common (base-10) logarithm
  56. (private API)
  57. """
  58. pass
  59. # static inline double ImSinh(double x) { return sinh(x); } /* original C++ signature */
  60. def im_sinh(x: float) -> float:
  61. """ Computes the hyperbolic sine
  62. (private API)
  63. """
  64. pass
  65. # static inline double ImAsinh(double x) { return asinh(x); } /* original C++ signature */
  66. def im_asinh(x: float) -> float:
  67. """ Computes the inverse hyperbolic sine
  68. (private API)
  69. """
  70. pass
  71. # Flips a flag in a flagset
  72. # static inline int ImPosMod(int l, int r) { return (l % r + r) % r; } /* original C++ signature */
  73. def im_pos_mod(l: int, r: int) -> int:
  74. """ Returns always positive modulo (assumes r != 0)
  75. (private API)
  76. """
  77. pass
  78. # static inline bool ImNan(double val) { return isnan(val); } /* original C++ signature */
  79. def im_nan(val: float) -> bool:
  80. """ Returns True if val is NAN
  81. (private API)
  82. """
  83. pass
  84. # static inline bool ImNanOrInf(double val) { return !(val >= -DBL_MAX && val <= DBL_MAX) || ImNan(val); } /* original C++ signature */
  85. def im_nan_or_inf(val: float) -> bool:
  86. """ Returns True if val is NAN or INFINITY
  87. (private API)
  88. """
  89. pass
  90. # static inline double ImConstrainNan(double val) { return ImNan(val) ? 0 : val; } /* original C++ signature */
  91. def im_constrain_nan(val: float) -> float:
  92. """ Turns NANs to 0s
  93. (private API)
  94. """
  95. pass
  96. # static inline double ImConstrainInf(double val) { /* original C++ signature */
  97. # const double max_val = DBL_MAX * 0.5;
  98. # return val >= max_val ? max_val : val <= -max_val ? -max_val : val;
  99. # }
  100. def im_constrain_inf(val: float) -> float:
  101. """ Turns infinity to floating point maximums
  102. Clamped to half DBL_MAX to prevent overflow in size calculations (Max - Min)
  103. (private API)
  104. """
  105. pass
  106. # static inline bool ImAlmostEqual(double v1, double v2, int ulp = 2) { /* original C++ signature */
  107. # return ImAbs(v1 - v2) < DBL_EPSILON * ImAbs(v1 + v2) * ulp || ImAbs(v1 - v2) < DBL_MIN;
  108. # }
  109. def im_almost_equal(v1: float, v2: float, ulp: int = 2) -> bool:
  110. """ True if two numbers are approximately equal using units in the last place.
  111. (private API)
  112. """
  113. pass
  114. # static inline ImU32 ImAlphaU32(ImU32 col, float alpha) { return col & ~((ImU32)((1.0f - alpha) * 255) << IM_COL32_A_SHIFT); } /* original C++ signature */
  115. def im_alpha_u32(col: ImU32, alpha: float) -> ImU32:
  116. """ Set alpha channel of 32-bit color from float in range [0.0 1.0]
  117. (private API)
  118. """
  119. pass
  120. # static inline ImU32 ImMixU32(ImU32 a, ImU32 b, ImU32 s) { /* original C++ signature */
  121. # #ifdef IMPLOT3D_MIX64
  122. # const ImU32 af = 256 - s;
  123. # const ImU32 bf = s;
  124. # const ImU64 al = (a & 0x00ff00ff) | (((ImU64)(a & 0xff00ff00)) << 24);
  125. # const ImU64 bl = (b & 0x00ff00ff) | (((ImU64)(b & 0xff00ff00)) << 24);
  126. # const ImU64 mix = (al * af + bl * bf);
  127. # return ((mix >> 32) & 0xff00ff00) | ((mix & 0xff00ff00) >> 8);
  128. # #else
  129. # const ImU32 af = 256 - s;
  130. # const ImU32 bf = s;
  131. # const ImU32 al = (a & 0x00ff00ff);
  132. # const ImU32 ah = (a & 0xff00ff00) >> 8;
  133. # const ImU32 bl = (b & 0x00ff00ff);
  134. # const ImU32 bh = (b & 0xff00ff00) >> 8;
  135. # const ImU32 ml = (al * af + bl * bf);
  136. # const ImU32 mh = (ah * af + bh * bf);
  137. # return (mh & 0xff00ff00) | ((ml & 0xff00ff00) >> 8);
  138. # #endif
  139. # }
  140. def im_mix_u32(a: ImU32, b: ImU32, s: ImU32) -> ImU32:
  141. """ Mix color a and b by factor s in [0 256]
  142. (private API)
  143. """
  144. pass
  145. #-----------------------------------------------------------------------------
  146. # [SECTION] Internal Enumerations
  147. #-----------------------------------------------------------------------------
  148. class MarkerInternal_(enum.IntFlag):
  149. # ImPlot3DMarker_Invalid = -3, /* original C++ signature */
  150. # }
  151. im_plot3_d_marker_invalid = enum.auto() # (= -3)
  152. #-----------------------------------------------------------------------------
  153. # [SECTION] Forward Declarations
  154. #-----------------------------------------------------------------------------
  155. #------------------------------------------------------------------------------
  156. # [SECTION] Callbacks
  157. #------------------------------------------------------------------------------
  158. #-----------------------------------------------------------------------------
  159. # [SECTION] Structs
  160. #-----------------------------------------------------------------------------
  161. class NextItemData:
  162. # ImPlot3DSpec Spec; /* original C++ signature */
  163. spec: Spec
  164. # bool RenderLine; /* original C++ signature */
  165. render_line: bool
  166. # bool RenderFill; /* original C++ signature */
  167. render_fill: bool
  168. # bool RenderMarkerLine; /* original C++ signature */
  169. render_marker_line: bool
  170. # bool RenderMarkerFill; /* original C++ signature */
  171. render_marker_fill: bool
  172. # bool IsAutoFill; /* original C++ signature */
  173. is_auto_fill: bool
  174. # bool IsAutoLine; /* original C++ signature */
  175. is_auto_line: bool
  176. # bool Hidden; /* original C++ signature */
  177. hidden: bool
  178. # ImPlot3DNextItemData() { Reset(); } /* original C++ signature */
  179. def __init__(self) -> None:
  180. pass
  181. # void Reset() { /* original C++ signature */
  182. # Spec = ImPlot3DSpec();
  183. # RenderLine = false;
  184. # RenderFill = false;
  185. # RenderMarkerLine = true;
  186. # RenderMarkerFill = true;
  187. # IsAutoFill = true;
  188. # IsAutoLine = true;
  189. # Hidden = false;
  190. # }
  191. def reset(self) -> None:
  192. """(private API)"""
  193. pass
  194. class ColormapData:
  195. """ Colormap data storage"""
  196. # int Count; /* original C++ signature */
  197. count: int
  198. # ImPlot3DColormapData() { Count = 0; } /* original C++ signature */
  199. def __init__(self) -> None:
  200. pass
  201. # int Append(const char* name, const ImU32* keys, int count, bool qual) { /* original C++ signature */
  202. # if (GetIndex(name) != -1)
  203. # return -1;
  204. # KeyOffsets.push_back(Keys.size());
  205. # KeyCounts.push_back(count);
  206. # Keys.reserve(Keys.size() + count);
  207. # for (int i = 0; i < count; ++i)
  208. # Keys.push_back(keys[i]);
  209. # TextOffsets.push_back(Text.size());
  210. # Text.append(name, name + strlen(name) + 1);
  211. # Quals.push_back(qual);
  212. # ImGuiID id = ImHashStr(name);
  213. # int idx = Count++;
  214. # Map.SetInt(id, idx);
  215. # _AppendTable(idx);
  216. # return idx;
  217. # }
  218. def append(self, name: str, keys: ImU32, count: int, qual: bool) -> int:
  219. """(private API)"""
  220. pass
  221. # void _AppendTable(ImPlot3DColormap cmap) { /* original C++ signature */
  222. # int key_count = GetKeyCount(cmap);
  223. # const ImU32* keys = GetKeys(cmap);
  224. # int off = Tables.size();
  225. # TableOffsets.push_back(off);
  226. # if (IsQual(cmap)) {
  227. # Tables.reserve(key_count);
  228. # for (int i = 0; i < key_count; ++i)
  229. # Tables.push_back(keys[i]);
  230. # TableSizes.push_back(key_count);
  231. # } else {
  232. # int max_size = 255 * (key_count - 1) + 1;
  233. # Tables.reserve(off + max_size);
  234. # // ImU32 last = keys[0];
  235. # // Tables.push_back(last);
  236. # // int n = 1;
  237. # for (int i = 0; i < key_count - 1; ++i) {
  238. # for (int s = 0; s < 255; ++s) {
  239. # ImU32 a = keys[i];
  240. # ImU32 b = keys[i + 1];
  241. # ImU32 c = ImPlot3D::ImMixU32(a, b, (ImU32)s);
  242. # // if (c != last) {
  243. # Tables.push_back(c);
  244. # // last = c;
  245. # // n++;
  246. # // }
  247. # }
  248. # }
  249. # ImU32 c = keys[key_count - 1];
  250. # // if (c != last) {
  251. # Tables.push_back(c);
  252. # // n++;
  253. # // }
  254. # // TableSizes.push_back(n);
  255. # TableSizes.push_back(max_size);
  256. # }
  257. # }
  258. def _append_table(self, cmap: Colormap) -> None:
  259. """(private API)"""
  260. pass
  261. # void RebuildTables() { /* original C++ signature */
  262. # Tables.resize(0);
  263. # TableSizes.resize(0);
  264. # TableOffsets.resize(0);
  265. # for (int i = 0; i < Count; ++i)
  266. # _AppendTable(i);
  267. # }
  268. def rebuild_tables(self) -> None:
  269. """(private API)"""
  270. pass
  271. # inline bool IsQual(ImPlot3DColormap cmap) const { return Quals[cmap]; } /* original C++ signature */
  272. def is_qual(self, cmap: Colormap) -> bool:
  273. """(private API)"""
  274. pass
  275. # inline const char* GetName(ImPlot3DColormap cmap) const { return cmap < Count ? Text.Buf.Data + TextOffsets[cmap] : nullptr; } /* original C++ signature */
  276. def get_name(self, cmap: Colormap) -> str:
  277. """(private API)"""
  278. pass
  279. # inline ImPlot3DColormap GetIndex(const char* name) const { /* original C++ signature */
  280. # ImGuiID key = ImHashStr(name);
  281. # return Map.GetInt(key, -1);
  282. # }
  283. def get_index(self, name: str) -> Colormap:
  284. """(private API)"""
  285. pass
  286. # inline const ImU32* GetKeys(ImPlot3DColormap cmap) const { return &Keys[KeyOffsets[cmap]]; } /* original C++ signature */
  287. def get_keys(self, cmap: Colormap) -> ImU32:
  288. """(private API)"""
  289. pass
  290. # inline int GetKeyCount(ImPlot3DColormap cmap) const { return KeyCounts[cmap]; } /* original C++ signature */
  291. def get_key_count(self, cmap: Colormap) -> int:
  292. """(private API)"""
  293. pass
  294. # inline ImU32 GetKeyColor(ImPlot3DColormap cmap, int idx) const { return Keys[KeyOffsets[cmap] + idx]; } /* original C++ signature */
  295. def get_key_color(self, cmap: Colormap, idx: int) -> ImU32:
  296. """(private API)"""
  297. pass
  298. # inline void SetKeyColor(ImPlot3DColormap cmap, int idx, ImU32 value) { /* original C++ signature */
  299. # Keys[KeyOffsets[cmap] + idx] = value;
  300. # RebuildTables();
  301. # }
  302. def set_key_color(self, cmap: Colormap, idx: int, value: ImU32) -> None:
  303. """(private API)"""
  304. pass
  305. # inline const ImU32* GetTable(ImPlot3DColormap cmap) const { return &Tables[TableOffsets[cmap]]; } /* original C++ signature */
  306. def get_table(self, cmap: Colormap) -> ImU32:
  307. """(private API)"""
  308. pass
  309. # inline int GetTableSize(ImPlot3DColormap cmap) const { return TableSizes[cmap]; } /* original C++ signature */
  310. def get_table_size(self, cmap: Colormap) -> int:
  311. """(private API)"""
  312. pass
  313. # inline ImU32 GetTableColor(ImPlot3DColormap cmap, int idx) const { return Tables[TableOffsets[cmap] + idx]; } /* original C++ signature */
  314. def get_table_color(self, cmap: Colormap, idx: int) -> ImU32:
  315. """(private API)"""
  316. pass
  317. # inline ImU32 LerpTable(ImPlot3DColormap cmap, float t) const { /* original C++ signature */
  318. # int off = TableOffsets[cmap];
  319. # int siz = TableSizes[cmap];
  320. # int idx = Quals[cmap] ? ImClamp((int)(siz * t), 0, siz - 1) : (int)((siz - 1) * t + 0.5f);
  321. # return Tables[off + idx];
  322. # }
  323. def lerp_table(self, cmap: Colormap, t: float) -> ImU32:
  324. """(private API)"""
  325. pass
  326. class Item:
  327. """ State information for plot items"""
  328. # ImGuiID ID; /* original C++ signature */
  329. id_: ID
  330. # ImU32 Color; /* original C++ signature */
  331. color: ImU32
  332. # ImPlot3DMarker Marker; /* original C++ signature */
  333. marker: Marker
  334. # int NameOffset; /* original C++ signature */
  335. name_offset: int
  336. # bool Show; /* original C++ signature */
  337. show: bool
  338. # bool LegendHovered; /* original C++ signature */
  339. legend_hovered: bool
  340. # bool SeenThisFrame; /* original C++ signature */
  341. seen_this_frame: bool
  342. # ImPlot3DItem() { /* original C++ signature */
  343. # ID = 0;
  344. # Color = IM_COL32_WHITE;
  345. # Marker = ImPlot3DMarker_None;
  346. # NameOffset = -1;
  347. # Show = true;
  348. # LegendHovered = false;
  349. # SeenThisFrame = false;
  350. # }
  351. def __init__(self) -> None:
  352. pass
  353. class Legend:
  354. """ Holds legend state"""
  355. # ImPlot3DLegendFlags Flags; /* original C++ signature */
  356. flags: LegendFlags
  357. # ImPlot3DLegendFlags PreviousFlags; /* original C++ signature */
  358. previous_flags: LegendFlags
  359. # ImPlot3DLocation Location; /* original C++ signature */
  360. location: Location
  361. # ImPlot3DLocation PreviousLocation; /* original C++ signature */
  362. previous_location: Location
  363. # ImRect Rect; /* original C++ signature */
  364. rect: ImRect
  365. # bool Hovered; /* original C++ signature */
  366. hovered: bool
  367. # bool Held; /* original C++ signature */
  368. held: bool
  369. # ImPlot3DLegend() { /* original C++ signature */
  370. # PreviousFlags = Flags = ImPlot3DLegendFlags_None;
  371. # Hovered = Held = false;
  372. # PreviousLocation = Location = ImPlot3DLocation_NorthWest;
  373. # }
  374. def __init__(self) -> None:
  375. pass
  376. # void Reset() { /* original C++ signature */
  377. # Indices.shrink(0);
  378. # Labels.Buf.shrink(0);
  379. # }
  380. def reset(self) -> None:
  381. """(private API)"""
  382. pass
  383. class ItemGroup:
  384. """ Holds items"""
  385. # ImPlot3DLegend Legend; /* original C++ signature */
  386. legend: Legend
  387. # int ColormapIdx; /* original C++ signature */
  388. colormap_idx: int
  389. # ImPlot3DMarker MarkerIdx; /* original C++ signature */
  390. marker_idx: Marker
  391. # ImPlot3DItemGroup() { /* original C++ signature */
  392. # ColormapIdx = 0;
  393. # MarkerIdx = 0;
  394. # }
  395. def __init__(self) -> None:
  396. pass
  397. # int GetItemCount() const { return ItemPool.GetBufSize(); } /* original C++ signature */
  398. def get_item_count(self) -> int:
  399. """(private API)"""
  400. pass
  401. # ImGuiID GetItemID(const char* label_id) { return ImGui::GetID(label_id); } /* original C++ signature */
  402. def get_item_id(self, label_id: str) -> ID:
  403. """(private API)"""
  404. pass
  405. # ImPlot3DItem* GetItem(ImGuiID id) { return ItemPool.GetByKey(id); } /* original C++ signature */
  406. @overload
  407. def get_item(self, id_: ID) -> Item:
  408. """(private API)"""
  409. pass
  410. # ImPlot3DItem* GetItem(const char* label_id) { return GetItem(GetItemID(label_id)); } /* original C++ signature */
  411. @overload
  412. def get_item(self, label_id: str) -> Item:
  413. """(private API)"""
  414. pass
  415. # ImPlot3DItem* GetOrAddItem(ImGuiID id) { return ItemPool.GetOrAddByKey(id); } /* original C++ signature */
  416. def get_or_add_item(self, id_: ID) -> Item:
  417. """(private API)"""
  418. pass
  419. # ImPlot3DItem* GetItemByIndex(int i) { return ItemPool.GetByIndex(i); } /* original C++ signature */
  420. def get_item_by_index(self, i: int) -> Item:
  421. """(private API)"""
  422. pass
  423. # int GetItemIndex(ImPlot3DItem* item) { return ItemPool.GetIndex(item); } /* original C++ signature */
  424. def get_item_index(self, item: Item) -> int:
  425. """(private API)"""
  426. pass
  427. # int GetLegendCount() const { return Legend.Indices.size(); } /* original C++ signature */
  428. def get_legend_count(self) -> int:
  429. """(private API)"""
  430. pass
  431. # ImPlot3DItem* GetLegendItem(int i) { return ItemPool.GetByIndex(Legend.Indices[i]); } /* original C++ signature */
  432. def get_legend_item(self, i: int) -> Item:
  433. """(private API)"""
  434. pass
  435. # const char* GetLegendLabel(int i) { return Legend.Labels.Buf.Data + GetLegendItem(i)->NameOffset; } /* original C++ signature */
  436. def get_legend_label(self, i: int) -> str:
  437. """(private API)"""
  438. pass
  439. # void Reset() { /* original C++ signature */
  440. # ItemPool.Clear();
  441. # Legend.Reset();
  442. # ColormapIdx = 0;
  443. # MarkerIdx = 0;
  444. # }
  445. def reset(self) -> None:
  446. """(private API)"""
  447. pass
  448. class Tick:
  449. """ Tick mark info"""
  450. # double PlotPos; /* original C++ signature */
  451. plot_pos: float
  452. # bool Major; /* original C++ signature */
  453. major: bool
  454. # bool ShowLabel; /* original C++ signature */
  455. show_label: bool
  456. # ImVec2 LabelSize; /* original C++ signature */
  457. label_size: ImVec2
  458. # int TextOffset; /* original C++ signature */
  459. text_offset: int
  460. # int Idx; /* original C++ signature */
  461. idx: int
  462. # ImPlot3DTick(double value, bool major, bool show_label) { /* original C++ signature */
  463. # PlotPos = value;
  464. # Major = major;
  465. # ShowLabel = show_label;
  466. # TextOffset = -1;
  467. # }
  468. def __init__(self, value: float, major: bool, show_label: bool) -> None:
  469. pass
  470. class Ticker:
  471. """ Collection of ticks"""
  472. # ImPlot3DTicker() { Reset(); } /* original C++ signature */
  473. def __init__(self) -> None:
  474. pass
  475. # ImPlot3DTick& AddTick(double value, bool major, bool show_label, const char* label) { /* original C++ signature */
  476. # ImPlot3DTick tick(value, major, show_label);
  477. # if (show_label && label != nullptr) {
  478. # tick.TextOffset = TextBuffer.size();
  479. # TextBuffer.append(label, label + strlen(label) + 1);
  480. # tick.LabelSize = ImGui::CalcTextSize(TextBuffer.Buf.Data + tick.TextOffset);
  481. # }
  482. # return AddTick(tick);
  483. # }
  484. @overload
  485. def add_tick(self, value: float, major: bool, show_label: bool, label: str) -> Tick:
  486. """(private API)"""
  487. pass
  488. # inline ImPlot3DTick& AddTick(ImPlot3DTick tick) { /* original C++ signature */
  489. # tick.Idx = Ticks.size();
  490. # Ticks.push_back(tick);
  491. # return Ticks.back();
  492. # }
  493. @overload
  494. def add_tick(self, tick: Tick) -> Tick:
  495. """(private API)"""
  496. pass
  497. # const char* GetText(int idx) const { return TextBuffer.Buf.Data + Ticks[idx].TextOffset; } /* original C++ signature */
  498. @overload
  499. def get_text(self, idx: int) -> str:
  500. """(private API)"""
  501. pass
  502. # const char* GetText(const ImPlot3DTick& tick) const { return GetText(tick.Idx); } /* original C++ signature */
  503. @overload
  504. def get_text(self, tick: Tick) -> str:
  505. """(private API)"""
  506. pass
  507. # void Reset() { /* original C++ signature */
  508. # Ticks.shrink(0);
  509. # TextBuffer.Buf.shrink(0);
  510. # }
  511. def reset(self) -> None:
  512. """(private API)"""
  513. pass
  514. # int TickCount() const { return Ticks.Size; } /* original C++ signature */
  515. def tick_count(self) -> int:
  516. """(private API)"""
  517. pass
  518. class Axis:
  519. """ Holds axis information"""
  520. # Flags
  521. # ImPlot3DAxisFlags Flags; /* original C++ signature */
  522. flags: AxisFlags
  523. # ImPlot3DAxisFlags PreviousFlags; /* original C++ signature */
  524. previous_flags: AxisFlags
  525. # Range
  526. # ImPlot3DRange Range; /* original C++ signature */
  527. range: Range
  528. # ImPlot3DCond RangeCond; /* original C++ signature */
  529. range_cond: Cond
  530. # double NDCScale; /* original C++ signature */
  531. ndc_scale: float
  532. # ImPlot3DScale Scale; /* original C++ signature */
  533. scale: Scale
  534. # Ticks
  535. # ImPlot3DTicker Ticker; /* original C++ signature */
  536. ticker: Ticker
  537. # void* FormatterData; /* original C++ signature */
  538. formatter_data: Any
  539. # bool ShowDefaultTicks; /* original C++ signature */
  540. show_default_ticks: bool
  541. # Scale
  542. # void* TransformData; /* original C++ signature */
  543. transform_data: Any # Custom transform data set by the user
  544. # ImPlot3DRange ScaledRange; /* original C++ signature */
  545. scaled_range: Range # Cached scaled range values
  546. # Fit data
  547. # bool FitThisFrame; /* original C++ signature */
  548. fit_this_frame: bool
  549. # ImPlot3DRange FitExtents; /* original C++ signature */
  550. fit_extents: Range
  551. # Constraints
  552. # ImPlot3DRange ConstraintRange; /* original C++ signature */
  553. constraint_range: Range
  554. # ImPlot3DRange ConstraintZoom; /* original C++ signature */
  555. constraint_zoom: Range
  556. # User input
  557. # bool Hovered; /* original C++ signature */
  558. hovered: bool
  559. # bool Held; /* original C++ signature */
  560. held: bool
  561. # Cached colors
  562. # ImU32 ColorBg; /* original C++ signature */
  563. color_bg: ImU32
  564. # ImU32 ColorHov; /* original C++ signature */
  565. color_hov: ImU32
  566. # ImU32 ColorAct; /* original C++ signature */
  567. color_act: ImU32
  568. # ImPlot3DAxis() { /* original C++ signature */
  569. # PreviousFlags = Flags = ImPlot3DAxisFlags_None;
  570. # // Range
  571. # Range.Min = 0.0;
  572. # Range.Max = 1.0;
  573. # RangeCond = ImPlot3DCond_None;
  574. # // Scale
  575. # NDCScale = 1.0;
  576. # Scale = ImPlot3DScale_Linear;
  577. # TransformForward = TransformInverse = nullptr;
  578. # TransformData = nullptr;
  579. # // Ticks
  580. # Formatter = nullptr;
  581. # FormatterData = nullptr;
  582. # Locator = nullptr;
  583. # ShowDefaultTicks = true;
  584. # // Fit data
  585. # FitThisFrame = true;
  586. # FitExtents = ImPlot3DRange(HUGE_VAL, -HUGE_VAL);
  587. # // Constraints
  588. # ConstraintRange = ImPlot3DRange(-INFINITY, INFINITY);
  589. # ConstraintZoom = ImPlot3DRange(DBL_MIN, INFINITY);
  590. # // User input
  591. # Hovered = false;
  592. # Held = false;
  593. # // Cached colors
  594. # ColorBg = ColorHov = ColorAct = IM_COL32_BLACK_TRANS;
  595. # }
  596. def __init__(self) -> None:
  597. """ Constructor"""
  598. pass
  599. # inline void Reset() { /* original C++ signature */
  600. # RangeCond = ImPlot3DCond_None;
  601. # // Scale
  602. # Scale = ImPlot3DScale_Linear;
  603. # TransformForward = TransformInverse = nullptr;
  604. # TransformData = nullptr;
  605. # // Ticks
  606. # Ticker.Reset();
  607. # Formatter = nullptr;
  608. # FormatterData = nullptr;
  609. # Locator = nullptr;
  610. # ShowDefaultTicks = true;
  611. # // Fit data
  612. # FitExtents = ImPlot3DRange(HUGE_VAL, -HUGE_VAL);
  613. # // Constraints
  614. # ConstraintRange = ImPlot3DRange(-INFINITY, INFINITY);
  615. # ConstraintZoom = ImPlot3DRange(DBL_MIN, INFINITY);
  616. # }
  617. def reset(self) -> None:
  618. """(private API)"""
  619. pass
  620. # inline void SetRange(double v1, double v2) { /* original C++ signature */
  621. # v1 = ImPlot3D::ImConstrainNan(ImPlot3D::ImConstrainInf(v1));
  622. # v2 = ImPlot3D::ImConstrainNan(ImPlot3D::ImConstrainInf(v2));
  623. # Range.Min = ImMin(v1, v2);
  624. # Range.Max = ImMax(v1, v2);
  625. # Constrain();
  626. # UpdateTransformCache();
  627. # }
  628. def set_range(self, v1: float, v2: float) -> None:
  629. """(private API)"""
  630. pass
  631. # inline bool SetMin(double _min, bool force = false) { /* original C++ signature */
  632. # if (!force && IsLockedMin())
  633. # return false;
  634. # _min = ImPlot3D::ImConstrainNan(ImPlot3D::ImConstrainInf(_min));
  635. #
  636. # // Constraints
  637. # if (_min < ConstraintRange.Min)
  638. # _min = ConstraintRange.Min;
  639. # double zoom = Range.Max - _min;
  640. # if (zoom < ConstraintZoom.Min)
  641. # _min = Range.Max - ConstraintZoom.Min;
  642. # if (zoom > ConstraintZoom.Max)
  643. # _min = Range.Max - ConstraintZoom.Max;
  644. #
  645. # // Ensure min is less than max
  646. # if (_min >= Range.Max)
  647. # return false;
  648. #
  649. # Range.Min = _min;
  650. # UpdateTransformCache();
  651. # return true;
  652. # }
  653. def set_min(self, _min: float, force: bool = False) -> bool:
  654. """(private API)"""
  655. pass
  656. # inline bool SetMax(double _max, bool force = false) { /* original C++ signature */
  657. # if (!force && IsLockedMax())
  658. # return false;
  659. # _max = ImPlot3D::ImConstrainNan(ImPlot3D::ImConstrainInf(_max));
  660. #
  661. # // Constraints
  662. # if (_max > ConstraintRange.Max)
  663. # _max = ConstraintRange.Max;
  664. # double zoom = _max - Range.Min;
  665. # if (zoom < ConstraintZoom.Min)
  666. # _max = Range.Min + ConstraintZoom.Min;
  667. # if (zoom > ConstraintZoom.Max)
  668. # _max = Range.Min + ConstraintZoom.Max;
  669. #
  670. # // Ensure max is greater than min
  671. # if (_max <= Range.Min)
  672. # return false;
  673. #
  674. # Range.Max = _max;
  675. # UpdateTransformCache();
  676. # return true;
  677. # }
  678. def set_max(self, _max: float, force: bool = False) -> bool:
  679. """(private API)"""
  680. pass
  681. # inline void Constrain() { /* original C++ signature */
  682. # Range.Min = ImPlot3D::ImConstrainNan(ImPlot3D::ImConstrainInf(Range.Min));
  683. # Range.Max = ImPlot3D::ImConstrainNan(ImPlot3D::ImConstrainInf(Range.Max));
  684. # if (Range.Min < ConstraintRange.Min)
  685. # Range.Min = ConstraintRange.Min;
  686. # if (Range.Max > ConstraintRange.Max)
  687. # Range.Max = ConstraintRange.Max;
  688. # double zoom = Range.Size();
  689. # if (zoom < ConstraintZoom.Min) {
  690. # double delta = (ConstraintZoom.Min - zoom) * 0.5;
  691. # Range.Min -= delta;
  692. # Range.Max += delta;
  693. # }
  694. # if (zoom > ConstraintZoom.Max) {
  695. # double delta = (zoom - ConstraintZoom.Max) * 0.5;
  696. # Range.Min += delta;
  697. # Range.Max -= delta;
  698. # }
  699. # if (Range.Max <= Range.Min)
  700. # Range.Max = Range.Min + DBL_EPSILON;
  701. # }
  702. def constrain(self) -> None:
  703. """(private API)"""
  704. pass
  705. # inline void UpdateTransformCache() { /* original C++ signature */
  706. # if (TransformForward != nullptr) {
  707. # ScaledRange.Min = TransformForward(Range.Min, TransformData);
  708. # ScaledRange.Max = TransformForward(Range.Max, TransformData);
  709. # } else {
  710. # ScaledRange.Min = Range.Min;
  711. # ScaledRange.Max = Range.Max;
  712. # }
  713. # }
  714. def update_transform_cache(self) -> None:
  715. """(private API)"""
  716. pass
  717. # inline double PlotToNDC(double plt) const { /* original C++ signature */
  718. # if (TransformForward != nullptr) {
  719. # double s = TransformForward(plt, TransformData);
  720. # return (s - ScaledRange.Min) / (ScaledRange.Max - ScaledRange.Min);
  721. # }
  722. # return (plt - Range.Min) / (Range.Max - Range.Min);
  723. # }
  724. def plot_to_ndc(self, plt: float) -> float:
  725. """(private API)"""
  726. pass
  727. # inline double NDCToPlot(double t) const { /* original C++ signature */
  728. # if (TransformInverse != nullptr) {
  729. # double s = t * (ScaledRange.Max - ScaledRange.Min) + ScaledRange.Min;
  730. # return TransformInverse(s, TransformData);
  731. # }
  732. # return Range.Min + t * (Range.Max - Range.Min);
  733. # }
  734. def ndc_to_plot(self, t: float) -> float:
  735. """(private API)"""
  736. pass
  737. # inline bool IsRangeLocked() const { return RangeCond == ImPlot3DCond_Always; } /* original C++ signature */
  738. def is_range_locked(self) -> bool:
  739. """(private API)"""
  740. pass
  741. # inline bool IsLockedMin() const { return IsRangeLocked() || ImPlot3D::ImHasFlag(Flags, ImPlot3DAxisFlags_LockMin); } /* original C++ signature */
  742. def is_locked_min(self) -> bool:
  743. """(private API)"""
  744. pass
  745. # inline bool IsLockedMax() const { return IsRangeLocked() || ImPlot3D::ImHasFlag(Flags, ImPlot3DAxisFlags_LockMax); } /* original C++ signature */
  746. def is_locked_max(self) -> bool:
  747. """(private API)"""
  748. pass
  749. # inline bool IsLocked() const { return IsLockedMin() && IsLockedMax(); } /* original C++ signature */
  750. def is_locked(self) -> bool:
  751. """(private API)"""
  752. pass
  753. # inline bool IsInputLockedMin() const { return IsLockedMin() || IsAutoFitting(); } /* original C++ signature */
  754. def is_input_locked_min(self) -> bool:
  755. """(private API)"""
  756. pass
  757. # inline bool IsInputLockedMax() const { return IsLockedMax() || IsAutoFitting(); } /* original C++ signature */
  758. def is_input_locked_max(self) -> bool:
  759. """(private API)"""
  760. pass
  761. # inline bool IsInputLocked() const { return IsLocked() || IsAutoFitting(); } /* original C++ signature */
  762. def is_input_locked(self) -> bool:
  763. """(private API)"""
  764. pass
  765. # inline bool IsPanLocked(bool increasing) { /* original C++ signature */
  766. # if (ImPlot3D::ImHasFlag(Flags, ImPlot3DAxisFlags_PanStretch)) {
  767. # return IsInputLocked();
  768. # } else {
  769. # if (IsLockedMin() || IsLockedMax() || IsAutoFitting())
  770. # return false;
  771. # if (increasing)
  772. # return Range.Max == ConstraintRange.Max;
  773. # else
  774. # return Range.Min == ConstraintRange.Min;
  775. # }
  776. # }
  777. def is_pan_locked(self, increasing: bool) -> bool:
  778. """(private API)"""
  779. pass
  780. # inline void SetLabel(const char* label) { /* original C++ signature */
  781. # Label.Buf.shrink(0);
  782. # if (label && ImGui::FindRenderedTextEnd(label, nullptr) != label)
  783. # Label.append(label, label + strlen(label) + 1);
  784. # }
  785. def set_label(self, label: str) -> None:
  786. """(private API)"""
  787. pass
  788. # inline const char* GetLabel() const { return Label.Buf.Data; } /* original C++ signature */
  789. def get_label(self) -> str:
  790. """(private API)"""
  791. pass
  792. # inline double NDCSize() const { /* original C++ signature */
  793. # // By default, the axis span from NDC -0.5 to 0.5, so size is 1.0
  794. # // If NDCScale is applied, the size is scaled accordingly
  795. # return NDCScale;
  796. # }
  797. def ndc_size(self) -> float:
  798. """(private API)"""
  799. pass
  800. # inline void SetAspect(double units_per_ndc_unit) { /* original C++ signature */
  801. # double new_size = units_per_ndc_unit * NDCSize();
  802. # double delta = (new_size - Range.Size()) * 0.5;
  803. # if (IsLocked())
  804. # return;
  805. # else if (IsLockedMin() && !IsLockedMax())
  806. # SetRange(Range.Min, Range.Max + 2 * delta);
  807. # else if (!IsLockedMin() && IsLockedMax())
  808. # SetRange(Range.Min - 2 * delta, Range.Max);
  809. # else
  810. # SetRange(Range.Min - delta, Range.Max + delta);
  811. # }
  812. def set_aspect(self, units_per_ndc_unit: float) -> None:
  813. """(private API)"""
  814. pass
  815. # double GetAspect() const { return Range.Size() / NDCSize(); } /* original C++ signature */
  816. def get_aspect(self) -> float:
  817. """(private API)"""
  818. pass
  819. # bool HasLabel() const; /* original C++ signature */
  820. def has_label(self) -> bool:
  821. """(private API)"""
  822. pass
  823. # bool HasGridLines() const; /* original C++ signature */
  824. def has_grid_lines(self) -> bool:
  825. """(private API)"""
  826. pass
  827. # bool HasTickLabels() const; /* original C++ signature */
  828. def has_tick_labels(self) -> bool:
  829. """(private API)"""
  830. pass
  831. # bool HasTickMarks() const; /* original C++ signature */
  832. def has_tick_marks(self) -> bool:
  833. """(private API)"""
  834. pass
  835. # bool IsAutoFitting() const; /* original C++ signature */
  836. def is_auto_fitting(self) -> bool:
  837. """(private API)"""
  838. pass
  839. # void ExtendFit(double value); /* original C++ signature */
  840. def extend_fit(self, value: float) -> None:
  841. """(private API)"""
  842. pass
  843. # void ApplyFit(); /* original C++ signature */
  844. def apply_fit(self) -> None:
  845. """(private API)"""
  846. pass
  847. class Plot:
  848. """ Holds plot state information that must persist after EndPlot"""
  849. # ImGuiID ID; /* original C++ signature */
  850. id_: ID
  851. # ImPlot3DFlags Flags; /* original C++ signature */
  852. flags: Flags
  853. # ImPlot3DFlags PreviousFlags; /* original C++ signature */
  854. previous_flags: Flags
  855. # bool JustCreated; /* original C++ signature */
  856. just_created: bool
  857. # bool Initialized; /* original C++ signature */
  858. initialized: bool
  859. # Bounding rectangles
  860. # ImRect FrameRect; /* original C++ signature */
  861. frame_rect: ImRect # Outermost bounding rectangle that encapsulates whole the plot/title/padding/etc
  862. # ImRect CanvasRect; /* original C++ signature */
  863. canvas_rect: ImRect # Frame rectangle reduced by padding
  864. # ImRect PlotRect; /* original C++ signature */
  865. plot_rect: ImRect # Bounding rectangle for the actual plot area
  866. # Rotation & axes & box
  867. # ImPlot3DQuat InitialRotation; /* original C++ signature */
  868. initial_rotation: Quat # Initial rotation quaternion
  869. # ImPlot3DQuat Rotation; /* original C++ signature */
  870. rotation: Quat # Current rotation quaternion
  871. # ImPlot3DCond RotationCond; /* original C++ signature */
  872. rotation_cond: Cond
  873. # Animation
  874. # float AnimationTime; /* original C++ signature */
  875. animation_time: float # Remaining animation time
  876. # ImPlot3DQuat RotationAnimationEnd; /* original C++ signature */
  877. rotation_animation_end: Quat # End rotation for animation
  878. # User input
  879. # bool SetupLocked; /* original C++ signature */
  880. setup_locked: bool
  881. # bool Hovered; /* original C++ signature */
  882. hovered: bool
  883. # bool Held; /* original C++ signature */
  884. held: bool
  885. # int HeldEdgeIdx; /* original C++ signature */
  886. held_edge_idx: int # Index of the edge being held
  887. # int HeldPlaneIdx; /* original C++ signature */
  888. held_plane_idx: int # Index of the plane being held
  889. # ImPlot3DPoint DragRotationAxis; /* original C++ signature */
  890. drag_rotation_axis: Point # Axis of rotation for the duration of a drag
  891. # bool FitThisFrame; /* original C++ signature */
  892. # Fit data
  893. fit_this_frame: bool
  894. # ImPlot3DItemGroup Items; /* original C++ signature */
  895. # Items
  896. items: ItemGroup
  897. # Misc
  898. # bool ContextClick; /* original C++ signature */
  899. context_click: bool # True if context button was clicked (to distinguish from double click)
  900. # bool OpenContextThisFrame; /* original C++ signature */
  901. open_context_this_frame: bool
  902. # ImPlot3DPlot() { /* original C++ signature */
  903. # PreviousFlags = Flags = ImPlot3DFlags_None;
  904. # JustCreated = true;
  905. # Initialized = false;
  906. # InitialRotation = ImPlot3DQuat(-0.513269, -0.212596, -0.318184, 0.76819);
  907. # Rotation = ImPlot3DQuat(0.0, 0.0, 0.0, 1.0);
  908. # RotationCond = ImPlot3DCond_None;
  909. # for (int i = 0; i < 3; i++)
  910. # Axes[i] = ImPlot3DAxis();
  911. # AnimationTime = 0.0f;
  912. # RotationAnimationEnd = Rotation;
  913. # SetupLocked = false;
  914. # Hovered = Held = false;
  915. # HeldEdgeIdx = -1;
  916. # HeldPlaneIdx = -1;
  917. # DragRotationAxis = ImPlot3DPoint(0.0, 0.0, 0.0);
  918. # FitThisFrame = true;
  919. # ContextClick = false;
  920. # OpenContextThisFrame = false;
  921. # }
  922. def __init__(self) -> None:
  923. pass
  924. # inline void SetTitle(const char* title) { /* original C++ signature */
  925. # Title.Buf.shrink(0);
  926. # if (title && ImGui::FindRenderedTextEnd(title, nullptr) != title)
  927. # Title.append(title, title + strlen(title) + 1);
  928. # }
  929. def set_title(self, title: str) -> None:
  930. """(private API)"""
  931. pass
  932. # inline bool HasTitle() const { return !Title.empty() && !ImPlot3D::ImHasFlag(Flags, ImPlot3DFlags_NoTitle); } /* original C++ signature */
  933. def has_title(self) -> bool:
  934. """(private API)"""
  935. pass
  936. # inline const char* GetTitle() const { return Title.Buf.Data; } /* original C++ signature */
  937. def get_title(self) -> str:
  938. """(private API)"""
  939. pass
  940. # inline bool IsRotationLocked() const { return RotationCond == ImPlot3DCond_Always; } /* original C++ signature */
  941. def is_rotation_locked(self) -> bool:
  942. """(private API)"""
  943. pass
  944. # void ExtendFit(const ImPlot3DPoint& point); /* original C++ signature */
  945. def extend_fit(self, point: Point) -> None:
  946. """ Extends the fit range of all three axes to include the provided point
  947. (private API)
  948. """
  949. pass
  950. # ImPlot3DPoint RangeMin() const; /* original C++ signature */
  951. def range_min(self) -> Point:
  952. """ Returns the minimum of the range in all three dimensions
  953. (private API)
  954. """
  955. pass
  956. # ImPlot3DPoint RangeMax() const; /* original C++ signature */
  957. def range_max(self) -> Point:
  958. """ Returns the maximum of the range in all three dimensions
  959. (private API)
  960. """
  961. pass
  962. # ImPlot3DPoint RangeCenter() const; /* original C++ signature */
  963. def range_center(self) -> Point:
  964. """ Returns the point at the center of the range in all three dimensions
  965. (private API)
  966. """
  967. pass
  968. # void SetRange(const ImPlot3DPoint& min, const ImPlot3DPoint& max); /* original C++ signature */
  969. def set_range(self, min: Point, max: Point) -> None:
  970. """ Sets the range of all three axes
  971. (private API)
  972. """
  973. pass
  974. # float GetViewScale() const; /* original C++ signature */
  975. def get_view_scale(self) -> float:
  976. """ Returns the scale of the plot view (constant to convert from NDC coordinates to pixels coordinates)
  977. (private API)
  978. """
  979. pass
  980. # ImPlot3DPoint GetBoxScale() const; /* original C++ signature */
  981. def get_box_scale(self) -> Point:
  982. """ Returns the scale of the plot box in each dimension
  983. (private API)
  984. """
  985. pass
  986. # void ApplyEqualAspect(ImAxis3D ref_axis); /* original C++ signature */
  987. def apply_equal_aspect(self, ref_axis: ImAxis3D) -> None:
  988. """ Applies equal aspect ratio constraint using the specified axis as reference.
  989. Other axes are adjusted to match the reference axis's aspect ratio (units per NDC unit).
  990. (private API)
  991. """
  992. pass
  993. class Context:
  994. # ImPlot3DPlot* CurrentPlot; /* original C++ signature */
  995. current_plot: Plot
  996. # ImPlot3DItemGroup* CurrentItems; /* original C++ signature */
  997. current_items: ItemGroup
  998. # ImPlot3DItem* CurrentItem; /* original C++ signature */
  999. current_item: Item
  1000. # ImPlot3DNextItemData NextItemData; /* original C++ signature */
  1001. next_item_data: NextItemData
  1002. # ImPlot3DStyle Style; /* original C++ signature */
  1003. style: Style
  1004. # ImPlot3DColormapData ColormapData; /* original C++ signature */
  1005. colormap_data: ColormapData
  1006. # ImPlot3DContext(ImPlot3DNextItemData NextItemData = ImPlot3DNextItemData(), ImPlot3DStyle Style = ImPlot3DStyle(), ImPlot3DColormapData ColormapData = ImPlot3DColormapData()); /* original C++ signature */
  1007. def __init__(self, next_item_data: Optional[NextItemData] = None, style: Optional[Style] = None, colormap_data: Optional[ColormapData] = None) -> None:
  1008. """Auto-generated default constructor with named params
  1009. Python bindings defaults:
  1010. If any of the params below is None, then its default value below will be used:
  1011. * NextItemData: NextItemData()
  1012. * Style: Style()
  1013. * ColormapData: ColormapData()
  1014. """
  1015. pass
  1016. #-----------------------------------------------------------------------------
  1017. # [SECTION] Context Pointer
  1018. #-----------------------------------------------------------------------------
  1019. #-----------------------------------------------------------------------------
  1020. # [SECTION] Context Utils
  1021. #-----------------------------------------------------------------------------
  1022. # IMPLOT3D_API void InitializeContext(ImPlot3DContext* ctx); /* original C++ signature */
  1023. def initialize_context(ctx: Context) -> None:
  1024. """ Initialize ImPlot3DContext"""
  1025. pass
  1026. # IMPLOT3D_API void ResetContext(ImPlot3DContext* ctx); /* original C++ signature */
  1027. def reset_context(ctx: Context) -> None:
  1028. """ Reset ImPlot3DContext"""
  1029. pass
  1030. #-----------------------------------------------------------------------------
  1031. # [SECTION] Style Utils
  1032. #-----------------------------------------------------------------------------
  1033. # IMPLOT3D_API bool IsColorAuto(const ImVec4& col); /* original C++ signature */
  1034. @overload
  1035. def is_color_auto(col: ImVec4Like) -> bool:
  1036. pass
  1037. # IMPLOT3D_API bool IsColorAuto(ImPlot3DCol idx); /* original C++ signature */
  1038. @overload
  1039. def is_color_auto(idx: Col) -> bool:
  1040. pass
  1041. # IMPLOT3D_API ImVec4 GetAutoColor(ImPlot3DCol idx); /* original C++ signature */
  1042. def get_auto_color(idx: Col) -> ImVec4:
  1043. pass
  1044. # IMPLOT3D_API const char* GetStyleColorName(ImPlot3DCol idx); /* original C++ signature */
  1045. def get_style_color_name(idx: Col) -> str:
  1046. pass
  1047. # Returns white or black text given background color
  1048. # static inline ImU32 CalcTextColor(const ImVec4& bg) { /* original C++ signature */
  1049. # return (bg.x * 0.299f + bg.y * 0.587f + bg.z * 0.114f) > 0.5f ? IM_COL32_BLACK : IM_COL32_WHITE;
  1050. # }
  1051. @overload
  1052. def calc_text_color(bg: ImVec4Like) -> ImU32:
  1053. """(private API)"""
  1054. pass
  1055. # static inline ImU32 CalcTextColor(ImU32 bg) { return CalcTextColor(ImGui::ColorConvertU32ToFloat4(bg)); } /* original C++ signature */
  1056. @overload
  1057. def calc_text_color(bg: ImU32) -> ImU32:
  1058. """(private API)"""
  1059. pass
  1060. # IMPLOT3D_API const ImPlot3DNextItemData& GetItemData(); /* original C++ signature */
  1061. def get_item_data() -> NextItemData:
  1062. """ Get styling data for next item (call between BeginItem/EndItem)"""
  1063. pass
  1064. # IMPLOT3D_API ImU32 GetColormapColorU32(int idx, ImPlot3DColormap cmap); /* original C++ signature */
  1065. def get_colormap_color_u32(idx: int, cmap: Colormap) -> ImU32:
  1066. """ Returns a color from the Color map given an index >= 0 (modulo will be performed)"""
  1067. pass
  1068. # IMPLOT3D_API ImU32 NextColormapColorU32(); /* original C++ signature */
  1069. def next_colormap_color_u32() -> ImU32:
  1070. """ Returns the next unused colormap color and advances the colormap. Can be used to skip colors if desired"""
  1071. pass
  1072. # IMPLOT3D_API void RenderColorBar(const ImU32* colors, int size, ImDrawList& DrawList, const ImRect& bounds, bool vert, bool reversed, /* original C++ signature */
  1073. # bool continuous);
  1074. def render_color_bar(colors: ImU32, size: int, draw_list: ImDrawList, bounds: ImRect, vert: bool, reversed: bool, continuous: bool) -> None:
  1075. """ Render a colormap bar"""
  1076. pass
  1077. #-----------------------------------------------------------------------------
  1078. # [SECTION] Item Utils
  1079. #-----------------------------------------------------------------------------
  1080. # Begins a new item. Returns False if the item should not be plotted
  1081. # IMPLOT3D_API bool BeginItem(const char* label_id, const ImPlot3DSpec& spec = ImPlot3DSpec(), const ImVec4& item_col = IMPLOT3D_AUTO_COL, /* original C++ signature */
  1082. # ImPlot3DMarker item_mkr = ImPlot3DMarker_Invalid);
  1083. def begin_item(label_id: str, spec: Optional[Spec] = None, item_col: Optional[ImVec4Like] = None, item_mkr: Optional[Marker] = None) -> bool:
  1084. """Python bindings defaults:
  1085. If any of the params below is None, then its default value below will be used:
  1086. * spec: Spec()
  1087. * item_col: IMPLOT3D_AUTO_COL
  1088. * item_mkr: Marker_Invalid
  1089. """
  1090. pass
  1091. # IMPLOT3D_API void EndItem(); /* original C++ signature */
  1092. def end_item() -> None:
  1093. pass
  1094. # IMPLOT3D_API ImPlot3DItem* RegisterOrGetItem(const char* label_id, ImPlot3DItemFlags flags, bool* just_created = nullptr); /* original C++ signature */
  1095. def register_or_get_item(label_id: str, flags: ItemFlags, just_created: Optional[bool] = None) -> Tuple[Item , Optional[bool]]:
  1096. """ Register or get an existing item from the current plot"""
  1097. pass
  1098. # IMPLOT3D_API ImPlot3DItem* GetCurrentItem(); /* original C++ signature */
  1099. def get_current_item() -> Item:
  1100. """ Gets the current item from ImPlot3DContext"""
  1101. pass
  1102. # IMPLOT3D_API void BustItemCache(); /* original C++ signature */
  1103. def bust_item_cache() -> None:
  1104. """ Busts the cache for every item for every plot in the current context"""
  1105. pass
  1106. # IMPLOT3D_API void AddTextRotated(ImDrawList* draw_list, ImVec2 pos, float angle, ImU32 col, const char* text_begin, const char* text_end = nullptr); /* original C++ signature */
  1107. def add_text_rotated(draw_list: ImDrawList, pos: ImVec2Like, angle: float, col: ImU32, text_begin: str, text_end: Optional[str] = None) -> None:
  1108. """ TODO move to another place"""
  1109. pass
  1110. #-----------------------------------------------------------------------------
  1111. # [SECTION] Plot Utils
  1112. #-----------------------------------------------------------------------------
  1113. # IMPLOT3D_API ImPlot3DPlot* GetCurrentPlot(); /* original C++ signature */
  1114. def get_current_plot() -> Plot:
  1115. """ Gets the current plot from ImPlot3DContext"""
  1116. pass
  1117. # IMPLOT3D_API void BustPlotCache(); /* original C++ signature */
  1118. def bust_plot_cache() -> None:
  1119. """ Busts the cache for every plot in the current context"""
  1120. pass
  1121. # IMPLOT3D_API ImVec2 GetFramePos(); /* original C++ signature */
  1122. def get_frame_pos() -> ImVec2:
  1123. """ Get the current frame position (top-left) in pixels"""
  1124. pass
  1125. # IMPLOT3D_API ImVec2 GetFrameSize(); /* original C++ signature */
  1126. def get_frame_size() -> ImVec2:
  1127. """ Get the current frame size in pixels"""
  1128. pass
  1129. # Convert a position in the current plot's coordinate system to the current plot's normalized device coordinate system (NDC)
  1130. # When the cube's aspect ratio is [1,1,1], the NDC ranges from [-0.5, 0.5] along each axis
  1131. # IMPLOT3D_API ImPlot3DPoint PlotToNDC(const ImPlot3DPoint& point); /* original C++ signature */
  1132. def plot_to_ndc(point: Point) -> Point:
  1133. pass
  1134. # IMPLOT3D_API ImPlot3DPoint NDCToPlot(const ImPlot3DPoint& point); /* original C++ signature */
  1135. def ndc_to_plot(point: Point) -> Point:
  1136. pass
  1137. # IMPLOT3D_API ImVec2 NDCToPixels(const ImPlot3DPoint& point); /* original C++ signature */
  1138. def ndc_to_pixels(point: Point) -> ImVec2:
  1139. """ Convert a position in the current plot's NDC to pixels"""
  1140. pass
  1141. # IMPLOT3D_API ImPlot3DRay PixelsToNDCRay(const ImVec2& pix); /* original C++ signature */
  1142. def pixels_to_ndc_ray(pix: ImVec2Like) -> Ray:
  1143. """ Convert a pixel coordinate to a ray in the NDC"""
  1144. pass
  1145. # IMPLOT3D_API ImPlot3DRay NDCRayToPlotRay(const ImPlot3DRay& ray); /* original C++ signature */
  1146. def ndc_ray_to_plot_ray(ray: Ray) -> Ray:
  1147. """ Convert a ray in the NDC to a ray in the current plot's coordinate system"""
  1148. pass
  1149. #-----------------------------------------------------------------------------
  1150. # [SECTION] Setup Utils
  1151. #-----------------------------------------------------------------------------
  1152. # IMPLOT3D_API void SetupLock(); /* original C++ signature */
  1153. def setup_lock() -> None:
  1154. pass
  1155. #-----------------------------------------------------------------------------
  1156. # [SECTION] Transforms
  1157. #-----------------------------------------------------------------------------
  1158. # static inline double TransformForward_Log10(double v, void*) { return ImLog10(v <= 0.0 ? DBL_MIN : v); } /* original C++ signature */
  1159. def transform_forward_log10(v: float, param_1: Any) -> float:
  1160. """(private API)"""
  1161. pass
  1162. # static inline double TransformInverse_Log10(double v, void*) { return ImPow(10, v); } /* original C++ signature */
  1163. def transform_inverse_log10(v: float, param_1: Any) -> float:
  1164. """(private API)"""
  1165. pass
  1166. # static inline double TransformForward_SymLog(double v, void*) { return 2.0 * ImAsinh(v / 2.0); } /* original C++ signature */
  1167. def transform_forward_sym_log(v: float, param_1: Any) -> float:
  1168. """(private API)"""
  1169. pass
  1170. # static inline double TransformInverse_SymLog(double v, void*) { return 2.0 * ImSinh(v / 2.0); } /* original C++ signature */
  1171. def transform_inverse_sym_log(v: float, param_1: Any) -> float:
  1172. """(private API)"""
  1173. pass
  1174. #-----------------------------------------------------------------------------
  1175. # [SECTION] Formatter
  1176. #-----------------------------------------------------------------------------
  1177. #------------------------------------------------------------------------------
  1178. # [SECTION] Locator
  1179. #------------------------------------------------------------------------------
  1180. # #endif
  1181. #################### </generated_from:implot3d_internal.h> ####################
  1182. # </litgen_stub>
  1183. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AUTOGENERATED CODE END !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!