Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
simple_geo::Area Class Reference

Public Member Functions

 Area ()=default
 
 Area (Point2D const &a, Point2D const &b)
 
Point2D const & Min () const
 
Point2D const & Max () const
 
Point2D Center () const
 
double DeltaY () const
 
double DeltaZ () const
 
bool isEmpty () const
 
void IncludePoint (Point2D const &point)
 
void Include (Area const &area)
 
void Intersect (Area const &area)
 

Protected Member Functions

void set_min (double &var, double val)
 
void set_max (double &var, double val)
 
void set_min_max (double &min_var, double &max_var, double val)
 
void set_sorted (double &min_var, double &max_var, double a, double b)
 

Protected Attributes

Point2D min
 
Point2D max
 

Detailed Description

Definition at line 76 of file GeometryTestAlg.cxx.

Constructor & Destructor Documentation

simple_geo::Area::Area ( )
default
simple_geo::Area::Area ( Point2D const &  a,
Point2D const &  b 
)
inline

Definition at line 80 of file GeometryTestAlg.cxx.

81  {
82  set_sorted(min.y, max.y, a.y, b.y);
83  set_sorted(min.z, max.z, a.z, b.z);
84  } // Area(Point2D x2)
void set_sorted(double &min_var, double &max_var, double a, double b)
const double a
static bool * b
Definition: config.cpp:1043

Member Function Documentation

Point2D simple_geo::Area::Center ( ) const
inline

Definition at line 88 of file GeometryTestAlg.cxx.

88 { return (min + max) / 2; }
double simple_geo::Area::DeltaY ( ) const
inline

Definition at line 89 of file GeometryTestAlg.cxx.

89 { return Max().y - Min().y; }
Point2D const & Min() const
Point2D const & Max() const
double simple_geo::Area::DeltaZ ( ) const
inline

Definition at line 90 of file GeometryTestAlg.cxx.

90 { return Max().z - Min().z; }
Point2D const & Min() const
Point2D const & Max() const
void simple_geo::Area::Include ( Area const &  area)
inline

Definition at line 99 of file GeometryTestAlg.cxx.

100  { IncludePoint(area.min); IncludePoint(area.max); }
void IncludePoint(Point2D const &point)
void simple_geo::Area::IncludePoint ( Point2D const &  point)
inline

Definition at line 93 of file GeometryTestAlg.cxx.

94  {
95  set_min_max(min.y, max.y, point.y);
96  set_min_max(min.z, max.z, point.z);
97  } // Include()
void set_min_max(double &min_var, double &max_var, double val)
void simple_geo::Area::Intersect ( Area const &  area)
inline

Definition at line 102 of file GeometryTestAlg.cxx.

103  {
104  set_max(min.y, area.min.y);
105  set_min(max.y, area.max.y);
106  set_max(min.z, area.min.z);
107  set_min(max.z, area.max.z);
108  }
void set_min(double &var, double val)
void set_max(double &var, double val)
bool simple_geo::Area::isEmpty ( ) const
inline

Definition at line 91 of file GeometryTestAlg.cxx.

91 { return (DeltaY() == 0) || (DeltaZ() == 0); }
double DeltaY() const
double DeltaZ() const
Point2D const& simple_geo::Area::Max ( ) const
inline

Definition at line 87 of file GeometryTestAlg.cxx.

87 { return max; }
Point2D const& simple_geo::Area::Min ( ) const
inline

Definition at line 86 of file GeometryTestAlg.cxx.

86 { return min; }
void simple_geo::Area::set_max ( double &  var,
double  val 
)
inlineprotected

Definition at line 114 of file GeometryTestAlg.cxx.

114 { if (val > var) var = val; }
int var
Definition: 018_def.c:9
void simple_geo::Area::set_min ( double &  var,
double  val 
)
inlineprotected

Definition at line 113 of file GeometryTestAlg.cxx.

113 { if (val < var) var = val; }
int var
Definition: 018_def.c:9
void simple_geo::Area::set_min_max ( double &  min_var,
double &  max_var,
double  val 
)
inlineprotected

Definition at line 115 of file GeometryTestAlg.cxx.

116  { set_min(min_var, val); set_max(max_var, val); }
void set_min(double &var, double val)
void set_max(double &var, double val)
void simple_geo::Area::set_sorted ( double &  min_var,
double &  max_var,
double  a,
double  b 
)
inlineprotected

Definition at line 117 of file GeometryTestAlg.cxx.

118  {
119  if (a > b) { min_var = b; max_var = a; }
120  else { min_var = a; max_var = b; }
121  }
const double a
static bool * b
Definition: config.cpp:1043

Member Data Documentation

Point2D simple_geo::Area::max
protected

Definition at line 111 of file GeometryTestAlg.cxx.

Point2D simple_geo::Area::min
protected

Definition at line 111 of file GeometryTestAlg.cxx.


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