ComponentActor.h 2.83 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef COMPONENT_ACTOR_H_
#define COMPONENT_ACTOR_H_
#include "GLActor.h"
#include "GLColor.h"

#include "MantidGeometry/IComponent.h"

/**
  \class  ObjComponentActor
  \brief  ObjComponentActor is an actor class for rendering ObjComponents.
  \author Srikanth Nagella
  \date   March 2009
  \version 1.0

   This class has the implementation for rendering ObjComponents in OpenGL and it inherits from the GLActor

17
  Copyright © 2007 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge National Laboratory & European Spallation Source
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

  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/>.

34
  File change history is stored at: <https://github.com/mantidproject/mantid>
35
36
37
38
39
40
41
42
*/
namespace Mantid
{
  namespace Geometry
  {
    class IObjComponent;
    class IDetector;
    class ObjCompAssembly;
43
    class CompAssembly;
44
45
46
  }
}

47
namespace MantidQt
48
{
49
50
51
52
53
54
55
56
57
	namespace MantidWidgets
	{
		class InstrumentActor;

		class ComponentActor : public GLActor
		{
		public:
			ComponentActor(const InstrumentActor &instrActor, const Mantid::Geometry::ComponentID &compID); ///< Default Constructor
			virtual std::string type()const { return "ComponentActor"; } ///< Type of the GL object
58
59
60
61
62
                        bool accept(GLActorVisitor &visitor,
                                    VisitorAcceptRule rule = VisitAll) override;
                        bool accept(
                            GLActorConstVisitor &visitor,
                            VisitorAcceptRule rule = VisitAll) const override;
63
64
65
66
67
                        boost::shared_ptr<const Mantid::Geometry::IComponent>
                        getComponent() const;
                        boost::shared_ptr<const Mantid::Geometry::IObjComponent>
                        getObjComponent() const;
                        boost::shared_ptr<const Mantid::Geometry::IDetector> getDetector() const;
68
69
70
71
72
73
74
75
76
77
78
79
80
			boost::shared_ptr<const Mantid::Geometry::ObjCompAssembly> getObjCompAssembly() const;
			boost::shared_ptr<const Mantid::Geometry::CompAssembly> getCompAssembly() const;
			virtual void setColors() {}
			/// Check if the component is a non-detector.
			bool isNonDetector() const;
		protected:
			const InstrumentActor& m_instrActor;
			Mantid::Geometry::ComponentID m_id; ///< Component ID
		};
	}//MantidWidgets
}//MantidQt


81
82
83

#endif /*COMPONENT_ACTOR_H_*/