0033040: Coding - get rid of unused headers [Storage to TopOpeBRepTool]
[occt.git] / src / TopOpeBRepDS / TopOpeBRepDS_HDataStructure.hxx
1 // Created on: 1993-06-17
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1993-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 _TopOpeBRepDS_HDataStructure_HeaderFile
18 #define _TopOpeBRepDS_HDataStructure_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <TopOpeBRepDS_DataStructure.hxx>
24 #include <TCollection_AsciiString.hxx>
25 #include <Standard_Transient.hxx>
26 #include <TopAbs_ShapeEnum.hxx>
27 #include <Standard_Integer.hxx>
28 #include <TopOpeBRepDS_Config.hxx>
29 #include <TopOpeBRepDS_Kind.hxx>
30 #include <TopOpeBRepDS_ListOfInterference.hxx>
31 class TopoDS_Shape;
32 class TopOpeBRepDS_Surface;
33 class TopOpeBRepDS_CurveIterator;
34 class TopOpeBRepDS_Curve;
35 class TopOpeBRepDS_PointIterator;
36 class TopOpeBRepDS_Point;
37 class TopOpeBRepDS_SurfaceIterator;
38 class TopOpeBRepDS_Interference;
39
40
41 class TopOpeBRepDS_HDataStructure;
42 DEFINE_STANDARD_HANDLE(TopOpeBRepDS_HDataStructure, Standard_Transient)
43
44
45 class TopOpeBRepDS_HDataStructure : public Standard_Transient
46 {
47
48 public:
49
50   
51   Standard_EXPORT TopOpeBRepDS_HDataStructure();
52   
53   Standard_EXPORT void AddAncestors (const TopoDS_Shape& S);
54   
55   //! Update  the data structure with  shapes of type T1
56   //! containing a subshape of type T2 which is stored
57   //! in the DS.
58   //! Used by the previous one.
59   Standard_EXPORT void AddAncestors (const TopoDS_Shape& S, const TopAbs_ShapeEnum T1, const TopAbs_ShapeEnum T2);
60   
61
62   //! Check the integrity of the DS
63   Standard_EXPORT void ChkIntg();
64   
65   Standard_EXPORT const TopOpeBRepDS_DataStructure& DS() const;
66   
67   Standard_EXPORT TopOpeBRepDS_DataStructure& ChangeDS();
68   
69   Standard_EXPORT Standard_Integer NbSurfaces() const;
70   
71   Standard_EXPORT Standard_Integer NbCurves() const;
72   
73   Standard_EXPORT Standard_Integer NbPoints() const;
74   
75   //! Returns the surface of index <I>.
76   Standard_EXPORT const TopOpeBRepDS_Surface& Surface (const Standard_Integer I) const;
77   
78   //! Returns an iterator  on the curves on  the surface
79   //! <I>.
80   Standard_EXPORT TopOpeBRepDS_CurveIterator SurfaceCurves (const Standard_Integer I) const;
81   
82   //! Returns the Curve of index <I>.
83   Standard_EXPORT const TopOpeBRepDS_Curve& Curve (const Standard_Integer I) const;
84   
85   //! Returns the Curve of index <I>.
86   Standard_EXPORT TopOpeBRepDS_Curve& ChangeCurve (const Standard_Integer I);
87   
88   //! Returns an iterator   on the points on  the  curve
89   //! <I>.
90   Standard_EXPORT TopOpeBRepDS_PointIterator CurvePoints (const Standard_Integer I) const;
91   
92   //! Returns the point of index <I>.
93   Standard_EXPORT const TopOpeBRepDS_Point& Point (const Standard_Integer I) const;
94   
95   Standard_EXPORT Standard_Integer NbShapes() const;
96   
97   //! Returns the shape of index <I> in the DS
98   Standard_EXPORT const TopoDS_Shape& Shape (const Standard_Integer I, const Standard_Boolean FindKeep = Standard_True) const;
99   
100   //! Returns the index of shape <S> in the DS
101   //! returns 0 if <S> is not in the DS
102   Standard_EXPORT Standard_Integer Shape (const TopoDS_Shape& S, const Standard_Boolean FindKeep = Standard_True) const;
103   
104   //! Returns True if <S> has new geometries.
105   Standard_EXPORT Standard_Boolean HasGeometry (const TopoDS_Shape& S) const;
106   
107   //! Returns True if <S> has new geometries (SOLID,FACE,EDGE)
108   //! or if <S> (SHELL,WIRE) has sub-shape (FACE,EDGE)
109   //! with new geometries
110   Standard_EXPORT Standard_Boolean HasShape (const TopoDS_Shape& S, const Standard_Boolean FindKeep = Standard_True) const;
111   
112   //! Returns True if <S> share a geometrical domain with
113   //! some other shapes.
114   Standard_EXPORT Standard_Boolean HasSameDomain (const TopoDS_Shape& S, const Standard_Boolean FindKeep = Standard_True) const;
115   
116   //! Returns an iterator on the SameDomain shapes attached
117   //! to the shape <S>.
118   Standard_EXPORT TopTools_ListIteratorOfListOfShape SameDomain (const TopoDS_Shape& S) const;
119   
120   //! Returns orientation of shape <S> compared with its
121   //! reference shape
122   Standard_EXPORT TopOpeBRepDS_Config SameDomainOrientation (const TopoDS_Shape& S) const;
123   
124   //! Returns orientation of shape <S> compared with its
125   //! reference shape
126   Standard_EXPORT Standard_Integer SameDomainReference (const TopoDS_Shape& S) const;
127   
128   //! Returns an iterator on the  surfaces attached to the
129   //! solid <S>.
130   Standard_EXPORT TopOpeBRepDS_SurfaceIterator SolidSurfaces (const TopoDS_Shape& S) const;
131   
132   //! Returns an iterator on the  surfaces attached to the
133   //! solid <I>.
134   Standard_EXPORT TopOpeBRepDS_SurfaceIterator SolidSurfaces (const Standard_Integer I) const;
135   
136   //! Returns an iterator on the  curves attached to the
137   //! face <F>.
138   Standard_EXPORT TopOpeBRepDS_CurveIterator FaceCurves (const TopoDS_Shape& F) const;
139   
140   //! Returns an iterator on the  curves attached to the
141   //! face <I>.
142   Standard_EXPORT TopOpeBRepDS_CurveIterator FaceCurves (const Standard_Integer I) const;
143   
144   //! Returns an iterator on the points  attached to the
145   //! edge <E>.
146   Standard_EXPORT TopOpeBRepDS_PointIterator EdgePoints (const TopoDS_Shape& E) const;
147   
148   Standard_EXPORT Standard_Integer MakeCurve (const TopOpeBRepDS_Curve& C1, TopOpeBRepDS_Curve& C2);
149   
150   Standard_EXPORT void RemoveCurve (const Standard_Integer iC);
151   
152   Standard_EXPORT Standard_Integer NbGeometry (const TopOpeBRepDS_Kind K) const;
153   
154   Standard_EXPORT Standard_Integer NbTopology (const TopOpeBRepDS_Kind K) const;
155   
156   Standard_EXPORT Standard_Integer NbTopology() const;
157   
158   //! returns True if all the edges stored as shapes in the DS
159   //! are SameParameter, otherwise False.
160   Standard_EXPORT Standard_Boolean EdgesSameParameter() const;
161   
162   Standard_EXPORT void SortOnParameter (const TopOpeBRepDS_ListOfInterference& L1, TopOpeBRepDS_ListOfInterference& L2) const;
163   
164   Standard_EXPORT void SortOnParameter (TopOpeBRepDS_ListOfInterference& L) const;
165   
166   Standard_EXPORT void MinMaxOnParameter (const TopOpeBRepDS_ListOfInterference& L, Standard_Real& Min, Standard_Real& Max) const;
167   
168
169   //! Search, among a list of interferences accessed by the iterator
170   //! <IT>, a geometry <G> whose 3D point is identical to the 3D point
171   //! of the TheDSPoint <PDS>.
172   //! returns True if such an interference has been found, False else.
173   //! if True, iterator It points (by the Value() method) on the first
174   //! interference accessing an identical 3D point.
175   Standard_EXPORT Standard_Boolean ScanInterfList (TopOpeBRepDS_ListIteratorOfListOfInterference& IT, const TopOpeBRepDS_Point& PDS) const;
176   
177
178   //! Get the geometry of a DS point <PDS>.
179   //! Search for it with ScanInterfList (previous method).
180   //! if found, set <G,K> to the geometry,kind of the interference found.
181   //! returns the value of ScanInterfList().
182   Standard_EXPORT Standard_Boolean GetGeometry (TopOpeBRepDS_ListIteratorOfListOfInterference& IT, const TopOpeBRepDS_Point& PDS, Standard_Integer& G, TopOpeBRepDS_Kind& K) const;
183   
184
185   //! Add interference <I> to list <LI>.
186   Standard_EXPORT void StoreInterference (const Handle(TopOpeBRepDS_Interference)& I, TopOpeBRepDS_ListOfInterference& LI, const TCollection_AsciiString& str = "");
187   
188
189   //! Add interference <I> to list of interference of shape <S>.
190   Standard_EXPORT void StoreInterference (const Handle(TopOpeBRepDS_Interference)& I, const TopoDS_Shape& S, const TCollection_AsciiString& str = "");
191   
192
193   //! Add interference <I> to list of interference of shape <IS>.
194   Standard_EXPORT void StoreInterference (const Handle(TopOpeBRepDS_Interference)& I, const Standard_Integer IS, const TCollection_AsciiString& str = "");
195   
196   Standard_EXPORT void StoreInterferences (const TopOpeBRepDS_ListOfInterference& LI, const TopoDS_Shape& S, const TCollection_AsciiString& str = "");
197   
198   Standard_EXPORT void StoreInterferences (const TopOpeBRepDS_ListOfInterference& LI, const Standard_Integer IS, const TCollection_AsciiString& str = "");
199   
200   Standard_EXPORT void ClearStoreInterferences (const TopOpeBRepDS_ListOfInterference& LI, const TopoDS_Shape& S, const TCollection_AsciiString& str = "");
201   
202   Standard_EXPORT void ClearStoreInterferences (const TopOpeBRepDS_ListOfInterference& LI, const Standard_Integer IS, const TCollection_AsciiString& str = "");
203
204
205
206
207   DEFINE_STANDARD_RTTIEXT(TopOpeBRepDS_HDataStructure,Standard_Transient)
208
209 protected:
210
211
212
213
214 private:
215
216
217   TopOpeBRepDS_DataStructure myDS;
218
219
220 };
221
222
223
224
225
226
227
228 #endif // _TopOpeBRepDS_HDataStructure_HeaderFile