1 // Copyright (c) 2013-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _StdPrs_WFDeflectionShape_H__
15 #define _StdPrs_WFDeflectionShape_H__
17 #include <Prs3d_Presentation.hxx>
18 #include <Prs3d_WFShape.hxx>
19 #include <Prs3d_Drawer.hxx>
20 #include <Prs3d_Root.hxx>
21 #include <StdPrs_WFDeflectionRestrictedFace.hxx>
22 #include <StdPrs_DeflectionCurve.hxx>
23 #include <StdPrs_Vertex.hxx>
24 #include <TopoDS_Shape.hxx>
25 #include <TopTools_HSequenceOfShape.hxx>
27 // Computes the wireframe presentation of surfaces
28 // by displaying planar sections.
30 class StdPrs_WFDeflectionShape : public Prs3d_Root
35 //! Add shape to presentation
36 static inline void Add (const Handle (Prs3d_Presentation)& thePrs,
37 const TopoDS_Shape& theShape,
38 const Handle (Prs3d_Drawer)& theDrawer)
42 Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
43 anAlgo.Add (thePrs, theShape, theDrawer);
46 static inline Handle(TopTools_HSequenceOfShape) PickCurve
47 (const Quantity_Length theX,
48 const Quantity_Length theY,
49 const Quantity_Length theZ,
50 const Quantity_Length theDistance,
51 const TopoDS_Shape& theShape,
52 const Handle (Prs3d_Drawer)& theDrawer)
56 Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
57 return anAlgo.PickCurve (theX, theY, theZ, theDistance, theShape, theDrawer);
60 static inline Handle(TopTools_HSequenceOfShape) PickPatch
61 (const Quantity_Length theX,
62 const Quantity_Length theY,
63 const Quantity_Length theZ,
64 const Quantity_Length theDistance,
65 const TopoDS_Shape& theShape,
66 const Handle(Prs3d_Drawer)& theDrawer)
70 Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
71 return anAlgo.PickPatch (theX, theY, theZ, theDistance, theShape, theDrawer);
76 class Face : public Prs3d_WFShape::Face
79 virtual void Add (const Handle(Prs3d_Presentation)& thePrs,
80 const Handle(BRepAdaptor_HSurface)& theFace,
81 const Standard_Boolean theToDrawUIso,
82 const Standard_Boolean theToDrawVIso,
83 const Quantity_Length theDeflection,
84 const Standard_Integer theNBUiso,
85 const Standard_Integer theNBViso,
86 const Handle(Prs3d_Drawer)& theDrawer,
87 Prs3d_NListOfSequenceOfPnt& theCurves) const
89 StdPrs_WFDeflectionRestrictedFace::Add (thePrs, theFace, theToDrawUIso, theToDrawVIso, theDeflection,
90 theNBUiso, theNBViso, theDrawer, theCurves);
93 virtual Standard_Boolean Match (const Quantity_Length theX,
94 const Quantity_Length theY,
95 const Quantity_Length theZ,
96 const Quantity_Length theDistance,
97 const Handle(BRepAdaptor_HSurface)& theFace,
98 const Handle(Prs3d_Drawer)& theDrawer) const
100 return StdPrs_WFDeflectionRestrictedFace::Match (theX, theY, theZ, theDistance, theFace, theDrawer);
104 class Curve : public Prs3d_WFShape::Curve
107 virtual void Add (const Handle(Prs3d_Presentation)& thePrs,
108 Adaptor3d_Curve& theCurve,
109 const Quantity_Length theDeflection,
110 const Handle(Prs3d_Drawer)& theDrawer,
111 TColgp_SequenceOfPnt& thePoints,
112 const Standard_Boolean theToDrawCurve) const
114 StdPrs_DeflectionCurve::Add (thePrs, theCurve, theDeflection, theDrawer, thePoints, theToDrawCurve);
117 virtual Standard_Boolean Match (const Quantity_Length theX,
118 const Quantity_Length theY,
119 const Quantity_Length theZ,
120 const Quantity_Length theDistance,
121 const Adaptor3d_Curve& theCurve,
122 const Handle(Prs3d_Drawer)& theDrawer) const
124 return StdPrs_DeflectionCurve::Match (theX, theY, theZ, theDistance, theCurve, theDrawer);
130 #endif // _StdPrs_WFDeflectionShape_H__