42cf5bc1 |
1 | // Created on: 1994-04-01 |
2 | // Created by: Modelistation |
3 | // Copyright (c) 1994-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _BRepTopAdaptor_TopolTool_HeaderFile |
18 | #define _BRepTopAdaptor_TopolTool_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <TopExp_Explorer.hxx> |
24 | #include <TopoDS_Face.hxx> |
25 | #include <Standard_Address.hxx> |
26 | #include <TColStd_ListOfTransient.hxx> |
27 | #include <TColStd_ListIteratorOfListOfTransient.hxx> |
28 | #include <Standard_Real.hxx> |
29 | #include <Adaptor3d_TopolTool.hxx> |
30 | #include <Standard_Boolean.hxx> |
31 | #include <TopAbs_State.hxx> |
32 | #include <TopAbs_Orientation.hxx> |
33 | #include <Standard_Integer.hxx> |
34 | class BRepAdaptor_HCurve2d; |
35 | class Standard_DomainError; |
36 | class Adaptor3d_HSurface; |
37 | class Adaptor2d_HCurve2d; |
38 | class Adaptor3d_HVertex; |
39 | class gp_Pnt2d; |
40 | class gp_Pnt; |
41 | |
42 | |
43 | class BRepTopAdaptor_TopolTool; |
44 | DEFINE_STANDARD_HANDLE(BRepTopAdaptor_TopolTool, Adaptor3d_TopolTool) |
45 | |
46 | |
47 | class BRepTopAdaptor_TopolTool : public Adaptor3d_TopolTool |
48 | { |
49 | |
50 | public: |
51 | |
52 | |
53 | Standard_EXPORT BRepTopAdaptor_TopolTool(); |
54 | |
55 | Standard_EXPORT BRepTopAdaptor_TopolTool(const Handle(Adaptor3d_HSurface)& Surface); |
56 | |
57 | Standard_EXPORT virtual void Initialize() Standard_OVERRIDE; |
58 | |
59 | Standard_EXPORT virtual void Initialize (const Handle(Adaptor3d_HSurface)& S) Standard_OVERRIDE; |
60 | |
61 | Standard_EXPORT virtual void Initialize (const Handle(Adaptor2d_HCurve2d)& Curve) Standard_OVERRIDE; |
62 | |
63 | Standard_EXPORT virtual void Init() Standard_OVERRIDE; |
64 | |
65 | Standard_EXPORT virtual Standard_Boolean More() Standard_OVERRIDE; |
66 | |
67 | Standard_EXPORT virtual Handle(Adaptor2d_HCurve2d) Value() Standard_OVERRIDE; |
68 | |
69 | Standard_EXPORT virtual void Next() Standard_OVERRIDE; |
70 | |
71 | Standard_EXPORT virtual Standard_Address Edge() const Standard_OVERRIDE; |
72 | |
73 | Standard_EXPORT virtual void InitVertexIterator() Standard_OVERRIDE; |
74 | |
75 | Standard_EXPORT virtual Standard_Boolean MoreVertex() Standard_OVERRIDE; |
76 | |
77 | Standard_EXPORT virtual Handle(Adaptor3d_HVertex) Vertex() Standard_OVERRIDE; |
78 | |
79 | Standard_EXPORT virtual void NextVertex() Standard_OVERRIDE; |
80 | |
81 | Standard_EXPORT virtual TopAbs_State Classify (const gp_Pnt2d& P2d, const Standard_Real Tol, const Standard_Boolean RecadreOnPeriodic = Standard_True) Standard_OVERRIDE; |
82 | |
83 | //! see the code for specifications) |
84 | Standard_EXPORT virtual Standard_Boolean IsThePointOn (const gp_Pnt2d& P2d, const Standard_Real Tol, const Standard_Boolean RecadreOnPeriodic = Standard_True) Standard_OVERRIDE; |
85 | |
86 | //! If the function returns the orientation of the arc. |
87 | //! If the orientation is FORWARD or REVERSED, the arc is |
88 | //! a "real" limit of the surface. |
89 | //! If the orientation is INTERNAL or EXTERNAL, the arc is |
90 | //! considered as an arc on the surface. |
91 | Standard_EXPORT virtual TopAbs_Orientation Orientation (const Handle(Adaptor2d_HCurve2d)& C) Standard_OVERRIDE; |
92 | |
93 | //! If the function returns the orientation of the arc. |
94 | //! If the orientation is FORWARD or REVERSED, the arc is |
95 | //! a "real" limit of the surface. |
96 | //! If the orientation is INTERNAL or EXTERNAL, the arc is |
97 | //! considered as an arc on the surface. |
98 | Standard_EXPORT virtual TopAbs_Orientation Orientation (const Handle(Adaptor3d_HVertex)& C) Standard_OVERRIDE; |
99 | |
100 | Standard_EXPORT void Destroy(); |
101 | ~BRepTopAdaptor_TopolTool() |
102 | { |
103 | Destroy(); |
104 | } |
105 | |
106 | //! answers if arcs and vertices may have 3d representations, |
107 | //! so that we could use Tol3d and Pnt methods. |
108 | Standard_EXPORT virtual Standard_Boolean Has3d() const Standard_OVERRIDE; |
109 | |
110 | //! returns 3d tolerance of the arc C |
111 | Standard_EXPORT virtual Standard_Real Tol3d (const Handle(Adaptor2d_HCurve2d)& C) const Standard_OVERRIDE; |
112 | |
113 | //! returns 3d tolerance of the vertex V |
114 | Standard_EXPORT virtual Standard_Real Tol3d (const Handle(Adaptor3d_HVertex)& V) const Standard_OVERRIDE; |
115 | |
116 | //! returns 3d point of the vertex V |
117 | Standard_EXPORT virtual gp_Pnt Pnt (const Handle(Adaptor3d_HVertex)& V) const Standard_OVERRIDE; |
118 | |
119 | Standard_EXPORT virtual void ComputeSamplePoints() Standard_OVERRIDE; |
120 | |
121 | //! compute the sample-points for the intersections algorithms |
122 | Standard_EXPORT virtual Standard_Integer NbSamplesU() Standard_OVERRIDE; |
123 | |
124 | //! compute the sample-points for the intersections algorithms |
125 | Standard_EXPORT virtual Standard_Integer NbSamplesV() Standard_OVERRIDE; |
126 | |
127 | //! compute the sample-points for the intersections algorithms |
128 | Standard_EXPORT virtual Standard_Integer NbSamples() Standard_OVERRIDE; |
129 | |
130 | Standard_EXPORT virtual void SamplePoint (const Standard_Integer Index, gp_Pnt2d& P2d, gp_Pnt& P3d) Standard_OVERRIDE; |
131 | |
132 | Standard_EXPORT virtual Standard_Boolean DomainIsInfinite() Standard_OVERRIDE; |
133 | |
134 | |
135 | |
136 | DEFINE_STANDARD_RTTI(BRepTopAdaptor_TopolTool,Adaptor3d_TopolTool) |
137 | |
138 | protected: |
139 | |
140 | |
141 | |
142 | |
143 | private: |
144 | |
145 | |
146 | TopExp_Explorer myVIterator; |
147 | TopoDS_Face myFace; |
148 | Standard_Address myFClass2d; |
149 | Handle(BRepAdaptor_HCurve2d) myCurve; |
150 | TColStd_ListOfTransient myCurves; |
151 | TColStd_ListIteratorOfListOfTransient myCIterator; |
152 | Standard_Real myU0; |
153 | Standard_Real myV0; |
154 | Standard_Real myDU; |
155 | Standard_Real myDV; |
156 | |
157 | |
158 | }; |
159 | |
160 | |
161 | |
162 | |
163 | |
164 | |
165 | |
166 | #endif // _BRepTopAdaptor_TopolTool_HeaderFile |