0027682: Visualization - provide method Prs3d_Drawer::SetShaderProgram() for setting...
[occt.git] / src / TopOpeBRepDS / TopOpeBRepDS_DSS.hxx
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
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_DSS_HeaderFile
18 #define _TopOpeBRepDS_DSS_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
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>
32 class TopoDS_Shape;
33 class TopOpeBRepDS_Interference;
34
35
36
37 class TopOpeBRepDS_DSS 
38 {
39 public:
40
41   DEFINE_STANDARD_ALLOC
42
43   
44   Standard_EXPORT TopOpeBRepDS_DSS();
45   
46   Standard_EXPORT void Clear();
47   
48   //! Insert a shape S. Returns the index.
49   Standard_EXPORT Standard_Integer AddShape (const TopoDS_Shape& S);
50   
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);
53   
54   Standard_EXPORT Standard_Boolean KeepShape (const Standard_Integer I, const Standard_Boolean K = Standard_True) const;
55   
56   Standard_EXPORT Standard_Boolean KeepShape (const TopoDS_Shape& S, const Standard_Boolean K = Standard_True) const;
57   
58   Standard_EXPORT void ChangeKeepShape (const Standard_Integer I, const Standard_Boolean K);
59   
60   Standard_EXPORT void ChangeKeepShape (const TopoDS_Shape& S, const Standard_Boolean K);
61   
62   Standard_EXPORT const TopOpeBRepDS_ListOfInterference& ShapeInterferences (const TopoDS_Shape& S, const Standard_Boolean K = Standard_True) const;
63   
64   Standard_EXPORT TopOpeBRepDS_ListOfInterference& ChangeShapeInterferences (const TopoDS_Shape& S);
65   
66   Standard_EXPORT const TopOpeBRepDS_ListOfInterference& ShapeInterferences (const Standard_Integer I, const Standard_Boolean K = Standard_True) const;
67   
68   Standard_EXPORT TopOpeBRepDS_ListOfInterference& ChangeShapeInterferences (const Standard_Integer I);
69   
70   Standard_EXPORT const TopTools_ListOfShape& ShapeSameDomain (const TopoDS_Shape& S) const;
71   
72   Standard_EXPORT TopTools_ListOfShape& ChangeShapeSameDomain (const TopoDS_Shape& S);
73   
74   Standard_EXPORT const TopTools_ListOfShape& ShapeSameDomain (const Standard_Integer I) const;
75   
76   Standard_EXPORT TopTools_ListOfShape& ChangeShapeSameDomain (const Standard_Integer I);
77   
78   Standard_EXPORT TopOpeBRepDS_MapOfIntegerShapeData& ChangeShapeData();
79   
80   Standard_EXPORT void AddShapeSameDomain (const TopoDS_Shape& S, const TopoDS_Shape& SSD);
81   
82   Standard_EXPORT void RemoveShapeSameDomain (const TopoDS_Shape& S, const TopoDS_Shape& SSD);
83   
84   Standard_EXPORT Standard_Integer SameDomainRef (const Standard_Integer I) const;
85   
86   Standard_EXPORT Standard_Integer SameDomainRef (const TopoDS_Shape& S) const;
87   
88   Standard_EXPORT void SameDomainRef (const Standard_Integer I, const Standard_Integer Ref);
89   
90   Standard_EXPORT void SameDomainRef (const TopoDS_Shape& S, const Standard_Integer Ref);
91   
92   Standard_EXPORT TopOpeBRepDS_Config SameDomainOri (const Standard_Integer I) const;
93   
94   Standard_EXPORT TopOpeBRepDS_Config SameDomainOri (const TopoDS_Shape& S) const;
95   
96   Standard_EXPORT void SameDomainOri (const Standard_Integer I, const TopOpeBRepDS_Config Ori);
97   
98   Standard_EXPORT void SameDomainOri (const TopoDS_Shape& S, const TopOpeBRepDS_Config Ori);
99   
100   Standard_EXPORT Standard_Integer SameDomainInd (const Standard_Integer I) const;
101   
102   Standard_EXPORT Standard_Integer SameDomainInd (const TopoDS_Shape& S) const;
103   
104   Standard_EXPORT void SameDomainInd (const Standard_Integer I, const Standard_Integer Ind);
105   
106   Standard_EXPORT void SameDomainInd (const TopoDS_Shape& S, const Standard_Integer Ind);
107   
108   Standard_EXPORT Standard_Integer AncestorRank (const Standard_Integer I) const;
109   
110   Standard_EXPORT Standard_Integer AncestorRank (const TopoDS_Shape& S) const;
111   
112   Standard_EXPORT void AncestorRank (const Standard_Integer I, const Standard_Integer Ianc);
113   
114   Standard_EXPORT void AncestorRank (const TopoDS_Shape& S, const Standard_Integer Ianc);
115   
116   Standard_EXPORT void AddShapeInterference (const TopoDS_Shape& S, const Handle(TopOpeBRepDS_Interference)& I);
117   
118   Standard_EXPORT void RemoveShapeInterference (const TopoDS_Shape& S, const Handle(TopOpeBRepDS_Interference)& I);
119   
120   Standard_EXPORT void FillShapesSameDomain (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
121   
122   Standard_EXPORT void UnfillShapesSameDomain (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
123   
124   Standard_EXPORT Standard_Integer NbShapes() const;
125   
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;
128   
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;
131   
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;
135   
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;
138
139
140
141
142 protected:
143
144
145
146
147
148 private:
149
150
151
152   TopOpeBRepDS_DoubleMapOfIntegerShape myDMOIS;
153   Standard_Integer myNbDMOIS;
154   TopOpeBRepDS_MapOfIntegerShapeData myIMOSD;
155   TopOpeBRepDS_ListOfInterference myEmptyListOfInterference;
156   TopTools_ListOfShape myEmptyListOfShape;
157   TopoDS_Shape myEmptyShape;
158
159
160 };
161
162
163
164
165
166
167
168 #endif // _TopOpeBRepDS_DSS_HeaderFile