Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libRendering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STORM
repos
Radium
libRendering
Commits
757e4d11
Commit
757e4d11
authored
4 years ago
by
Mathias Paulin
Browse files
Options
Downloads
Patches
Plain Diff
Make the application handle Radium Picking results.
parent
97e9c61e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Mara/RadiumPlayer.cpp
+33
-0
33 additions, 0 deletions
src/Mara/RadiumPlayer.cpp
src/Mara/RadiumPlayer.hpp
+7
-0
7 additions, 0 deletions
src/Mara/RadiumPlayer.hpp
with
40 additions
and
0 deletions
src/Mara/RadiumPlayer.cpp
+
33
−
0
View file @
757e4d11
...
...
@@ -4,6 +4,7 @@
#include
<Engine/Rendering/ForwardRenderer.hpp>
#include
<Engine/Rendering/RenderObject.hpp>
#include
<Engine/Rendering/RenderObjectManager.hpp>
#include
<Gui/SelectionManager/SelectionManager.hpp>
#include
<Gui/Viewer/Viewer.hpp>
#include
<VolumeLoader/VolumeLoader.hpp>
...
...
@@ -74,6 +75,34 @@ void RadiumPlayer::parseCommandLine() {
if
(
parser
.
isSet
(
fileOpt
)
)
{
m_fileOption
=
parser
.
values
(
fileOpt
);
}
}
void
RadiumPlayer
::
toggleCirclePicking
(
bool
on
)
{
auto
mainWindow
=
dynamic_cast
<
MainWindow
*>
(
m_mainWindow
.
get
()
);
mainWindow
->
centralWidget
()
->
setMouseTracking
(
on
);
}
void
RadiumPlayer
::
handlePicking
(
const
Ra
::
Engine
::
Rendering
::
Renderer
::
PickingResult
&
pickingResult
)
{
Ra
::
Core
::
Utils
::
Index
roIndex
(
pickingResult
.
m_roIdx
);
Ra
::
Engine
::
RadiumEngine
*
engine
=
Ra
::
Engine
::
RadiumEngine
::
getInstance
();
auto
mainWindow
=
dynamic_cast
<
MainWindow
*>
(
m_mainWindow
.
get
()
);
if
(
roIndex
.
isValid
()
)
{
auto
ro
=
engine
->
getRenderObjectManager
()
->
getRenderObject
(
roIndex
);
if
(
ro
->
getType
()
!=
Ra
::
Engine
::
Rendering
::
RenderObjectType
::
UI
)
{
Ra
::
Engine
::
Scene
::
Component
*
comp
=
ro
->
getComponent
();
Ra
::
Engine
::
Scene
::
Entity
*
ent
=
comp
->
getEntity
();
// For now we don't enable group selection.
mainWindow
->
getSelectionManager
()
->
setCurrentEntry
(
Ra
::
Engine
::
Scene
::
ItemEntry
(
ent
,
comp
,
roIndex
),
QItemSelectionModel
::
ClearAndSelect
|
QItemSelectionModel
::
Current
);
}
}
else
{
mainWindow
->
getSelectionManager
()
->
clear
();
}
}
void
RadiumPlayer
::
addConnections
()
{
auto
mainWindow
=
dynamic_cast
<
MainWindow
*>
(
m_mainWindow
.
get
()
);
...
...
@@ -89,6 +118,10 @@ void RadiumPlayer::addConnections() {
connect
(
this
,
&
Ra
::
Gui
::
BaseApplication
::
updateFrameStats
,
this
,
&
RadiumPlayer
::
updateFrameStats
);
framesCountForStatsChanged
(
25
);
connect
(
m_viewer
,
&
Ra
::
Gui
::
Viewer
::
toggleBrushPicking
,
this
,
&
RadiumPlayer
::
toggleCirclePicking
);
connect
(
m_viewer
,
&
Ra
::
Gui
::
Viewer
::
rightClickPicking
,
this
,
&
RadiumPlayer
::
handlePicking
);
}
void
RadiumPlayer
::
addPluginsDir
()
{
...
...
This diff is collapsed.
Click to expand it.
src/Mara/RadiumPlayer.hpp
+
7
−
0
View file @
757e4d11
...
...
@@ -42,5 +42,12 @@ class RadiumPlayer : public Ra::Gui::BaseApplication
/// Current file. First indicate that the file (second) must be loaded at startup
std
::
optional
<
QStringList
>
m_fileOption
{
std
::
nullopt
};
private
slots
:
/// Allow to pick using a circle
void
toggleCirclePicking
(
bool
on
);
/// Slot for the picking results from the viewer.
void
handlePicking
(
const
Ra
::
Engine
::
Rendering
::
Renderer
::
PickingResult
&
pickingResult
);
};
}
// namespace Mara
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment