Mantid
Loading...
Searching...
No Matches
Framework
PythonInterface
mantid
geometry
src
Exports
ICompAssembly.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 +
7
#include "
MantidGeometry/ICompAssembly.h
"
8
#include "
MantidPythonInterface/core/GetPointer.h
"
9
#include <boost/python/class.hpp>
10
#include <boost/python/register_ptr_to_python.hpp>
11
12
using
Mantid::Geometry::ICompAssembly
;
13
using
Mantid::Geometry::IComponent
;
14
using namespace
boost::python
;
15
16
GET_POINTER_SPECIALIZATION
(
ICompAssembly
)
17
18
void
export_ICompAssembly
() {
19
register_ptr_to_python<std::shared_ptr<ICompAssembly>>();
20
21
class_<ICompAssembly, boost::python::bases<IComponent>, boost::noncopyable>(
"ICompAssembly"
, no_init)
22
.def(
"nelements"
, &
ICompAssembly::nelements
, arg(
"self"
),
"Returns the number of elements in the assembly"
)
23
.def(
"__len__"
, &
ICompAssembly::nelements
, arg(
"self"
),
"Returns the number of elements in the assembly"
)
24
.def(
"__getitem__"
, &ICompAssembly::operator[], (arg(
"self"
), arg(
"index"
)),
25
"Return the component at the given index"
);
26
}
GetPointer.h
GET_POINTER_SPECIALIZATION
#define GET_POINTER_SPECIALIZATION(TYPE)
Definition
GetPointer.h:17
export_ICompAssembly
void export_ICompAssembly()
Definition
ICompAssembly.cpp:18
ICompAssembly.h
Mantid::Geometry::ICompAssembly
Class for Assembly of geometric components.
Definition
ICompAssembly.h:30
Mantid::Geometry::ICompAssembly::nelements
virtual int nelements() const =0
Return the number of elements in the assembly.
Mantid::Geometry::IComponent
base class for Geometric IComponent
Definition
IComponent.h:53
boost::python
Definition
NDArray.h:50
Generated by
1.9.8