fixed: compile issue
[opensg.git] / Tools / osgBench / TestWindow.h
blob3f92c679aa92c89f65ea9b9bdb2da883a14c5c2b
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _TESTWINDOW_H_
40 #define _TESTWINDOW_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
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>
54 #include <Nodes.h>
56 class TestWindow
58 /*========================== PUBLIC =================================*/
59 public:
61 TestWindow(void);
63 ~TestWindow();
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);
88 void showAll(void);
90 void finish(void);
91 void redraw(void);
93 OSG::ImagePtr snapshot(void);
95 void open (void);
96 void close (void);
97 inline bool isOpen(void);
99 inline OSG::SimpleSceneManager *getSSM(void);
100 inline OSG::WindowPtr getWindow(void);
102 /*========================= PROTECTED ===============================*/
103 protected:
105 void update(void);
107 /*========================== PRIVATE ================================*/
108 private:
110 OSG::Int16 _width, _height;
111 OSG::Real32 _left, _right, _bottom, _top;
112 OSG::NodePtr _scene;
113 OSG::GLUTWindowPtr _window;
114 OSG::SimpleSceneManager *_ssm;
115 OSG::Real32 _near, _far, _fov;
116 OSG::TransformPtr _beacon;
117 OSG::GrabForegroundPtr _grabber;
119 bool _open;
120 int _winid;
123 #include "TestWindow.inl"
125 #endif