diff --git a/src/libRender/RadiumNBR/Gui/RenderGraphEditor/RenderGraphEditorView.cpp b/src/libRender/RadiumNBR/Gui/RenderGraphEditor/RenderGraphEditorView.cpp index d691df57a39be3dd367b083a4c0e7d7ee1953a9c..48cdc9dedb539b8d45751df0342ba9b1dcac818c 100644 --- a/src/libRender/RadiumNBR/Gui/RenderGraphEditor/RenderGraphEditorView.cpp +++ b/src/libRender/RadiumNBR/Gui/RenderGraphEditor/RenderGraphEditorView.cpp @@ -6,12 +6,9 @@ #include <nodes/ConnectionStyle> #include <nodes/NodeData> -#include <RadiumNBR/NodeBasedRenderer.hpp> #include <RadiumNBR/NodeGraph/RenderGraph.hpp> #include <RadiumNBR/Gui/RenderGraphEditor/NodeAdapterModel.hpp> -#include <RadiumNBR/Gui/RenderGraphEditor/SourceColorTextureModel.hpp> -#include <RadiumNBR/Gui/RenderGraphEditor/SourceDepthTextureModel.hpp> #include <RadiumNBR/Gui/RenderGraphEditor/WidgetFactory.hpp> #include <RadiumNBR/NodeGraph/PremadeNodes/PremadeNodesIncludes.hpp> @@ -202,13 +199,6 @@ std::shared_ptr<DataModelRegistry> initializeNodeRegistry( RenderGraph* renderGr ret->registerModel<NodeAdapterModel<EnvMapTextureSource>>( NodeCreator<NodeAdapterModel<EnvMapTextureSource>>( renderGraph ), "Sources" ); - /* - ret->registerModel<SourceColorTextureModel>( - NodeCreator<SourceColorTextureModel>( renderGraph ), "Sources" ); - ret->registerModel<SourceDepthTextureModel>( - NodeCreator<SourceDepthTextureModel>( renderGraph ), "Sources" ); - */ - ret->registerModel<NodeAdapterModel<ColorTextureNode>>( NodeCreator<NodeAdapterModel<ColorTextureNode>>( renderGraph ), "Sources" ); ret->registerModel<NodeAdapterModel<DepthTextureNode>>( diff --git a/src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceColorTextureModel.cpp b/src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceColorTextureModel.cpp deleted file mode 100644 index c586a57ad56a98ff6e79fd6ccdecb7acd4aacc54..0000000000000000000000000000000000000000 --- a/src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceColorTextureModel.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include <RadiumNBR/Gui/RenderGraphEditor/SourceColorTextureModel.hpp> - -#include <Engine/Data/Texture.hpp> - -#include <RadiumNBR/NodeGraph/Node.hpp> - -using QtNodes::NodeData; -using QtNodes::NodeDataModel; -using QtNodes::NodeDataType; -using QtNodes::PortIndex; -using QtNodes::PortType; - -SourceColorTextureModel::SourceColorTextureModel( RenderGraph* renderGraph ) : - m_renderGraph( renderGraph ) { - m_node = new ColorTextureNode( "Source node color texture" + - std::to_string( m_renderGraph->getNodesCount() ) ); - m_renderGraph->addNode( m_node ); -} - -unsigned int SourceColorTextureModel::nPorts( PortType portType ) const { - unsigned int result = 1; - - switch ( portType ) - { - case PortType::In: { - result = 0; - break; - } - - case PortType::Out: { - result = 1; - break; - } - - default: { - break; - } - } - - return result; -} - -NodeDataType SourceColorTextureModel::dataType( PortType, PortIndex ) const { - return QtNodes::NodeDataType{ std::to_string( typeid( NodeTypeTexture ).hash_code() ).c_str(), - "outColorTexture" }; -} diff --git a/src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceColorTextureModel.hpp b/src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceColorTextureModel.hpp deleted file mode 100644 index ca5ade802c2e7b55bda9f73263942392c9546c76..0000000000000000000000000000000000000000 --- a/src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceColorTextureModel.hpp +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once -#include <QtCore/QObject> -#include <RadiumNBR/NodeBasedRendererMacro.hpp> - -#include <nodes/NodeDataModel> - -#include <RadiumNBR/Gui/RenderGraphEditor/ConnectionStatusData.hpp> - -#include <RadiumNBR/NodeGraph/PremadeNodes/Sources/ColorTextureNode.hpp> -#include <RadiumNBR/NodeGraph/RenderGraph.hpp> - -#include <iostream> - -class NodeBasedRenderer_LIBRARY_API SourceColorTextureModel : public QtNodes::NodeDataModel -{ - Q_OBJECT - - public: - SourceColorTextureModel( RenderGraph* renderGraph ); - - ~SourceColorTextureModel() { - m_renderGraph->removeNode( m_node ); - m_renderGraph->m_recompile = true; - } - - public: - QString caption() const override { return SourceColorTextureModel::Name(); } - - bool captionVisible() const override { return true; } - - static QString Name() { return ColorTextureNode::getTypename().c_str(); } - - QString name() const override { return SourceColorTextureModel::Name(); } - - QString uuid() const override { return m_node->getUuid().c_str(); } - - public: - unsigned int nPorts( QtNodes::PortType portType ) const override; - - QtNodes::NodeDataType dataType( QtNodes::PortType portType, - QtNodes::PortIndex portIndex ) const override; - - std::shared_ptr<QtNodes::NodeData> outData( QtNodes::PortIndex port ) override { - return std::make_shared<ConnectionStatusData>( m_node, - m_node->getOutputs()[port]->getName() ); - } - - void setInData( std::shared_ptr<QtNodes::NodeData> data, int ) override {} - - QWidget* embeddedWidget() override { return nullptr; } - - private: - ColorTextureNode* m_node{ nullptr }; - RenderGraph* m_renderGraph{ nullptr }; -}; diff --git a/src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceDepthTextureModel.cpp b/src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceDepthTextureModel.cpp deleted file mode 100644 index eb81fba19a649e96eb5d038d37d061c0ef7a86ae..0000000000000000000000000000000000000000 --- a/src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceDepthTextureModel.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include "SourceDepthTextureModel.hpp" - -#include <Engine/Data/Texture.hpp> -#include <RadiumNBR/NodeGraph/Node.hpp> - -using QtNodes::NodeData; -using QtNodes::NodeDataModel; -using QtNodes::NodeDataType; -using QtNodes::PortIndex; -using QtNodes::PortType; - -SourceDepthTextureModel::SourceDepthTextureModel( RenderGraph* renderGraph ) : - m_renderGraph( renderGraph ) { - m_node = new DepthTextureNode( "Source node depth texture" + - std::to_string( m_renderGraph->getNodesCount() ) ); - m_renderGraph->addNode( m_node ); -} - -unsigned int SourceDepthTextureModel::nPorts( PortType portType ) const { - unsigned int result = 1; - - switch ( portType ) - { - case PortType::In: { - result = 0; - break; - } - - case PortType::Out: { - result = 1; - break; - } - - default: { - break; - } - } - - return result; -} - -NodeDataType SourceDepthTextureModel::dataType( PortType, PortIndex ) const { - return QtNodes::NodeDataType{ std::to_string( typeid( NodeTypeTexture ).hash_code() ).c_str(), - "outDepthTexture" }; -} diff --git a/src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceDepthTextureModel.hpp b/src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceDepthTextureModel.hpp deleted file mode 100644 index cab0a35a99ec2a7cd6d1445300d8558ca0b8e39e..0000000000000000000000000000000000000000 --- a/src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceDepthTextureModel.hpp +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once -#include <QtCore/QObject> -#include <RadiumNBR/NodeBasedRendererMacro.hpp> - -#include <nodes/NodeDataModel> - -#include "ConnectionStatusData.hpp" - -#include <RadiumNBR/NodeGraph/PremadeNodes/Sources/DepthTextureNode.hpp> -#include <RadiumNBR/NodeGraph/RenderGraph.hpp> - -#include <iostream> - -class NodeBasedRenderer_LIBRARY_API SourceDepthTextureModel : public QtNodes::NodeDataModel -{ - Q_OBJECT - - public: - SourceDepthTextureModel( RenderGraph* renderGraph ); - - ~SourceDepthTextureModel() { - m_renderGraph->removeNode( m_node ); - m_renderGraph->m_recompile = true; - } - - public: - QString caption() const override { return SourceDepthTextureModel::Name(); } - - bool captionVisible() const override { return true; } - - static QString Name() { return DepthTextureNode::getTypename().c_str(); } - - QString name() const override { return SourceDepthTextureModel::Name(); } - - QString uuid() const override { return m_node->getUuid().c_str(); } - - public: - unsigned int nPorts( QtNodes::PortType portType ) const override; - - QtNodes::NodeDataType dataType( QtNodes::PortType portType, - QtNodes::PortIndex portIndex ) const override; - - std::shared_ptr<QtNodes::NodeData> outData( QtNodes::PortIndex port ) override { - return std::make_shared<ConnectionStatusData>( m_node, - m_node->getOutputs()[port]->getName() ); - } - - void setInData( std::shared_ptr<QtNodes::NodeData> data, int ) override {} - - QWidget* embeddedWidget() override { return nullptr; } - - private: - DepthTextureNode* m_node{ nullptr }; - RenderGraph* m_renderGraph{ nullptr }; -};