From bca877d47b13434b00e4a94e80cf826bccea6e8a Mon Sep 17 00:00:00 2001
From: Mathias Paulin <mathias.paulin@irit.fr>
Date: Wed, 23 Feb 2022 08:15:01 +0100
Subject: [PATCH] [librender] remove unused files.

---
 .../RenderGraphEditorView.cpp                 | 10 ----
 .../SourceColorTextureModel.cpp               | 46 ----------------
 .../SourceColorTextureModel.hpp               | 55 -------------------
 .../SourceDepthTextureModel.cpp               | 45 ---------------
 .../SourceDepthTextureModel.hpp               | 55 -------------------
 5 files changed, 211 deletions(-)
 delete mode 100644 src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceColorTextureModel.cpp
 delete mode 100644 src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceColorTextureModel.hpp
 delete mode 100644 src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceDepthTextureModel.cpp
 delete mode 100644 src/libRender/RadiumNBR/Gui/RenderGraphEditor/SourceDepthTextureModel.hpp

diff --git a/src/libRender/RadiumNBR/Gui/RenderGraphEditor/RenderGraphEditorView.cpp b/src/libRender/RadiumNBR/Gui/RenderGraphEditor/RenderGraphEditorView.cpp
index d691df5..48cdc9d 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 c586a57..0000000
--- 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 ca5ade8..0000000
--- 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 eb81fba..0000000
--- 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 cab0a35..0000000
--- 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 };
-};
-- 
GitLab