1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _TESTWINDOW_H_
40 #define _TESTWINDOW_H_
45 #include <OpenSG/OSGConfig.h>
46 #include <OpenSG/OSGMatrix.h>
47 #include <OpenSG/OSGNode.h>
48 #include <OpenSG/OSGGLUTWindow.h>
49 #include <OpenSG/OSGSimpleSceneManager.h>
50 #include <OpenSG/OSGPerspectiveCamera.h>
51 #include <OpenSG/OSGImage.h>
52 #include <OpenSG/OSGGrabForeground.h>
58 /*========================== PUBLIC =================================*/
65 void setSize(OSG::UInt16 width
, OSG::UInt16 height
);
66 void setFullscreen(void);
68 void setViewport(OSG::Real32 left
, OSG::Real32 right
,
69 OSG::Real32 bottom
, OSG::Real32 top
);
71 inline OSG::UInt16
getWidth (void);
72 inline OSG::UInt16
getHeight(void);
74 inline OSG::PerspectiveCameraPtr
getCamera(void);
76 inline OSG::NodePtr
getScene(void );
77 inline void setScene(OSG::NodePtr root
);
78 inline void setScene(NodeBase
&root
);
80 void setCamera(OSG::Matrix mat
);
81 void setCamera(OSG::Real32 fromx
, OSG::Real32 fromy
, OSG::Real32 fromz
,
82 OSG::Real32 atx
, OSG::Real32 aty
, OSG::Real32 atz
,
83 OSG::Real32 upx
, OSG::Real32 upy
, OSG::Real32 upz
);
85 void setNearFar(OSG::Real32 n
, OSG::Real32 f
);
86 void setFov(OSG::Real32 fov
);
93 OSG::ImagePtr
snapshot(void);
97 inline bool isOpen(void);
99 inline OSG::SimpleSceneManager
*getSSM(void);
100 inline OSG::WindowPtr
getWindow(void);
102 /*========================= PROTECTED ===============================*/
107 /*========================== PRIVATE ================================*/
110 OSG::Int16 _width
, _height
;
111 OSG::Real32 _left
, _right
, _bottom
, _top
;
113 OSG::GLUTWindowPtr _window
;
114 OSG::SimpleSceneManager
*_ssm
;
115 OSG::Real32 _near
, _far
, _fov
;
116 OSG::TransformPtr _beacon
;
117 OSG::GrabForegroundPtr _grabber
;
123 #include "TestWindow.inl"