0032768: Coding - get rid of unused headers [BopAlgo to BRepBuilderAPI]
[occt.git] / src / BRepAlgo / BRepAlgo_NormalProjection.hxx
1 // Created on: 1997-10-13
2 // Created by: Roman BORISOV
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _BRepAlgo_NormalProjection_HeaderFile
18 #define _BRepAlgo_NormalProjection_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22
23 #include <TopoDS_Shape.hxx>
24 #include <GeomAbs_Shape.hxx>
25 #include <Standard_Integer.hxx>
26 #include <TopTools_DataMapOfShapeShape.hxx>
27 #include <TopTools_DataMapOfShapeListOfShape.hxx>
28 #include <TopTools_ListOfShape.hxx>
29 class TopoDS_Edge;
30 class Adaptor3d_Curve;
31
32
33 //! This class makes the projection  of a wire on a
34 //! shape.
35 class BRepAlgo_NormalProjection 
36 {
37 public:
38
39   DEFINE_STANDARD_ALLOC
40
41   
42   Standard_EXPORT BRepAlgo_NormalProjection();
43   
44   Standard_EXPORT BRepAlgo_NormalProjection(const TopoDS_Shape& S);
45   
46   Standard_EXPORT void Init (const TopoDS_Shape& S);
47   
48   //! Add an edge or a wire to the list of shape to project
49   Standard_EXPORT void Add (const TopoDS_Shape& ToProj);
50   
51   //! Set the parameters  used  for computation
52   //! Tol3d is the required  tolerance between the  3d projected
53   //! curve  and its 2d representation
54   //! InternalContinuity  is the order of constraints
55   //! used for  approximation.
56   //! MaxDeg and MaxSeg are the maximum degree and the maximum
57   //! number of segment for BSpline resulting of an approximation.
58   Standard_EXPORT void SetParams (const Standard_Real Tol3D, const Standard_Real Tol2D, const GeomAbs_Shape InternalContinuity, const Standard_Integer MaxDegree, const Standard_Integer MaxSeg);
59   
60   //! Set the parameters  used  for computation
61   //! in their default values
62   Standard_EXPORT void SetDefaultParams();
63   
64   //! Sets the maximum distance between target shape and
65   //! shape to project. If this condition is not satisfied then
66   //! corresponding part of solution is discarded.
67   //! if MaxDist < 0 then this method does not affect the algorithm
68   Standard_EXPORT void SetMaxDistance (const Standard_Real MaxDist);
69   
70   //! if  With3d = Standard_False the 3dcurve is not computed
71   //! the  initial 3dcurve is kept  to  build the  resulting edges.
72   Standard_EXPORT void Compute3d (const Standard_Boolean With3d = Standard_True);
73   
74   //! Manage  limitation  of  projected  edges.
75   Standard_EXPORT void SetLimit (const Standard_Boolean FaceBoundaries = Standard_True);
76   
77   //! Builds the result as a  compound.
78   Standard_EXPORT void Build();
79   
80   Standard_EXPORT Standard_Boolean IsDone() const;
81   
82   //! returns the result
83   Standard_EXPORT const TopoDS_Shape& Projection() const;
84   
85   //! For a resulting edge, returns the corresponding initial edge.
86   Standard_EXPORT const TopoDS_Shape& Ancestor (const TopoDS_Edge& E) const;
87   
88   //! For a projected edge, returns the corresponding initial face.
89   Standard_EXPORT const TopoDS_Shape& Couple (const TopoDS_Edge& E) const;
90   
91   //! Returns the  list   of shapes generated   from the
92   //! shape <S>.
93   Standard_EXPORT const TopTools_ListOfShape& Generated (const TopoDS_Shape& S);
94   
95   Standard_EXPORT Standard_Boolean IsElementary (const Adaptor3d_Curve& C) const;
96   
97   //! build the result as a list of wire if possible in --
98   //! a first returns a wire only if there is only a wire.
99   Standard_EXPORT Standard_Boolean BuildWire (TopTools_ListOfShape& Liste) const;
100
101
102
103
104 protected:
105
106
107
108
109
110 private:
111
112
113
114   TopoDS_Shape myShape;
115   Standard_Boolean myIsDone;
116   Standard_Real myTol3d;
117   Standard_Real myTol2d;
118   Standard_Real myMaxDist;
119   Standard_Boolean myWith3d;
120   GeomAbs_Shape myContinuity;
121   Standard_Integer myMaxDegree;
122   Standard_Integer myMaxSeg;
123   Standard_Boolean myFaceBounds;
124   TopoDS_Shape myToProj;
125   TopTools_DataMapOfShapeShape myAncestorMap;
126   TopTools_DataMapOfShapeShape myCorresp;
127   TopTools_DataMapOfShapeListOfShape myDescendants;
128   TopoDS_Shape myRes;
129
130
131 };
132
133
134
135
136
137
138
139 #endif // _BRepAlgo_NormalProjection_HeaderFile