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> |
25 | #include <Handle_Geom_Surface.hxx> |
26 | #include <Handle_Geom2d_Curve.hxx> |
27 | #include <Handle_BRepAdaptor_HSurface.hxx> |
28 | #include <BRepAdaptor_Curve.hxx> |
29 | |
30 | class Geom_Surface; |
31 | class Geom2d_Curve; |
32 | class TopoDS_Edge; |
33 | class BRepAdaptor_HSurface; |
34 | class TopTools_IndexedDataMapOfShapeListOfShape; |
35 | |
36 | //! Auxiliary class implements functionality producing tessellated |
37 | //! representation of an edge based on edge geometry. |
38 | class BRepMesh_EdgeTessellator : public BRepMesh_IEdgeTool |
39 | { |
40 | public: |
41 | |
42 | //! Constructor. |
43 | //! Automatically performs tessellation of the edge according to the |
44 | //! given parameters. |
45 | BRepMesh_EdgeTessellator( |
46 | const TopoDS_Edge& theEdge, |
47 | const Handle(BRepMesh_FaceAttribute)& theFaceAttribute, |
48 | const TopTools_IndexedDataMapOfShapeListOfShape& theMapOfSharedFaces, |
49 | const Standard_Real theLinDeflection, |
74da0216 |
50 | const Standard_Real theAngDeflection, |
51 | const Standard_Real theMinSize); |
ceb418e1 |
52 | |
53 | //! Returns number of dicretization points. |
54 | virtual Standard_Integer NbPoints() const |
55 | { |
56 | return myTool->NbPoints(); |
57 | } |
58 | |
59 | //! Returns parameters of solution with the given index. |
60 | //! @param theIndex index of tessellation point. |
61 | //! @param theParameter parameters on PCurve corresponded to the solution. |
62 | //! @param thePoint tessellation point. |
63 | //! @param theUV coordinates of tessellation point in parametric space of face. |
64 | virtual void Value(const Standard_Integer theIndex, |
65 | Standard_Real& theParameter, |
66 | gp_Pnt& thePoint, |
67 | gp_Pnt2d& theUV); |
68 | |
ec357c5c |
69 | DEFINE_STANDARD_RTTI(BRepMesh_EdgeTessellator, BRepMesh_IEdgeTool) |
ceb418e1 |
70 | |
71 | private: |
72 | |
73 | //! |
74 | void splitSegment(const Handle(Geom_Surface)& theSurf, |
75 | const Handle(Geom2d_Curve)& theCurve2d, |
76 | const Standard_Real theFirst, |
77 | const Standard_Real theLast, |
78 | const Standard_Integer theNbIter); |
79 | |
80 | private: |
848fa7e3 |
81 | NCollection_Handle<BRepMesh_GeomTool> myTool; |
82 | Handle(BRepAdaptor_HSurface) mySurface; |
83 | BRepAdaptor_Curve myCOnS; |
84 | Standard_Real mySquareEdgeDef; |
74da0216 |
85 | Standard_Real mySquareMinSize; |
ceb418e1 |
86 | }; |
87 | |
88 | DEFINE_STANDARD_HANDLE(BRepMesh_EdgeTessellator, BRepMesh_IEdgeTool) |
89 | |
90 | #endif |