summaryrefslogtreecommitdiff
path: root/src/BRepFill/BRepFill_OffsetAncestors.cxx
blob: 992c4610812316ebc095ada51041a12ca65711ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// File:	BRepFill_OffsetAncestors.cxx
// Created:	Fri Sep  1 14:32:44 1995
// Author:	Bruno DUMORTIER
//		<dub@fuegox>


#include <BRepFill_OffsetAncestors.ixx>

#include <TopExp_Explorer.hxx>
#include <TopoDS_Face.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>

//=======================================================================
//function : BRepFill_OffsetAncestors
//purpose  : 
//=======================================================================

BRepFill_OffsetAncestors::BRepFill_OffsetAncestors()
:myIsPerform(Standard_False)
{
}


//=======================================================================
//function : BRepFill_OffsetAncestors
//purpose  : 
//=======================================================================

BRepFill_OffsetAncestors::BRepFill_OffsetAncestors
(BRepFill_OffsetWire& Paral)
{
  Perform(Paral);
}


//=======================================================================
//function : Perform
//purpose  : 
//=======================================================================

void BRepFill_OffsetAncestors::Perform(BRepFill_OffsetWire& Paral)
{
  TopoDS_Face Spine = Paral.Spine();
  
  TopExp_Explorer                    Exp;
  TopTools_ListIteratorOfListOfShape it;

  // on itere sur les edges.
  for ( Exp.Init(Spine, TopAbs_EDGE); Exp.More(); Exp.Next()) {
    for (it.Initialize(Paral.GeneratedShapes(Exp.Current()));
	 it.More(); it.Next()) {
      myMap.Bind( it.Value(), Exp.Current());
    }
  }

  // on itere sur les vertex.
  for ( Exp.Init(Spine, TopAbs_VERTEX); Exp.More(); Exp.Next()) {
    for (it.Initialize(Paral.GeneratedShapes(Exp.Current()));
	 it.More(); it.Next()) {
      myMap.Bind( it.Value(), Exp.Current());
    }
  }

  myIsPerform = Standard_True;
}

//=======================================================================
//function : IsDone
//purpose  : 
//=======================================================================

Standard_Boolean BRepFill_OffsetAncestors::IsDone() const
{
  return myIsPerform;
}

//=======================================================================
//function : IsDone
//purpose  : 
//=======================================================================

Standard_Boolean BRepFill_OffsetAncestors:: HasAncestor(const TopoDS_Edge& S1)
const
{
  return myMap.IsBound(S1);
}

//=======================================================================
//function : TopoDS_Shape&
//purpose  : 
//=======================================================================

const TopoDS_Shape& BRepFill_OffsetAncestors::Ancestor(const TopoDS_Edge& S1)
const
{
  StdFail_NotDone_Raise_if( !myIsPerform, "");
  return myMap(S1);
}