| 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 | //--------------------------------------------------------- |
| 39 | // Constructeurs avec courbe sur surface |
| 40 | //--------------------------------------------------------- |
| 41 | BRepFill_CurveConstraint :: BRepFill_CurveConstraint (const Handle(Adaptor3d_HCurveOnSurface)& Boundary, |
| 42 | const Standard_Integer Tang, |
| 43 | const Standard_Integer NPt, |
| 44 | const Standard_Real TolDist, |
| 45 | const Standard_Real TolAng, |
| 46 | const Standard_Real TolCurv |
| 47 | ) |
| 48 | { |
| 49 | myFrontiere=Boundary; |
| 50 | myTolDist=TolDist; |
| 51 | myTolAng=TolAng; |
| 52 | myTolCurv=TolCurv; |
| 53 | GeomLProp_SLProps SLP(2,TolDist); |
| 54 | myLProp=SLP; |
| 55 | myOrder=Tang; |
| 56 | if ((Tang<-1)||(Tang>2)) |
| 57 | Standard_Failure::Raise("BRepFill : The continuity is not G0 G1 or G2"); |
| 58 | myNbPoints=NPt; |
| 59 | myConstG0=Standard_True; |
| 60 | myConstG1=Standard_True; |
| 61 | myConstG2=Standard_True; |
| 62 | if (myFrontiere.IsNull()) |
| 63 | Standard_Failure::Raise("BRepFill_CurveConstraint : Curve must be on a Surface"); |
| 64 | Handle(Geom_Surface) Surf; |
| 65 | Handle(GeomAdaptor_HSurface) GS1; |
| 66 | GS1 = Handle(GeomAdaptor_HSurface)::DownCast(myFrontiere->ChangeCurve().GetSurface()); |
| 67 | if (!GS1.IsNull()) { |
| 68 | Surf=GS1->ChangeSurface().Surface(); |
| 69 | } |
| 70 | else { |
| 71 | Handle(BRepAdaptor_HSurface) BS1; |
| 72 | BS1=Handle(BRepAdaptor_HSurface)::DownCast(myFrontiere->ChangeCurve().GetSurface()); |
| 73 | Surf = BRep_Tool::Surface(BS1->ChangeSurface().Face()); |
| 74 | } |
| 75 | myLProp.SetSurface(Surf); |
| 76 | } |
| 77 | |
| 78 | //--------------------------------------------------------- |
| 79 | // Constructeurs avec courbe 3d (pour continuite G0 G-1) |
| 80 | //--------------------------------------------------------- |
| 81 | BRepFill_CurveConstraint :: BRepFill_CurveConstraint (const Handle(Adaptor3d_HCurve)& Boundary, |
| 82 | const Standard_Integer Tang, |
| 83 | const Standard_Integer NPt, |
| 84 | const Standard_Real TolDist) |
| 85 | : GeomPlate_CurveConstraint(Boundary,Tang,NPt,TolDist) |
| 86 | |
| 87 | { |
| 88 | } |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |