From 5ca55ed4df0655c9ca691822936e04f5d64b7666 Mon Sep 17 00:00:00 2001
From: Sreekanth Arikatla <sreekanth.arikatla@kitware.com>
Date: Mon, 19 Mar 2018 15:37:01 -0400
Subject: [PATCH] REFAC: Ensure vulkan backend compiles and runs with the
 refactoring

---
 Examples/Sandbox/main.cpp                           |  2 +-
 .../VulkanRenderer/imstkVulkanRenderer.cpp          |  3 ++-
 .../Rendering/VulkanRenderer/imstkVulkanRenderer.h  | 13 ++++++++++++-
 .../VulkanRenderer/imstkVulkanInteractorStyle.cpp   |  2 +-
 .../VulkanRenderer/imstkVulkanViewer.h              |  2 +-
 Source/SimulationManager/imstkOpenVRCommand.cpp     |  1 +
 6 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/Examples/Sandbox/main.cpp b/Examples/Sandbox/main.cpp
index c8a7e93ac..ba34337ce 100644
--- a/Examples/Sandbox/main.cpp
+++ b/Examples/Sandbox/main.cpp
@@ -3692,7 +3692,7 @@ int main()
     //testViewer();
     //testDecals();
     //testRendering();
-    testRenderMaterials();
+    //testRenderMaterials();
     //testScreenShotUtility();
     //testCapsule();
 
diff --git a/Source/Rendering/VulkanRenderer/imstkVulkanRenderer.cpp b/Source/Rendering/VulkanRenderer/imstkVulkanRenderer.cpp
index b59c9d298..12e1ad4f3 100644
--- a/Source/Rendering/VulkanRenderer/imstkVulkanRenderer.cpp
+++ b/Source/Rendering/VulkanRenderer/imstkVulkanRenderer.cpp
@@ -21,7 +21,8 @@
 
 #include "imstkVulkanRenderer.h"
 
-namespace imstk {
+namespace imstk
+{
 VulkanRenderer::VulkanRenderer(std::shared_ptr<Scene> scene)
 {
     m_scene = scene;
diff --git a/Source/Rendering/VulkanRenderer/imstkVulkanRenderer.h b/Source/Rendering/VulkanRenderer/imstkVulkanRenderer.h
index 291d59dd4..7725a123c 100644
--- a/Source/Rendering/VulkanRenderer/imstkVulkanRenderer.h
+++ b/Source/Rendering/VulkanRenderer/imstkVulkanRenderer.h
@@ -57,7 +57,8 @@ struct VulkanRendererConstants
     unsigned int numLights;
 };
 
-class VulkanRenderer : public Renderer {
+class VulkanRenderer : public Renderer
+{
 public:
     VulkanRenderer(std::shared_ptr<Scene> scene);
     ~VulkanRenderer();
@@ -160,6 +161,16 @@ protected:
     ///
     void createShadowMaps(uint32_t resolution);
 
+    /// \brief Update background colors
+    ///
+    void updateBackground(const Vec3d color1, const Vec3d color2 = Vec3d::Zero(), const bool gradientBackground = false) {};
+
+protected:
+    friend class VulkanViewer;
+    friend class VulkanMaterialDelegate;
+    friend class VulkanPostProcess;
+    friend class VulkanPostProcessingChain;
+
     void initialize(unsigned int width, unsigned int height);
     void loadAllGeometry();
     std::shared_ptr<VulkanRenderDelegate> loadGeometry(std::shared_ptr<Geometry> geometry);
diff --git a/Source/SimulationManager/VulkanRenderer/imstkVulkanInteractorStyle.cpp b/Source/SimulationManager/VulkanRenderer/imstkVulkanInteractorStyle.cpp
index 947014daf..bed49abb5 100644
--- a/Source/SimulationManager/VulkanRenderer/imstkVulkanInteractorStyle.cpp
+++ b/Source/SimulationManager/VulkanRenderer/imstkVulkanInteractorStyle.cpp
@@ -78,7 +78,7 @@ VulkanInteractorStyle::OnChar(int keyID, int type)
         // Launch simulation if inactive
         if (status == SimulationStatus::INACTIVE)
         {
-            m_simManager->launchSimulation();
+            m_simManager->startSimulation(SimulationStatus::RUNNING);
         }
     }
     else if (status != SimulationStatus::INACTIVE &&
diff --git a/Source/SimulationManager/VulkanRenderer/imstkVulkanViewer.h b/Source/SimulationManager/VulkanRenderer/imstkVulkanViewer.h
index db737e834..28cee677f 100644
--- a/Source/SimulationManager/VulkanRenderer/imstkVulkanViewer.h
+++ b/Source/SimulationManager/VulkanRenderer/imstkVulkanViewer.h
@@ -50,7 +50,7 @@ public:
     /// \brief Setup the current renderer to render what's needed
     /// based on the mode chosen
     ///
-    void setRenderingMode(Renderer::Mode mode) {};
+    void setRenderingMode(const Renderer::Mode mode) {};
 
     ///
     /// \brief Setups up the swapchain
diff --git a/Source/SimulationManager/imstkOpenVRCommand.cpp b/Source/SimulationManager/imstkOpenVRCommand.cpp
index e361a481a..22a395600 100644
--- a/Source/SimulationManager/imstkOpenVRCommand.cpp
+++ b/Source/SimulationManager/imstkOpenVRCommand.cpp
@@ -25,6 +25,7 @@ limitations under the License.
 // imstk
 #include "imstkOpenVRCommand.h"
 #include "imstkSimulationManager.h"
+#include "VTKRenderer/imstkVTKRenderer.h"
 
 namespace imstk
 {
-- 
GitLab