0027961: Visualization - remove unused and no more working OpenGl_AVIWriter
[occt.git] / src / BOPDS / BOPDS_PaveBlock.hxx
1 // Created by: Peter KURNEV
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15 #ifndef _BOPDS_PaveBlock_HeaderFile
16 #define _BOPDS_PaveBlock_HeaderFile
17
18 #include <Standard.hxx>
19 #include <Standard_Type.hxx>
20
21 #include <BOPCol_BaseAllocator.hxx>
22 #include <Standard_Integer.hxx>
23 #include <BOPDS_Pave.hxx>
24 #include <BOPDS_ListOfPave.hxx>
25 #include <Standard_Real.hxx>
26 #include <Bnd_Box.hxx>
27 #include <BOPCol_MapOfInteger.hxx>
28 #include <MMgt_TShared.hxx>
29 #include <Standard_Boolean.hxx>
30 #include <BOPDS_ListOfPaveBlock.hxx>
31 class BOPDS_Pave;
32 class Bnd_Box;
33
34
35 class BOPDS_PaveBlock;
36 DEFINE_STANDARD_HANDLE(BOPDS_PaveBlock, MMgt_TShared)
37
38
39 //! The class BOPDS_PaveBlock is to store
40 //! the information about pave block on an edge.
41 //! Two adjacent paves on edge make up pave block.
42 class BOPDS_PaveBlock : public MMgt_TShared
43 {
44
45 public:
46
47   
48
49   //! Empty contructor
50   Standard_EXPORT BOPDS_PaveBlock();
51   
52
53   //! Contructor
54   //! <theAllocator> - the allocator to manage the memory
55   Standard_EXPORT BOPDS_PaveBlock(const BOPCol_BaseAllocator& theAllocator);
56   
57
58   //! Modifier
59   //! Sets the first pave <thePave>
60   Standard_EXPORT void SetPave1 (const BOPDS_Pave& thePave);
61   
62
63   //! Selector
64   //! Returns the first pave
65   Standard_EXPORT const BOPDS_Pave& Pave1() const;
66   
67
68   //! Modifier
69   //! Sets the second pave <thePave>
70   Standard_EXPORT void SetPave2 (const BOPDS_Pave& thePave);
71   
72
73   //! Selector
74   //! Returns the second pave
75   Standard_EXPORT const BOPDS_Pave& Pave2() const;
76   
77
78   //! Modifier
79   //! Sets the index of edge of pave block <theEdge>
80   Standard_EXPORT void SetEdge (const Standard_Integer theEdge);
81   
82
83   //! Selector
84   //! Returns the index of edge of pave block
85   Standard_EXPORT Standard_Integer Edge() const;
86   
87
88   //! Query
89   //! Returns true if the pave block has edge
90   Standard_EXPORT Standard_Boolean HasEdge() const;
91   
92
93   //! Query
94   //! Returns true if the pave block has edge
95   //! Returns the index of edge <theEdge>
96   Standard_EXPORT Standard_Boolean HasEdge (Standard_Integer& theEdge) const;
97   
98
99   //! Modifier
100   //! Sets the index of original edge
101   //! of the pave block <theEdge>
102   Standard_EXPORT void SetOriginalEdge (const Standard_Integer theEdge);
103   
104
105   //! Selector
106   //! Returns the index of original edge of pave block
107   Standard_EXPORT Standard_Integer OriginalEdge() const;
108   
109
110   //! Query
111   //! Returns true if the edge is equal to the original edge
112   //! of the pave block
113   Standard_EXPORT Standard_Boolean IsSplitEdge() const;
114   
115
116   //! Selector
117   //! Returns the parametric range <theT1,theT2>
118   //! of the pave block
119   Standard_EXPORT void Range (Standard_Real& theT1, Standard_Real& theT2) const;
120   
121
122   //! Query
123   //! Returns true if the pave block has pave indices
124   //! that equal to the  pave indices of the pave block
125   //! <theOther>
126   Standard_EXPORT Standard_Boolean HasSameBounds (const Handle(BOPDS_PaveBlock)& theOther) const;
127   
128
129   //! Selector
130   //! Returns the pave indices  <theIndex1,theIndex2>
131   //! of the pave block
132   Standard_EXPORT void Indices (Standard_Integer& theIndex1, 
133                                 Standard_Integer& theIndex2) const;
134   
135
136   //! Query
137   //! Returns true if the pave block contains extra paves
138   Standard_EXPORT Standard_Boolean IsToUpdate() const;
139   
140
141   //! Modifier
142   //! Appends extra paves <theLP>
143   Standard_EXPORT void AppendExtPave (const BOPDS_Pave& theLP);
144   
145
146   //! Modifier
147   //! Appends extra pave <thePave>
148   Standard_EXPORT void AppendExtPave1 (const BOPDS_Pave& thePave);
149   
150
151   //! Selector
152   //! Returns the  extra paves
153   Standard_EXPORT const BOPDS_ListOfPave& ExtPaves() const;
154   
155
156   //! Selector / Modifier
157   //! Returns the extra paves
158   Standard_EXPORT BOPDS_ListOfPave& ChangeExtPaves();
159   
160
161   //! Modifier
162   //! Updates the pave block. The extra paves are used
163   //! to create new pave blocks <theLPB>.
164   //! <theFlag> - if true, the first pave and the second
165   //! pave are used to produce new pave blocks.
166   Standard_EXPORT void Update (BOPDS_ListOfPaveBlock& theLPB, 
167                                const Standard_Boolean theFlag = Standard_True);
168   
169
170   //! Query
171   //! Returns true if the extra paves contain the pave
172   //! with given value of the parameter <thePrm>
173   //! <theTol>  - the value of the tolerance to compare
174   //! <theInd>  - index of the found pave
175   Standard_EXPORT Standard_Boolean ContainsParameter (const Standard_Real thePrm, 
176                                                       const Standard_Real theTol,
177                                                       Standard_Integer& theInd) const;
178   
179
180   //! Modifier
181   //! Sets the shrunk data for the pave block
182   //! <theTS1>,  <theTS2> - shrunk range
183   //! <theBox> - the bounding box
184   //! <theIsSplittable> - defines whether the edge can be split
185   Standard_EXPORT void SetShrunkData (const Standard_Real theTS1, 
186                                       const Standard_Real theTS2, 
187                                       const Bnd_Box& theBox,
188                                       const Standard_Boolean theIsSplittable);
189   
190
191   //! Selector
192   //! Returns  the shrunk data for the pave block
193   //! <theTS1>,  <theTS2> - shrunk range
194   //! <theBox> - the bounding box
195   //! <theIsSplittable> - defines whether the edge can be split
196   Standard_EXPORT void ShrunkData (Standard_Real& theTS1, 
197                                    Standard_Real& theTS2, 
198                                    Bnd_Box& theBox,
199                                    Standard_Boolean& theIsSplittable) const;
200   
201
202   //! Query
203   //! Returns true if the pave block contains
204   //! the shrunk data
205   Standard_EXPORT Standard_Boolean HasShrunkData() const;
206   
207   Standard_EXPORT void Dump() const;
208
209   //! Query
210   //! Returns FALSE if the pave block has a too short
211   //! shrunk range and cannot be split, otherwise returns TRUE
212   Standard_Boolean IsSplittable() const
213   {
214     return myIsSplittable;
215   }
216
217
218
219   DEFINE_STANDARD_RTTIEXT(BOPDS_PaveBlock,MMgt_TShared)
220
221 protected:
222
223
224   BOPCol_BaseAllocator myAllocator;
225   Standard_Integer myEdge;
226   Standard_Integer myOriginalEdge;
227   BOPDS_Pave myPave1;
228   BOPDS_Pave myPave2;
229   BOPDS_ListOfPave myExtPaves;
230   Standard_Real myTS1;
231   Standard_Real myTS2;
232   Bnd_Box myShrunkBox;
233   BOPCol_MapOfInteger myMFence;
234   Standard_Boolean myIsSplittable;
235
236 private:
237
238
239
240
241 };
242
243
244
245
246
247
248
249 #endif // _BOPDS_PaveBlock_HeaderFile