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 #ifndef _BRepMesh_EdgeTessellationExtractor_HeaderFile
17 #define _BRepMesh_EdgeTessellationExtractor_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <BRepMesh_IEdgeTool.hxx>
22 #include <BRepMesh_EdgeParameterProvider.hxx>
23 #include <TopLoc_Location.hxx>
24 #include <TColgp_Array1OfPnt.hxx>
25 #include <TColStd_Array1OfInteger.hxx>
27 class Poly_Triangulation;
28 class Poly_PolygonOnTriangulation;
32 //! Auxiliary class implements functionality retrieving tessellated
33 //! representation of an edge stored in polygon.
34 class BRepMesh_EdgeTessellationExtractor : public BRepMesh_IEdgeTool
39 //! Initializes extractor.
40 BRepMesh_EdgeTessellationExtractor(
41 const TopoDS_Edge& theEdge,
42 const Handle(Geom2d_Curve)& thePCurve,
43 const TopoDS_Face& theFace,
44 const Handle(Poly_Triangulation)& theTriangulation,
45 const Handle(Poly_PolygonOnTriangulation)& thePolygon,
46 const TopLoc_Location& theLocation);
48 //! Returns number of dicretization points.
49 virtual Standard_Integer NbPoints() const
51 return myIndices.Length();
54 //! Returns parameters of solution with the given index.
55 //! @param theIndex index of tessellation point.
56 //! @param theParameter parameters on PCurve corresponded to the solution.
57 //! @param thePoint tessellation point.
58 //! @param theUV coordinates of tessellation point in parametric space of face.
59 virtual void Value(const Standard_Integer theIndex,
60 Standard_Real& theParameter,
64 DEFINE_STANDARD_RTTI(BRepMesh_EdgeTessellationExtractor, BRepMesh_IEdgeTool)
68 //! Assignment operator.
69 void operator =(const BRepMesh_EdgeTessellationExtractor& /*theOther*/)
75 BRepMesh_EdgeParameterProvider myProvider;
76 const Handle(Geom2d_Curve)& myPCurve;
77 const TColgp_Array1OfPnt& myNodes;
78 const TColStd_Array1OfInteger& myIndices;
79 const TopLoc_Location myLoc;
82 DEFINE_STANDARD_HANDLE(BRepMesh_EdgeTessellationExtractor, BRepMesh_IEdgeTool)