#ifndef POLYVOL_HH #define POLYVOL_HH #include #include namespace dgs { /// A generalized polygon. class PolyVol : public GeometryElement { private : /// number of sides in x-y plane int _numberSides; /// half width along local z-direction double _dz; /// half lengths of sides in x-y plane double _halfLengths[10]; /// angles of sides in local x-y plane double _angles[10]; /// position of volume corner at (0,0) in local x-y coord. CartesianCoordinate _volPos; /// Support for positioning children. CartesianCoordinate xform_to_local(const GeometryXform&) const; /// Support for positioning children. GeometryXform local_to_xform(const CartesianCoordinate&) const; /// RCS version std::string _cvers; // Replaced at checkout public : /// Default constructor. PolyVol(): _cvers("Revision:$") {} /// Fill volume void fill_Vol(int ns, double dz, double hl[10], double ang[10]); /// returns number of sides int get_number_sides() const; /// resturns half width double get_dz() const; /// returns half lengths void get_half_lengths(double *half_lengths) const; /// returns angles void get_angles(double *angles) const; /// Convert local point to global one. SpacePoint local_to_global( const CartesianCoordinate&) const; /// Convert global point to local one. CartesianCoordinate global_to_local(const SpacePoint&) const; /// Set corner of volume to specified Cartesian point. void set_corner_xyz(); /// Set Xform. void set_Xform(double, double, double, double); /// Position child surface at specfied local point. bool position_child_at( const CartesianCoordinate& , GeometryElement& ); /// Get position of volume. CartesianCoordinate get_corner() const { return _volPos;} /// Get source code version. Kept to allow following code changes const std::string& code_version() const { return _cvers; } D0_OBJECT_SETUP(PolyVol); // persistent class }; } #endif // POLYVOL_HH