Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AutoControl.hh
1 #ifndef __AutoControl_HH__
2 #define __AutoControl_HH__
3 
4 #include "ControlInterface.hh"
5 #include "TrackballControl.hh"
6 #include <GLviewer/RenderContextBase.hh>
7 #include <Base/Math/Vector3.hh>
8 
9 namespace BIAS {
10 
11  /**
12  \class AutoControl
13  \author cmenk
14  \ingroup g_glviewer
15  \brief class for camera movement in autopilot mode.
16  */
17  class BIASGLviewer_EXPORT AutoControl : public ControlInterface
18  {
19  public:
20  AutoControl();
21 
22  /**
23  * Initialisizes the autopilot.
24  */
25  void Init();
26 
27  /**
28  * Adds a defined pose to the autopilot at the end of PoseList_ F1
29  */
30  void AddPose(BIAS::Vector3<double> C, BIAS::Vector3<double> PoI,
32 
33  /**
34  * Adds the current pose of ControldObject to the autopilot at the
35  * end of PoseList_ F1
36  */
37  void AddPose();
38 
39  /**
40  * Goes to the next calculated pose. F2
41  */
42  int NextStep();
43 
44  /**
45  * Goes to the defined step and sector.
46  returns 0 for sucess, -1 if step or sector exceeds max
47  */
48  int GoTo(unsigned int step, unsigned int sector);
49 
50  /**
51  * Goes to the defined pose.
52  returns 0 for sucess, -1 if step or sector exceeds max
53  */
54  int GoToPose(int pose);
55 
56  unsigned int GetStep(){return Step_;};
57 
58  unsigned int GetSector(){return Sector_;};
59  unsigned int GetNumSectors(){return (unsigned int)PoseList_.size()-1;};
60 
61  /**
62  * Sets the autopilot to start point. F3
63  */
64  void Rewind();
65 
66  /**
67  * Deletes the last added pose and resets the autopilot F4
68  */
69  void DeleteLast();
70 
71  /**
72  * Deletes the defined pose and resets the autopilot F4
73  */
74  void DeletePose(int pose);
75 
76  /**
77  * Deletes all poses in PoseList_ and resets autopilot.
78  */
79  void DeleteAll();
80 
81  /**
82  * Handles special key events.
83  */
84  bool SpecialKeyPressed(int key);
85 
86  void SetContext(RenderContextBase* context);
87 
88  int SaveToFile(const std::string &file);
89 
90  int LoadFromFile(const std::string &file);
91 
92  unsigned int GetNumberOfSteps(){return NumberOfSteps_;};
93  void SetNumberOfSteps(unsigned int n){ NumberOfSteps_ = n;};
94 
95  void Activate() {Active_ = true;};
96  void Deactivate() {Active_ = false;};
97  bool IsActive() {return Active_;};
98  bool IsInitialized() {return PoseList_.size()>0;};
99  bool TimerExpired();
100 
101  protected:
102  struct CameraPose
103  {
107  };
108 
109  std::vector<CameraPose> PoseList_;
111 
115  double StepSizeC_;
116  double StepSizeUp_;
117  double StepSizePoI_;
118 
119  unsigned int NumberOfSteps_; // steps for every sector
120  unsigned int Step_;
121  unsigned int Sector_;
123 
124  bool Active_;
125  };
126 }//end of namespace
127 #endif
unsigned int GetNumberOfSteps()
Definition: AutoControl.hh:92
BIAS::Vector3< double > VecC_
Definition: AutoControl.hh:112
BIAS::Vector3< double > C
Definition: AutoControl.hh:104
unsigned int GetSector()
Definition: AutoControl.hh:58
std::vector< CameraPose > PoseList_
Definition: AutoControl.hh:109
unsigned int GetNumSectors()
Definition: AutoControl.hh:59
RenderContextBase * Context_
Definition: AutoControl.hh:110
class for camera movement in autopilot mode.
Definition: AutoControl.hh:17
BIAS::Vector3< double > VecPoI_
Definition: AutoControl.hh:114
void SetNumberOfSteps(unsigned int n)
Definition: AutoControl.hh:93
unsigned int GetStep()
Definition: AutoControl.hh:56
unsigned int Step_
Definition: AutoControl.hh:120
unsigned int Sector_
Definition: AutoControl.hh:121
Defines the common interface used for communication between rendering components. ...
BIAS::Vector3< double > up
Definition: AutoControl.hh:106
unsigned int NumberOfSteps_
Definition: AutoControl.hh:119
BIAS::Vector3< double > PoI
Definition: AutoControl.hh:105
BIAS::Vector3< double > VecUp_
Definition: AutoControl.hh:113
Base for all classes creating interface between GL and &quot;window manager&quot;.