VM2D 1.14
Vortex methods for 2D flows simulation
Loading...
Searching...
No Matches
VM2D::NbBox Struct Reference

Габаритный прямоугольник More...

#include <cpuNeighborTree.h>

Public Member Functions

void SetEmpty ()
void Add (const Point2D &p)
void Add (const NbBox &b)
bool IsEmpty () const
double Dist2 (const NbBox &b) const
 Квадрат расстояния до другого прямоугольника (для пустого — бесконечность).
double Dist2 (const Point2D &p) const
 Квадрат расстояния до точки

Public Attributes

double minx
double miny
double maxx
double maxy

Detailed Description

Габаритный прямоугольник

Definition at line 54 of file cpuNeighborTree.h.

Member Function Documentation

◆ Add() [1/2]

void VM2D::NbBox::Add ( const NbBox & b)
inline

Definition at line 70 of file cpuNeighborTree.h.

71 {
72 minx = std::min(minx, b.minx); maxx = std::max(maxx, b.maxx);
73 miny = std::min(miny, b.miny); maxy = std::max(maxy, b.maxy);
74 }

◆ Add() [2/2]

void VM2D::NbBox::Add ( const Point2D & p)
inline

Definition at line 64 of file cpuNeighborTree.h.

65 {
66 minx = std::min(minx, p[0]); maxx = std::max(maxx, p[0]);
67 miny = std::min(miny, p[1]); maxy = std::max(maxy, p[1]);
68 }
Here is the caller graph for this function:

◆ Dist2() [1/2]

double VM2D::NbBox::Dist2 ( const NbBox & b) const
inline

Квадрат расстояния до другого прямоугольника (для пустого — бесконечность).

Definition at line 79 of file cpuNeighborTree.h.

80 {
81 if (IsEmpty() || b.IsEmpty())
82 return std::numeric_limits<double>::infinity();
83 const double dx = std::max(0.0, std::max(minx - b.maxx, b.minx - maxx));
84 const double dy = std::max(0.0, std::max(miny - b.maxy, b.miny - maxy));
85 return dx * dx + dy * dy;
86 }
bool IsEmpty() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dist2() [2/2]

double VM2D::NbBox::Dist2 ( const Point2D & p) const
inline

Квадрат расстояния до точки

Definition at line 89 of file cpuNeighborTree.h.

90 {
91 if (IsEmpty())
92 return std::numeric_limits<double>::infinity();
93 const double dx = std::max(0.0, std::max(minx - p[0], p[0] - maxx));
94 const double dy = std::max(0.0, std::max(miny - p[1], p[1] - maxy));
95 return dx * dx + dy * dy;
96 }
Here is the call graph for this function:

◆ IsEmpty()

bool VM2D::NbBox::IsEmpty ( ) const
inline

Definition at line 76 of file cpuNeighborTree.h.

76{ return minx > maxx; }
Here is the caller graph for this function:

◆ SetEmpty()

void VM2D::NbBox::SetEmpty ( )
inline

Definition at line 58 of file cpuNeighborTree.h.

59 {
60 minx = miny = std::numeric_limits<double>::infinity();
61 maxx = maxy = -std::numeric_limits<double>::infinity();
62 }
Here is the caller graph for this function:

Member Data Documentation

◆ maxx

double VM2D::NbBox::maxx

Definition at line 56 of file cpuNeighborTree.h.

◆ maxy

double VM2D::NbBox::maxy

Definition at line 56 of file cpuNeighborTree.h.

◆ minx

double VM2D::NbBox::minx

Definition at line 56 of file cpuNeighborTree.h.

◆ miny

double VM2D::NbBox::miny

Definition at line 56 of file cpuNeighborTree.h.


The documentation for this struct was generated from the following file: