#ifndef __PNDDRCSURFPOLYFLAT_H__ #define __PNDDRCSURFPOLYFLAT_H__ /*! \brief Abstract class for flat surface representation, defined by a sequence of point going arround the surface. */ class PndDrcSurfPolyFlat : public PndDrcSurfAbs { protected: //! Vector of surface boundary points. vector m_p; private: //! Normal vector. XYZVector m_normal; /*! \brief Auxiliary function for assignment operator and copy constructor.. \param s The object to copy. */ void copy(const PndDrcSurfPolyFlat& s); /*! \brief Line intersection between two lines each define by two points. The intersection has to be between the points. \param p1a 1st point of 1st line \param p1b 2nd point of 1st line \param p2a 1st point of 2nd line \param p2b 2nd point of 2nd line \return Flag if intersection exists. */ bool lineCross(const XYZPoint& p1a, const XYZPoint& p1b, const XYZPoint& p2a, const XYZPoint& p2b) const; public: PndDrcSurfPolyFlat(); //!< Empty constructor. /*! \brief Copy constructor. \param s Object to copy. */ PndDrcSurfPolyFlat(const PndDrcSurfPolyFlat& s); /*! \brief Assignment operator. \param s Object to assign. */ PndDrcSurfPolyFlat& operator=(const PndDrcSurfPolyFlat& s); /*! \brief Add a surface boundary point \param point The point */ void addPoint(XYZPoint point); /*! \brief Test if point within surface. \param point Point to test. \return true if within surface. */ bool withinSurface(XYZPoint& point) const; // implemetation of pure virtual functions. virtual PndDrcSurfPolyFlat* clone() const; XYZVector normal(const XYZPoint& point) const; bool surfaceHit(PndDrcPhoton& ph, XYZPoint& pos_new, double& path_length) const; void print(fstream& stream) const; void addTransform(const Transform3D& trans); virtual bool isFlat(){return true;}; }; #endif