5b36d0f875d9e5724b5245ac2dbded862d730707
[occt.git] / src / StdPrs / StdPrs_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 _StdPrs_WFShape_H__
15 #define _StdPrs_WFShape_H__
16
17 #include <Prs3d_Root.hxx>
18 #include <Prs3d_Presentation.hxx>
19 #include <Prs3d_Drawer.hxx>
20 #include <TopTools_HSequenceOfShape.hxx>
21 #include <Quantity_Length.hxx>
22 #include <Prs3d_WFShape.hxx>
23 #include <StdPrs_WFRestrictedFace.hxx>
24 #include <StdPrs_Curve.hxx>
25 #include <StdPrs_Vertex.hxx>
26
27 class StdPrs_WFShape : public Prs3d_Root
28 {
29
30 public:
31
32   //! Add shape to presentation
33   static inline void Add (const Handle (Prs3d_Presentation)& thePrs,
34                           const TopoDS_Shape&                theShape,
35                           const Handle (Prs3d_Drawer)&       theDrawer)
36   {
37     Face  aFaceAlgo;
38     Curve aCurveAlgo;
39     Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
40     anAlgo.Add (thePrs, theShape, theDrawer);
41   }
42
43   static inline Handle(TopTools_HSequenceOfShape) PickCurve
44       (const Quantity_Length        theX,
45        const Quantity_Length        theY,
46        const Quantity_Length        theZ,
47        const Quantity_Length        theDistance,
48        const TopoDS_Shape&          theShape,
49        const Handle (Prs3d_Drawer)& theDrawer)
50   {
51     Face  aFaceAlgo;
52     Curve aCurveAlgo;
53     Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
54     return anAlgo.PickCurve (theX, theY, theZ, theDistance, theShape, theDrawer);
55   }
56
57   static inline Handle(TopTools_HSequenceOfShape) PickPatch
58       (const Quantity_Length       theX,
59        const Quantity_Length       theY,
60        const Quantity_Length       theZ,
61        const Quantity_Length       theDistance,
62        const TopoDS_Shape&         theShape,
63        const Handle(Prs3d_Drawer)& theDrawer)
64   {
65     Face  aFaceAlgo;
66     Curve aCurveAlgo;
67     Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
68     return anAlgo.PickPatch (theX, theY, theZ, theDistance, theShape, theDrawer);
69   }
70
71 private:
72
73   class Face : public Prs3d_WFShape::Face
74   {
75   public:
76     virtual void Add (const Handle(Prs3d_Presentation)&   thePrs,
77                       const Handle(BRepAdaptor_HSurface)& theFace,
78                       const Standard_Boolean              theToDrawUIso,
79                       const Standard_Boolean              theToDrawVIso,
80                       const Quantity_Length               theDeflection,
81                       const Standard_Integer              theNBUiso,
82                       const Standard_Integer              theNBViso,
83                       const Handle(Prs3d_Drawer)&         theDrawer,
84                       Prs3d_NListOfSequenceOfPnt&         theCurves) const
85     {
86       StdPrs_WFRestrictedFace::Add (thePrs, theFace, theToDrawUIso, theToDrawVIso, theDeflection,
87                                     theNBUiso, theNBViso, theDrawer, theCurves);
88     }
89
90     virtual Standard_Boolean Match (const Quantity_Length               theX,
91                                     const Quantity_Length               theY,
92                                     const Quantity_Length               theZ,
93                                     const Quantity_Length               theDistance,
94                                     const Handle(BRepAdaptor_HSurface)& theFace,
95                                     const Handle(Prs3d_Drawer)&         theDrawer) const
96     {
97       return StdPrs_WFRestrictedFace::Match (theX, theY, theZ, theDistance, theFace, theDrawer);
98     }
99   };
100
101   class Curve : public Prs3d_WFShape::Curve
102   {
103   public:
104     virtual void Add (const Handle(Prs3d_Presentation)& thePrs,
105                       Adaptor3d_Curve&                  theCurve,
106                       const Quantity_Length             theDeflection,
107                       const Handle(Prs3d_Drawer)&       theDrawer,
108                       TColgp_SequenceOfPnt&             thePoints,
109                       const Standard_Boolean            theToDrawCurve) const
110     {
111       StdPrs_Curve::Add (thePrs, theCurve, theDeflection, theDrawer, thePoints, theToDrawCurve);
112     }
113
114     virtual Standard_Boolean Match (const Quantity_Length       theX,
115                                     const Quantity_Length       theY,
116                                     const Quantity_Length       theZ,
117                                     const Quantity_Length       theDistance,
118                                     const Adaptor3d_Curve&      theCurve,
119                                     const Handle(Prs3d_Drawer)& theDrawer) const
120     {
121       return StdPrs_Curve::Match (theX, theY, theZ, theDistance, theCurve, theDrawer);
122     }
123   };
124
125 };
126
127 #endif // _StdPrs_WFShape_H__