d7223c76 |
1 | // Copyright (c) 2013 OPEN CASCADE SAS |
2 | // |
3 | // The content of this file is subject to the Open CASCADE Technology Public |
4 | // License Version 6.5 (the "License"). You may not use the content of this file |
5 | // except in compliance with the License. Please obtain a copy of the License |
6 | // at http://www.opencascade.org and read it completely before using this file. |
7 | // |
8 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
9 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
10 | // |
11 | // The Original Code and all software distributed under the License is |
12 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
13 | // Initial Developer hereby disclaims all such warranties, including without |
14 | // limitation, any warranties of merchantability, fitness for a particular |
15 | // purpose or non-infringement. Please see the License for the specific terms |
16 | // and conditions governing the rights and limitations under the License. |
17 | |
18 | #ifndef _Prs3d_WFShape_H__ |
19 | #define _Prs3d_WFShape_H__ |
20 | |
d7223c76 |
21 | #include <Prs3d_Root.hxx> |
d7223c76 |
22 | #include <Prs3d_NListOfSequenceOfPnt.hxx> |
d7223c76 |
23 | #include <TopTools_HSequenceOfShape.hxx> |
c151c0f1 |
24 | #include <Quantity_Length.hxx> |
25 | |
26 | class Adaptor3d_Curve; |
27 | class TopoDS_Edge; |
28 | class TopoDS_Shape; |
29 | class TColgp_SequenceOfPnt; |
30 | class Handle(BRepAdaptor_HSurface); |
31 | class Handle(Prs3d_Drawer); |
d7223c76 |
32 | |
d7223c76 |
33 | class Prs3d_WFShape : Prs3d_Root |
34 | { |
c151c0f1 |
35 | |
d7223c76 |
36 | public: |
37 | |
38 | DEFINE_STANDARD_ALLOC |
39 | |
d7223c76 |
40 | public: |
41 | |
c151c0f1 |
42 | class Face |
d7223c76 |
43 | { |
c151c0f1 |
44 | public: |
45 | virtual void Add (const Handle(Prs3d_Presentation)& thePrs, |
46 | const Handle(BRepAdaptor_HSurface)& theFace, |
47 | const Standard_Boolean theToDrawUIso, |
48 | const Standard_Boolean theToDrawVIso, |
49 | const Quantity_Length theDeflection, |
50 | const Standard_Integer theNBUiso, |
51 | const Standard_Integer theNBViso, |
52 | const Handle(Prs3d_Drawer)& theDrawer, |
53 | Prs3d_NListOfSequenceOfPnt& theCurves) const = 0; |
54 | |
55 | virtual Standard_Boolean Match (const Quantity_Length theX, |
56 | const Quantity_Length theY, |
57 | const Quantity_Length theZ, |
58 | const Quantity_Length theDistance, |
59 | const Handle(BRepAdaptor_HSurface)& theFace, |
60 | const Handle(Prs3d_Drawer)& theDrawer) const = 0; |
61 | }; |
62 | |
63 | class Curve |
d7223c76 |
64 | { |
c151c0f1 |
65 | public: |
66 | virtual void Add (const Handle(Prs3d_Presentation)& thePrs, |
67 | Adaptor3d_Curve& theCurve, |
68 | const Quantity_Length theDeflection, |
69 | const Handle(Prs3d_Drawer)& theDrawer, |
70 | TColgp_SequenceOfPnt& thePoints, |
71 | const Standard_Boolean theToDrawCurve) const = 0; |
72 | |
73 | virtual Standard_Boolean Match (const Quantity_Length theX, |
74 | const Quantity_Length theY, |
75 | const Quantity_Length theZ, |
76 | const Quantity_Length theDistance, |
77 | const Adaptor3d_Curve& theCurve, |
78 | const Handle(Prs3d_Drawer)& theDrawer) const = 0; |
79 | }; |
80 | |
81 | inline Prs3d_WFShape (const Face& theFace, |
82 | const Curve& theCurve) |
83 | : myFaceAlgo (theFace), |
84 | myCurveAlgo (theCurve) {} |
d7223c76 |
85 | |
c151c0f1 |
86 | public: |
d7223c76 |
87 | |
c151c0f1 |
88 | //! Add shape to presentation |
89 | Standard_EXPORT void Add (const Handle (Prs3d_Presentation)& thePresentation, |
90 | const TopoDS_Shape& theShape, |
91 | const Handle (Prs3d_Drawer)& theDrawer); |
d7223c76 |
92 | |
c151c0f1 |
93 | Standard_EXPORT Handle(TopTools_HSequenceOfShape) PickCurve |
d7223c76 |
94 | (const Quantity_Length theX, |
95 | const Quantity_Length theY, |
96 | const Quantity_Length theZ, |
97 | const Quantity_Length theDistance, |
98 | const TopoDS_Shape& theShape, |
c151c0f1 |
99 | const Handle (Prs3d_Drawer)& theDrawer); |
d7223c76 |
100 | |
c151c0f1 |
101 | Standard_EXPORT Handle(TopTools_HSequenceOfShape) PickPatch |
d7223c76 |
102 | (const Quantity_Length theX, |
103 | const Quantity_Length theY, |
104 | const Quantity_Length theZ, |
105 | const Quantity_Length theDistance, |
106 | const TopoDS_Shape& theShape, |
c151c0f1 |
107 | const Handle(Prs3d_Drawer)& theDrawer); |
d7223c76 |
108 | |
c151c0f1 |
109 | private: |
d7223c76 |
110 | |
c151c0f1 |
111 | static Standard_Boolean AddPolygon (const TopoDS_Edge& theEdge, |
112 | const Standard_Real theDeflection, |
113 | TColgp_SequenceOfPnt& thePoints); |
d7223c76 |
114 | |
c151c0f1 |
115 | private: |
116 | |
117 | const Face& myFaceAlgo; |
118 | const Curve& myCurveAlgo; |
119 | |
120 | private: |
d7223c76 |
121 | |
c151c0f1 |
122 | Prs3d_WFShape (const Prs3d_WFShape& ); |
123 | Prs3d_WFShape& operator= (const Prs3d_WFShape& ); |
d7223c76 |
124 | |
125 | }; |
126 | |
c151c0f1 |
127 | #endif // _Prs3d_WFShape_H__ |