1 // Created on: 2014-08-13
2 // Created by: Oleg AGASHIN
3 // Copyright (c) 2011-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <BRepMesh_EdgeTessellationExtractor.hxx>
17 #include <Geom2d_Curve.hxx>
18 #include <Poly_PolygonOnTriangulation.hxx>
19 #include <Poly_Triangulation.hxx>
20 #include <BRepMesh_ShapeTool.hxx>
23 IMPLEMENT_STANDARD_RTTIEXT(BRepMesh_EdgeTessellationExtractor,BRepMesh_IEdgeTool)
25 //=======================================================================
26 //function : Constructor
28 //=======================================================================
29 BRepMesh_EdgeTessellationExtractor::BRepMesh_EdgeTessellationExtractor(
30 const TopoDS_Edge& theEdge,
31 const Handle(Geom2d_Curve)& thePCurve,
32 const TopoDS_Face& theFace,
33 const Handle(Poly_Triangulation)& theTriangulation,
34 const Handle(Poly_PolygonOnTriangulation)& thePolygon,
35 const TopLoc_Location& theLocation)
36 : myProvider(theEdge, theFace, thePolygon->Parameters()),
38 myNodes(theTriangulation->Nodes()),
39 myIndices(thePolygon->Nodes()),
44 //=======================================================================
47 //=======================================================================
48 void BRepMesh_EdgeTessellationExtractor::Value(
49 const Standard_Integer theIndex,
50 Standard_Real& theParameter,
54 const gp_Pnt& theRefPnt = myNodes(myIndices(theIndex));
55 thePoint = BRepMesh_ShapeTool::UseLocation(theRefPnt, myLoc);
57 theParameter = myProvider.Parameter(theIndex, thePoint);
58 theUV = myPCurve->Value(theParameter);