/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
DataFormats/GeometrySurface/interface/Cone.h
67 строк
2 KB
Cms Build
Clang-Format
11 июн 2019, 11:30
11 июн 2019, 11:30
044a211
Код
Авторство
О чём код?
#ifndef Geom_Cone_H #define Geom_Cone_H /** \class Cone * * A Cone. * * \warning Surfaces are reference counted, so only ReferenceCountingPointer * should be used to point to them. For this reason, they should be * using the static build() method. * (The normal constructors will become private in the future). * */ #include "DataFormats/GeometrySurface/interface/Surface.h" class Cone final : public Surface { public: template <typename... Args> Cone(const PositionType& vert, Geom::Theta<Scalar> angle, Args&&... args) : Surface(std::forward<Args>(args)...), theVertex(vert), theAngle(angle) {} typedef ReferenceCountingPointer<Cone> ConePointer; typedef ReferenceCountingPointer<Cone> ConstConePointer; /// Construct a cone with the specified vertex and opening angle. /// The reference frame is defined by pos and rot; /// the cone axis is parallel to the local Z axis. static ConePointer build(const PositionType& pos, const RotationType& rot, const PositionType& vert, Geom::Theta<Scalar> angle) { return ConePointer(new Cone(vert, angle, pos, rot)); } // -- DEPRECATED CONSTRUCTOR /// Do not use this constructor directly; use the static build method, /// which returns a ReferenceCountingPointer. /// This constructor will soon become private Cone(const PositionType& pos, const RotationType& rot, const PositionType& vert, Geom::Theta<Scalar> angle) : Surface(pos, rot), theVertex(vert), theAngle(angle) {} // -- Extension of Surface interface for cone /// Global position of the cone vertex GlobalPoint vertex() const { return theVertex; } /// Angle of the cone Geom::Theta<float> openingAngle() const { return theAngle; } // -- Implementation of Surface interface Side side(const LocalPoint& p, Scalar tolerance) const override { return side(toGlobal(p), tolerance); } Side side(const GlobalPoint& p, Scalar tolerance) const override; // Tangent plane to surface from global point ConstReferenceCountingPointer<TangentPlane> tangentPlane(const GlobalPoint&) const override; // Tangent plane to surface from local point ConstReferenceCountingPointer<TangentPlane> tangentPlane(const LocalPoint&) const override; private: GlobalPoint theVertex; Geom::Theta<Scalar> theAngle; }; #endif