Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/geom.git] / src / NMTDS / NMTDS_ShapesDataStructure.hxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23
24 #ifndef _NMTDS_ShapesDataStructure_HeaderFile
25 #define _NMTDS_ShapesDataStructure_HeaderFile
26
27 #include <Standard.hxx>
28 #include <Standard_Macro.hxx>
29 #include <TopoDS_Shape.hxx>
30 #include <NMTDS_CArray1OfIndexRange.hxx>
31 #include <TopTools_DataMapOfShapeInteger.hxx>
32 #include <BooleanOperations_ShapesDataStructure.hxx>
33 #include <Standard_Integer.hxx>
34 #include <TopoDS_Shape.hxx>
35 #include <NMTDS_CArray1OfIndexRange.hxx>
36 #include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
37 #include <TColStd_IndexedMapOfInteger.hxx>
38 #include <Bnd_Box.hxx>
39
40 //=======================================================================
41 //class    : NMTDS_ShapesDataStructure
42 //purpose  : 
43 //=======================================================================
44 class NMTDS_ShapesDataStructure  : public BooleanOperations_ShapesDataStructure
45 {
46  public:
47   Standard_EXPORT
48     NMTDS_ShapesDataStructure();
49   
50   Standard_EXPORT
51     void SetCompositeShape(const TopoDS_Shape& aS) ;
52   
53   Standard_EXPORT
54     void Init() ;
55   
56   Standard_EXPORT
57     const NMTDS_CArray1OfIndexRange& Ranges() const;
58   
59   Standard_EXPORT
60     const TopoDS_Shape& CompositeShape() const;
61   
62   Standard_EXPORT
63     Standard_Integer ShapeRangeIndex(const Standard_Integer aId) const;
64   
65   Standard_EXPORT
66     virtual  Standard_Integer Rank(const Standard_Integer anIndex) const;
67   
68   Standard_EXPORT
69     virtual  Standard_Integer ShapeIndex(const TopoDS_Shape& aS,
70                                          const Standard_Integer iRank) const;
71   
72   Standard_EXPORT     
73     void FillMap(const TopoDS_Shape& aS,
74                  BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSA,
75                  BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMS) const;
76   
77   Standard_EXPORT
78     void FillSubshapes(const TopoDS_Shape& aS,
79                        BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSA,
80                        BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMS) const;
81   
82   Standard_EXPORT     
83     void GetAllSuccessors(const Standard_Integer anIndex,
84                           TColStd_IndexedMapOfInteger& aScrs) const;
85   
86   Standard_EXPORT     
87     void ComputeBoxEx(const Standard_Integer anIndex,
88                       Bnd_Box& aBox) const;
89
90
91  protected:
92   TopoDS_Shape myCompositeShape;
93   NMTDS_CArray1OfIndexRange myRanges;
94   TopTools_DataMapOfShapeInteger myShapeIndexMap;
95 };
96 #endif