Free Electron
QuickViewer.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_QuickViewer_h__
8 #define __viewer_QuickViewer_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Self-configuring delegate for ObjectViewer
17 
18  @ingroup viewer
19 *//***************************************************************************/
20 class FE_DL_EXPORT QuickViewer:
21  public Initialize<QuickViewer>,
22  virtual public QuickViewerI
23 {
24  public:
25  QuickViewer(void);
26 virtual ~QuickViewer(void);
27  void initialize(void);
28 
29  //* As QuickViewerI
30 virtual Real frameRate(void) const
31  { return m_spObjectViewer->frameRate(); }
32 virtual void bind(sp<WindowI> spWindowI)
33  { m_spWindowI=spWindowI; }
34 virtual void bind(sp<DrawI> spDrawI);
36  { return m_spObjectViewer->getCameraControllerI(); }
37 virtual sp<DrawI> getDrawI(void) const
38  { return m_spObjectViewer->getDrawI(); }
39 virtual sp<WindowI> getWindowI(void) const
40  { return m_spWindowI; }
41 virtual SpatialVector interestPoint(void) const
42  { return m_spInterestHandler->m_spCameraControllerI
43  ->interestMatrix().translation(); }
44 virtual SpatialVector auxilliaryPoint(void) const
45  { return m_spInterestHandler->m_spCameraControllerI
46  ->auxillaryMatrix().translation(); }
47 virtual void insertBeatHandler(sp<HandlerI> spHandlerI);
48 virtual void insertEventHandler(sp<HandlerI> spHandlerI);
49 virtual void insertDrawHandler(sp<HandlerI> spHandlerI);
50 virtual void open(void);
51 virtual void reopen(void);
52 virtual void run(U32 frames);
53 
54  private:
55 
56  class InterestHandler:
57  public HandlerI,
58  public CastableAs<InterestHandler>
59  {
60  public:
61  InterestHandler(void) {}
62 
63  virtual void bind(sp<DrawI> spDrawI)
64  { m_spDrawI=spDrawI; }
65  virtual void bind(sp<CameraControllerI> spCameraControllerI)
66  { m_spCameraControllerI=spCameraControllerI; }
67 
68  //* As HandlerI
69  virtual void handleBind(sp<SignalerI> spSignalerI,
70  sp<Layout> spLayout);
71  virtual void handle(Record& render);
72 
73  sp<DrawI> m_spDrawI;
74  sp<CameraControllerI> m_spCameraControllerI;
75  AsViewer m_asViewer;
76  };
77 
78  BWORD m_opened;
79  sp<WindowI> m_spWindowI;
80  sp<SignalerViewerI> m_spObjectViewer;
81  sp<InterestHandler> m_spInterestHandler;
82  sp<HandlerI> m_spJoyHandler;
83 };
84 
85 } /* namespace ext */
86 } /* namespace fe */
87 
88 #endif /* __viewer_QuickViewer_h__ */
virtual Real frameRate(void) const
Returns frames per seconds.
Definition: QuickViewer.h:30
Self-configuring delegate for ObjectViewer.
Definition: QuickViewer.h:20
virtual sp< WindowI > getWindowI(void) const
Returns the internally-created WindowI.
Definition: QuickViewer.h:39
virtual SpatialVector auxilliaryPoint(void) const
Returns the secondary point.
Definition: QuickViewer.h:44
kernel
Definition: namespace.dox:3
virtual sp< CameraControllerI > getCameraControllerI(void) const
Returns the current CameraControllerI.
Definition: QuickViewer.h:35
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Self-configuring Viewer.
Definition: QuickViewerI.h:20
Interface to handle signals from an SignalerI.
Definition: HandlerI.h:22
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
virtual SpatialVector interestPoint(void) const
Returns the center of attention.
Definition: QuickViewer.h:41
SignalerViewerI attributes.
Definition: SignalerViewerI.h:37
virtual sp< DrawI > getDrawI(void) const
Returns the current DrawI.
Definition: QuickViewer.h:37
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192