7#include <unordered_map>
22 MRVIEWER_API
virtual void draw(
float height );
67 MRVIEWER_API
virtual void drawSceneContextMenu_(
const std::vector<std::shared_ptr<Object>>& ,
const std::string& )
82 MRVIEWER_API
virtual bool drawObject_(
Object&
object,
const std::string& uniqueStr,
int depth );
106 bool showNewSelectedObjects_ =
true;
107 bool deselectNewHiddenObjects_ =
false;
109 void drawObjectsList_();
111 float getDrawDropTargetHeight_()
const;
112 void reorderSceneIfNeeded_();
115 MRVIEWER_API
virtual void updateSceneWindowScrollIfNeeded_();
117 std::vector<Object*> getPreSelection_(
Object* meshclicked,
118 bool isShift,
bool isCtrl,
119 const std::vector<std::shared_ptr<Object>>& selected,
120 const std::vector<std::shared_ptr<Object>>& all );
121 void updateSelection_(
Object* objPtr,
const std::vector<std::shared_ptr<Object>>& selected,
const std::vector<std::shared_ptr<Object>>& all );
123 bool clickTrigger_ =
false;
124 bool allowSceneReorder_ =
true;
127 struct MoveAndScrollData
131 bool needScroll =
false;
133 MoveAndScrollData upFirstSelected_;
134 MoveAndScrollData downLastSelected_;
135 MoveAndScrollData nextVisible_;
140 struct ScrollPositionPreservation
142 float relativeMousePos{ 0.0f };
143 float absLinePosRatio{ 0.0f };
146 int framesTillFixScroll_ = 0;
148 bool dragObjectsMode_{
false };
150 bool dragModeTrigger_{
false };
named object in the data model
Definition MRObject.h:62
class for drawing a list of scene objects (and handling interaction with it)
Definition MRSceneObjectsListDrawer.h:16
MRVIEWER_API void selectAllObjects()
select all selectable objects
virtual MRVIEWER_API float drawCustomTreeObjectProperties_(Object &obj, bool onlyCalcHeight)
MRVIEWER_API void allowSceneReorder(bool allow)
set possibility change object order
MRVIEWER_API void expandObjectTreeAndScroll(const Object *obj)
expands all objs parents in tree and scroll scene tree window so selection becomes visible
MRVIEWER_API void setNextFrameFixScroll(int skipFrames=1)
helper method for fix scroll position after change available height
virtual MRVIEWER_API void drawSceneContextMenu_(const std::vector< std::shared_ptr< Object > > &, const std::string &)
Definition MRSceneObjectsListDrawer.h:67
std::unordered_map< const Object *, bool > sceneOpenCommands_
Definition MRSceneObjectsListDrawer.h:153
MRVIEWER_API void setObjectTreeState(const Object *obj, bool open)
set object collapse state (hiding children)
virtual MRVIEWER_API std::string objectLineStrId_(const Object &object, const std::string &uniqueStr)
virtual MRVIEWER_API void draw(float height)
MRVIEWER_API void setLeavesVisibility(bool visible)
set visible flag all selectable objects
MRVIEWER_API void makeDragDropSource_(const std::vector< std::shared_ptr< Object > > &payload)
payload object will be moved
virtual MRVIEWER_API bool drawSkippedObject_(Object &object, const std::string &uniqueStr, int depth)
draw dummy container for skipped object
void setShowNewSelectedObjects(bool show)
set flag of the object visibility activation after selection
Definition MRSceneObjectsListDrawer.h:25
bool getDeselectNewHiddenObjects()
get flag of deselect object after hidden
Definition MRSceneObjectsListDrawer.h:32
MRVIEWER_API void processItemClick_(Object &object, const std::vector< std::shared_ptr< Object > > &selected)
function that do click logic on object line (select/deselect/rename/open context)
MRVIEWER_API void changeSelection(bool isDown, bool isShift)
virtual MRVIEWER_API bool collapsingHeader_(const std::string &uniqueName, ImGuiTreeNodeFlags flags)
override this to customize CollapsingHeader draw
MRVIEWER_API bool needDragDropTarget_()
checking the need to draw a target
bool getShowNewSelectedObjects()
get flag of the object visibility activation after selection
Definition MRSceneObjectsListDrawer.h:27
MRVIEWER_API void makeDragDropTarget_(Object &target, bool before, bool betweenLine, const std::string &uniqueStr)
void setDeselectNewHiddenObjects(bool deselect)
set flag of deselect object after hidden
Definition MRSceneObjectsListDrawer.h:30
MRVIEWER_API bool drawObjectCollapsingHeader_(Object &object, const std::string &uniqueStr, bool hasRealChildren)
function that draws collapsing header and process click on it
int ImGuiTreeNodeFlags
Definition MRSceneObjectsListDrawer.h:75
MRVIEWER_API void drawObjectVisibilityCheckbox_(Object &object, const std::string &uniqueStr)
virtual MRVIEWER_API void drawCustomObjectPrefixInScene_(const Object &, bool)
Definition MRSceneObjectsListDrawer.h:63
MRVIEWER_API void changeVisible(bool isDown)
virtual MRVIEWER_API bool drawObject_(Object &object, const std::string &uniqueStr, int depth)
override this to customize whole object line
virtual ~SceneObjectsListDrawer()=default
Definition MRCameraOrientationPlugin.h:8
constexpr int sDefaultGroupState
Definition MRSceneObjectsListDrawer.h:156
Definition MRSceneReorder.h:10