SingleWindow 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #ifndef OSGVIEWER_SingleWindow
  14. #define OSGVIEWER_SingleWindow 1
  15. #include <osgViewer/View>
  16. namespace osgViewer {
  17. /** single camera on a single window.*/
  18. class OSGVIEWER_EXPORT SingleWindow : public ViewConfig
  19. {
  20. public:
  21. SingleWindow():_x(0),_y(0),_width(-1),_height(-1),_screenNum(0),_windowDecoration(true),_overrideRedirect(false) {}
  22. 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) {}
  23. 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) {}
  24. META_Object(osgViewer,SingleWindow);
  25. virtual void configure(osgViewer::View& view) const;
  26. void setX(int x) { _x = x; }
  27. int getX() const { return _x; }
  28. void setY(int y) { _y = y; }
  29. int getY() const { return _y; }
  30. void setWidth(int w) { _width = w; }
  31. int getWidth() const { return _width; }
  32. void setHeight(int h) { _height = h; }
  33. int getHeight() const { return _height; }
  34. void setScreenNum(unsigned int sn) { _screenNum = sn; }
  35. unsigned int getScreenNum() const { return _screenNum; }
  36. void setWindowDecoration(bool wd) { _windowDecoration = wd; }
  37. bool getWindowDecoration() const { return _windowDecoration; }
  38. void setOverrideRedirect(bool override) { _overrideRedirect = override; }
  39. bool getOverrideRedirect() const { return _overrideRedirect; }
  40. protected:
  41. int _x, _y, _width, _height;
  42. unsigned int _screenNum;
  43. bool _windowDecoration;
  44. bool _overrideRedirect;
  45. };
  46. }
  47. #endif