Mantid
Loading...
Searching...
No Matches
IMaskWorkspace.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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"
11
12#include <memory>
13#include <set>
14#include <string>
15
16namespace Mantid {
17namespace API {
18
21class MANTID_API_DLL IMaskWorkspace {
22public:
23 IMaskWorkspace() = default;
25 virtual ~IMaskWorkspace() = default;
27 virtual const std::string id() const { return "IMaskWorkspace"; }
29 virtual std::size_t getNumberMasked() const = 0;
31 virtual bool isMasked(const detid_t detectorID) const = 0;
33 virtual bool isMasked(const std::set<detid_t> &detectorIDs) const = 0;
35 virtual void setMasked(const detid_t detectorID, const bool mask = true) = 0;
37 virtual void setMasked(const std::set<detid_t> &detectorIDs, const bool mask = true) = 0;
39 std::unique_ptr<IMaskWorkspace> clone() const { return std::unique_ptr<IMaskWorkspace>(doInterfaceClone()); }
40
41protected:
43 IMaskWorkspace(const IMaskWorkspace &other) { (void)other; }
44
46 virtual IMaskWorkspace *doInterfaceClone() const = 0;
47};
48
50using IMaskWorkspace_sptr = std::shared_ptr<IMaskWorkspace>;
52using IMaskWorkspace_const_sptr = std::shared_ptr<const IMaskWorkspace>;
53} // namespace API
54} // namespace Mantid
This class provides an interface to a MaskWorkspace.
virtual const std::string id() const
Return the workspace typeID.
virtual IMaskWorkspace * doInterfaceClone() const =0
returns a clone of the workspace as the interface
virtual void setMasked(const detid_t detectorID, const bool mask=true)=0
Set / remove mask of a detector.
virtual bool isMasked(const detid_t detectorID) const =0
Check if a detector is masked.
virtual std::size_t getNumberMasked() const =0
Total number of masked pixels.
IMaskWorkspace & operator=(const IMaskWorkspace &)=delete
virtual ~IMaskWorkspace()=default
virtual void setMasked(const std::set< detid_t > &detectorIDs, const bool mask=true)=0
Set / remove masks of all detectors in a set.
IMaskWorkspace(const IMaskWorkspace &other)
Protected copy constructor. May be used by childs for cloning.
virtual bool isMasked(const std::set< detid_t > &detectorIDs) const =0
Check if all detectors in a set are masked.
std::unique_ptr< IMaskWorkspace > clone() const
Returns a clone of the workspace.
std::shared_ptr< const IMaskWorkspace > IMaskWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< IMaskWorkspace > IMaskWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.