0024023: Revamp the OCCT Handle -- automatic
[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
26 class Prs3d_WFShape : Prs3d_Root
27 {
28
29 public:
30
31   DEFINE_STANDARD_ALLOC
32
33 public:
34
35   class Face
36   {
37   public:
38     virtual void Add (const Handle(Prs3d_Presentation)&   thePrs,
39                       const Handle(BRepAdaptor_HSurface)& theFace,
40                       const Standard_Boolean              theToDrawUIso,
41                       const Standard_Boolean              theToDrawVIso,
42                       const Quantity_Length               theDeflection,
43                       const Standard_Integer              theNBUiso,
44                       const Standard_Integer              theNBViso,
45                       const Handle(Prs3d_Drawer)&         theDrawer,
46                       Prs3d_NListOfSequenceOfPnt&         theCurves) const = 0;
47
48     virtual Standard_Boolean Match (const Quantity_Length               theX,
49                                     const Quantity_Length               theY,
50                                     const Quantity_Length               theZ,
51                                     const Quantity_Length               theDistance,
52                                     const Handle(BRepAdaptor_HSurface)& theFace,
53                                     const Handle(Prs3d_Drawer)&         theDrawer) const = 0;
54   };
55
56   class Curve
57   {
58   public:
59     virtual void Add (const Handle(Prs3d_Presentation)& thePrs,
60                       Adaptor3d_Curve&                  theCurve,
61                       const Quantity_Length             theDeflection,
62                       const Handle(Prs3d_Drawer)&       theDrawer,
63                       TColgp_SequenceOfPnt&             thePoints,
64                       const Standard_Boolean            theToDrawCurve) const = 0;
65
66     virtual Standard_Boolean Match (const Quantity_Length       theX,
67                                     const Quantity_Length       theY,
68                                     const Quantity_Length       theZ,
69                                     const Quantity_Length       theDistance,
70                                     const Adaptor3d_Curve&      theCurve,
71                                     const Handle(Prs3d_Drawer)& theDrawer) const = 0;
72   };
73
74   inline Prs3d_WFShape (const Face&  theFace,
75                         const Curve& theCurve)
76   : myFaceAlgo (theFace),
77     myCurveAlgo (theCurve) {}
78
79 public:
80
81   //! Add shape to presentation
82   Standard_EXPORT void Add (const Handle (Prs3d_Presentation)& thePresentation,
83                             const TopoDS_Shape&                theShape,
84                             const Handle (Prs3d_Drawer)&       theDrawer);
85
86   Standard_EXPORT Handle(TopTools_HSequenceOfShape) PickCurve
87       (const Quantity_Length        theX,
88        const Quantity_Length        theY,
89        const Quantity_Length        theZ,
90        const Quantity_Length        theDistance,
91        const TopoDS_Shape&          theShape,
92        const Handle (Prs3d_Drawer)& theDrawer);
93
94   Standard_EXPORT Handle(TopTools_HSequenceOfShape) PickPatch
95       (const Quantity_Length       theX,
96        const Quantity_Length       theY,
97        const Quantity_Length       theZ,
98        const Quantity_Length       theDistance,
99        const TopoDS_Shape&         theShape,
100        const Handle(Prs3d_Drawer)& theDrawer);
101
102 private:
103
104   static Standard_Boolean AddPolygon (const TopoDS_Edge&    theEdge,
105                                       TColgp_SequenceOfPnt& thePoints);
106
107 private:
108
109   const Face&  myFaceAlgo;
110   const Curve& myCurveAlgo;
111
112 private:
113
114   Prs3d_WFShape            (const Prs3d_WFShape& );
115   Prs3d_WFShape& operator= (const Prs3d_WFShape& );
116
117 };
118
119 #endif // _Prs3d_WFShape_H__