Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:16

0001 // Created on: 2020-01-31
0002 // Created by: Svetlana SHUTINA
0003 // Copyright (c) 2020 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement. 
0015 
0016 #ifndef _BRepPreviewAPI_MakeBox_HeaderFile
0017 #define _BRepPreviewAPI_MakeBox_HeaderFile
0018 
0019 #include <BRepPrimAPI_MakeBox.hxx>
0020 
0021 //! Builds a valid box, if points fulfill the conditions of a valid box.
0022 //! And allows to build a preview, otherwise.
0023 //! There are 4 cases:
0024 //! 1 - preview can be a vertex if thin box in all directions is a point;
0025 //! 2 - preview can be an edge if thin box in two directions is a point;
0026 //! 3 - preview can be a rectangular face if thin box in only one direction is a point;
0027 //! 4 - preview can be a valid box if point values fulfill the conditions of a valid box.
0028 
0029 class BRepPreviewAPI_MakeBox : public BRepPrimAPI_MakeBox
0030 {
0031 public:
0032 
0033   //! Constructor
0034   BRepPreviewAPI_MakeBox() {}
0035 
0036   //! Creates a preview depending on point values.
0037   Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0038 
0039 private:
0040 
0041   //! Create a vertex if thin box in all directions is a point.
0042   void makeVertex (const gp_Pnt& thePoint);
0043 
0044   //! Create an edge if thin box in two directions is a point.
0045   void makeEdge (const gp_Pnt& thePoint1, const gp_Pnt& thePoint2);
0046 
0047   //! Create a rectangular face if the box is thin in one direction only.
0048   //! @param thePnt1 the first point for a rectangular face
0049   //! @param thePnt2 the second point for a rectangular face
0050   //! @param thePnt3 the third point for a rectangular face
0051   //! @param thePnt4 the fourth point for a rectangular face
0052   void makeRectangle (const gp_Pnt& thePnt1, const gp_Pnt& thePnt2,
0053                       const gp_Pnt& thePnt3, const gp_Pnt& thePnt4);
0054 
0055 };
0056 
0057 #endif