Back to index

salome-geom  6.5.0
NMTDS_ShapesDataStructure.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 
00024 #ifndef _NMTDS_ShapesDataStructure_HeaderFile
00025 #define _NMTDS_ShapesDataStructure_HeaderFile
00026 
00027 #include <Standard.hxx>
00028 #include <Standard_Macro.hxx>
00029 #include <TopoDS_Shape.hxx>
00030 #include <NMTDS_CArray1OfIndexRange.hxx>
00031 #include <TopTools_DataMapOfShapeInteger.hxx>
00032 #include <BooleanOperations_ShapesDataStructure.hxx>
00033 #include <Standard_Integer.hxx>
00034 #include <TopoDS_Shape.hxx>
00035 #include <NMTDS_CArray1OfIndexRange.hxx>
00036 #include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
00037 #include <TColStd_IndexedMapOfInteger.hxx>
00038 #include <Bnd_Box.hxx>
00039 
00040 //=======================================================================
00041 //class    : NMTDS_ShapesDataStructure
00042 //purpose  : 
00043 //=======================================================================
00044 class NMTDS_ShapesDataStructure  : public BooleanOperations_ShapesDataStructure
00045 {
00046  public:
00047   Standard_EXPORT
00048     NMTDS_ShapesDataStructure();
00049   
00050   Standard_EXPORT
00051     void SetCompositeShape(const TopoDS_Shape& aS) ;
00052   
00053   Standard_EXPORT
00054     void Init() ;
00055   
00056   Standard_EXPORT
00057     const NMTDS_CArray1OfIndexRange& Ranges() const;
00058   
00059   Standard_EXPORT
00060     const TopoDS_Shape& CompositeShape() const;
00061   
00062   Standard_EXPORT
00063     Standard_Integer ShapeRangeIndex(const Standard_Integer aId) const;
00064   
00065   Standard_EXPORT
00066     virtual  Standard_Integer Rank(const Standard_Integer anIndex) const;
00067   
00068   Standard_EXPORT
00069     virtual  Standard_Integer ShapeIndex(const TopoDS_Shape& aS,
00070                                     const Standard_Integer iRank) const;
00071   
00072   Standard_EXPORT     
00073     void FillMap(const TopoDS_Shape& aS,
00074                BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSA,
00075                BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMS) const;
00076   
00077   Standard_EXPORT
00078     void FillSubshapes(const TopoDS_Shape& aS,
00079                      BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSA,
00080                      BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMS) const;
00081   
00082   Standard_EXPORT     
00083     void GetAllSuccessors(const Standard_Integer anIndex,
00084                        TColStd_IndexedMapOfInteger& aScrs) const;
00085   
00086   Standard_EXPORT     
00087     void ComputeBoxEx(const Standard_Integer anIndex,
00088                     Bnd_Box& aBox) const;
00089 
00090 
00091  protected:
00092   TopoDS_Shape myCompositeShape;
00093   NMTDS_CArray1OfIndexRange myRanges;
00094   TopTools_DataMapOfShapeInteger myShapeIndexMap;
00095 };
00096 #endif