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_IMAGE ,
18 RAY_TRACE_VIDEO ,
19 WRITE_SCENE
20 };
21
23 static int _width , _height;
24
25 public:
27 const static char KEY_ESCAPE;
28
30 enum
31 {
32 // No culling
33 NO_CULL,
34 // Back-face culling
35 CULL_BACK_FACE,
36 // Front-face culling
37 CULL_FRONT_FACE
38 };
39
41 static Scene* scene;
42
44 static Mouse mouse;
45
47 static Util::Point3D center;
48
50 static double radius;
51
53 static bool isVisible;
54
56 static int frameCount;
57
59 static Util::Timer frameCountTimer;
60
62 static double frameRate;
63
65 static Util::Timer timer;
66
68 static int interpolationType;
69
71 static int parametrizationType;
72
74 static int PrintError( int showNoError=0 );
75
77 static void WriteLeftString( int x , int y , const std::string &str );
78
80 static void WriteRightString( int x , int y , const std::string &str );
81
83 static Image::Image32 TakeSnapshot( void );
84
86 static void IdleFunction( void );
87
89 static void VisibilityFunction( int state );
90
92 static void SetEvaluators( void );
93
95 // Mouse event handlers //
97
98 static void MouseFunction( int button, int state, int x, int y );
99
101 static void MotionFunction( int x, int y );
102
104 static void PassiveMotionFunction( int x, int y );
105
107 // Keyboard event handlers //
109
110 static void KeyboardFunction( unsigned char c, int x, int y );
111
113 static void SpecialFunction( int key , int x , int y );
114
116 // Menu event handlers //
118
119 static void DrawModeMenu( int entry );
120
122 static void CullModeMenu( int entry );
123
125 static void InterpolationTypeMenu( int entry );
126
128 static void ParametrizationTypeMenu( int entry );
129
131 static void MainMenu( int entry );
132
134 static void DisplayFunction( void );
135
137 static void ReshapeFunction( int width , int height );
138
141 static void View( Scene& scene , int width , int height );
142 };
143}
144#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:47
Ray::Window::mouse
static Mouse mouse
Definition window.h:44
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:41
Ray::Window::frameCountTimer
static Util::Timer frameCountTimer
Definition window.h:59
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:452
Ray::Window::NO_CULL
@ NO_CULL
Definition window.h:33
Ray::Window::CULL_BACK_FACE
@ CULL_BACK_FACE
Definition window.h:35
Ray::Window::CULL_FRONT_FACE
@ CULL_FRONT_FACE
Definition window.h:37
Ray::Window::IdleFunction
static void IdleFunction(void)
Definition window.cpp:163
Ray::Window::RAY_TRACE_IMAGE
@ RAY_TRACE_IMAGE
Definition window.h:17
Ray::Window::RAY_TRACE_VIDEO
@ RAY_TRACE_VIDEO
Definition window.h:18
Ray::Window::WRITE_SCENE
@ WRITE_SCENE
Definition window.h:19
Ray::Window::QUIT
@ QUIT
Definition window.h:16
Ray::Window::timer
static Util::Timer timer
Definition window.h:65
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:53
Ray::Window::KEY_ESCAPE
static const char KEY_ESCAPE
Definition window.h:27
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:71
Ray::Window::interpolationType
static int interpolationType
Definition window.h:68
Ray::Window::ReshapeFunction
static void ReshapeFunction(int width, int height)
Definition window.cpp:442
Ray::Window::_height
static int _height
Definition window.h:23
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::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:50
Ray::Window::DrawModeMenu
static void DrawModeMenu(int entry)
Definition window.cpp:260
Ray::Window::_width
static int _width
Definition window.h:23
Ray::Window::frameCount
static int frameCount
Definition window.h:56
Ray::Window::frameRate
static double frameRate
Definition window.h:62
Ray::Window::DisplayFunction
static void DisplayFunction(void)
Definition window.cpp:365
Ray::Window::PrintError
static int PrintError(int showNoError=0)
Definition window.cpp:40
Util::Timer
Definition timer.h:37
mouse.h
Ray
Definition box.h:7
Util::Point3D
Point< 3 > Point3D
Definition geometry.h:526
scene.h
timer.h