00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef X11Renderer_h
00039 #define X11Renderer_h
00040
00041 #include <Renderer.h>
00042
00043 class View;
00044 class Projection;
00045 class Clipping;
00046 class Viewport;
00047 class ScanLineConverter;
00048 class Device;
00049 class FACE;
00050
00051 #include <fstream>
00052 using std::ofstream;
00053
00054 class X11Renderer : public Renderer
00055 {
00056 public:
00057 X11Renderer(const char *title, int xLoc, int yLoc, int width, int height,
00058 ColorMap &theMap);
00059 X11Renderer(const char *title, int xLoc, int yLoc, int width, int height,
00060 ColorMap &theMap, const char *fileName);
00061
00062 virtual ~X11Renderer();
00063
00064 virtual int clearImage(void);
00065 virtual int startImage(void);
00066 virtual int doneImage(void);
00067
00068 virtual int drawPoint(const Vector &, float V1, int width = 1);
00069 virtual int drawPoint(const Vector &, const Vector &rgb1, int width = 1);
00070
00071 virtual int drawLine(const Vector &, const Vector &,
00072 float V1, float V2, int width = 1, int style = 1);
00073
00074 virtual int drawLine(const Vector &end1, const Vector &end2,
00075 const Vector &rgb1, const Vector &rgb2,
00076 int width = 1, int style = 1);
00077
00078 virtual int drawPolygon(const Matrix &points, const Vector &values);
00079 virtual int drawPolygon(const Matrix &points, const Matrix &rgbValues);
00080
00081
00082
00083
00084
00085
00086 virtual int setVRP(float x, float y, float z);
00087 virtual int setVPN(float x, float y, float z);
00088 virtual int setVUP(float x, float y, float z);
00089
00090
00091 virtual int setViewWindow(float, float, float, float);
00092
00093
00094 virtual int setPlaneDist(float, float);
00095
00096
00097 virtual int setProjectionMode(const char *mode);
00098 virtual int setFillMode(const char *);
00099
00100 virtual int setPRP(float u, float v, float n);
00101
00102
00103
00104 virtual int setPortWindow(float, float, float, float);
00105
00106
00107 virtual int drawText(const Vector &posGlobal, char *string, int length,
00108 char horizontalJustify = 'l', char verticalJustify = 'b');
00109
00110 protected:
00111
00112 int displayFace(FACE &);
00113
00114 View *theView;
00115 Projection *theProjection;
00116 Clipping *theClipping;
00117 Viewport *theViewport;
00118 ScanLineConverter *theScan;
00119 Device *theDevice;
00120
00121 private:
00122 int aFile;
00123 char *theFileName;
00124 ofstream theFile;
00125 };
00126
00127 #endif
00128