Mask defining a box region. More...
#include <mask.h>
Public Member Functions | |
| BoxMask (const Dictionary &) | |
| Parameters that should be in the dictionary: lower_left - Position of lower left corner (array of doubles) upper_right - Position of upper right corner (array of doubles) azimuth_angle - Rotation angle in degrees from x-axis (double), optional polar_angle - Rotation angle in degrees from z-axis (double), the polar angle does not apply in 2D, optional. | |
| BoxMask (const Position< D > &lower_left, const Position< D > &upper_right, const double azimuth_angle=0.0, const double polar_angle=0.0) | |
| ~BoxMask () override | |
| bool | inside (const Position< D > &p) const override |
| bool | inside (const Box< D > &b) const override |
| bool | outside (const Box< D > &b) const override |
| Box< D > | get_bbox () const override |
| The whole mask is inside (i.e., false everywhere outside) the bounding box. | |
| Dictionary | get_dict () const override |
| Mask< D > * | clone () const override |
| Clone method. | |
| bool | inside (const Position< 2 > &p) const |
| bool | inside (const Position< 3 > &p) const |
| std::string | get_name () |
| std::string | get_name () |
Public Member Functions inherited from nest::Mask< D > | |
| ~Mask () override | |
| bool | inside (const std::vector< double > &pt) const override |
| AbstractMask * | intersect_mask (const AbstractMask &other) const override |
| Create the intersection of this mask with another. | |
| AbstractMask * | union_mask (const AbstractMask &other) const override |
| Create the union of this mask with another. | |
| AbstractMask * | minus_mask (const AbstractMask &other) const override |
| Create the difference of this mask and another. | |
| virtual bool | inside (const std::vector< double > &) const=0 |
Public Member Functions inherited from nest::AbstractMask | |
| virtual | ~AbstractMask () |
Static Public Member Functions | |
| static std::string | get_name () |
Protected Member Functions | |
| void | calculate_min_max_values_ () |
| Calculate the min/max x, y, z values in case of a rotated box. | |
| void | calculate_min_max_values_ () |
| void | calculate_min_max_values_ () |
| Specialization of calculate_min_max_values_() for 3 dimensions. | |
Protected Attributes | |
| Position< D > | lower_left_ |
| Position< D > | upper_right_ |
| Position< D > | min_values_ |
| The {min,max}_values_ correspond to the minimum and maximum x, y, z values after the box has been rotated. | |
| Position< D > | max_values_ |
| double | azimuth_angle_ |
| double | polar_angle_ |
| double | azimuth_cos_ |
| double | azimuth_sin_ |
| double | polar_cos_ |
| double | polar_sin_ |
| Position< D > | cntr_ |
| Position< D > | eps_ |
| double | cntr_x_az_cos_ |
| double | cntr_x_az_sin_ |
| double | cntr_y_az_cos_ |
| double | cntr_y_az_sin_ |
| double | cntr_z_pol_cos_ |
| double | cntr_z_pol_sin_ |
| double | cntr_x_az_cos_pol_cos_ |
| double | cntr_x_az_cos_pol_sin_ |
| double | cntr_y_az_sin_pol_cos_ |
| double | cntr_y_az_sin_pol_sin_ |
| double | az_cos_pol_cos_ |
| double | az_cos_pol_sin_ |
| double | az_sin_pol_cos_ |
| double | az_sin_pol_sin_ |
| bool | is_rotated_ |
Mask defining a box region.
| nest::BoxMask< D >::BoxMask | ( | const Dictionary & | d | ) |
Parameters that should be in the dictionary: lower_left - Position of lower left corner (array of doubles) upper_right - Position of upper right corner (array of doubles) azimuth_angle - Rotation angle in degrees from x-axis (double), optional polar_angle - Rotation angle in degrees from z-axis (double), the polar angle does not apply in 2D, optional.
References nest::names::azimuth_angle(), nest::names::lower_left(), numerics::pi, nest::names::polar_angle(), and nest::names::upper_right().
|
inline |
References nest::BoxMask< D >::az_cos_pol_cos_, nest::BoxMask< D >::az_cos_pol_sin_, nest::BoxMask< D >::az_sin_pol_cos_, nest::BoxMask< D >::az_sin_pol_sin_, nest::BoxMask< D >::azimuth_angle_, nest::BoxMask< D >::azimuth_cos_, nest::BoxMask< D >::azimuth_sin_, nest::BoxMask< D >::calculate_min_max_values_(), nest::BoxMask< D >::cntr_, nest::BoxMask< D >::cntr_x_az_cos_, nest::BoxMask< D >::cntr_x_az_cos_pol_cos_, nest::BoxMask< D >::cntr_x_az_cos_pol_sin_, nest::BoxMask< D >::cntr_y_az_sin_, nest::BoxMask< D >::cntr_y_az_sin_pol_cos_, nest::BoxMask< D >::cntr_y_az_sin_pol_sin_, nest::BoxMask< D >::cntr_z_pol_cos_, nest::BoxMask< D >::cntr_z_pol_sin_, nest::BoxMask< D >::eps_, nest::BoxMask< D >::is_rotated_, nest::BoxMask< D >::polar_angle_, nest::BoxMask< D >::polar_cos_, and nest::BoxMask< D >::polar_sin_.
|
inlineoverride |
|
protected |
|
protected |
Specialization of calculate_min_max_values_() for 3 dimensions.
Rotate the corners of the box to find the new minimum and maximum x, y and z values to define the bounding box of the rotated box. We need to rotate all eight corners. If the box is not rotated, the min values correspond to the lower_left values and the max values correspond to the upper_right values.
LLH LHH *--------* /| /| / |LLL / |LHL
–--—*–* HLH| / HHH| / |/ |/ -----— HLL HHL
max_values_ *-----*------------* / / \ /|
—/-------—---- | | / \ | |
|
protected |
Calculate the min/max x, y, z values in case of a rotated box.
Referenced by nest::BoxMask< D >::BoxMask().
|
overridevirtual |
|
overridevirtual |
The whole mask is inside (i.e., false everywhere outside) the bounding box.
Implements nest::Mask< D >.
|
overridevirtual |
Reimplemented from nest::AbstractMask.
References nest::names::azimuth_angle(), nest::names::lower_left(), nest::names::polar_angle(), and nest::names::upper_right().
|
static |
|
inline |
|
inline |
|
overridevirtual |
Implements nest::Mask< D >.
References nest::inside().
| bool nest::BoxMask< 2 >::inside | ( | const Position< 2 > & | p | ) | const |
| bool nest::BoxMask< 3 >::inside | ( | const Position< 3 > & | p | ) | const |
|
overridevirtual |
Implements nest::Mask< D >.
|
overridevirtual |
Reimplemented from nest::Mask< D >.
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
|
protected |
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
|
protected |
|
protected |
The {min,max}_values_ correspond to the minimum and maximum x, y, z values after the box has been rotated.
That is, the lower_left and upper_right of the bounding box of the rotated box. If the box is not rotated, min_values_ = lower_left_ and max_values_ = upper_right_.
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |
Referenced by nest::BoxMask< D >::BoxMask().
|
protected |