Mantid
Loading...
Searching...
No Matches
ObjCompAssembly.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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#include "MantidGeometry/DllConfig.h"
11#include <string>
12#include <vector>
13
14#ifdef _WIN32
15#pragma warning(disable : 4250)
16#endif
17
18namespace Mantid {
19namespace Geometry {
30class MANTID_GEOMETRY_DLL ObjCompAssembly : public virtual ICompAssembly, public virtual ObjComponent {
31 using comp_it = std::vector<ObjComponent *>::iterator;
32 using const_comp_it = std::vector<ObjComponent *>::const_iterator;
33public:
35 std::string type() const override { return "ObjCompAssembly"; }
37 // ObjCompAssembly();
38
39 ObjCompAssembly(const IComponent *base, const ParameterMap *map);
40
42 ObjCompAssembly(const std::string &, IComponent *reference = nullptr);
45 ObjCompAssembly &operator=(const ObjCompAssembly &);
46 ~ObjCompAssembly() override;
48 IComponent *clone() const override;
50 int nelements() const override;
52 int add(IComponent *) override;
54 int addCopy(IComponent *) override;
56 int addCopy(IComponent *, const std::string &) override;
58 //[] when you have a pointer
59 std::shared_ptr<IComponent> getChild(const int i) const override { return (*this)[i]; }
61 // given name
62 std::shared_ptr<const IComponent> getComponentByName(const std::string &cname, int nlevels = 0) const override;
64 std::shared_ptr<IComponent> operator[](int i) const override;
66 void printChildren(std::ostream &) const override;
67 void printTree(std::ostream &) const override;
68
69 Kernel::Quat getRotation() const override;
70 Kernel::V3D getPos() const override;
71
73 std::shared_ptr<IObject> createOutline();
74 void setOutline(std::shared_ptr<const IObject> obj);
75
78 void testIntersectionWithChildren(Track & /*testRay*/,
79 std::deque<IComponent_const_sptr> & /*searchQueue*/) const override;
80
81 size_t registerContents(class Mantid::Geometry::ComponentVisitor &visitor) const override;
82
83protected:
85 void getChildren(std::vector<IComponent_const_sptr> &outVector, bool recursive) const override;
86
87private:
90
92 std::vector<ObjComponent *> m_group;
93};
94
96using ObjCompAssembly_sptr = std::shared_ptr<ObjCompAssembly>;
98using ObjCompAssembly_const_sptr = std::shared_ptr<const ObjCompAssembly>;
99
100MANTID_GEOMETRY_DLL std::ostream &operator<<(std::ostream &, const ObjCompAssembly &);
101
102} // Namespace Geometry
103} // Namespace Mantid
double obj
the value of the quadratic function
ComponentVisitor : Visitor for IComponents.
Class for Assembly of geometric components.
base class for Geometric IComponent
Definition IComponent.h:53
Class for Assembly of geometric components.
ObjCompAssembly & operator=(const ICompAssembly &)
Private copy assignment operator.
std::vector< ObjComponent * >::iterator comp_it
Iterator type.
std::vector< ObjComponent * >::const_iterator const_comp_it
Const iterator type.
std::shared_ptr< IComponent > getChild(const int i) const override
Get a pointer to the ith component within the assembly. Easier to use than.
std::vector< ObjComponent * > m_group
the group of child components
std::string type() const override
String description of the type of component.
Object Component class, this class brings together the physical attributes of the component to the po...
Parameter map iterator typedef.
Defines a track as a start point and a direction.
Definition Track.h:165
Class for quaternions.
Definition Quat.h:39
Class for 3D vectors.
Definition V3D.h:34
std::shared_ptr< ObjCompAssembly > ObjCompAssembly_sptr
Shared pointer to ObjCompAssembly.
MANTID_GEOMETRY_DLL std::ostream & operator<<(std::ostream &stream, const PointGroup &self)
Returns a streamed representation of the PointGroup object.
std::shared_ptr< const ObjCompAssembly > ObjCompAssembly_const_sptr
Shared pointer to ObjCompAssembly (const version)
Helper class which provides the Collimation Length for SANS instruments.