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_EdgeTessellator_HeaderFile
17 #define _BRepMesh_EdgeTessellator_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <BRepMesh_Collections.hxx>
22 #include <BRepMesh_IEdgeTool.hxx>
23 #include <BRepMesh_GeomTool.hxx>
24 #include <BRepMesh_FaceAttribute.hxx>
25 #include <Handle_Geom_Surface.hxx>
26 #include <Handle_Geom2d_Curve.hxx>
27 #include <Handle_BRepAdaptor_HSurface.hxx>
28 #include <BRepAdaptor_Curve.hxx>
33 class BRepAdaptor_HSurface;
34 class TopTools_IndexedDataMapOfShapeListOfShape;
36 //! Auxiliary class implements functionality producing tessellated
37 //! representation of an edge based on edge geometry.
38 class BRepMesh_EdgeTessellator : public BRepMesh_IEdgeTool
43 //! Automatically performs tessellation of the edge according to the
45 BRepMesh_EdgeTessellator(
46 const TopoDS_Edge& theEdge,
47 const Handle(BRepMesh_FaceAttribute)& theFaceAttribute,
48 const TopTools_IndexedDataMapOfShapeListOfShape& theMapOfSharedFaces,
49 const Standard_Real theLinDeflection,
50 const Standard_Real theAngDeflection);
52 //! Returns number of dicretization points.
53 virtual Standard_Integer NbPoints() const
55 return myTool->NbPoints();
58 //! Returns parameters of solution with the given index.
59 //! @param theIndex index of tessellation point.
60 //! @param theParameter parameters on PCurve corresponded to the solution.
61 //! @param thePoint tessellation point.
62 //! @param theUV coordinates of tessellation point in parametric space of face.
63 virtual void Value(const Standard_Integer theIndex,
64 Standard_Real& theParameter,
68 DEFINE_STANDARD_RTTI(BRepMesh_EdgeTessellator)
73 void splitSegment(const Handle(Geom_Surface)& theSurf,
74 const Handle(Geom2d_Curve)& theCurve2d,
75 const Standard_Real theFirst,
76 const Standard_Real theLast,
77 const Standard_Integer theNbIter);
80 N_HANDLE<BRepMesh_GeomTool> myTool;
81 Handle(BRepAdaptor_HSurface) mySurface;
82 BRepAdaptor_Curve myCOnS;
83 Standard_Real mySquareEdgeDef;
86 DEFINE_STANDARD_HANDLE(BRepMesh_EdgeTessellator, BRepMesh_IEdgeTool)