Free Electron
InspectController.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_InspectController_h__
8 #define __viewer_InspectController_h__
9 
10 #define MOUSEMODES 9
11 
12 namespace fe
13 {
14 namespace ext
15 {
16 
17 /**************************************************************************//**
18  @brief Viewpoint controller for detailed inspection of a single object
19 
20  @ingroup viewer
21 *//***************************************************************************/
22 class FE_DL_EXPORT InspectController:
23  virtual public CameraControllerI,
24  virtual public HandlerI,
25  virtual public Reactor,
26  public CastableAs<InspectController>
27 {
28  public:
29  InspectController(void);
30 virtual ~InspectController(void);
31 
32  //* as HandlerI
33 virtual void handle(Record &record);
34 
35  //* as CameraControllerI
36 virtual
37 const SpatialTransform& interestMatrix(void) const
38  { return m_interestMatrix;}
39 virtual
41  { return m_auxillaryMatrix;}
42 
43 virtual BWORD closeEvent(void) const
44  { return m_closeEvent; }
45 
46 virtual U32 keyCount(U32 key) const;
47 virtual U32 setKeyCount(U32 key,U32 count);
48 virtual void setKeyMax(U32 key,U32 max);
49 virtual Real mouseDial(U32 mode) const;
50 
51 virtual SpatialVector lookPoint(void) const;
52 virtual Real azimuth(void) const;
53 virtual Real downangle(void) const;
54 virtual Real distance(void) const;
55 
56 virtual void setVertical(SpatialVector a_vertical);
57 virtual void setLookPoint(SpatialVector a_point);
58 virtual void setLookAngle(Real azimuth,Real downangle,
59  Real distance);
60 
61 virtual void useCustomCamera(sp<CameraI> a_spCamera);
62 virtual sp<CameraI> camera(void) const;
63 
64 virtual BWORD rotationLock(void) const
65  { return m_rotationLock; }
66 virtual void setRotationLock(BWORD a_rotationLock)
67  { m_rotationLock=a_rotationLock; }
68 
69  private:
70  using Reactor::react;
71 
72  //* Change interpreted state using events
73  void react(const WindowEvent &windowEvent);
74 
75  //* Update state while nothing is happening
76  void idleFunction(void);
77 
78  //* Change matrix using interpreted state
79  void updateMatrix(void);
80 
81  //* adjustment based on distance from object
82  Real zoomscalar(void);
83 
84  WindowEvent m_event;
85  U32 m_keyCount[WindowEvent::e_keyUsed];
86  U32 m_keyMax[WindowEvent::e_keyUsed];
87  I32 m_mouseState[MOUSEMODES];
88  Real m_fMouse[MOUSEMODES];
89  Real m_dfMouse[MOUSEMODES];
90  Real m_dfJoy[MOUSEMODES];
91  Real m_mouseScale[MOUSEMODES];
92  Real m_modelScale;
93  BWORD m_rotationLock;
94  BWORD m_closeEvent;
95  BWORD m_leftRight;
96  BWORD m_alted;
97  BWORD m_ctrled;
98  BWORD m_shifted;
99  U32 m_indexX;
100  U32 m_indexY;
101 
102  sp<CameraEditable> m_spCameraCore;
103  sp<CameraI> m_spCameraCustom;
104  SpatialTransform m_cameraMatrix;
105  SpatialTransform m_interestMatrix;
106  SpatialTransform m_auxillaryMatrix;
107 
108  SpatialVector m_vertical;
109 
110  PathAccessor<SpatialTransform> m_paPerspMatrix;
111 };
112 
113 } /* namespace ext */
114 } /* namespace fe */
115 
116 #endif /* __viewer_InspectController_h__ */
virtual const SpatialTransform & auxillaryMatrix(void) const
Secondary point of significance.
Definition: InspectController.h:40
Viewpoint controller for detailed inspection of a single object.
Definition: InspectController.h:22
kernel
Definition: namespace.dox:3
virtual const SpatialTransform & interestMatrix(void) const
Transform to center of interest.
Definition: InspectController.h:37
Interface to handle signals from an SignalerI.
Definition: HandlerI.h:22
Generalized windowing event.
Definition: WindowEvent.h:43
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Viewpoint controller for a Viewer.
Definition: CameraControllerI.h:20
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192