1 // Created on: 1993-07-06
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and / or modify it
9 // under the terms of the GNU Lesser General Public 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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <BRep_CurveOnClosedSurface.ixx>
18 #include <Precision.hxx>
22 //=======================================================================
23 //function : BRep_CurveOnClosedSurface
25 //=======================================================================
27 BRep_CurveOnClosedSurface::BRep_CurveOnClosedSurface
28 (const Handle(Geom2d_Curve)& PC1,
29 const Handle(Geom2d_Curve)& PC2,
30 const Handle(Geom_Surface)& S,
31 const TopLoc_Location& L,
32 const GeomAbs_Shape C) :
33 BRep_CurveOnSurface(PC1,S,L),
40 //=======================================================================
41 //function : IsCurveOnClosedSurface
43 //=======================================================================
45 Standard_Boolean BRep_CurveOnClosedSurface::IsCurveOnClosedSurface()const
50 //=======================================================================
51 //function : IsRegularity
53 //=======================================================================
55 Standard_Boolean BRep_CurveOnClosedSurface::IsRegularity()const
61 //=======================================================================
62 //function : IsRegularity
64 //=======================================================================
66 Standard_Boolean BRep_CurveOnClosedSurface::IsRegularity
67 (const Handle(Geom_Surface)& S1,
68 const Handle(Geom_Surface)& S2,
69 const TopLoc_Location& L1,
70 const TopLoc_Location& L2)const
72 return ((Surface() == S1) &&
80 //=======================================================================
83 //=======================================================================
85 const Handle(Geom2d_Curve)& BRep_CurveOnClosedSurface::PCurve2()const
91 //=======================================================================
92 //function : Continuity
94 //=======================================================================
96 const GeomAbs_Shape& BRep_CurveOnClosedSurface::Continuity()const
101 //=======================================================================
102 //function : Surface2
104 //=======================================================================
106 const Handle(Geom_Surface)& BRep_CurveOnClosedSurface::Surface2()const
112 //=======================================================================
113 //function : Location2
115 //=======================================================================
117 const TopLoc_Location& BRep_CurveOnClosedSurface::Location2()const
122 //=======================================================================
125 //=======================================================================
127 void BRep_CurveOnClosedSurface::PCurve2(const Handle(Geom2d_Curve)& C)
133 //=======================================================================
134 //function : Continuity
136 //=======================================================================
138 void BRep_CurveOnClosedSurface::Continuity(const GeomAbs_Shape C)
144 //=======================================================================
147 //=======================================================================
149 Handle(BRep_CurveRepresentation) BRep_CurveOnClosedSurface::Copy() const
151 Handle(BRep_CurveOnClosedSurface) C =
152 new BRep_CurveOnClosedSurface(PCurve(),PCurve2(),
153 Surface(),Location(),myContinuity);
155 C->SetRange(First(), Last());
156 C->SetUVPoints(myUV1,myUV2);
157 C->SetUVPoints2(myUV21,myUV22);
163 //=======================================================================
166 //=======================================================================
168 void BRep_CurveOnClosedSurface::Update()
170 if (!Precision::IsNegativeInfinite(First()))
171 myPCurve2->D0(First(),myUV21);
172 if (!Precision::IsPositiveInfinite(Last()))
173 myPCurve2->D0(Last(),myUV22);
174 BRep_CurveOnSurface::Update();