OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
BoundingBox.h
Go to the documentation of this file.
1#pragma once
2#pragma warning(disable : 4251)
3
4#include <bsoncxx/builder/basic/document.hpp>
5
6class __declspec(dllexport) BoundingBox
7{
8public:
9 BoundingBox();
10 virtual ~BoundingBox();
11
12 void reset(void);
13
14 void extend(double x, double y, double z);
15 void extend(const BoundingBox &box);
16 void extend(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
17
18 bool testPointInside(double x, double y, double z, double tolerance) const;
19
20 double getXmin(void) const { return xmin; };
21 double getXmax(void) const { return xmax; };
22 double getYmin(void) const { return ymin; };
23 double getYmax(void) const { return ymax; };
24 double getZmin(void) const { return zmin; };
25 double getZmax(void) const { return zmax; };
26
27 bool getEmpty(void) const { return empty; };
28
29 bool getCenterPoint(double &xc, double &yc, double &zc) const;
30 double getDiagonal(void) const { return sqrt((xmax - xmin)*(xmax - xmin) + (ymax - ymin)*(ymax - ymin) + (zmax - zmin)*(zmax - zmin)); };
31
32 bsoncxx::document::value getBSON(void);
33 void setFromBSON(bsoncxx::document::view view);
34
35private:
36 double xmin, xmax, ymin, ymax, zmin, zmax;
37 bool empty;
38};
39