Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "MantidDataHandling/LoadShape.h"
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/FileProperty.h"
#include "MantidAPI/InstrumentValidator.h"
#include "MantidAPI/WorkspaceFactory.h"
#include "MantidGeometry/Instrument.h"
#include "MantidKernel/CompositeValidator.h"
#include "MantidKernel/EnabledWhenProperty.h"
#include "MantidKernel/Exception.h"
#include <Poco/File.h>
namespace Mantid {
namespace DataHandling {
// Register the algorithm into the algorithm factory
DECLARE_ALGORITHM(LoadShape)
using namespace Kernel;
using namespace API;
void LoadShape::init() {
auto wsValidator = boost::make_shared<CompositeValidator>();
wsValidator->add<API::InstrumentValidator>();
// input workspace
declareProperty(
make_unique<WorkspaceProperty<>>("InputWorkspace", "", Direction::Input,
wsValidator),
"The name of the workspace containing the instrument to add the shape");
// shape file
const std::vector<std::string> extensions{ ".stl" };
declareProperty(
make_unique<FileProperty>(
"Filename", "", FileProperty::Load, extensions),
"The name of the file containing the shape. "
"Extension must be .stl");
// attach to sample
declareProperty("Attach to sample", false,
"If true, the shape will be attached to the sample,"
"else you need to specify the component to which it is attached.");
// component name
declareProperty<std::string>("Component name", "",
"Name of component, to which to attach shape.");
setPropertySettings("Component name", make_unique<EnabledWhenProperty>(
"Attach to Sample", IS_EQUAL_TO, "0"));
// Output workspace
declareProperty(
make_unique<WorkspaceProperty<Workspace>>(
"OutputWorkspace", "", Direction::Output),
"The name of the workspace that will be same as"
"the input workspace but with shape added to it");
}
void LoadShape::exec() {
}
} // end DataHandling namespace
} // end MantidNamespace