Mantid
Loading...
Searching...
No Matches
SampleShapeValidator.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 +
8#include "MantidAPI/Sample.h"
9#include <memory>
10
11namespace Mantid::API {
12
14std::string SampleShapeValidator::getType() const { return "SampleShape"; }
15
17Kernel::IValidator_sptr SampleShapeValidator::clone() const { return std::make_shared<SampleShapeValidator>(); }
18
24std::string SampleShapeValidator::checkValidity(const std::shared_ptr<ExperimentInfo> &value) const {
25 const auto &sampleShape = value->sample().getShape();
26 if (sampleShape.hasValidShape()) {
27 return "";
28 } else {
29 return "Invalid or no shape defined for sample";
30 }
31}
32
33} // namespace Mantid::API
double value
The value of the point.
Definition: FitMW.cpp:51
Kernel::IValidator_sptr clone() const override
std::string checkValidity(const std::shared_ptr< ExperimentInfo > &value) const override
Checks that the workspace has a valid sample shape defined.
std::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.
Definition: IValidator.h:26