0022627: Change OCCT memory management defaults
[occt.git] / src / BRepFill / BRepFill_Section.cxx
CommitLineData
7fd59977 1// File: BRepFill_Section.cxx
2// Created: Wed Jul 22 10:50:48 1998
3// Author: Philippe MANGIN
4// <pmn@sgi29>
5
6
7#include <BRepFill_Section.ixx>
8
9#include <TopoDS.hxx>
10#include <BRep_Builder.hxx>
11#include <TopoDS_Edge.hxx>
12
13
14BRepFill_Section::BRepFill_Section() :islaw(0), contact(0), correction(0)
15{
16}
17
18
19BRepFill_Section::BRepFill_Section(const TopoDS_Shape& Profile,
20 const TopoDS_Vertex& V,
21 const Standard_Boolean WithContact,
22 const Standard_Boolean WithCorrection)
23 : vertex(V),
24 islaw(0),contact(WithContact),
25 correction(WithCorrection)
26{
27 if (Profile.ShapeType() == TopAbs_WIRE)
28 wire = TopoDS::Wire(Profile);
29 else if (Profile.ShapeType() == TopAbs_VERTEX)
30 {
31 TopoDS_Vertex aVertex = TopoDS::Vertex(Profile);
32 BRep_Builder BB;
33
34 TopoDS_Edge DegEdge;
35 BB.MakeEdge( DegEdge );
36 BB.Add( DegEdge, aVertex.Oriented(TopAbs_FORWARD) );
37 BB.Add( DegEdge, aVertex.Oriented(TopAbs_REVERSED) );
38 BB.Degenerated( DegEdge, Standard_True );
39 DegEdge.Closed( Standard_True );
40
41 BB.MakeWire( wire );
42 BB.Add( wire, DegEdge );
43 wire.Closed( Standard_True );
44 }
45 else
46 Standard_Failure::Raise("BRepFill_Section: bad shape type of section");
47}
48
49void BRepFill_Section::Set(const Standard_Boolean IsLaw)
50{
51 islaw = IsLaw;
52}