50 inside(
const std::vector< double >& )
const override
108 std::vector< long > shape = d.get< std::vector< long > >(
names::shape );
120 throw BadProperty(
"Grid mask must be 2- or 3-dimensional." );
144 d[ get_name() ] = maskd;
146 long shape_x = lower_right_[ 0 ] - upper_left_[ 0 ];
147 long shape_y = lower_right_[ 1 ] - upper_left_[ 1 ];
148 std::vector< long > shape_dim { shape_x, shape_y };
152 long shape_z = lower_right_[ 2 ] - upper_left_[ 2 ];
153 shape_dim.push_back( shape_z );
164 lower_right_ = lower_right_ - upper_left_ - anchor;
165 upper_left_ = -anchor;
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Abstract base class for masks with unspecified dimension.
Definition mask.h:51
Exception to be thrown if a status parameter is incomplete or inconsistent.
Definition exceptions.h:680
Mask defined in terms of grid points rather than spacial coordinates.
Definition grid_mask.h:40
GridMask(const Dictionary &d)
Parameters: shape - size in grid coordinates (length 2 for 2D layers or length 3 for 3D layers)
Definition grid_mask.h:106
Dictionary get_dict() const override
Definition grid_mask.h:140
void set_anchor(const Position< D, int > &)
Definition grid_mask.h:162
Position< D, int > get_lower_right() const
Definition grid_mask.h:95
Position< D, int > lower_right_
Definition grid_mask.h:102
bool inside(const std::vector< double > &) const override
Definition grid_mask.h:50
static std::string get_name()
Position< D, int > upper_left_
Definition grid_mask.h:101
AbstractMask * intersect_mask(const AbstractMask &) const override
Create the intersection of this mask with another.
Definition grid_mask.h:71
Position< D, int > get_upper_left() const
Definition grid_mask.h:89
AbstractMask * union_mask(const AbstractMask &) const override
Create the union of this mask with another.
Definition grid_mask.h:77
GridMask< D > * clone() const
Definition grid_mask.h:60
AbstractMask * minus_mask(const AbstractMask &) const override
Create the difference of this mask and another.
Definition grid_mask.h:83
Base class for all Kernel exceptions.
Definition exceptions.h:65
const std::string shape("shape")
const std::string grid3d("grid3d")
const std::string grid("grid")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33