35 const Mask* other_d =
dynamic_cast< const Mask*
>( &other );
38 throw BadProperty(
"Masks must have same number of dimensions." );
47 const Mask* other_d =
dynamic_cast< const Mask*
>( &other );
50 throw BadProperty(
"Masks must have same number of dimensions." );
59 const Mask* other_d =
dynamic_cast< const Mask*
>( &other );
62 throw BadProperty(
"Masks must have same number of dimensions." );
79 for (
int i = 0; i < D; ++i )
93 return (
inside( b.lower_left ) and
inside( b.upper_right ) );
106 for (
int i = 0; i < D; ++i )
151 for (
int i = 0; i < D; ++i )
153 const double di = std::abs( p[ i ] -
center_[ i ] );
176 for (
int i = 0; i < D; ++i )
191 for (
int i = 0; i < D; ++i )
226 std::vector< double > radii( 3 );
239 radii[ 0 ] = greatest_semi_axis;
240 radii[ 1 ] = greatest_semi_axis;
241 radii[ 2 ] = greatest_semi_axis;
244 for (
int i = 0; i < D; ++i )
260 for (
int i = 0; i < D; ++i )
328 for (
int i = 0; i < D; ++i )
376 for (
int i = 0; i < D; ++i )
422 return mask1_->get_bbox();
436 return m_->inside( -p );
443 return m_->inside(
Box< D >( -b.upper_right, -b.lower_left ) );
450 return m_->outside(
Box< D >( -b.upper_right, -b.lower_left ) );
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
AnchoredMask(const Mask< D > &m, Position< D > anchor)
Construct the converse of the two given mask.
Definition mask.h:685
bool outside(const Box< D > &b) const
Definition mask_impl.h:484
Box< D > get_bbox() const
The whole mask is inside (i.e., false everywhere outside) the bounding box.
Definition mask_impl.h:491
bool inside(const Position< D > &p) const
Definition mask_impl.h:470
Mask< D > * m_
Definition mask.h:716
Position< D > anchor_
Definition mask.h:717
Mask< D > * clone() const
Clone method.
Definition mask_impl.h:499
Dictionary get_dict() const
Definition mask_impl.h:506
Exception to be thrown if a status parameter is incomplete or inconsistent.
Definition exceptions.h:680
static std::string get_name()
Dictionary get_dict() const override
Definition mask_impl.h:208
BallMask(Position< D > center, double radius)
Definition mask.h:314
bool outside(const Box< D > &b) const override
Definition mask_impl.h:172
bool inside(const Position< D > &p) const override
Definition mask_impl.h:146
Mask< D > * clone() const override
Clone method.
Definition mask_impl.h:201
double radius_
Definition mask.h:361
Position< D > center_
Definition mask.h:360
Box< D > get_bbox() const override
The whole mask is inside (i.e., false everywhere outside) the bounding box.
Definition mask_impl.h:188
Position< D > max_values_
Definition mask.h:274
bool outside(const Box< D > &b) const override
Definition mask_impl.h:98
Position< D > lower_left_
Definition mask.h:264
Position< D > upper_right_
Definition mask.h:265
Box< D > get_bbox() const override
The whole mask is inside (i.e., false everywhere outside) the bounding box.
Definition mask_impl.h:118
double polar_angle_
Definition mask.h:277
bool inside(const Position< D > &p) const override
Dictionary get_dict() const override
Definition mask_impl.h:132
BoxMask(const Dictionary &)
Parameters that should be in the dictionary: lower_left - Position of lower left corner (array of dou...
Definition mask.h:735
static std::string get_name()
Position< D > min_values_
The {min,max}_values_ correspond to the minimum and maximum x, y, z values after the box has been rot...
Definition mask.h:273
Mask< D > * clone() const override
Clone method.
Definition mask_impl.h:125
double azimuth_angle_
Definition mask.h:276
Mask< D > * m_
Definition mask.h:668
Box< D > get_bbox() const
The whole mask is inside (i.e., false everywhere outside) the bounding box.
Definition mask_impl.h:455
bool inside(const Position< D > &p) const
Definition mask_impl.h:434
ConverseMask(const Mask< D > &m)
Construct the converse of the two given mask.
Definition mask.h:641
Mask< D > * clone() const
Clone method.
Definition mask_impl.h:463
bool outside(const Box< D > &b) const
Definition mask_impl.h:448
Mask combining two masks with a minus operation, the difference.
Definition mask.h:586
Box< D > get_bbox() const
The whole mask is inside (i.e., false everywhere outside) the bounding box.
Definition mask_impl.h:420
Mask< D > * clone() const
Clone method.
Definition mask_impl.h:427
bool outside(const Box< D > &b) const
Definition mask_impl.h:413
DifferenceMask(const Mask< D > &m1, const Mask< D > &m2)
Construct the difference of the two given masks.
Definition mask.h:594
bool inside(const Position< D > &p) const
Definition mask_impl.h:399
Mask< D > * mask1_
Definition mask.h:624
Mask< D > * mask2_
Definition mask.h:624
double azimuth_angle_
Definition mask.h:471
double polar_axis_
Definition mask.h:470
void create_bbox_()
Definition mask_impl.h:220
Mask< D > * clone() const override
Clone method.
Definition mask_impl.h:279
EllipseMask(Position< D > center, double major_axis, double minor_axis, double polar_axis, double azimuth_angle, double polar_angle)
Definition mask.h:381
Dictionary get_dict() const override
Definition mask_impl.h:286
double major_axis_
Definition mask.h:468
static std::string get_name()
double polar_angle_
Definition mask.h:472
Position< D > center_
Definition mask.h:467
Box< D > bbox_
Definition mask.h:483
double minor_axis_
Definition mask.h:469
Box< D > get_bbox() const override
The whole mask is inside (i.e., false everywhere outside) the bounding box.
Definition mask_impl.h:272
bool outside(const Box< D > &b) const override
Definition mask_impl.h:253
Mask combining two masks with a Boolean AND, the intersection.
Definition mask.h:491
Box< D > get_bbox() const
The whole mask is inside (i.e., false everywhere outside) the bounding box.
Definition mask_impl.h:324
Mask< D > * mask1_
Definition mask.h:532
Mask< D > * clone() const
Clone method.
Definition mask_impl.h:344
Mask< D > * mask2_
Definition mask.h:532
bool outside(const Box< D > &b) const
Definition mask_impl.h:317
IntersectionMask(const Mask< D > &m1, const Mask< D > &m2)
Construct the intersection of the two given masks.
Definition mask.h:499
bool inside(const Position< D > &p) const
Definition mask_impl.h:303
Abstract base class for masks with given dimension.
Definition mask.h:101
AbstractMask * intersect_mask(const AbstractMask &other) const override
Create the intersection of this mask with another.
Definition mask_impl.h:33
virtual bool inside(const Position< D > &) const =0
virtual Box< D > get_bbox() const =0
The whole mask is inside (i.e., false everywhere outside) the bounding box.
virtual bool outside(const Box< D > &b) const
Definition mask_impl.h:76
AbstractMask * minus_mask(const AbstractMask &other) const override
Create the difference of this mask and another.
Definition mask_impl.h:57
AbstractMask * union_mask(const AbstractMask &other) const override
Create the union of this mask with another.
Definition mask_impl.h:45
Mask combining two masks with a Boolean OR, the sum.
Definition mask.h:540
Mask< D > * mask2_
Definition mask.h:578
bool inside(const Position< D > &p) const
Definition mask_impl.h:351
Box< D > get_bbox() const
The whole mask is inside (i.e., false everywhere outside) the bounding box.
Definition mask_impl.h:372
Mask< D > * mask1_
Definition mask.h:578
UnionMask(const Mask< D > &m1, const Mask< D > &m2)
Construct the union of the two given masks.
Definition mask.h:548
bool outside(const Box< D > &b) const
Definition mask_impl.h:365
Mask< D > * clone() const
Clone method.
Definition mask_impl.h:392
const std::string polar_axis("polar_axis")
const std::string polar_angle("polar_angle")
const std::string anchor("anchor")
const std::string azimuth_angle("azimuth_angle")
const std::string minor_axis("minor_axis")
const std::string radius("radius")
const std::string major_axis("major_axis")
const std::string lower_left("lower_left")
const std::string upper_right("upper_right")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
bool inside(const std::vector< double > &point, const MaskPTR mask)
Definition spatial.cpp:499
A box is defined by the lower left corner (minimum coordinates) and the upper right corner (maximum c...
Definition position.h:321
Position< D > lower_left
Definition position.h:331
Position< D > upper_right
Definition position.h:332