OpenLexocad  27.0
Bnd_Box.h
Go to the documentation of this file.
1 //
3 // Copyright(C) 2013-2016 OpenCascade [www.opencascade.org]
4 //
5 // This library is free software; you can redistribute it and / or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street,
18 // Fifth Floor, Boston, MA 02110 - 1301 USA
19 //
21 
22 #pragma once
23 
24 #include <Geom/GeomEnums.h>
25 #include <Geom/geom_defines.h>
26 
27 namespace Geom
28 {
29 class Pnt;
30 class Dir;
31 class Trsf;
32 class Lin;
33 class Pln;
34 class Vec;
35 } // namespace Geom
36 
37 
38 namespace Geom
39 {
67 {
68 public:
71  Bnd_Box();
74  void SetWhole();
76  void SetVoid();
80  void Set(const Geom::Pnt& P);
86  void Set(const Geom::Pnt& P, const Geom::Dir& D);
92  void Update(const double aXmin, const double aYmin, const double aZmin, const double aXmax, const double aYmax, const double aZmax);
94  void Update(const double X, const double Y, const double Z);
96  // Standard_EXPORT double GetGap() const;
98  void SetGap(const double Tol);
105  void Enlarge(const double Tol);
110  void Get(double& aXmin, double& aYmin, double& aZmin, double& aXmax, double& aYmax, double& aZmax) const;
111 
116  const double GetXmin() const;
121  const double GetYmin() const;
126  const double GetZmin() const;
131  const double GetXmax() const;
136  const double GetYmax() const;
141  const double GetZmax() const;
142 
147  const double GetXsize() const;
152  const double GetYsize() const;
157  const double GetZsize() const;
158 
163  const Geom::Pnt GetMin() const;
168  const Geom::Pnt GetMax() const;
173  const Geom::Pnt GetCenter() const;
178  void GetSize(double& length, double& width, double& height) const;
181  void OpenXmin();
184  void OpenXmax();
187  void OpenYmin();
190  void OpenYmax();
193  void OpenZmin();
196  void OpenZmax();
198  unsigned int IsOpenXmin() const;
200  unsigned int IsOpenXmax() const;
202  unsigned int IsOpenYmin() const;
204  unsigned int IsOpenYmax() const;
206  unsigned int IsOpenZmin() const;
208  unsigned int IsOpenZmax() const;
210  unsigned int IsWhole() const;
212  unsigned int IsVoid() const;
214  // Standard_EXPORT bool IsXThin(const double tol) const;
216  // Standard_EXPORT bool IsYThin(const double tol) const;
218  // Standard_EXPORT bool IsZThin(const double tol) const;
221  // Standard_EXPORT bool IsThin(const double tol) const;
228  Geom::Bnd_Box Transformed(const Geom::Trsf& T) const;
230  void Add(const Bnd_Box& Other);
232  void Add(const Geom::Pnt& P);
234  void Add(const Geom::Pnt& P, const Geom::Dir& D);
238  void Add(const Geom::Dir& D);
240  unsigned int IsOut(const Geom::Pnt& P) const;
242  unsigned int IsOut(const Geom::Lin& L) const;
244  unsigned int IsOut(const Geom::Pln& P) const;
246  unsigned int IsOut(const Geom::Bnd_Box& Other) const;
249  unsigned int IsOut(const Geom::Bnd_Box& Other, const Geom::Trsf& T) const;
252  unsigned int IsOut(const Geom::Trsf& T1, const Geom::Bnd_Box& Other, const Geom::Trsf& T2) const;
256  unsigned int IsOut(const Geom::Pnt& P1, const Geom::Pnt& P2, const Geom::Dir& D) const;
258  // Standard_EXPORT double Distance(const Bnd_Box& Other) const;
259 
260  // Standard_EXPORT void Dump() const;
262  // double SquareExtent() const;
263 
264 
265  // Return difference between min point of two bounding boxes
266  Geom::Vec GetMinDifference(const Geom::Bnd_Box& Other) const;
267 
268 protected:
269 private:
270  double Xmin;
271  double Xmax;
272  double Ymin;
273  double Ymax;
274  double Zmin;
275  double Zmax;
276  double Gap;
277  unsigned int Flags;
278 };
279 
280 } // namespace Geom
Definition: Rotation.h:5
X
Definition: Globals.h:32
Definition: Pln.h:59
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:42
Definition: Bnd_Box.h:66
#define GEOM_EXPORT
Definition: geom_defines.h:8
Definition: Lin.h:50
Definition: Trsf.h:58
Definition: Dir.h:46
Y
Definition: Globals.h:32
Z
Definition: Globals.h:32
Defines a non-persistent vector in 3D space.
Definition: Vec.h:45