[Thplot-cvs] CVS: thplot/src/Draw Grid.cpp,1.4,1.5 Curve.cpp,1.2,1.3 Curve.h,1.2,1.3
Status: Pre-Alpha
Brought to you by:
apeden
From: Tony P. <ap...@us...> - 2002-07-04 15:53:30
|
Update of /cvsroot/thplot/thplot/src/Draw In directory usw-pr-cvs1:/tmp/cvs-serv21175 Modified Files: Grid.cpp Curve.cpp Curve.h Log Message: Added support for drawing curves with different line styles. Index: Grid.cpp =================================================================== RCS file: /cvsroot/thplot/thplot/src/Draw/Grid.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Grid.cpp 2 Jul 2002 17:20:42 -0000 1.4 --- Grid.cpp 4 Jul 2002 15:53:26 -0000 1.5 *************** *** 119,122 **** --- 119,123 ---- void Grid::drawGridLines(void) { if( independent ) { + glLineWidth(1); glColor3f(0.5,0.5,0.5); if( indep_major_gridlines ) { *************** *** 142,145 **** --- 143,147 ---- if( dependent ) { + glLineWidth(1); glColor3f(0.5,0.5,0.5); if( dep_major_gridlines ) { Index: Curve.cpp =================================================================== RCS file: /cvsroot/thplot/thplot/src/Draw/Curve.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Curve.cpp 2 Jul 2002 17:20:42 -0000 1.2 --- Curve.cpp 4 Jul 2002 15:53:26 -0000 1.3 *************** *** 33,37 **** index=idx; lines=true; ! symbols=true; }; --- 33,38 ---- index=idx; lines=true; ! symbols=false; ! lstyle=linestyles(index % Nstyles); }; *************** *** 62,66 **** if(lines) { ! glLineWidth(1); glColor3f(0,0,0); glBegin(GL_LINE_STRIP); --- 63,75 ---- if(lines) { ! if(lstyle == solid) { ! glDisable(GL_LINE_STIPPLE); ! glLineWidth(1); ! } else { ! glEnable(GL_LINE_STIPPLE); ! glLineStipple(1,lsmask[lstyle]); ! glLineWidth(2); ! } ! glColor3f(0,0,0); glBegin(GL_LINE_STRIP); Index: Curve.h =================================================================== RCS file: /cvsroot/thplot/thplot/src/Draw/Curve.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Curve.h 2 Jul 2002 17:20:42 -0000 1.2 --- Curve.h 4 Jul 2002 15:53:26 -0000 1.3 *************** *** 33,36 **** --- 33,41 ---- #include <Draw/Grid.h> + typedef enum { solid, dash, dashdotdash } linestyles; + const int lsmask[] = { 0x7fff, 0xF0F0, 0x1C47, 0x33cf }; + const int Nstyles = 4; + + class Curve { public: *************** *** 50,53 **** --- 55,59 ---- string ind_pname, dep_pname; bool lines, symbols; + linestyles lstyle; }; |