Free Electron
ObjectViewer.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __viewer_ObjectViewer_h__
8 #define __viewer_ObjectViewer_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Viewer designed to inspect a single object
17 
18  @ingroup viewer
19 *//***************************************************************************/
20 class FE_DL_EXPORT ObjectViewer:
21  public Initialize<ObjectViewer>,
22  virtual public SignalerViewerI
23 {
24  public:
25  ObjectViewer(void);
26 virtual ~ObjectViewer(void);
27  void initialize(void);
28 
29  //* As ViewerI
30 virtual void bind(sp<WindowI> spWindowI);
31 virtual void bind(sp<DrawI> spDrawI);
33  { return m_spCameraControllerI; }
34 virtual void setCameraControllerI(
35  sp<CameraControllerI> a_spCameraControllerI)
36  { m_spCameraControllerI=a_spCameraControllerI; }
37 virtual sp<DrawI> getDrawI(void) const { return m_spDrawI; }
38 virtual void insertBeatHandler(sp<HandlerI> spHandlerI);
39 virtual void insertEventHandler(sp<HandlerI> spHandlerI);
40 virtual void insertDrawHandler(sp<HandlerI> spHandlerI);
41 virtual void render(Real a_time,Real a_timestep);
42 virtual Real frameRate(void) const { return m_frameRate; }
43 
44  private:
45 
46  void start(void);
47 
48  sp<SignalerI> m_spEventSignaler;
49  sp<SignalerI> m_spDrawSignaler;
50  sp<Scope> m_spScope;
51  sp<Layout> m_spBeatLayout;
52  sp<Layout> m_spRenderLayout;
53 
54  Record m_beat;
55  Record m_underlay;
56  Record m_render;
57  Record m_overlay;
58 
59  sp<DrawI> m_spDrawI;
60  sp<CameraControllerI> m_spCameraControllerI;
61  sp<CameraI> m_spCameraPerspective;
62  sp<CameraEditable> m_spCameraOverlay;
63 
64  AsViewer m_asViewer;
65 
66  BWORD m_started;
67  Real m_frameMS;
68  Real m_frameRate;
69  Real m_frameTotal;
70  U32 m_frameCount;
71  SystemTicker m_ticker;
72 };
73 
74 } /* namespace ext */
75 } /* namespace fe */
76 
77 #endif /* __viewer_ObjectViewer_h__ */
Simple viewer interface.
Definition: SignalerViewerI.h:22
virtual Real frameRate(void) const
Returns frames per seconds.
Definition: ObjectViewer.h:42
kernel
Definition: namespace.dox:3
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
virtual void setCameraControllerI(sp< CameraControllerI > a_spCameraControllerI)
Replaces the current CameraControllerI.
Definition: ObjectViewer.h:34
virtual sp< DrawI > getDrawI(void) const
Returns the current DrawI.
Definition: ObjectViewer.h:37
High precision timer.
Definition: SystemTicker.h:174
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Viewer designed to inspect a single object.
Definition: ObjectViewer.h:20
SignalerViewerI attributes.
Definition: SignalerViewerI.h:37
virtual sp< CameraControllerI > getCameraControllerI(void) const
Returns the current CameraControllerI.
Definition: ObjectViewer.h:32