diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-03-19 19:59:10 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-03-19 19:59:10 (GMT) |
commit | c60eec16458a41c3185c09abdc6ec23174ae4859 (patch) | |
tree | 67e93353834a31e489f0edab4f5028882b39131a /tksao | |
parent | fac94d1e0c1313892a0b3578e875300139f52272 (diff) | |
download | blt-c60eec16458a41c3185c09abdc6ec23174ae4859.zip blt-c60eec16458a41c3185c09abdc6ec23174ae4859.tar.gz blt-c60eec16458a41c3185c09abdc6ec23174ae4859.tar.bz2 |
clean up macosx code supporting fill
Diffstat (limited to 'tksao')
-rw-r--r-- | tksao/frame/baseellipse.C | 88 | ||||
-rw-r--r-- | tksao/frame/baseellipse.h | 6 | ||||
-rw-r--r-- | tksao/frame/circle.C | 24 | ||||
-rw-r--r-- | tksao/frame/circle.h | 6 | ||||
-rw-r--r-- | tksao/frame/ellipse.C | 24 | ||||
-rw-r--r-- | tksao/frame/ellipse.h | 6 |
6 files changed, 53 insertions, 101 deletions
diff --git a/tksao/frame/baseellipse.C b/tksao/frame/baseellipse.C index 6e5ce53..f80c5b0 100644 --- a/tksao/frame/baseellipse.C +++ b/tksao/frame/baseellipse.C @@ -357,6 +357,20 @@ void BaseEllipse::renderPS(int mode) { renderPSEllipse(mode); } +void BaseEllipse::renderPSDraw() +{ + ostringstream str; + str << "stroke" << endl << ends; + Tcl_AppendResult(parent->interp, str.str().c_str(), NULL); +} + +void BaseEllipse::renderPSFill() +{ + ostringstream str; + str << "fill" << endl << ends; + Tcl_AppendResult(parent->interp, str.str().c_str(), NULL); +} + void BaseEllipse::renderPSCircle(int mode) { renderPSGC(mode); @@ -365,6 +379,12 @@ void BaseEllipse::renderPSCircle(int mode) double ang = calcAngle(); for (int ii=0; ii<numAnnuli_; ii++) { + { + ostringstream str; + str << "newpath" << endl << ends; + Tcl_AppendResult(parent->interp, str.str().c_str(), NULL); + } + Vector r = annuli_[ii]; Vector ur = fwdMap(r,Coord::CANVAS); @@ -382,31 +402,17 @@ void BaseEllipse::renderPSCircle(int mode) if (a2<=a1) a2 += 360; - renderPSCircleDraw(cc, l, a1, a2); - } -} - -void BaseEllipse::renderPSCircleDraw(Vector& cc, double l, float a1, float a2) -{ - ostringstream str; - str << "newpath " - << cc.TkCanvasPs(parent->canvas) << ' ' - << l << ' ' - << a1 << ' ' << a2 << ' ' - << "arc stroke" << endl << ends; - Tcl_AppendResult(parent->interp, str.str().c_str(), NULL); -} + { + ostringstream str; + str << cc.TkCanvasPs(parent->canvas) << ' ' + << l << ' ' + << a1 << ' ' << a2 << ' ' + << "arc" << endl << ends; + Tcl_AppendResult(parent->interp, str.str().c_str(), NULL); + } -void BaseEllipse::renderPSCircleFillDraw(Vector& cc, double l, - float a1, float a2) -{ - ostringstream str; - str << "newpath " - << cc.TkCanvasPs(parent->getCanvas()) << ' ' - << l << ' ' - << a1 << ' ' << a2 << ' ' - << "arc fill" << endl << ends; - Tcl_AppendResult(parent->interp, str.str().c_str(), NULL); + renderPSDraw(); + } } void BaseEllipse::renderPSEllipse(int mode) @@ -442,24 +448,10 @@ void BaseEllipse::renderPSEllipse(int mode) s1=s2=0; } - renderPSEllipseDraw(); + renderPSDraw(); } } -void BaseEllipse::renderPSEllipseDraw() -{ - ostringstream str; - str << "stroke" << endl << ends; - Tcl_AppendResult(parent->interp, str.str().c_str(), NULL); -} - -void BaseEllipse::renderPSEllipseFillDraw() -{ - ostringstream str; - str << "fill" << endl << ends; - Tcl_AppendResult(parent->interp, str.str().c_str(), NULL); -} - void BaseEllipse::renderPSEllipsePrep(double a1, double a2, double b1, double b2, Vector& rr) @@ -560,6 +552,8 @@ void BaseEllipse::renderMACOSXCircle() double ang = calcAngle(); for (int ii=0; ii<numAnnuli_; ii++) { + macosxNewPath(); + Vector r = annuli_[ii]; Vector ur = fwdMap(r,Coord::CANVAS); @@ -574,14 +568,15 @@ void BaseEllipse::renderMACOSXCircle() if (a2<=a1) a2 += M_TWOPI; - renderMACOSXCircleDraw(cc, l, a1, a2); + macosxArc(cc, l, a1, a2); + + renderMACOSXDraw(); } } -void BaseEllipse::renderMACOSXCircleDraw(Vector& cc, double l, - float a1, float a2) +void BaseEllipse::renderMACOSXDraw() { - macosxDrawArc(cc, l, a1, a2); + macosxStroke(); } void BaseEllipse::renderMACOSXEllipse() @@ -614,16 +609,11 @@ void BaseEllipse::renderMACOSXEllipse() if (s1&&s2) s1=s2=0; - renderMACOSXEllipseDraw(); + renderMACOSXDraw(); } } } -void BaseEllipse::renderMACOSXEllipseDraw() -{ - macosxStroke(); -} - void BaseEllipse::renderMACOSXEllipsePrep(double a1, double a2, double b1, double b2, Vector& rr) diff --git a/tksao/frame/baseellipse.h b/tksao/frame/baseellipse.h index 6d525f4..a7c88b2 100644 --- a/tksao/frame/baseellipse.h +++ b/tksao/frame/baseellipse.h @@ -56,10 +56,8 @@ class BaseEllipse : public BaseMarker { void renderXEllipseDashDraw(Drawable, GC); void renderPS(int); - virtual void renderPSCircleDraw(Vector& cc, double l, float a1, float a2); - void renderPSCircleFillDraw(Vector& cc, double l, float a1, float a2); - virtual void renderPSEllipseDraw(); - void renderPSEllipseFillDraw(); + virtual void renderPSDraw(); + void renderPSFill(); #ifdef MAC_OSX_TK void renderMACOSX(); diff --git a/tksao/frame/circle.C b/tksao/frame/circle.C index 02cfe40..4b9dad2 100644 --- a/tksao/frame/circle.C +++ b/tksao/frame/circle.C @@ -78,32 +78,16 @@ void Circle::renderXEllipseDraw(Drawable drawable, GC lgc) renderXEllipseDashDraw(drawable, lgc); } -void Circle::renderPSCircleDraw(Vector& cc, double l, float a1, float a2) +void Circle::renderPSDraw() { if (fill_) - BaseEllipse::renderPSCircleFillDraw(cc, l, a1, a2); + BaseEllipse::renderPSFill(); else - BaseEllipse::renderPSCircleDraw(cc, l, a1, a2); -} - -void Circle::renderPSEllipseDraw() -{ - if (fill_) - BaseEllipse::renderPSEllipseFillDraw(); - else - BaseEllipse::renderPSEllipseDraw(); + BaseEllipse::renderPSDraw(); } #ifdef MAC_OSX_TK -void Circle::renderMACOSXCircleDraw(Vector& cc, double l, float a1, float a2) -{ - if (fill_) - macosxFillArc(cc, l, a1, a2); - else - macosxDrawArc(cc, l, a1, a2); -} - -void Circle::renderMACOSXEllipseDraw() +void Circle::renderMACOSXDraw() { if (fill_) macosxFill(); diff --git a/tksao/frame/circle.h b/tksao/frame/circle.h index c6e6bb6..eaec029 100644 --- a/tksao/frame/circle.h +++ b/tksao/frame/circle.h @@ -15,12 +15,10 @@ class Circle : public BaseEllipse { void renderXCircleDraw(Drawable, GC, Vector&, Vector&, int, int); void renderXEllipseDraw(Drawable, GC); - void renderPSCircleDraw(Vector& cc, double l, float a1, float a2); - void renderPSEllipseDraw(); + void renderPSDraw(); #ifdef MAC_OSX_TK - void renderMACOSXCircleDraw(Vector&, double, float, float); - void renderMACOSXEllipseDraw(); + void renderMACOSXDraw(); #endif #ifdef __WIN32 diff --git a/tksao/frame/ellipse.C b/tksao/frame/ellipse.C index 1c887fc..34069a4 100644 --- a/tksao/frame/ellipse.C +++ b/tksao/frame/ellipse.C @@ -66,32 +66,16 @@ void Ellipse::renderXEllipseDraw(Drawable drawable, GC lgc) renderXEllipseDashDraw(drawable, lgc); } -void Ellipse::renderPSCircleDraw(Vector& cc, double l, float a1, float a2) +void Ellipse::renderPSDraw() { if (fill_) - BaseEllipse::renderPSCircleFillDraw(cc, l, a1, a2); + BaseEllipse::renderPSFill(); else - BaseEllipse::renderPSCircleDraw(cc, l, a1, a2); -} - -void Ellipse::renderPSEllipseDraw() -{ - if (fill_) - BaseEllipse::renderPSEllipseFillDraw(); - else - BaseEllipse::renderPSEllipseDraw(); + BaseEllipse::renderPSDraw(); } #ifdef MAC_OSX_TK -void Ellipse::renderMACOSXCircleDraw(Vector& cc, double l, float a1, float a2) -{ - if (fill_) - macosxFillArc(cc, l, a1, a2); - else - macosxDrawArc(cc, l, a1, a2); -} - -void Ellipse::renderMACOSXEllipseDraw() +void Ellipse::renderMACOSXDraw() { if (fill_) macosxFill(); diff --git a/tksao/frame/ellipse.h b/tksao/frame/ellipse.h index 44cbdec..c40a32f 100644 --- a/tksao/frame/ellipse.h +++ b/tksao/frame/ellipse.h @@ -15,12 +15,10 @@ class Ellipse : public BaseEllipse { void renderXCircleDraw(Drawable, GC, Vector&, Vector&, int, int); void renderXEllipseDraw(Drawable, GC); - void renderPSCircleDraw(Vector& cc, double l, float a1, float a2); - void renderPSEllipseDraw(); + void renderPSDraw(); #ifdef MAC_OSX_TK - void renderMACOSXCircleDraw(Vector&, double, float, float); - void renderMACOSXEllipseDraw(); + void renderMACOSXDraw(); #endif #ifdef __WIN32 |