Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
View.hh
1 #ifndef __View_hh__
2 #define __View_hh__
3 
4 #include <bias_config.h>
5 
6 #ifndef BIAS_HAVE_OPENGL
7 # error You need BIAS with USE_OpenGL Please recompile BIAS.
8 #endif // BUILD_GLviewer
9 
10 #include "Scenes/SceneBase.hh"
11 #include "GLProjectionParametersInterface.hh"
12 #include <Base/Common/W32Compat.hh>
13 
14 #include <vector>
15 
16 
17 namespace BIAS {
18 
19  /**
20  * @brief A view is a rectangular part of a render context in which a set of scenes
21  * is rendered using a GLProjection.
22  * @author jkollmann
23  * @ingroup g_glviewer
24  */
25  class BIASGLviewer_EXPORT View {
26  public:
27  View();
28 
29  void SetViewport(int x, int y, int width, int height);
30  void SetClearColor(float red, float green, float blue, float alpha = 1.0f);
31 
32  /** Sets the GLProjection to be used for rendering this view.
33  Every GLProjection can only be added to one view! */
34  void SetGLProjectionParametersInterface(GLProjectionParametersInterface* camera);
35 
36  void SetBackgroundImageScene(SceneBGImage* bg);
37 
38  /** Appends a scene to the list of scenes to be rendered in this view.
39  Every scene can only be added to one view! */
40  void AppendScene(SceneBase* scene);
41 
42  /** Removes a scene from the list of scenes. */
43  void RemoveScene(SceneBase* scene);
44 
45  /** Inserts a scene to the given position in the list of scenes.
46  Every scene can only be added to one view!*/
47  void InsertSceneAt(SceneBase* scene, int index);
48 
49  /** Removes the scene with the given index. */
50  void RemoveSceneAt(SceneBase* scene, int index);
51 
52  int Render();
53 
54  private:
55  BIAS::Vector4<int> viewport_;
56  BIAS::Vector4<float> clearColor_;
58  std::vector<SceneBase*> scenes_;
59  SceneBGImage* backgroundImageScene_;
60  };
61 
62 
63 } // namespace BIAS
64 
65 #endif // __View_hh__
Scene that renders a background image behind all other scenes.
Definition: SceneBGImage.hh:42
Abstract interface class to handle changes in rendering parameters by controllers and in rendering co...
A view is a rectangular part of a render context in which a set of scenes is rendered using a GLProje...
Definition: View.hh:25
Base class for all scenes.
Definition: SceneBase.hh:68