#ifndef __DRCSURFPOLYPARA_H__ #define __DRCSURFPOLYPARA_H__ /*! \brief Representation of a parabolic surface It is limited by a polygon made up by points. The "radius" of the parabolic surface can be given. The radius is twice the focal length. The definition of the parabola is given by \f$ p-z = \frac{x^2+y^2}{2p}\f$, where p plays the role of the radius. The definition is very close to that of \sa DrcSurfPolySphere The borders of the parabola are defined by a projection on the x-y plane. This projection is defined by a polygone with points which you can add. \sa addPoint The z-components of these points have to be zero. Such defined, the paraboloid can be positioned and rotated by \sa shift \sa rotate The rotation is performed before the shift operation. */ class DrcSurfPolyPara : public DrcSurfPolyFlat { private: //! The radius of the sphere. double m_radius; //! Flag if dimensions are checked. mutable bool m_checked; //! Transform Transform3D m_trans; //! Inverse transform Transform3D m_transInv; private: /*! \brief Auxiliary function for assignment operator and copy constructor.. \param s The object to copy. */ void copy(const DrcSurfPolyPara& s); /*! \brief Check dimensions of parabolic surface. The radius has to be given and the points of the polygon have to be such that the projection is within the half parabolic shape. /return true if ok. */ bool check() const; public: DrcSurfPolyPara(); //!< Empty constructor. /*! \brief Copy constructor. \param s Object to copy. */ DrcSurfPolyPara(const DrcSurfPolyPara& s); /*! \brief Assignment operator. \param s Object to assign. */ DrcSurfPolyPara& operator=(const DrcSurfPolyPara& s); virtual ~DrcSurfPolyPara(){}; /*! \brief Set the radius of the sphere. \param radius The radius [mm] */ void setRadius(double radius){m_radius=radius;}; /*! Point limiting the sphere. The paraboloid construction points are not the same as the limiting points of the sphere itself. This function returns the limiting points. \param i Index of point starting with 0 \return The point. */ XYZPoint limitingPoint(unsigned int i); /*! Center point of the surface. Like the /sa limitingPoint this function returns the point on the z-axis at construction after applying transformations. \return The transformed center point. */ XYZPoint centerPoint(); // implemetation of pure virtual functions. virtual DrcSurfPolyPara* clone() const; XYZVector normal(const XYZPoint& point) const; bool surfaceHit(DrcPhoton& ph, XYZPoint& pos_new, double& path_length) const; void print(fstream& stream) const; void addTransform(const Transform3D& trans); virtual bool isFlat(){return false;}; }; #endif