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#include <vector>
16
17namespace Mantid {
18namespace API {
19
23// Reference Docs
24// Concepts: TODO
25// API: TODO
26
27class MANTID_API_DLL IMaskWorkspace {
28public:
29 IMaskWorkspace() = default;
31 virtual ~IMaskWorkspace() = default;
33 virtual const std::string id() const { return "IMaskWorkspace"; }
35 virtual std::size_t getNumberMasked() const = 0;
37 virtual bool containsDetID(const detid_t detectorID) const = 0;
38 virtual bool containsDetIDs(const std::set<detid_t> &detectorIDs) const = 0;
39 virtual bool containsDetIDs(const std::vector<detid_t> &detectorIDs) const = 0;
41 virtual bool isMasked(const detid_t detectorID) const = 0;
43 virtual bool isMasked(const std::set<detid_t> &detectorIDs) const = 0;
45 virtual void setMasked(const detid_t detectorID, const bool mask = true) = 0;
47 virtual void setMasked(const std::set<detid_t> &detectorIDs, const bool mask = true) = 0;
49 std::unique_ptr<IMaskWorkspace> clone() const { return std::unique_ptr<IMaskWorkspace>(doInterfaceClone()); }
50
51protected:
53 IMaskWorkspace(const IMaskWorkspace &other) { (void)other; }
54
56 virtual IMaskWorkspace *doInterfaceClone() const = 0;
57};
58
60using IMaskWorkspace_sptr = std::shared_ptr<IMaskWorkspace>;
62using IMaskWorkspace_const_sptr = std::shared_ptr<const IMaskWorkspace>;
63} // namespace API
64} // 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 bool containsDetIDs(const std::set< detid_t > &detectorIDs) const =0
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.
virtual bool containsDetID(const detid_t detectorID) const =0
Check if detector id exists in mask.
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.
virtual bool containsDetIDs(const std::vector< detid_t > &detectorIDs) const =0
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.