Container.h 2.08 KB
Newer Older
Martyn Gigg's avatar
Martyn Gigg committed
1
2
#ifndef MANTID_GEOMETRY_CONTAINER_H_
#define MANTID_GEOMETRY_CONTAINER_H_
3
4

#include "MantidGeometry/DllConfig.h"
5
#include "MantidGeometry/Objects/CSGObject.h"
6
#include <unordered_map>
7
8
9
10
11

namespace Mantid {
namespace Geometry {

/**
Martyn Gigg's avatar
Martyn Gigg committed
12
  Models a Container is used to hold a sample in the beam. It gets most
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
  of its functionality from Geometry::Object but can also hold a
  definition of what the sample geometry itself would be. If the sample shape
  definition is set then we term this a constriained sample geometry.

  Copyright &copy; 2016 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
  National Laboratory & European Spallation Source

  This file is part of Mantid.

  Mantid is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 3 of the License, or
  (at your option) any later version.

  Mantid is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.

  File change history is stored at: <https://github.com/mantidproject/mantid>
  Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
38
class MANTID_GEOMETRY_DLL Container final : public CSGObject {
39
public:
40
41
  typedef std::unordered_map<std::string, double> ShapeArgs;

Martyn Gigg's avatar
Martyn Gigg committed
42
43
  Container() = default;
  Container(std::string xml);
44
45
46

  bool hasSampleShape() const;
  Object_sptr createSampleShape(const ShapeArgs &args) const;
47

48
  void setSampleShape(const std::string &sampleShapeXML);
49
50

private:
51
  std::string m_sampleShapeXML;
52
53
};

54
/// Typdef for a shared pointer
Martyn Gigg's avatar
Martyn Gigg committed
55
typedef boost::shared_ptr<Container> Container_sptr;
56
/// Typdef for a shared pointer to a const object
Martyn Gigg's avatar
Martyn Gigg committed
57
typedef boost::shared_ptr<const Container> Container_const_sptr;
58

59
60
61
} // namespace Geometry
} // namespace Mantid

Martyn Gigg's avatar
Martyn Gigg committed
62
#endif /* MANTID_GEOMETRY_CONTAINER_H_ */