MeshLib
 
Loading...
Searching...
No Matches
MRUIStyle.h
Go to the documentation of this file.
1#pragma once
2#include "MRMesh/MRFinally.h"
3#include "MRPch/MRFmt.h"
4#include "MRViewer/MRUnits.h"
6#include "exports.h"
7#include "imgui.h"
8#include <span>
9#include <string>
10#include <optional>
11
12namespace MR
13{
14
15class ImGuiImage;
16
17namespace UI
18{
19
20// enumeration texture types
21enum class TextureType
22{
23 Mono,
28 Count
29};
30
31// get texture by type
32MRVIEWER_API std::unique_ptr<ImGuiImage>& getTexture( TextureType type );
33
35MRVIEWER_API void init();
36
39{
46
48 bool forceImguiTextColor = false;
50 bool border = false;
51
54
56 bool enableTestEngine = true;
57};
58
60{
61 ImGuiButtonFlags flags = ImGuiButtonFlags_None;
62 // flag for buttonEx, which can be disabled
63 bool active = true;
64 // button without a gradient, always ative, configurable by an external style
65 bool flatBackgroundColor = false;
66};
67
69{
70 // the point from which the axes will be drawn
72
73 // size plot by axis
74 float size;
75 // optimal length between dashes
76 float optimalLenth = 10.0f;
77 // the minimum value of the axis
78 float minValue = 0.0f;
79 // the maximal value of the axis
80 float maxValue = 1.0f;
81 // sign every nth dash
83
84 // length dash without text
85 float lenDash = 8.0f;
86 // length dash with text
87 float lenDashWithText = 12.0f;
88 // text offset from dash
89 float textPadding = 3.0f;
90 // the format of the text for labels
92};
93
95MRVIEWER_API bool buttonEx( const char* label, bool active, const Vector2f& size = Vector2f( 0, 0 ),
96 ImGuiButtonFlags flags = ImGuiButtonFlags_None, const ButtonCustomizationParams& custmParams = {} );
99MRVIEWER_API bool button( const char* label, bool active, const Vector2f& size = Vector2f( 0, 0 ), ImGuiKey key = ImGuiKey_None );
102inline bool button( const char* label, const Vector2f& size = Vector2f( 0, 0 ), ImGuiKey key = ImGuiKey_None )
103{
104 return button( label, true, size, key );
105}
108MRVIEWER_API bool buttonCommonSize( const char* label, const Vector2f& size = Vector2f( 0, 0 ), ImGuiKey key = ImGuiKey_None );
110MRVIEWER_API bool buttonUnique( const char* label, int* value, int ownValue, const Vector2f& size = Vector2f( 0, 0 ), ImGuiKey key = ImGuiKey_None );
111
112// draw dash with text along the horizontal axis
113MRVIEWER_API void drawPoltHorizontalAxis( float menuScaling, const PlotAxis& plotAxis );
114// draw dash with text along the vertical axis
115MRVIEWER_API void drawPoltVerticalAxis( float menuScaling, const PlotAxis& plotAxis );
116
117// draw a button with an icon and text under it
118MRVIEWER_API bool buttonIconEx(
119 const std::string& name,
120 const Vector2f& iconSize,
121 const std::string& text,
122 const ImVec2& buttonSize,
123 const ButtonIconCustomizationParams& params = {} );
124// button with a gradient and the ability to make it inactive
125inline bool buttonIcon( const std::string& name, const Vector2f& iconSize, const std::string& text, bool active, const ImVec2& buttonSize )
126{
128 params.active = active;
129 params.flatBackgroundColor = true;
130 return buttonIconEx(name, iconSize, text, buttonSize, params );
131}
132// button with a gradient, always ative
133inline bool buttonIcon( const std::string& name, const Vector2f& iconSize, const std::string& text, const ImVec2& buttonSize )
134{
135 return buttonIconEx( name, iconSize, text, buttonSize );
136}
137// button without a gradient, always ative, configurable by an external style
138inline bool buttonIconFlatBG( const std::string& name, const Vector2f& iconSize, const std::string& text, const ImVec2& buttonSize )
139{
141 params.flatBackgroundColor = true;
142 params.forceImguiTextColor = true;
143 return buttonIconEx( name, iconSize, text, buttonSize, params );
144}
145
147MRVIEWER_API bool checkbox( const char* label, bool* value );
149MRVIEWER_API bool checkboxOrFixedValue( const char* label, bool* value, std::optional<bool> valueOverride );
151MRVIEWER_API bool checkboxValid( const char* label, bool* value, bool valid );
153MRVIEWER_API bool checkboxMixed( const char* label, bool* value, bool mixed );
155template <typename Getter, typename Setter>
156bool checkbox( const char* label, Getter get, Setter set )
157{
158 bool value = get();
159 bool ret = checkbox( label, &value );
160 set( value );
161 return ret;
162}
163
165template <typename T>
166bool checkboxFlags( const char* label, T& target, T flags )
167{
168 bool value = bool( target & flags );
169 bool mixed = value && ( target & flags ) != flags;
170 if ( checkboxMixed( label, &value, mixed ) )
171 {
172 if ( value )
173 target |= flags;
174 else
175 target &= ~flags;
176 return true;
177 }
178 return false;
179}
180
182{
183 // The persistent value of this setting, as set by the user by clicking the checkbox.
184 bool baseValue = false;
185 // Whether the setting is currently inverted because the modifier is held.
186 bool modifierHeld = false;
187
188 // You usually want to read this instead of the variables above.
189 // Returns `baseValue`, but inverted if `modifierHeld` is set.
190 [[nodiscard]] explicit operator bool() const { return baseValue != modifierHeld; }
191};
192
202MRVIEWER_API bool checkboxOrModifier( const char* label, CheckboxOrModifierState& value, int modifiers, int respectedModifiers = -1, std::optional<bool> valueOverride = {} );
203
204
206MRVIEWER_API bool radioButton( const char* label, int* value, int valButton );
208MRVIEWER_API bool radioButtonOrFixedValue( const char* label, int* value, int valButton, std::optional<int> valueOverride );
209
211{
212 // The permanent value of this setting, as set by the user by clicking the radio button.
213 int value{};
214 // The value that is displayed, and to be used - can differ from `value` if modifiers are pressed.
216
217 // The effective value, affected by modifiers.
218 [[nodiscard]] explicit operator int() const
219 {
220 return effectiveValue;
221 }
222};
223
230MRVIEWER_API bool radioButtonOrModifier( const char* label, RadioButtonOrModifierState& value, int valButton, int modifiers, int respectedModifiers = -1, std::optional<int> valueOverride = {} );
231
233MRVIEWER_API bool colorEdit4( const char* label, Vector4f& color, ImGuiColorEditFlags flags = ImGuiColorEditFlags_None );
234MRVIEWER_API bool colorEdit4( const char* label, Color& color, ImGuiColorEditFlags flags = ImGuiColorEditFlags_None );
235
237MRVIEWER_API bool combo( const char* label, int* v, const std::vector<std::string>& options,
238 bool showPreview = true, const std::vector<std::string>& tooltips = {}, const std::string& defaultText = "Not selected" );
239
241MRVIEWER_API bool beginCombo( const char* label, const std::string& text = "Not selected", bool showPreview = true );
242MRVIEWER_API void endCombo( bool showPreview = true );
243
245MRVIEWER_API bool inputText( const char* label, std::string& str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr );
247MRVIEWER_API bool inputTextIntoArray( const char* label, char* array, std::size_t size, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr );
248
250MRVIEWER_API bool inputTextMultiline( const char* label, std::string& str, const ImVec2& size = ImVec2(), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr );
252MRVIEWER_API bool inputTextIntoArrayMultiline( const char* label, char* buf, size_t buf_size, const ImVec2& size = ImVec2(), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr );
253
255{
256 std::optional<ImVec2> cachedSize; // Reset this when manually modifying the text.
257};
259MRVIEWER_API bool inputTextMultilineFullyScrollable( CachedTextSize& cache, const char* label, std::string& str, const ImVec2& size = ImVec2(), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr );
260MRVIEWER_API bool inputTextIntoArrayMultilineFullyScrollable( CachedTextSize& cache, const char* label, char* buf, size_t buf_size, const ImVec2& size = ImVec2(), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr );
261
263MRVIEWER_API bool inputTextCentered( const char* label, std::string& str, float width = 0.0f, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr );
264
266MRVIEWER_API void inputTextCenteredReadOnly( const char* label, const std::string& str, float width = 0.0f, const std::optional<ImVec4>& textColor = {} );
267
268
269namespace detail
270{
271 // A type-erased slider.
272 MRVIEWER_API bool genericSlider( const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags );
273
274 // Whether `T` is a scalar type that we can use with our widgets.
275 template <typename T>
276 concept Scalar = std::is_arithmetic_v<T> && !std::is_same_v<T, bool>;
277
278 // Whether `T` is a scalar or vector that we can use with our widgets.
279 template <typename T>
281
282 // Whether `Bound` is a valid min/max bound for `Target`.
283 // That is, either the same type, or if `Target` is a vector, `Bound` can also be a scalar of the same type.
284 template <typename Bound, typename Target>
286 std::same_as<Bound, Target> ||
287 ( VectorTraits<Bound>::size == 1 && std::same_as<typename VectorTraits<Bound>::BaseType, typename VectorTraits<Target>::BaseType> );
288
289 // Whether `Speed` is a valid drag speed type for `Target`.
290 // That is, either a single/vector of `float` or the same type as target (or its element if it's a vector).
291 template <typename Speed, typename Target>
293 std::same_as<Speed, typename VectorTraits<Target>::BaseType> || std::same_as<Speed, float> ||
294 std::same_as<Speed, Target> || std::same_as<Speed, typename VectorTraits<Target>::template ChangeBase<float>>;
295
296 // A common code for sliders and other widgets dealing with measurement units.
297 // `E` must be explicitly set to a measurement unit enum. The other template parameters are deduced.
298 // `label` is the widget label, `v` is the target value.
299 // `func` draws the widget for an individual scalar. We call it more than once for vectors.
300 // `func` is `( const char* label, auto& elem, int i ) -> bool`.
301 // It receives `elem` already converted to the display units (so you must convert min/max bounds manually). `i` is the element index for vectors.
302 // When `v` is integral, `func` will be instantiated for both integral and floating-point element type. The latter is required if we're doing conversions.
303 // NOTE: For integral `v`, in `func` you must look at the type of `elem` and convert your min/max bounds (etc) to the same type.
304 // Notice `unitParams` being accepted by an lvalue reference. For convenience, we reset the `sourceUnit` in it before calling the user callback,
305 // since at that point no further conversions are necessary.
306 template <UnitEnum E, VectorOrScalar T, typename F>
307 [[nodiscard]] bool unitWidget( const char* label, T& v, UnitToStringParams<E>& unitParams, F&& func );
308
309 // Some default slider parameters. For now they are hardcoded here, but we can move them elsewhere later.
310
311 // Default drag speed for `UI::drag()`.
312 template <UnitEnum E, VectorOrScalar T>
313 requires ( VectorTraits<T>::size == 1 )
314 [[nodiscard]] float getDefaultDragSpeed();
315
316 // Default step speed for `UI::input()`.
317 template <UnitEnum E, VectorOrScalar T, VectorOrScalar TargetType>
318 [[nodiscard]] T getDefaultStep( bool fast );
319}
320
321// Default flags for `slider()` and `drag()` below.
322inline constexpr int defaultSliderFlags = ImGuiSliderFlags_AlwaysClamp;
323
324// Draw a slider.
325// `E` must be specified explicitly, to one of: `NoUnit` `LengthUnit`, `AngleUnit`, ...
326// By default, for angles `v` will be converted to degrees for display (but `vMin`, `vMax` are still in radians, same as `v`),
327// while length and unit-less values will be left as is. This can be customized in `unitParams` or globally (see `MRUnits.h`).
328template <UnitEnum E, detail::VectorOrScalar T, detail::ValidBoundForTargetType<T> U = typename VectorTraits<T>::BaseType>
329bool slider( const char* label, T& v, const U& vMin, const U& vMax, UnitToStringParams<E> unitParams = {}, ImGuiSliderFlags flags = defaultSliderFlags );
330
331// Draw a dragging widget. Also includes [+] and [-] buttons (for integers only by default_, like `ImGui::Input`).
332// `E` must be specified explicitly, to one of: `NoUnit` `LengthUnit`, `AngleUnit`, ...
333// By default, for angles `v` will be converted to degrees for display (but `vSpeed` is still in radians, same as `v`),
334// while length and unit-less values will be left as is. This can be customized in `unitParams` or globally (see `MRUnits.h`).
335// If only the min limit is specified, then the max limit is assumed to be the largest number.
336template <UnitEnum E, detail::VectorOrScalar T, detail::ValidDragSpeedForTargetType<T> SpeedType = float, detail::ValidBoundForTargetType<T> U = typename VectorTraits<T>::BaseType>
337bool drag( const char* label, T& v, SpeedType vSpeed = detail::getDefaultDragSpeed<E, SpeedType>(), const U& vMin = std::numeric_limits<U>::lowest(), const U& vMax = std::numeric_limits<U>::max(), UnitToStringParams<E> unitParams = {}, ImGuiSliderFlags flags = defaultSliderFlags, const U& step = detail::getDefaultStep<E, U, T>( false ), const U& stepFast = detail::getDefaultStep<E, U, T>( true ) );
338
339// Draw a read-only copyable value.
340// `E` must be specified explicitly, to one of: `NoUnit` `LengthUnit`, `AngleUnit`, ...
341// By default, for angles `v` will be converted to degrees for display, while length and unit-less values will be left as is.
342// This can be customized in `unitParams` or globally (see `MRUnits.h`).
343template <UnitEnum E, detail::VectorOrScalar T>
344void readOnlyValue( const char* label, const T& v, std::optional<ImVec4> textColor = {}, UnitToStringParams<E> unitParams = {} );
345
346
348MRVIEWER_API void transparentText( const char* fmt, ... );
350MRVIEWER_API void transparentTextWrapped( const char* fmt, ... );
351
353MRVIEWER_API void setTooltipIfHovered( const std::string& text, float scaling );
354
359MRVIEWER_API void separator( float scaling, const std::string& text = "", int issueCount = -1 );
360MRVIEWER_API void separator(
361 float scaling,
362 const std::string& text,
363 const ImVec4& color,
364 const std::string& issueCount );
365// separator line with icon and text
366// iconSize icon size without scaling
367MRVIEWER_API void separator( float scaling, const ImGuiImage& icon, const std::string& text, const Vector2f& iconSize = { 24.f, 24.f } );
368MRVIEWER_API void separator( float scaling, const std::string& iconName, const std::string& text, const Vector2f& iconSize = { 24.f, 24.f } );
369
374MRVIEWER_API void progressBar( float scaling, float fraction, const Vector2f& size = Vector2f( -1, 0 ) );
375
376// create and append items into a TabBar: see corresponding ImGui:: functions
377MRVIEWER_API bool beginTabBar( const char* str_id, ImGuiTabBarFlags flags = 0 );
378MRVIEWER_API void endTabBar();
379MRVIEWER_API bool beginTabItem( const char* label, bool* p_open = NULL, ImGuiTabItemFlags flags = 0 );
380MRVIEWER_API void endTabItem();
381
391MRVIEWER_API void alignTextToFramePadding( float padding );
395MRVIEWER_API void alignTextToControl( float controlHeight );
397MRVIEWER_API void alignTextToRadioButton( float scaling );
399MRVIEWER_API void alignTextToCheckBox( float scaling );
401MRVIEWER_API void alignTextToButton( float scaling );
402
405MRVIEWER_API void highlightWindowBottom( float scaling );
406
407} // namespace UI
408
409}
410
411#include "MRUIStyle.ipp"
Definition MRImGuiImage.h:14
Definition MRUIStyle.h:276
Definition MRUIStyle.h:285
Definition MRUIStyle.h:280
auto width(const Box< V > &box)
returns size along x axis
Definition MRMesh/MRBox.h:230
T getDefaultStep(bool fast)
float getDefaultDragSpeed()
MRVIEWER_API bool genericSlider(const char *label, ImGuiDataType data_type, void *p_data, const void *p_min, const void *p_max, const char *format, ImGuiSliderFlags flags)
bool unitWidget(const char *label, T &v, UnitToStringParams< E > &unitParams, F &&func)
MRVIEWER_API bool buttonEx(const char *label, bool active, const Vector2f &size=Vector2f(0, 0), ImGuiButtonFlags flags=ImGuiButtonFlags_None, const ButtonCustomizationParams &custmParams={})
draw gradient button, which can be disabled (active = false)
TextureType
Definition MRUIStyle.h:22
MRVIEWER_API bool checkboxOrModifier(const char *label, CheckboxOrModifierState &value, int modifiers, int respectedModifiers=-1, std::optional< bool > valueOverride={})
MRVIEWER_API std::unique_ptr< ImGuiImage > & getTexture(TextureType type)
MRVIEWER_API void alignTextToRadioButton(float scaling)
Specialization of alignTextToFramePadding for UI::radioButton.
MRVIEWER_API bool inputTextMultilineFullyScrollable(CachedTextSize &cache, const char *label, std::string &str, const ImVec2 &size=ImVec2(), ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=nullptr, void *user_data=nullptr)
This version adds a horizontal scrollbar. Also it never draws the label, and uses full window width b...
MRVIEWER_API bool radioButtonOrModifier(const char *label, RadioButtonOrModifierState &value, int valButton, int modifiers, int respectedModifiers=-1, std::optional< int > valueOverride={})
bool drag(const char *label, T &v, SpeedType vSpeed=detail::getDefaultDragSpeed< E, SpeedType >(), const U &vMin=std::numeric_limits< U >::lowest(), const U &vMax=std::numeric_limits< U >::max(), UnitToStringParams< E > unitParams={}, ImGuiSliderFlags flags=defaultSliderFlags, const U &step=detail::getDefaultStep< E, U, T >(false), const U &stepFast=detail::getDefaultStep< E, U, T >(true))
MRVIEWER_API void separator(float scaling, const std::string &text="", int issueCount=-1)
bool buttonIconFlatBG(const std::string &name, const Vector2f &iconSize, const std::string &text, const ImVec2 &buttonSize)
Definition MRUIStyle.h:138
MRVIEWER_API void endTabBar()
MRVIEWER_API void transparentTextWrapped(const char *fmt,...)
similar to ImGui::TextWrapped but use current text color with alpha channel = 0.5
void readOnlyValue(const char *label, const T &v, std::optional< ImVec4 > textColor={}, UnitToStringParams< E > unitParams={})
MRVIEWER_API bool inputTextIntoArrayMultiline(const char *label, char *buf, size_t buf_size, const ImVec2 &size=ImVec2(), ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=nullptr, void *user_data=nullptr)
This overload is for arrays, as opposed to std::strings.
MRVIEWER_API void endTabItem()
MRVIEWER_API void highlightWindowBottom(float scaling)
MRVIEWER_API bool checkbox(const char *label, bool *value)
draw gradient checkbox
MRVIEWER_API bool inputTextIntoArrayMultilineFullyScrollable(CachedTextSize &cache, const char *label, char *buf, size_t buf_size, const ImVec2 &size=ImVec2(), ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=nullptr, void *user_data=nullptr)
MRVIEWER_API void alignTextToButton(float scaling)
Specialization of alignTextToFramePadding for UI::button with default height.
MRVIEWER_API void alignTextToCheckBox(float scaling)
Specialization of alignTextToFramePadding for UI::checkbox.
MRVIEWER_API void alignTextToControl(float controlHeight)
MRVIEWER_API void drawPoltHorizontalAxis(float menuScaling, const PlotAxis &plotAxis)
MRVIEWER_API void drawPoltVerticalAxis(float menuScaling, const PlotAxis &plotAxis)
MRVIEWER_API bool beginCombo(const char *label, const std::string &text="Not selected", bool showPreview=true)
draw custom content combo box
bool buttonIcon(const std::string &name, const Vector2f &iconSize, const std::string &text, bool active, const ImVec2 &buttonSize)
Definition MRUIStyle.h:125
constexpr int defaultSliderFlags
Definition MRUIStyle.h:322
bool slider(const char *label, T &v, const U &vMin, const U &vMax, UnitToStringParams< E > unitParams={}, ImGuiSliderFlags flags=defaultSliderFlags)
MRVIEWER_API bool combo(const char *label, int *v, const std::vector< std::string > &options, bool showPreview=true, const std::vector< std::string > &tooltips={}, const std::string &defaultText="Not selected")
draw combo box
MRVIEWER_API bool radioButton(const char *label, int *value, int valButton)
draw gradient radio button
MRVIEWER_API void setTooltipIfHovered(const std::string &text, float scaling)
draw tooltip only if current item is hovered
MRVIEWER_API bool checkboxValid(const char *label, bool *value, bool valid)
If valid is false checkbox is disabled. Same as checkboxOrFixedValue( ..., valid ?...
MRVIEWER_API void endCombo(bool showPreview=true)
MRVIEWER_API bool inputTextIntoArray(const char *label, char *array, std::size_t size, ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=nullptr, void *user_data=nullptr)
This overload is for arrays, as opposed to std::strings.
MRVIEWER_API void transparentText(const char *fmt,...)
similar to ImGui::Text but use current text color with alpha channel = 0.5
MRVIEWER_API void init()
init internal parameters
MRVIEWER_API bool checkboxOrFixedValue(const char *label, bool *value, std::optional< bool > valueOverride)
If valueOverride is specified, then the checkbox is disabled and that value is displayed instead of v...
MRVIEWER_API void progressBar(float scaling, float fraction, const Vector2f &size=Vector2f(-1, 0))
MRVIEWER_API void inputTextCenteredReadOnly(const char *label, const std::string &str, float width=0.0f, const std::optional< ImVec4 > &textColor={})
draw read-only text box with text aligned by center
MRVIEWER_API bool colorEdit4(const char *label, Vector4f &color, ImGuiColorEditFlags flags=ImGuiColorEditFlags_None)
draw gradient color edit 4
MRVIEWER_API bool inputTextMultiline(const char *label, std::string &str, const ImVec2 &size=ImVec2(), ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=nullptr, void *user_data=nullptr)
Draws multiline text input, should be used instead of ImGui::InputTextMultiline().
MRVIEWER_API bool checkboxMixed(const char *label, bool *value, bool mixed)
draw gradient checkbox with mixed state
MRVIEWER_API bool buttonIconEx(const std::string &name, const Vector2f &iconSize, const std::string &text, const ImVec2 &buttonSize, const ButtonIconCustomizationParams &params={})
MRVIEWER_API bool beginTabBar(const char *str_id, ImGuiTabBarFlags flags=0)
bool checkboxFlags(const char *label, T &target, T flags)
Draw a checkbox toggling one or more bits in the mask.
Definition MRUIStyle.h:166
MRVIEWER_API bool buttonUnique(const char *label, int *value, int ownValue, const Vector2f &size=Vector2f(0, 0), ImGuiKey key=ImGuiKey_None)
draw button with same logic as radioButton
MRVIEWER_API bool button(const char *label, bool active, const Vector2f &size=Vector2f(0, 0), ImGuiKey key=ImGuiKey_None)
MRVIEWER_API bool radioButtonOrFixedValue(const char *label, int *value, int valButton, std::optional< int > valueOverride)
If valueOverride is specified, then the radio button is disabled and that value is displayed instead ...
MRVIEWER_API bool inputText(const char *label, std::string &str, ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=nullptr, void *user_data=nullptr)
Draws text input, should be used instead of ImGui::InputText().
MRVIEWER_API void alignTextToFramePadding(float padding)
MRVIEWER_API bool beginTabItem(const char *label, bool *p_open=NULL, ImGuiTabItemFlags flags=0)
MRVIEWER_API bool inputTextCentered(const char *label, std::string &str, float width=0.0f, ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=nullptr, void *user_data=nullptr)
draw input text box with text aligned by center
MRVIEWER_API bool buttonCommonSize(const char *label, const Vector2f &size=Vector2f(0, 0), ImGuiKey key=ImGuiKey_None)
Definition MRCameraOrientationPlugin.h:7
ImVec2 size(const ViewportRectangle &rect)
Definition MRViewport.h:32
constexpr const T & get(const Vector2< T > &v) noexcept
Definition MRTupleBindings.h:83
std::variant< > VarUnitToStringParams
Definition MRUnits.h:292
Definition MRColor.h:9
parameters to customize buttonEx
Definition MRUIStyle.h:39
bool forceImguiTextColor
force use if ImGuiCol_Text for text
Definition MRUIStyle.h:48
ImGuiImage * customTexture
Definition MRUIStyle.h:43
bool border
show border or not
Definition MRUIStyle.h:50
bool underlineFirstLetter
draw line under first letter of label
Definition MRUIStyle.h:53
bool forceImGuiBackground
force use imgui background if !customTexture
Definition MRUIStyle.h:45
bool enableTestEngine
Allow interacting with this button from UI::TestEngine.
Definition MRUIStyle.h:56
Definition MRUIStyle.h:60
bool flatBackgroundColor
Definition MRUIStyle.h:65
bool active
Definition MRUIStyle.h:63
ImGuiButtonFlags flags
Definition MRUIStyle.h:61
Definition MRUIStyle.h:255
std::optional< ImVec2 > cachedSize
Definition MRUIStyle.h:256
Definition MRUIStyle.h:182
bool modifierHeld
Definition MRUIStyle.h:186
bool baseValue
Definition MRUIStyle.h:184
Definition MRUIStyle.h:69
float size
Definition MRUIStyle.h:74
VarUnitToStringParams labelFormatParams
Definition MRUIStyle.h:91
float lenDash
Definition MRUIStyle.h:85
size_t textDashIndicesStep
Definition MRUIStyle.h:82
float minValue
Definition MRUIStyle.h:78
float lenDashWithText
Definition MRUIStyle.h:87
ImVec2 startAxisPoint
Definition MRUIStyle.h:71
float optimalLenth
Definition MRUIStyle.h:76
float maxValue
Definition MRUIStyle.h:80
float textPadding
Definition MRUIStyle.h:89
Definition MRUIStyle.h:211
int value
Definition MRUIStyle.h:213
int effectiveValue
Definition MRUIStyle.h:215
Definition MRUnits.h:237
Definition MRMesh/MRVectorTraits.h:14
static constexpr int size
Definition MRMesh/MRVectorTraits.h:18
T BaseType
Definition MRMesh/MRVectorTraits.h:17