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 );
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 );
232 void changeTab_(
int newTab );
234 std::string getRequirements_(
const std::shared_ptr<RibbonMenuItem>& item )
const;
236 void drawSearchButton_();
237 void drawCollapseButton_();
238 void drawHelpButton_();
240 void sortObjectsRecursive_( std::shared_ptr<Object>
object );
243 void drawHeaderQuickAccess_();
244 void drawHeaderPannel_();
245 void drawActiveListButton_(
float btnSize );
247 ImVec2 activeListPos_{ 0,0 };
248 bool activeListPressed_{
false };
250 void beginTopPanel_();
252 void drawTopPanelOpened_(
bool drawTabs,
bool centerItems );
254 std::string transformClipboardText_;
256 int currentTopPanelHeight_ = 113;
257 int topPanelOpenedHeight_ = 113;
258 int topPanelHiddenHeight_ = 33;
260 ImVec2 sceneSize_{ 310, 0 };
261 float informationHeight_{ 0.f };
262 float transformHeight_{ 0.f };
265 float blockingHighlightTimer_{ 0.0f };
268 float tabPanelScroll_{ 0.0f };
270 bool autoCloseBlockingPlugins_{
true };
272 enum class CollapseState
277 } collapseState_{ CollapseState::Pinned };
279 float openedMaxSecs_{ 2.0f };
280 float openedTimer_{ openedMaxSecs_ };
282 int activeTabIndex_{ 0 };
283 RibbonFontManager fontManager_;
284 RibbonButtonDrawer buttonDrawer_;
286 std::unordered_map<std::string, CustomContextMenuCheckbox> customCheckBox_;
289 RibbonNotifier notifier_;
290#ifndef __EMSCRIPTEN__
291 AsyncRequest asyncRequest_;