1 // Created on: 1995-09-01
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1995-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 <BRepFill_OffsetAncestors.ixx>
19 #include <TopExp_Explorer.hxx>
20 #include <TopoDS_Face.hxx>
21 #include <TopTools_ListIteratorOfListOfShape.hxx>
23 //=======================================================================
24 //function : BRepFill_OffsetAncestors
26 //=======================================================================
28 BRepFill_OffsetAncestors::BRepFill_OffsetAncestors()
29 :myIsPerform(Standard_False)
34 //=======================================================================
35 //function : BRepFill_OffsetAncestors
37 //=======================================================================
39 BRepFill_OffsetAncestors::BRepFill_OffsetAncestors
40 (BRepFill_OffsetWire& Paral)
46 //=======================================================================
49 //=======================================================================
51 void BRepFill_OffsetAncestors::Perform(BRepFill_OffsetWire& Paral)
53 TopoDS_Face Spine = Paral.Spine();
56 TopTools_ListIteratorOfListOfShape it;
58 // on itere sur les edges.
59 for ( Exp.Init(Spine, TopAbs_EDGE); Exp.More(); Exp.Next()) {
60 for (it.Initialize(Paral.GeneratedShapes(Exp.Current()));
61 it.More(); it.Next()) {
62 myMap.Bind( it.Value(), Exp.Current());
66 // on itere sur les vertex.
67 for ( Exp.Init(Spine, TopAbs_VERTEX); Exp.More(); Exp.Next()) {
68 for (it.Initialize(Paral.GeneratedShapes(Exp.Current()));
69 it.More(); it.Next()) {
70 myMap.Bind( it.Value(), Exp.Current());
74 myIsPerform = Standard_True;
77 //=======================================================================
80 //=======================================================================
82 Standard_Boolean BRepFill_OffsetAncestors::IsDone() const
87 //=======================================================================
90 //=======================================================================
92 Standard_Boolean BRepFill_OffsetAncestors:: HasAncestor(const TopoDS_Edge& S1)
95 return myMap.IsBound(S1);
98 //=======================================================================
99 //function : TopoDS_Shape&
101 //=======================================================================
103 const TopoDS_Shape& BRepFill_OffsetAncestors::Ancestor(const TopoDS_Edge& S1)
106 StdFail_NotDone_Raise_if( !myIsPerform, "");