Mantid
Loading...
Searching...
No Matches
IPreview.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include "MantidAPI/DllConfig.h"
10#include "Workspace_fwd.h"
11
12#include <string>
13
14namespace Mantid {
15namespace API {
16
24class MANTID_API_DLL IPreview {
25public:
26 enum class PreviewType { IVIEW = 0, PLOT1D = 1, PLOT2D = 2, SVIEW = 3 };
27 virtual ~IPreview() = default;
28 virtual PreviewType type() const = 0;
29 virtual std::string technique() const = 0;
30 virtual std::string facility() const = 0;
31 virtual std::string name() const = 0;
32 Workspace_sptr view(Workspace_sptr ws) const { return preview(ws); }
33
34private:
35 virtual Workspace_sptr preview(Workspace_sptr ws) const { return ws; }
36};
37using IPreview_uptr = std::unique_ptr<IPreview>;
38} // namespace API
39} // namespace Mantid
IPreview : This is the abstract base class of the raw data previews.
Definition: IPreview.h:24
virtual std::string name() const =0
virtual Workspace_sptr preview(Workspace_sptr ws) const
Definition: IPreview.h:35
Workspace_sptr view(Workspace_sptr ws) const
Definition: IPreview.h:32
virtual std::string facility() const =0
virtual std::string technique() const =0
virtual ~IPreview()=default
virtual PreviewType type() const =0
std::unique_ptr< IPreview > IPreview_uptr
Definition: IPreview.h:37
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Definition: Workspace_fwd.h:20
Helper class which provides the Collimation Length for SANS instruments.