diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-03-08 22:05:22 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-03-08 22:05:22 (GMT) |
commit | aced47b647500f0dae9c982ea5fc6de905726505 (patch) | |
tree | 8992b635687cbbc88e3206981746604e4f277892 | |
parent | fd6b04d9384e8bc4a3b0a37528a48f5fd3671f39 (diff) | |
download | blt-aced47b647500f0dae9c982ea5fc6de905726505.zip blt-aced47b647500f0dae9c982ea5fc6de905726505.tar.gz blt-aced47b647500f0dae9c982ea5fc6de905726505.tar.bz2 |
add contour scope
-rw-r--r-- | tksao/frame/context.C | 46 | ||||
-rw-r--r-- | tksao/frame/context.h | 11 |
2 files changed, 40 insertions, 17 deletions
diff --git a/tksao/frame/context.C b/tksao/frame/context.C index 0762a17..4dc8585 100644 --- a/tksao/frame/context.C +++ b/tksao/frame/context.C @@ -436,16 +436,26 @@ void Context::contourCreateFV(const char* color, int width, int dash, int smooth, FrScale::ColorScaleType colorScaleType, float expo, - float clipMode, Vector limits, - const char* level) -{ + FrScale::ClipMode clipMode, float autoCutPer, + FrScale::ClipScope clipScope, + double low, double high, const char* level) +{ + FrScale fr = frScale; + fr.setColorScaleType(colorScaleType); + fr.setExpo(expo); + fr.setClipMode(clipMode); + fr.setAutoCutPer(autoCutPer); + fr.setClipScope(clipScope); + fr.setLow(low); + fr.setHigh(high); + if (!isMosaic()) { if (cfits) - fvcontour_.create(parent_, cfits, &frScale, color, width, dash, method, numlevel, smooth, level, colorScaleType, expo, clipMode, limits); + fvcontour_.create(parent_, cfits, &fr, color, width, dash, method, numlevel, smooth, level); } else { if (fits) { - fvcontour_.create(parent_, fits, &frScale, color, width, dash, method, numlevel, smooth, level, colorScaleType, expo, clipMode, limits); + fvcontour_.create(parent_, fits, &fr, color, width, dash, method, numlevel, smooth, level); FitsImage* ptr = fits->nextMosaic(); while (ptr) { @@ -717,17 +727,20 @@ Vector Context::getClip() return Vector(frScale.low(), frScale.high()); } -Vector Context::getClip(FrScale::ClipMode cm, float ac) +Vector Context::getClip(FrScale::ClipMode cm, FrScale::ClipScope sc, float ac) { if (DebugPerf) cerr << "Context::getClip()" << endl; // we already have the scale? - if (frScale.clipMode() == cm && frScale.autoCutPer() == ac) + if (frScale.clipMode() == cm && + frScale.clipScope() == sc && + frScale.autoCutPer() == ac) return Vector(frScale.low(),frScale.high()); FrScale cl = frScale; cl.setClipMode(cm); + cl.setClipScope(sc); cl.setAutoCutPer(ac); updateClip(&cl); @@ -2748,12 +2761,21 @@ void Context::updateClipLocal(FrScale* fr) void Context::updateContours() { - fvcontour_.update(cfits); -} + if (!cfits) + return; -void Context::updateContoursScale() -{ - fvcontour_.update(cfits,&frScale); + if (!hasContour_) + return; + + switch (fvcontour_.frScale()->clipScope()) { + case FrScale::GLOBAL: + break; + case FrScale::LOCAL: + updateClip(fvcontour_.frScale()); + break; + } + + fvcontour_.update(cfits); } void Context::updateContours(const Matrix& mx) diff --git a/tksao/frame/context.h b/tksao/frame/context.h index d83a312..f0055da 100644 --- a/tksao/frame/context.h +++ b/tksao/frame/context.h @@ -123,8 +123,9 @@ class Context { int smooth, FrScale::ColorScaleType colorScaleType, float expo, - float clipMode, Vector limits, - const char* level); + FrScale::ClipMode clipMode, float, + FrScale::ClipScope clipScope, + double low, double high, const char* level); void contourDeleteFV(); void contourDeleteAux(); void contourListFV(ostream&, Coord::CoordSystem, Coord::SkyFrame); @@ -146,7 +147,7 @@ class Context { int fitsCount(); - Vector getClip(FrScale::ClipMode, float); + Vector getClip(FrScale::ClipMode, FrScale::ClipScope, float); Vector getClip(); FitsZBound* getDataParams(FrScale::SecMode); // return bbox in IMAGE Vector getMinMax(); @@ -221,7 +222,6 @@ class Context { void updateClip(); void updateContours(); void updateContours(const Matrix&); - void updateContoursScale(); void updateSlice(int, int); int updateClipScope(FrScale::ClipScope); @@ -257,7 +257,8 @@ class Context { float zContrast() {return frScale.zContrast();} int zSample() {return frScale.zSample();} int zLine() {return frScale.zLine();} - Vector clipUser() {return Vector(frScale.ulow(), frScale.uhigh());} + double ulow() {return frScale.ulow();} + double uhigh() {return frScale.uhigh();} void setClipScope(FrScale::ClipScope ss) {frScale.setClipScope(ss);} void setColorScaleType(FrScale::ColorScaleType tt) |