Public Types | Public Member Functions | Private Types | List of all members
lar::util::simple_geo::Area< Point > Class Template Reference

Area delimited by two points. More...

#include <SimpleGeo.h>

Inheritance diagram for lar::util::simple_geo::Area< Point >:
lar::util::simple_geo::AreaBase< Point > lar::util::simple_geo::Volume< Point >

Public Types

using Point_t = typename Base_t::Point_t
 
using Area_t = Area< Point_t >
 
- Public Types inherited from lar::util::simple_geo::AreaBase< Point >
using Point_t = Point
 
using Area_t = AreaBase< Point >
 

Public Member Functions

 Area ()=default
 
 Area (Point_t const &a, Point_t const &b)
 
auto DeltaY () const
 
bool isEmptyY () const
 
unsigned int nonEmptyDims () const
 
bool isNullY () const
 
bool isNull () const
 
bool isEmpty () const
 
bool isLine () const
 
bool isPlane () const
 
auto thinnestSize () const
 
unsigned int thinnestSide () const
 Returns the index of the thinnest side (0 is x, 1 is y) More...
 
void IncludePoint (Point_t const &point)
 
void Include (Area_t const &area)
 
void Intersect (Area_t const &area)
 
- Public Member Functions inherited from lar::util::simple_geo::AreaBase< Point >
 AreaBase ()=default
 
 AreaBase (Point_t const &a, Point_t const &b)
 
Point_t const & Min () const
 
Point_t const & Max () const
 
Point_t Center () const
 
auto DeltaX () const
 
bool isEmptyX () const
 
bool isNullX () const
 
bool isNull () const
 
unsigned int nonEmptyDims () const
 
bool isEmpty () const
 
bool isLine () const
 
auto thinnestSize () const
 
unsigned int thinnestSide () const
 Returns the index of the thinnest side (0 is x) More...
 
void IncludePoint (Point_t const &point)
 
void Include (Area_t const &area)
 
void Intersect (Area_t const &area)
 
bool operator== (Area_t const &as) const
 
bool operator!= (Area_t const &as) const
 

Private Types

using Base_t = AreaBase< Point >
 

Additional Inherited Members

- Protected Types inherited from lar::util::simple_geo::AreaBase< Point >
using Data_t = typename Point_t::Data_t
 
- Static Protected Member Functions inherited from lar::util::simple_geo::AreaBase< Point >
static void set_min (Data_t &var, Data_t val)
 
static void set_max (Data_t &var, Data_t val)
 
static void set_min_max (Data_t &min_var, Data_t &max_var, Data_t val)
 
static void set_sorted (Data_t &min_var, Data_t &max_var, Data_t a, Data_t b)
 
- Protected Attributes inherited from lar::util::simple_geo::AreaBase< Point >
Point_t min
 
Point_t max
 

Detailed Description

template<typename Point = Point2D<double>>
class lar::util::simple_geo::Area< Point >

Area delimited by two points.

Definition at line 201 of file SimpleGeo.h.

Member Typedef Documentation

template<typename Point = Point2D<double>>
using lar::util::simple_geo::Area< Point >::Area_t = Area<Point_t>

Definition at line 206 of file SimpleGeo.h.

template<typename Point = Point2D<double>>
using lar::util::simple_geo::Area< Point >::Base_t = AreaBase<Point>
private

Definition at line 202 of file SimpleGeo.h.

template<typename Point = Point2D<double>>
using lar::util::simple_geo::Area< Point >::Point_t = typename Base_t::Point_t

Definition at line 205 of file SimpleGeo.h.

Constructor & Destructor Documentation

template<typename Point = Point2D<double>>
lar::util::simple_geo::Area< Point >::Area ( )
default
template<typename Point = Point2D<double>>
lar::util::simple_geo::Area< Point >::Area ( Point_t const &  a,
Point_t const &  b 
)
inline

Definition at line 210 of file SimpleGeo.h.

211  : Base_t(a, b)
AreaBase< Point > Base_t
Definition: SimpleGeo.h:202
const double a
static bool * b
Definition: config.cpp:1043
static void set_sorted(Data_t &min_var, Data_t &max_var, Data_t a, Data_t b)
Definition: SimpleGeo.h:190

Member Function Documentation

template<typename Point = Point2D<double>>
auto lar::util::simple_geo::Area< Point >::DeltaY ( ) const
inline

Definition at line 214 of file SimpleGeo.h.

214 { return Base_t::Max().y - Base_t::Min().y; }
Point_t const & Min() const
Definition: SimpleGeo.h:140
Point_t const & Max() const
Definition: SimpleGeo.h:141
template<typename Point = Point2D<double>>
void lar::util::simple_geo::Area< Point >::Include ( Area_t const &  area)
inline

Definition at line 240 of file SimpleGeo.h.

241  { IncludePoint(area.min); IncludePoint(area.max); }
void IncludePoint(Point_t const &point)
Definition: SimpleGeo.h:234
template<typename Point = Point2D<double>>
void lar::util::simple_geo::Area< Point >::IncludePoint ( Point_t const &  point)
inline

Definition at line 234 of file SimpleGeo.h.

235  {
236  Base_t::IncludePoint(point);
238  }
static void set_min_max(Data_t &min_var, Data_t &max_var, Data_t val)
Definition: SimpleGeo.h:186
void IncludePoint(Point_t const &point)
Definition: SimpleGeo.h:157
template<typename Point = Point2D<double>>
void lar::util::simple_geo::Area< Point >::Intersect ( Area_t const &  area)
inline

Definition at line 243 of file SimpleGeo.h.

244  {
245  Base_t::Intersect(area);
246  Base_t::set_max(Base_t::min.y, area.min.y);
247  Base_t::set_min(Base_t::max.y, area.max.y);
248  if (isNullY())
249  throw typename Base_t::NullIntersection("null y dimension");
250  }
void Intersect(Area_t const &area)
Definition: SimpleGeo.h:163
static void set_min(Data_t &var, Data_t val)
Definition: SimpleGeo.h:180
static void set_max(Data_t &var, Data_t val)
Definition: SimpleGeo.h:183
template<typename Point = Point2D<double>>
bool lar::util::simple_geo::Area< Point >::isEmpty ( ) const
inline

Definition at line 220 of file SimpleGeo.h.

220 { return nonEmptyDims() == 0; }
unsigned int nonEmptyDims() const
Definition: SimpleGeo.h:216
template<typename Point = Point2D<double>>
bool lar::util::simple_geo::Area< Point >::isEmptyY ( ) const
inline

Definition at line 215 of file SimpleGeo.h.

215 { return DeltaY() == 0; }
template<typename Point = Point2D<double>>
bool lar::util::simple_geo::Area< Point >::isLine ( ) const
inline

Definition at line 221 of file SimpleGeo.h.

221 { return nonEmptyDims() == 1; }
unsigned int nonEmptyDims() const
Definition: SimpleGeo.h:216
template<typename Point = Point2D<double>>
bool lar::util::simple_geo::Area< Point >::isNull ( ) const
inline

Definition at line 219 of file SimpleGeo.h.

219 { return Base_t::isNull() || isNullY(); }
template<typename Point = Point2D<double>>
bool lar::util::simple_geo::Area< Point >::isNullY ( ) const
inline

Definition at line 218 of file SimpleGeo.h.

218 { return Base_t::Max().y < Base_t::Min().y; }
Point_t const & Min() const
Definition: SimpleGeo.h:140
Point_t const & Max() const
Definition: SimpleGeo.h:141
template<typename Point = Point2D<double>>
bool lar::util::simple_geo::Area< Point >::isPlane ( ) const
inline

Definition at line 222 of file SimpleGeo.h.

222 { return nonEmptyDims() == 2; }
unsigned int nonEmptyDims() const
Definition: SimpleGeo.h:216
template<typename Point = Point2D<double>>
unsigned int lar::util::simple_geo::Area< Point >::nonEmptyDims ( ) const
inline

Definition at line 216 of file SimpleGeo.h.

217  { return Base_t::nonEmptyDims() + (isEmptyY()? 0: 1); }
unsigned int nonEmptyDims() const
Definition: SimpleGeo.h:148
template<typename Point = Point2D<double>>
unsigned int lar::util::simple_geo::Area< Point >::thinnestSide ( ) const
inline

Returns the index of the thinnest side (0 is x, 1 is y)

Definition at line 228 of file SimpleGeo.h.

229  {
230  return
232  }
unsigned int thinnestSide() const
Returns the index of the thinnest side (0 is x)
Definition: SimpleGeo.h:155
template<typename Point = Point2D<double>>
auto lar::util::simple_geo::Area< Point >::thinnestSize ( ) const
inline

Definition at line 224 of file SimpleGeo.h.

225  { return std::min(DeltaY(), Base_t::thinnestSize()); }
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55

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