Commit 369159b5 authored by Nghia Truong's avatar Nghia Truong

STYLE: Additional style enforement

parent 02eec9c9
......@@ -54,7 +54,7 @@ VulkanViewer::VulkanViewer(SimulationManager * manager, bool enableVR)
}
void
VulkanViewer::setActiveScene(std::shared_ptr<Scene> scene)
VulkanViewer::setActiveScene(const std::shared_ptr<Scene>& scene)
{
m_renderer = std::make_shared<VulkanRenderer>(scene);
m_renderer->m_backgroundColor = m_backgroundColor;
......@@ -181,7 +181,7 @@ VulkanViewer::setRenderingMode(const Renderer::Mode mode)
m_renderer->setMode(mode, false);
}
const Renderer::Mode
Renderer::Mode
VulkanViewer::getRenderingMode()
{
return m_renderer->getMode();
......
......@@ -46,19 +46,19 @@ class VulkanViewer : public Viewer
public:
VulkanViewer(SimulationManager * manager = nullptr, bool enableVR = false);
virtual void setActiveScene(std::shared_ptr<Scene> scene);
virtual void setActiveScene(const std::shared_ptr<Scene>& scene) override;
virtual void startRenderingLoop();
virtual void startRenderingLoop() override;
virtual void endRenderingLoop();
virtual void endRenderingLoop() override;
///
/// \brief Setup the current renderer to render what's needed
/// based on the mode chosen
///
void setRenderingMode(const Renderer::Mode mode);
virtual void setRenderingMode(const Renderer::Mode mode) override;
virtual const Renderer::Mode getRenderingMode();
virtual Renderer::Mode getRenderingMode() override;
///
/// \brief Setups up the swapchain
......@@ -71,7 +71,8 @@ public:
/// \brief Set the coloring of the screen background
/// If 'gradientBackground' is false or not supplied color1 will fill the entire background
///
virtual void setBackgroundColors(const Vec3d color1, const Vec3d color2 = Vec3d::Zero(), const bool gradientBackground = false) override;
virtual void setBackgroundColors(const Vec3d color1, const Vec3d color2 = Vec3d::Zero(),
const bool gradientBackground = false) override;
///
/// \brief Enable/disable fullscreen
......
......@@ -23,13 +23,13 @@
namespace imstk
{
std::shared_ptr<Scene>
const std::shared_ptr<Scene>&
Viewer::getActiveScene() const
{
return m_activeScene;
}
std::shared_ptr<Renderer>
const std::shared_ptr<Renderer>&
Viewer::getActiveRenderer() const
{
return m_rendererMap.at(m_activeScene);
......@@ -41,13 +41,13 @@ Viewer::isRendering() const
return m_running;
}
std::shared_ptr<ScreenCaptureUtility>
const std::shared_ptr<ScreenCaptureUtility>&
Viewer::getScreenCaptureUtility() const
{
return m_screenCapturer;
}
std::shared_ptr<GUIOverlay::Canvas>
const std::shared_ptr<GUIOverlay::Canvas>&
Viewer::getCanvas()
{
return m_canvas;
......@@ -118,4 +118,4 @@ Viewer::setOnTimerFunction(EventHandlerFunction func)
{
m_interactorStyle->m_onTimerFunction = func;
}
}
\ No newline at end of file
}
......@@ -42,19 +42,19 @@ class Viewer
{
public:
Viewer() {};
Viewer(SimulationManager * manager){};
Viewer() {}
Viewer(SimulationManager *){}
virtual ~Viewer() = default;
///
/// \brief Get scene currently being rendered
///
std::shared_ptr<Scene> getActiveScene() const;
const std::shared_ptr<Scene>& getActiveScene() const;
///
/// \brief Set scene to be rendered
///
virtual void setActiveScene(std::shared_ptr<Scene> scene) = 0;
virtual void setActiveScene(const std::shared_ptr<Scene>& scene) = 0;
///
/// \brief Start rendering
......@@ -75,7 +75,7 @@ public:
///
/// \brief Get the current renderer's mode
///
virtual const Renderer::Mode getRenderingMode(){ return Renderer::Mode::EMPTY; };
virtual Renderer::Mode getRenderingMode(){ return Renderer::Mode::EMPTY; }
///
/// \brief Returns true if the Viewer is rendering
......@@ -85,12 +85,12 @@ public:
///
/// \brief Retrieve the renderer associated with the current scene
///
std::shared_ptr<Renderer> getActiveRenderer() const;
const std::shared_ptr<Renderer>& getActiveRenderer() const;
///
/// \brief access screen shot utility
///
std::shared_ptr<ScreenCaptureUtility> getScreenCaptureUtility() const;
const std::shared_ptr<ScreenCaptureUtility>& getScreenCaptureUtility() const;
///
/// \brief Set the coloring of the screen background
......@@ -101,7 +101,7 @@ public:
///
/// \brief Get canvas
///
std::shared_ptr<GUIOverlay::Canvas> getCanvas();
const std::shared_ptr<GUIOverlay::Canvas>& getCanvas();
///
/// \brief Set custom event handlers on interactor style
......@@ -124,15 +124,13 @@ public:
void setOnTimerFunction(EventHandlerFunction func);
protected:
std::shared_ptr<Scene> m_activeScene;
std::unordered_map<std::shared_ptr<Scene>, std::shared_ptr<Renderer>> m_rendererMap;
std::shared_ptr<Scene> m_activeScene;
std::shared_ptr<InteractorStyle> m_interactorStyle;
std::shared_ptr<ScreenCaptureUtility> m_screenCapturer; ///> Screen shot utility
std::shared_ptr<InteractorStyle> m_interactorStyle;
bool m_running = false;
std::shared_ptr<GUIOverlay::Canvas> m_canvas = std::make_shared<GUIOverlay::Canvas>();;
std::shared_ptr<GUIOverlay::Canvas> m_canvas = std::make_shared<GUIOverlay::Canvas>();
};
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment