#ifndef WEDGE_HPP #define WEDGE_HPP // // $Id: Wedge.hpp,v 1.10 1998/11/04 22:56:55 hobbs Exp $ // // File: Wedge.hpp // Purpose: // Created: 22-NOV-1997 Emanuela Barberis // // $Revision: 1.10 $ // // // Include files #include #ifndef MATRIX_H class MatrixD; #endif namespace dgs { #ifndef CARTESIANCOORDINATE_HH class CartesianCoordinate; #endif #ifndef CARTESIANMATRIX_HPP class CartesianMatrix; #endif /** A Wedge. A wedge. */ class Wedge: public GeometryElement { public: /// Default constructor. Wedge (): _halfwidth1(0.0), _halfwidth2(0.0), _halfheight(0.0), _cvers("$Revision: 1.10 $") {} /// Construct wedge with specified half-widths and half-height. Wedge(const double halfwidth1, const double halfwidth2, const double halfheight): _halfwidth1(halfwidth1), _halfwidth2(halfwidth2), _halfheight(halfheight), _cvers("$Revision: 1.10 $") {} /// Convert local point to global one. virtual SpacePoint local_to_global(const CartesianCoordinate& lpt) const; /// Convert local point to global one. 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 a wedge with specified changes to half-widths and half-height. bool resize(const double dhalfwidth1, const double dhalfwidth2, const double dhalfheight); /// Position child surface at specified local point. bool position_child_at(const CartesianCoordinate& lpt, GeometryElement& kid); /// The GeometryElement interface (will be a dummy - never any kids) const std::list get_children(); /// Get half-width 1. double get_hw1size() const { return _halfwidth1; } /// Get half-width 2. double get_hw2size() const { return _halfwidth2; } /// Get half-height. double get_hhsize() const { return _halfheight; } /// 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 Wedge& me); private: /// Half-width 1. double _halfwidth1; /// Half-width 2. double _halfwidth2; /// Half-height. double _halfheight; /// 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(Wedge); }; } #endif //WEDGE_HPP