45 struct CustomContextMenuCheckbox
47 using Setter = std::function<void( std::shared_ptr<Object>
object,
ViewportId id,
bool checked )>;
48 using Getter = std::function<bool( std::shared_ptr<Object>
object,
ViewportId id )>;
58 MRVIEWER_API
static std::shared_ptr<RibbonMenu>
instance();
63 const std::string& name,
64 CustomContextMenuCheckbox customContextMenuCheckbox );
73 MRVIEWER_API
virtual void load_font(
int font_size = 13 )
override;
97 Vector2i
getSceneSize() {
return Vector2i(
int( sceneSize_.x ),
int( sceneSize_.y ) ); };
105 bool hasAnyActiveItem()
const {
return bool( activeBlockingItem_.item ) || !activeNonBlockingItems_.empty(); }
136 MRVIEWER_API
static void cloneTree(
const std::vector<std::shared_ptr<Object>>& selectedObjects );
164 MRVIEWER_API
virtual void drawSmallButtonsSet_(
const std::vector<std::string>& group,
int setFrontIndex,
int setLength,
171 int numSmallText{ 0 };
177 MRVIEWER_API
virtual void setupItemsGroup_(
const std::vector<std::string>& groupsInTab,
const std::string& tabName,
bool centerItems );
178 MRVIEWER_API
virtual void drawItemsGroup_(
const std::string& tabName,
const std::string& groupName,
183 MRVIEWER_API
virtual bool itemPressed_(
const std::shared_ptr<RibbonMenuItem>& item,
const std::string& requiremetnsHint = {} );
186 MRVIEWER_API
virtual std::string
getRequirements_(
const std::shared_ptr<RibbonMenuItem>& item )
const;
191 MRVIEWER_API
virtual void postResize_(
int width,
int height )
override;
196 std::shared_ptr<RibbonMenuItem>
item;
198 bool dialogPositionFixed{
false };
205 MRVIEWER_API
virtual void drawTopPanel_(
bool drawTabs =
true,
bool centerItems =
false );
250 void changeTab_(
int newTab );
252 void drawSearchButton_();
253 void drawCollapseButton_();
254 void drawHelpButton_();
256 void sortObjectsRecursive_( std::shared_ptr<Object>
object );
259 void drawHeaderQuickAccess_();
260 void drawHeaderPannel_();
261 void drawActiveListButton_(
float btnSize );
263 ImVec2 activeListPos_{ 0,0 };
264 bool activeListPressed_{
false };
266 void beginTopPanel_();
268 void drawTopPanelOpened_(
bool drawTabs,
bool centerItems );
270 std::string transformClipboardText_;
272 int currentTopPanelHeight_ = 113;
273 int topPanelOpenedHeight_ = 113;
274 int topPanelHiddenHeight_ = 33;
276 ImVec2 sceneSize_{ 310, 0 };
277 float informationHeight_{ 0.f };
278 float transformHeight_{ 0.f };
280 RibbonMenuUIConfig menuUIConfig_;
283 float blockingHighlightTimer_{ 0.0f };
286 float tabPanelScroll_{ 0.0f };
288 bool autoCloseBlockingPlugins_{
true };
290 enum class CollapseState
295 } collapseState_{ CollapseState::Pinned };
297 float openedMaxSecs_{ 2.0f };
298 float openedTimer_{ openedMaxSecs_ };
300 int activeTabIndex_{ 0 };
301 RibbonFontManager fontManager_;
302 RibbonButtonDrawer buttonDrawer_;
304 std::unordered_map<std::string, CustomContextMenuCheckbox> customCheckBox_;
307 RibbonNotifier notifier_;
308#ifndef __EMSCRIPTEN__
309 AsyncRequest asyncRequest_;