Mantid
Loading...
Searching...
No Matches
IObjComponent.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
9#include "MantidGeometry/DllConfig.h"
13
14namespace Mantid {
15
16namespace Kernel {
17class Material;
18}
19
20namespace Geometry {
21class Track;
22class IObject;
23class GeometryHandler;
24
38class MANTID_GEOMETRY_DLL IObjComponent : public virtual IComponent {
39public:
41 std::string type() const override { return "IObjComponent"; }
42
44
45 IObjComponent(GeometryHandler *the_handler);
46
48
49 IObjComponent &operator=(const IObjComponent &rhs);
50
51 // Looking to get rid of the first of these constructors in due course (and
52 // probably add others)
53 ~IObjComponent() override;
54
58 IComponent *clone() const override = 0;
59
61 virtual bool isValid(const Kernel::V3D &point) const = 0;
62
64 virtual bool isOnSide(const Kernel::V3D &point) const = 0;
65
67 virtual int interceptSurface(Track &track) const = 0;
68
71 virtual double solidAngle(const Geometry::SolidAngleParams &params) const = 0;
72
74 virtual int getPointInObject(Kernel::V3D &point) const = 0;
75
76 // Rendering member functions
78 virtual void draw() const = 0;
79
81 virtual void drawObject() const = 0;
82
85 virtual void initDraw() const = 0;
86
88 virtual const std::shared_ptr<const IObject> shape() const = 0;
90 virtual const Kernel::Material material() const = 0;
91
93 GeometryHandler *Handle() const { return handle.get(); }
94
95protected:
97 void setGeometryHandler(GeometryHandler *h);
98
99private:
101 std::unique_ptr<GeometryHandler> handle;
102
103 friend class GeometryHandler;
104};
105
107using IObjComponent_sptr = std::shared_ptr<IObjComponent>;
109using IObjComponent_const_sptr = std::shared_ptr<const IObjComponent>;
110
111} // namespace Geometry
112} // namespace Mantid
const std::vector< double > & rhs
Handles rendering of all object Geometry.
base class for Geometric IComponent
Definition IComponent.h:53
Object Component class, this class brings together the physical attributes of the component to the po...
GeometryHandler * Handle() const
Gets the GeometryHandler.
virtual const std::shared_ptr< const IObject > shape() const =0
Returns the shape of the Object.
virtual const Kernel::Material material() const =0
Returns the material of the Object.
IComponent * clone() const override=0
Virtual Copy Constructor.
virtual bool isOnSide(const Kernel::V3D &point) const =0
Does the point given lie on the surface of this object component?
virtual int getPointInObject(Kernel::V3D &point) const =0
Try to find a point that lies within (or on) the object.
std::unique_ptr< GeometryHandler > handle
Geometry Handle for rendering.
virtual void initDraw() const =0
Initializes the ObjComponent for rendering, this function should be called before rendering.
virtual bool isValid(const Kernel::V3D &point) const =0
Does the point given lie within this object component?
virtual void draw() const =0
Draws the objcomponent.
virtual int interceptSurface(Track &track) const =0
Checks whether the track given will pass through this Component.
virtual void drawObject() const =0
Draws the Object.
std::string type() const override
type string
virtual double solidAngle(const Geometry::SolidAngleParams &params) const =0
Finds the approximate solid angle covered by the component when viewed from the point given.
Defines a track as a start point and a direction.
Definition Track.h:165
A material is defined as being composed of a given element, defined as a PhysicalConstants::NeutronAt...
Definition Material.h:50
Class for 3D vectors.
Definition V3D.h:34
std::shared_ptr< IObjComponent > IObjComponent_sptr
Shared pointer to IObjComponent.
std::shared_ptr< const IObjComponent > IObjComponent_const_sptr
Shared pointer to IObjComponent (const version)
Helper class which provides the Collimation Length for SANS instruments.