Carna Version 3.3.3
Loading...
Searching...
No Matches
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>
17
22namespace Carna
23{
24
25namespace base
26{
27
28
29
30// ----------------------------------------------------------------------------------
31// Viewport
32// ----------------------------------------------------------------------------------
33
48class CARNA_LIB Viewport
49{
50
52
53 struct Details;
54 const std::unique_ptr< Details > pimpl;
55
56public:
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
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
Represents an association.
Definition Association.h:45
Maintains a framebuffer object that supports up to 8 color components simultaneously.
Definition Framebuffer.h:50
Defines a rendering viewport. The viewport is a property of the current OpenGL context.
Definition Viewport.h:49
unsigned int marginTop() const
Tells viewport's top margin.
Viewport(const Framebuffer &)
void setHeight(unsigned int)
Sets viewport height.
void setMarginLeft(unsigned int)
Sets viewport left margin.
void done() const
Restores the previous viewport.
unsigned int marginRight() const
Tells viewport's right margin.
unsigned int parentHeight() const
Tells parent viewport's height.
void setWidth(unsigned int)
Sets viewport width.
bool isActive() const
Tells whether this viewport is currently active.
unsigned int marginLeft() const
Tells viewport's left margin.
void setMarginTop(unsigned int)
Sets viewport top margin.
unsigned int height() const
Tells viewport height.
Viewport(unsigned int rootWidth, unsigned int rootHeight, bool fitSquare)
Creates root viewport.
unsigned int parentWidth() const
Tells parent viewport's width.
void makeActive() const
Makes this viewport the active one of the current OpenGL context.
unsigned int width() const
Tells viewport width.
unsigned int marginBottom() const
Tells viewport's bottom margin.
~Viewport()
Restores the parent viewport if this viewport is still active.
Viewport(const Viewport &parent, unsigned int left, unsigned int top, unsigned int width, unsigned int height)
Derives viewport from parent.
#define NON_COPYABLE
Features class it is placed in as non-copyable.