0028643: Coding rules - eliminate GCC compiler warnings -Wmisleading-indentation
[occt.git] / src / BRepOffsetAPI / BRepOffsetAPI_MakeEvolved.cxx
1 // Created on: 1995-09-18
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17
18 #include <BRepFill.hxx>
19 #include <BRepFill_Evolved.hxx>
20 #include <BRepOffsetAPI_MakeEvolved.hxx>
21 #include <gp_Ax3.hxx>
22 #include <TopoDS_Face.hxx>
23 #include <TopoDS_Shape.hxx>
24 #include <TopoDS_Wire.hxx>
25
26 //=======================================================================
27 //function : BRepOffsetAPI_MakeEvolved
28 //purpose  : 
29 //=======================================================================
30 BRepOffsetAPI_MakeEvolved::BRepOffsetAPI_MakeEvolved()
31 {
32 }
33
34
35 //=======================================================================
36 //function : BRepOffsetAPI_MakeEvolved
37 //purpose  : 
38 //=======================================================================
39
40 BRepOffsetAPI_MakeEvolved::BRepOffsetAPI_MakeEvolved(const TopoDS_Wire&     Spine,
41                                          const TopoDS_Wire&     Profil, 
42                                          const GeomAbs_JoinType Join,
43                                          const Standard_Boolean AxeProf,
44                                          const Standard_Boolean Solid,
45                                          const Standard_Boolean ProfOnSpine,
46                                          const Standard_Real    Tol)
47 {
48   gp_Ax3 Axis(gp_Pnt(0.,0.,0.),
49               gp_Dir(0.,0.,1.),
50               gp_Dir(1.,0.,0.));
51
52   if ( !AxeProf) {
53     Standard_Boolean POS;
54     BRepFill::Axe(Spine,Profil,Axis,POS,Tol);
55     if (ProfOnSpine && !POS) return;
56   }
57
58   myEvolved.Perform(Spine,Profil,Axis,Join,Solid);
59   Build();
60   Done();
61 }
62
63
64 //=======================================================================
65 //function : BRepOffsetAPI_MakeEvolved
66 //purpose  : 
67 //=======================================================================
68
69 BRepOffsetAPI_MakeEvolved::BRepOffsetAPI_MakeEvolved(const TopoDS_Face&     Spine,
70                                          const TopoDS_Wire&     Profil,
71                                          const GeomAbs_JoinType Join,
72                                          const Standard_Boolean AxeProf,
73                                          const Standard_Boolean Solid,
74                                          const Standard_Boolean ProfOnSpine,
75                                          const Standard_Real    Tol)
76 {
77   gp_Ax3 Axis(gp_Pnt(0.,0.,0.),
78               gp_Dir(0.,0.,1.),
79               gp_Dir(1.,0.,0.));
80
81   if ( !AxeProf) {
82     Standard_Boolean POS;
83     BRepFill::Axe(Spine,Profil,Axis,POS,Tol);
84     if (ProfOnSpine && !POS) return;
85   }
86
87   myEvolved.Perform(Spine,Profil,Axis,Join,Solid);
88   Build();
89 }
90
91
92 //=======================================================================
93 //function : BRepFill_Evolved&
94 //purpose  : 
95 //=======================================================================
96
97 const BRepFill_Evolved& BRepOffsetAPI_MakeEvolved::Evolved() const 
98 {
99   return myEvolved;
100 }
101
102
103 //=======================================================================
104 //function :
105 //purpose  : 
106 //=======================================================================
107
108 void BRepOffsetAPI_MakeEvolved::Build()
109 {
110   myShape = myEvolved.Shape();
111   if (myEvolved.IsDone())  Done();
112 }
113
114
115 //=======================================================================
116 //function : Top
117 //purpose  : 
118 //=======================================================================
119
120 const TopoDS_Shape&  BRepOffsetAPI_MakeEvolved::Top() const 
121 {
122   return myEvolved.Top();
123 }
124
125 //=======================================================================
126 //function : Bottom
127 //purpose  : 
128 //=======================================================================
129
130 const TopoDS_Shape&  BRepOffsetAPI_MakeEvolved::Bottom() const 
131 {
132   return myEvolved.Bottom();
133 }
134
135 //=======================================================================
136 //function : GeneratedShapes
137 //purpose  : 
138 //=======================================================================
139
140 const TopTools_ListOfShape&  BRepOffsetAPI_MakeEvolved::GeneratedShapes ( 
141    const TopoDS_Shape& SpineShape,
142    const TopoDS_Shape& ProfShape )
143 const 
144 {
145   return myEvolved.GeneratedShapes(SpineShape,ProfShape);
146 }