37 lines
634 B
C++
37 lines
634 B
C++
#include "area.hh"
|
|
|
|
|
|
Area::Area(string an, float x1, float x2, float y1, float y2, float z1, float z2)
|
|
{
|
|
area_name = an;
|
|
x_min = x1;
|
|
x_max = x2;
|
|
y_min = y1;
|
|
y_max = y2;
|
|
z_min = z1;
|
|
z_max = z2;
|
|
}
|
|
|
|
Area::Area(const Area &a)
|
|
{
|
|
area_name = a.area_name;
|
|
x_min = a.x_min;
|
|
x_max = a.x_max;
|
|
y_min = a.y_min;
|
|
y_max = a.y_max;
|
|
z_min = a.z_min;
|
|
z_max = a.z_max;
|
|
}
|
|
|
|
bool Area::containsPoint(Point p)const
|
|
{
|
|
if((p.getX() >= x_min) \
|
|
&& (p.getX() <= x_max) \
|
|
&& (p.getY() >= y_min) \
|
|
&& (p.getY() <= y_max) \
|
|
&& (p.getZ() >= z_min) \
|
|
&& (p.getZ() <= z_max))
|
|
return true;
|
|
return false;
|
|
}
|