summaryrefslogtreecommitdiffstats
path: root/tksao/frame/context.C
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-02-17 22:10:13 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-02-17 22:10:13 (GMT)
commit33275f0fcd0068455b55182387fdc84afb87e7d8 (patch)
treebadd8b3a946b4e72e29d8de7dc7585798bd9eeee /tksao/frame/context.C
parent22ab08a3da8a9b05a504a715260dcf96b191b626 (diff)
downloadblt-33275f0fcd0068455b55182387fdc84afb87e7d8.zip
blt-33275f0fcd0068455b55182387fdc84afb87e7d8.tar.gz
blt-33275f0fcd0068455b55182387fdc84afb87e7d8.tar.bz2
fix has contours issue
Diffstat (limited to 'tksao/frame/context.C')
-rw-r--r--tksao/frame/context.C122
1 files changed, 77 insertions, 45 deletions
diff --git a/tksao/frame/context.C b/tksao/frame/context.C
index 8b23ddd..0762a17 100644
--- a/tksao/frame/context.C
+++ b/tksao/frame/context.C
@@ -454,16 +454,20 @@ void Context::contourCreateFV(const char* color, int width, int dash,
}
}
}
+
+ hasContour_ =1;
}
void Context::contourDeleteFV()
{
fvcontour_.lcontourlevel().deleteAll();
+ hasContour_ =0;
}
void Context::contourDeleteAux()
{
auxcontours_.deleteAll();
+ hasAuxContour_ =0;
}
void Context::contourListFV(ostream& str, Coord::CoordSystem sys,
@@ -472,6 +476,9 @@ void Context::contourListFV(ostream& str, Coord::CoordSystem sys,
if (!cfits)
return;
+ if (!hasContour_)
+ return;
+
contourList(str, sys, sky, fvcontour_.lcontourlevel());
}
@@ -481,6 +488,9 @@ void Context::contourListAux(ostream& str, Coord::CoordSystem sys,
if (!cfits)
return;
+ if (!hasAuxContour_)
+ return;
+
contourList(str, sys, sky, auxcontours_);
}
@@ -586,16 +596,20 @@ void Context::contourPS(Widget::PSColorSpace cs)
// render back to front
// aux contours
- if (auxcontours_.tail())
- do
- auxcontours_.current()->ps(cs);
- while (auxcontours_.previous());
+ if (hasAuxContour_) {
+ if (auxcontours_.tail())
+ do
+ auxcontours_.current()->ps(cs);
+ while (auxcontours_.previous());
+ }
- List<ContourLevel>& cc = fvcontour_.lcontourlevel();
- if (cc.head())
- do
- cc.current()->ps(cs);
- while (cc.next());
+ if (hasContour_) {
+ List<ContourLevel>& cc = fvcontour_.lcontourlevel();
+ if (cc.head())
+ do
+ cc.current()->ps(cs);
+ while (cc.next());
+ }
}
void Context::contourX11(Pixmap pm, Coord::InternalSystem sys,
@@ -606,16 +620,20 @@ void Context::contourX11(Pixmap pm, Coord::InternalSystem sys,
// render back to front
// aux contours
- if (auxcontours_.tail())
- do
- auxcontours_.current()->render(pm, sys, width, height);
- while (auxcontours_.previous());
+ if (hasAuxContour_) {
+ if (auxcontours_.tail())
+ do
+ auxcontours_.current()->render(pm, sys, width, height);
+ while (auxcontours_.previous());
+ }
- List<ContourLevel>& cc = fvcontour_.lcontourlevel();
- if (cc.head())
- do
- cc.current()->render(pm, sys, width, height);
- while (cc.next());
+ if (hasContour_) {
+ List<ContourLevel>& cc = fvcontour_.lcontourlevel();
+ if (cc.head())
+ do
+ cc.current()->render(pm, sys, width, height);
+ while (cc.next());
+ }
}
#ifdef MAC_OSX_TK
@@ -626,16 +644,20 @@ void Context::contourMacOSX()
// render back to front
// aux contours
- if (auxcontours_.tail())
- do
- auxcontours_.current()->macosx();
- while (auxcontours_.previous());
+ if (hasAuxContour_) {
+ if (auxcontours_.tail())
+ do
+ auxcontours_.current()->macosx();
+ while (auxcontours_.previous());
+ }
- List<ContourLevel>& cc = fvcontour_.lcontourlevel();
- if (cc.head())
- do
- cc.current()->macosx();
- while (cc.next());
+ if (hasContour_) {
+ List<ContourLevel>& cc = fvcontour_.lcontourlevel();
+ if (cc.head())
+ do
+ cc.current()->macosx();
+ while (cc.next());
+ }
}
#endif
@@ -647,16 +669,20 @@ void Context::contourWin32()
// render back to front
// aux contours
- if (auxcontours_.tail())
- do
- auxcontours_.current()->win32();
- while (auxcontours_.previous());
+ if (hasAuxContour_) {
+ if (auxcontours_.tail())
+ do
+ auxcontours_.current()->win32();
+ while (auxcontours_.previous());
+ }
- List<ContourLevel>& cc = fvcontour_.lcontourlevel();
- if (cc.head())
- do
- cc.current()->win32();
- while (cc.next());
+ if (hasContour_) {
+ List<ContourLevel>& cc = fvcontour_.lcontourlevel();
+ if (cc.head())
+ do
+ cc.current()->win32();
+ while (cc.next());
+ }
}
#endif
@@ -2527,6 +2553,8 @@ void Context::unload()
fvcontour_.lcontourlevel().deleteAll();
auxcontours_.deleteAll();
+ hasContour_ =0;
+ hasAuxContour_ =0;
resetSecMode();
updateClip();
@@ -2734,16 +2762,20 @@ void Context::updateContours(const Matrix& mx)
return;
// aux contours
- if (auxcontours_.head())
- do
- auxcontours_.current()->updateCoords(mx);
- while (auxcontours_.next());
+ if (hasAuxContour_) {
+ if (auxcontours_.head())
+ do
+ auxcontours_.current()->updateCoords(mx);
+ while (auxcontours_.next());
+ }
- List<ContourLevel>& cc = fvcontour_.lcontourlevel();
- if (cc.head())
- do
- cc.current()->updateCoords(mx);
- while (cc.next());
+ if (hasContour_) {
+ List<ContourLevel>& cc = fvcontour_.lcontourlevel();
+ if (cc.head())
+ do
+ cc.current()->updateCoords(mx);
+ while (cc.next());
+ }
}
void Context::updateSlice(int id, int ss)