Changeset 11923 for trunk


Ignore:
Timestamp:
08/31/11 16:46:44 (13 years ago)
Author:
tbretz
Message:
Possibility to switch highlighting off was missing.
Location:
trunk/FACT++/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/QCameraWidget.cc

    r11901 r11923  
    288288
    289289
    290      void QCameraWidget::highlightPixel(int idx)
     290     void QCameraWidget::highlightPixel(int idx, bool highlight)
    291291     {
    292292         if (idx < 0 || idx > ACTUAL_NUM_PIXELS)
     
    295295           return;
    296296         }
    297          highlightedPixels.push_back(idx);
    298          if (isVisible())
    299              updateGL();
    300      }
    301      void QCameraWidget::highlightPatch(int idx)
     297
     298         const vector<int>::iterator v = ::find(highlightedPixels.begin(), highlightedPixels.end(), idx);
     299         if (highlight)
     300         {
     301             if (v==highlightedPixels.end())
     302                 highlightedPixels.push_back(idx);
     303         }
     304         else
     305         {
     306             if (v!=highlightedPixels.end())
     307                 highlightedPixels.erase(v);
     308         }
     309
     310         if (isVisible())
     311             updateGL();
     312     }
     313     void QCameraWidget::highlightPatch(int idx, bool highlight)
    302314     {
    303315         if (idx < 0 || idx > NTMARK)
     
    306318             return;
    307319         }
    308          highlightedPatches.push_back(idx);
     320
     321         const vector<int>::iterator v = ::find(highlightedPatches.begin(), highlightedPatches.end(), idx);
     322         if (highlight)
     323         {
     324             if (v==highlightedPatches.end())
     325                 highlightedPatches.push_back(idx);
     326         }
     327         else
     328         {
     329             if (v!=highlightedPatches.end())
     330                 highlightedPatches.erase(v);
     331         }
     332
    309333         if (isVisible())
    310334             updateGL();
  • trunk/FACT++/gui/QCameraWidget.h

    r11901 r11923  
    2929
    3030public:
    31     void highlightPixel(int idx);
    32     void highlightPatch(int idx);
     31    void highlightPixel(int idx, bool highlight=true);
     32    void highlightPatch(int idx, bool highlight=true);
    3333    void clearHighlightedPatches();
    3434    void clearHighlightedPixels();
Note: See TracChangeset for help on using the changeset viewer.