NEST main@caf0ae8
 
Loading...
Searching...
No Matches
nest::BoxMask< D > Class Template Reference

Mask defining a box region. More...

#include <mask.h>

Inheritance diagram for nest::BoxMask< D >:
[legend]
Collaboration diagram for nest::BoxMask< D >:
[legend]

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_
 

Detailed Description

template<int D>
class nest::BoxMask< D >

Mask defining a box region.

Constructor & Destructor Documentation

◆ BoxMask() [1/2]

template<int D>
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().

Here is the call graph for this function:

◆ BoxMask() [2/2]

◆ ~BoxMask()

template<int D>
nest::BoxMask< D >::~BoxMask ( )
inlineoverride

Member Function Documentation

◆ calculate_min_max_values_() [1/3]

void nest::BoxMask< 2 >::calculate_min_max_values_ ( )
protected

◆ calculate_min_max_values_() [2/3]

void nest::BoxMask< 3 >::calculate_min_max_values_ ( )
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_
  *-----*------------*
/    /     \        /|

—/-------—---- | | / \ | |

  • * | | \ / | |
  • \ / * | | \ \ / / | | | \ * / | * | \ | / |/ --------—----—* min_values_

◆ calculate_min_max_values_() [3/3]

template<int D>
void nest::BoxMask< D >::calculate_min_max_values_ ( )
protected

Calculate the min/max x, y, z values in case of a rotated box.

Referenced by nest::BoxMask< D >::BoxMask().

Here is the caller graph for this function:

◆ clone()

template<int D>
Mask< D > * nest::BoxMask< D >::clone ( ) const
overridevirtual

Clone method.

Returns
dynamically allocated copy of mask object

Implements nest::Mask< D >.

◆ get_bbox()

template<int D>
Box< D > nest::BoxMask< D >::get_bbox ( ) const
overridevirtual

The whole mask is inside (i.e., false everywhere outside) the bounding box.

Returns
bounding box

Implements nest::Mask< D >.

◆ get_dict()

template<int D>
Dictionary nest::BoxMask< D >::get_dict ( ) const
overridevirtual
Returns
a dictionary with the definition for this mask.

Reimplemented from nest::AbstractMask.

References nest::names::azimuth_angle(), nest::names::lower_left(), nest::names::polar_angle(), and nest::names::upper_right().

Here is the call graph for this function:

◆ get_name() [1/3]

template<int D>
static std::string nest::BoxMask< D >::get_name ( )
static
Returns
the name of this mask type.

◆ get_name() [2/3]

std::string nest::BoxMask< 2 >::get_name ( )
inline

References nest::names::rectangular().

Here is the call graph for this function:

◆ get_name() [3/3]

std::string nest::BoxMask< 3 >::get_name ( )
inline

References nest::names::box().

Here is the call graph for this function:

◆ inside() [1/4]

template<int D>
bool nest::BoxMask< D >::inside ( const Box< D > &  b) const
overridevirtual
Returns
true if the whole given box is inside this box

Implements nest::Mask< D >.

References nest::inside().

Here is the call graph for this function:

◆ inside() [2/4]

bool nest::BoxMask< 2 >::inside ( const Position< 2 > &  p) const

◆ inside() [3/4]

bool nest::BoxMask< 3 >::inside ( const Position< 3 > &  p) const

◆ inside() [4/4]

template<int D>
bool nest::BoxMask< D >::inside ( const Position< D > &  p) const
overridevirtual
Returns
true if point is inside the box

Implements nest::Mask< D >.

◆ outside()

template<int D>
bool nest::BoxMask< D >::outside ( const Box< D > &  b) const
overridevirtual
Returns
true if the whole given box is outside this box

Reimplemented from nest::Mask< D >.

Member Data Documentation

◆ az_cos_pol_cos_

template<int D>
double nest::BoxMask< D >::az_cos_pol_cos_
protected

◆ az_cos_pol_sin_

template<int D>
double nest::BoxMask< D >::az_cos_pol_sin_
protected

◆ az_sin_pol_cos_

template<int D>
double nest::BoxMask< D >::az_sin_pol_cos_
protected

◆ az_sin_pol_sin_

template<int D>
double nest::BoxMask< D >::az_sin_pol_sin_
protected

◆ azimuth_angle_

template<int D>
double nest::BoxMask< D >::azimuth_angle_
protected

◆ azimuth_cos_

template<int D>
double nest::BoxMask< D >::azimuth_cos_
protected

◆ azimuth_sin_

template<int D>
double nest::BoxMask< D >::azimuth_sin_
protected

◆ cntr_

template<int D>
Position< D > nest::BoxMask< D >::cntr_
protected

◆ cntr_x_az_cos_

template<int D>
double nest::BoxMask< D >::cntr_x_az_cos_
protected

◆ cntr_x_az_cos_pol_cos_

template<int D>
double nest::BoxMask< D >::cntr_x_az_cos_pol_cos_
protected

◆ cntr_x_az_cos_pol_sin_

template<int D>
double nest::BoxMask< D >::cntr_x_az_cos_pol_sin_
protected

◆ cntr_x_az_sin_

template<int D>
double nest::BoxMask< D >::cntr_x_az_sin_
protected

◆ cntr_y_az_cos_

template<int D>
double nest::BoxMask< D >::cntr_y_az_cos_
protected

◆ cntr_y_az_sin_

template<int D>
double nest::BoxMask< D >::cntr_y_az_sin_
protected

◆ cntr_y_az_sin_pol_cos_

template<int D>
double nest::BoxMask< D >::cntr_y_az_sin_pol_cos_
protected

◆ cntr_y_az_sin_pol_sin_

template<int D>
double nest::BoxMask< D >::cntr_y_az_sin_pol_sin_
protected

◆ cntr_z_pol_cos_

template<int D>
double nest::BoxMask< D >::cntr_z_pol_cos_
protected

◆ cntr_z_pol_sin_

template<int D>
double nest::BoxMask< D >::cntr_z_pol_sin_
protected

◆ eps_

template<int D>
Position< D > nest::BoxMask< D >::eps_
protected

◆ is_rotated_

template<int D>
bool nest::BoxMask< D >::is_rotated_
protected

◆ lower_left_

template<int D>
Position< D > nest::BoxMask< D >::lower_left_
protected

◆ max_values_

template<int D>
Position< D > nest::BoxMask< D >::max_values_
protected

◆ min_values_

template<int D>
Position< D > nest::BoxMask< D >::min_values_
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_.

◆ polar_angle_

template<int D>
double nest::BoxMask< D >::polar_angle_
protected

◆ polar_cos_

template<int D>
double nest::BoxMask< D >::polar_cos_
protected

◆ polar_sin_

template<int D>
double nest::BoxMask< D >::polar_sin_
protected

◆ upper_right_

template<int D>
Position< D > nest::BoxMask< D >::upper_right_
protected

The documentation for this class was generated from the following files: