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;
33 //! Auxiliary class implements functionality retrieving tessellated
34 //! representation of an edge stored in polygon.
35 class BRepMesh_EdgeTessellationExtractor : public BRepMesh_IEdgeTool
40 //! Initializes extractor.
41 BRepMesh_EdgeTessellationExtractor(
42 const TopoDS_Edge& theEdge,
43 const Handle(Geom2d_Curve)& thePCurve,
44 const TopoDS_Face& theFace,
45 const Handle(Poly_Triangulation)& theTriangulation,
46 const Handle(Poly_PolygonOnTriangulation)& thePolygon,
47 const TopLoc_Location& theLocation);
49 //! Returns number of dicretization points.
50 virtual Standard_Integer NbPoints() const Standard_OVERRIDE
52 return myIndices.Length();
55 //! Returns parameters of solution with the given index.
56 //! @param theIndex index of tessellation point.
57 //! @param theParameter parameters on PCurve corresponded to the solution.
58 //! @param thePoint tessellation point.
59 //! @param theUV coordinates of tessellation point in parametric space of face.
60 virtual void Value(const Standard_Integer theIndex,
61 Standard_Real& theParameter,
63 gp_Pnt2d& theUV) Standard_OVERRIDE;
65 DEFINE_STANDARD_RTTI(BRepMesh_EdgeTessellationExtractor, BRepMesh_IEdgeTool)
69 //! Assignment operator.
70 void operator =(const BRepMesh_EdgeTessellationExtractor& /*theOther*/)
76 BRepMesh_EdgeParameterProvider myProvider;
77 const Handle(Geom2d_Curve)& myPCurve;
78 const TColgp_Array1OfPnt& myNodes;
79 const TColStd_Array1OfInteger& myIndices;
80 const TopLoc_Location myLoc;
83 DEFINE_STANDARD_HANDLE(BRepMesh_EdgeTessellationExtractor, BRepMesh_IEdgeTool)