00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef PSDISPLAYDEVICE_H
00024 #define PSDISPLAYDEVICE_h
00025
00026 #include <stdio.h>
00027 #include "DepthSortObj.h"
00028 #include "DispCmds.h"
00029 #include "FileRenderer.h"
00030 #include "SortableArray.h"
00031
00033 class PSDisplayDevice : public FileRenderer {
00034 private:
00035 SortableArray <DepthSortObject> depth_list;
00036 float scaledEyePos[3];
00037 float x_scale, y_scale;
00038 float x_offset, y_offset;
00039
00041 int memerror;
00042
00044 void process_depth_list(void);
00045
00047 void set_sphere_res(int res);
00048
00050
00051
00052 void sphere_approx(float *c, float r);
00053 void cylinder_approx(float *a, float *b, float r, int res, int filled);
00054 void cone_approx(float *a, float *b, float r);
00055 void decompose_mesh(DispCmdTriMesh *mesh);
00056 void decompose_tristrip(DispCmdTriStrips *strip);
00058
00059 inline float compute_dist(float *c);
00060 float compute_light(float *a, float *b, float *c);
00061 float norm_light[3];
00062
00064
00065
00066 int sph_iter;
00067 int sph_desired_iter;
00068 int sph_nverts;
00069 float *sph_verts;
00071
00073
00074 long memusage;
00075 long points;
00076 long objects;
00078
00079 protected:
00080 virtual void comment(const char *s);
00081
00082 public:
00083 PSDisplayDevice(void);
00084 ~PSDisplayDevice(void);
00085 virtual void write_header(void);
00086 virtual void write_trailer(void);
00087
00092 virtual void render(const VMDDisplayList *display_list);
00093 virtual void render_done(void);
00094 };
00095
00096 #endif
00097