#ifndef TRAPEZOID_HH #define TRAPEZOID_HH //============================================================================= // // Class : Trapezoid // Created : 4-DEC-1997 by Stephen Kahn // Purpose : Characterize a GeometryElement as a TRD1 or TRD2 shape // Components are inner_half_width // outer_half_width // inner_half_length // outer_half_length // half_height // If outer_half_length == inner_half_length or // outer_half_length < 0 we have TRD1 // //============================================================================= #include #include #include namespace dgs { /// A trapezoid. class Trapezoid : public GeometryElement { private : /// Inner half-width. double _inner_half_width; /// Outer half-width. double _outer_half_width; /// Inner half-length double _inner_half_length; /// Outer half-length double _outer_half_length; /// Half-height double _half_height; /// Support for positioning children. CartesianCoordinate xform_to_local(const GeometryXform& )const; /// Support for positioning children. GeometryXform local_to_xform(const CartesianCoordinate& )const; /// Nominal Global position CartesianCoordinate _TrapCenter; /// Inner edge CartesianCoordinate _inner_edge; /// RCS version std::string _cvers; // Replaced at checkout public : /// Default constructor Trapezoid(): _cvers("$Revision: 1.9 $") {} /// Fill trapezoid. void fill_Trapezoid( double dxi, double dxo, double dzi, double dzo, double dh) ; /// Get inner half-width. double get_inner_half_width() const; /// Get outer half-width. double get_outer_half_width() const; /// Get inner half-length. double get_inner_half_length() const; /// Get outer half-length. double get_outer_half_length() const; /// Get half-height. double get_half_height() 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 center of trapezoid to specified Cartesian point. void set_center_xyz( double, double, double); void set_center_xyz(); /// Set Xform. void set_Xform(double, double, double, double ); /// Position child surface a specified local point. bool position_child_at( const CartesianCoordinate& , GeometryElement& ); bool position_child_at( const GeometryXform&, GeometryElement& ); /// Get center of trapezoid. CartesianCoordinate get_center() const; D0_OBJECT_SETUP(Trapezoid); // persistent class }; //#include } #endif // TRAPEZOID_HH