0030655: Modeling Data - Provide interfaces for selection of the elements from BVH...
[occt.git] / src / Bnd / Bnd_Tools.hxx
CommitLineData
7c1a8210 1// Created by: Eugeny MALTCHIKOV
2// Created on: 2019-04-17
3// Copyright (c) 2019 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _Bnd_Tools_Header
17#define _Bnd_Tools_Header
18
19#include <Bnd_Box2d.hxx>
20#include <Bnd_Box.hxx>
21#include <BVH_Box.hxx>
22
23//! Defines a set of static methods operating with bounding boxes
24class Bnd_Tools
25{
26public: //! @name Bnd_Box to BVH_Box conversion
27
28 //! Converts the given Bnd_Box2d to BVH_Box
29 static BVH_Box <Standard_Real, 2> Bnd2BVH (const Bnd_Box2d& theBox)
30 {
31 Standard_Real aXMin, aYMin, aXMax, aYMax;
32 theBox.Get (aXMin, aYMin, aXMax, aYMax);
33 return BVH_Box <Standard_Real, 2> (BVH_Vec2d (aXMin, aYMin),
34 BVH_Vec2d (aXMax, aYMax));
35 }
36
37 //! Converts the given Bnd_Box to BVH_Box
38 static BVH_Box <Standard_Real, 3> Bnd2BVH (const Bnd_Box& theBox)
39 {
40 Standard_Real aXMin, aYMin, aZMin, aXMax, aYMax, aZMax;
41 theBox.Get (aXMin, aYMin, aZMin, aXMax, aYMax, aZMax);
42 return BVH_Box <Standard_Real, 3> (BVH_Vec3d (aXMin, aYMin, aZMin),
43 BVH_Vec3d (aXMax, aYMax, aZMax));
44 }
45};
46
47#endif // _Bnd_Tools_Header