00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00022 #ifndef LIBTACHYONDISPLAYDEVICE
00023 #define LIBTACHYONDISPLAYDEVICE
00024
00025 #include <stdio.h>
00026 #include "FileRenderer.h"
00027 #include "tachyon.h"
00028 #include "WKFUtils.h"
00029
00031 class LibTachyonDisplayDevice : public FileRenderer {
00032 private:
00033 wkf_timerhandle trt_timer;
00034 #ifdef VMDMPI
00035 int parallel_group;
00036 #endif
00037 SceneHandle rtscene;
00038 int inclipgroup;
00039 int involtex;
00040 int voltexID;
00041 float xplaneeq[4];
00042 float yplaneeq[4];
00043 float zplaneeq[4];
00044 rt_timerhandle buildtime;
00045 rt_timerhandle rendertime;
00046
00047 void reset_vars(void);
00048 void * tex_cindexmaterial(int, int);
00049 void * tex_colormaterial(float *rgb, int);
00050 void write_camera(void);
00051 void write_lights(void);
00052 void write_materials(void);
00053
00054 protected:
00055
00056 void cylinder(float *, float *, float rad, int filled);
00057 void line(float *xyz1, float *xyz2);
00058 void point(float *xyz);
00059 void sphere(float *xyzr);
00060 virtual void sphere_array(int num, int res, float *centers, float *radii, float *colors);
00061 void text(float *pos, float size, float thickness, const char *str);
00062 void triangle(const float *, const float *, const float *,
00063 const float *, const float *, const float *);
00064 void tricolor(const float * xyz1, const float * xyz2, const float * xyz3,
00065 const float * n1, const float * n2, const float * n3,
00066 const float *c1, const float *c2, const float *c3);
00067 void tristrip(int numverts, const float *cnv, int numstrips,
00068 const int *vertsperstrip, const int *facets);
00069
00070
00071 virtual void define_volume_texture(int ID, int xs, int ys, int zs,
00072 const float *xplaneeq,
00073 const float *yplaneeq,
00074 const float *zplaneeq,
00075 unsigned char *texmap);
00076
00077
00078 virtual void volume_texture_on(int texmode);
00079
00080
00081 virtual void volume_texture_off(void);
00082
00083
00084
00085 void start_clipgroup(void);
00086 void end_clipgroup(void);
00087
00088 public:
00089 LibTachyonDisplayDevice(VMDApp *);
00090 virtual ~LibTachyonDisplayDevice(void);
00091 virtual int open_file(const char *filename);
00092 virtual void close_file(void);
00093 void write_header(void);
00094 void write_trailer(void);
00095 };
00096
00097 #endif
00098