9 #include "imstkRenderer.h" 10 #include "imstkModule.h" 12 #include <unordered_map> 18 class InteractorStyle;
19 class KeyboardDeviceClient;
20 class MouseDeviceClient;
22 class ScreenCaptureUtility;
26 std::string m_windowName =
"imstk";
28 bool m_hideCurzor =
false;
29 bool m_hideBorder =
true;
30 bool m_fullScreen =
false;
32 int m_renderWinWidth = 1000;
33 int m_renderWinHeight = 800;
48 ~
Viewer()
override =
default;
58 void setDebugAxesLength(
double x,
double y,
double z);
63 virtual void setActiveScene(std::shared_ptr<Scene> scene) = 0;
75 void setSize(Vec2i size) { setSize(size[0], size[1]); }
77 virtual const Vec2i getSize()
const {
return Vec2i::Zero(); }
87 std::shared_ptr<Renderer> getActiveRenderer()
const;
97 virtual void setWindowTitle(
const std::string& title) = 0;
103 virtual void setInfoLevel(
const int level);
124 virtual void setBackgroundColors(
const Color color1,
const Color color2 =
Color(0.0, 0.0, 0.0),
const bool gradientBackground =
false) = 0;
126 virtual void processEvents() = 0;
131 virtual std::shared_ptr<KeyboardDeviceClient> getKeyboardDevice()
const;
136 virtual std::shared_ptr<MouseDeviceClient> getMouseDevice()
const;
138 double getVisualFps()
const {
return m_visualFps; }
146 void updateModule()
override;
148 std::unordered_map<std::shared_ptr<Scene>, std::shared_ptr<Renderer>> m_rendererMap;
150 std::shared_ptr<Scene> m_activeScene;
151 std::shared_ptr<Entity> m_debugEntity;
152 std::shared_ptr<Camera> m_debugCamera;
155 std::shared_ptr<ViewerConfig> m_config;
158 std::chrono::high_resolution_clock::time_point
m_pre;
159 std::chrono::high_resolution_clock::time_point
m_post;
162 double m_visualFps = 0.0;
163 double m_lastFps = 0.0;
std::chrono::high_resolution_clock::time_point m_pre
time point pre-rendering
std::chrono::high_resolution_clock::time_point m_lastFpsUpdate
time point for last framerate display update
virtual void setUseVsync(const bool)
Set whether to sync frames to the refresh of the monitor.
virtual const int getInfoLevelCount() const
Get the number of info levels for a viewer, varies on implementation.
std::shared_ptr< Scene > getActiveScene() const
Get scene currently being rendered.
std::shared_ptr< ScreenCaptureUtility > getScreenCaptureUtility() const
access screen shot utility
Base class for viewer that manages render window and the renderers Creates backend-specific renderers...
int getInfoLevel() const
Get the current info level.
virtual Renderer::Mode getRenderingMode() const
Get the current renderer's mode.
std::shared_ptr< ScreenCaptureUtility > m_screenCapturer
Screen shot utility.
virtual void setSize(int, int)
Set the render window size.
Mode
Enumerations for the render mode.
Base class for imstk module system. A module defines something that is updated, and can be paused/res...
std::chrono::high_resolution_clock::time_point m_post
time point post-rendering