0027232: Configuration - fix mblen missing building issue on Android
[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
42cf5bc1 17
7fd59977 18#include <Adaptor2d_HCurve2d.hxx>
42cf5bc1 19#include <Adaptor3d_HCurve.hxx>
20#include <Adaptor3d_HCurveOnSurface.hxx>
7fd59977 21#include <Adaptor3d_HSurface.hxx>
42cf5bc1 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>
7fd59977 28#include <GeomAdaptor.hxx>
42cf5bc1 29#include <GeomAdaptor_HSurface.hxx>
7fd59977 30#include <GeomAPI.hxx>
42cf5bc1 31#include <GeomPlate_CurveConstraint.hxx>
7fd59977 32#include <Precision.hxx>
7fd59977 33#include <ProjLib_ProjectedCurve.hxx>
42cf5bc1 34#include <ProjLib_ProjectOnPlane.hxx>
35#include <Standard_ConstructionError.hxx>
36#include <Standard_Type.hxx>
37
92efcf78 38IMPLEMENT_STANDARD_RTTIEXT(BRepFill_CurveConstraint,GeomPlate_CurveConstraint)
39
7fd59977 40//---------------------------------------------------------
41// Constructeurs avec courbe sur surface
42//---------------------------------------------------------
43BRepFill_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;
61myConstG0=Standard_True;
62myConstG1=Standard_True;
63myConstG2=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//---------------------------------------------------------
83BRepFill_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