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