0023024: Update headers of OCCT files
[occt.git] / src / BRepFill / BRepFill_CurveConstraint.cxx
1 // Created on: 1997-10-31
2 // Created by: Joelle CHAUVET
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
5 //
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
10 //
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 //
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
20
21
22
23 #include <BRepFill_CurveConstraint.ixx>
24 #include <GeomPlate_CurveConstraint.hxx>
25 #include <GCPnts_AbscissaPoint.hxx>
26 #include <Adaptor2d_HCurve2d.hxx>
27 #include <Adaptor3d_HSurface.hxx>
28 #include <ProjLib_ProjectOnPlane.hxx>
29 #include <GeomAdaptor.hxx>
30 #include <GeomAPI.hxx>
31 #include <Geom_Plane.hxx>
32 #include <Precision.hxx>
33 #include <GeomAdaptor_HSurface.hxx>
34 #include <BRepAdaptor_HSurface.hxx>
35 #include <BRep_Tool.hxx>
36
37 #include <Geom2dAdaptor_HCurve.hxx>
38 #include <Adaptor2d_HCurve2d.hxx>
39 #include <ProjLib_ProjectedCurve.hxx>
40 //---------------------------------------------------------
41 //         Constructeurs avec courbe sur surface
42 //---------------------------------------------------------
43 BRepFill_CurveConstraint :: BRepFill_CurveConstraint (const Handle(Adaptor3d_HCurveOnSurface)& Boundary,
44                                                 const Standard_Integer Tang,
45                                                 const Standard_Integer NPt,
46                                                 const Standard_Real TolDist,
47                                                 const Standard_Real TolAng,
48                                                 const Standard_Real TolCurv
49 )
50
51   myFrontiere=Boundary;
52   myTolDist=TolDist;
53   myTolAng=TolAng;
54   myTolCurv=TolCurv;
55   GeomLProp_SLProps SLP(2,TolDist);
56   myLProp=SLP;
57   myOrder=Tang;
58   if ((Tang<-1)||(Tang>2))
59     Standard_Failure::Raise("BRepFill : The continuity is not G0 G1 or G2"); 
60   myNbPoints=NPt;
61 myConstG0=Standard_True;
62 myConstG1=Standard_True;
63 myConstG2=Standard_True;
64  if (myFrontiere.IsNull())
65     Standard_Failure::Raise("BRepFill_CurveConstraint : Curve must be on a Surface"); 
66   Handle(Geom_Surface) Surf;
67   Handle(GeomAdaptor_HSurface) GS1;
68   GS1 = Handle(GeomAdaptor_HSurface)::DownCast(myFrontiere->ChangeCurve().GetSurface());
69   if (!GS1.IsNull()) {
70     Surf=GS1->ChangeSurface().Surface();
71   }
72   else {
73     Handle(BRepAdaptor_HSurface) BS1;
74     BS1=Handle(BRepAdaptor_HSurface)::DownCast(myFrontiere->ChangeCurve().GetSurface());
75     Surf = BRep_Tool::Surface(BS1->ChangeSurface().Face());
76   }
77   myLProp.SetSurface(Surf);
78 }
79
80 //---------------------------------------------------------
81 //    Constructeurs avec courbe 3d (pour continuite G0 G-1)
82 //---------------------------------------------------------
83 BRepFill_CurveConstraint :: BRepFill_CurveConstraint (const Handle(Adaptor3d_HCurve)& Boundary,
84                                                 const Standard_Integer Tang, 
85                                                 const Standard_Integer NPt,
86                                                 const Standard_Real TolDist) 
87 : GeomPlate_CurveConstraint(Boundary,Tang,NPt,TolDist)
88
89
90 }
91
92
93
94
95