0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / BRepBuilderAPI / BRepBuilderAPI_ModifyShape.hxx
1 // Created on: 1994-12-02
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _BRepBuilderAPI_ModifyShape_HeaderFile
18 #define _BRepBuilderAPI_ModifyShape_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <BRepTools_Modifier.hxx>
25 #include <TopoDS_Shape.hxx>
26 #include <BRepBuilderAPI_MakeShape.hxx>
27 #include <TopTools_ListOfShape.hxx>
28 class BRepTools_Modification;
29 class Standard_NullObject;
30 class Standard_NoSuchObject;
31 class TopoDS_Shape;
32
33
34 //! Implements   the  methods   of MakeShape for   the
35 //! constant  topology modifications.  The methods are
36 //! implemented  when the modification uses a Modifier
37 //! from BRepTools. Some of  them have to be redefined
38 //! if  the  modification is  implemented with another
39 //! tool (see Transform from BRepBuilderAPI for example).
40 //! The BRepBuilderAPI package provides the following
41 //! frameworks to perform modifications of this sort:
42 //! -   BRepBuilderAPI_Copy to produce the copy of a shape,
43 //! -   BRepBuilderAPI_Transform and
44 //! BRepBuilderAPI_GTransform to apply a geometric
45 //! transformation to a shape,
46 //! -   BRepBuilderAPI_NurbsConvert to convert the
47 //! whole geometry of a shape into NURBS geometry,
48 //! -   BRepOffsetAPI_DraftAngle to build a tapered shape.
49 class BRepBuilderAPI_ModifyShape  : public BRepBuilderAPI_MakeShape
50 {
51 public:
52
53   DEFINE_STANDARD_ALLOC
54
55   
56   //! Returns the list  of shapes modified from the shape
57   //! <S>.
58   Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& S) Standard_OVERRIDE;
59   
60   //! Returns the modified shape corresponding to <S>.
61   //! S can correspond to the entire initial shape or to its subshape.
62   //! Exceptions
63   //! Standard_NoSuchObject if S is not the initial shape or
64   //! a subshape of the initial shape to which the
65   //! transformation has been applied. Raises NoSuchObject from Standard
66   //! if S is not the initial shape or a sub-shape
67   //! of the initial shape.
68   Standard_EXPORT virtual TopoDS_Shape ModifiedShape (const TopoDS_Shape& S) const;
69
70
71
72
73 protected:
74
75   
76   //! Empty constructor.
77   Standard_EXPORT BRepBuilderAPI_ModifyShape();
78   
79   //! Initializes the modifier with  the Shape  <S>, and
80   //! set the field <myInitialShape> to <S>.
81   Standard_EXPORT BRepBuilderAPI_ModifyShape(const TopoDS_Shape& S);
82   
83   //! Set the field <myModification> with <M>.
84   Standard_EXPORT BRepBuilderAPI_ModifyShape(const Handle(BRepTools_Modification)& M);
85   
86   //! Initializes the modifier with  the Shape  <S>, and
87   //! set the field <myInitialShape> to <S>, and set the
88   //! field <myModification> with  <M>, the performs the
89   //! modification.
90   Standard_EXPORT BRepBuilderAPI_ModifyShape(const TopoDS_Shape& S, const Handle(BRepTools_Modification)& M);
91   
92   //! Performs the previously  given modification on the
93   //! shape <S>.
94   Standard_EXPORT void DoModif (const TopoDS_Shape& S);
95   
96   //! Performs the  modification   <M> on a   previously
97   //! given shape.
98   Standard_EXPORT void DoModif (const Handle(BRepTools_Modification)& M);
99   
100   //! Performs the  modification <M> on the shape <S>.
101   Standard_EXPORT void DoModif (const TopoDS_Shape& S, const Handle(BRepTools_Modification)& M);
102
103
104   BRepTools_Modifier myModifier;
105   TopoDS_Shape myInitialShape;
106   Handle(BRepTools_Modification) myModification;
107
108
109 private:
110
111   
112   Standard_EXPORT void DoModif();
113
114
115
116
117 };
118
119
120
121
122
123
124
125 #endif // _BRepBuilderAPI_ModifyShape_HeaderFile