1 // Created on: 1996-02-13
2 // Created by: Yves FRICAUD
3 // Copyright (c) 1996-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 #include <BRepOffsetAPI_MakeThickSolid.ixx>
18 #include <BRepOffset_MakeOffset.hxx>
19 #include <Standard_ConstructionError.hxx>
20 #include <TopTools_ListIteratorOfListOfShape.hxx>
24 //=======================================================================
25 //function : BRepOffsetAPI_MakeThickSolid
27 //=======================================================================
29 BRepOffsetAPI_MakeThickSolid::BRepOffsetAPI_MakeThickSolid()
34 //=======================================================================
35 //function : BRepOffsetAPI_MakeThickSolid
37 //=======================================================================
39 BRepOffsetAPI_MakeThickSolid::BRepOffsetAPI_MakeThickSolid
40 (const TopoDS_Shape& S,
41 const TopTools_ListOfShape& ClosingFaces,
42 const Standard_Real Offset,
43 const Standard_Real Tol,
44 const BRepOffset_Mode Mode,
45 const Standard_Boolean Intersection,
46 const Standard_Boolean SelfInter,
47 const GeomAbs_JoinType Join)
49 myOffsetShape.Initialize (S,Offset,Tol,Mode,Intersection,SelfInter,Join);
50 TopTools_ListIteratorOfListOfShape it(ClosingFaces);
51 for (; it.More(); it.Next()) {
52 myOffsetShape.AddFace(TopoDS::Face(it.Value()));
57 //=======================================================================
60 //=======================================================================
62 void BRepOffsetAPI_MakeThickSolid::Build()
65 myOffsetShape.MakeThickSolid();
66 if (!myOffsetShape.IsDone()) return;
67 myShape = myOffsetShape.Shape();
74 //=======================================================================
77 //=======================================================================
79 const TopTools_ListOfShape& BRepOffsetAPI_MakeThickSolid::Modified (const TopoDS_Shape& F)
83 if (myOffsetShape.OffsetFacesFromShapes().HasImage(F)) {
84 if (myOffsetShape.ClosingFaces().Contains(F)) {
85 myOffsetShape.OffsetFacesFromShapes().LastImage (F, myGenerated);
86 // Les face du resultat sont orientees comme dans la piece initiale.
87 //si offset a l interieur.
88 TopTools_ListIteratorOfListOfShape it(myGenerated);
89 for (; it.More(); it.Next())