33 struct CustomContextMenuCheckbox
35 using Setter = std::function<void( std::shared_ptr<Object>
object,
ViewportId id,
bool checked )>;
36 using Getter = std::function<bool( std::shared_ptr<Object>
object,
ViewportId id )>;
46 MRVIEWER_API
static std::shared_ptr<RibbonMenu>
instance();
51 const std::string& name,
52 CustomContextMenuCheckbox customContextMenuCheckbox );
61 MRVIEWER_API
virtual void load_font(
int font_size = 13 )
override;
85 Vector2i
getSceneSize() {
return Vector2i(
int( sceneSize_.x ),
int( sceneSize_.y ) ); };
93 bool hasAnyActiveItem()
const {
return bool( activeBlockingItem_.item ) || !activeNonBlockingItems_.empty(); }
124 MRVIEWER_API
static void cloneTree(
const std::vector<std::shared_ptr<Object>>& selectedObjects );
153 MRVIEWER_API
virtual void drawSmallButtonsSet_(
const std::vector<std::string>& group,
int setFrontIndex,
int setLength,
160 int numSmallText{ 0 };
166 MRVIEWER_API
virtual void setupItemsGroup_(
const std::vector<std::string>& groupsInTab,
const std::string& tabName,
bool centerItems );
167 MRVIEWER_API
virtual void drawItemsGroup_(
const std::string& tabName,
const std::string& groupName,
172 MRVIEWER_API
virtual bool itemPressed_(
const std::shared_ptr<RibbonMenuItem>& item,
const std::string& requiremetnsHint = {} );
177 MRVIEWER_API
virtual void postResize_(
int width,
int height )
override;
182 std::shared_ptr<RibbonMenuItem>
item;
184 bool dialogPositionFixed{
false };
191 MRVIEWER_API
virtual void drawTopPanel_(
bool drawTabs =
true,
bool centerItems =
false );
235 void changeTab_(
int newTab );
237 std::string getRequirements_(
const std::shared_ptr<RibbonMenuItem>& item )
const;
239 void drawSearchButton_();
240 void drawCollapseButton_();
241 void drawHelpButton_();
243 void sortObjectsRecursive_( std::shared_ptr<Object>
object );
246 void drawHeaderQuickAccess_();
247 void drawHeaderPannel_();
248 void drawActiveListButton_(
float btnSize );
250 ImVec2 activeListPos_{ 0,0 };
251 bool activeListPressed_{
false };
253 void beginTopPanel_();
255 void drawTopPanelOpened_(
bool drawTabs,
bool centerItems );
257 std::string transformClipboardText_;
259 int currentTopPanelHeight_ = 113;
260 int topPanelOpenedHeight_ = 113;
261 int topPanelHiddenHeight_ = 33;
263 ImVec2 sceneSize_{ 310, 0 };
264 float informationHeight_{ 0.f };
265 float transformHeight_{ 0.f };
268 float blockingHighlightTimer_{ 0.0f };
271 float tabPanelScroll_{ 0.0f };
273 bool autoCloseBlockingPlugins_{
true };
275 enum class CollapseState
280 } collapseState_{ CollapseState::Pinned };
282 float openedMaxSecs_{ 2.0f };
283 float openedTimer_{ openedMaxSecs_ };
285 int activeTabIndex_{ 0 };
286 RibbonFontManager fontManager_;
287 RibbonButtonDrawer buttonDrawer_;
289 std::unordered_map<std::string, CustomContextMenuCheckbox> customCheckBox_;
292 RibbonNotifier notifier_;
293#ifndef __EMSCRIPTEN__
294 AsyncRequest asyncRequest_;