summaryrefslogtreecommitdiff
path: root/src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.cxx
blob: ca28547a702dc66ff911a2e57811062aa4c5446c (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
// File:	BRepOffsetAPI_MakeThickSolid.cxx
// Created:	Tue Feb 13 14:27:56 1996
// Author:	Yves FRICAUD
//		<yfr@stylox>


#include <BRepOffsetAPI_MakeThickSolid.ixx>
#include <BRepOffset_MakeOffset.hxx>
#include <Standard_ConstructionError.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopoDS.hxx>


//=======================================================================
//function : BRepOffsetAPI_MakeThickSolid
//purpose  : 
//=======================================================================

BRepOffsetAPI_MakeThickSolid::BRepOffsetAPI_MakeThickSolid()
{
}


//=======================================================================
//function : BRepOffsetAPI_MakeThickSolid
//purpose  : 
//=======================================================================

BRepOffsetAPI_MakeThickSolid::BRepOffsetAPI_MakeThickSolid
(const TopoDS_Shape&         S, 
 const TopTools_ListOfShape& ClosingFaces,
 const Standard_Real         Offset, 
 const Standard_Real         Tol, 
 const BRepOffset_Mode       Mode,
 const Standard_Boolean      Intersection,
 const Standard_Boolean      SelfInter,
 const GeomAbs_JoinType      Join)
{
  myOffsetShape.Initialize (S,Offset,Tol,Mode,Intersection,SelfInter,Join);
  TopTools_ListIteratorOfListOfShape it(ClosingFaces);
  for (; it.More(); it.Next()) {
    myOffsetShape.AddFace(TopoDS::Face(it.Value()));
  }
  Build();
}

//=======================================================================
//function : virtual
//purpose  : 
//=======================================================================

void BRepOffsetAPI_MakeThickSolid::Build()
{
  if (!IsDone()) {
    myOffsetShape.MakeThickSolid();
    if (!myOffsetShape.IsDone()) return;
    myShape  = myOffsetShape.Shape();
    Done();
  }
}



//=======================================================================
//function : Modified
//purpose  : 
//=======================================================================

const TopTools_ListOfShape& BRepOffsetAPI_MakeThickSolid::Modified (const TopoDS_Shape& F) 

{
  myGenerated.Clear();
  if (myOffsetShape.OffsetFacesFromShapes().HasImage(F)) {
    if (myOffsetShape.ClosingFaces().Contains(F)) { 
      myOffsetShape.OffsetFacesFromShapes().LastImage (F, myGenerated); 
      // Les face du resultat sont orientees comme dans la piece initiale.
      //si offset a l interieur.
      TopTools_ListIteratorOfListOfShape it(myGenerated);
      for (; it.More(); it.Next())
	it.Value().Reverse();
   
    }
  }
  return myGenerated;
}