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
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_ModifyShape_HeaderFile
18 #define _BRepBuilderAPI_ModifyShape_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
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;
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
56 //! Returns the list of shapes modified from the shape
58 Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& S) Standard_OVERRIDE;
60 //! Returns the modified shape corresponding to <S>.
61 //! S can correspond to the entire initial shape or to its subshape.
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;
76 //! Empty constructor.
77 Standard_EXPORT BRepBuilderAPI_ModifyShape();
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);
83 //! Set the field <myModification> with <M>.
84 Standard_EXPORT BRepBuilderAPI_ModifyShape(const Handle(BRepTools_Modification)& M);
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
90 Standard_EXPORT BRepBuilderAPI_ModifyShape(const TopoDS_Shape& S, const Handle(BRepTools_Modification)& M);
92 //! Performs the previously given modification on the
94 Standard_EXPORT void DoModif (const TopoDS_Shape& S);
96 //! Performs the modification <M> on a previously
98 Standard_EXPORT void DoModif (const Handle(BRepTools_Modification)& M);
100 //! Performs the modification <M> on the shape <S>.
101 Standard_EXPORT void DoModif (const TopoDS_Shape& S, const Handle(BRepTools_Modification)& M);
104 BRepTools_Modifier myModifier;
105 TopoDS_Shape myInitialShape;
106 Handle(BRepTools_Modification) myModification;
112 Standard_EXPORT void DoModif();
125 #endif // _BRepBuilderAPI_ModifyShape_HeaderFile