#ifndef PLANE_HH #define PLANE_HH // // $Id: Plane.hpp,v 1.9 1998/10/23 14:32:52 hobbs Exp $ // // File: Plane.hh // Purpose: // Created: 12-SEP-1997 John Hobbs // // $Revision: 1.9 $ // // // Include files #include namespace dgs { #ifndef CARTESIANCOORDINATE_HH class CartesianCoordinate; #endif #ifndef CARTESIANMATRIX_HPP class CartesianMatrix; #endif /** A plane. A plane is a surface of size $2x_{1/2}$ by $2y_{1/2}$. The plane is oriented in the x,y plane. */ class Plane: public GeometryElement { public: /// Default constructor. Plane(): _cvers("$Revision: 1.9 $") {} /// Construct plane with x,y half-lengths specified. Plane(const double xhalf, const double yhalf): _xhalf(xhalf), _yhalf(yhalf), _cvers("$Revision: 1.9 $") {} /// Convert local point to global one. virtual SpacePoint local_to_global(const CartesianCoordinate& lpt) const; /// Convert Matrix in local coordinates to matrix in global coordinates virtual MatrixD local_to_global(const CartesianMatrix& theMatrix) const; /// Convert global point to local one. virtual CartesianCoordinate global_to_local(const SpacePoint& gpt) const; /// Resize plane by given amounts in x and y. bool resize(const double dxhalf, const double dyhalf); /// Position child surface at specified local coordinate. bool position_child_at(const CartesianCoordinate& lpt, GeometryElement& kid); /// Get x half-length of plane. double get_xsize() const { return _xhalf; } /// Get y half-length of plane. double get_ysize() const { return _yhalf; } /// Get source code version. Kept to allow following code changes const std::string& code_version() const { return _cvers; } /// Stream insertion operator. friend std::ostream& operator<<(std::ostream& os, const Plane& me); private: /// x half-length. double _xhalf; /// y half-length. double _yhalf; /// Support for positioning children. CartesianCoordinate xform_to_local(const GeometryXform& xf) const; /// Support for positioning children. GeometryXform local_to_xform(const CartesianCoordinate& lpt) const; /// RCS version std::string _cvers; // Replaced at checkout public: D0_OBJECT_SETUP(Plane); }; } #endif //PLANE_HH