1 // Created on: 2020-01-31
2 // Created by: Svetlana SHUTINA
3 // Copyright (c) 2020 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _BRepPreviewAPI_MakeBox_HeaderFile
17 #define _BRepPreviewAPI_MakeBox_HeaderFile
19 #include <BRepPrimAPI_MakeBox.hxx>
21 //! Builds a valid box, if points fulfill the conditions of a valid box.
22 //! And allows to build a preview, otherwise.
23 //! There are 4 cases:
24 //! 1 - preview can be a vertex if thin box in all directions is a point;
25 //! 2 - preview can be an edge if thin box in two directions is a point;
26 //! 3 - preview can be a rectangular face if thin box in only one direction is a point;
27 //! 4 - preview can be a valid box if point values fulfill the conditions of a valid box.
29 class BRepPreviewAPI_MakeBox : public BRepPrimAPI_MakeBox
34 BRepPreviewAPI_MakeBox() {}
36 //! Creates a preview depending on point values.
37 Standard_EXPORT virtual void Build() Standard_OVERRIDE;
41 //! Create a vertex if thin box in all directions is a point.
42 void makeVertex (const gp_Pnt& thePoint);
44 //! Create an edge if thin box in two directions is a point.
45 void makeEdge (const gp_Pnt& thePoint1, const gp_Pnt& thePoint2);
47 //! Create a rectangular face if the box is thin in one direction only.
48 //! @param thePnt1 the first point for a rectangular face
49 //! @param thePnt2 the second point for a rectangular face
50 //! @param thePnt3 the third point for a rectangular face
51 //! @param thePnt4 the fourth point for a rectangular face
52 void makeRectangle (const gp_Pnt& thePnt1, const gp_Pnt& thePnt2,
53 const gp_Pnt& thePnt3, const gp_Pnt& thePnt4);