1 // Created on: 1994-02-16
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepBuilderAPI_MakeShell_HeaderFile
18 #define _BRepBuilderAPI_MakeShell_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <BRepLib_MakeShell.hxx>
25 #include <BRepBuilderAPI_MakeShape.hxx>
26 #include <Standard_Real.hxx>
27 #include <BRepBuilderAPI_ShellError.hxx>
32 //! Describes functions to build a
33 //! shape corresponding to the skin of a surface.
34 //! Note that the term shell in the class name has the same definition
35 //! as that of a shell in STEP, in other words the skin of a shape,
36 //! and not a solid model defined by surface and thickness. If you want
37 //! to build the second sort of shell, you must use
38 //! BRepOffsetAPI_MakeOffsetShape. A shell is made of a series of
39 //! faces connected by their common edges.
40 //! If the underlying surface of a face is not C2 continuous and
41 //! the flag Segment is True, MakeShell breaks the surface down into
42 //! several faces which are all C2 continuous and which are
43 //! connected along the non-regular curves on the surface.
44 //! The resulting shell contains all these faces.
45 //! Construction of a Shell from a non-C2 continuous Surface
46 //! A MakeShell object provides a framework for:
47 //! - defining the construction of a shell,
48 //! - implementing the construction algorithm, and
49 //! - consulting the result.
51 //! The connected C2 faces in the shell resulting from a decomposition of
52 //! the surface are not sewn. For a sewn result, you need to use
53 //! BRepOffsetAPI_Sewing. For a shell with thickness, you need to use
54 //! BRepOffsetAPI_MakeOffsetShape.
55 class BRepBuilderAPI_MakeShell : public BRepBuilderAPI_MakeShape
62 //! Constructs an empty shell framework. The Init
63 //! function is used to define the construction arguments.
65 //! The function Error will return
66 //! BRepBuilderAPI_EmptyShell if it is called before the function Init.
67 Standard_EXPORT BRepBuilderAPI_MakeShell();
69 //! Constructs a shell from the surface S.
70 Standard_EXPORT BRepBuilderAPI_MakeShell(const Handle(Geom_Surface)& S, const Standard_Boolean Segment = Standard_False);
72 //! Constructs a shell from the surface S,
73 //! limited in the u parametric direction by the two
74 //! parameter values UMin and UMax, and limited in the v
75 //! parametric direction by the two parameter values VMin and VMax.
76 Standard_EXPORT BRepBuilderAPI_MakeShell(const Handle(Geom_Surface)& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax, const Standard_Boolean Segment = Standard_False);
78 //! Defines or redefines the arguments
79 //! for the construction of a shell. The construction is initialized
80 //! with the surface S, limited in the u parametric direction by the
81 //! two parameter values UMin and UMax, and in the v parametric
82 //! direction by the two parameter values VMin and VMax.
84 //! The function Error returns:
85 //! - BRepBuilderAPI_ShellParametersOutOfRange
86 //! when the given parameters are outside the bounds of the
87 //! surface or the basis surface if S is trimmed
88 Standard_EXPORT void Init (const Handle(Geom_Surface)& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax, const Standard_Boolean Segment = Standard_False);
90 //! Returns true if the shell is built.
91 Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
93 //! Returns the construction status:
94 //! - BRepBuilderAPI_ShellDone if the shell is built, or
95 //! - another value of the BRepBuilderAPI_ShellError
96 //! enumeration indicating why the construction failed.
97 //! This is frequently BRepBuilderAPI_ShellParametersOutOfRange
98 //! indicating that the given parameters are outside the bounds of the surface.
99 Standard_EXPORT BRepBuilderAPI_ShellError Error() const;
101 //! Returns the new Shell.
102 Standard_EXPORT const TopoDS_Shell& Shell() const;
103 Standard_EXPORT operator TopoDS_Shell() const;
118 BRepLib_MakeShell myMakeShell;
129 #endif // _BRepBuilderAPI_MakeShell_HeaderFile