1 // Created on: 1998-02-05
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _TopOpeBRepDS_DSS_HeaderFile
18 #define _TopOpeBRepDS_DSS_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TopOpeBRepDS_DoubleMapOfIntegerShape.hxx>
25 #include <Standard_Integer.hxx>
26 #include <TopOpeBRepDS_MapOfIntegerShapeData.hxx>
27 #include <TopOpeBRepDS_ListOfInterference.hxx>
28 #include <TopTools_ListOfShape.hxx>
29 #include <TopoDS_Shape.hxx>
30 #include <Standard_Boolean.hxx>
31 #include <TopOpeBRepDS_Config.hxx>
33 class TopOpeBRepDS_Interference;
37 class TopOpeBRepDS_DSS
44 Standard_EXPORT TopOpeBRepDS_DSS();
46 Standard_EXPORT void Clear();
48 //! Insert a shape S. Returns the index.
49 Standard_EXPORT Standard_Integer AddShape (const TopoDS_Shape& S);
51 //! Insert a shape S which ancestor is I = 1 or 2. Returns the index.
52 Standard_EXPORT Standard_Integer AddShape (const TopoDS_Shape& S, const Standard_Integer I);
54 Standard_EXPORT Standard_Boolean KeepShape (const Standard_Integer I, const Standard_Boolean K = Standard_True) const;
56 Standard_EXPORT Standard_Boolean KeepShape (const TopoDS_Shape& S, const Standard_Boolean K = Standard_True) const;
58 Standard_EXPORT void ChangeKeepShape (const Standard_Integer I, const Standard_Boolean K);
60 Standard_EXPORT void ChangeKeepShape (const TopoDS_Shape& S, const Standard_Boolean K);
62 Standard_EXPORT const TopOpeBRepDS_ListOfInterference& ShapeInterferences (const TopoDS_Shape& S, const Standard_Boolean K = Standard_True) const;
64 Standard_EXPORT TopOpeBRepDS_ListOfInterference& ChangeShapeInterferences (const TopoDS_Shape& S);
66 Standard_EXPORT const TopOpeBRepDS_ListOfInterference& ShapeInterferences (const Standard_Integer I, const Standard_Boolean K = Standard_True) const;
68 Standard_EXPORT TopOpeBRepDS_ListOfInterference& ChangeShapeInterferences (const Standard_Integer I);
70 Standard_EXPORT const TopTools_ListOfShape& ShapeSameDomain (const TopoDS_Shape& S) const;
72 Standard_EXPORT TopTools_ListOfShape& ChangeShapeSameDomain (const TopoDS_Shape& S);
74 Standard_EXPORT const TopTools_ListOfShape& ShapeSameDomain (const Standard_Integer I) const;
76 Standard_EXPORT TopTools_ListOfShape& ChangeShapeSameDomain (const Standard_Integer I);
78 Standard_EXPORT TopOpeBRepDS_MapOfIntegerShapeData& ChangeShapeData();
80 Standard_EXPORT void AddShapeSameDomain (const TopoDS_Shape& S, const TopoDS_Shape& SSD);
82 Standard_EXPORT void RemoveShapeSameDomain (const TopoDS_Shape& S, const TopoDS_Shape& SSD);
84 Standard_EXPORT Standard_Integer SameDomainRef (const Standard_Integer I) const;
86 Standard_EXPORT Standard_Integer SameDomainRef (const TopoDS_Shape& S) const;
88 Standard_EXPORT void SameDomainRef (const Standard_Integer I, const Standard_Integer Ref);
90 Standard_EXPORT void SameDomainRef (const TopoDS_Shape& S, const Standard_Integer Ref);
92 Standard_EXPORT TopOpeBRepDS_Config SameDomainOri (const Standard_Integer I) const;
94 Standard_EXPORT TopOpeBRepDS_Config SameDomainOri (const TopoDS_Shape& S) const;
96 Standard_EXPORT void SameDomainOri (const Standard_Integer I, const TopOpeBRepDS_Config Ori);
98 Standard_EXPORT void SameDomainOri (const TopoDS_Shape& S, const TopOpeBRepDS_Config Ori);
100 Standard_EXPORT Standard_Integer SameDomainInd (const Standard_Integer I) const;
102 Standard_EXPORT Standard_Integer SameDomainInd (const TopoDS_Shape& S) const;
104 Standard_EXPORT void SameDomainInd (const Standard_Integer I, const Standard_Integer Ind);
106 Standard_EXPORT void SameDomainInd (const TopoDS_Shape& S, const Standard_Integer Ind);
108 Standard_EXPORT Standard_Integer AncestorRank (const Standard_Integer I) const;
110 Standard_EXPORT Standard_Integer AncestorRank (const TopoDS_Shape& S) const;
112 Standard_EXPORT void AncestorRank (const Standard_Integer I, const Standard_Integer Ianc);
114 Standard_EXPORT void AncestorRank (const TopoDS_Shape& S, const Standard_Integer Ianc);
116 Standard_EXPORT void AddShapeInterference (const TopoDS_Shape& S, const Handle(TopOpeBRepDS_Interference)& I);
118 Standard_EXPORT void RemoveShapeInterference (const TopoDS_Shape& S, const Handle(TopOpeBRepDS_Interference)& I);
120 Standard_EXPORT void FillShapesSameDomain (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
122 Standard_EXPORT void UnfillShapesSameDomain (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
124 Standard_EXPORT Standard_Integer NbShapes() const;
126 //! returns the shape of index I stored the maps
127 Standard_EXPORT const TopoDS_Shape& Shape (const Standard_Integer I, const Standard_Boolean K = Standard_True) const;
129 //! returns the index of shape <S>, 0 if <S> is not in the maps.
130 Standard_EXPORT Standard_Integer Shape (const TopoDS_Shape& S, const Standard_Boolean K = Standard_True) const;
132 //! Returns True if <S> has new geometries, i.e :
133 //! True if S is stored and has an interference list not empty
134 Standard_EXPORT Standard_Boolean HasGeometry (const TopoDS_Shape& S) const;
136 //! Returns True if <S> is stored in the maps
137 Standard_EXPORT Standard_Boolean HasShape (const TopoDS_Shape& S, const Standard_Boolean K = Standard_True) const;
152 TopOpeBRepDS_DoubleMapOfIntegerShape myDMOIS;
153 Standard_Integer myNbDMOIS;
154 TopOpeBRepDS_MapOfIntegerShapeData myIMOSD;
155 TopOpeBRepDS_ListOfInterference myEmptyListOfInterference;
156 TopTools_ListOfShape myEmptyListOfShape;
157 TopoDS_Shape myEmptyShape;
168 #endif // _TopOpeBRepDS_DSS_HeaderFile