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
8namespace Ray
9{
11 class Window
12 {
14 enum
15 {
20 };
21
23 static int _width , _height;
24
25 public:
27 const static char KEY_ESCAPE;
28
30 enum
31 {
32 // No culling
34 // Back-face culling
36 // Front-face culling
38 };
39
41 static Scene* scene;
42
44 static Mouse mouse;
45
48
50 static double radius;
51
53 static bool isVisible;
54
56 static int frameCount;
57
60
62 static double frameRate;
63
66
69
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
Definition image.h:35
Definition mouse.h:10
Definition scene.h:139
Definition window.h:12
static Util::Point3D center
Definition window.h:47
static Mouse mouse
Definition window.h:44
static void WriteLeftString(int x, int y, const std::string &str)
Definition window.cpp:73
static void InterpolationTypeMenu(int entry)
Definition window.cpp:278
static Scene * scene
Definition window.h:41
static Util::Timer frameCountTimer
Definition window.h:59
static Image::Image32 TakeSnapshot(void)
Definition window.cpp:137
static void MotionFunction(int x, int y)
Definition window.cpp:182
static void KeyboardFunction(unsigned char c, int x, int y)
Definition window.cpp:202
static void View(Scene &scene, int width, int height)
Definition window.cpp:452
@ NO_CULL
Definition window.h:33
@ CULL_BACK_FACE
Definition window.h:35
@ CULL_FRONT_FACE
Definition window.h:37
static void IdleFunction(void)
Definition window.cpp:163
@ RAY_TRACE_IMAGE
Definition window.h:17
@ RAY_TRACE_VIDEO
Definition window.h:18
@ WRITE_SCENE
Definition window.h:19
@ QUIT
Definition window.h:16
static Util::Timer timer
Definition window.h:65
static void WriteRightString(int x, int y, const std::string &str)
Definition window.cpp:105
static void MouseFunction(int button, int state, int x, int y)
Definition window.cpp:180
static bool isVisible
Definition window.h:53
static const char KEY_ESCAPE
Definition window.h:27
static void VisibilityFunction(int state)
Definition window.cpp:171
static void CullModeMenu(int entry)
Definition window.cpp:266
static int parametrizationType
Definition window.h:71
static int interpolationType
Definition window.h:68
static void ReshapeFunction(int width, int height)
Definition window.cpp:442
static int _height
Definition window.h:23
static void SpecialFunction(int key, int x, int y)
Definition window.cpp:228
static void PassiveMotionFunction(int x, int y)
Definition window.cpp:193
static void MainMenu(int entry)
Definition window.cpp:293
static void ParametrizationTypeMenu(int entry)
Definition window.cpp:285
static void SetEvaluators(void)
Definition window.cpp:113
static double radius
Definition window.h:50
static void DrawModeMenu(int entry)
Definition window.cpp:260
static int _width
Definition window.h:23
static int frameCount
Definition window.h:56
static double frameRate
Definition window.h:62
static void DisplayFunction(void)
Definition window.cpp:365
static int PrintError(int showNoError=0)
Definition window.cpp:40
Definition timer.h:37
Definition box.h:7
Point< 3 > Point3D
Definition geometry.h:526