From 8da5784b3e24ca5f40b380525ae3b15105b5c732 Mon Sep 17 00:00:00 2001 From: William Joye Date: Mon, 22 Oct 2018 13:07:24 -0400 Subject: new mask --- tksao/frame/base.C | 1 - tksao/frame/base.h | 3 +-- tksao/frame/frame.C | 1 - tksao/frame/frame3d.C | 1 - tksao/frame/framergb.C | 14 ++++++++++++++ tksao/frame/framergb.h | 4 ++++ tksao/frame/frload.C | 6 ------ 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/tksao/frame/base.C b/tksao/frame/base.C index e6ad19e..e0e97e4 100644 --- a/tksao/frame/base.C +++ b/tksao/frame/base.C @@ -70,7 +70,6 @@ Base::Base(Tcl_Interp* i, Tk_Canvas c, Tk_Item* item) currentContext = NULL; keyContext = NULL; - keyContextSet =0; orientation = Coord::NORMAL; zoom_ = Vector(1,1); diff --git a/tksao/frame/base.h b/tksao/frame/base.h index 400103e..a90ba0a 100644 --- a/tksao/frame/base.h +++ b/tksao/frame/base.h @@ -170,7 +170,6 @@ public: Context* currentContext; Context* keyContext; - int keyContextSet; Coord::Orientation orientation; // current image orientation Matrix orientationMatrix; // current image orientation matrix @@ -383,7 +382,7 @@ public: virtual int isFrame3d() {return 0;} virtual int isFrameRGB() {return 0;} - void loadDone(int, LayerType); + virtual void loadDone(int, LayerType); void markerAnalysisHistogram(Marker*, double**, double**, const BBox&, int); int markerAnalysisPlot2d(Marker*, double**, double**, double**, double**, diff --git a/tksao/frame/frame.C b/tksao/frame/frame.C index 15d701d..f8cb555 100644 --- a/tksao/frame/frame.C +++ b/tksao/frame/frame.C @@ -20,7 +20,6 @@ Frame::Frame(Tcl_Interp* i, Tk_Canvas c, Tk_Item* item) currentContext = context; keyContext = context; - keyContextSet =1; colormapData =NULL; diff --git a/tksao/frame/frame3d.C b/tksao/frame/frame3d.C index 7fef84f..01e07a7 100644 --- a/tksao/frame/frame3d.C +++ b/tksao/frame/frame3d.C @@ -27,7 +27,6 @@ Frame3d::Frame3d(Tcl_Interp* i, Tk_Canvas c, Tk_Item* item) currentContext = context; keyContext = context; - keyContextSet =1; cmapID = 1; bias = 0.5; diff --git a/tksao/frame/framergb.C b/tksao/frame/framergb.C index 89942c3..a71dd23 100644 --- a/tksao/frame/framergb.C +++ b/tksao/frame/framergb.C @@ -659,6 +659,20 @@ void FrameRGB::loadRGBFinish() update(MATRIX); } +void FrameRGB::loadDone(int rr, LayerType ll) +{ + if (rr) { + if (ll == IMG) { + if (!keyContextSet) { + keyContext = currentContext; + keyContextSet =1; + } + } + + Base::loadDone(rr, ll); + } +} + // waj void FrameRGB::pushMatrices() { diff --git a/tksao/frame/framergb.h b/tksao/frame/framergb.h index 4c4c7f1..a862636 100644 --- a/tksao/frame/framergb.h +++ b/tksao/frame/framergb.h @@ -27,6 +27,8 @@ class FrameRGB : public FrameBase { int colorCount; // number of dynamic colors unsigned char* colorCells; // current color values + int keyContextSet; + private: void alignWCS(); void alignWCS(Coord::CoordSystem, Coord::SkyFrame); @@ -58,6 +60,8 @@ class FrameRGB : public FrameBase { protected: int isFrameRGB() {return 1;} + void loadDone(int, LayerType); + unsigned char* fillImage(int, int, Coord::InternalSystem); void updateColorCells(unsigned char*, int); void updateColorScale(); diff --git a/tksao/frame/frload.C b/tksao/frame/frload.C index c30a97f..a0c2184 100644 --- a/tksao/frame/frload.C +++ b/tksao/frame/frload.C @@ -714,12 +714,6 @@ void Base::loadMosaicImageWFPC2VarCmd(const char* ch, const char* fn) void Base::loadDone(int rr, LayerType ll) { if (rr) { - if (ll == IMG) { - if (!keyContextSet) { - keyContext = currentContext; - keyContextSet =1; - } - } alignWCS(); if (!preservePan) { centerImage(); -- cgit v0.12