Page MenuHomec4science

subtraction.hh
No OneTemporary

File Metadata

Created
Thu, Jul 18, 10:36

subtraction.hh

/**
* @file subtraction.hh
* @author Till Junge <till.junge@epfl.ch>
* @date Thu Jul 10 15:31:43 2014
*
* @brief Defines a geometry as a subtraction of one geometry from another
*
* @section LICENSE
*
* <insert lisence here>
*
*/
/* -------------------------------------------------------------------------- */
#ifndef __SUBTRACTION_HH__
#define __SUBTRACTION_HH__
#include "common.hh"
#include "geometry.hh"
template <Uint DIM>
class Subtraction: public Geometry<DIM> {
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
Subtraction(const Geometry<DIM> & includeGeom,
const Geometry<DIM> & excludeGeom,
std::string name = "");
Subtraction(const Subtraction<DIM> & other);
virtual ~Subtraction();
/* ------------------------------------------------------------------------ */
/* 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> & getIncludeGeom() const {return this->includeGeom;}
const Geometry<DIM> & getExcludeGeom() const {return this->excludeGeom;}
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
private:
Geometry<DIM> & includeGeom;
Geometry<DIM> & excludeGeom;
};
/// standard output stream operator
template<Uint DIM>
inline std::ostream & operator <<(std::ostream & stream, const Subtraction<DIM> & _this)
{
_this.printself(stream);
return stream;
}
#endif /* __SUBTRACTION_HH__ */

Event Timeline