ceb418e1 |
1 | // Created on: 2014-08-13 |
2 | // Created by: Oleg AGASHIN |
3 | // Copyright (c) 2011-2014 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
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. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _BRepMesh_EdgeTessellator_HeaderFile |
17 | #define _BRepMesh_EdgeTessellator_HeaderFile |
18 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_DefineAlloc.hxx> |
848fa7e3 |
21 | #include <BRepMesh.hxx> |
ceb418e1 |
22 | #include <BRepMesh_IEdgeTool.hxx> |
23 | #include <BRepMesh_GeomTool.hxx> |
24 | #include <BRepMesh_FaceAttribute.hxx> |
ceb418e1 |
25 | #include <BRepAdaptor_Curve.hxx> |
b7c077b9 |
26 | #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx> |
ceb418e1 |
27 | |
28 | class Geom_Surface; |
29 | class Geom2d_Curve; |
30 | class TopoDS_Edge; |
31 | class BRepAdaptor_HSurface; |
ceb418e1 |
32 | |
33 | //! Auxiliary class implements functionality producing tessellated |
34 | //! representation of an edge based on edge geometry. |
35 | class BRepMesh_EdgeTessellator : public BRepMesh_IEdgeTool |
36 | { |
37 | public: |
38 | |
39 | //! Constructor. |
40 | //! Automatically performs tessellation of the edge according to the |
41 | //! given parameters. |
42 | BRepMesh_EdgeTessellator( |
43 | const TopoDS_Edge& theEdge, |
44 | const Handle(BRepMesh_FaceAttribute)& theFaceAttribute, |
45 | const TopTools_IndexedDataMapOfShapeListOfShape& theMapOfSharedFaces, |
46 | const Standard_Real theLinDeflection, |
74da0216 |
47 | const Standard_Real theAngDeflection, |
48 | const Standard_Real theMinSize); |
ceb418e1 |
49 | |
50 | //! Returns number of dicretization points. |
79104795 |
51 | virtual Standard_Integer NbPoints() const Standard_OVERRIDE |
ceb418e1 |
52 | { |
53 | return myTool->NbPoints(); |
54 | } |
55 | |
56 | //! Returns parameters of solution with the given index. |
57 | //! @param theIndex index of tessellation point. |
58 | //! @param theParameter parameters on PCurve corresponded to the solution. |
59 | //! @param thePoint tessellation point. |
60 | //! @param theUV coordinates of tessellation point in parametric space of face. |
61 | virtual void Value(const Standard_Integer theIndex, |
62 | Standard_Real& theParameter, |
63 | gp_Pnt& thePoint, |
79104795 |
64 | gp_Pnt2d& theUV) Standard_OVERRIDE; |
ceb418e1 |
65 | |
ec357c5c |
66 | DEFINE_STANDARD_RTTI(BRepMesh_EdgeTessellator, BRepMesh_IEdgeTool) |
ceb418e1 |
67 | |
68 | private: |
69 | |
70 | //! |
71 | void splitSegment(const Handle(Geom_Surface)& theSurf, |
72 | const Handle(Geom2d_Curve)& theCurve2d, |
73 | const Standard_Real theFirst, |
74 | const Standard_Real theLast, |
75 | const Standard_Integer theNbIter); |
76 | |
77 | private: |
848fa7e3 |
78 | NCollection_Handle<BRepMesh_GeomTool> myTool; |
79 | Handle(BRepAdaptor_HSurface) mySurface; |
80 | BRepAdaptor_Curve myCOnS; |
81 | Standard_Real mySquareEdgeDef; |
74da0216 |
82 | Standard_Real mySquareMinSize; |
ceb418e1 |
83 | }; |
84 | |
85 | DEFINE_STANDARD_HANDLE(BRepMesh_EdgeTessellator, BRepMesh_IEdgeTool) |
86 | |
87 | #endif |