Commit c579de17 authored by Jose Borreguero's avatar Jose Borreguero
Browse files

Refs #30885 resolved to casting pointer



Signed-off-by: default avatarJose Borreguero <borreguero@gmail.com>
parent c4efa88e
......@@ -211,8 +211,8 @@ mtd_add_qt_library(TARGET_NAME MantidQtWidgetsInstrumentView
../../../Framework/DataObjects/inc
LINK_LIBS
${CORE_MANTIDLIBS}
PythonInterfaceCore
DataObjects
PythonInterfaceCore
${POCO_LIBRARIES}
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
......
......@@ -117,10 +117,10 @@ private slots:
void singleComponentTouched(size_t pickID);
void singleComponentPicked(size_t pickID);
void alignPeaks(const std::vector<Mantid::Kernel::V3D> &planePeaks,
const Mantid::DataObjects::Peak *peak);
const Mantid::Geometry::IPeak *peak);
void comparePeaks(
const std::pair<std::vector<Mantid::DataObjects::Peak *>,
std::vector<Mantid::DataObjects::Peak *>> &peaks);
const std::pair<std::vector<Mantid::Geometry::IPeak *>,
std::vector<Mantid::Geometry::IPeak *>> &peaks);
void updateSelectionInfoDisplay();
void shapeCreated();
void updatePlotMultipleDetectors();
......@@ -209,16 +209,16 @@ public:
public slots:
void displayInfo(size_t pickID);
void displayComparePeaksInfo(
const std::pair<std::vector<Mantid::DataObjects::Peak *>,
std::vector<Mantid::DataObjects::Peak *>> &peaks);
const std::pair<std::vector<Mantid::Geometry::IPeak *>,
std::vector<Mantid::Geometry::IPeak *>> &peaks);
void displayAlignPeaksInfo(const std::vector<Mantid::Kernel::V3D> &planePeaks,
const Mantid::DataObjects::Peak *peak);
const Mantid::Geometry::IPeak *peak);
void clear();
private:
QString displayDetectorInfo(size_t index);
QString displayNonDetectorInfo(Mantid::Geometry::ComponentID compID);
QString displayPeakInfo(Mantid::DataObjects::Peak *peak);
QString displayPeakInfo(Mantid::Geometry::IPeak *peak);
QString displayPeakAngles(const std::pair<Mantid::Geometry::IPeak *,
Mantid::Geometry::IPeak *> &peaks);
QString getPeakOverlayInfo();
......
......@@ -758,14 +758,14 @@ void InstrumentWidgetPickTab::singleComponentPicked(size_t pickID) {
}
void InstrumentWidgetPickTab::comparePeaks(
const std::pair<std::vector<Mantid::DataObjects::Peak *>,
std::vector<Mantid::DataObjects::Peak *>> &peaks) {
const std::pair<std::vector<Mantid::Geometry::IPeak *>,
std::vector<Mantid::Geometry::IPeak *>> &peaks) {
m_infoController->displayComparePeaksInfo(peaks);
}
void InstrumentWidgetPickTab::alignPeaks(
const std::vector<Mantid::Kernel::V3D> &planePeaks,
const Mantid::DataObjects::Peak *peak) {
const Mantid::Geometry::IPeak *peak) {
m_infoController->displayAlignPeaksInfo(planePeaks, peak);
}
......@@ -1005,8 +1005,9 @@ QString ComponentInfoController::displayNonDetectorInfo(
}
QString
ComponentInfoController::displayPeakInfo(Mantid::DataObjects::Peak *peak) {
ComponentInfoController::displayPeakInfo(Mantid::Geometry::IPeak *ipeak) {
std::stringstream text;
auto peak = static_cast<Mantid::DataObjects::Peak*>(ipeak);
auto instrument = peak->getInstrument();
auto sample = instrument->getSample()->getPos();
auto source = instrument->getSource()->getPos();
......@@ -1042,8 +1043,8 @@ QString ComponentInfoController::displayPeakAngles(
}
void ComponentInfoController::displayComparePeaksInfo(
const std::pair<std::vector<Mantid::DataObjects::Peak *>,
std::vector<Mantid::DataObjects::Peak *>> &peaks) {
const std::pair<std::vector<Mantid::Geometry::IPeak *>,
std::vector<Mantid::Geometry::IPeak *>> &peaks) {
std::stringstream text;
text << "Comparison Information\n";
......@@ -1068,7 +1069,7 @@ void ComponentInfoController::displayComparePeaksInfo(
void ComponentInfoController::displayAlignPeaksInfo(
const std::vector<Mantid::Kernel::V3D> &planePeaks,
const Mantid::DataObjects::Peak *peak) {
const Mantid::Geometry::IPeak *ipeak) {
using Mantid::Kernel::V3D;
......@@ -1080,6 +1081,7 @@ void ComponentInfoController::displayAlignPeaksInfo(
// find projection of beam direction onto plane
// this is so we always orientate to a common reference direction
auto peak = static_cast<const Mantid::DataObjects::Peak*>(ipeak);
const auto instrument = peak->getInstrument();
const auto samplePos = instrument->getSample()->getPos();
const auto sourcePos = instrument->getSource()->getPos();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment