0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- automatic
[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-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 <Adaptor2d_HCurve2d.hxx>
19 #include <Adaptor3d_HCurve.hxx>
20 #include <Adaptor3d_HCurveOnSurface.hxx>
21 #include <Adaptor3d_HSurface.hxx>
22 #include <BRep_Tool.hxx>
23 #include <BRepAdaptor_HSurface.hxx>
24 #include <BRepFill_CurveConstraint.hxx>
25 #include <GCPnts_AbscissaPoint.hxx>
26 #include <Geom2dAdaptor_HCurve.hxx>
27 #include <Geom_Plane.hxx>
28 #include <GeomAdaptor.hxx>
29 #include <GeomAdaptor_HSurface.hxx>
30 #include <GeomAPI.hxx>
31 #include <GeomPlate_CurveConstraint.hxx>
32 #include <Precision.hxx>
33 #include <ProjLib_ProjectedCurve.hxx>
34 #include <ProjLib_ProjectOnPlane.hxx>
35 #include <Standard_ConstructionError.hxx>
36 #include <Standard_Type.hxx>
37
38 IMPLEMENT_STANDARD_RTTIEXT(BRepFill_CurveConstraint,GeomPlate_CurveConstraint)
39
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