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 = {} );
175 MRVIEWER_API
virtual std::string
getRequirements_(
const std::shared_ptr<RibbonMenuItem>& item )
const;
180 MRVIEWER_API
virtual void postResize_(
int width,
int height )
override;
185 std::shared_ptr<RibbonMenuItem>
item;
187 bool dialogPositionFixed{
false };
194 MRVIEWER_API
virtual void drawTopPanel_(
bool drawTabs =
true,
bool centerItems =
false );
241 void changeTab_(
int newTab );
243 void drawSearchButton_();
244 void drawCollapseButton_();
245 void drawHelpButton_();
247 void sortObjectsRecursive_( std::shared_ptr<Object>
object );
250 void drawHeaderQuickAccess_();
251 void drawHeaderPannel_();
252 void drawActiveListButton_(
float btnSize );
254 ImVec2 activeListPos_{ 0,0 };
255 bool activeListPressed_{
false };
257 void beginTopPanel_();
259 void drawTopPanelOpened_(
bool drawTabs,
bool centerItems );
261 std::string transformClipboardText_;
263 int currentTopPanelHeight_ = 113;
264 int topPanelOpenedHeight_ = 113;
265 int topPanelHiddenHeight_ = 33;
267 ImVec2 sceneSize_{ 310, 0 };
268 float informationHeight_{ 0.f };
269 float transformHeight_{ 0.f };
272 float blockingHighlightTimer_{ 0.0f };
275 float tabPanelScroll_{ 0.0f };
277 bool autoCloseBlockingPlugins_{
true };
279 enum class CollapseState
284 } collapseState_{ CollapseState::Pinned };
286 float openedMaxSecs_{ 2.0f };
287 float openedTimer_{ openedMaxSecs_ };
289 int activeTabIndex_{ 0 };
290 RibbonFontManager fontManager_;
291 RibbonButtonDrawer buttonDrawer_;
293 std::unordered_map<std::string, CustomContextMenuCheckbox> customCheckBox_;
296 RibbonNotifier notifier_;
297#ifndef __EMSCRIPTEN__
298 AsyncRequest asyncRequest_;