[Thplot-cvs] CVS: thplot/src/Draw Curve.cpp,1.4,1.5 Symbol.h,1.1,1.2 Curve.h,1.4,1.5
Status: Pre-Alpha
Brought to you by:
apeden
From: Tony P. <ap...@us...> - 2002-07-08 11:20:18
|
Update of /cvsroot/thplot/thplot/src/Draw In directory usw-pr-cvs1:/tmp/cvs-serv14363 Modified Files: Curve.cpp Symbol.h Curve.h Log Message: Change symbol and line style assignment logic so that the line style is not incremented until all symbol types have been exhausted. Add api for getting/setting line and symbol types. Index: Curve.cpp =================================================================== RCS file: /cvsroot/thplot/thplot/src/Draw/Curve.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Curve.cpp 6 Jul 2002 14:49:40 -0000 1.4 --- Curve.cpp 8 Jul 2002 11:20:15 -0000 1.5 *************** *** 37,41 **** symbols_on=true; lstyle=solid; ! //lstyle=linestyles(index % Nstyles); symbols = new Symbol(SymbolType(index % NSymbolTypes),false); xthreshold=2;ythreshold=5; --- 37,43 ---- symbols_on=true; lstyle=solid; ! //only increment the line style after all symbol types have ! //been used ! lstyle=LineStyle( int(index / NSymbolTypes) % Nstyles ); symbols = new Symbol(SymbolType(index % NSymbolTypes),false); xthreshold=2;ythreshold=5; *************** *** 74,78 **** glEnable(GL_LINE_STIPPLE); glLineStipple(1,lsmask[lstyle]); ! glLineWidth(2); } --- 76,80 ---- glEnable(GL_LINE_STIPPLE); glLineStipple(1,lsmask[lstyle]); ! glLineWidth(1); } Index: Symbol.h =================================================================== RCS file: /cvsroot/thplot/thplot/src/Draw/Symbol.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Symbol.h 6 Jul 2002 14:49:40 -0000 1.1 --- Symbol.h 8 Jul 2002 11:20:15 -0000 1.2 *************** *** 40,44 **** ~Symbol(void); ! void setType(SymbolType type) { stype=type; regen=true; } SymbolType getType(void) { return stype; } --- 40,45 ---- ~Symbol(void); ! void setType(SymbolType type) ! { stype= SymbolType(type % NSymbolTypes); regen=true; } SymbolType getType(void) { return stype; } Index: Curve.h =================================================================== RCS file: /cvsroot/thplot/thplot/src/Draw/Curve.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Curve.h 6 Jul 2002 14:49:40 -0000 1.4 --- Curve.h 8 Jul 2002 11:20:15 -0000 1.5 *************** *** 34,39 **** #include <Draw/Grid.h> ! typedef enum { solid, dash, dashdotdash } linestyles; ! const int lsmask[] = { 0x7fff, 0xF0F0, 0x1C47, 0x33cf }; const int Nstyles = 4; --- 34,39 ---- #include <Draw/Grid.h> ! typedef enum { solid, dash, dashdot, dashdashdot } LineStyle; ! const int lsmask[] = { 0x7fff, 0xf0f0, 0x1c47, 0x33cf }; const int Nstyles = 4; *************** *** 53,56 **** --- 53,62 ---- float getSymbolDrawYThreshold( void ) { return ythreshold; } + LineStyle getLineType(void) { return lstyle; } + SymbolType getSymbolType(void) { return symbols->getType(); } + + void setLineType(LineStyle ls) { lstyle = LineStyle(ls % Nstyles); } + void setSymbolType(SymbolType st) { symbols->setType(st); } + bool DrawGL(void); *************** *** 63,67 **** string ind_pname, dep_pname; bool lines_on, symbols_on; ! linestyles lstyle; float xthreshold,ythreshold; }; --- 69,73 ---- string ind_pname, dep_pname; bool lines_on, symbols_on; ! LineStyle lstyle; float xthreshold,ythreshold; }; |