3#include "MRMesh/MRphmap.h"
15class MRVIEWER_CLASS RibbonIcons
32 MRVIEWER_API
static void load();
34 MRVIEWER_API
static void free();
40 ~RibbonIcons() =
default;
42 static RibbonIcons& instance_();
47 std::unique_ptr<ImGuiImage>
white;
59 using SizedIcons = std::array<Icons, size_t( Sizes::Count )>;
61 static const char* sizeSubFolder_( Sizes sz );
63 const ImGuiImage* findRequiredSize_(
const SizedIcons& icons,
float width, ColorType colorType, IconType iconType )
const;
65 void load_( IconType type );
#define MR_MAKE_FLAG_OPERATORS_IN_CLASS(T)
Generates operators for a enum (at class scope).
Definition MRFlagOperators.h:9
Definition MRImGuiImage.h:18
auto width(const Box< V > &box)
returns size along x axis
Definition MRBox.h:354
HashMap< std::string, SizedIcons > map
Definition MRRibbonIcons.h:80
AvailableColor availableColor
Definition MRRibbonIcons.h:79
IconType
Definition MRRibbonIcons.h:24
std::pair< Sizes, Sizes > minMaxSizes
first - min size, second - max size
Definition MRRibbonIcons.h:78
static const ImGuiImage * findByName(const std::string &name, float width, ColorType colorType, IconType iconType)
finds icon with best fitting size, if there is no returns nullptr
static void load()
this should be called once on start of program (called in RibbonMenu::init)
std::unique_ptr< ImGuiImage > white
Definition MRRibbonIcons.h:47
static void free()
this should be called once before program stops (called in RibbonMenu::shutdown)
AvailableColor
Definition MRRibbonIcons.h:70
std::filesystem::path pathDirectory
Definition MRRibbonIcons.h:76
ColorType
Definition MRRibbonIcons.h:19
std::unique_ptr< ImGuiImage > colored
Definition MRRibbonIcons.h:46
phmap::flat_hash_map< K, V, Hash, Eq > HashMap
Definition MRMeshFwd.h:606
@ Logos
have two sizes
Definition MRRibbonIcons.h:28
@ RibbonItemIcon
Definition MRRibbonIcons.h:25
@ IndependentIcons
have two sizes
Definition MRRibbonIcons.h:27
@ Count
have two sizes
Definition MRRibbonIcons.h:29
@ ObjectTypeIcon
have four sizes
Definition MRRibbonIcons.h:26
@ Colored
Definition MRRibbonIcons.h:72
@ White
Definition MRRibbonIcons.h:71
@ Colored
Definition MRRibbonIcons.h:20
@ White
Definition MRRibbonIcons.h:21
only for bindings generation
Definition MRCameraOrientationPlugin.h:8