Page MenuHomec4science

union.hh
No OneTemporary

File Metadata

Created
Sat, Aug 17, 23:34

union.hh

/**
* @file union.hh
* @author Till Junge <till.junge@epfl.ch>
* @date Thu Jul 3 11:10:31 2014
*
* @brief Class defines a geometry as a union of two Geometries
*
* @section LICENSE
*
* <insert lisence here>
*
*/
/* -------------------------------------------------------------------------- */
#ifndef __UNION_HH__
#define __UNION_HH__
#include "common.hh"
#include "geometry.hh"
template <Uint DIM>
class Union: public Geometry<DIM> {
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
Union(const Geometry<DIM>& geomA, const Geometry<DIM>& geomB,
std::string name = "");
Union(const Union<DIM> & other);
virtual ~Union();
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
public:
/// function to print the content of the class
virtual void printself(std::ostream & stream, int indent = 0) const;
virtual void shift(const PointRef<DIM> & offset);
virtual Geometry<DIM> * resolveType() const;
virtual bool is_inside(const Real * point, Real tol) const;
virtual InsideObject from_border(const Real * point, Real tol) const;
virtual Real min_in_direction(const Real * dir, const Real & unit = 1) const;
virtual Real max_in_direction(const Real * dir, const Real & unit = 1) const;
/* ------------------------------------------------------------------------ */
/* Accessors */
/* ------------------------------------------------------------------------ */
public:
const Geometry<DIM> & getGeomA() const {return this->geomA;}
const Geometry<DIM> & getGeomB() const {return this->geomB;}
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
private:
Geometry<DIM> & geomA;
Geometry<DIM> & geomB;
};
/// standard output stream operator
template<Uint DIM>
inline std::ostream & operator <<(std::ostream & stream, const Union<DIM> & _this)
{
_this.printself(stream);
return stream;
}
#endif /* __UNION_HH__ */

Event Timeline