00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MSL_RENDER_H
00020 #define MSL_RENDER_H
00021
00022 #include <stdlib.h>
00023 #include <stdio.h>
00024 #include <string.h>
00025
00026 #include "scene.h"
00027 #include "gui.h"
00028 #include "util.h"
00029
00030 class Gui;
00031
00032 #define RENDERCOLORS 10 // Number of colors
00033
00037
00054 class Render
00055 {
00056 protected:
00058 Scene *S;
00059
00062 virtual void SetCurrentAnimationFrame();
00063
00065 virtual void ShowCurrentAnimationFrame() {};
00066
00068 list<MSLVector> StateList;
00069
00071 list<double> TimeList;
00072
00073 list<string> EnvList;
00074 list<string> BodyList;
00075
00077 float RGBRed[RENDERCOLORS];
00078 float RGBGreen[RENDERCOLORS];
00079 float RGBBlue[RENDERCOLORS];
00080
00081 public:
00083 string FilePath;
00084
00086 list<MSLVector> FrameList;
00087
00089 double FrameTime;
00090
00092 float LastFrameTime;
00093
00095 float FrameStuckTime;
00096
00098 int NumFrames;
00099
00101 double AnimationStartPause;
00102
00104 double AnimationEndPause;
00105
00107 double AnimationTimeScale;
00108
00110 int AnimationFrameIndex;
00111
00113 MSLVector CurrentAnimationFrame;
00114
00116 bool AnimationActive;
00117
00120 bool ControlFreak;
00121
00123
00124
00126 bool RenderCtlWindowOn;
00127
00129 bool AttachedCameraOn;
00130
00132 bool BoundingBoxOn;
00133
00135 bool MultipleViewsOn;
00136
00138 bool ShowPathOn;
00139
00141 double AmbientLight;
00142
00143 Render();
00144 Render(string filepath);
00145 Render(Scene *s, string filepath);
00146 virtual ~Render() {}
00147
00149 virtual void Init();
00150
00152 virtual void HandleEvents() {};
00153
00155 virtual void MainLoop(Gui *g);
00156
00158 virtual void Reset();
00159
00161 virtual void Terminate() {};
00162
00164 virtual void SetFrameList();
00165
00167 virtual void MakeAnimationFrames(const list<MSLVector> &xlist, double deltat);
00168 virtual void MakeAnimationFrames(const list<MSLVector> &xlist,
00169 const list<double> &timelist);
00170
00172 virtual void DrawPath() {};
00173
00175 virtual void ButtonHandle(int b);
00176
00178 void SetScene(Scene *s);
00179
00181
00182 };
00183
00184 #endif