| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
#ifndef _TESTWINDOW_H_ |
|---|
| 40 |
#define _TESTWINDOW_H_ |
|---|
| 41 |
#ifdef __sgi |
|---|
| 42 |
#pragma once |
|---|
| 43 |
#endif |
|---|
| 44 |
|
|---|
| 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> |
|---|
| 53 |
|
|---|
| 54 |
#include <Nodes.h> |
|---|
| 55 |
|
|---|
| 56 |
class TestWindow |
|---|
| 57 |
{ |
|---|
| 58 |
|
|---|
| 59 |
public: |
|---|
| 60 |
|
|---|
| 61 |
TestWindow(void); |
|---|
| 62 |
|
|---|
| 63 |
~TestWindow(); |
|---|
| 64 |
|
|---|
| 65 |
void setSize(OSG::UInt16 width, OSG::UInt16 height); |
|---|
| 66 |
void setFullscreen(void); |
|---|
| 67 |
|
|---|
| 68 |
void setViewport(OSG::Real32 left, OSG::Real32 right, |
|---|
| 69 |
OSG::Real32 bottom, OSG::Real32 top ); |
|---|
| 70 |
|
|---|
| 71 |
inline OSG::UInt16 getWidth (void); |
|---|
| 72 |
inline OSG::UInt16 getHeight(void); |
|---|
| 73 |
|
|---|
| 74 |
inline OSG::PerspectiveCameraPtr getCamera(void); |
|---|
| 75 |
|
|---|
| 76 |
inline OSG::NodePtr getScene(void ); |
|---|
| 77 |
inline void setScene(OSG::NodePtr root); |
|---|
| 78 |
inline void setScene(NodeBase &root); |
|---|
| 79 |
|
|---|
| 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); |
|---|
| 84 |
|
|---|
| 85 |
void setNearFar(OSG::Real32 n, OSG::Real32 f); |
|---|
| 86 |
void setFov(OSG::Real32 fov); |
|---|
| 87 |
|
|---|
| 88 |
void showAll(void); |
|---|
| 89 |
|
|---|
| 90 |
void finish(void); |
|---|
| 91 |
void redraw(void); |
|---|
| 92 |
|
|---|
| 93 |
OSG::ImagePtr snapshot(void); |
|---|
| 94 |
|
|---|
| 95 |
void open (void); |
|---|
| 96 |
void close (void); |
|---|
| 97 |
inline bool isOpen(void); |
|---|
| 98 |
|
|---|
| 99 |
inline OSG::SimpleSceneManager *getSSM(void); |
|---|
| 100 |
inline OSG::WindowPtr getWindow(void); |
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
protected: |
|---|
| 104 |
|
|---|
| 105 |
void update(void); |
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
private: |
|---|
| 109 |
|
|---|
| 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; |
|---|
| 118 |
|
|---|
| 119 |
bool _open; |
|---|
| 120 |
int _winid; |
|---|
| 121 |
}; |
|---|
| 122 |
|
|---|
| 123 |
#include "TestWindow.inl" |
|---|
| 124 |
|
|---|
| 125 |
#endif |
|---|