0024120: Move out StdPrs_WFShape implementation to StdPrs_WFShape.cxx
[occt.git] / src / Prs3d / Prs3d_WFShape.hxx
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
21 #include <Prs3d_Root.hxx>
22 #include <Prs3d_NListOfSequenceOfPnt.hxx>
23 #include <TopTools_HSequenceOfShape.hxx>
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);
32
33 class Prs3d_WFShape : Prs3d_Root
34 {
35
36 public:
37
38   DEFINE_STANDARD_ALLOC
39
40 public:
41
42   class Face
43   {
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
64   {
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) {}
85
86 public:
87
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);
92
93   Standard_EXPORT Handle(TopTools_HSequenceOfShape) PickCurve
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,
99        const Handle (Prs3d_Drawer)& theDrawer);
100
101   Standard_EXPORT Handle(TopTools_HSequenceOfShape) PickPatch
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,
107        const Handle(Prs3d_Drawer)& theDrawer);
108
109 private:
110
111   static Standard_Boolean AddPolygon (const TopoDS_Edge&    theEdge,
112                                       const Standard_Real   theDeflection,
113                                       TColgp_SequenceOfPnt& thePoints);
114
115 private:
116
117   const Face&  myFaceAlgo;
118   const Curve& myCurveAlgo;
119
120 private:
121
122   Prs3d_WFShape            (const Prs3d_WFShape& );
123   Prs3d_WFShape& operator= (const Prs3d_WFShape& );
124
125 };
126
127 #endif // _Prs3d_WFShape_H__