Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-24 09:16:04

0001 // Created on: 1993-07-21
0002 // Created by: Remi LEQUETTE
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _BRepPrimAPI_MakeBox_HeaderFile
0018 #define _BRepPrimAPI_MakeBox_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <BRepPrim_Wedge.hxx>
0024 #include <BRepBuilderAPI_MakeShape.hxx>
0025 class gp_Pnt;
0026 class gp_Ax2;
0027 class TopoDS_Shell;
0028 class TopoDS_Solid;
0029 class TopoDS_Face;
0030 
0031 //! Describes functions to build parallelepiped boxes.
0032 //! A MakeBox object provides a framework for:
0033 //! -   defining the construction of a box,
0034 //! -   implementing the construction algorithm, and
0035 //! -   consulting the result.
0036 //! Constructs a box such that its sides are parallel to the axes of
0037 //! -   the global coordinate system, or
0038 //! -   the local coordinate system Axis. and
0039 //! -   with a corner at (0, 0, 0) and of size (dx, dy, dz), or
0040 //! -   with a corner at point P and of size (dx, dy, dz), or
0041 //! -   with corners at points P1 and P2.
0042 //! Exceptions
0043 //! Standard_DomainError if: dx, dy, dz are less than or equal to
0044 //! Precision::Confusion(), or
0045 //! -   the vector joining the points P1 and P2 has a
0046 //! component projected onto the global coordinate
0047 //! system less than or equal to Precision::Confusion().
0048 //! In these cases, the box would be flat.
0049 
0050 class BRepPrimAPI_MakeBox : public BRepBuilderAPI_MakeShape
0051 {
0052 public:
0053   DEFINE_STANDARD_ALLOC
0054 
0055   //! Default constructor
0056   BRepPrimAPI_MakeBox() {}
0057 
0058   //! Make a box with a corner at 0,0,0 and the other dx,dy,dz
0059   Standard_EXPORT BRepPrimAPI_MakeBox(const Standard_Real dx,
0060                                       const Standard_Real dy,
0061                                       const Standard_Real dz);
0062 
0063   //! Make a box with a corner at P and size dx, dy, dz.
0064   Standard_EXPORT BRepPrimAPI_MakeBox(const gp_Pnt&       P,
0065                                       const Standard_Real dx,
0066                                       const Standard_Real dy,
0067                                       const Standard_Real dz);
0068 
0069   //! Make a box with corners P1,P2.
0070   Standard_EXPORT BRepPrimAPI_MakeBox(const gp_Pnt& P1, const gp_Pnt& P2);
0071 
0072   //! Make a box with Ax2 (the left corner and the axis) and size dx, dy, dz.
0073   Standard_EXPORT BRepPrimAPI_MakeBox(const gp_Ax2&       Axes,
0074                                       const Standard_Real dx,
0075                                       const Standard_Real dy,
0076                                       const Standard_Real dz);
0077 
0078   //! Init a box with a corner at 0,0,0 and the other theDX, theDY, theDZ
0079   Standard_EXPORT void Init(const Standard_Real theDX,
0080                             const Standard_Real theDY,
0081                             const Standard_Real theDZ);
0082 
0083   //! Init a box with a corner at thePnt and size theDX, theDY, theDZ.
0084   Standard_EXPORT void Init(const gp_Pnt&       thePnt,
0085                             const Standard_Real theDX,
0086                             const Standard_Real theDY,
0087                             const Standard_Real theDZ);
0088 
0089   //! Init a box with corners thePnt1, thePnt2.
0090   Standard_EXPORT void Init(const gp_Pnt& thePnt1, const gp_Pnt& thePnt2);
0091 
0092   //! Init a box with Ax2 (the left corner and the theAxes) and size theDX, theDY, theDZ.
0093   Standard_EXPORT void Init(const gp_Ax2&       theAxes,
0094                             const Standard_Real theDX,
0095                             const Standard_Real theDY,
0096                             const Standard_Real theDZ);
0097 
0098   //! Returns the internal algorithm.
0099   Standard_EXPORT BRepPrim_Wedge& Wedge();
0100 
0101   //! Stores the solid in myShape.
0102   Standard_EXPORT virtual void Build(
0103     const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0104 
0105   //! Returns the constructed box as a shell.
0106   Standard_EXPORT const TopoDS_Shell& Shell();
0107   Standard_EXPORT                     operator TopoDS_Shell();
0108 
0109   //! Returns the constructed box as a solid.
0110   Standard_EXPORT const TopoDS_Solid& Solid();
0111   Standard_EXPORT                     operator TopoDS_Solid();
0112 
0113   //! Returns ZMin face
0114   Standard_EXPORT const TopoDS_Face& BottomFace();
0115 
0116   //! Returns XMin face
0117   Standard_EXPORT const TopoDS_Face& BackFace();
0118 
0119   //! Returns XMax face
0120   Standard_EXPORT const TopoDS_Face& FrontFace();
0121 
0122   //! Returns YMin face
0123   Standard_EXPORT const TopoDS_Face& LeftFace();
0124 
0125   //! Returns YMax face
0126   Standard_EXPORT const TopoDS_Face& RightFace();
0127 
0128   //! Returns ZMax face
0129   Standard_EXPORT const TopoDS_Face& TopFace();
0130 
0131 protected:
0132   BRepPrim_Wedge myWedge;
0133 
0134 private:
0135 };
0136 
0137 #endif // _BRepPrimAPI_MakeBox_HeaderFile