summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2020-03-13 21:03:50 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2020-03-13 21:03:50 (GMT)
commitb7344e9a22b4e5e1e51945c907962bf927375c65 (patch)
treebcaf59ce76548e06de50feef63d2e12c5b99fb79
parentbdf4cb8f92a397068ebb996312871813b3e7d231 (diff)
downloadblt-b7344e9a22b4e5e1e51945c907962bf927375c65.zip
blt-b7344e9a22b4e5e1e51945c907962bf927375c65.tar.gz
blt-b7344e9a22b4e5e1e51945c907962bf927375c65.tar.bz2
mv vector out from tksao
-rwxr-xr-xtksao/configure8
-rw-r--r--tksao/configure.ac8
-rw-r--r--tksao/frame/base.C8
-rw-r--r--tksao/frame/basebox.C8
-rw-r--r--tksao/frame/baseellipse.C14
-rw-r--r--tksao/frame/bpanda.C4
-rw-r--r--tksao/frame/compass.C12
-rw-r--r--tksao/frame/contour.C5
-rw-r--r--tksao/frame/cpanda.C4
-rw-r--r--tksao/frame/epanda.C4
-rw-r--r--tksao/frame/frame3dbase.C4
-rw-r--r--tksao/frame/line.C4
-rw-r--r--tksao/frame/marker.C10
-rw-r--r--tksao/frame/point.C50
-rw-r--r--tksao/frame/polygon.C4
-rw-r--r--tksao/frame/projection.C12
-rw-r--r--tksao/frame/ruler.C14
-rw-r--r--tksao/frame/segment.C4
-rw-r--r--tksao/frame/text.C3
-rw-r--r--tksao/util/gridbase.C6
-rw-r--r--tksao/util/util.C2
-rw-r--r--tksao/util/util.h1
-rw-r--r--tksao/widget/widget.C4
-rw-r--r--tksao/widget/widget.h1
-rw-r--r--vector/fuzzy.h (renamed from tksao/util/fuzzy.h)0
-rw-r--r--vector/vector.C (renamed from tksao/vector/vector.C)5
-rw-r--r--vector/vector.h (renamed from tksao/vector/vector.h)2
-rw-r--r--vector/vector3d.C (renamed from tksao/vector/vector3d.C)5
-rw-r--r--vector/vector3d.h (renamed from tksao/vector/vector3d.h)4
-rw-r--r--vector/vectorstr.C (renamed from tksao/vector/vectorstr.C)20
-rw-r--r--vector/vectorstr.h (renamed from tksao/vector/vectorstr.h)0
31 files changed, 119 insertions, 111 deletions
diff --git a/tksao/configure b/tksao/configure
index 7bb9348..c772089 100755
--- a/tksao/configure
+++ b/tksao/configure
@@ -5664,9 +5664,9 @@ util/grid3dbase.C
util/gridbase.C
util/ps.C
util/util.C
-vector/vector.C
-vector/vector3d.C
-vector/vectorstr.C
+../vector/vector.C
+../vector/vector3d.C
+../vector/vectorstr.C
widget/truecolor16.C
widget/truecolor24.C
widget/truecolor8.C
@@ -5718,7 +5718,7 @@ widget/widget.C
- vars="-I. -I./colorbar -I./fitsy++ -I./frame -I./list -I./magnifier -I./panner -I./util -I./vector -I./widget -I${prefix}/include"
+ vars="-I. -I./colorbar -I./fitsy++ -I./frame -I./list -I./magnifier -I./panner -I./util -I../vector -I./widget -I${prefix}/include"
for i in $vars; do
PKG_INCLUDES="$PKG_INCLUDES $i"
done
diff --git a/tksao/configure.ac b/tksao/configure.ac
index 1d588b1..a69c470 100644
--- a/tksao/configure.ac
+++ b/tksao/configure.ac
@@ -265,9 +265,9 @@ util/grid3dbase.C
util/gridbase.C
util/ps.C
util/util.C
-vector/vector.C
-vector/vector3d.C
-vector/vectorstr.C
+../vector/vector.C
+../vector/vector3d.C
+../vector/vectorstr.C
widget/truecolor16.C
widget/truecolor24.C
widget/truecolor8.C
@@ -275,7 +275,7 @@ widget/widget.C
])
TEA_ADD_HEADERS([])
-TEA_ADD_INCLUDES([-I. -I./colorbar -I./fitsy++ -I./frame -I./list -I./magnifier -I./panner -I./util -I./vector -I./widget -I${prefix}/include])
+TEA_ADD_INCLUDES([-I. -I./colorbar -I./fitsy++ -I./frame -I./list -I./magnifier -I./panner -I./util -I../vector -I./widget -I${prefix}/include])
TEA_ADD_LIBS([])
TEA_ADD_CFLAGS([])
TEA_ADD_STUB_SOURCES([])
diff --git a/tksao/frame/base.C b/tksao/frame/base.C
index bebc46b..73a130c 100644
--- a/tksao/frame/base.C
+++ b/tksao/frame/base.C
@@ -1037,14 +1037,14 @@ void Base::psCrosshair(PSColorSpace mode)
ostringstream str;
str << "newpath "
- << aa.TkCanvasPs(canvas) << ' '
+ << TkCanvasPs(aa) << ' '
<< "moveto "
- << bb.TkCanvasPs(canvas) << ' '
+ << TkCanvasPs(bb) << ' '
<< "lineto stroke" << endl
<< "newpath "
- << cc.TkCanvasPs(canvas) << ' '
+ << TkCanvasPs(cc) << ' '
<< "moveto "
- << dd.TkCanvasPs(canvas) << ' '
+ << TkCanvasPs(dd) << ' '
<< "lineto stroke" << endl << ends;
Tcl_AppendResult(interp, str.str().c_str(), NULL);
}
diff --git a/tksao/frame/basebox.C b/tksao/frame/basebox.C
index 3e51de3..79cb2ae 100644
--- a/tksao/frame/basebox.C
+++ b/tksao/frame/basebox.C
@@ -79,9 +79,9 @@ void BaseBox::renderPSDraw(int ii)
Vector v = parent->mapFromRef(vertices_[ii][jj],Coord::CANVAS);
if (jj==0)
str << "newpath "
- << v.TkCanvasPs(parent->canvas) << " moveto" << endl;
+ << parent->TkCanvasPs(v) << " moveto" << endl;
else
- str << v.TkCanvasPs(parent->canvas) << " lineto" << endl;
+ str << parent->TkCanvasPs(v) << " lineto" << endl;
}
str << "stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
@@ -94,9 +94,9 @@ void BaseBox::renderPSFillDraw(int ii)
Vector v = parent->mapFromRef(vertices_[ii][jj],Coord::CANVAS);
if (jj==0)
str << "newpath "
- << v.TkCanvasPs(parent->canvas) << " moveto" << endl;
+ << parent->TkCanvasPs(v) << " moveto" << endl;
else
- str << v.TkCanvasPs(parent->canvas) << " lineto" << endl;
+ str << parent->TkCanvasPs(v) << " lineto" << endl;
}
str << "fill" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
diff --git a/tksao/frame/baseellipse.C b/tksao/frame/baseellipse.C
index 07bc95b..2f84fb9 100644
--- a/tksao/frame/baseellipse.C
+++ b/tksao/frame/baseellipse.C
@@ -446,7 +446,7 @@ void BaseEllipse::renderPSCircle(PSColorSpace mode)
{
ostringstream str;
- str << cc.TkCanvasPs(parent->canvas) << ' '
+ str << parent->TkCanvasPs(cc) << ' '
<< l << ' '
<< a1 << ' ' << a2 << ' '
<< "arc" << endl << ends;
@@ -538,11 +538,11 @@ void BaseEllipse::renderPSEllipseArc(double a1, double a2, Vector& rr)
Vector tt1 = fwdMap(t1*FlipY(),Coord::CANVAS);
ostringstream str;
- str << tt0.TkCanvasPs(parent->canvas) << ' '
+ str << parent->TkCanvasPs(tt0) << ' '
<< "moveto "
- << xx1.TkCanvasPs(parent->canvas) << ' '
- << xx2.TkCanvasPs(parent->canvas) << ' '
- << tt1.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(xx1) << ' '
+ << parent->TkCanvasPs(xx2) << ' '
+ << parent->TkCanvasPs(tt1) << ' '
<< "curveto" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
}
@@ -562,9 +562,9 @@ void BaseEllipse::renderPSInclude(PSColorSpace mode)
ostringstream str;
str << "newpath "
- << r1.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(r1) << ' '
<< "moveto "
- << r2.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(r2) << ' '
<< "lineto stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
}
diff --git a/tksao/frame/bpanda.C b/tksao/frame/bpanda.C
index c8bdf21..e700eb0 100644
--- a/tksao/frame/bpanda.C
+++ b/tksao/frame/bpanda.C
@@ -110,9 +110,9 @@ void Bpanda::renderPS(PSColorSpace mode)
ostringstream str;
str << "newpath "
- << rr0.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(rr0) << ' '
<< "moveto "
- << rr1.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(rr1) << ' '
<< "lineto stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
}
diff --git a/tksao/frame/compass.C b/tksao/frame/compass.C
index 50fa2b4..ba6b71d 100644
--- a/tksao/frame/compass.C
+++ b/tksao/frame/compass.C
@@ -153,14 +153,14 @@ void Compass::renderPS(PSColorSpace mode)
{
ostringstream str;
str << "newpath "
- << aa.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(aa) << ' '
<< "moveto "
- << bb.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(bb) << ' '
<< "lineto stroke" << endl
<< "newpath "
- << aa.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(aa) << ' '
<< "moveto "
- << cc.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(cc) << ' '
<< "lineto stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
}
@@ -175,7 +175,7 @@ void Compass::renderPS(PSColorSpace mode)
if (northText) {
double angle = (bb-aa).angle();
- Vector ddd = dd.TkCanvasPs(parent->canvas);
+ Vector ddd = parent->TkCanvasPs(dd);
str << "gsave" << endl
<< "newpath " << endl
<< ddd << " moveto" << endl
@@ -216,7 +216,7 @@ void Compass::renderPS(PSColorSpace mode)
if (eastText) {
double angle = (cc-aa).angle();
- Vector eee = ee.TkCanvasPs(parent->canvas);
+ Vector eee = parent->TkCanvasPs(ee);
str << "gsave" << endl
<< "newpath " << endl
<< eee << " moveto" << endl
diff --git a/tksao/frame/contour.C b/tksao/frame/contour.C
index 14f0e94..0279cd3 100644
--- a/tksao/frame/contour.C
+++ b/tksao/frame/contour.C
@@ -224,11 +224,10 @@ void Contour::ps(PSColorSpace mode)
str << endl;
Vector v1 = base_->mapFromRef(lvertex_.current()->vector,Coord::CANVAS);
- str << "newpath " << endl
- << v1.TkCanvasPs(base_->canvas) << " moveto" << endl;
+ str << "newpath " << endl << parent_->parent_->TkCanvasPs(v1) << " moveto" << endl;
while (lvertex_.next()) {
Vector vv = base_->mapFromRef(lvertex_.current()->vector,Coord::CANVAS);
- str << vv.TkCanvasPs(base_->canvas) << " lineto" << endl;
+ str << parent_->parent_->TkCanvasPs(vv) << " lineto" << endl;
}
str << "stroke" << endl << ends;
Tcl_AppendResult(base_->interp, str.str().c_str(), NULL);
diff --git a/tksao/frame/cpanda.C b/tksao/frame/cpanda.C
index 2d9fcda..fff5c93 100644
--- a/tksao/frame/cpanda.C
+++ b/tksao/frame/cpanda.C
@@ -112,9 +112,9 @@ void Cpanda::renderPS(PSColorSpace mode)
ostringstream str;
str << "newpath "
- << rr0.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(rr0) << ' '
<< "moveto "
- << rr1.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(rr1) << ' '
<< "lineto stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
}
diff --git a/tksao/frame/epanda.C b/tksao/frame/epanda.C
index 980a3f8..0971951 100644
--- a/tksao/frame/epanda.C
+++ b/tksao/frame/epanda.C
@@ -110,9 +110,9 @@ void Epanda::renderPS(PSColorSpace mode)
ostringstream str;
str << "newpath "
- << rr0.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(rr0) << ' '
<< "moveto "
- << rr1.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(rr1) << ' '
<< "lineto stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
}
diff --git a/tksao/frame/frame3dbase.C b/tksao/frame/frame3dbase.C
index b924b6c..10192aa 100644
--- a/tksao/frame/frame3dbase.C
+++ b/tksao/frame/frame3dbase.C
@@ -580,8 +580,8 @@ void Frame3dBase::psLine(Vector& ss, Vector& tt, int dd)
str << "[] 0 setdash" << endl;
str << "newpath "
- << ss.TkCanvasPs(canvas) << " moveto" << endl
- << tt.TkCanvasPs(canvas) << " lineto stroke" << endl << ends;
+ << TkCanvasPs(ss) << " moveto" << endl
+ << TkCanvasPs(tt) << " lineto stroke" << endl << ends;
Tcl_AppendResult(interp, str.str().c_str(), NULL);
}
diff --git a/tksao/frame/line.C b/tksao/frame/line.C
index aed9fdb..1d069e2 100644
--- a/tksao/frame/line.C
+++ b/tksao/frame/line.C
@@ -83,9 +83,9 @@ void Line::renderPS(PSColorSpace mode)
ostringstream str;
str << "newpath "
- << aa.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(aa) << ' '
<< "moveto "
- << bb.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(bb) << ' '
<< "lineto stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
}
diff --git a/tksao/frame/marker.C b/tksao/frame/marker.C
index ab678a8..375846f 100644
--- a/tksao/frame/marker.C
+++ b/tksao/frame/marker.C
@@ -393,9 +393,9 @@ void Marker::renderPSInclude(PSColorSpace mode)
ostringstream str;
str << "newpath "
- << ll.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(ll) << ' '
<< "moveto "
- << ur.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(ur) << ' '
<< "lineto stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
}
@@ -414,7 +414,7 @@ void Marker::renderPSText(PSColorSpace mode)
<< " scalefont setfont" << endl;
Vector bbc = bbox.center();
- Vector tt = Vector(bbc[0], bbox.ll[1]).TkCanvasPs(parent->canvas);
+ Vector tt = parent->TkCanvasPs(Vector(bbc[0], bbox.ll[1]));
str << "gsave" << endl
<< "newpath " << endl
<< tt << " moveto" << endl
@@ -437,9 +437,9 @@ void Marker::renderPSArrow(const Vector& p1, const Vector& p2,
Vector* vv = arrow(p1,p2,sys);
ostringstream str;
str << "newpath " << endl
- << vv[0].TkCanvasPs(parent->canvas) << " moveto" << endl;
+ << parent->TkCanvasPs(vv[0]) << " moveto" << endl;
for (int ii=1; ii<6; ii++)
- str << vv[ii].TkCanvasPs(parent->canvas) << " lineto" << endl;
+ str << parent->TkCanvasPs(vv[ii]) << " lineto" << endl;
str << "closepath fill" << endl << ends;
Tcl_AppendResult(parent->interp, (char*)str.str().c_str(), NULL);
delete [] vv;
diff --git a/tksao/frame/point.C b/tksao/frame/point.C
index c2e0bf3..e8784e2 100644
--- a/tksao/frame/point.C
+++ b/tksao/frame/point.C
@@ -171,13 +171,13 @@ void Point::renderPS(PSColorSpace mode)
case DIAMOND:
vv = generateDiamond(Coord::CANVAS);
str << "newpath "
- << vv[0].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[0]) << ' '
<< "moveto "
- << vv[1].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[1]) << ' '
<< "lineto "
- << vv[2].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[2]) << ' '
<< "lineto "
- << vv[3].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[3]) << ' '
<< "lineto "
<< "closepath stroke" << endl
<< ends;
@@ -186,14 +186,14 @@ void Point::renderPS(PSColorSpace mode)
case CROSS:
vv = generateCross(Coord::CANVAS);
str << "newpath "
- << vv[0].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[0]) << ' '
<< "moveto "
- << vv[1].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[1]) << ' '
<< "lineto stroke" << endl
<< "newpath "
- << vv[2].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[2]) << ' '
<< "moveto "
- << vv[3].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[3]) << ' '
<< "lineto stroke" << endl
<< ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
@@ -201,14 +201,14 @@ void Point::renderPS(PSColorSpace mode)
case EX:
vv = generateEx(Coord::CANVAS);
str << "newpath "
- << vv[0].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[0]) << ' '
<< "moveto "
- << vv[1].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[1]) << ' '
<< "lineto stroke" << endl
<< "newpath "
- << vv[2].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[2]) << ' '
<< "moveto "
- << vv[3].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[3]) << ' '
<< "lineto stroke" << endl
<< ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
@@ -216,19 +216,19 @@ void Point::renderPS(PSColorSpace mode)
case ARROW:
vv = generateArrow(Coord::CANVAS);
str << "newpath "
- << vv[0].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[0]) << ' '
<< "moveto "
- << vv[3].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[3]) << ' '
<< "lineto stroke" << endl
<< "newpath "
- << vv[1].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[1]) << ' '
<< "moveto "
- << vv[3].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[3]) << ' '
<< "lineto stroke" << endl
<< "newpath "
- << vv[2].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[2]) << ' '
<< "moveto "
- << vv[3].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[3]) << ' '
<< "lineto stroke" << endl
<< ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
@@ -248,16 +248,16 @@ void Point::renderPSCircle(int mode, int ss)
if (parent->isAzElZero()) {
Vector cc = parent->mapFromRef(center,Coord::CANVAS);
ostringstream str;
- str << "newpath " << cc.TkCanvasPs(parent->canvas) << ' ' << ss/2.
+ str << "newpath " << parent->TkCanvasPs(cc) << ' ' << ss/2.
<< " 0 360 arc stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
}
else {
Vector* vv = generateCircle(Coord::CANVAS,ss);
ostringstream str;
- str << "newpath " << vv[0].TkCanvasPs(parent->canvas) << " moveto " << endl;
+ str << "newpath " << parent->TkCanvasPs(vv[0]) << " moveto " << endl;
for (int ii=1; ii<NUMSEG; ii++)
- str << vv[ii].TkCanvasPs(parent->canvas) << " lineto" << endl;
+ str << parent->TkCanvasPs(vv[ii]) << " lineto" << endl;
str << "closepath stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
delete [] vv;
@@ -269,13 +269,13 @@ void Point::renderPSBox(int mode)
Vector* vv = generateBox(Coord::CANVAS);
ostringstream str;
str << "newpath "
- << vv[0].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[0]) << ' '
<< "moveto "
- << vv[1].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[1]) << ' '
<< "lineto "
- << vv[2].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[2]) << ' '
<< "lineto "
- << vv[3].TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(vv[3]) << ' '
<< "lineto " << endl
<< "closepath stroke" << endl
<< ends;
diff --git a/tksao/frame/polygon.C b/tksao/frame/polygon.C
index 5e618f2..46ff671 100644
--- a/tksao/frame/polygon.C
+++ b/tksao/frame/polygon.C
@@ -83,10 +83,10 @@ void Polygon::renderPS(PSColorSpace mode)
vertex.head();
Vector v = fwdMap(vertex.current()->vector,Coord::CANVAS);
str << "newpath " << endl
- << v.TkCanvasPs(parent->canvas) << " moveto" << endl;
+ << parent->TkCanvasPs(v) << " moveto" << endl;
while (vertex.next()) {
Vector v = fwdMap(vertex.current()->vector,Coord::CANVAS);
- str << v.TkCanvasPs(parent->canvas) << " lineto" << endl;
+ str << parent->TkCanvasPs(v) << " lineto" << endl;
}
str << "closepath ";
diff --git a/tksao/frame/projection.C b/tksao/frame/projection.C
index b0a05cd..5bfbaf3 100644
--- a/tksao/frame/projection.C
+++ b/tksao/frame/projection.C
@@ -86,9 +86,9 @@ void Projection::renderPS(PSColorSpace mode)
{
ostringstream str;
str << "newpath "
- << aa.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(aa) << ' '
<< "moveto "
- << bb.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(bb) << ' '
<< "lineto stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
}
@@ -108,13 +108,13 @@ void Projection::renderPS(PSColorSpace mode)
ostringstream str;
str << "newpath "
- << lr.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(lr) << ' '
<< "moveto "
- << ur.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(ur) << ' '
<< "lineto "
- << ul.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(ul) << ' '
<< "lineto "
- << ll.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(ll) << ' '
<< "lineto stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
}
diff --git a/tksao/frame/ruler.C b/tksao/frame/ruler.C
index 5d8585b..0813274 100644
--- a/tksao/frame/ruler.C
+++ b/tksao/frame/ruler.C
@@ -115,9 +115,9 @@ void Ruler::renderPS(PSColorSpace mode)
{
ostringstream str;
str << "newpath "
- << dd.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(dd) << ' '
<< "moveto "
- << ee.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(ee) << ' '
<< "lineto stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
renderPSArrow(p2,p1,Coord::CANVAS);
@@ -129,14 +129,14 @@ void Ruler::renderPS(PSColorSpace mode)
{
ostringstream str;
str << "newpath "
- << aa.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(aa) << ' '
<< "moveto "
- << cc.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(cc) << ' '
<< "lineto stroke" << endl
<< "newpath "
- << bb.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(bb) << ' '
<< "moveto "
- << cc.TkCanvasPs(parent->canvas) << ' '
+ << parent->TkCanvasPs(cc) << ' '
<< "lineto stroke" << endl << ends;
Tcl_AppendResult(parent->interp, str.str().c_str(), NULL);
}
@@ -155,7 +155,7 @@ void Ruler::renderPS(PSColorSpace mode)
distToStr(vstr);
vstr << ends;
char* buf = dupstr(vstr.str().c_str());
- Vector tt = ((bb-aa)/2 + aa).TkCanvasPs(parent->canvas);
+ Vector tt = parent->TkCanvasPs(((bb-aa)/2 + aa));
str << "gsave" << endl
<< "newpath " << endl
<< tt << " moveto" << endl
diff --git a/tksao/frame/segment.C b/tksao/frame/segment.C
index 142db2b..f67d37c 100644
--- a/tksao/frame/segment.C
+++ b/tksao/frame/segment.C
@@ -65,11 +65,11 @@ void Segment::renderPS(PSColorSpace mode)
Vector v = fwdMap(vertex.current()->vector,Coord::CANVAS);
if (first) {
str << "newpath " << endl
- << v.TkCanvasPs(parent->canvas) << " moveto" << endl;
+ << parent->TkCanvasPs(v) << " moveto" << endl;
first = 0;
}
else
- str << v.TkCanvasPs(parent->canvas) << " lineto" << endl;
+ str << parent->TkCanvasPs(v) << " lineto" << endl;
} while (vertex.next());
str << "stroke" << endl << ends;
diff --git a/tksao/frame/text.C b/tksao/frame/text.C
index b73a149..a4de348 100644
--- a/tksao/frame/text.C
+++ b/tksao/frame/text.C
@@ -72,7 +72,8 @@ void Text::renderPS(PSColorSpace mode)
<< " scalefont setfont" << endl;
double ang = rotate ? calcAngle() : 0;
- Vector cc = (parent->mapFromRef(center,Coord::CANVAS)).TkCanvasPs(parent->canvas);
+ Vector bb = parent->mapFromRef(center,Coord::CANVAS);
+ Vector cc = parent->TkCanvasPs(bb);
str << "gsave" << endl
<< "newpath " << endl
<< cc << " moveto" << endl
diff --git a/tksao/util/gridbase.C b/tksao/util/gridbase.C
index 4bfcab2..311ef5c 100644
--- a/tksao/util/gridbase.C
+++ b/tksao/util/gridbase.C
@@ -216,10 +216,10 @@ int GridBase::psLine(int n, float* x, float* y)
ostringstream str;
if (i == 0) {
str << "newpath " << endl;
- str << v.TkCanvasPs(parent_->getCanvas()) << " moveto" << endl << ends;
+ str << parent_->TkCanvasPs(v) << " moveto" << endl << ends;
}
else
- str << v.TkCanvasPs(parent_->getCanvas()) << " lineto" << endl << ends;
+ str << parent_->TkCanvasPs(v) << " lineto" << endl << ends;
Tcl_AppendResult(parent_->getInterp(), str.str().c_str(), NULL);
}
@@ -250,7 +250,7 @@ int GridBase::psText(const char* txt, float x, float y,
psColor(text_);
str << "gsave "
- << cc.TkCanvasPs(parent_->getCanvas()) << " moveto" << endl
+ << parent_->TkCanvasPs(cc) << " moveto" << endl
<< radToDeg(angle) << " rotate "
<< '(' << psQuote(txt) << ')' << " show"
<< " grestore" << endl << ends;
diff --git a/tksao/util/util.C b/tksao/util/util.C
index d4e9c74..72ce4b8 100644
--- a/tksao/util/util.C
+++ b/tksao/util/util.C
@@ -2,7 +2,7 @@
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"
-#include <tcl.h>
+#include <tk.h>
#include "util.h"
diff --git a/tksao/util/util.h b/tksao/util/util.h
index 2cd64c0..185ab55 100644
--- a/tksao/util/util.h
+++ b/tksao/util/util.h
@@ -21,7 +21,6 @@ using namespace std;
#include "fuzzy.h"
#include "vector.h"
-#include "vector3d.h"
#ifndef PATH_MAX
#define PATH_MAX 1024
diff --git a/tksao/widget/widget.C b/tksao/widget/widget.C
index 5e0c917..456f30c 100644
--- a/tksao/widget/widget.C
+++ b/tksao/widget/widget.C
@@ -640,6 +640,10 @@ void Widget::warpTo(Vector& vv)
#endif
}
+Vector Widget::TkCanvasPs(const Vector& v) {
+ return Vector(v[0], Tk_CanvasPsY(canvas, v[1]));
+}
+
void Widget::psHead1(ostream& str, int width, int height)
{
switch (psColorSpace) {
diff --git a/tksao/widget/widget.h b/tksao/widget/widget.h
index 977a3f7..0fb1c59 100644
--- a/tksao/widget/widget.h
+++ b/tksao/widget/widget.h
@@ -168,6 +168,7 @@ class Widget {
void warp(Vector&);
void warpTo(Vector&);
+ Vector TkCanvasPs(const Vector&);
void psColor(PSColorSpace mode, XColor* clr);
// Required Canvas Functions
diff --git a/tksao/util/fuzzy.h b/vector/fuzzy.h
index d7f5f1b..d7f5f1b 100644
--- a/tksao/util/fuzzy.h
+++ b/vector/fuzzy.h
diff --git a/tksao/vector/vector.C b/vector/vector.C
index 9744cc8..88949f1 100644
--- a/tksao/vector/vector.C
+++ b/vector/vector.C
@@ -44,11 +44,6 @@ Vector& Vector::clip(const BBox& bb)
return *this;
}
-Vector Vector::TkCanvasPs(void* canvas)
-{
- return Vector(v[0], Tk_CanvasPsY((Tk_Canvas)canvas, v[1]));
-}
-
ostream& operator<<(ostream& os, const Vector& v)
{
unsigned char sep = (unsigned char)os.iword(Vector::separator);
diff --git a/tksao/vector/vector.h b/vector/vector.h
index f7461fc..783336e 100644
--- a/tksao/vector/vector.h
+++ b/vector/vector.h
@@ -77,8 +77,6 @@ class Vector {
// restrict vector by bbox
Vector& clip(const BBox&);
-
- Vector TkCanvasPs(void* canvas);
};
// Vector separator(int)
diff --git a/tksao/vector/vector3d.C b/vector/vector3d.C
index ef57553..78575ae 100644
--- a/tksao/vector/vector3d.C
+++ b/vector/vector3d.C
@@ -35,11 +35,6 @@ Vector3d& Vector3d::operator=(const Vector& a)
return *this;
}
-Vector Vector3d::TkCanvasPs(void* canvas)
-{
- return Vector(v[0], Tk_CanvasPsY((Tk_Canvas)canvas, v[1]));
-}
-
ostream& operator<<(ostream& os, const Vector3d& v)
{
unsigned char sep = (unsigned char)os.iword(Vector::separator);
diff --git a/tksao/vector/vector3d.h b/vector/vector3d.h
index dba825b..3d77d86 100644
--- a/tksao/vector/vector3d.h
+++ b/vector/vector3d.h
@@ -38,8 +38,8 @@ class Vector3d {
Vector3d& operator=(const Vector3d& a)
{v[0]=a.v[0];v[1]=a.v[1];v[2]=a.v[2];v[3]=a.v[3]; return *this;}
- double& operator[](int i) {return v[i];} // return element
const double& operator[](int i) const {return v[i];} // return element
+ double& operator[](int i) {return v[i];} // return element
double* vv() {return v;} // return vector
Vector3d& operator+=(const Vector3d& a) // addition
@@ -75,8 +75,6 @@ class Vector3d {
return d ? Vector3d(v[0]/d,v[1]/d,v[2]/d) : Vector3d();}
Vector3d project()
{return (v[3]!=1) ? Vector3d(v[0]/v[3],v[1]/v[3],v[2]/v[3]) : *this;}
-
- Vector TkCanvasPs(void* canvas);
};
ostream& operator<<(ostream&, const Vector3d&);
istream& operator>>(istream&, Vector3d&);
diff --git a/tksao/vector/vectorstr.C b/vector/vectorstr.C
index 7d0576c..7505fc6 100644
--- a/tksao/vector/vectorstr.C
+++ b/vector/vectorstr.C
@@ -2,9 +2,27 @@
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+using namespace std;
+
#include "vectorstr.h"
#include "vector.h"
-#include "util.h"
+#include "vector3d.h"
+
+static char* dupstr(const char* str)
+{
+ char* copy;
+ if (str) {
+ copy=new char[strlen(str)+1];
+ strcpy(copy,str);
+ }
+ else
+ copy=NULL;
+
+ return copy;
+}
// VectorStr
diff --git a/tksao/vector/vectorstr.h b/vector/vectorstr.h
index 71181fb..71181fb 100644
--- a/tksao/vector/vectorstr.h
+++ b/vector/vectorstr.h