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 #include <G3Globals.h>
00043 #include <fstream.h>
00044
00045 #include <View.h>
00046 #include <Projection.h>
00047 #include <Clipping.h>
00048 #include <Viewport.h>
00049 #include <ScanLineConverter.h>
00050 #include <Device.h>
00051 #include <FACE.h>
00052
00054 class X11Renderer : public Renderer
00055 {
00056 public:
00058 X11Renderer(char *title, int xLoc, int yLoc, int width, int height,
00059 ColorMap &theMap);
00061 X11Renderer(char *title, int xLoc, int yLoc, int width, int height,
00062 ColorMap &theMap, char *fileName);
00063
00065 virtual ~X11Renderer();
00066
00068 virtual int clearImage(void);
00070 virtual int startImage(void);
00072 virtual int doneImage(void);
00073
00075 virtual int drawPoint(const Vector &, float V1, int width = 1);
00077 virtual int drawPoint(const Vector &, const Vector &rgb1, int width = 1);
00078
00080 virtual int drawLine(const Vector &, const Vector &,
00081 float V1, float V2, int width = 1, int style = 1);
00082
00084 virtual int drawLine(const Vector &end1, const Vector &end2,
00085 const Vector &rgb1, const Vector &rgb2,
00086 int width = 1, int style = 1);
00087
00089 virtual int drawPolygon(const Matrix &points, const Vector &values);
00091 virtual int drawPolygon(const Matrix &points, const Matrix &rgbValues);
00092
00093
00094
00095
00096
00098 virtual int setVRP(float x, float y, float z);
00099 virtual int setVPN(float x, float y, float z);
00100 virtual int setVUP(float x, float y, float z);
00101
00103 virtual int setViewWindow(float, float, float, float);
00105
00106 virtual int setPlaneDist(float, float);
00108
00109 virtual int setProjectionMode(char *mode);
00110 virtual int setFillMode(char *);
00111
00112 virtual int setPRP(float u, float v, float n);
00113
00114
00116 virtual int setPortWindow(float, float, float, float);
00118
00119 virtual int drawText(const Vector &posGlobal, char *string, int length,
00120 char horizontalJustify = 'l', char verticalJustify = 'b');
00121
00122 protected:
00123
00125 int displayFace(FACE &);
00126
00128 View *theView;
00130 Projection *theProjection;
00132 Clipping *theClipping;
00134 Viewport *theViewport;
00136 ScanLineConverter *theScan;
00138 Device *theDevice;
00139
00140 private:
00142 int aFile;
00143 char theFileName[MAX_FILENAMELENGTH];
00144 ofstream theFile;
00145 };
00146
00147 #endif
00148
00149 ÿ