PeriDyno 1.0.0
Loading...
Searching...
No Matches
imgui_extend.h
Go to the documentation of this file.
1#pragma once
2#include <imgui.h>
3
4// dyno
5#include "Vector.h"
6#include "Module.h"
7#include "IconsFontAwesome5.h"
8
9namespace ImGui
10{
22
23 // Horizontal
26 // Logo with text
27 IMGUI_API bool ImageButtonWithText(ImTextureID texId,const char* label,const ImVec2& imageSize=ImVec2(0,0), const ImVec2& uv0 = ImVec2(0,0), const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,0), const ImVec4& tint_col = ImVec4(1,1,1,1));
28 // ToggleButton (with Icon or no)
29 IMGUI_API bool radioWithIconButton(const char* label, const char* tooltip, bool v);
30 IMGUI_API bool clickButton(const char* label, const char* tooltip);
31 IMGUI_API void toggleButton(ImTextureID texId, const char* label, bool *v);
32 IMGUI_API void toggleButton(const char* label, bool *v);
33 // ExampleButton
34 IMGUI_API void exampleButton(const char* label, bool *v);
35 // ColorBar
36
37 IMGUI_API bool ColorBar(char* label, float* values, ImU32* col, int length, int num_type);
38
39 // Get ID without label showing
40 IMGUI_API void beginTitle(const char* label);
41 IMGUI_API void endTitle();
42
43 IMGUI_API ImU32 VecToImU(const dyno::Vec3f* v);
44 IMGUI_API ImU32 ToHeatColor(const float v, const float v_min, const float v_max);
45 IMGUI_API ImU32 ToJetColor(const float v, const float v_min, const float v_max);
46
47 template<typename T>
48 std::shared_ptr<ImU32[]> ToImU(T v, int size);
49 template<>
50 std::shared_ptr<ImU32[]> ToImU<dyno::Vec3f*>(dyno::Vec3f* v, int size);
51 template<>
52 std::shared_ptr<ImU32[]> ToImU<const dyno::Vec3f*>(const dyno::Vec3f* v, int size);
53
54#ifdef CUDA_BACKEND
55 template<>
56 std::shared_ptr<ImU32[]> ToImU<dyno::DArray<dyno::Vec3f>>(dyno::DArray<dyno::Vec3f> v, int size);
57#endif
58
59// template<>
60// bool ColorBar<std::shared_ptr<ImU32[]>>(char* label, float* values, std::shared_ptr<ImU32[]>* col, int length);
61//
62// template<>
63// bool ColorBar<ImU32>(char* label, float* values, ImU32* col, int length);
64
65 void initializeStyle(float scale);
66}
#define IMGUI_API
Definition ImGuizmo.h:111
#define T(t)
IMGUI_API ImU32 ToJetColor(const float v, const float v_min, const float v_max)
@ ImGuiExColVal_WindowMenuBg_1
@ ImGuiExColVal_WindowTopBg_1
@ ImGuiExColVal_ButtonHovered_1
@ ImGuiExColVal_COUNT
@ ImGuiExColVal_Button_1
@ ImGuiExColVal_ButtonActive_1
std::shared_ptr< ImU32[]> ToImU(T v, int size)
IMGUI_API void exampleButton(const char *label, bool *v)
IMGUI_API bool clickButton(const char *label, const char *tooltip)
IMGUI_API bool ImageButtonWithText(ImTextureID texId, const char *label, const ImVec2 &imageSize=ImVec2(0, 0), const ImVec2 &uv0=ImVec2(0, 0), const ImVec2 &uv1=ImVec2(1, 1), int frame_padding=-1, const ImVec4 &bg_col=ImVec4(0, 0, 0, 0), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1))
std::shared_ptr< ImU32[]> ToImU< dyno::Vec3f * >(dyno::Vec3f *v, int size)
ImVec4 ExColorsVal[ImGuiExColVal_COUNT]
void initializeStyle(float scale)
IMGUI_API void initColorVal()
IMGUI_API bool ColorBar(char *label, float *values, ImU32 *col, int length, int num_type)
IMGUI_API void beginTitle(const char *label)
IMGUI_API void EndHorizontal()
IMGUI_API void toggleButton(ImTextureID texId, const char *label, bool *v)
IMGUI_API void endTitle()
IMGUI_API ImU32 ToHeatColor(const float v, const float v_min, const float v_max)
IMGUI_API bool radioWithIconButton(const char *label, const char *tooltip, bool v)
std::shared_ptr< ImU32[]> ToImU< const dyno::Vec3f * >(const dyno::Vec3f *v, int size)
IMGUI_API void BeginHorizontal()
IMGUI_API ImU32 VecToImU(const dyno::Vec3f *v)
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89
Vector< float, 3 > Vec3f
Definition Vector3D.h:93