-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Re #6162. Added a new tool button to Pick Tab"
This reverts commit 956a6a9.
- Loading branch information
1 parent
0e844c9
commit 00244cf
Showing
22 changed files
with
311 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,30 @@ | ||
<RCC> | ||
<qresource prefix="/"> | ||
<file>pvIcon.png</file> | ||
<file>MantidSplashScreen.png</file> | ||
<file>MantidPlot_Icon_32offset.png</file> | ||
<file>SNS_logo_trans_back.gif</file> | ||
<file>Tessella_Logo_Transparent.gif</file> | ||
<file>Mantid_Logo_Transparent_Cropped.png</file> | ||
<file>HFIR_logo_small.png</file> | ||
<file>ISIS_Logo_Transparent.gif</file> | ||
<file>Mantid_Logo_Transparent.png</file> | ||
<file>data_replace.png</file> | ||
</qresource> | ||
<qresource prefix="/Icons"> | ||
<file>LoadFile.png</file> | ||
</qresource> | ||
<qresource prefix="/PickTools"> | ||
<file>selection-tube.png</file> | ||
<file>selection-box.png</file> | ||
<file>selection-circle.png</file> | ||
<file>selection-pointer.png</file> | ||
<file>selection-text.png</file> | ||
<file>selection-peak.png</file> | ||
<file>selection-peaks.png</file> | ||
<file>shape-pointer.png</file> | ||
</qresource> | ||
<qresource prefix="/MaskTools"> | ||
<file>selection-pointer.png</file> | ||
<file>selection-circle.png</file> | ||
<file>selection-box.png</file> | ||
</qresource> | ||
<qresource prefix="/"> | ||
<file>pvIcon.png</file> | ||
<file>MantidSplashScreen.png</file> | ||
<file>MantidPlot_Icon_32offset.png</file> | ||
<file>SNS_logo_trans_back.gif</file> | ||
<file>Tessella_Logo_Transparent.gif</file> | ||
<file>Mantid_Logo_Transparent_Cropped.png</file> | ||
<file>HFIR_logo_small.png</file> | ||
<file>ISIS_Logo_Transparent.gif</file> | ||
<file>Mantid_Logo_Transparent.png</file> | ||
<file>data_replace.png</file> | ||
</qresource> | ||
<qresource prefix="/Icons"> | ||
<file>LoadFile.png</file> | ||
</qresource> | ||
<qresource prefix="/PickTools"> | ||
<file>selection-tube.png</file> | ||
<file>selection-box.png</file> | ||
<file>selection-circle.png</file> | ||
<file>selection-pointer.png</file> | ||
<file>selection-text.png</file> | ||
<file>selection-peak.png</file> | ||
</qresource> | ||
<qresource prefix="/MaskTools"> | ||
<file>selection-pointer.png</file> | ||
<file>selection-circle.png</file> | ||
<file>selection-box.png</file> | ||
</qresource> | ||
</RCC> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/DetSelector.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
//-------------------------------- | ||
// Includes | ||
//-------------------------------- | ||
#include "DetSelector.h" | ||
#include "MantidKernel/System.h" | ||
|
||
#include <QPainter> | ||
#include <algorithm> | ||
|
||
DetSelector::DetSelector(): | ||
m_xStart(0),m_yStart(0),m_inProgress(false),m_color(Qt::blue) | ||
{ | ||
} | ||
|
||
void DetSelector::draw(QPainter& painter) | ||
{ | ||
UNUSED_ARG(painter); | ||
} | ||
|
||
DetSelector* DetSelector::create(DetSelectionType type) | ||
{ | ||
switch(type) | ||
{ | ||
case Single: | ||
return new DetSelector(); | ||
default: | ||
return new BoxDetSelector(); | ||
}; | ||
} | ||
|
||
void DetSelector::start(int x, int y) | ||
{ | ||
m_xStart = x; | ||
m_yStart = y; | ||
m_inProgress = true; | ||
} | ||
|
||
void DetSelector::stop() | ||
{ | ||
m_inProgress = false; | ||
} | ||
|
||
void BoxDetSelector::draw(QPainter& painter) | ||
{ | ||
if (!m_inProgress) return; | ||
painter.setPen(m_color); | ||
painter.drawRect(m_xStart,m_yStart,m_xEnd,m_yEnd); | ||
} | ||
|
||
void BoxDetSelector::move(int x, int y) | ||
{ | ||
if (!m_inProgress) return; | ||
m_xEnd = x; | ||
m_yEnd = y; | ||
if (m_xEnd < m_xStart) std::swap(m_xEnd,m_xStart); | ||
if (m_yEnd < m_yStart) std::swap(m_yEnd,m_yStart); | ||
} |
68 changes: 68 additions & 0 deletions
68
Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/DetSelector.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#ifndef DETSELECTOR_H_ | ||
#define DETSELECTOR_H_ | ||
|
||
#include <QColor> | ||
/** | ||
\class DetSelector | ||
\brief class to pick group of detectors | ||
\author Roman Tolchenov | ||
\date 10 Feb 2011 | ||
Copyright © 2007 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory | ||
This file is part of Mantid. | ||
Mantid is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 3 of the License, or | ||
(at your option) any later version. | ||
Mantid is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
File change history is stored at: <https://github.com/mantidproject/mantid> | ||
*/ | ||
|
||
class QPainter; | ||
|
||
/** | ||
* Enumerates the ways teh detectors can be selected. | ||
* SingleDetectorSelection separates ways of selecting a single detector from | ||
* those of groups of detectors | ||
*/ | ||
enum DetSelectionType {Single=0,Peak,SingleDetectorSelection,BoxType,Tube}; | ||
|
||
class DetSelector | ||
{ | ||
public: | ||
DetSelector(); ///< Constructor | ||
virtual ~DetSelector(){} ///< Destructor | ||
virtual void draw(QPainter& painter); | ||
virtual void start(int x, int y); | ||
virtual void move(int , int ){} | ||
virtual void stop(); | ||
static DetSelector* create(DetSelectionType type); | ||
protected: | ||
int m_xStart; | ||
int m_yStart; | ||
bool m_inProgress; | ||
QColor m_color; | ||
}; | ||
|
||
class BoxDetSelector: public DetSelector | ||
{ | ||
public: | ||
void draw(QPainter& painter); | ||
void move(int x, int y); | ||
protected: | ||
int m_xEnd; | ||
int m_yEnd; | ||
}; | ||
|
||
#endif /*DETSELECTOR_H_*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.