Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:15:47

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 _BRepBuilderAPI_MakeSolid_HeaderFile
0018 #define _BRepBuilderAPI_MakeSolid_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <BRepLib_MakeSolid.hxx>
0025 #include <BRepBuilderAPI_MakeShape.hxx>
0026 class TopoDS_CompSolid;
0027 class TopoDS_Shell;
0028 class TopoDS_Solid;
0029 class TopoDS_Shape;
0030 
0031 //! Describes functions to build a solid from shells.
0032 //! A solid is made of one shell, or a series of shells, which
0033 //! do not intersect each other. One of these shells
0034 //! constitutes the outside skin of the solid. It may be closed
0035 //! (a finite solid) or open (an infinite solid). Other shells
0036 //! form hollows (cavities) in these previous ones. Each
0037 //! must bound a closed volume.
0038 //! A MakeSolid object provides a framework for:
0039 //! -   defining and implementing the construction of a solid, and
0040 //! -   consulting the result.
0041 class BRepBuilderAPI_MakeSolid : public BRepBuilderAPI_MakeShape
0042 {
0043 public:
0044   DEFINE_STANDARD_ALLOC
0045 
0046   //! Initializes the construction of a solid. An empty solid is
0047   //! considered to cover the whole space. The Add function
0048   //! is used to define shells to bound it.
0049   Standard_EXPORT BRepBuilderAPI_MakeSolid();
0050 
0051   //! Make a solid from a CompSolid.
0052   Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_CompSolid& S);
0053 
0054   //! Make a solid from a shell.
0055   Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S);
0056 
0057   //! Make a solid from two shells.
0058   Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1, const TopoDS_Shell& S2);
0059 
0060   //! Make a solid from three shells.
0061   //! Constructs a solid
0062   //! -   covering the whole space, or
0063   //! -   from shell S, or
0064   //! -   from two shells S1 and S2, or
0065   //! -   from three shells S1, S2 and S3, or
0066   //! Warning
0067   //! No check is done to verify the conditions of coherence
0068   //! of the resulting solid. In particular, S1, S2 (and S3) must
0069   //! not intersect each other.
0070   //! Besides, after all shells have been added using the Add
0071   //! function, one of these shells should constitute the outside
0072   //! skin of the solid; it may be closed (a finite solid) or open
0073   //! (an infinite solid). Other shells form hollows (cavities) in
0074   //! these previous ones. Each must bound a closed volume.
0075   Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1,
0076                                            const TopoDS_Shell& S2,
0077                                            const TopoDS_Shell& S3);
0078 
0079   //! Make a solid from a solid. useful for adding later.
0080   Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So);
0081 
0082   //! Add a shell to a solid.
0083   //!
0084   //! Constructs a solid:
0085   //! -   from the solid So, to which shells can be added, or
0086   //! -   by adding the shell S to the solid So.
0087   //! Warning
0088   //! No check is done to verify the conditions of coherence
0089   //! of the resulting solid. In particular S must not intersect the solid S0.
0090   //! Besides, after all shells have been added using the Add
0091   //! function, one of these shells should constitute the outside
0092   //! skin of the solid. It may be closed (a finite solid) or open
0093   //! (an infinite solid). Other shells form hollows (cavities) in
0094   //! the previous ones. Each must bound a closed volume.
0095   Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So, const TopoDS_Shell& S);
0096 
0097   //! Adds the shell to the current solid.
0098   //! Warning
0099   //! No check is done to verify the conditions of coherence
0100   //! of the resulting solid. In particular, S must not intersect
0101   //! other shells of the solid under construction.
0102   //! Besides, after all shells have been added, one of
0103   //! these shells should constitute the outside skin of the
0104   //! solid. It may be closed (a finite solid) or open (an
0105   //! infinite solid). Other shells form hollows (cavities) in
0106   //! these previous ones. Each must bound a closed volume.
0107   Standard_EXPORT void Add(const TopoDS_Shell& S);
0108 
0109   //! Returns true if the solid is built.
0110   //! For this class, a solid under construction is always valid.
0111   //! If no shell has been added, it could be a whole-space
0112   //! solid. However, no check was done to verify the
0113   //! conditions of coherence of the resulting solid.
0114   Standard_EXPORT bool IsDone() const override;
0115 
0116   //! Returns the new Solid.
0117   Standard_EXPORT const TopoDS_Solid& Solid();
0118   Standard_EXPORT                     operator TopoDS_Solid();
0119 
0120   Standard_EXPORT bool IsDeleted(const TopoDS_Shape& S) override;
0121 
0122 private:
0123   BRepLib_MakeSolid myMakeSolid;
0124 };
0125 
0126 #endif // _BRepBuilderAPI_MakeSolid_HeaderFile