1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <StdPrs_ToolRFace.hxx>
17 #include <Adaptor2d_Curve2d.hxx>
18 #include <BRep_Tool.hxx>
19 #include <BRepAdaptor_Surface.hxx>
22 //=======================================================================
23 //function : StdPrs_ToolRFace
25 //=======================================================================
26 StdPrs_ToolRFace::StdPrs_ToolRFace()
27 : myHasNullCurves (Standard_False)
31 //=======================================================================
32 //function : StdPrs_ToolRFace
34 //=======================================================================
35 StdPrs_ToolRFace::StdPrs_ToolRFace (const Handle(BRepAdaptor_Surface)& theSurface)
36 : myFace (theSurface->Face()),
37 myHasNullCurves (Standard_False)
39 myFace.Orientation(TopAbs_FORWARD);
42 //=======================================================================
45 //=======================================================================
46 const TopoDS_Edge& StdPrs_ToolRFace::Edge() const
48 return TopoDS::Edge (myExplorer.Current());
51 //=======================================================================
54 //=======================================================================
55 void StdPrs_ToolRFace::next()
57 Standard_Real aParamU1, aParamU2;
58 for (; myExplorer.More(); myExplorer.Next())
60 // skip INTERNAL and EXTERNAL edges
61 if (myExplorer.Current().Orientation() != TopAbs_FORWARD
62 && myExplorer.Current().Orientation() != TopAbs_REVERSED)
67 if (Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface (TopoDS::Edge (myExplorer.Current()), myFace, aParamU1, aParamU2))
69 myCurve.Load (aCurve, aParamU1, aParamU2);
74 myHasNullCurves = Standard_True;