-
Notifications
You must be signed in to change notification settings - Fork 343
[Sofa.GUI.Common] Handle object selection in BaseViewer #5636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
87e73ac
aa029ee
1f99fc1
015da6f
bd81f89
7c8b15f
a969423
ee64fd9
9715dbb
32e79d4
e7bfe25
f0557ce
89196f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,7 +121,23 @@ class SOFA_GUI_COMMON_API BaseViewer | |
| /// the rendering pass is done here (have to be called in a loop) | ||
| virtual void drawScene(void) = 0; | ||
|
|
||
| void drawSelection(sofa::core::visual::VisualParams* vparams); | ||
|
|
||
| void setCurrentSelection(const std::set<core::objectmodel::Base::SPtr> &selection); | ||
| const std::set<sofa::core::objectmodel::Base::SPtr>& getCurrentSelection() const; | ||
|
|
||
| public: | ||
| bool m_showSelectedNodeBoundingBox {true}; | ||
| bool m_showSelectedObjectBoundingBox {true}; | ||
| bool m_showSelectedObjectPositions {true}; | ||
| bool m_showSelectedObjectSurfaces {true}; | ||
| bool m_showSelectedObjectVolumes {true}; | ||
| bool m_showSelectedObjectIndices {true}; | ||
| float m_visualScaling {0.2}; | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could there be some kind of merge between this and the VisualStyle flags ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank for the question, I think that VisualStyle is to control how objects are rendered not to control the viewer itself. More generally this questionning (and design choices) should be part of a general refactoring of the whole overlay/gizmos rendering... covering the situation of: LineAxis, Grid, OglFrame, how imGUI and Sofa.Qt's are actually implementing the overlays and how to configure that ViewerSettings, VisualStyle. |
||
| protected: | ||
| void drawIndices(const sofa::type::BoundingBox& bbox, const std::vector<sofa::type::Vec3>& positions); | ||
|
|
||
| /// internally called while the actual viewer needs a redraw (ie the camera changed) | ||
| virtual void redraw() = 0; | ||
|
|
||
|
|
@@ -135,6 +151,7 @@ class SOFA_GUI_COMMON_API BaseViewer | |
| bool _video; | ||
| bool m_isVideoButtonPressed; | ||
| bool m_bShowAxis; | ||
|
|
||
| bool _fullScreen; | ||
| int _background; | ||
| bool initTexturesDone; | ||
|
|
@@ -153,6 +170,8 @@ class SOFA_GUI_COMMON_API BaseViewer | |
| int _mouseInteractorSavedPosY; | ||
|
|
||
| std::string _screenshotDirectory; | ||
|
|
||
| std::set<sofa::core::objectmodel::Base::SPtr> currentSelection; | ||
| }; | ||
|
|
||
| } // namespace sofa::gui::common | ||
Uh oh!
There was an error while loading. Please reload this page.