Back to home page

EIC code displayed by LXR

 
 

    


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

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 
0032 //! Describes functions to build parallelepiped boxes.
0033 //! A MakeBox object provides a framework for:
0034 //! -   defining the construction of a box,
0035 //! -   implementing the construction algorithm, and
0036 //! -   consulting the result.
0037 //! Constructs a box such that its sides are parallel to the axes of
0038 //! -   the global coordinate system, or
0039 //! -   the local coordinate system Axis. and
0040 //! -   with a corner at (0, 0, 0) and of size (dx, dy, dz), or
0041 //! -   with a corner at point P and of size (dx, dy, dz), or
0042 //! -   with corners at points P1 and P2.
0043 //! Exceptions
0044 //! Standard_DomainError if: dx, dy, dz are less than or equal to
0045 //! Precision::Confusion(), or
0046 //! -   the vector joining the points P1 and P2 has a
0047 //! component projected onto the global coordinate
0048 //! system less than or equal to Precision::Confusion().
0049 //! In these cases, the box would be flat.
0050 
0051 class BRepPrimAPI_MakeBox  : public BRepBuilderAPI_MakeShape
0052 {
0053 public:
0054 
0055   DEFINE_STANDARD_ALLOC
0056 
0057     
0058   //! Default constructor
0059   BRepPrimAPI_MakeBox() {}
0060   
0061   //! Make a box with a corner at 0,0,0 and the other dx,dy,dz
0062   Standard_EXPORT BRepPrimAPI_MakeBox(const Standard_Real dx, const Standard_Real dy, const Standard_Real dz);
0063   
0064   //! Make a box with a corner at P and size dx, dy, dz.
0065   Standard_EXPORT BRepPrimAPI_MakeBox(const gp_Pnt& P, const Standard_Real dx, const Standard_Real dy, const Standard_Real dz);
0066   
0067   //! Make a box with corners P1,P2.
0068   Standard_EXPORT BRepPrimAPI_MakeBox(const gp_Pnt& P1, const gp_Pnt& P2);
0069   
0070   //! Make a box with Ax2 (the left corner and the axis) and size dx, dy, dz.
0071   Standard_EXPORT BRepPrimAPI_MakeBox(const gp_Ax2& Axes, const Standard_Real dx, const Standard_Real dy, const Standard_Real dz);
0072   
0073   //! Init a box with a corner at 0,0,0 and the other theDX, theDY, theDZ
0074   Standard_EXPORT void Init (const Standard_Real theDX, const Standard_Real theDY, const Standard_Real theDZ);
0075   
0076   //! Init a box with a corner at thePnt and size theDX, theDY, theDZ.
0077   Standard_EXPORT void Init (const gp_Pnt& thePnt,
0078                              const Standard_Real theDX,
0079                              const Standard_Real theDY,
0080                              const Standard_Real theDZ);
0081   
0082   //! Init a box with corners thePnt1, thePnt2.
0083   Standard_EXPORT void Init (const gp_Pnt& thePnt1, const gp_Pnt& thePnt2);
0084 
0085   //! Init a box with Ax2 (the left corner and the theAxes) and size theDX, theDY, theDZ.
0086   Standard_EXPORT void Init (const gp_Ax2& theAxes,
0087                              const Standard_Real theDX,
0088                              const Standard_Real theDY,
0089                              const Standard_Real theDZ);
0090 
0091   //! Returns the internal algorithm.
0092   Standard_EXPORT BRepPrim_Wedge& Wedge();
0093   
0094   //! Stores the solid in myShape.
0095   Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0096   
0097   //! Returns the constructed box as a shell.
0098   Standard_EXPORT const TopoDS_Shell& Shell();
0099 Standard_EXPORT operator TopoDS_Shell();
0100   
0101   //! Returns the constructed box as a solid.
0102   Standard_EXPORT const TopoDS_Solid& Solid();
0103 Standard_EXPORT operator TopoDS_Solid();
0104   
0105   //! Returns ZMin face
0106   Standard_EXPORT const TopoDS_Face& BottomFace();
0107   
0108   //! Returns XMin face
0109   Standard_EXPORT const TopoDS_Face& BackFace();
0110   
0111   //! Returns XMax face
0112   Standard_EXPORT const TopoDS_Face& FrontFace();
0113   
0114   //! Returns YMin face
0115   Standard_EXPORT const TopoDS_Face& LeftFace();
0116   
0117   //! Returns YMax face
0118   Standard_EXPORT const TopoDS_Face& RightFace();
0119   
0120   //! Returns ZMax face
0121   Standard_EXPORT const TopoDS_Face& TopFace();
0122 
0123 
0124 
0125 
0126 protected:
0127 
0128 
0129   BRepPrim_Wedge myWedge;
0130 
0131 
0132 
0133 private:
0134 
0135 
0136 
0137 
0138 
0139 };
0140 
0141 
0142 
0143 
0144 
0145 
0146 
0147 #endif // _BRepPrimAPI_MakeBox_HeaderFile