Skip to content
Snippets Groups Projects
Commit 8067b205 authored by Mathias Paulin's avatar Mathias Paulin :speech_balloon:
Browse files

Add some todos to remember what's next

parent f6b3f603
No related branches found
No related tags found
No related merge requests found
......@@ -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[] ) {
......
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment