openscenegraph
SingleWindow
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGVIEWER_SingleWindow
15#define OSGVIEWER_SingleWindow 1
16
17#include <osgViewer/View>
18
19namespace osgViewer {
20
21/** single camera on a single window.*/
22class OSGVIEWER_EXPORT SingleWindow : public ViewConfig
23{
24 public:
25
26 SingleWindow():_x(0),_y(0),_width(-1),_height(-1),_screenNum(0),_windowDecoration(true),_overrideRedirect(false) {}
27 SingleWindow(int x, int y, int width, int height, unsigned int screenNum=0):_x(x),_y(y),_width(width),_height(height),_screenNum(screenNum),_windowDecoration(true),_overrideRedirect(false) {}
28 SingleWindow(const SingleWindow& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):ViewConfig(rhs,copyop), _x(rhs._x),_y(rhs._y),_width(rhs._width),_height(rhs._height),_screenNum(rhs._screenNum),_windowDecoration(rhs._windowDecoration), _overrideRedirect(rhs._overrideRedirect) {}
29
30 META_Object(osgViewer,SingleWindow);
31
32 virtual void configure(osgViewer::View& view) const;
33
34 void setX(int x) { _x = x; }
35 int getX() const { return _x; }
36
37 void setY(int y) { _y = y; }
38 int getY() const { return _y; }
39
40 void setWidth(int w) { _width = w; }
41 int getWidth() const { return _width; }
42
43 void setHeight(int h) { _height = h; }
44 int getHeight() const { return _height; }
45
46 void setScreenNum(unsigned int sn) { _screenNum = sn; }
47 unsigned int getScreenNum() const { return _screenNum; }
48
49 void setWindowDecoration(bool wd) { _windowDecoration = wd; }
50 bool getWindowDecoration() const { return _windowDecoration; }
51
52 void setOverrideRedirect(bool override) { _overrideRedirect = override; }
53 bool getOverrideRedirect() const { return _overrideRedirect; }
54
55 protected:
56
57 int _x, _y, _width, _height;
58 unsigned int _screenNum;
59 bool _windowDecoration;
60 bool _overrideRedirect;
61};
62
63}
64
65#endif