Assignments Assignments

window.h
Go to the documentation of this file.
1#ifndef RAY_WINDOW_INCLUDED
2#define RAY_WINDOW_INCLUDED
3
4#include <Util/timer.h>
5#include <Ray/mouse.h>
6#include <Ray/scene.h>
7
8 namespace Ray
9{
11 class Window
12 {
14 enum
15 {
16 QUIT ,
17 RAY_TRACE ,
18 WRITE_SCENE
19 };
20
22 static int _width , _height;
23
24 public:
26 const static char KEY_ESCAPE;
27
29 enum
30 {
31 // No culling
32 NO_CULL,
33 // Back-face culling
34 CULL_BACK_FACE,
35 // Front-face culling
36 CULL_FRONT_FACE
37 };
38
40 static Scene* scene;
41
43 static Mouse mouse;
44
46 static Util::Point3D center;
47
49 static double radius;
50
52 static bool isVisible;
53
55 static int frameCount;
56
58 static Util::Timer frameCountTimer;
59
61 static double frameRate;
62
64 static Util::Timer timer;
65
67 static int interpolationType;
68
70 static int parametrizationType;
71
73 static int PrintError( int showNoError=0 );
74
76 static void WriteLeftString( int x , int y , const std::string &str );
77
79 static void WriteRightString( int x , int y , const std::string &str );
80
82 static Image::Image32 TakeSnapshot( void );
83
85 static void IdleFunction( void );
86
88 static void VisibilityFunction( int state );
89
91 static void SetEvaluators( void );
92
94 // Mouse event handlers //
96
97 static void MouseFunction( int button, int state, int x, int y );
98
100 static void MotionFunction( int x, int y );
101
103 static void PassiveMotionFunction( int x, int y );
104
106 // Keyboard event handlers //
108
109 static void KeyboardFunction( unsigned char c, int x, int y );
110
112 static void SpecialFunction( int key , int x , int y );
113
115 // Menu event handlers //
117
118 static void DrawModeMenu( int entry );
119
121 static void CullModeMenu( int entry );
122
124 static void InterpolationTypeMenu( int entry );
125
127 static void ParametrizationTypeMenu( int entry );
128
130 static void MainMenu( int entry );
131
133 static void DisplayFunction( void );
134
136 static void ReshapeFunction( int width , int height );
137
140 static void View( Scene& scene , int width , int height );
141 };
142}
143#endif // RAY_WINDOW_INCLUDED
Image::Image32
Definition image.h:35
Ray::Mouse
Definition mouse.h:10
Ray::Scene
Definition scene.h:139
Ray::Window
Definition window.h:12
Ray::Window::center
static Util::Point3D center
Definition window.h:46
Ray::Window::mouse
static Mouse mouse
Definition window.h:43
Ray::Window::WriteLeftString
static void WriteLeftString(int x, int y, const std::string &str)
Definition window.cpp:73
Ray::Window::InterpolationTypeMenu
static void InterpolationTypeMenu(int entry)
Definition window.cpp:278
Ray::Window::scene
static Scene * scene
Definition window.h:40
Ray::Window::frameCountTimer
static Util::Timer frameCountTimer
Definition window.h:58
Ray::Window::TakeSnapshot
static Image::Image32 TakeSnapshot(void)
Definition window.cpp:137
Ray::Window::MotionFunction
static void MotionFunction(int x, int y)
Definition window.cpp:182
Ray::Window::KeyboardFunction
static void KeyboardFunction(unsigned char c, int x, int y)
Definition window.cpp:202
Ray::Window::View
static void View(Scene &scene, int width, int height)
Definition window.cpp:416
Ray::Window::IdleFunction
static void IdleFunction(void)
Definition window.cpp:163
Ray::Window::timer
static Util::Timer timer
Definition window.h:64
Ray::Window::WriteRightString
static void WriteRightString(int x, int y, const std::string &str)
Definition window.cpp:105
Ray::Window::MouseFunction
static void MouseFunction(int button, int state, int x, int y)
Definition window.cpp:180
Ray::Window::isVisible
static bool isVisible
Definition window.h:52
Ray::Window::KEY_ESCAPE
static const char KEY_ESCAPE
Definition window.h:26
Ray::Window::VisibilityFunction
static void VisibilityFunction(int state)
Definition window.cpp:171
Ray::Window::CullModeMenu
static void CullModeMenu(int entry)
Definition window.cpp:266
Ray::Window::parametrizationType
static int parametrizationType
Definition window.h:70
Ray::Window::interpolationType
static int interpolationType
Definition window.h:67
Ray::Window::ReshapeFunction
static void ReshapeFunction(int width, int height)
Definition window.cpp:406
Ray::Window::_height
static int _height
Definition window.h:22
Ray::Window::SpecialFunction
static void SpecialFunction(int key, int x, int y)
Definition window.cpp:228
Ray::Window::PassiveMotionFunction
static void PassiveMotionFunction(int x, int y)
Definition window.cpp:193
Ray::Window::MainMenu
static void MainMenu(int entry)
Definition window.cpp:293
Ray::Window::NO_CULL
@ NO_CULL
Definition window.h:32
Ray::Window::CULL_BACK_FACE
@ CULL_BACK_FACE
Definition window.h:34
Ray::Window::CULL_FRONT_FACE
@ CULL_FRONT_FACE
Definition window.h:36
Ray::Window::WRITE_SCENE
@ WRITE_SCENE
Definition window.h:18
Ray::Window::RAY_TRACE
@ RAY_TRACE
Definition window.h:17
Ray::Window::QUIT
@ QUIT
Definition window.h:16
Ray::Window::ParametrizationTypeMenu
static void ParametrizationTypeMenu(int entry)
Definition window.cpp:285
Ray::Window::SetEvaluators
static void SetEvaluators(void)
Definition window.cpp:113
Ray::Window::radius
static double radius
Definition window.h:49
Ray::Window::DrawModeMenu
static void DrawModeMenu(int entry)
Definition window.cpp:260
Ray::Window::_width
static int _width
Definition window.h:22
Ray::Window::frameCount
static int frameCount
Definition window.h:55
Ray::Window::frameRate
static double frameRate
Definition window.h:61
Ray::Window::DisplayFunction
static void DisplayFunction(void)
Definition window.cpp:329
Ray::Window::PrintError
static int PrintError(int showNoError=0)
Definition window.cpp:40
Util::Point< 3 >
Util::Timer
Definition timer.h:37
mouse.h
Ray
Definition box.h:7
scene.h
timer.h