Salome HOME
ddf0786c38c163b6dd908acf02ac6d653ce31e8a
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_ShapeInfoFiller.hxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18
19 #ifndef _GEOMAlgo_ShapeInfoFiller_HeaderFile
20 #define _GEOMAlgo_ShapeInfoFiller_HeaderFile
21
22 #include <Standard.hxx>
23 #include <Standard_Macro.hxx>
24 #include <Standard_Real.hxx>
25
26 #include <gp_Pln.hxx>
27 #include <gp_Sphere.hxx>
28 #include <gp_Cylinder.hxx>
29 #include <gp_Cone.hxx>
30 #include <gp_Torus.hxx>
31
32 #include <GeomAbs_CurveType.hxx>
33 #include <GeomAbs_SurfaceType.hxx>
34
35 #include <TopoDS_Solid.hxx>
36 #include <TopoDS_Shape.hxx>
37 #include <TopoDS_Face.hxx>
38
39 #include <GEOMAlgo_ShapeInfo.hxx>
40 #include <GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx>
41 #include <GEOMAlgo_Algo.hxx>
42
43 //=======================================================================
44 //class    : GEOMAlgo_ShapeInfoFiller
45 //purpose  :
46 //=======================================================================
47 class GEOMAlgo_ShapeInfoFiller  : public GEOMAlgo_Algo
48 {
49  public:
50   Standard_EXPORT
51     GEOMAlgo_ShapeInfoFiller();
52
53   Standard_EXPORT
54     virtual ~GEOMAlgo_ShapeInfoFiller();
55
56   Standard_EXPORT
57     void SetShape(const TopoDS_Shape& aS) ;
58
59   Standard_EXPORT
60     const TopoDS_Shape& Shape() const;
61
62   Standard_EXPORT
63     void SetTolerance(const Standard_Real aT) ;
64
65   Standard_EXPORT
66     Standard_Real Tolerance() const;
67
68   Standard_EXPORT
69     const GEOMAlgo_ShapeInfo& Info() const;
70
71   Standard_EXPORT
72     const GEOMAlgo_ShapeInfo& Info(const TopoDS_Shape& aS) const;
73
74   Standard_EXPORT
75     virtual  void Perform() ;
76
77  protected:
78   Standard_EXPORT
79     virtual  void CheckData() ;
80
81   Standard_EXPORT
82     void FillNbSubShapes(const TopoDS_Shape& aS,GEOMAlgo_ShapeInfo& aInfo) ;
83
84   Standard_EXPORT
85     void FillSubShapes(const TopoDS_Shape& aS) ;
86
87   Standard_EXPORT
88     void FillShape(const TopoDS_Shape& aS) ;
89
90   Standard_EXPORT
91     void FillVertex(const TopoDS_Shape& aS) ;
92
93   Standard_EXPORT
94     void FillEdge(const TopoDS_Shape& aS) ;
95
96   Standard_EXPORT
97     void FillFace(const TopoDS_Shape& aS) ;
98
99   Standard_EXPORT
100     void FillSolid(const TopoDS_Shape& aS) ;
101
102   Standard_EXPORT
103     void FillContainer(const TopoDS_Shape& aS) ;
104
105   Standard_EXPORT
106     void FillDetails(const TopoDS_Face& aF,const gp_Pln& aPln) ;
107
108   Standard_EXPORT
109     void FillDetails(const TopoDS_Face& aF,const gp_Sphere& aSph) ;
110
111   Standard_EXPORT
112     void FillDetails(const TopoDS_Face& aF,const gp_Cylinder& aCyl) ;
113
114   Standard_EXPORT
115     void FillDetails(const TopoDS_Face& aF,const gp_Cone& aCone) ;
116
117   Standard_EXPORT
118     void FillDetails(const TopoDS_Face& aF,const gp_Torus& aTorus) ;
119
120   Standard_EXPORT
121     void FillDetails(const TopoDS_Solid& aS) ;
122
123   //modified by NIZNHY-PKV Tue Jul 03 13:31:43 2012f
124   Standard_EXPORT
125     Standard_Boolean TreatStepSphere(const TopoDS_Solid& aS);
126
127   Standard_EXPORT  static
128     Standard_Boolean IsAllowedType(const GeomAbs_CurveType aCT);
129
130   Standard_EXPORT  static
131     Standard_Boolean IsAllowedType(const GeomAbs_SurfaceType aST);
132
133   Standard_EXPORT  static
134     Standard_Integer NbWires(const TopoDS_Face& aF);
135
136   Standard_EXPORT  static
137     Standard_Integer NbShells(const TopoDS_Solid& aS);
138   //modified by NIZNHY-PKV Tue Jul 03 13:31:49 2012t
139
140   TopoDS_Shape myShape;
141   GEOMAlgo_ShapeInfo myEmptyInfo;
142   GEOMAlgo_IndexedDataMapOfShapeShapeInfo myMapInfo;
143   Standard_Real myTolerance;
144 };
145
146 #endif