44 struct CustomContextMenuCheckbox
46 using Setter = std::function<void( std::shared_ptr<Object>
object,
ViewportId id,
bool checked )>;
47 using Getter = std::function<bool( std::shared_ptr<Object>
object,
ViewportId id )>;
60 MRVIEWER_API
static std::shared_ptr<RibbonMenu>
instance();
65 const std::string& name,
66 CustomContextMenuCheckbox customContextMenuCheckbox );
75 MRVIEWER_API
virtual void load_font(
int font_size = 13 )
override;
99 Vector2i
getSceneSize() {
return Vector2i(
int( sceneSize_.x ),
int( sceneSize_.y ) ); };
107 bool hasAnyActiveItem()
const {
return bool( activeBlockingItem_.item ) || !activeNonBlockingItems_.empty(); }
138 MRVIEWER_API
static void cloneTree(
const std::vector<std::shared_ptr<Object>>& selectedObjects );
166 MRVIEWER_API
virtual void drawSmallButtonsSet_(
const std::vector<std::string>& group,
int setFrontIndex,
int setLength,
173 int numSmallText{ 0 };
179 MRVIEWER_API
virtual void setupItemsGroup_(
const std::vector<std::string>& groupsInTab,
const std::string& tabName,
bool centerItems );
180 MRVIEWER_API
virtual void drawItemsGroup_(
const std::string& tabName,
const std::string& groupName,
185 MRVIEWER_API
virtual bool itemPressed_(
const std::shared_ptr<RibbonMenuItem>& item,
const std::string& requiremetnsHint = {} );
188 MRVIEWER_API
virtual std::string
getRequirements_(
const std::shared_ptr<RibbonMenuItem>& item )
const;
193 MRVIEWER_API
virtual void postResize_(
int width,
int height )
override;
198 std::shared_ptr<RibbonMenuItem>
item;
200 bool dialogPositionFixed{
false };
207 MRVIEWER_API
virtual void drawTopPanel_(
bool drawTabs =
true,
bool centerItems =
false );
253 void changeTab_(
int newTab );
255 void drawSearchButton_();
256 void drawCollapseButton_();
257 void drawHelpButton_();
259 void sortObjectsRecursive_( std::shared_ptr<Object>
object );
262 void drawHeaderQuickAccess_();
263 void drawHeaderPannel_();
264 void drawActiveListButton_(
float btnSize );
266 ImVec2 activeListPos_{ 0,0 };
267 bool activeListPressed_{
false };
269 void beginTopPanel_();
271 void drawTopPanelOpened_(
bool drawTabs,
bool centerItems );
273 std::string transformClipboardText_;
275 int currentTopPanelHeight_ = 113;
276 int topPanelOpenedHeight_ = 113;
277 int topPanelHiddenHeight_ = 33;
279 ImVec2 sceneSize_{ 310, 0 };
280 float informationHeight_{ 0.f };
281 float transformHeight_{ 0.f };
283 RibbonMenuUIConfig menuUIConfig_;
286 float blockingHighlightTimer_{ 0.0f };
289 float tabPanelScroll_{ 0.0f };
291 bool autoCloseBlockingPlugins_{
true };
293 enum class CollapseState
298 } collapseState_{ CollapseState::Pinned };
300 float openedMaxSecs_{ 2.0f };
301 float openedTimer_{ openedMaxSecs_ };
303 int activeTabIndex_{ 0 };
304 RibbonFontManager fontManager_;
305 RibbonButtonDrawer buttonDrawer_;
307 std::unordered_map<std::string, CustomContextMenuCheckbox> customCheckBox_;
309 std::unique_ptr<Toolbar> toolbar_;
310 RibbonNotifier notifier_;
311#ifndef __EMSCRIPTEN__
312 AsyncRequest asyncRequest_;