00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <QtOpenGL>
00014
00015 #include "ucdriverex.h"
00016
00017 class GLDisplayListWidget;
00018
00019 #ifndef __GLDriverQtQt__
00020 #define __GLDriverQtQt__
00021
00022
00023 #define ENSUREMINMAX(A,B,MIN,MAX) MIN = (A < B) ? A : B;MAX = (A < B) ? B : A
00024 #define SETSCALE(MIN,MAX,SCALEVAR) SCALEVAR = MAX-MIN
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 class GLDriverQt : public UCdriverEx
00076 {
00077
00078 public:
00079
00080 GLDriverQt(int DisplayList);
00081 GLDriverQt();
00082
00083 GLuint getDisplayList(){return displayListIndex;};
00084 virtual ~GLDriverQt();
00085
00086
00087
00088
00089
00090 void start();
00091
00092
00093
00094 void clearFrame();
00095
00096 private :
00097
00098
00099
00100 GLDisplayListWidget* m_glWnd;
00101
00102
00103
00104 GLuint displayListIndex;
00105
00106
00107 unsigned int textBase;
00108
00109
00110 double m_dAlpha;
00111
00112
00113 double m_dXMin,m_dXMax;double m_dXScale;
00114
00115
00116 double m_dYMin,m_dYMax;double m_dYScale;
00117
00118
00119 double m_dZMin,m_dZMax;double m_dZScale;
00120
00121
00122 inline double NORMX(double x) { return (x*m_dXScale)+m_dXMin; }
00123
00124
00125 inline double NORMY(double y) { return (y*m_dYScale)+m_dYMin; }
00126
00127
00128 inline double NORMZ(double z) { return (z*m_dZScale)+m_dZMin; }
00129
00130
00131
00132
00133
00134
00135
00136
00137 inline void SetColor(unsigned int color,double* RGB);
00138
00139
00140
00141
00142
00143
00144 inline void SetStipple(unsigned int stipple,unsigned int user_pattern);
00145
00146
00147
00148
00149 void OpenList();
00150
00151
00152
00153 void CloseList();
00154
00155
00156
00157 void DeleteList();
00158
00159
00160
00161 public:
00162
00163 virtual void line(double x1,double y1, double x2,double y2, int dash_pattern,
00164 unsigned int user_pattern, double width, int color,double *RGB);
00165
00166
00167 virtual void lines(double* X,double* Y,long npoints, int dash_pattern,
00168 unsigned int user_pattern,double width,int color,double* RGB);
00169
00170
00171 virtual void point(double x,double y, char chr,const char *font,double size, int color,
00172 double *RGB);
00173
00174 virtual void points(double *X,double *Y,long npoints, char chr,const char* font,double dsize,
00175 int color,double *RGB);
00176
00177 virtual void text(
00178 double x,double y,const char* s,const char* font,double size,double rotation,
00179 double horiz_just,double vert_just,
00180 int color,double *RGB);
00181
00182
00183
00184 virtual void region(double *X, double *Y, long npoints, double *RGB)
00185 {
00186 return;
00187
00188 X = 0;
00189 Y = 0;
00190 npoints = 0;
00191 RGB = 0;
00192
00193 };
00194
00195 virtual void frame();
00196
00197
00198
00199 public:
00200
00201 virtual double alphaEx(double alpha=1.0)
00202 {
00203 double old = m_dAlpha;
00204 m_dAlpha = alpha;
00205 return old;
00206 }
00207
00208 virtual void lineEx(
00209 double x1,double y1,
00210 double x2,double y2,
00211 int dash_pattern,unsigned int user_pattern,
00212 double width,
00213 int color,double *RGB);
00214
00215 virtual void lineEx(
00216 double x1,double y1,double z1,
00217 double x2,double y2,double z2,
00218 int dash_pattern,unsigned int user_pattern,
00219 double width,
00220 int color,double *RGB);
00221
00222 virtual void linesEx(
00223 double* X,double* Y,long npoints,
00224 int dash_pattern,unsigned int user_pattern,
00225 double width,int color,double* RGB);
00226
00227 virtual void linesEx(
00228 double* X,double* Y,double* Z,long npoints,
00229 int dash_pattern,unsigned int user_pattern,
00230 double width,int color,double* RGB);
00231
00232 virtual void textEx(double x,double y,double z, double nx, double ny, double nz,
00233 const char* s,const char* font, double size, double rotation, double horiz_just,
00234 double vert_just, int color,double *RGB);
00235
00236 virtual void pointEx(
00237 double x,double y,
00238 char chr,const char* font,double size,
00239 int color,double* RGB);
00240
00241 virtual void pointEx(double x,double y,double z,char chr,const char* font,
00242 double size, int color,double* RGB);
00243
00244 protected :
00245
00246 void plotHText(double x, double y, const char *s, const char *font, double size,
00247 double rotation, double horiz_just, double vert_just, int color, double *rgb);
00248
00249 void plotHText(double x, double y, double z,
00250 double nx, double ny, double nz, const char *s, const char *font, double size,
00251 double rotation, double horiz_just, double vert_just, int color, double *rgb);
00252
00253 public :
00254
00255
00256
00257
00258
00259
00260 void SetGLDisplayListWidget(GLDisplayListWidget* a);
00261 };
00262
00263 #endif
00264
00265