0026185: BRepOffsetAPI_MakeOffset: regressions on some customer's cases
[occt.git] / src / BRepFill / BRepFill_CurveConstraint.cxx
CommitLineData
b311480e 1// Created on: 1997-10-31
2// Created by: Joelle CHAUVET
3// Copyright (c) 1997-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <BRepFill_CurveConstraint.ixx>
18#include <GeomPlate_CurveConstraint.hxx>
19#include <GCPnts_AbscissaPoint.hxx>
20#include <Adaptor2d_HCurve2d.hxx>
21#include <Adaptor3d_HSurface.hxx>
22#include <ProjLib_ProjectOnPlane.hxx>
23#include <GeomAdaptor.hxx>
24#include <GeomAPI.hxx>
25#include <Geom_Plane.hxx>
26#include <Precision.hxx>
27#include <GeomAdaptor_HSurface.hxx>
28#include <BRepAdaptor_HSurface.hxx>
29#include <BRep_Tool.hxx>
30
31#include <Geom2dAdaptor_HCurve.hxx>
32#include <Adaptor2d_HCurve2d.hxx>
33#include <ProjLib_ProjectedCurve.hxx>
34//---------------------------------------------------------
35// Constructeurs avec courbe sur surface
36//---------------------------------------------------------
37BRepFill_CurveConstraint :: BRepFill_CurveConstraint (const Handle(Adaptor3d_HCurveOnSurface)& Boundary,
38 const Standard_Integer Tang,
39 const Standard_Integer NPt,
40 const Standard_Real TolDist,
41 const Standard_Real TolAng,
42 const Standard_Real TolCurv
43)
44{
45 myFrontiere=Boundary;
46 myTolDist=TolDist;
47 myTolAng=TolAng;
48 myTolCurv=TolCurv;
49 GeomLProp_SLProps SLP(2,TolDist);
50 myLProp=SLP;
51 myOrder=Tang;
52 if ((Tang<-1)||(Tang>2))
53 Standard_Failure::Raise("BRepFill : The continuity is not G0 G1 or G2");
54 myNbPoints=NPt;
55myConstG0=Standard_True;
56myConstG1=Standard_True;
57myConstG2=Standard_True;
58 if (myFrontiere.IsNull())
59 Standard_Failure::Raise("BRepFill_CurveConstraint : Curve must be on a Surface");
60 Handle(Geom_Surface) Surf;
61 Handle(GeomAdaptor_HSurface) GS1;
62 GS1 = Handle(GeomAdaptor_HSurface)::DownCast(myFrontiere->ChangeCurve().GetSurface());
63 if (!GS1.IsNull()) {
64 Surf=GS1->ChangeSurface().Surface();
65 }
66 else {
67 Handle(BRepAdaptor_HSurface) BS1;
68 BS1=Handle(BRepAdaptor_HSurface)::DownCast(myFrontiere->ChangeCurve().GetSurface());
69 Surf = BRep_Tool::Surface(BS1->ChangeSurface().Face());
70 }
71 myLProp.SetSurface(Surf);
72}
73
74//---------------------------------------------------------
75// Constructeurs avec courbe 3d (pour continuite G0 G-1)
76//---------------------------------------------------------
77BRepFill_CurveConstraint :: BRepFill_CurveConstraint (const Handle(Adaptor3d_HCurve)& Boundary,
78 const Standard_Integer Tang,
79 const Standard_Integer NPt,
80 const Standard_Real TolDist)
81: GeomPlate_CurveConstraint(Boundary,Tang,NPt,TolDist)
82
83{
84}
85
86
87
88
89