summaryrefslogtreecommitdiff
path: root/src/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.cxx
blob: 6bf2c0da8b1d54453b1609f798609ac583b20f78 (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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// File:	BRepOffsetAPI_MakeEvolved.cxx
// Created:	Mon Sep 18 14:27:09 1995
// Author:	Bruno DUMORTIER
//		<dub@fuegox>


#include <BRepOffsetAPI_MakeEvolved.ixx>

#include <gp_Ax3.hxx>
#include <BRepFill.hxx>

//=======================================================================
//function : BRepOffsetAPI_MakeEvolved
//purpose  : 
//=======================================================================

BRepOffsetAPI_MakeEvolved::BRepOffsetAPI_MakeEvolved()
{
}


//=======================================================================
//function : BRepOffsetAPI_MakeEvolved
//purpose  : 
//=======================================================================

BRepOffsetAPI_MakeEvolved::BRepOffsetAPI_MakeEvolved(const TopoDS_Wire&     Spine,
					 const TopoDS_Wire&     Profil, 
					 const GeomAbs_JoinType Join,
					 const Standard_Boolean AxeProf,
					 const Standard_Boolean Solid,
					 const Standard_Boolean ProfOnSpine,
					 const Standard_Real    Tol)
{
  gp_Ax3 Axis(gp_Pnt(0.,0.,0.),
	      gp_Dir(0.,0.,1.),
	      gp_Dir(1.,0.,0.));

  if ( !AxeProf) {
    Standard_Boolean POS;
    BRepFill::Axe(Spine,Profil,Axis,POS,Tol);
    if (ProfOnSpine && !POS) return;
  }

  myEvolved.Perform(Spine,Profil,Axis,Join,Solid);
  Build();
  Done();
}


//=======================================================================
//function : BRepOffsetAPI_MakeEvolved
//purpose  : 
//=======================================================================

BRepOffsetAPI_MakeEvolved::BRepOffsetAPI_MakeEvolved(const TopoDS_Face&     Spine,
					 const TopoDS_Wire&     Profil,
					 const GeomAbs_JoinType Join,
					 const Standard_Boolean AxeProf,
					 const Standard_Boolean Solid,
					 const Standard_Boolean ProfOnSpine,
					 const Standard_Real    Tol)
{
  gp_Ax3 Axis(gp_Pnt(0.,0.,0.),
	      gp_Dir(0.,0.,1.),
	      gp_Dir(1.,0.,0.));

  if ( !AxeProf) {
    Standard_Boolean POS;
    BRepFill::Axe(Spine,Profil,Axis,POS,Tol);
    if (ProfOnSpine && !POS) return;
  }

  myEvolved.Perform(Spine,Profil,Axis,Join,Solid);
  Build();
}


//=======================================================================
//function : BRepFill_Evolved&
//purpose  : 
//=======================================================================

const BRepFill_Evolved& BRepOffsetAPI_MakeEvolved::Evolved() const 
{
  return myEvolved;
}


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

void BRepOffsetAPI_MakeEvolved::Build()
{
  myShape = myEvolved.Shape();
  if (myEvolved.IsDone())  Done();
}


//=======================================================================
//function : Top
//purpose  : 
//=======================================================================

const TopoDS_Shape&  BRepOffsetAPI_MakeEvolved::Top() const 
{
  return myEvolved.Top();
}

//=======================================================================
//function : Bottom
//purpose  : 
//=======================================================================

const TopoDS_Shape&  BRepOffsetAPI_MakeEvolved::Bottom() const 
{
  return myEvolved.Bottom();
}

//=======================================================================
//function : GeneratedShapes
//purpose  : 
//=======================================================================

const TopTools_ListOfShape&  BRepOffsetAPI_MakeEvolved::GeneratedShapes ( 
   const TopoDS_Shape& SpineShape,
   const TopoDS_Shape& ProfShape )
const 
{
  return myEvolved.GeneratedShapes(SpineShape,ProfShape);
}