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
8067b205
Commit
8067b205
authored
4 years ago
by
Mathias Paulin
Browse files
Options
Downloads
Patches
Plain Diff
Add some todos to remember what's next
parent
f6b3f603
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/DemoApp/main.cpp
+24
-20
24 additions, 20 deletions
src/DemoApp/main.cpp
src/libRender/RadiumNBR/Gui/RendererPanel.cpp
+3
-1
3 additions, 1 deletion
src/libRender/RadiumNBR/Gui/RendererPanel.cpp
with
27 additions
and
21 deletions
src/DemoApp/main.cpp
+
24
−
20
View file @
8067b205
...
...
@@ -57,25 +57,6 @@ class RendererController : public RadiumNBR::VisualizationController
};
};
/**
* Define a factory that set the wanted renderer on the window
*/
class
DemoWindowFactory
:
public
Ra
::
Gui
::
BaseApplication
::
WindowFactory
{
public:
DemoWindowFactory
()
=
delete
;
~
DemoWindowFactory
()
=
default
;
explicit
DemoWindowFactory
(
std
::
shared_ptr
<
RadiumNBR
::
NodeBasedRenderer
>
r
)
:
renderer
(
r
)
{}
inline
Ra
::
Gui
::
MainWindowInterface
*
createMainWindow
()
const
override
{
auto
window
=
new
Ra
::
Gui
::
SimpleWindow
();
window
->
addRenderer
(
renderer
->
getRendererName
(),
renderer
);
return
window
;
}
private
:
std
::
shared_ptr
<
RadiumNBR
::
NodeBasedRenderer
>
renderer
;
};
/** Process the scene to add the custom attribs to all objects
*/
void
AddCustomAttributeToMeshes
()
{
...
...
@@ -184,6 +165,29 @@ const std::string customFragmentColor{
"return vec4( (specColor+col)*max(lightDir.z, 0), 1);
\n
"
"}
\n
"
};
/**
* Main code to demonstrate the use of a self configured node based renderer
*/
/**
* Define a factory that set the wanted renderer on the window
*/
class
DemoWindowFactory
:
public
Ra
::
Gui
::
BaseApplication
::
WindowFactory
{
public:
DemoWindowFactory
()
=
delete
;
~
DemoWindowFactory
()
=
default
;
explicit
DemoWindowFactory
(
std
::
shared_ptr
<
RadiumNBR
::
NodeBasedRenderer
>
r
)
:
renderer
(
r
)
{}
inline
Ra
::
Gui
::
MainWindowInterface
*
createMainWindow
()
const
override
{
auto
window
=
new
Ra
::
Gui
::
SimpleWindow
();
window
->
addRenderer
(
renderer
->
getRendererName
(),
renderer
);
return
window
;
}
private
:
std
::
shared_ptr
<
RadiumNBR
::
NodeBasedRenderer
>
renderer
;
};
/**
* main function.
*/
...
...
@@ -215,7 +219,7 @@ int main( int argc, char* argv[] ) {
return
app
.
exec
();
}
// Will be removed soon
#if 0
int main( int argc, char* argv[] ) {
...
...
This diff is collapsed.
Click to expand it.
src/libRender/RadiumNBR/Gui/RendererPanel.cpp
+
3
−
1
View file @
8067b205
...
...
@@ -168,7 +168,9 @@ void RendererPanel::addSeparator() {
void
RendererPanel
::
addCodeEditor
(
const
std
::
string
&
name
,
std
::
function
<
void
(
std
::
string
)
>
callback
,
const
std
::
string
&
initialText
)
{
// @todo : get a full featured code editor
// cf https://www.codeproject.com/Articles/1139741/QCodeEditor-Widget-for-Qt
// (code at https://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=1139741)
auto
button
=
new
QPushButton
(
name
.
c_str
(),
this
);
QDialog
*
dialog
=
nullptr
;
auto
editDialog
=
[
this
,
callback
,
initialText
,
dialog
]()
mutable
{
...
...
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