-
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.
refs #6279. Refactor PeakOverlayViewFactory hierachy.
Add a new base class for common methods. Rename PeakOverlayFactory -> PeakOverlaySphereFactory. Create new type of factory PeakOverlayCrossFactory. PeakOverlayCrossFactory is not producing a new product of a PeakOverlayCross yet. This is the next stage.
- Loading branch information
1 parent
373691b
commit cf27410
Showing
9 changed files
with
253 additions
and
119 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
50 changes: 50 additions & 0 deletions
50
Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/PeakOverlayCrossFactory.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,50 @@ | ||
#ifndef MANTID_SLICEVIEWER_PEAKOVERLAYCROSS_FACTORY_H_ | ||
#define MANTID_SLICEVIEWER_PEAKOVERLAYCROSS_FACTORY_H_ | ||
|
||
#include "MantidQtSliceViewer/PeakOverlayViewFactoryBase.h" | ||
#include <boost/shared_ptr.hpp> | ||
|
||
namespace MantidQt | ||
{ | ||
namespace SliceViewer | ||
{ | ||
|
||
/** Concrete view factory. For creating instances of PeakOverlayCross widget. | ||
@date 2012-08-24 | ||
Copyright © 2011 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> | ||
Code Documentation is available at: <http://doxygen.mantidproject.org> | ||
*/ | ||
class DLLExport PeakOverlayCrossFactory : public PeakOverlayViewFactoryBase | ||
{ | ||
public: | ||
PeakOverlayCrossFactory(QwtPlot * plot, QWidget * parent, const size_t colourNumber=0); | ||
virtual ~PeakOverlayCrossFactory(); | ||
boost::shared_ptr<PeakOverlayView> createView(const Mantid::Kernel::V3D& position) const; | ||
virtual void setRadius(const double&) | ||
{ | ||
// Do nothing. | ||
} | ||
}; | ||
} | ||
} | ||
|
||
#endif /*MANTID_SLICEVIEWER_PEAKOVERLAYCROSS_FACTORY_H_*/ |
49 changes: 49 additions & 0 deletions
49
Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/PeakOverlaySphereFactory.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,49 @@ | ||
#ifndef MANTID_SLICEVIEWER_PEAKOVERLAYSPHERE_FACTORY_H_ | ||
#define MANTID_SLICEVIEWER_PEAKOVERLAYSPHERE_FACTORY_H_ | ||
|
||
#include "MantidQtSliceViewer/PeakOverlayViewFactoryBase.h" | ||
#include <boost/shared_ptr.hpp> | ||
|
||
namespace MantidQt | ||
{ | ||
namespace SliceViewer | ||
{ | ||
|
||
/** Concrete view factory. For creating instances of PeakOverlaySphere widget. | ||
@date 2012-08-24 | ||
Copyright © 2011 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> | ||
Code Documentation is available at: <http://doxygen.mantidproject.org> | ||
*/ | ||
class DLLExport PeakOverlaySphereFactory : public PeakOverlayViewFactoryBase | ||
{ | ||
private: | ||
double m_peakRadius; | ||
public: | ||
PeakOverlaySphereFactory(QwtPlot * plot, QWidget * parent, const size_t colourNumber=0); | ||
virtual ~PeakOverlaySphereFactory(); | ||
boost::shared_ptr<PeakOverlayView> createView(const Mantid::Kernel::V3D& position) const; | ||
virtual void setRadius(const double& peakRadius); | ||
}; | ||
} | ||
} | ||
|
||
#endif /*MANTID_SLICEVIEWER_PEAKOVERLAYSPHERE_FACTORY_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
30 changes: 30 additions & 0 deletions
30
Code/Mantid/MantidQt/SliceViewer/src/PeakOverlayCrossFactory.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,30 @@ | ||
#include "MantidQtSliceViewer/PeakOverlayCrossFactory.h" | ||
#include "MantidQtSliceViewer/PeakOverlaySphere.h" | ||
#include "MantidKernel/V3D.h" | ||
#include "MantidAPI/IPeak.h" | ||
#include "MantidAPI/IMDWorkspace.h" | ||
#include "MantidAPI/IMDEventWorkspace.h" | ||
#include "MantidAPI/IMDHistoWorkspace.h" | ||
#include <boost/make_shared.hpp> | ||
|
||
using namespace Mantid::API; | ||
|
||
namespace MantidQt | ||
{ | ||
namespace SliceViewer | ||
{ | ||
|
||
PeakOverlayCrossFactory::PeakOverlayCrossFactory(QwtPlot * plot, QWidget * parent, const size_t colourNumber) : PeakOverlayViewFactoryBase(plot, parent, colourNumber) | ||
{ | ||
} | ||
|
||
boost::shared_ptr<PeakOverlayView> PeakOverlayCrossFactory::createView(const Mantid::Kernel::V3D& position) const | ||
{ | ||
return boost::make_shared<PeakOverlaySphere>(m_plot, m_parent, position, 0, this->m_peakColour); | ||
} | ||
|
||
PeakOverlayCrossFactory::~PeakOverlayCrossFactory() | ||
{ | ||
} | ||
} | ||
} |
92 changes: 0 additions & 92 deletions
92
Code/Mantid/MantidQt/SliceViewer/src/PeakOverlayFactory.cpp
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
Code/Mantid/MantidQt/SliceViewer/src/PeakOverlaySphereFactory.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,34 @@ | ||
#include "MantidQtSliceViewer/PeakOverlaySphereFactory.h" | ||
#include "MantidQtSliceViewer/PeakOverlaySphere.h" | ||
#include <boost/make_shared.hpp> | ||
|
||
using namespace Mantid::API; | ||
|
||
namespace MantidQt | ||
{ | ||
namespace SliceViewer | ||
{ | ||
|
||
PeakOverlaySphereFactory::PeakOverlaySphereFactory(QwtPlot * plot, QWidget * parent, const size_t colourNumber) : PeakOverlayViewFactoryBase(plot, parent, colourNumber) | ||
{ | ||
} | ||
|
||
boost::shared_ptr<PeakOverlayView> PeakOverlaySphereFactory::createView(const Mantid::Kernel::V3D& position) const | ||
{ | ||
return boost::make_shared<PeakOverlaySphere>(m_plot, m_parent, position, this->m_peakRadius, this->m_peakColour); | ||
} | ||
|
||
PeakOverlaySphereFactory::~PeakOverlaySphereFactory() | ||
{ | ||
} | ||
|
||
/* | ||
Setter for the actual peak radius. The radius used for drawing will depend on the plane instesection. | ||
@param peakRadius : Global value for the peak radius to apply to all peaks manufactured through this factory. | ||
*/ | ||
void PeakOverlaySphereFactory::setRadius(const double& peakRadius) | ||
{ | ||
m_peakRadius = peakRadius; | ||
} | ||
} | ||
} |
Oops, something went wrong.