Carna  Version 3.0.1
Viewport.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 - 2015 Leonid Kostrykin
3  *
4  * Chair of Medical Engineering (mediTEC)
5  * RWTH Aachen University
6  * Pauwelsstr. 20
7  * 52074 Aachen
8  * Germany
9  *
10  */
11 
12 #ifndef VIEWPORT_H_6014714286
13 #define VIEWPORT_H_6014714286
14 
15 #include <Carna/Carna.h>
16 #include <Carna/base/noncopyable.h>
17 
22 namespace Carna
23 {
24 
25 namespace base
26 {
27 
28 
29 
30 // ----------------------------------------------------------------------------------
31 // Viewport
32 // ----------------------------------------------------------------------------------
33 
48 class CARNA_LIB Viewport
49 {
50 
52 
53  struct Details;
54  const std::unique_ptr< Details > pimpl;
55 
56 public:
57 
61  Viewport( unsigned int rootWidth, unsigned int rootHeight, bool fitSquare );
62 
65  explicit Viewport( const Framebuffer& );
66 
70  Viewport( const Viewport& parent, unsigned int left, unsigned int top, unsigned int width, unsigned int height );
71 
75  ~Viewport();
76 
81  void makeActive() const;
82 
86  bool isActive() const;
87 
93  void done() const;
94 
95  void setWidth ( unsigned int );
96  void setHeight( unsigned int );
97 
98  void setMarginLeft( unsigned int );
99  void setMarginTop ( unsigned int );
100 
101  unsigned int width() const;
102  unsigned int height() const;
103 
104  unsigned int parentWidth () const;
105  unsigned int parentHeight() const;
106 
107  unsigned int marginLeft () const;
108  unsigned int marginTop () const;
109  unsigned int marginRight () const;
110  unsigned int marginBottom() const;
111 
112 }; // Viewport
113 
114 
115 
116 } // namespace Carna :: base
117 
118 } // namespace Carna
119 
120 #endif // VIEWPORT_H_6014714286
Defines a rendering viewport. The viewport is a property of the current OpenGL context.
Definition: Viewport.h:48
Maintains a framebuffer object that supports up to 8 color components simultaneously.
Definition: Framebuffer.h:49
#define NON_COPYABLE
Features class it is placed in as non-copyable.
Definition: noncopyable.h:109