845e81a64249efa380f1d4da5825075ec575d031
[occt.git] / src / Prs3d / Prs3d_WFShape.hxx
1 // Copyright (c) 2013-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _Prs3d_WFShape_H__
15 #define _Prs3d_WFShape_H__
16
17 #include <Prs3d_Root.hxx>
18 #include <Prs3d_NListOfSequenceOfPnt.hxx>
19 #include <TopTools_HSequenceOfShape.hxx>
20 #include <Quantity_Length.hxx>
21
22 class Adaptor3d_Curve;
23 class TopoDS_Edge;
24 class TopoDS_Shape;
25 class TColgp_SequenceOfPnt;
26 class Handle(BRepAdaptor_HSurface);
27 class Handle(Prs3d_Drawer);
28
29 class Prs3d_WFShape : Prs3d_Root
30 {
31
32 public:
33
34   DEFINE_STANDARD_ALLOC
35
36 public:
37
38   class Face
39   {
40   public:
41     virtual void Add (const Handle(Prs3d_Presentation)&   thePrs,
42                       const Handle(BRepAdaptor_HSurface)& theFace,
43                       const Standard_Boolean              theToDrawUIso,
44                       const Standard_Boolean              theToDrawVIso,
45                       const Quantity_Length               theDeflection,
46                       const Standard_Integer              theNBUiso,
47                       const Standard_Integer              theNBViso,
48                       const Handle(Prs3d_Drawer)&         theDrawer,
49                       Prs3d_NListOfSequenceOfPnt&         theCurves) const = 0;
50
51     virtual Standard_Boolean Match (const Quantity_Length               theX,
52                                     const Quantity_Length               theY,
53                                     const Quantity_Length               theZ,
54                                     const Quantity_Length               theDistance,
55                                     const Handle(BRepAdaptor_HSurface)& theFace,
56                                     const Handle(Prs3d_Drawer)&         theDrawer) const = 0;
57   };
58
59   class Curve
60   {
61   public:
62     virtual void Add (const Handle(Prs3d_Presentation)& thePrs,
63                       Adaptor3d_Curve&                  theCurve,
64                       const Quantity_Length             theDeflection,
65                       const Handle(Prs3d_Drawer)&       theDrawer,
66                       TColgp_SequenceOfPnt&             thePoints,
67                       const Standard_Boolean            theToDrawCurve) const = 0;
68
69     virtual Standard_Boolean Match (const Quantity_Length       theX,
70                                     const Quantity_Length       theY,
71                                     const Quantity_Length       theZ,
72                                     const Quantity_Length       theDistance,
73                                     const Adaptor3d_Curve&      theCurve,
74                                     const Handle(Prs3d_Drawer)& theDrawer) const = 0;
75   };
76
77   inline Prs3d_WFShape (const Face&  theFace,
78                         const Curve& theCurve)
79   : myFaceAlgo (theFace),
80     myCurveAlgo (theCurve) {}
81
82 public:
83
84   //! Add shape to presentation
85   Standard_EXPORT void Add (const Handle (Prs3d_Presentation)& thePresentation,
86                             const TopoDS_Shape&                theShape,
87                             const Handle (Prs3d_Drawer)&       theDrawer);
88
89   Standard_EXPORT Handle(TopTools_HSequenceOfShape) PickCurve
90       (const Quantity_Length        theX,
91        const Quantity_Length        theY,
92        const Quantity_Length        theZ,
93        const Quantity_Length        theDistance,
94        const TopoDS_Shape&          theShape,
95        const Handle (Prs3d_Drawer)& theDrawer);
96
97   Standard_EXPORT Handle(TopTools_HSequenceOfShape) PickPatch
98       (const Quantity_Length       theX,
99        const Quantity_Length       theY,
100        const Quantity_Length       theZ,
101        const Quantity_Length       theDistance,
102        const TopoDS_Shape&         theShape,
103        const Handle(Prs3d_Drawer)& theDrawer);
104
105 private:
106
107   static Standard_Boolean AddPolygon (const TopoDS_Edge&    theEdge,
108                                       const Standard_Real   theDeflection,
109                                       TColgp_SequenceOfPnt& thePoints);
110
111 private:
112
113   const Face&  myFaceAlgo;
114   const Curve& myCurveAlgo;
115
116 private:
117
118   Prs3d_WFShape            (const Prs3d_WFShape& );
119   Prs3d_WFShape& operator= (const Prs3d_WFShape& );
120
121 };
122
123 #endif // _Prs3d_WFShape_H__