#ifndef ANNULARSURFACESECTION_HH #define ANNULARSURFACESECTION_HH // // $Id: AnnularSurfaceSection.hpp,v 1.7 1998/10/23 14:32:48 hobbs Exp $ // // File: disk.hh // Purpose: // Created: 16-SEP-1997 John Hobbs // // $Revision: 1.7 $ // // // Include files #include #include namespace dgs { class CylindricalCoordinate; /** A section of an annular surface. {\bf AnnularSurfaceSection} is an annulus (section of a plane) that does not form a full circle. The radial extent is from $r_{min}$ to $r_{max}$, and angular range is from $0$ to $\phi_{max}$. */ class AnnularSurfaceSection : public GeometryElement { public: /// Default constructor. AnnularSurfaceSection(): _rmin(0.0), _rmax(0.0), _phimax(0.0), _cvers("Revision:$") {} /// Construct an annulus with specified rmin, rmax and phimax. AnnularSurfaceSection(const double rmin, const double rmax, const double phimax): _rmin(rmin), _rmax(rmax), _phimax(phimax), _cvers("Revision:$") {} /// Convert local point to global one. virtual SpacePoint local_to_global(const CylindricalCoordinate& lpt) const; /// Convert global point to local one. virtual CylindricalCoordinate global_to_local(const SpacePoint & gpt) const; /// Resize annulus by specified changes to rmin, rmax and phimax. bool resize(const double drmin, const double drmax, const double dphimax); /// Position child surface at specified local point. bool position_child_at(const CylindricalCoordinate& lpt, GeometryElement& kid); /// Access rmin. double get_rmin() const { return _rmin; } /// Access rmax. double get_rmax() const { return _rmax; } /// Access phimax. double get_phimax() const { return _phimax; } /// Stream insertion operator. friend std::ostream& operator<<(std::ostream& os, const AnnularSurfaceSection& me); /// Get source code version. Kept to allow following code changes const std::string& code_version() const { return _cvers; } private: /// rmin. double _rmin; /// rmax. double _rmax; /// phimax. double _phimax; /// Support for placing children. CylindricalCoordinate xform_to_local(const GeometryXform& xf) const; /// Support for placing children. GeometryXform local_to_xform(const CylindricalCoordinate& lpt) const; /// RCS version std::string _cvers; // Replaced at checkout public: D0_OBJECT_SETUP(AnnularSurfaceSection); }; } #endif //ANNULARSURFACESECTION_HH