0024157: Parallelization of assembly part of BO
[occt.git] / src / StdPrs / StdPrs_WFDeflectionShape.hxx
CommitLineData
d7223c76 1// Copyright (c) 2013 OPEN CASCADE SAS
b311480e 2//
3// The content of this file is subject to the Open CASCADE Technology Public
4// License Version 6.5 (the "License"). You may not use the content of this file
5// except in compliance with the License. Please obtain a copy of the License
6// at http://www.opencascade.org and read it completely before using this file.
7//
8// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10//
11// The Original Code and all software distributed under the License is
12// distributed on an "AS IS" basis, without warranty of any kind, and the
13// Initial Developer hereby disclaims all such warranties, including without
14// limitation, any warranties of merchantability, fitness for a particular
15// purpose or non-infringement. Please see the License for the specific terms
16// and conditions governing the rights and limitations under the License.
17
d7223c76 18#ifndef _StdPrs_WFDeflectionShape_H__
19#define _StdPrs_WFDeflectionShape_H__
7fd59977 20
d7223c76 21#include <Prs3d_Presentation.hxx>
22#include <Prs3d_WFShape.hxx>
23#include <Prs3d_Drawer.hxx>
24#include <Prs3d_Root.hxx>
25#include <StdPrs_WFDeflectionRestrictedFace.hxx>
26#include <StdPrs_DeflectionCurve.hxx>
27#include <StdPrs_Vertex.hxx>
28#include <TopoDS_Shape.hxx>
29#include <TopTools_HSequenceOfShape.hxx>
7fd59977 30
c151c0f1 31class StdPrs_WFDeflectionShape : public Prs3d_Root
32{
33
34public:
35
36 //! Add shape to presentation
37 static inline void Add (const Handle (Prs3d_Presentation)& thePrs,
38 const TopoDS_Shape& theShape,
39 const Handle (Prs3d_Drawer)& theDrawer)
40 {
41 Face aFaceAlgo;
42 Curve aCurveAlgo;
43 Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
44 anAlgo.Add (thePrs, theShape, theDrawer);
45 }
46
47 static inline Handle(TopTools_HSequenceOfShape) PickCurve
48 (const Quantity_Length theX,
49 const Quantity_Length theY,
50 const Quantity_Length theZ,
51 const Quantity_Length theDistance,
52 const TopoDS_Shape& theShape,
53 const Handle (Prs3d_Drawer)& theDrawer)
54 {
55 Face aFaceAlgo;
56 Curve aCurveAlgo;
57 Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
58 return anAlgo.PickCurve (theX, theY, theZ, theDistance, theShape, theDrawer);
59 }
60
61 static inline Handle(TopTools_HSequenceOfShape) PickPatch
62 (const Quantity_Length theX,
63 const Quantity_Length theY,
64 const Quantity_Length theZ,
65 const Quantity_Length theDistance,
66 const TopoDS_Shape& theShape,
67 const Handle(Prs3d_Drawer)& theDrawer)
68 {
69 Face aFaceAlgo;
70 Curve aCurveAlgo;
71 Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
72 return anAlgo.PickPatch (theX, theY, theZ, theDistance, theShape, theDrawer);
73 }
74
75private:
76
77 class Face : public Prs3d_WFShape::Face
78 {
79 public:
80 virtual void Add (const Handle(Prs3d_Presentation)& thePrs,
81 const Handle(BRepAdaptor_HSurface)& theFace,
82 const Standard_Boolean theToDrawUIso,
83 const Standard_Boolean theToDrawVIso,
84 const Quantity_Length theDeflection,
85 const Standard_Integer theNBUiso,
86 const Standard_Integer theNBViso,
87 const Handle(Prs3d_Drawer)& theDrawer,
88 Prs3d_NListOfSequenceOfPnt& theCurves) const
89 {
90 StdPrs_WFDeflectionRestrictedFace::Add (thePrs, theFace, theToDrawUIso, theToDrawVIso, theDeflection,
91 theNBUiso, theNBViso, theDrawer, theCurves);
92 }
93
94 virtual Standard_Boolean Match (const Quantity_Length theX,
95 const Quantity_Length theY,
96 const Quantity_Length theZ,
97 const Quantity_Length theDistance,
98 const Handle(BRepAdaptor_HSurface)& theFace,
99 const Handle(Prs3d_Drawer)& theDrawer) const
100 {
101 return StdPrs_WFDeflectionRestrictedFace::Match (theX, theY, theZ, theDistance, theFace, theDrawer);
102 }
103 };
104
105 class Curve : public Prs3d_WFShape::Curve
106 {
107 public:
108 virtual void Add (const Handle(Prs3d_Presentation)& thePrs,
109 Adaptor3d_Curve& theCurve,
110 const Quantity_Length theDeflection,
111 const Handle(Prs3d_Drawer)& theDrawer,
112 TColgp_SequenceOfPnt& thePoints,
113 const Standard_Boolean theToDrawCurve) const
114 {
115 StdPrs_DeflectionCurve::Add (thePrs, theCurve, theDeflection, theDrawer, thePoints, theToDrawCurve);
116 }
117
118 virtual Standard_Boolean Match (const Quantity_Length theX,
119 const Quantity_Length theY,
120 const Quantity_Length theZ,
121 const Quantity_Length theDistance,
122 const Adaptor3d_Curve& theCurve,
123 const Handle(Prs3d_Drawer)& theDrawer) const
124 {
125 return StdPrs_DeflectionCurve::Match (theX, theY, theZ, theDistance, theCurve, theDrawer);
126 }
127 };
128
129};
130
131#endif // _StdPrs_WFDeflectionShape_H__