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 void getChildren(std::vector<IComponent_const_sptr> &outVector, bool recursive) const override;
63 // given name
64 std::shared_ptr<const IComponent> getComponentByName(const std::string &cname, int nlevels = 0) const override;
66 std::shared_ptr<IComponent> operator[](int i) const override;
68 void printChildren(std::ostream &) const override;
69 void printTree(std::ostream &) const override;
70
71 Kernel::Quat getRotation() const override;
72 Kernel::V3D getPos() const override;
73
75 std::shared_ptr<IObject> createOutline();
76 void setOutline(std::shared_ptr<const IObject> obj);
77
80 void testIntersectionWithChildren(Track & /*testRay*/,
81 std::deque<IComponent_const_sptr> & /*searchQueue*/) const override;
82
83 size_t registerContents(class Mantid::Geometry::ComponentVisitor &visitor) const override;
84
85private:
88
90 std::vector<ObjComponent *> m_group;
91};
92
94using ObjCompAssembly_sptr = std::shared_ptr<ObjCompAssembly>;
96using ObjCompAssembly_const_sptr = std::shared_ptr<const ObjCompAssembly>;
97
98MANTID_GEOMETRY_DLL std::ostream &operator<<(std::ostream &, const ObjCompAssembly &);
99
100} // Namespace Geometry
101} // Namespace Mantid
double obj
the value of the quadratic function
ComponentVisitor : Visitor for IComponents.
Class for Assembly of geometric components.
Definition: ICompAssembly.h:30
base class for Geometric IComponent
Definition: IComponent.h:51
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...
Definition: ObjComponent.h:33
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.
Definition: PointGroup.cpp:312
std::shared_ptr< const ObjCompAssembly > ObjCompAssembly_const_sptr
Shared pointer to ObjCompAssembly (const version)
Helper class which provides the Collimation Length for SANS instruments.