Salome HOME
Compatibility with dev version of OCCT
[tools/install.git] / config_files / patches / OCCT-6.8.0_SRC.patch
1 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/drv/BRepBlend/BRepBlend_Walking_0.cxx OCCT-6.8.0_SRC-patch/drv/BRepBlend/BRepBlend_Walking_0.cxx
2 --- OCCT-6.8.0_SRC/drv/BRepBlend/BRepBlend_Walking_0.cxx        2014-11-11 17:53:30.000000000 +0300
3 +++ OCCT-6.8.0_SRC-patch/drv/BRepBlend/BRepBlend_Walking_0.cxx  2015-01-16 14:33:41.000000000 +0300
4 @@ -22,6 +22,7 @@
5  #include <Blend_Point.hxx>
6  #include <Blend_Function.hxx>
7  #include <Blend_FuncInv.hxx>
8 +#include <ChFiDS_HElSpine.hxx>
9  #include <gp_Pnt2d.hxx>
10  #include <IntSurf_Transition.hxx>
11   
12 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/AIS_InteractiveContext.hxx OCCT-6.8.0_SRC-patch/inc/AIS_InteractiveContext.hxx
13 --- OCCT-6.8.0_SRC/inc/AIS_InteractiveContext.hxx       2014-11-11 17:54:39.000000000 +0300
14 +++ OCCT-6.8.0_SRC-patch/inc/AIS_InteractiveContext.hxx 2015-01-16 14:34:51.000000000 +0300
15 @@ -239,13 +239,6 @@
16    //! Local Context opened.
17    Standard_EXPORT   Standard_Boolean KeepTemporary (const Handle(AIS_InteractiveObject)& anIObj, const Standard_Integer InWhichLocal = -1) ;
18    
19 -  //! Removes the interactive object aniobj from all viewers.
20 -  //! If a local context is open and if updateviewer equals
21 -  //! Standard_False, the presentation of the Interactive
22 -  //! Object activates the selection mode; the object is
23 -  //! displayed but no viewer will be updated.
24 -  Standard_EXPORT   void Clear (const Handle(AIS_InteractiveObject)& aniobj, const Standard_Boolean updateviewer = Standard_True) ;
25 -  
26    //! Empties the graphic presentation of the mode
27    //! indexed by aMode.
28    //! If a local context is open and if updateviewer equals
29 @@ -1633,6 +1626,12 @@
30    Standard_EXPORT   void InitAttributes() ;
31    
32    Standard_EXPORT   Standard_Integer PurgeViewer (const Handle(V3d_Viewer)& Vwr) ;
33 +  
34 +  //! UNKNOWN
35 +  Standard_EXPORT   void redisplayPrsModes (const Handle(AIS_InteractiveObject)& theIObj, const Standard_Boolean theToUpdateViewer = Standard_True) ;
36 +  
37 +  //! UNKNOWN
38 +  Standard_EXPORT   void redisplayPrsRecModes (const Handle(AIS_InteractiveObject)& theIObj, const Standard_Boolean theToUpdateViewer = Standard_True) ;
39  
40    AIS_DataMapOfIOStatus myObjects;
41    Handle(SelectMgr_SelectionManager) mgrSelector;
42 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/Blend_Walking_1.gxx OCCT-6.8.0_SRC-patch/inc/Blend_Walking_1.gxx
43 --- OCCT-6.8.0_SRC/inc/Blend_Walking_1.gxx      2014-11-11 17:46:43.000000000 +0300
44 +++ OCCT-6.8.0_SRC-patch/inc/Blend_Walking_1.gxx        2015-01-16 12:59:38.000000000 +0300
45 @@ -56,6 +56,7 @@
46  
47  void Blend_Walking::Perform(Blend_Function& Func,
48                             Blend_FuncInv& FuncInv,
49 +                            const Handle(ChFiDS_HElSpine)& HGuide,
50                             const Standard_Real Pdep,   
51                             const Standard_Real Pmax,
52                             const Standard_Real MaxStep,
53 @@ -154,7 +155,7 @@
54      }
55    }
56  
57 -  InternalPerform(Func,FuncInv,Pmax);
58 +  InternalPerform(Func,FuncInv,HGuide,Pmax);
59  
60    done = Standard_True;
61  }
62 @@ -461,7 +462,8 @@
63    previousP.ParametersOnS1(sol(1),sol(2));
64    previousP.ParametersOnS2(sol(3),sol(4));
65  
66 -  InternalPerform(Func,FuncInv,P);
67 +  Handle(ChFiDS_HElSpine) anHGuide;
68 +  InternalPerform(Func,FuncInv,anHGuide,P);
69    return Standard_True;
70  }
71  
72 @@ -502,7 +504,8 @@
73    if(OnS1) clasonS1 = Standard_False;
74    else clasonS2 = Standard_False;
75  
76 -  InternalPerform(Func,FuncInv,P);
77 +  Handle(ChFiDS_HElSpine) anHGuide;
78 +  InternalPerform(Func,FuncInv,anHGuide,P);
79  
80    clasonS1 = Standard_True;
81    clasonS2 = Standard_True;
82 @@ -548,7 +551,8 @@
83    previousP.ParametersOnS1(sol(1),sol(2));
84    previousP.ParametersOnS2(sol(3),sol(4));
85  
86 -  InternalPerform(Func,FuncInv,Pmin);
87 +  Handle(ChFiDS_HElSpine) anHGuide;
88 +  InternalPerform(Func,FuncInv,anHGuide,Pmin);
89  
90    iscomplete = Standard_True;
91    return Standard_True;
92 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/Blend_Walking_4.gxx OCCT-6.8.0_SRC-patch/inc/Blend_Walking_4.gxx
93 --- OCCT-6.8.0_SRC/inc/Blend_Walking_4.gxx      2014-11-11 17:46:43.000000000 +0300
94 +++ OCCT-6.8.0_SRC-patch/inc/Blend_Walking_4.gxx        2015-01-16 12:59:38.000000000 +0300
95 @@ -12,6 +12,8 @@
96  // Alternatively, this file may be used under the terms of Open CASCADE
97  // commercial license or contractual agreement.
98  
99 +#include <gce_MakePln.hxx>
100 +
101  static void evalpinit(math_Vector& parinit,
102                       const Blend_Point& previousP,
103                       const Standard_Real parprec,
104 @@ -65,6 +67,7 @@
105  
106  void Blend_Walking::InternalPerform(Blend_Function& Func,
107                                     Blend_FuncInv& FuncInv,
108 +                                    const Handle(ChFiDS_HElSpine)& HGuide,
109                                     const Standard_Real Bound)
110  {
111  
112 @@ -251,12 +254,64 @@
113           // avec les surfaces periodiques.
114           State = Blend_OnRst12;
115           param =  (w1+w2)/2;
116 +          gp_Pnt Pnt1, Pnt2;
117           p2d = TheArcTool::Value(recdomain1->Value(),solrst1(1));
118           sol(1) = p2d.X();
119           sol(2) = p2d.Y();
120 +          Pnt1 = TheSurfaceTool::Value(surf1,sol(1),sol(2));
121           p2d = TheArcTool::Value(recdomain2->Value(),solrst2(1));
122           sol(3) = p2d.X();
123           sol(4) = p2d.Y();
124 +          Pnt2 = TheSurfaceTool::Value(surf2,sol(3),sol(4));
125 +          if (!HGuide.IsNull())
126 +          {
127 +            const Standard_Real TolProd = 1.e-5;
128 +            Standard_Real SavedParams [2];
129 +            Standard_Boolean SameDirs [2] = {Standard_False, Standard_False};
130 +            ChFiDS_ElSpine& theElSpine = HGuide->ChangeCurve();
131 +            SavedParams[0] = theElSpine.GetSavedFirstParameter();
132 +            SavedParams[1] = theElSpine.GetSavedLastParameter();
133 +            for (Standard_Integer ind = 0; ind < 2; ind++)
134 +            {
135 +              if (!Precision::IsInfinite(SavedParams[ind]))
136 +              {
137 +                //Check the original first and last parameters of guide curve
138 +                //for equality to found parameter <param>:
139 +                //check equality of tangent to guide curve and
140 +                //normal to plane built on 3 points:
141 +                //point on guide curve and points on restrictions of adjacent
142 +                //surfaces.
143 +                gp_Pnt Pnt0;
144 +                gp_Vec Dir0;
145 +                HGuide->D1(SavedParams[ind], Pnt0, Dir0);
146 +                Standard_Real Length = Dir0.Magnitude();
147 +                if (Length <= gp::Resolution())
148 +                  continue;
149 +                Dir0 /= Length;
150 +                gce_MakePln PlaneBuilder(Pnt0, Pnt1, Pnt2);
151 +                if (!PlaneBuilder.IsDone())
152 +                  continue;
153 +                gp_Pln thePlane = PlaneBuilder.Value();
154 +                gp_Dir DirPlane = thePlane.Axis().Direction();
155 +                gp_Vec theProd = Dir0 ^ DirPlane;
156 +                Standard_Real ProdMod = theProd.Magnitude();
157 +                if (ProdMod <= TolProd)
158 +                  SameDirs[ind] = Standard_True;
159 +              }
160 +            }
161 +            Standard_Real theParam = Precision::Infinite();
162 +            //Choose the closest parameter
163 +            if (SameDirs[0] && SameDirs[1])
164 +              theParam = (Abs(param - SavedParams[0]) < Abs(param - SavedParams[1]))?
165 +                SavedParams[0] : SavedParams[1];
166 +            else if (SameDirs[0])
167 +              theParam = SavedParams[0];
168 +            else if (SameDirs[1])
169 +              theParam = SavedParams[1];
170 +            
171 +            if (!Precision::IsInfinite(theParam))
172 +              param = theParam;
173 +          }
174         }
175         else if (recad1) {
176           // sol sur 1
177 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/BRepBlend_Walking.hxx OCCT-6.8.0_SRC-patch/inc/BRepBlend_Walking.hxx
178 --- OCCT-6.8.0_SRC/inc/BRepBlend_Walking.hxx    2014-11-11 17:53:30.000000000 +0300
179 +++ OCCT-6.8.0_SRC-patch/inc/BRepBlend_Walking.hxx      2015-01-16 14:33:41.000000000 +0300
180 @@ -22,6 +22,7 @@
181  #include <Handle_Adaptor2d_HCurve2d.hxx>
182  #include <Handle_Adaptor3d_HCurve.hxx>
183  #include <Standard_Integer.hxx>
184 +#include <Handle_ChFiDS_HElSpine.hxx>
185  #include <TopAbs_State.hxx>
186  #include <Blend_Status.hxx>
187  class BRepBlend_Line;
188 @@ -41,6 +42,7 @@
189  class Blend_Point;
190  class Blend_Function;
191  class Blend_FuncInv;
192 +class ChFiDS_HElSpine;
193  class gp_Pnt2d;
194  class IntSurf_Transition;
195  
196 @@ -59,7 +61,7 @@
197    
198    Standard_EXPORT   void AddSingularPoint (const Blend_Point& P) ;
199    
200 -  Standard_EXPORT   void Perform (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False) ;
201 +  Standard_EXPORT   void Perform (Blend_Function& F, Blend_FuncInv& FInv, const Handle(ChFiDS_HElSpine)& HGuide, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False) ;
202    
203    Standard_EXPORT   Standard_Boolean PerformFirstSection (Blend_Function& F, const Standard_Real Pdep, math_Vector& ParDep, const Standard_Real Tolesp, const Standard_Real TolGuide, TopAbs_State& Pos1, TopAbs_State& Pos2) ;
204    
205 @@ -99,7 +101,7 @@
206  private:
207  
208    
209 -  Standard_EXPORT   void InternalPerform (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Bound) ;
210 +  Standard_EXPORT   void InternalPerform (Blend_Function& F, Blend_FuncInv& FInv, const Handle(ChFiDS_HElSpine)& HGuide, const Standard_Real Bound) ;
211    
212    Standard_EXPORT   Standard_Integer ArcToRecadre (const Standard_Boolean OnFirst, const math_Vector& Sol, const Standard_Integer PrevIndex, gp_Pnt2d& lpt2d, gp_Pnt2d& pt2d, Standard_Real& ponarc) ;
213    
214 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/ChFiDS_ElSpine.hxx OCCT-6.8.0_SRC-patch/inc/ChFiDS_ElSpine.hxx
215 --- OCCT-6.8.0_SRC/inc/ChFiDS_ElSpine.hxx       2014-11-11 17:53:46.000000000 +0300
216 +++ OCCT-6.8.0_SRC-patch/inc/ChFiDS_ElSpine.hxx 2015-01-16 14:33:58.000000000 +0300
217 @@ -56,6 +56,10 @@
218    
219    Standard_EXPORT virtual   Standard_Real LastParameter()  const;
220    
221 +  Standard_EXPORT   Standard_Real GetSavedFirstParameter()  const;
222 +  
223 +  Standard_EXPORT   Standard_Real GetSavedLastParameter()  const;
224 +  
225    Standard_EXPORT   GeomAbs_Shape Continuity()  const;
226    
227    Standard_EXPORT   Standard_Integer NbIntervals (const GeomAbs_Shape S) ;
228 @@ -91,6 +95,10 @@
229    
230    Standard_EXPORT   void LastParameter (const Standard_Real P) ;
231    
232 +  Standard_EXPORT   void SaveFirstParameter() ;
233 +  
234 +  Standard_EXPORT   void SaveLastParameter() ;
235 +  
236    Standard_EXPORT   void SetOrigin (const Standard_Real O) ;
237    
238    Standard_EXPORT   void FirstPointAndTgt (gp_Pnt& P, gp_Vec& T)  const;
239 @@ -149,6 +157,8 @@
240    Standard_Real plast;
241    Standard_Real period;
242    Standard_Boolean periodic;
243 +  Standard_Real pfirstsav;
244 +  Standard_Real plastsav;
245  
246  
247  };
248 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/Graphic3d_GraphicDriver.hxx OCCT-6.8.0_SRC-patch/inc/Graphic3d_GraphicDriver.hxx
249 --- OCCT-6.8.0_SRC/inc/Graphic3d_GraphicDriver.hxx      2014-11-11 17:54:46.000000000 +0300
250 +++ OCCT-6.8.0_SRC-patch/inc/Graphic3d_GraphicDriver.hxx        2015-01-16 14:34:57.000000000 +0300
251 @@ -130,9 +130,6 @@
252    //! call_togl_setvisualisation
253    Standard_EXPORT virtual   void SetVisualisation (const Graphic3d_CView& ACView)  = 0;
254    
255 -  //! call_togl_transparency
256 -  Standard_EXPORT virtual   void Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag)  = 0;
257 -  
258    //! call_togl_view
259    Standard_EXPORT virtual   Standard_Boolean View (Graphic3d_CView& ACView)  = 0;
260    
261 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/IntPatch_ImpImpIntersection_4.gxx OCCT-6.8.0_SRC-patch/inc/IntPatch_ImpImpIntersection_4.gxx
262 --- OCCT-6.8.0_SRC/inc/IntPatch_ImpImpIntersection_4.gxx        2014-11-11 17:46:54.000000000 +0300
263 +++ OCCT-6.8.0_SRC-patch/inc/IntPatch_ImpImpIntersection_4.gxx  2015-01-16 13:01:24.000000000 +0300
264 @@ -1151,6 +1151,7 @@
265                                          const Standard_Real theUlSurf1,
266                                          const Standard_Real thePeriodOfSurf1,
267                                          const Handle(IntSurf_LineOn2S)& theLine,
268 +                                        const Standard_Real theTol3D,
269                                          const Standard_Real theTol2D,
270                                          const Standard_Boolean theFlForce)
271  {
272 @@ -1177,6 +1178,32 @@
273                          thePntOnSurf2.X(), thePntOnSurf2.Y());
274    }
275  
276 +  const Standard_Integer aNbPnts = theLine->NbPoints();
277 +  if(aNbPnts > 0)
278 +  {
279 +    Standard_Real aUl = 0.0, aVl = 0.0;
280 +    const IntSurf_PntOn2S aPlast = theLine->Value(aNbPnts);
281 +    if(isTheReverse)
282 +      aPlast.ParametersOnS2(aUl, aVl);
283 +    else
284 +      aPlast.ParametersOnS1(aUl, aVl);
285 +
286 +    if(anUpar <= aUl)
287 +    {//Parameter value will be always increased.
288 +      return Standard_False;
289 +    }
290 +
291 +    //theTol2D is minimal step along parameter changed. 
292 +    //Therefore, if we apply this minimal step two 
293 +    //neighbour points will be always "same". Consequently,
294 +    //we should reduce tolerance for IsSame checking.
295 +    const Standard_Real aDTol = 1.0-Epsilon(1.0);
296 +    if(aPnt.IsSame(aPlast, theTol3D*aDTol, theTol2D*aDTol))
297 +    {
298 +      theLine->RemovePoint(aNbPnts);
299 +    }
300 +  }
301 +
302    theLine->Add(aPnt);
303    return Standard_True;
304  }
305 @@ -1191,6 +1218,7 @@
306                                            const stCoeffsValue& theCoeffs,
307                                            const Bnd_Box2d& theUVSurf1,
308                                            const Bnd_Box2d& theUVSurf2,
309 +                                          const Standard_Real theTol3D,
310                                            const Standard_Real theTol2D,
311                                            const Standard_Real thePeriod,
312                                            const Standard_Real theNulValue,
313 @@ -1281,7 +1309,7 @@
314          AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
315                            gp_Pnt2d(anUpar1, aV1), gp_Pnt2d(aU2, aV2),
316                            aUSurf1f, aUSurf1l, thePeriod,
317 -                          theWL->Curve(), theTol2D, theFlForce);
318 +                          theWL->Curve(), theTol3D, theTol2D, theFlForce);
319        }
320        else
321        {
322 @@ -1313,7 +1341,7 @@
323          AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
324                          gp_Pnt2d(anUpar2, aV1), gp_Pnt2d(aU2, aV2),
325                          aUSurf1f, aUSurf1l, thePeriod,
326 -                        theWL->Curve(), theTol2D, theFlForce);
327 +                        theWL->Curve(),theTol3D, theTol2D, theFlForce);
328        }
329        else
330        {
331 @@ -1346,7 +1374,7 @@
332          AddPointIntoWL(theQuad1, theQuad2, isTheReverse, 
333                          gp_Pnt2d(anUpar2, aV1), gp_Pnt2d(aU2, aV2),
334                          aUSurf1f, aUSurf1l, thePeriod,
335 -                        theWL->Curve(), theTol2D, theFlForce);
336 +                        theWL->Curve(), theTol3D, theTol2D, theFlForce);
337        }
338        else
339        {
340 @@ -1376,7 +1404,7 @@
341          AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
342                          gp_Pnt2d(anUpar1, aV1), gp_Pnt2d(aU2, aV2),
343                          aUSurf1f, aUSurf1l, thePeriod,
344 -                        theWL->Curve(), theTol2D, theFlForce);
345 +                        theWL->Curve(), theTol3D, theTol2D, theFlForce);
346        }
347        else
348        {
349 @@ -1545,7 +1573,8 @@
350    {
351      Standard_Real &a = theU1crit[i],
352                    &b = theU1crit[i-1];
353 -    if(Abs(a - b) < theTol2D)
354 +    const Standard_Real aRemain = fmod(Abs(a - b), thePeriod); // >= 0, because Abs(a - b) >= 0
355 +    if((Abs(a - b) < theTol2D) || (aRemain < theTol2D) || (Abs(aRemain - thePeriod) < theTol2D))
356      {
357        a = (a + b)/2.0;
358        b = Precision::Infinite();
359 @@ -1817,6 +1846,7 @@
360      Standard_Boolean isAddedIntoWL1 = Standard_False, isAddedIntoWL2 = Standard_False;
361  
362      Standard_Real anUf = aU1f[aCurInterval], anUl = aU1l[aCurInterval];
363 +    const Standard_Boolean isDeltaPeriod  = IsEqual(anUl-anUf, aPeriod);
364  
365      //Inscribe and sort critical points
366      InscribeAndSortArray(anU1crit, aNbCritPointsMax, anUf, anUl, theTol2D, aPeriod);
367 @@ -1830,6 +1860,8 @@
368        Handle(IntPatch_WLine) aWLine2 = new IntPatch_WLine(aL2S2, Standard_False);
369  
370        Standard_Integer aWL1FindStatus = 0, aWL2FindStatus = 0;
371 +      Standard_Boolean  isAddingWL1Enabled = Standard_True,
372 +                        isAddingWL2Enabled = Standard_True;
373  
374        Standard_Real anU1 = anUf;
375  
376 @@ -1845,6 +1877,23 @@
377  
378        while(anU1 <= anUl)
379        {
380 +        if(isDeltaPeriod)
381 +        {
382 +          if(IsEqual(anU1, anUl))
383 +          {
384 +            //if isAddedIntoWL* == TRUE WLine contains only one point
385 +            //(which was end point of previous WLine). If we will
386 +            //add point found on the current step WLine will contain only
387 +            //two points. At that both these points will be equal to the
388 +            //points found earlier. Therefore, new WLine will repeat 
389 +            //already existing WLine. Consequently, it is necessary 
390 +            //to forbid building new line in this case.
391 +
392 +            isAddingWL1Enabled = !isAddedIntoWL1;
393 +            isAddingWL2Enabled = !isAddedIntoWL2;
394 +          }
395 +        }
396 +
397          for(Standard_Integer i = 0; i < aNbCritPointsMax; i++)
398          {
399            if((anU1 - anU1crit[i])*aCriticalDelta[i] < 0.0)
400 @@ -1995,123 +2044,129 @@
401            isFirst = Standard_False;
402          }
403  
404 -        if( ((aUSurf2f-aU21) <= theTol2D) && 
405 -            ((aU21-aUSurf2l) <= theTol2D) &&
406 -            ((aVSurf1f - aV11) <= theTol2D) && 
407 -            ((aV11 - aVSurf1l) <= theTol2D) &&
408 -            ((aVSurf2f - aV21) <= theTol2D) && ((aV21 - aVSurf2l) <= theTol2D))
409 +        if(isAddingWL1Enabled)
410          {
411 -          Standard_Boolean isForce = Standard_False;
412 -          if(!aWL1FindStatus)
413 +          if( ((aUSurf2f-aU21) <= theTol2D) && 
414 +              ((aU21-aUSurf2l) <= theTol2D) &&
415 +              ((aVSurf1f - aV11) <= theTol2D) && 
416 +              ((aV11 - aVSurf1l) <= theTol2D) &&
417 +              ((aVSurf2f - aV21) <= theTol2D) && ((aV21 - aVSurf2l) <= theTol2D))
418            {
419 -            Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
420 -
421 -            if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
422 +            Standard_Boolean isForce = Standard_False;
423 +            if(!aWL1FindStatus)
424              {
425 -              isForce = Standard_True;
426 -            }
427 +              Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
428  
429 -            AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
430 -                              theUVSurf1, theUVSurf2, theTol2D, aPeriod,
431 -                              aNulValue, anU1, aU21, aV11, aV11Prev,
432 -                              aV21, aV21Prev, isTheReverse,
433 -                              1.0, isForce, isFound1, isFound2);
434 +              if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
435 +              {
436 +                isForce = Standard_True;
437 +              }
438 +
439 +              AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
440 +                                theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
441 +                                aNulValue, anU1, aU21, aV11, aV11Prev,
442 +                                aV21, aV21Prev, isTheReverse,
443 +                                1.0, isForce, isFound1, isFound2);
444                
445 -            if(isFound1 || isFound2)
446 -            {
447 -              aWL1FindStatus = 1;
448 +              if(isFound1 || isFound2)
449 +              {
450 +                aWL1FindStatus = 1;
451 +              }
452              }
453 -          }
454  
455 -          if((aWL1FindStatus != 2) || (aWLine1->NbPnts() >= 1))
456 -          {
457 -            if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse, 
458 -                  gp_Pnt2d(anU1, aV11), gp_Pnt2d(aU21, aV21),
459 -                  aUSurf1f, aUSurf1l, aPeriod,
460 -                  aWLine1->Curve(), theTol2D, isForce))
461 +            if((aWL1FindStatus != 2) || (aWLine1->NbPnts() >= 1))
462              {
463 -              if(!aWL1FindStatus)
464 +              if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse, 
465 +                    gp_Pnt2d(anU1, aV11), gp_Pnt2d(aU21, aV21),
466 +                    aUSurf1f, aUSurf1l, aPeriod,
467 +                    aWLine1->Curve(), theTol3D, theTol2D, isForce))
468                {
469 -                aWL1FindStatus = 1;
470 +                if(!aWL1FindStatus)
471 +                {
472 +                  aWL1FindStatus = 1;
473 +                }
474                }
475              }
476            }
477 -        }
478 -        else
479 -        {
480 -          if(aWL1FindStatus == 1)
481 +          else
482            {
483 -            Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
484 +            if(aWL1FindStatus == 1)
485 +            {
486 +              Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
487  
488 -            AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
489 -                              theUVSurf1, theUVSurf2, theTol2D, aPeriod,
490 -                              aNulValue, anU1, aU21, aV11, aV11Prev,
491 -                              aV21, aV21Prev, isTheReverse,
492 -                              1.0, Standard_False, isFound1, isFound2);
493 +              AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
494 +                                theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
495 +                                aNulValue, anU1, aU21, aV11, aV11Prev,
496 +                                aV21, aV21Prev, isTheReverse,
497 +                                1.0, Standard_False, isFound1, isFound2);
498  
499 -            if(isFound1 || isFound2)
500 -              aWL1FindStatus = 2; //start a new line
501 +              if(isFound1 || isFound2)
502 +                aWL1FindStatus = 2; //start a new line
503 +            }
504            }
505          }
506 -      
507 -        if( ((aUSurf2f-aU22) <= theTol2D) &&
508 -            ((aU22-aUSurf2l) <= theTol2D) && 
509 -            ((aVSurf1f - aV12) <= theTol2D) &&
510 -            ((aV12 - aVSurf1l) <= theTol2D) &&
511 -            ((aVSurf2f - aV22) <= theTol2D) &&
512 -            ((aV22 - aVSurf2l) <= theTol2D))
513 +        
514 +        if(isAddingWL2Enabled)
515          {
516 -          Standard_Boolean isForce = Standard_False;
517 -
518 -          if(!aWL2FindStatus)
519 +          if( ((aUSurf2f-aU22) <= theTol2D) &&
520 +              ((aU22-aUSurf2l) <= theTol2D) && 
521 +              ((aVSurf1f - aV12) <= theTol2D) &&
522 +              ((aV12 - aVSurf1l) <= theTol2D) &&
523 +              ((aVSurf2f - aV22) <= theTol2D) &&
524 +              ((aV22 - aVSurf2l) <= theTol2D))
525            {
526 -            Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
527 +            Standard_Boolean isForce = Standard_False;
528  
529 -            if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
530 +            if(!aWL2FindStatus)
531              {
532 -              isForce = Standard_True;
533 -            }
534 +              Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
535  
536 -            AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
537 -                              theUVSurf1, theUVSurf2, theTol2D, aPeriod,
538 -                              aNulValue, anU1, aU22, aV12, aV12Prev,
539 -                              aV22, aV22Prev, isTheReverse,
540 -                              -1.0, isForce, isFound1, isFound2);
541 +              if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
542 +              {
543 +                isForce = Standard_True;
544 +              }
545 +
546 +              AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
547 +                                theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
548 +                                aNulValue, anU1, aU22, aV12, aV12Prev,
549 +                                aV22, aV22Prev, isTheReverse,
550 +                                -1.0, isForce, isFound1, isFound2);
551                
552 -            if(isFound1 || isFound2)
553 -            {
554 -              aWL2FindStatus = 1;
555 +              if(isFound1 || isFound2)
556 +              {
557 +                aWL2FindStatus = 1;
558 +              }
559              }
560 -          }
561  
562 -          if((aWL2FindStatus != 2) || (aWLine2->NbPnts() >= 1))
563 -          {
564 -            if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
565 -                  gp_Pnt2d(anU1, aV12), gp_Pnt2d(aU22, aV22),
566 -                  aUSurf1f, aUSurf1l, aPeriod,
567 -                  aWLine2->Curve(), theTol2D, isForce))
568 +            if((aWL2FindStatus != 2) || (aWLine2->NbPnts() >= 1))
569              {
570 -              if(!aWL2FindStatus)
571 +              if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
572 +                    gp_Pnt2d(anU1, aV12), gp_Pnt2d(aU22, aV22),
573 +                    aUSurf1f, aUSurf1l, aPeriod,
574 +                    aWLine2->Curve(), theTol3D, theTol2D, isForce))
575                {
576 -                aWL2FindStatus = 1;
577 +                if(!aWL2FindStatus)
578 +                {
579 +                  aWL2FindStatus = 1;
580 +                }
581                }
582              }
583            }
584 -        }
585 -        else
586 -        {
587 -          if(aWL2FindStatus == 1)
588 +          else
589            {
590 -            Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
591 +            if(aWL2FindStatus == 1)
592 +            {
593 +              Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
594  
595 -            AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
596 -                              theUVSurf1, theUVSurf2, theTol2D, aPeriod,
597 -                              aNulValue, anU1, aU22, aV12, aV12Prev,
598 -                              aV22, aV22Prev, isTheReverse,
599 -                              -1.0, Standard_False, isFound1, isFound2);
600 +              AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
601 +                                theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
602 +                                aNulValue, anU1, aU22, aV12, aV12Prev,
603 +                                aV22, aV22Prev, isTheReverse,
604 +                                -1.0, Standard_False, isFound1, isFound2);
605  
606 -            if(isFound1 || isFound2)
607 -              aWL2FindStatus = 2; //start a new line
608 +              if(isFound1 || isFound2)
609 +                aWL2FindStatus = 2; //start a new line
610 +            }
611            }
612          }
613  
614 @@ -2237,15 +2292,29 @@
615        }
616        else if(aWLine1->NbPnts() > 1)
617        {
618 -        isTheEmpty = Standard_False;
619 -        isAddedIntoWL1 = Standard_True;
620 +        Standard_Boolean isGood = Standard_True;
621 +
622 +        if(aWLine1->NbPnts() == 2)
623 +        {
624 +          const IntSurf_PntOn2S& aPf = aWLine1->Point(1);
625 +          const IntSurf_PntOn2S& aPl = aWLine1->Point(2);
626  
627 -        SeekAdditionalPoints(theQuad1, theQuad2, aWLine1->Curve(), 
628 -                              anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
629 -                              theTol2D, aPeriod, 1.0, isTheReverse);
630 +          if(aPf.IsSame(aPl, Precision::Confusion()))
631 +            isGood = Standard_False;
632 +        }
633  
634 -        aWLine1->ComputeVertexParameters(theTol3D);
635 -        theSlin.Append(aWLine1);
636 +        if(isGood)
637 +        {
638 +          isTheEmpty = Standard_False;
639 +          isAddedIntoWL1 = Standard_True;
640 +
641 +          SeekAdditionalPoints( theQuad1, theQuad2, aWLine1->Curve(), 
642 +                                anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
643 +                                theTol2D, aPeriod, 1.0, isTheReverse);
644 +
645 +          aWLine1->ComputeVertexParameters(theTol3D);
646 +          theSlin.Append(aWLine1);
647 +        }
648        }
649        else
650        {
651 @@ -2267,15 +2336,28 @@
652        }
653        else if(aWLine2->NbPnts() > 1)
654        {
655 -        isTheEmpty = Standard_False;
656 -        isAddedIntoWL2 = Standard_True;
657 +        Standard_Boolean isGood = Standard_True;
658 +        if(aWLine2->NbPnts() == 2)
659 +        {
660 +          const IntSurf_PntOn2S& aPf = aWLine2->Point(1);
661 +          const IntSurf_PntOn2S& aPl = aWLine2->Point(2);
662 +
663 +          if(aPf.IsSame(aPl, Precision::Confusion()))
664 +            isGood = Standard_False;
665 +        }
666  
667 -        SeekAdditionalPoints(theQuad1, theQuad2, aWLine2->Curve(),
668 -                              anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
669 -                              theTol2D, aPeriod, -1.0, isTheReverse);
670 +        if(isGood)
671 +        {
672 +          isTheEmpty = Standard_False;
673 +          isAddedIntoWL2 = Standard_True;
674  
675 -        aWLine2->ComputeVertexParameters(theTol3D);
676 -        theSlin.Append(aWLine2);
677 +          SeekAdditionalPoints(theQuad1, theQuad2, aWLine2->Curve(),
678 +                                anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
679 +                                theTol2D, aPeriod, -1.0, isTheReverse);
680 +
681 +          aWLine2->ComputeVertexParameters(theTol3D);
682 +          theSlin.Append(aWLine2);
683 +        }
684        }
685        else
686        {
687 @@ -2284,6 +2366,203 @@
688      }
689    }
690  
691 +  if(theSlin.Length() > 0)
692 +  {
693 +    for(Standard_Integer aNumOfLine = 2; aNumOfLine <= theSlin.Length(); aNumOfLine++)
694 +    {
695 +      const Handle(IntPatch_WLine)& aWLine = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine));
696 +
697 +      const IntSurf_PntOn2S& aPntFWL = aWLine->Point(1);
698 +
699 +      Standard_Real aU1 = 0.0, aU2 = 0.0, aV1 = 0.0, aV2 = 0.0;
700 +      aPntFWL.Parameters(aU1, aV1, aU2, aV2);
701 +
702 +      if( IsEqual(aU1, 0.0) || IsEqual(aU1, aPeriod))
703 +      {
704 +        theSlin.Exchange(1, aNumOfLine);
705 +        break;
706 +      }
707 +    }
708 +
709 +    for(Standard_Integer aNumOfLine1 = 1; aNumOfLine1 <= theSlin.Length(); aNumOfLine1++)
710 +    {
711 +      const Handle(IntPatch_WLine)& aWLine1 = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine1));
712 +
713 +      const Standard_Integer aNbPntsWL1 = aWLine1->NbPnts();
714 +      const IntSurf_PntOn2S& aPntFWL1 = aWLine1->Point(1);
715 +      const IntSurf_PntOn2S& aPntLWL1 = aWLine1->Point(aNbPntsWL1);
716 +
717 +      for(Standard_Integer aNPt = 1; aNPt <= theSPnt.Length(); aNPt++)
718 +      {
719 +        const IntSurf_PntOn2S aPntCur = theSPnt.Value(aNPt).PntOn2S();
720 +
721 +        if( aPntCur.IsSame(aPntFWL1, Precision::Confusion()) ||
722 +            aPntCur.IsSame(aPntLWL1, Precision::Confusion()))
723 +        {
724 +          theSPnt.Remove(aNPt);
725 +          aNPt--;
726 +        }
727 +      }
728 +
729 +      Standard_Boolean hasBeenRemoved = Standard_False;
730 +      for(Standard_Integer aNumOfLine2 = aNumOfLine1 + 1; aNumOfLine2 <= theSlin.Length(); aNumOfLine2++)
731 +      {
732 +        const Handle(IntPatch_WLine)& aWLine2 = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine2));
733 +
734 +        const Standard_Integer aNbPntsWL1 = aWLine1->NbPnts();
735 +        const Standard_Integer aNbPntsWL2 = aWLine2->NbPnts();
736 +
737 +        const IntSurf_PntOn2S& aPntFWL1 = aWLine1->Point(1);
738 +        const IntSurf_PntOn2S& aPntLWL1 = aWLine1->Point(aNbPntsWL1);
739 +
740 +        const IntSurf_PntOn2S& aPntFWL2 = aWLine2->Point(1);
741 +        const IntSurf_PntOn2S& aPntLWL2 = aWLine2->Point(aNbPntsWL2);
742 +
743 +        if(aPntFWL1.IsSame(aPntFWL2, Precision::Confusion()))
744 +        {
745 +          Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0;
746 +          Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0;
747 +
748 +          aPntFWL1.Parameters(aU11, aV11, aU12, aV12);
749 +          aPntFWL2.Parameters(aU21, aV21, aU22, aV22);
750 +
751 +          if( !(IsEqual(fmod(aU11, aPeriod), 0.0) ||
752 +                IsEqual(fmod(aU12, aPeriod), 0.0) ||
753 +                IsEqual(fmod(aU21, aPeriod), 0.0) ||
754 +                IsEqual(fmod(aU22, aPeriod), 0.0) ||
755 +                IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) ||
756 +                IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) ||
757 +                IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) ||
758 +                IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l)))
759 +          {
760 +            aWLine1->ClearVertexes();
761 +            for(Standard_Integer aNPt = 1; aNPt <= aNbPntsWL2; aNPt++)
762 +            {
763 +              const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt);
764 +              aWLine1->Curve()->InsertBefore(1, aPt);
765 +            }
766 +
767 +            aWLine1->ComputeVertexParameters(theTol3D);
768 +
769 +            theSlin.Remove(aNumOfLine2);
770 +            aNumOfLine2--;
771 +            hasBeenRemoved = Standard_True;
772 +
773 +            continue;
774 +          }
775 +        }
776 +
777 +        if(aPntFWL1.IsSame(aPntLWL2, Precision::Confusion()))
778 +        {
779 +          Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0;
780 +          Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0;
781 +
782 +          aPntFWL1.Parameters(aU11, aV11, aU12, aV12);
783 +          aPntLWL2.Parameters(aU21, aV21, aU22, aV22);
784 +
785 +          if( !(IsEqual(fmod(aU11, aPeriod), 0.0) ||
786 +                IsEqual(fmod(aU12, aPeriod), 0.0) ||
787 +                IsEqual(fmod(aU21, aPeriod), 0.0) ||
788 +                IsEqual(fmod(aU22, aPeriod), 0.0) ||
789 +                IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) ||
790 +                IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) ||
791 +                IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) ||
792 +                IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l)))
793 +          {
794 +            aWLine1->ClearVertexes();
795 +            for(Standard_Integer aNPt = aNbPntsWL2; aNPt >= 1; aNPt--)
796 +            {
797 +              const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt);
798 +              aWLine1->Curve()->InsertBefore(1, aPt);
799 +            }
800 +
801 +            aWLine1->ComputeVertexParameters(theTol3D);
802 +
803 +            theSlin.Remove(aNumOfLine2);
804 +            aNumOfLine2--;
805 +            hasBeenRemoved = Standard_True;
806 +
807 +            continue;
808 +          }
809 +        }
810 +
811 +        if(aPntLWL1.IsSame(aPntFWL2, Precision::Confusion()))
812 +        {
813 +          Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0;
814 +          Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0;
815 +
816 +          aPntLWL1.Parameters(aU11, aV11, aU12, aV12);
817 +          aPntFWL2.Parameters(aU21, aV21, aU22, aV22);
818 +
819 +          if( !(IsEqual(fmod(aU11, aPeriod), 0.0) ||
820 +                IsEqual(fmod(aU12, aPeriod), 0.0) ||
821 +                IsEqual(fmod(aU21, aPeriod), 0.0) ||
822 +                IsEqual(fmod(aU22, aPeriod), 0.0) ||
823 +                IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) ||
824 +                IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) ||
825 +                IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) ||
826 +                IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l)))
827 +          {
828 +            aWLine1->ClearVertexes();
829 +            for(Standard_Integer aNPt = 1; aNPt <= aNbPntsWL2; aNPt++)
830 +            {
831 +              const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt);
832 +              aWLine1->Curve()->Add(aPt);
833 +            }
834 +
835 +            aWLine1->ComputeVertexParameters(theTol3D);
836 +
837 +            theSlin.Remove(aNumOfLine2);
838 +            aNumOfLine2--;
839 +            hasBeenRemoved = Standard_True;
840 +
841 +            continue;
842 +          }
843 +        }
844 +
845 +        if(aPntLWL1.IsSame(aPntLWL2, Precision::Confusion()))
846 +        {
847 +          Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0;
848 +          Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0;
849 +
850 +          aPntLWL1.Parameters(aU11, aV11, aU12, aV12);
851 +          aPntLWL2.Parameters(aU21, aV21, aU22, aV22);
852 +
853 +          if( !(IsEqual(fmod(aU11, aPeriod), 0.0) ||
854 +                IsEqual(fmod(aU12, aPeriod), 0.0) ||
855 +                IsEqual(fmod(aU21, aPeriod), 0.0) ||
856 +                IsEqual(fmod(aU22, aPeriod), 0.0) ||
857 +                IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) ||
858 +                IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) ||
859 +                IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) ||
860 +                IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l)))
861 +          {
862 +            aWLine1->ClearVertexes();
863 +            for(Standard_Integer aNPt = aNbPntsWL2; aNPt >= 1; aNPt--)
864 +            {
865 +              const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt);
866 +              aWLine1->Curve()->Add(aPt);
867 +            }
868 +
869 +            aWLine1->ComputeVertexParameters(theTol3D);
870 +
871 +            theSlin.Remove(aNumOfLine2);
872 +            aNumOfLine2--;
873 +            hasBeenRemoved = Standard_True;
874 +
875 +            continue;
876 +          }
877 +        }
878 +      }
879 +
880 +      if(hasBeenRemoved)
881 +        aNumOfLine1--;
882 +
883 +      //aWLine1->ComputeVertexParameters(theTol3D);
884 +    }
885 +  }//if(theSlin.Length() > 0)
886 +
887 +
888    return Standard_True;
889  }
890  
891 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/IntPatch_WLine.hxx OCCT-6.8.0_SRC-patch/inc/IntPatch_WLine.hxx
892 --- OCCT-6.8.0_SRC/inc/IntPatch_WLine.hxx       2014-11-11 17:54:07.000000000 +0300
893 +++ OCCT-6.8.0_SRC-patch/inc/IntPatch_WLine.hxx 2015-01-16 14:34:19.000000000 +0300
894 @@ -138,6 +138,12 @@
895    
896    Standard_EXPORT  const  Handle(Adaptor2d_HCurve2d)& GetArcOnS2()  const;
897    
898 +  Standard_EXPORT   void ClearVertexes() ;
899 +  
900 +  Standard_EXPORT   void RemoveVertex (const Standard_Integer theIndex) ;
901 +  
902 +  Standard_EXPORT   void InsertVertexBefore (const Standard_Integer theIndex, const IntPatch_Point& thePnt) ;
903 +  
904    Standard_EXPORT   void Dump()  const;
905  
906  
907 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/IntPatch_WLine.lxx OCCT-6.8.0_SRC-patch/inc/IntPatch_WLine.lxx
908 --- OCCT-6.8.0_SRC/inc/IntPatch_WLine.lxx       2014-11-11 17:46:54.000000000 +0300
909 +++ OCCT-6.8.0_SRC-patch/inc/IntPatch_WLine.lxx 2015-01-16 12:59:50.000000000 +0300
910 @@ -97,3 +97,27 @@
911  {
912    return svtx(Index);
913  }
914 +
915 +inline void IntPatch_WLine::ClearVertexes()
916 +{
917 +  svtx.Clear();
918 +}
919 +
920 +inline void IntPatch_WLine::RemoveVertex(const Standard_Integer theIndex)
921 +{
922 +  if((theIndex < 1) || (theIndex > NbVertex()))
923 +    Standard_OutOfRange::Raise("Cannot delete not existing vertex");
924 +  svtx.Remove(theIndex);
925 +}
926 +
927 +inline void IntPatch_WLine::InsertVertexBefore( const Standard_Integer theIndex,
928 +                                                const IntPatch_Point& thePnt)
929 +{
930 +  const Standard_Integer aNbVertexes = NbVertex();
931 +  Standard_Integer anIndex = Max(theIndex, 1);
932 +
933 +  if(anIndex > aNbVertexes)
934 +    svtx.Append(thePnt);
935 +  else
936 +    svtx.InsertBefore(theIndex, thePnt);
937 +}
938 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/IntSurf_PntOn2S.hxx OCCT-6.8.0_SRC-patch/inc/IntSurf_PntOn2S.hxx
939 --- OCCT-6.8.0_SRC/inc/IntSurf_PntOn2S.hxx      2014-11-11 17:54:10.000000000 +0300
940 +++ OCCT-6.8.0_SRC-patch/inc/IntSurf_PntOn2S.hxx        2015-01-16 14:34:22.000000000 +0300
941 @@ -60,6 +60,11 @@
942    
943    //! Returns the parameters of the point on both surfaces.
944        void Parameters (Standard_Real& U1, Standard_Real& V1, Standard_Real& U2, Standard_Real& V2)  const;
945 +  
946 +  //! Returns TRUE if 2D- and 3D-coordinates of theOterPoint are equal to
947 +  //! corresponding coordinates of me (with given tolerance).
948 +  //! If theTol2D == 0.0 we will compare 3D-points only.
949 +  Standard_EXPORT   Standard_Boolean IsSame (const IntSurf_PntOn2S& theOterPoint, const Standard_Real theTol3D = 0.0, const Standard_Real theTol2D = 0.0)  const;
950  
951  
952  
953 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/OpenGl_GraphicDriver.hxx OCCT-6.8.0_SRC-patch/inc/OpenGl_GraphicDriver.hxx
954 --- OCCT-6.8.0_SRC/inc/OpenGl_GraphicDriver.hxx 2014-11-11 17:46:58.000000000 +0300
955 +++ OCCT-6.8.0_SRC-patch/inc/OpenGl_GraphicDriver.hxx   2015-01-16 13:01:24.000000000 +0300
956 @@ -167,7 +167,6 @@
957    Standard_EXPORT void SetClipPlanes (const Graphic3d_CView& theCView);
958    Standard_EXPORT void SetCamera (const Graphic3d_CView& theCView);
959    Standard_EXPORT void SetVisualisation (const Graphic3d_CView& ACView);
960 -  Standard_EXPORT void Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag);
961    Standard_EXPORT Standard_Boolean View (Graphic3d_CView& ACView);
962    Standard_EXPORT void Environment (const Graphic3d_CView& ACView);
963    Standard_EXPORT void ZBufferTriedronSetup (const Quantity_NameOfColor XColor = Quantity_NOC_RED, const Quantity_NameOfColor YColor = Quantity_NOC_GREEN, const Quantity_NameOfColor ZColor = Quantity_NOC_BLUE1, const Standard_Real SizeRatio = 0.8, const Standard_Real AxisDiametr = 0.05, const Standard_Integer NbFacettes = 12);
964 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/OpenGl_Workspace.hxx OCCT-6.8.0_SRC-patch/inc/OpenGl_Workspace.hxx
965 --- OCCT-6.8.0_SRC/inc/OpenGl_Workspace.hxx     2014-11-11 17:46:58.000000000 +0300
966 +++ OCCT-6.8.0_SRC-patch/inc/OpenGl_Workspace.hxx       2015-01-16 13:01:24.000000000 +0300
967 @@ -184,7 +184,6 @@
968                                 Image_PixMap&               theImage,
969                                 const Graphic3d_BufferType& theBufferType);
970  
971 -  void UseTransparency (const Standard_Boolean theFlag);
972    Standard_Boolean& UseZBuffer()   { return myUseZBuffer; }
973    Standard_Boolean& UseDepthTest() { return myUseDepthTest; }
974    Standard_Boolean& UseGLLight()   { return myUseGLLight; }
975 @@ -671,7 +670,6 @@
976    Standard_Boolean       myTransientDrawToFront; //!< optimization flag for immediate mode (to render directly to the front buffer)
977    Standard_Boolean       myBackBufferRestored;
978    Standard_Boolean       myIsImmediateDrawn;     //!< flag indicates that immediate mode buffer contains some data
979 -  Standard_Boolean       myUseTransparency;
980    Standard_Boolean       myUseZBuffer;
981    Standard_Boolean       myUseDepthTest;
982    Standard_Boolean       myUseGLLight;
983 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/ShapeFix_Shape.hxx OCCT-6.8.0_SRC-patch/inc/ShapeFix_Shape.hxx
984 --- OCCT-6.8.0_SRC/inc/ShapeFix_Shape.hxx       2014-11-11 17:54:25.000000000 +0300
985 +++ OCCT-6.8.0_SRC-patch/inc/ShapeFix_Shape.hxx 2015-01-16 14:34:37.000000000 +0300
986 @@ -116,6 +116,10 @@
987    //! Returns (modifiable) the mode for applying
988    //! ShapeFix::FixVertexPosition before all fixes, by default False.
989        Standard_Integer& FixVertexPositionMode() ;
990 +  
991 +  //! Returns (modifiable) the mode for fixing tolerances of vertices on whole shape
992 +  //! after performing all fixes
993 +      Standard_Integer& FixVertexTolMode() ;
994  
995  
996  
997 @@ -139,6 +143,7 @@
998    Standard_Integer myFixWireMode;
999    Standard_Integer myFixSameParameterMode;
1000    Standard_Integer myFixVertexPositionMode;
1001 +  Standard_Integer myFixVertexTolMode;
1002    Standard_Integer myStatus;
1003  
1004  
1005 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/ShapeFix_Shape.lxx OCCT-6.8.0_SRC-patch/inc/ShapeFix_Shape.lxx
1006 --- OCCT-6.8.0_SRC/inc/ShapeFix_Shape.lxx       2014-11-11 17:47:05.000000000 +0300
1007 +++ OCCT-6.8.0_SRC-patch/inc/ShapeFix_Shape.lxx 2015-01-16 13:00:03.000000000 +0300
1008 @@ -122,3 +122,13 @@
1009  {
1010    return myFixVertexPositionMode;
1011  }
1012 +
1013 +//=======================================================================
1014 +//function : FixVertexTolMode
1015 +//purpose  : 
1016 +//=======================================================================
1017 +
1018 +inline Standard_Integer& ShapeFix_Shape::FixVertexTolMode() 
1019 +{
1020 +  return myFixVertexTolMode;
1021 +}
1022 \ No newline at end of file
1023 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/V3d_View.hxx OCCT-6.8.0_SRC-patch/inc/V3d_View.hxx
1024 --- OCCT-6.8.0_SRC/inc/V3d_View.hxx     2014-11-11 17:54:58.000000000 +0300
1025 +++ OCCT-6.8.0_SRC-patch/inc/V3d_View.hxx       2015-01-16 14:35:09.000000000 +0300
1026 @@ -308,9 +308,6 @@
1027    //! Returns TRUE when the light is active in this view.
1028    Standard_EXPORT   Standard_Boolean IsActiveLight (const Handle(V3d_Light)& aLight)  const;
1029    
1030 -  //! Activate/Deactivate the transparency in this view.
1031 -  Standard_EXPORT   void SetTransparency (const Standard_Boolean AnActivity = Standard_False) ;
1032 -  
1033    //! sets the immediate update mode and returns the previous one.
1034    Standard_EXPORT   Standard_Boolean SetImmediateUpdate (const Standard_Boolean theImmediateUpdate) ;
1035    
1036 @@ -704,9 +701,6 @@
1037    
1038    Standard_EXPORT   Handle(Graphic3d_TextureEnv) TextureEnv()  const;
1039    
1040 -  //! Returns the transparency activity.
1041 -  Standard_EXPORT   Standard_Boolean Transparency()  const;
1042 -  
1043    //! Returns the current visualisation mode.
1044    Standard_EXPORT   V3d_TypeOfVisualization Visualization()  const;
1045    
1046 @@ -1075,7 +1069,6 @@
1047    TColStd_Array2OfReal MyTrsf;
1048    Handle(Graphic3d_Structure) MyGridEchoStructure;
1049    Handle(Graphic3d_Group) MyGridEchoGroup;
1050 -  Standard_Boolean MyTransparencyFlag;
1051    Graphic3d_Vector myXscreenAxis;
1052    Graphic3d_Vector myYscreenAxis;
1053    Graphic3d_Vector myZscreenAxis;
1054 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/Visual3d_View.hxx OCCT-6.8.0_SRC-patch/inc/Visual3d_View.hxx
1055 --- OCCT-6.8.0_SRC/inc/Visual3d_View.hxx        2014-11-11 17:54:59.000000000 +0300
1056 +++ OCCT-6.8.0_SRC-patch/inc/Visual3d_View.hxx  2015-01-16 14:35:10.000000000 +0300
1057 @@ -478,11 +478,6 @@
1058    //! Warning: Works only under Windows.
1059    Standard_EXPORT   Standard_Boolean Print (const Aspect_Handle hPrnDC, const Standard_Boolean showBackground, const Standard_CString filename, const Aspect_PrintAlgo printAlgorithm = Aspect_PA_STRETCH, const Standard_Real theScaleFactor = 1.0)  const;
1060    
1061 -  //! if <AFlag> is Standard_True then the transparency
1062 -  //! is managed in the view <me>.
1063 -  //! Default Standard_False
1064 -  Standard_EXPORT   void SetTransparency (const Standard_Boolean AFlag) ;
1065 -  
1066    //! Returns Standard_True if the ZBuffer is activated
1067    //! in the view <me> and Standard_False if not.
1068    Standard_EXPORT   Standard_Boolean ZBufferIsActivated()  const;
1069 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/inc/Visual3d_ViewManager.hxx OCCT-6.8.0_SRC-patch/inc/Visual3d_ViewManager.hxx
1070 --- OCCT-6.8.0_SRC/inc/Visual3d_ViewManager.hxx 2014-11-11 17:54:59.000000000 +0300
1071 +++ OCCT-6.8.0_SRC-patch/inc/Visual3d_ViewManager.hxx   2015-01-16 14:35:10.000000000 +0300
1072 @@ -200,16 +200,6 @@
1073    //! if <AStructure> is displayed in <AProjector> and TOS_COMPUTED.
1074    Standard_EXPORT   void ReCompute (const Handle(Graphic3d_Structure)& AStructure, const Handle(Graphic3d_DataStructureManager)& AProjector) ;
1075    
1076 -  //! Returns Standard_True if the transparency
1077 -  //! is activated in all activated views.
1078 -  //! Default Standard_False
1079 -  Standard_EXPORT   Standard_Boolean Transparency()  const;
1080 -  
1081 -  //! if <AFlag> is Standard_True then the transparency
1082 -  //! is managed.
1083 -  //! Default Standard_False
1084 -  Standard_EXPORT   void SetTransparency (const Standard_Boolean AFlag) ;
1085 -  
1086    //! Returns Standard_True if the zbuffer activity
1087    //! is managed automatically.
1088    //! Default Standard_False
1089 @@ -251,7 +241,6 @@
1090    Aspect_GenId MyViewGenId;
1091    Handle(Graphic3d_GraphicDriver) MyGraphicDriver;
1092    Standard_Boolean MyZBufferAuto;
1093 -  Standard_Boolean MyTransparency;
1094    TColStd_MapOfInteger myLayerIds;
1095    TColStd_SequenceOfInteger myLayerSeq;
1096    Visual3d_MapOfZLayerSettings myMapOfZLayerSettings;
1097 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/samples/qt/VoxelDemo/src/Viewer.cpp OCCT-6.8.0_SRC-patch/samples/qt/VoxelDemo/src/Viewer.cpp
1098 --- OCCT-6.8.0_SRC/samples/qt/VoxelDemo/src/Viewer.cpp  2014-11-11 17:46:38.000000000 +0300
1099 +++ OCCT-6.8.0_SRC-patch/samples/qt/VoxelDemo/src/Viewer.cpp    2015-01-16 12:59:32.000000000 +0300
1100 @@ -51,7 +51,6 @@
1101  
1102      myView->MustBeResized();
1103      myView->SetSurfaceDetail(V3d_TEX_NONE);
1104 -    myView->SetTransparency(Standard_True);
1105      myView->SetSize(10000.0);
1106      myView->SetZSize(10000.0);
1107      myView->SetViewMappingDefault();
1108 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/AIS/AIS_InteractiveContext.cdl OCCT-6.8.0_SRC-patch/src/AIS/AIS_InteractiveContext.cdl
1109 --- OCCT-6.8.0_SRC/src/AIS/AIS_InteractiveContext.cdl   2014-11-11 17:46:38.000000000 +0300
1110 +++ OCCT-6.8.0_SRC-patch/src/AIS/AIS_InteractiveContext.cdl     2015-01-16 13:01:23.000000000 +0300
1111 @@ -268,15 +268,6 @@
1112  -- inWhichLocal gives the local context in which anIObj
1113  -- is displayed. By default, the index -1 refers to the last
1114  -- Local Context opened.
1115
1116 -    Clear(me : mutable;
1117 -         aniobj         : InteractiveObject from AIS;
1118 -         updateviewer   : Boolean from Standard = Standard_True);
1119 ----Purpose: Removes the interactive object aniobj from all viewers.
1120 --- If a local context is open and if updateviewer equals
1121 --- Standard_False, the presentation of the Interactive
1122 --- Object activates the selection mode; the object is
1123 --- displayed but no viewer will be updated.
1124  
1125      ClearPrs( me           :mutable;
1126               aniobj       : InteractiveObject from AIS;
1127 @@ -2046,6 +2037,16 @@
1128      PurgeViewer(me:mutable;Vwr:Viewer from V3d) 
1129      returns Integer from Standard is static private;
1130  
1131 +    redisplayPrsModes (me                : mutable;
1132 +                       theIObj           : InteractiveObject from AIS;
1133 +                       theToUpdateViewer : Boolean from Standard = Standard_True) is static private;
1134 +   ---Purpose: UNKNOWN
1135 +
1136 +    redisplayPrsRecModes (me                : mutable;
1137 +                          theIObj           : InteractiveObject from AIS;
1138 +                          theToUpdateViewer : Boolean from Standard = Standard_True) is static private;
1139 +   ---Purpose: UNKNOWN
1140 +
1141  fields
1142  
1143      myObjects    : DataMapOfIOStatus from AIS;
1144 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/AIS/AIS_InteractiveContext.cxx OCCT-6.8.0_SRC-patch/src/AIS/AIS_InteractiveContext.cxx
1145 --- OCCT-6.8.0_SRC/src/AIS/AIS_InteractiveContext.cxx   2014-11-11 17:46:38.000000000 +0300
1146 +++ OCCT-6.8.0_SRC-patch/src/AIS/AIS_InteractiveContext.cxx     2015-01-16 13:01:23.000000000 +0300
1147 @@ -16,27 +16,6 @@
1148  
1149  // Modified by  XAB & Serguei Dec 97 (angle &deviation coeffts)
1150  
1151 -#define BUC60577        //GG_101099     Enable to compute correctly
1152 -//                      transparency with more than one object in the view.
1153 -
1154 -#define BUC60632        //GG 15/03/00 Add protection on SetDisplayMode()
1155 -//                      method, compute only authorized presentation.
1156 -
1157 -#define BUC60688        //GG 25/05/00 Add SetSensitivity() methods.
1158 -
1159 -#define BUC60722  //GG 04/09/00 Always enable viewer update when erasing something
1160 -
1161 -#define IMP051001       //GG Adds SetZDetected() and ZDetected() methods
1162 -
1163 -#define OCC172          //SAV clear static map before destroying context.
1164 -
1165 -#define OCC204          //SAV 26/02/02 : pass <updateviewer> flag to 
1166 -// AddOrRemoveCurrentObject method from ClearGlobal.
1167 -
1168 -#define OCC4373         //SAN 10/11/03 : improve display mode management in
1169 -// Display( IO, updateviewer ) and 
1170 -// SetDisplayMode( IO, mode, updateviewer ) methods
1171 -
1172  #include <AIS_InteractiveContext.ixx>
1173  
1174  //#include <AIS_DataMapIteratorOfDataMapOfInteractiveInteger.hxx>
1175 @@ -71,28 +50,6 @@
1176  
1177  #include <AIS_ListIteratorOfListOfInteractive.hxx>
1178  
1179 -// In the method GetDefModes() the returned value of the selection mode 
1180 -// is always equal to 0 if it is -1.
1181 -#define BUC61051
1182 -
1183 -// The local context is closed the method ::ResetOriginalState() sets the selection mode equal to 0
1184 -// in spite of the selection mode of the interactive object in Natural Point.
1185 -#define OCC166
1186 -
1187 -static Standard_Boolean AISDebugModeOn()
1188 -{
1189 -//  static OSD_Environment aisdb("AISDEBUGMODE");
1190 -//  return !aisdb.Value().IsEmpty();
1191 -  static Standard_Integer isDebugMode(-1);
1192 -  if (isDebugMode < 0) {
1193 -    isDebugMode = 1;
1194 -    OSD_Environment aisdb("AISDEBUGMODE");
1195 -    if (aisdb.Value().IsEmpty())
1196 -      isDebugMode = 0;
1197 -  }
1198 -  return (isDebugMode != 0);
1199 -}
1200 -
1201  namespace
1202  {
1203    static volatile Standard_Integer THE_AIS_INDEX_SEL = 0;
1204 @@ -109,7 +66,7 @@
1205      return TCollection_AsciiString ("AIS_CurContext_")
1206           + TCollection_AsciiString (Standard_Atomic_Increment (&THE_AIS_INDEX_CUR));
1207    }
1208 -};
1209 +}
1210  
1211  //=======================================================================
1212  //function : AIS_InteractiveContext
1213 @@ -131,9 +88,7 @@
1214  mySubIntensity(Quantity_NOC_GRAY40),
1215  myDisplayMode(0),
1216  myCurLocalIndex(0),
1217 -#ifdef IMP051001
1218  myZDetectionFlag(0),
1219 -#endif
1220  myIsAutoActivateSelMode( Standard_True )
1221  { 
1222    InitAttributes();
1223 @@ -141,31 +96,30 @@
1224  
1225  void AIS_InteractiveContext::Delete() const
1226  {
1227 -  //Clear the static current selection. Else the memory
1228 -  //is not release
1229 +  // clear the static current selection
1230    AIS_Selection::ClearCurrentSelection();
1231 -#ifdef OCC172
1232 +
1233    // to avoid an exception
1234 -  if ( AIS_Selection::Find( mySelectionName.ToCString() ) )
1235 -    AIS_Selection::Remove( mySelectionName.ToCString() );
1236 +  if (AIS_Selection::Find (mySelectionName.ToCString()))
1237 +  {
1238 +    AIS_Selection::Remove (mySelectionName.ToCString());
1239 +  }
1240  
1241    // to avoid an exception
1242 -  if ( AIS_Selection::Find( myCurrentName.ToCString() ) )
1243 -    AIS_Selection::Remove( myCurrentName.ToCString() );
1244 +  if (AIS_Selection::Find (myCurrentName.ToCString()))
1245 +  {
1246 +    AIS_Selection::Remove (myCurrentName.ToCString());
1247 +  }
1248  
1249    // let's remove one reference explicitly. this operation's supposed to
1250    // be performed when mgrSelector will be destroyed but anyway...
1251 -  mgrSelector->Remove( myMainSel );
1252 -#endif
1253 -  AIS_ListOfInteractive aList;
1254 -  
1255 -  AIS_DataMapIteratorOfDataMapOfIOStatus anIt(myObjects);
1256 +  mgrSelector->Remove (myMainSel);
1257 +
1258    Handle(AIS_InteractiveContext) aNullContext;
1259 -  for(; anIt.More() ; anIt.Next())
1260 +  for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
1261    {
1262 -    Handle(AIS_InteractiveObject) anObj = anIt.Key();
1263 -    anObj->SetContext(aNullContext);
1264 -    
1265 +    Handle(AIS_InteractiveObject) anObj = anObjIter.Key();
1266 +    anObj->SetContext (aNullContext);
1267    }
1268    MMgt_TShared::Delete();
1269  }
1270 @@ -209,494 +163,466 @@
1271  
1272  //=======================================================================
1273  //function : DisplayedObjects
1274 -//purpose  : 
1275 +//purpose  :
1276  //=======================================================================
1277 -
1278 -void AIS_InteractiveContext::DisplayedObjects(AIS_ListOfInteractive& aListOfIO,
1279 -                                              const Standard_Boolean OnlyFromNeutral) const 
1280 +void AIS_InteractiveContext::DisplayedObjects (AIS_ListOfInteractive& theListOfIO,
1281 +                                               const Standard_Boolean theOnlyFromNeutral) const
1282  {
1283 -#ifdef OCCT_DEBUG
1284 -  cout<<"AIS_IC::DisplayedObjects"<<endl;
1285 -#endif
1286 -
1287 -  AIS_DataMapIteratorOfDataMapOfIOStatus It(myObjects);
1288 -  if(!HasOpenedContext() || OnlyFromNeutral){
1289 -    for(;It.More();It.Next()){
1290 -      if(It.Value()->GraphicStatus()==AIS_DS_Displayed)
1291 -        aListOfIO.Append(It.Key());
1292 -    }
1293 -  }
1294 -  else{
1295 -    TColStd_MapOfTransient theMap;
1296 -    // neutral point
1297 -    for(;It.More();It.Next()){
1298 -      if(It.Value()->GraphicStatus()==AIS_DS_Displayed)
1299 -        theMap.Add(It.Key());
1300 -    }
1301 -
1302 -    //parse all local contexts...
1303 -#ifdef OCCT_DEBUG
1304 -    cout<<"\tFrom Neutral Point : "<<theMap.Extent()<<endl;
1305 -    Standard_Integer NbDisp;
1306 -    for(AIS_DataMapIteratorOfDataMapOfILC it1(myLocalContexts);it1.More();it1.Next()){
1307 -      const Handle(AIS_LocalContext)& LC = it1.Value();
1308 -      NbDisp =  LC->DisplayedObjects(theMap);
1309 -      cout<<"\tIn Local Context "<<it1.Key()<<" : "<<NbDisp<<endl;
1310 -    }
1311 -#endif
1312 -    Handle(AIS_InteractiveObject) curIO;
1313 -    Handle(Standard_Transient) Tr;
1314 -      for(TColStd_MapIteratorOfMapOfTransient it2(theMap);it2.More();it2.Next()){
1315 -        Tr = it2.Key();
1316 -        curIO = *((Handle(AIS_InteractiveObject)*) &Tr);
1317 -        aListOfIO.Append(curIO);
1318 +  if (!HasOpenedContext()
1319 +   || theOnlyFromNeutral)
1320 +  {
1321 +    for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
1322 +    {
1323 +      if (anObjIter.Value()->GraphicStatus() == AIS_DS_Displayed)
1324 +      {
1325 +        theListOfIO.Append (anObjIter.Key());
1326        }
1327      }
1328 +    return;
1329 +  }
1330 +
1331 +  // neutral point
1332 +  TColStd_MapOfTransient aDispMap;
1333 +  for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
1334 +  {
1335 +    if (anObjIter.Value()->GraphicStatus() == AIS_DS_Displayed)
1336 +    {
1337 +      aDispMap.Add (anObjIter.Key());
1338 +    }
1339 +  }
1340 +
1341 +  // parse all local contexts...
1342 +  for (AIS_DataMapIteratorOfDataMapOfILC aCtxIter (myLocalContexts); aCtxIter.More(); aCtxIter.Next())
1343 +  {
1344 +    const Handle(AIS_LocalContext)& aLocCtx = aCtxIter.Value();
1345 +    aLocCtx->DisplayedObjects (aDispMap);
1346 +  }
1347 +
1348 +  Handle(AIS_InteractiveObject) anObj;
1349 +  for (TColStd_MapIteratorOfMapOfTransient aDispMapIter (aDispMap); aDispMapIter.More(); aDispMapIter.Next())
1350 +  {
1351 +    const Handle(Standard_Transient)& aTransient = aDispMapIter.Key();
1352 +    anObj = *((Handle(AIS_InteractiveObject)* )&aTransient);
1353 +    theListOfIO.Append (anObj);
1354 +  }
1355  }
1356 +
1357  //=======================================================================
1358  //function : DisplayedObjects
1359 -//purpose  : 
1360 +//purpose  :
1361  //=======================================================================
1362 -
1363 -void AIS_InteractiveContext::DisplayedObjects(const AIS_KindOfInteractive TheKind,
1364 -                                              const Standard_Integer TheSign,
1365 -                                              AIS_ListOfInteractive& aListOfIO,
1366 -                                              const Standard_Boolean /*OnlyFromNeutral*/) const 
1367 +void AIS_InteractiveContext::DisplayedObjects (const AIS_KindOfInteractive theKind,
1368 +                                               const Standard_Integer      theSign,
1369 +                                               AIS_ListOfInteractive&      theListOfIO,
1370 +                                               const Standard_Boolean /*OnlyFromNeutral*/) const
1371  {
1372 -  ObjectsByDisplayStatus( TheKind, TheSign, AIS_DS_Displayed, aListOfIO );
1373 +  ObjectsByDisplayStatus (theKind, theSign, AIS_DS_Displayed, theListOfIO);
1374  }
1375  
1376  //=======================================================================
1377  //function : ErasedObjects
1378 -//purpose  : 
1379 +//purpose  :
1380  //=======================================================================
1381 -
1382 -void AIS_InteractiveContext::ErasedObjects(AIS_ListOfInteractive& theListOfIO) const 
1383 +void AIS_InteractiveContext::ErasedObjects (AIS_ListOfInteractive& theListOfIO) const
1384  {
1385 -  ObjectsByDisplayStatus( AIS_DS_Erased, theListOfIO );
1386 +  ObjectsByDisplayStatus (AIS_DS_Erased, theListOfIO);
1387  }
1388  
1389  //=======================================================================
1390  //function : ErasedObjects
1391 -//purpose  : 
1392 +//purpose  :
1393  //=======================================================================
1394 -
1395 -void AIS_InteractiveContext::ErasedObjects(const AIS_KindOfInteractive TheKind,
1396 -                                           const Standard_Integer TheSign,
1397 -                                           AIS_ListOfInteractive& theListOfIO) const 
1398 +void AIS_InteractiveContext::ErasedObjects (const AIS_KindOfInteractive theKind,
1399 +                                            const Standard_Integer      theSign,
1400 +                                            AIS_ListOfInteractive&      theListOfIO) const
1401  {
1402 -  ObjectsByDisplayStatus( TheKind, TheSign, AIS_DS_Erased, theListOfIO );
1403 +  ObjectsByDisplayStatus (theKind, theSign, AIS_DS_Erased, theListOfIO);
1404  }
1405  
1406  //=======================================================================
1407  //function : ObjectsByDisplayStatus
1408 -//purpose  : 
1409 +//purpose  :
1410  //=======================================================================
1411 -
1412 -void AIS_InteractiveContext::ObjectsByDisplayStatus(const AIS_DisplayStatus theStatus,
1413 -                                                    AIS_ListOfInteractive&  theListOfIO) const 
1414 +void AIS_InteractiveContext::ObjectsByDisplayStatus (const AIS_DisplayStatus theStatus,
1415 +                                                     AIS_ListOfInteractive&  theListOfIO) const
1416  {
1417 -  AIS_DataMapIteratorOfDataMapOfIOStatus It(myObjects);
1418 -  for(;It.More();It.Next()){
1419 -    if(It.Value()->GraphicStatus() == theStatus)
1420 -      theListOfIO.Append(It.Key());
1421 +  for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
1422 +  {
1423 +    if (anObjIter.Value()->GraphicStatus() == theStatus)
1424 +    {
1425 +      theListOfIO.Append (anObjIter.Key());
1426 +    }
1427    }
1428  }
1429  
1430  //=======================================================================
1431  //function : ObjectsByDisplayStatus
1432 -//purpose  : 
1433 +//purpose  :
1434  //=======================================================================
1435 +void AIS_InteractiveContext::ObjectsByDisplayStatus (const AIS_KindOfInteractive theKind,
1436 +                                                     const Standard_Integer      theSign,
1437 +                                                     const AIS_DisplayStatus     theStatus,
1438 +                                                     AIS_ListOfInteractive&      theListOfIO) const
1439 +{
1440 +  for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
1441 +  {
1442 +    if (anObjIter.Value()->GraphicStatus() != theStatus
1443 +     || anObjIter.Key()->Type() != theKind)
1444 +    {
1445 +      continue;
1446 +    }
1447  
1448 -void AIS_InteractiveContext::ObjectsByDisplayStatus(const AIS_KindOfInteractive TheKind,
1449 -                                                    const Standard_Integer TheSign,
1450 -                                                    const AIS_DisplayStatus theStatus,
1451 -                                                    AIS_ListOfInteractive& theListOfIO) const 
1452 -{
1453 -  AIS_DataMapIteratorOfDataMapOfIOStatus It(myObjects);
1454 -  for(;It.More();It.Next()){
1455 -    if(It.Value()->GraphicStatus()==theStatus){
1456 -      if(It.Key()->Type()==TheKind){
1457 -        if(TheSign ==-1)
1458 -          theListOfIO.Append(It.Key());
1459 -        else{
1460 -          if(It.Key()->Signature()==TheSign)
1461 -            theListOfIO.Append(It.Key());
1462 -        }
1463 -      }
1464 +    if (theSign == -1
1465 +     || anObjIter.Key()->Signature() == theSign)
1466 +    {
1467 +      theListOfIO.Append (anObjIter.Key());
1468      }
1469    }
1470  }
1471  
1472  //=======================================================================
1473  //function : ObjectsInside
1474 -//purpose  : 
1475 +//purpose  :
1476  //=======================================================================
1477 +void AIS_InteractiveContext::ObjectsInside (AIS_ListOfInteractive&      theListOfIO,
1478 +                                            const AIS_KindOfInteractive theKind,
1479 +                                            const Standard_Integer      theSign) const
1480 +{
1481 +  if (theKind == AIS_KOI_None
1482 +   && theSign == -1)
1483 +  {
1484 +    for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
1485 +    {
1486 +      theListOfIO.Append (anObjIter.Key());
1487 +    }
1488 +    return;
1489 +  }
1490  
1491 -void AIS_InteractiveContext::ObjectsInside(AIS_ListOfInteractive& aListOfIO,
1492 -                                           const AIS_KindOfInteractive TheKind,
1493 -                                           const Standard_Integer TheSign) const 
1494 -{
1495 -  AIS_DataMapIteratorOfDataMapOfIOStatus It(myObjects);
1496 -  if(TheKind==AIS_KOI_None && TheSign ==-1){
1497 -    for(;It.More();It.Next()){
1498 -        aListOfIO.Append(It.Key());
1499 -    }
1500 -  }
1501 -  else{
1502 -    for(;It.More();It.Next()){
1503 -      if(It.Key()->Type()==TheKind){
1504 -        if(TheSign ==-1)
1505 -          aListOfIO.Append(It.Key());
1506 -        else{
1507 -          if(It.Key()->Signature()==TheSign)
1508 -            aListOfIO.Append(It.Key());
1509 -        }
1510 -      }
1511 +  for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
1512 +  {
1513 +    if (anObjIter.Key()->Type() != theKind)
1514 +    {
1515 +      continue;
1516 +    }
1517 +
1518 +    if (theSign == -1
1519 +     || anObjIter.Key()->Signature() == theSign)
1520 +    {
1521 +      theListOfIO.Append (anObjIter.Key());
1522      }
1523    }
1524  }
1525  
1526  //=======================================================================
1527  //function : Display
1528 -//purpose  : 
1529 +//purpose  :
1530  //=======================================================================
1531 +void AIS_InteractiveContext::Display (const Handle(AIS_InteractiveObject)& theIObj,
1532 +                                      const Standard_Boolean               theToUpdateViewer)
1533 +{
1534 +  if (theIObj.IsNull())
1535 +  {
1536 +    return;
1537 +  }
1538 +
1539 +  Standard_Integer aDispMode = 0, aHiMod = -1, aSelMode = -1;
1540 +  GetDefModes (theIObj, aDispMode, aHiMod, aSelMode);
1541  
1542 -void AIS_InteractiveContext::Display(const Handle(AIS_InteractiveObject)& anIObj,
1543 -                                     const Standard_Boolean updateviewer )
1544 +  Display (theIObj, aDispMode, myIsAutoActivateSelMode ? aSelMode : -1,
1545 +           theToUpdateViewer, theIObj->AcceptShapeDecomposition());
1546 +}
1547 +
1548 +//=======================================================================
1549 +//function : Display
1550 +//purpose  :
1551 +//=======================================================================
1552 +void AIS_InteractiveContext::Display (const Handle(AIS_InteractiveObject)& theIObj,
1553 +                                      const Standard_Integer               theDispMode,
1554 +                                      const Standard_Integer               theSelectionMode,
1555 +                                      const Standard_Boolean               theToUpdateViewer,
1556 +                                      const Standard_Boolean               theToAllowDecomposition)
1557  {
1558 -  if(anIObj.IsNull()) return;
1559 -  
1560 -  Standard_Integer DispMode,HiMod,SelMode;
1561 -  
1562 -  GetDefModes(anIObj,DispMode,HiMod,SelMode);
1563 -  
1564 -  Handle (AIS_InteractiveContext) aThis = this;
1565 -  if(!anIObj->HasInteractiveContext()) 
1566 -    anIObj->SetContext(aThis);
1567 -  
1568 -  //NO LOCAL CONTEXT OPEN
1569 -  if(!HasOpenedContext()) {
1570 -#ifndef OCC4373
1571 -    // SAN : Do not return here. Perform advanced display mode analysis a bit later...
1572 -    if(IsDisplayed(anIObj)) return;
1573 -#endif
1574 -
1575 -    // it did not yet exist
1576 -    if(!myObjects.IsBound(anIObj)){
1577 -      
1578 -      Handle(AIS_GlobalStatus) STATUS= 
1579 -#ifdef OCC166
1580 -        new AIS_GlobalStatus(AIS_DS_Displayed,DispMode,SelMode);
1581 -#else
1582 -      new AIS_GlobalStatus(AIS_DS_Displayed,DispMode,0);
1583 -#endif
1584 -      myObjects.Bind (anIObj,STATUS);
1585 -      myMainPM->Display(anIObj,DispMode);
1586 -      if( myIsAutoActivateSelMode )
1587 -      {
1588 -        if(!mgrSelector->Contains(anIObj))
1589 -           mgrSelector->Load(anIObj);
1590 -        mgrSelector->Activate(anIObj,SelMode,myMainSel);
1591 -      }
1592 -        
1593 -     if(updateviewer) myMainVwr->Update();
1594 -    }
1595 -    // it is somewhere else...
1596 -    else {
1597 -      // CLE
1598 -      // const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
1599 -      Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
1600 -      // ENDCLE
1601 -      if (STATUS->GraphicStatus() == AIS_DS_Displayed || STATUS->GraphicStatus() == AIS_DS_Erased)
1602 -      {
1603 -        // SAN : erase presentations for all display modes different from <DispMode>;
1604 -        //       then make sure <DispMode> is displayed and maybe highlighted;
1605 -        //       Finally, activate selection mode <SelMode> if not yet activated.
1606 -        TColStd_ListOfInteger aModesToRemove;
1607 -        TColStd_ListIteratorOfListOfInteger ItL (STATUS->DisplayedModes());
1608 -        for(;ItL.More();ItL.Next()){
1609 -
1610 -          Standard_Integer OldMode = ItL.Value();
1611 -
1612 -          if(OldMode!=DispMode){
1613 -            aModesToRemove.Append(OldMode);
1614 -            if(myMainPM->IsHighlighted(anIObj,OldMode))
1615 -              myMainPM->Unhighlight(anIObj,OldMode);
1616 -            myMainPM->Erase(anIObj,OldMode);
1617 -          }
1618 -        }
1619 +  if (theIObj.IsNull())
1620 +  {
1621 +    return;
1622 +  }
1623  
1624 -        for(ItL.Initialize(aModesToRemove);ItL.More();ItL.Next())
1625 -          STATUS->RemoveDisplayMode(ItL.Value());
1626 +  if (!theIObj->HasInteractiveContext())
1627 +  {
1628 +    theIObj->SetContext (this);
1629 +  }
1630  
1631 -        if(!STATUS->IsDModeIn(DispMode))
1632 -          STATUS->AddDisplayMode(DispMode);
1633 +  if (HasOpenedContext())
1634 +  {
1635 +    myLocalContexts (myCurLocalIndex)->Display (theIObj, theDispMode, theToAllowDecomposition, theSelectionMode);
1636 +    if (theToUpdateViewer)
1637 +    {
1638 +      myMainVwr->Update();
1639 +    }
1640 +    return;
1641 +  }
1642  
1643 -        myMainPM->Display(anIObj,DispMode);
1644 -        if (STATUS->GraphicStatus() == AIS_DS_Erased)
1645 -        {
1646 -          STATUS->SetGraphicStatus(AIS_DS_Displayed);
1647 -        }
1648 -        if(STATUS->IsHilighted()){
1649 -          myMainPM->Highlight(anIObj,HiMod);
1650 -        }
1651 -        if( myIsAutoActivateSelMode )
1652 -        {
1653 -           if(!mgrSelector->Contains(anIObj))
1654 -              mgrSelector->Load(anIObj);
1655 -           if(!mgrSelector->IsActivated(anIObj,SelMode))
1656 -              mgrSelector->Activate(anIObj,SelMode,myMainSel);
1657 -        }
1658 +  if (!myObjects.IsBound (theIObj))
1659 +  {
1660 +    Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (AIS_DS_Displayed, theDispMode, theSelectionMode);
1661 +    myObjects.Bind   (theIObj, aStatus);
1662 +    myMainPM->Display(theIObj, theDispMode);
1663 +    if (theSelectionMode != -1)
1664 +    {
1665 +      if (!mgrSelector->Contains (theIObj))
1666 +      {
1667 +        mgrSelector->Load (theIObj);
1668        }
1669 -    } 
1670 -    
1671 -    if(anIObj->IsTransparent() && !myMainVwr->Viewer()->Transparency())
1672 -      myMainVwr->Viewer()->SetTransparency(Standard_True);
1673 -    if(updateviewer) myMainVwr->Update();
1674 +      mgrSelector->Activate (theIObj, theSelectionMode, myMainSel);
1675 +    }
1676    }
1677 -  
1678 -  //  LOCAL CONTEXT OPEN
1679    else
1680    {
1681 -    myLocalContexts(myCurLocalIndex)->Display(anIObj,DispMode,anIObj->AcceptShapeDecomposition(),SelMode);
1682 -    
1683 -    if(anIObj->IsTransparent() && !myMainVwr->Viewer()->Transparency())
1684 -      myMainVwr->Viewer()->SetTransparency(Standard_True);
1685 -    
1686 -    
1687 -    if(updateviewer) myMainVwr->Update();
1688 -  }
1689 -}
1690 +    Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
1691 +    if (aStatus->GraphicStatus() != AIS_DS_Displayed
1692 +     && aStatus->GraphicStatus() != AIS_DS_Erased)
1693 +    {
1694 +      return;
1695 +    }
1696  
1697 -//=======================================================================
1698 -//function : Display
1699 -//purpose  : 
1700 -//=======================================================================
1701 +    // Erase presentations for all display modes different from aDispMode.
1702 +    // Then make sure aDispMode is displayed and maybe highlighted.
1703 +    // Finally, activate selection mode <SelMode> if not yet activated.
1704 +    TColStd_ListOfInteger aModesToRemove;
1705 +    for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
1706 +    {
1707 +      const Standard_Integer anOldMode = aDispModeIter.Value();
1708 +      if (anOldMode != theDispMode)
1709 +      {
1710 +        aModesToRemove.Append (anOldMode);
1711 +        if(myMainPM->IsHighlighted (theIObj, anOldMode))
1712 +        {
1713 +          myMainPM->Unhighlight (theIObj, anOldMode);
1714 +        }
1715 +        myMainPM->Erase (theIObj, anOldMode);
1716 +      }
1717 +    }
1718  
1719 -void AIS_InteractiveContext::Display(const Handle(AIS_InteractiveObject)& anIObj,
1720 -                                    const Standard_Integer aDisplayMode, 
1721 -                                    const Standard_Integer aSelectionMode, 
1722 -                                    const Standard_Boolean updateviewer, 
1723 -                                    const Standard_Boolean allowdecomposition)
1724 -{
1725 -  if(anIObj.IsNull()) return;
1726 +    for (TColStd_ListIteratorOfListOfInteger aRemModeIter (aModesToRemove); aRemModeIter.More(); aRemModeIter.Next())
1727 +    {
1728 +      aStatus->RemoveDisplayMode (aRemModeIter.Value());
1729 +    }
1730  
1731 -  if(!anIObj->HasInteractiveContext()) anIObj->SetContext(this);
1732 -  
1733 -  // if no local context...
1734 -  if(!HasOpenedContext()) {
1735 -    //    if(!anIObj->HasDisplayMode())
1736 -    //      anIObj->SetDisplayMode(aDisplayMode);
1737 -  
1738 -    if(!myObjects.IsBound(anIObj)){
1739 -      Handle(AIS_GlobalStatus) STATUS= 
1740 -        new AIS_GlobalStatus(AIS_DS_Displayed,aDisplayMode,aSelectionMode);
1741 -      myObjects.Bind (anIObj,STATUS);
1742 -      myMainPM->Display(anIObj,aDisplayMode);
1743 -      if(aSelectionMode!=-1){
1744 -        if(!mgrSelector->Contains(anIObj))
1745 -          mgrSelector->Load(anIObj,aSelectionMode);
1746 -        mgrSelector->Activate(anIObj,aSelectionMode,myMainSel);
1747 -      }
1748 -      if(updateviewer) myMainVwr->Update();
1749 +    if (!aStatus->IsDModeIn (theDispMode))
1750 +    {
1751 +      aStatus->AddDisplayMode (theDispMode);
1752 +    }
1753 +
1754 +    myMainPM->Display (theIObj, theDispMode);
1755 +    if (aStatus->GraphicStatus() == AIS_DS_Erased)
1756 +    {
1757 +      aStatus->SetGraphicStatus (AIS_DS_Displayed);
1758 +    }
1759 +    if (aStatus->IsHilighted())
1760 +    {
1761 +      const Standard_Integer aHiMod = theIObj->HasHilightMode() ? theIObj->HilightMode() : theDispMode;
1762 +      myMainPM->Highlight (theIObj, aHiMod);
1763      }
1764 -    //    anIObj->SelectionMode(aSelectionMode);
1765 -    else{
1766 -      // CLE
1767 -      // const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
1768 -      Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
1769 -      // ENDCLE
1770 -      if(!STATUS->IsDModeIn(aDisplayMode)){
1771 -        myMainPM->Display(anIObj,aDisplayMode);
1772 -        STATUS->AddDisplayMode(aDisplayMode);
1773 -        if(STATUS->IsSubIntensityOn())
1774 -          myMainPM->Color(anIObj,mySubIntensity,aDisplayMode);
1775 +    if (theSelectionMode != -1)
1776 +    {
1777 +      if (!mgrSelector->Contains (theIObj))
1778 +      {
1779 +        mgrSelector->Load (theIObj);
1780        }
1781 -      if(aSelectionMode!=-1){
1782 -        STATUS->AddSelectionMode(aSelectionMode);
1783 -        mgrSelector->Activate(anIObj,aSelectionMode,myMainSel);
1784 +      if (!mgrSelector->IsActivated (theIObj, theSelectionMode))
1785 +      {
1786 +        mgrSelector->Activate (theIObj, theSelectionMode, myMainSel);
1787        }
1788 -      if(updateviewer) myMainVwr->Update();
1789 -      
1790      }
1791    }
1792 -  else
1793 -    {
1794 -      myLocalContexts(myCurLocalIndex)->Display(anIObj,aDisplayMode,allowdecomposition,aSelectionMode);
1795 -      if(updateviewer) myMainVwr->Update();
1796 -    }  
1797 -}
1798  
1799 +  if (theToUpdateViewer)
1800 +  {
1801 +    myMainVwr->Update();
1802 +  }
1803 +}
1804  
1805  //=======================================================================
1806  //function : Load
1807 -//purpose  : 
1808 +//purpose  :
1809  //=======================================================================
1810 -
1811 -void AIS_InteractiveContext::Load(const Handle(AIS_InteractiveObject)& anIObj,
1812 -                                  const Standard_Integer SelMode,
1813 -                                  const Standard_Boolean AllowDecomposition)
1814 +void AIS_InteractiveContext::Load (const Handle(AIS_InteractiveObject)& theIObj,
1815 +                                   const Standard_Integer               theSelMode,
1816 +                                   const Standard_Boolean               theToAllowDecomposition)
1817  {
1818 -  if(anIObj.IsNull()) return;
1819 -  if(!anIObj->HasInteractiveContext()) anIObj->SetContext(this);
1820 -  
1821 +  if (theIObj.IsNull())
1822 +  {
1823 +    return;
1824 +  }
1825  
1826 -  if(!HasOpenedContext()) {
1827 -    if(SelMode==-1 && !AllowDecomposition){
1828 -      Standard_Integer DispMode,HiMod,SelModeDef;
1829 -      
1830 -      GetDefModes(anIObj,DispMode,HiMod,SelModeDef);
1831 -      Handle(AIS_GlobalStatus) STATUS= 
1832 -        new AIS_GlobalStatus(AIS_DS_Erased,DispMode,SelModeDef);
1833 -      myObjects.Bind (anIObj,STATUS);      
1834 -      return;
1835 -    }
1836 +  if (!theIObj->HasInteractiveContext())
1837 +  {
1838 +    theIObj->SetContext (this);
1839 +  }
1840 +
1841 +  if (HasOpenedContext())
1842 +  {
1843 +    myLocalContexts (myCurLocalIndex)->Load (theIObj, theToAllowDecomposition, theSelMode);
1844 +    return;
1845    }
1846 -  myLocalContexts(myCurLocalIndex)->Load(anIObj,AllowDecomposition,SelMode);
1847 -}
1848  
1849 +  if (theSelMode == -1
1850 +  && !theToAllowDecomposition
1851 +  && !myObjects.IsBound (theIObj))
1852 +  {
1853 +    Standard_Integer aDispMode, aHiMod, aSelModeDef;
1854 +    GetDefModes (theIObj, aDispMode, aHiMod, aSelModeDef);
1855 +    Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (AIS_DS_Erased, aDispMode, aSelModeDef);
1856 +    myObjects.Bind (theIObj, aStatus);
1857 +  }
1858 +}
1859  
1860  //=======================================================================
1861  //function : Erase
1862 -//purpose  : 
1863 +//purpose  :
1864  //=======================================================================
1865 -
1866 -void AIS_InteractiveContext::Erase(const Handle(AIS_InteractiveObject)& anIObj, 
1867 -                                   const Standard_Boolean updateviewer)
1868 +void AIS_InteractiveContext::Erase (const Handle(AIS_InteractiveObject)& theIObj,
1869 +                                    const Standard_Boolean               theToUpdateViewer)
1870  {
1871 -  if(anIObj.IsNull()) return;
1872 -  
1873 -  if ( !anIObj->IsAutoHilight() )
1874 -    anIObj->ClearSelected();
1875 +  if (theIObj.IsNull())
1876 +  {
1877 +    return;
1878 +  }
1879    
1880 -  if(!HasOpenedContext()){
1881 -    EraseGlobal(anIObj,updateviewer);
1882 +  if (!theIObj->IsAutoHilight())
1883 +  {
1884 +    theIObj->ClearSelected();
1885    }
1886 -  else
1887 +
1888 +  Standard_Boolean wasInCtx = Standard_False;
1889 +  if (HasOpenedContext())
1890 +  {
1891 +    // First it is checked if it is possible to remove in the current local context
1892 +    // then one tries to remove in other local contexts, if they allow it...
1893 +    wasInCtx = myLocalContexts (myCurLocalIndex)->Erase (theIObj);
1894 +    for (AIS_DataMapIteratorOfDataMapOfILC aCtxIter (myLocalContexts); aCtxIter.More(); aCtxIter.Next())
1895      {
1896 -      // First it is checked if it is possible to remove in the current local context
1897 -      // then one tries to remove in other local contexts, if they allow it...
1898 -      
1899 -      Standard_Boolean WasInCtx = myLocalContexts(myCurLocalIndex)->Erase(anIObj);
1900 -//      if(!WasInCtx) {
1901 -      AIS_DataMapIteratorOfDataMapOfILC It(myLocalContexts);
1902 -      for (;It.More();It.Next()){
1903 -        if(It.Value()->AcceptErase())
1904 -#ifdef BUC60722
1905 -          WasInCtx |= It.Value()->Erase(anIObj);
1906 -#else
1907 -          WasInCtx = It.Value()->Erase(anIObj);
1908 -#endif
1909 +      if (aCtxIter.Value()->AcceptErase())
1910 +      {
1911 +        wasInCtx = aCtxIter.Value()->Erase (theIObj) || wasInCtx;
1912        }
1913 -      
1914 -      if(!WasInCtx)
1915 -        EraseGlobal(anIObj,updateviewer);
1916 -      else
1917 -        if(updateviewer) myMainVwr->Update();
1918      }
1919 +  }
1920 +
1921 +  if (!wasInCtx)
1922 +  {
1923 +    EraseGlobal (theIObj, Standard_False);
1924 +  }
1925 +
1926 +  if (theToUpdateViewer)
1927 +  {
1928 +    myMainVwr->Update();
1929 +  }
1930  }
1931  
1932  //=======================================================================
1933  //function : EraseAll
1934 -//purpose  : 
1935 +//purpose  :
1936  //=======================================================================
1937 -
1938 -void AIS_InteractiveContext::EraseAll(const Standard_Boolean updateviewer)
1939 +void AIS_InteractiveContext::EraseAll (const Standard_Boolean theToUpdateViewer)
1940  {
1941 -  if(!HasOpenedContext())
1942 +  if (HasOpenedContext())
1943    {
1944 -    for (AIS_DataMapIteratorOfDataMapOfIOStatus ItM(myObjects); ItM.More(); ItM.Next())
1945 -    {
1946 -      if(ItM.Value()->GraphicStatus() == AIS_DS_Displayed)
1947 -        Erase(ItM.Key(),Standard_False);
1948 -    }
1949 -    if(updateviewer)
1950 +    return;
1951 +  }
1952 +
1953 +  for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
1954 +  {
1955 +    if (anObjIter.Value()->GraphicStatus() == AIS_DS_Displayed)
1956      {
1957 -      myMainVwr->Update();
1958 +      Erase (anObjIter.Key(), Standard_False);
1959      }
1960    }
1961 +
1962 +  if (theToUpdateViewer)
1963 +  {
1964 +    myMainVwr->Update();
1965 +  }
1966  }
1967  
1968  //=======================================================================
1969  //function : DisplayAll
1970 -//purpose  : 
1971 +//purpose  :
1972  //=======================================================================
1973 -
1974 -void AIS_InteractiveContext::DisplayAll(const Standard_Boolean updateviewer)
1975 +void AIS_InteractiveContext::DisplayAll (const Standard_Boolean theToUpdateViewer)
1976  {
1977 -  if(!HasOpenedContext()){
1978 -
1979 -    AIS_DisplayStatus aStatus;
1980 +  if (HasOpenedContext())
1981 +  {
1982 +    return;
1983 +  }
1984  
1985 -    if (!HasOpenedContext())
1986 +  for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
1987 +  {
1988 +    const AIS_DisplayStatus aStatus = anObjIter.Value()->GraphicStatus();
1989 +    if (aStatus == AIS_DS_Erased)
1990      {
1991 -      for (AIS_DataMapIteratorOfDataMapOfIOStatus ItM (myObjects); ItM.More(); ItM.Next())
1992 -      {
1993 -        aStatus = ItM.Value()->GraphicStatus();
1994 -        if (aStatus == AIS_DS_Erased)
1995 -          Display(ItM.Key(),Standard_False);
1996 -      }
1997 -      if(updateviewer)
1998 -      {
1999 -        myMainVwr->Update();
2000 -      }
2001 +      Display (anObjIter.Key(), Standard_False);
2002      }
2003    }
2004 -  
2005 +
2006 +  if (theToUpdateViewer)
2007 +  {
2008 +    myMainVwr->Update();
2009 +  }
2010  }
2011  
2012  //=======================================================================
2013  //function : DisplaySelected
2014 -//purpose  : 
2015 +//purpose  :
2016  //=======================================================================
2017 -
2018 -void AIS_InteractiveContext::DisplaySelected(const Standard_Boolean updateviewer)
2019 +void AIS_InteractiveContext::DisplaySelected (const Standard_Boolean theToUpdateViewer)
2020  {
2021 -  
2022 -  if (!HasOpenedContext())
2023 +  if (HasOpenedContext())
2024    {
2025 -    Standard_Boolean found = Standard_False;
2026 -    Handle(AIS_Selection) sel = AIS_Selection::Selection(myCurrentName.ToCString());
2027 -    Handle(AIS_InteractiveObject) iObj;
2028 -    for (sel->Init(); sel->More(); sel->Next())
2029 -    {
2030 -      iObj = Handle(AIS_InteractiveObject)::DownCast(sel->Value());
2031 -      Display(iObj,Standard_False);
2032 -      found = Standard_True;
2033 -    }
2034 -    if (found && updateviewer)
2035 -    {
2036 -      myMainVwr->Update();
2037 -    }
2038 +    return;
2039 +  }
2040 +
2041 +  Standard_Boolean      isFound  = Standard_False;
2042 +  Handle(AIS_Selection) aSelIter = AIS_Selection::Selection (myCurrentName.ToCString());
2043 +  for (aSelIter->Init(); aSelIter->More(); aSelIter->Next())
2044 +  {
2045 +    Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (aSelIter->Value());
2046 +    Display (anObj, Standard_False);
2047 +    isFound = Standard_True;
2048    }
2049 -}
2050  
2051 +  if (isFound && theToUpdateViewer)
2052 +  {
2053 +    myMainVwr->Update();
2054 +  }
2055 +}
2056  
2057  //=======================================================================
2058  //function : EraseSelected
2059 -//purpose  : 
2060 +//purpose  :
2061  //=======================================================================
2062 -
2063 -void AIS_InteractiveContext::EraseSelected(const Standard_Boolean updateviewer)
2064 +void AIS_InteractiveContext::EraseSelected (const Standard_Boolean theToUpdateViewer)
2065  {
2066 -  if (!HasOpenedContext())
2067 +  if (HasOpenedContext())
2068    {
2069 -    Standard_Boolean found = Standard_False;
2070 -    Handle(AIS_Selection) sel = AIS_Selection::Selection(myCurrentName.ToCString());
2071 -    Handle(AIS_InteractiveObject) iObj;
2072 -    for (sel->Init();sel->More();sel->Next())
2073 -    {
2074 -      iObj = Handle(AIS_InteractiveObject)::DownCast(sel->Value());
2075 -      Erase(iObj,Standard_False);
2076 -      found = Standard_True;
2077 -    }
2078 -    if(found && updateviewer)
2079 -    {
2080 -      myMainVwr->Update();
2081 -    }
2082 +    return;
2083 +  }
2084 +
2085 +  Standard_Boolean      isFound  = Standard_False;
2086 +  Handle(AIS_Selection) aSelIter = AIS_Selection::Selection(myCurrentName.ToCString());
2087 +  for (aSelIter->Init(); aSelIter->More(); aSelIter->Next())
2088 +  {
2089 +    Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (aSelIter->Value());
2090 +    Erase (anObj, Standard_False);
2091 +    isFound = Standard_True;
2092 +  }
2093 +
2094 +  if (isFound && theToUpdateViewer)
2095 +  {
2096 +    myMainVwr->Update();
2097    }
2098  }
2099 +
2100  //=======================================================================
2101  //function : 
2102  //purpose  : 
2103 @@ -761,187 +687,163 @@
2104    return Standard_True;
2105  }
2106  
2107 -
2108  //=======================================================================
2109 -//purpose  : 
2110 +//function : DisplayStatus
2111 +//purpose  :
2112  //=======================================================================
2113 -
2114 -AIS_DisplayStatus AIS_InteractiveContext::DisplayStatus(const Handle(AIS_InteractiveObject)& anIObj) const 
2115 +AIS_DisplayStatus AIS_InteractiveContext::DisplayStatus (const Handle(AIS_InteractiveObject)& theIObj) const
2116  {
2117 -  if(anIObj.IsNull()) return AIS_DS_None;
2118 -
2119 -  if(myObjects.IsBound(anIObj))
2120 -    return myObjects(anIObj)->GraphicStatus();
2121 +  if (theIObj.IsNull())
2122 +  {
2123 +    return AIS_DS_None;
2124 +  }
2125 +  else if (myObjects.IsBound (theIObj))
2126 +  {
2127 +    return myObjects (theIObj)->GraphicStatus();
2128 +  }
2129  
2130 -  AIS_DataMapIteratorOfDataMapOfILC ItM(myLocalContexts);
2131 -  for(;ItM.More();ItM.Next()){
2132 -    if(ItM.Value()->IsIn(anIObj))
2133 +  for (AIS_DataMapIteratorOfDataMapOfILC aCtxIter (myLocalContexts); aCtxIter.More(); aCtxIter.Next())
2134 +  {
2135 +    if (aCtxIter.Value()->IsIn (theIObj))
2136 +    {
2137        return AIS_DS_Temporary;
2138 +    }
2139    }
2140 -  
2141    return AIS_DS_None;
2142 -  
2143  }
2144  
2145 -
2146 -
2147 -
2148  //=======================================================================
2149  //function : DisplayedModes
2150 -//purpose  : 
2151 +//purpose  :
2152  //=======================================================================
2153 -
2154 -const TColStd_ListOfInteger& AIS_InteractiveContext::
2155 -DisplayedModes(const Handle(AIS_InteractiveObject)& anIObj) const 
2156 +const TColStd_ListOfInteger& AIS_InteractiveContext::DisplayedModes (const Handle(AIS_InteractiveObject)& theIObj) const
2157  {
2158 -  return myObjects(anIObj)->DisplayedModes();
2159 +  return myObjects (theIObj)->DisplayedModes();
2160  }
2161  
2162 -
2163  //=======================================================================
2164  //function : Remove
2165 -//purpose  : 
2166 +//purpose  :
2167  //=======================================================================
2168 -void AIS_InteractiveContext::Remove(const Handle(AIS_InteractiveObject)& anIObj,
2169 -                                    const Standard_Boolean updateviewer)
2170 +void AIS_InteractiveContext::Remove (const Handle(AIS_InteractiveObject)& theIObj,
2171 +                                     const Standard_Boolean               theToUpdateViewer)
2172  {
2173 -
2174 -  if(anIObj.IsNull()) return;
2175 -
2176 -  if(!HasOpenedContext()){ 
2177 -    ClearGlobal(anIObj,updateviewer);
2178 +  if (theIObj.IsNull())
2179 +  {
2180 +    return;
2181    }
2182 -  else
2183 +
2184 +  if (HasOpenedContext())
2185 +  {
2186 +    myLocalContexts (myCurLocalIndex)->Remove (theIObj);
2187 +    for (AIS_DataMapIteratorOfDataMapOfILC aCtxIter (myLocalContexts); aCtxIter.More(); aCtxIter.Next())
2188      {
2189 -      myLocalContexts(myCurLocalIndex)->Remove(anIObj);
2190 -      AIS_DataMapIteratorOfDataMapOfILC It(myLocalContexts);
2191 -      for (;It.More() ;It.Next()){
2192 -        if(It.Value()->AcceptErase())
2193 -          It.Value()->Remove(anIObj);
2194 -        
2195 +      if (aCtxIter.Value()->AcceptErase())
2196 +      {
2197 +        aCtxIter.Value()->Remove (theIObj);
2198        }
2199 -      //      if(!WasInCtx)
2200 -      ClearGlobal(anIObj,updateviewer);
2201 -//      else
2202 -//      if(updateviewer) myMainVwr->Update();
2203      }
2204 +  }
2205 +
2206 +  ClearGlobal (theIObj, theToUpdateViewer);
2207  }
2208  
2209  //=======================================================================
2210  //function : RemoveAll
2211 -//purpose  : 
2212 +//purpose  :
2213  //=======================================================================
2214 -void AIS_InteractiveContext::RemoveAll(const Standard_Boolean updateviewer)
2215 +void AIS_InteractiveContext::RemoveAll (const Standard_Boolean theToUpdateViewer)
2216  {
2217    AIS_ListOfInteractive aList;
2218 -  ObjectsInside(aList);
2219 -  AIS_ListIteratorOfListOfInteractive aListIterator;
2220 -  for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){
2221 -    Remove(aListIterator.Value(), Standard_False);
2222 +  ObjectsInside (aList);
2223 +  for (AIS_ListIteratorOfListOfInteractive aListIterator (aList); aListIterator.More(); aListIterator.Next())
2224 +  {
2225 +    Remove (aListIterator.Value(), Standard_False);
2226    }
2227 -       
2228 -  if(updateviewer)
2229 -    myMainVwr->Update();
2230 -}
2231 -
2232 -//=======================================================================
2233 -//function : Clear
2234 -//purpose  : 
2235 -//=======================================================================
2236 -
2237 -void AIS_InteractiveContext::Clear(const Handle(AIS_InteractiveObject)& anIObj,
2238 -                                   const Standard_Boolean updateviewer)
2239 -{
2240 -  if(anIObj.IsNull()) return;
2241  
2242 -  if(!HasOpenedContext()){ 
2243 -    ClearGlobal(anIObj,updateviewer);
2244 +  if (theToUpdateViewer)
2245 +  {
2246 +    myMainVwr->Update();
2247    }
2248 -  else
2249 -    {
2250 -      
2251 -      Standard_Boolean  WasInCtx = myLocalContexts(myCurLocalIndex)->Remove(anIObj);
2252 -      AIS_DataMapIteratorOfDataMapOfILC It(myLocalContexts);
2253 -      for (;It.More() ;It.Next()){
2254 -        if(It.Value()->AcceptErase())
2255 -          WasInCtx = It.Value()->Remove(anIObj);
2256 -        
2257 -      }
2258 -      if(!WasInCtx)
2259 -        ClearGlobal(anIObj,updateviewer);
2260 -      else
2261 -        if(updateviewer) myMainVwr->Update();
2262 -    }
2263  }
2264  
2265 -
2266 -
2267 -
2268  //=======================================================================
2269  //function : ClearPrs
2270 -//purpose  : 
2271 +//purpose  :
2272  //=======================================================================
2273 -
2274 -void AIS_InteractiveContext::ClearPrs(const Handle(AIS_InteractiveObject)& anIObj,
2275 -                                      const Standard_Integer aMode,
2276 -                                      const Standard_Boolean updateviewer)
2277 +void AIS_InteractiveContext::ClearPrs (const Handle(AIS_InteractiveObject)& theIObj,
2278 +                                       const Standard_Integer               theMode,
2279 +                                       const Standard_Boolean               theToUpdateViewer)
2280  {
2281 -  if(anIObj.IsNull()) return;
2282 +  if (theIObj.IsNull())
2283 +  {
2284 +    return;
2285 +  }
2286  
2287 -  if(!HasOpenedContext()){
2288 -    ClearGlobalPrs(anIObj,aMode,updateviewer);
2289 +  if (!HasOpenedContext())
2290 +  {
2291 +    ClearGlobalPrs (theIObj, theMode, theToUpdateViewer);
2292 +    return;
2293    }
2294 -  else
2295 +
2296 +  Standard_Boolean wasInCtx = myLocalContexts (myCurLocalIndex)->ClearPrs (theIObj, theMode);
2297 +  for (AIS_DataMapIteratorOfDataMapOfILC aCtxIter (myLocalContexts); aCtxIter.More(); aCtxIter.Next())
2298 +  {
2299 +    if (aCtxIter.Value()->AcceptErase())
2300      {
2301 -      Standard_Boolean  WasInCtx = myLocalContexts(myCurLocalIndex)->ClearPrs(anIObj,aMode);
2302 -      AIS_DataMapIteratorOfDataMapOfILC It(myLocalContexts);
2303 -      for (;It.More() ;It.Next()){
2304 -        if(It.Value()->AcceptErase())
2305 -          WasInCtx = It.Value()->ClearPrs(anIObj,aMode);
2306 -      }
2307 -      if(!WasInCtx)
2308 -        ClearGlobalPrs(anIObj,aMode,updateviewer);
2309 -      else
2310 -        if(updateviewer) myMainVwr->Update();
2311 -      
2312 +      wasInCtx = aCtxIter.Value()->ClearPrs (theIObj, theMode) || wasInCtx;
2313      }
2314 +  }
2315 +  if (!wasInCtx)
2316 +  {
2317 +    ClearGlobalPrs (theIObj, theMode, theToUpdateViewer);
2318 +  }
2319 +  else if (theToUpdateViewer)
2320 +  {
2321 +    myMainVwr->Update();
2322 +  }
2323  }
2324  
2325  //=======================================================================
2326  //function : Hilight
2327 -//purpose  : 
2328 +//purpose  :
2329  //=======================================================================
2330 -
2331 -void AIS_InteractiveContext::Hilight(const Handle(AIS_InteractiveObject)& anIObj,
2332 -                                     const Standard_Boolean updateviewer)
2333 +void AIS_InteractiveContext::Hilight (const Handle(AIS_InteractiveObject)& theIObj,
2334 +                                      const Standard_Boolean               theToUpdateViewer)
2335  {
2336 -  if(anIObj.IsNull()) return;
2337 +  if (theIObj.IsNull())
2338 +  {
2339 +    return;
2340 +  }
2341  
2342 -  if(!anIObj->HasInteractiveContext()) anIObj->SetContext(this);
2343 +  if (!theIObj->HasInteractiveContext())
2344 +  {
2345 +    theIObj->SetContext (this);
2346 +  }
2347    if (!HasOpenedContext())
2348    {
2349 -    if(!myObjects.IsBound(anIObj)) return;
2350 -
2351 -    // CLE
2352 -    // const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
2353 -    // const TColStd_ListOfInteger& LL = STATUS->DisplayedModes();
2354 -    Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
2355 -
2356 -    // ENDCLE
2357 -    STATUS->SetHilightStatus (Standard_True);
2358 +    if (!myObjects.IsBound (theIObj))
2359 +    {
2360 +      return;
2361 +    }
2362  
2363 -    if (STATUS->GraphicStatus() == AIS_DS_Displayed)
2364 +    Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
2365 +    aStatus->SetHilightStatus (Standard_True);
2366 +    if (aStatus->GraphicStatus() == AIS_DS_Displayed)
2367      {
2368 -      Standard_Integer aHilightMode = anIObj->HasHilightMode() ? anIObj->HilightMode() : 0;
2369 -      myMainPM->Highlight (anIObj, aHilightMode);
2370 +      Standard_Integer aHilightMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
2371 +      myMainPM->Highlight (theIObj, aHilightMode);
2372      }
2373    }
2374    else
2375    {
2376 -    myLocalContexts(myCurLocalIndex)->Hilight(anIObj);
2377 +    myLocalContexts (myCurLocalIndex)->Hilight (theIObj);
2378    }
2379  
2380 -  if(updateviewer) myMainVwr->Update();
2381 +  if (theToUpdateViewer)
2382 +  {
2383 +    myMainVwr->Update();
2384 +  }
2385  }
2386  //=======================================================================
2387  //function : Hilight
2388 @@ -1086,153 +988,165 @@
2389  
2390  //=======================================================================
2391  //function : IsDisplayed
2392 -//purpose  : 
2393 +//purpose  :
2394  //=======================================================================
2395 -
2396 -Standard_Boolean AIS_InteractiveContext::
2397 -IsDisplayed(const Handle(AIS_InteractiveObject)& anIObj,
2398 -            const Standard_Integer aMode) const 
2399 +Standard_Boolean AIS_InteractiveContext::IsDisplayed (const Handle(AIS_InteractiveObject)& theIObj,
2400 +                                                      const Standard_Integer               theMode) const
2401  {
2402 -  if(anIObj.IsNull()) return Standard_False;
2403 -  if(myObjects.IsBound(anIObj)) {
2404 -    if(myObjects(anIObj)->GraphicStatus()==AIS_DS_Displayed &&
2405 -       myObjects(anIObj)->IsDModeIn(aMode)) 
2406 +  if (theIObj.IsNull())
2407 +  {
2408 +    return Standard_False;
2409 +  }
2410 +
2411 +  if (myObjects.IsBound (theIObj))
2412 +  {
2413 +    Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
2414 +    if (aStatus->GraphicStatus() == AIS_DS_Displayed
2415 +     && aStatus->IsDModeIn (theMode))
2416 +    {
2417        return Standard_True;
2418 +    }
2419    }
2420 -  
2421 -  AIS_DataMapIteratorOfDataMapOfILC ItM(myLocalContexts);
2422 -  for(;ItM.More();ItM.Next()){
2423 -    if(ItM.Value()->IsDisplayed(anIObj,aMode))
2424 +
2425 +  for (AIS_DataMapIteratorOfDataMapOfILC aCtxIter (myLocalContexts); aCtxIter.More(); aCtxIter.Next())
2426 +  {
2427 +    if (aCtxIter.Value()->IsDisplayed (theIObj, theMode))
2428 +    {
2429        return Standard_True;
2430 +    }
2431    }
2432    return Standard_False;
2433  }
2434  
2435 -
2436  //=======================================================================
2437  //function : DisplayPriority
2438 -//purpose  : 
2439 +//purpose  :
2440  //=======================================================================
2441 -
2442 -Standard_Integer AIS_InteractiveContext::
2443 -DisplayPriority(const Handle(AIS_InteractiveObject)& anIObj) const 
2444 +Standard_Integer AIS_InteractiveContext::DisplayPriority (const Handle(AIS_InteractiveObject)& theIObj) const
2445  {
2446 -  if(anIObj.IsNull()) return -1;
2447 +  if (theIObj.IsNull())
2448 +  {
2449 +    return -1;
2450 +  }
2451 +  else if (!myObjects.IsBound (theIObj))
2452 +  {
2453 +    return 0;
2454 +  }
2455  
2456 -  if (myObjects.IsBound(anIObj))
2457 +  Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
2458 +  if (aStatus->GraphicStatus() == AIS_DS_Displayed
2459 +   || aStatus->GraphicStatus() == AIS_DS_Erased)
2460    {
2461 -    Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
2462 -    if (STATUS->GraphicStatus() == AIS_DS_Displayed || STATUS->GraphicStatus() == AIS_DS_Erased)
2463 -    {
2464 -      Standard_Integer aDispMode = anIObj->HasDisplayMode() ? anIObj->DisplayMode() : 
2465 -                                   (anIObj->AcceptDisplayMode(myDisplayMode)? myDisplayMode : 0);
2466 -      return myMainPM->DisplayPriority (anIObj, aDispMode);
2467 -    }
2468 +    Standard_Integer aDispMode = theIObj->HasDisplayMode()
2469 +                               ? theIObj->DisplayMode()
2470 +                               : (theIObj->AcceptDisplayMode (myDisplayMode)
2471 +                                ? myDisplayMode
2472 +                                : 0);
2473 +    return myMainPM->DisplayPriority (theIObj, aDispMode);
2474    }
2475    return 0;
2476  }
2477 +
2478  //=======================================================================
2479  //function : SetDisplayPriority
2480 -//purpose  : 
2481 +//purpose  :
2482  //=======================================================================
2483 -
2484 -void AIS_InteractiveContext::SetDisplayPriority(const Handle(AIS_InteractiveObject)& anIObj,
2485 -                                               const Standard_Integer aPriority)
2486 +void AIS_InteractiveContext::SetDisplayPriority (const Handle(AIS_InteractiveObject)& theIObj,
2487 +                                                 const Standard_Integer               thePriority)
2488  {
2489 -  if(anIObj.IsNull())
2490 +  if (theIObj.IsNull())
2491 +  {
2492      return;
2493 -  if(!anIObj->HasInteractiveContext())
2494 -    anIObj->SetContext(this);
2495 -  if(myObjects.IsBound(anIObj))
2496 +  }
2497 +
2498 +  if (!theIObj->HasInteractiveContext())
2499    {
2500 -    Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
2501 +    theIObj->SetContext (this);
2502 +  }
2503  
2504 -    if (STATUS->GraphicStatus() == AIS_DS_Displayed || STATUS->GraphicStatus() == AIS_DS_Erased)
2505 -    {
2506 -      Standard_Integer aDisplayMode = anIObj->HasDisplayMode() ? anIObj->DisplayMode() : 
2507 -                                      (anIObj->AcceptDisplayMode(myDisplayMode)? myDisplayMode : 0);
2508 -      myMainPM->SetDisplayPriority (anIObj, aDisplayMode, aPriority);
2509 +  if (myObjects.IsBound (theIObj))
2510 +  {
2511 +    Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
2512 +    if (aStatus->GraphicStatus() == AIS_DS_Displayed
2513 +     || aStatus->GraphicStatus() == AIS_DS_Erased)
2514 +    {
2515 +      Standard_Integer aDisplayMode = theIObj->HasDisplayMode()
2516 +                                    ? theIObj->DisplayMode()
2517 +                                    : (theIObj->AcceptDisplayMode (myDisplayMode)
2518 +                                     ? myDisplayMode
2519 +                                     : 0);
2520 +      myMainPM->SetDisplayPriority (theIObj, aDisplayMode, thePriority);
2521      }
2522    }
2523    else if (HasOpenedContext())
2524    {
2525 -    myLocalContexts(myCurLocalIndex)->SetDisplayPriority(anIObj,aPriority);
2526 +    myLocalContexts (myCurLocalIndex)->SetDisplayPriority (theIObj, thePriority);
2527    }
2528  }
2529  
2530  //=======================================================================
2531  //function : Redisplay
2532 -//purpose  : 
2533 +//purpose  :
2534  //=======================================================================
2535 -
2536 -void AIS_InteractiveContext::Redisplay(const Handle(AIS_InteractiveObject)& anIObj,
2537 -                                      const Standard_Boolean updateviewer,
2538 -                                      const Standard_Boolean allmodes)
2539 +void AIS_InteractiveContext::Redisplay (const Handle(AIS_InteractiveObject)& theIObj,
2540 +                                        const Standard_Boolean               theToUpdateViewer,
2541 +                                        const Standard_Boolean               theAllModes)
2542  {
2543 -  if(AISDebugModeOn()){
2544 -    cout<<"===>AIS_InteractiveContext::Redisplay de :";
2545 -    cout<<anIObj->DynamicType()->Name()<<endl;
2546 -  }
2547 -
2548 -  RecomputePrsOnly(anIObj,updateviewer,allmodes);
2549 -  RecomputeSelectionOnly(anIObj);
2550 +  RecomputePrsOnly (theIObj, theToUpdateViewer, theAllModes);
2551 +  RecomputeSelectionOnly (theIObj);
2552  }
2553  
2554  //=======================================================================
2555  //function : Redisplay
2556 -//purpose  : 
2557 +//purpose  :
2558  //=======================================================================
2559 -
2560 -void AIS_InteractiveContext::Redisplay(const AIS_KindOfInteractive KOI,
2561 -                                       const Standard_Integer /*Sign*/,
2562 -                                      const Standard_Boolean updateviewer)
2563 -{
2564 -  Standard_Boolean found_viewer(Standard_False);
2565 -  // update
2566 -  for(AIS_DataMapIteratorOfDataMapOfIOStatus It(myObjects);It.More();It.Next()){
2567 -    // CLE
2568 -    // const Handle(AIS_InteractiveObject)& IO = It.Key();
2569 -    Handle(AIS_InteractiveObject) IO = It.Key();
2570 -    // ENDCLE
2571 -    if(IO->Type()== KOI){ 
2572 -#ifdef OCCT_DEBUG
2573 -//      Standard_Boolean good = (Sign==-1)? Standard_True : 
2574 -//        ((IO->Signature()==Sign)? Standard_True:Standard_False);
2575 -#endif
2576 -      Redisplay(IO,Standard_False);
2577 -      if (It.Value()->GraphicStatus() == AIS_DS_Displayed)
2578 -      {
2579 -        found_viewer = Standard_True;
2580 -      }
2581 +void AIS_InteractiveContext::Redisplay (const AIS_KindOfInteractive theKOI,
2582 +                                        const Standard_Integer    /*theSign*/,
2583 +                                        const Standard_Boolean      theToUpdateViewer)
2584 +{
2585 +  Standard_Boolean isRedisplayed = Standard_False;
2586 +  for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
2587 +  {
2588 +    Handle(AIS_InteractiveObject) anObj = anObjIter.Key();
2589 +    if (anObj->Type() != theKOI)
2590 +    {
2591 +      continue;
2592      }
2593 +
2594 +    Redisplay (anObj, Standard_False);
2595 +    isRedisplayed = anObjIter.Value()->GraphicStatus() == AIS_DS_Displayed
2596 +                 || isRedisplayed;
2597    }
2598 -  // update viewer...
2599 -  if(updateviewer && found_viewer)
2600 +
2601 +  if (theToUpdateViewer
2602 +   && isRedisplayed)
2603    {
2604      myMainVwr->Update();
2605    }
2606  }
2607  
2608 -
2609  //=======================================================================
2610  //function : RecomputePrsOnly
2611 -//purpose  : 
2612 +//purpose  :
2613  //=======================================================================
2614 -
2615 -void AIS_InteractiveContext::RecomputePrsOnly(const Handle(AIS_InteractiveObject)& anIObj,
2616 -                                              const Standard_Boolean updateviewer,
2617 -                                              const Standard_Boolean allmodes)
2618 +void AIS_InteractiveContext::RecomputePrsOnly (const Handle(AIS_InteractiveObject)& theIObj,
2619 +                                               const Standard_Boolean               theToUpdateViewer,
2620 +                                               const Standard_Boolean               theAllModes)
2621  {
2622 -  if(anIObj.IsNull()) return;
2623 -  anIObj->Update(allmodes);
2624 +  if (theIObj.IsNull())
2625 +  {
2626 +    return;
2627 +  }
2628  
2629 -  if (!updateviewer)
2630 +  theIObj->Update (theAllModes);
2631 +  if (!theToUpdateViewer)
2632    {
2633      return;
2634    }
2635  
2636 -  if (HasOpenedContext() ||
2637 -     (myObjects.IsBound(anIObj) && myObjects(anIObj)->GraphicStatus() == AIS_DS_Displayed))
2638 +  if (HasOpenedContext()
2639 +   || (myObjects.IsBound (theIObj)
2640 +    && myObjects (theIObj)->GraphicStatus() == AIS_DS_Displayed))
2641    {
2642      myMainVwr->Update();
2643    }
2644 @@ -1276,21 +1190,19 @@
2645  
2646  //=======================================================================
2647  //function : Update
2648 -//purpose  : 
2649 +//purpose  :
2650  //=======================================================================
2651  void AIS_InteractiveContext::Update (const Handle(AIS_InteractiveObject)& theIObj,
2652 -                                     const Standard_Boolean theUpdateViewer)
2653 +                                     const Standard_Boolean               theUpdateViewer)
2654  {
2655    if (theIObj.IsNull())
2656    {
2657      return;
2658    }
2659  
2660 -  TColStd_ListOfInteger aListOfFlaggedPrsModes;
2661 -  theIObj->ToBeUpdated (aListOfFlaggedPrsModes);
2662 -
2663 -  TColStd_ListIteratorOfListOfInteger aPrsModesIt (aListOfFlaggedPrsModes);
2664 -  for ( ; aPrsModesIt.More(); aPrsModesIt.Next())
2665 +  TColStd_ListOfInteger aPrsModes;
2666 +  theIObj->ToBeUpdated (aPrsModes);
2667 +  for (TColStd_ListIteratorOfListOfInteger aPrsModesIt (aPrsModes); aPrsModesIt.More(); aPrsModesIt.Next())
2668    {
2669      theIObj->Update (aPrsModesIt.Value(), Standard_False);
2670    }
2671 @@ -1323,138 +1235,142 @@
2672  
2673  //=======================================================================
2674  //function : SetLocation
2675 -//purpose  : 
2676 +//purpose  :
2677  //=======================================================================
2678 -
2679 -void AIS_InteractiveContext::SetLocation(const Handle(AIS_InteractiveObject)& anIObj,
2680 -                                         const TopLoc_Location& aLoc)
2681 +void AIS_InteractiveContext::SetLocation (const Handle(AIS_InteractiveObject)& theIObj,
2682 +                                          const TopLoc_Location&               theLoc)
2683  {
2684 -  if(anIObj.IsNull()) return;
2685 -
2686 +  if (theIObj.IsNull())
2687 +  {
2688 +    return;
2689 +  }
2690  
2691 -  if(anIObj->HasTransformation() && aLoc.IsIdentity()){
2692 -    anIObj->ResetTransformation();
2693 -    mgrSelector->Update(anIObj,Standard_False);
2694 +  if (theIObj->HasTransformation()
2695 +   && theLoc.IsIdentity())
2696 +  {
2697 +    theIObj->ResetTransformation();
2698 +    mgrSelector->Update (theIObj, Standard_False);
2699 +    return;
2700 +  }
2701 +  else if (theLoc.IsIdentity())
2702 +  {
2703      return;
2704    }
2705 -  if(aLoc.IsIdentity()) return ;
2706  
2707    // first reset the previous location to properly clean everything...
2708 -  if(anIObj->HasTransformation())
2709 -    anIObj->ResetTransformation();
2710 +  if (theIObj->HasTransformation())
2711 +  {
2712 +    theIObj->ResetTransformation();
2713 +  }
2714  
2715 +  theIObj->SetLocalTransformation (theLoc.Transformation());
2716  
2717 -  anIObj->SetLocalTransformation (aLoc.Transformation());
2718 -  
2719 -  if(!HasOpenedContext())
2720 -    mgrSelector->Update(anIObj,Standard_False);
2721 +  if (!HasOpenedContext())
2722 +  {
2723 +    mgrSelector->Update (theIObj, Standard_False);
2724 +  }
2725    else
2726 -    {
2727 -      // CLE
2728 -      // const Handle(StdSelect_ViewerSelector3d)& tempSel = myLocalContexts(myCurLocalIndex)->MainSelector();
2729 -      Handle(StdSelect_ViewerSelector3d) tempSel = myLocalContexts(myCurLocalIndex)->MainSelector();
2730 -      // ENDCLE
2731 -      mgrSelector->Update(anIObj,tempSel,Standard_False);
2732 -    }
2733 +  {
2734 +    Handle(StdSelect_ViewerSelector3d) aTempSel = myLocalContexts (myCurLocalIndex)->MainSelector();
2735 +    mgrSelector->Update (theIObj, aTempSel, Standard_False);
2736 +  }
2737  }
2738 +
2739  //=======================================================================
2740  //function : ResetLocation
2741 -//purpose  : 
2742 +//purpose  :
2743  //=======================================================================
2744 -void AIS_InteractiveContext::ResetLocation(const Handle(AIS_InteractiveObject)& anIObj)
2745 +void AIS_InteractiveContext::ResetLocation (const Handle(AIS_InteractiveObject)& theIObj)
2746  {
2747 -  if(anIObj.IsNull()) return;
2748 +  if (theIObj.IsNull())
2749 +  {
2750 +    return;
2751 +  }
2752  
2753 -  anIObj->ResetTransformation();
2754 -  mgrSelector->Update(anIObj,Standard_False);
2755 +  theIObj->ResetTransformation();
2756 +  mgrSelector->Update (theIObj, Standard_False);
2757  }
2758  
2759  //=======================================================================
2760  //function : HasLocation
2761 -//purpose  : 
2762 +//purpose  :
2763  //=======================================================================
2764 -
2765 -Standard_Boolean AIS_InteractiveContext::
2766 -HasLocation(const Handle(AIS_InteractiveObject)& anIObj) const
2767 +Standard_Boolean AIS_InteractiveContext::HasLocation (const Handle(AIS_InteractiveObject)& theIObj) const
2768  {
2769 -  if(anIObj.IsNull()) return Standard_False;
2770 -
2771 -  return anIObj->HasTransformation();
2772 +  return !theIObj.IsNull()
2773 +       && theIObj->HasTransformation();
2774  }
2775  
2776 -TopLoc_Location AIS_InteractiveContext::
2777 -Location(const Handle(AIS_InteractiveObject)& anIObj) const
2778 +//=======================================================================
2779 +//function : Location
2780 +//purpose  :
2781 +//=======================================================================
2782 +TopLoc_Location AIS_InteractiveContext::Location (const Handle(AIS_InteractiveObject)& theIObj) const
2783  {
2784 -  return anIObj->Transformation();
2785 +  return theIObj->Transformation();
2786  }
2787  
2788  //=======================================================================
2789  //function : SetDeviationCoefficient
2790 -//purpose  : 
2791 +//purpose  :
2792  //=======================================================================
2793 -
2794 -void AIS_InteractiveContext::SetDeviationCoefficient(const Standard_Real aCoefficient)
2795 +void AIS_InteractiveContext::SetDeviationCoefficient (const Standard_Real theCoefficient)
2796  {
2797 -  myDefaultDrawer->SetDeviationCoefficient(aCoefficient);
2798 +  myDefaultDrawer->SetDeviationCoefficient (theCoefficient);
2799  }
2800 +
2801  //=======================================================================
2802  //function : SetDeviationAngle
2803 -//purpose  : 
2804 +//purpose  :
2805  //=======================================================================
2806 -
2807 -void AIS_InteractiveContext::SetDeviationAngle(const Standard_Real anAngle)
2808 +void AIS_InteractiveContext::SetDeviationAngle (const Standard_Real theAngle)
2809  {
2810 -  myDefaultDrawer->SetDeviationCoefficient(anAngle);
2811 +  myDefaultDrawer->SetDeviationCoefficient (theAngle);
2812  }
2813  
2814  //=======================================================================
2815  //function : DeviationAngle
2816  //purpose  : Gets  deviationAngle
2817  //=======================================================================
2818 -
2819  Standard_Real AIS_InteractiveContext::DeviationAngle() const
2820  {
2821 -  //return M_PI/180.0e0 ;
2822 -    return myDefaultDrawer->DeviationAngle();
2823 +  return myDefaultDrawer->DeviationAngle();
2824  }
2825  
2826  //=======================================================================
2827  //function : DeviationCoefficient
2828 -//purpose  : 
2829 +//purpose  :
2830  //=======================================================================
2831 -
2832 -Standard_Real AIS_InteractiveContext::DeviationCoefficient() const 
2833 +Standard_Real AIS_InteractiveContext::DeviationCoefficient() const
2834  {
2835    return myDefaultDrawer->DeviationCoefficient();
2836  }
2837 +
2838  //=======================================================================
2839  //function : SetHLRDeviationCoefficient
2840 -//purpose  : 
2841 +//purpose  :
2842  //=======================================================================
2843 -
2844 -void AIS_InteractiveContext::SetHLRDeviationCoefficient(const Standard_Real aCoefficient)
2845 +void AIS_InteractiveContext::SetHLRDeviationCoefficient (const Standard_Real theCoefficient)
2846  {
2847 -  myDefaultDrawer->SetHLRDeviationCoefficient(aCoefficient);
2848 +  myDefaultDrawer->SetHLRDeviationCoefficient (theCoefficient);
2849  }
2850  
2851  //=======================================================================
2852  //function : HLRDeviationCoefficient
2853 -//purpose  : 
2854 +//purpose  :
2855  //=======================================================================
2856 -
2857 -Standard_Real AIS_InteractiveContext::HLRDeviationCoefficient() const 
2858 +Standard_Real AIS_InteractiveContext::HLRDeviationCoefficient() const
2859  {
2860    return myDefaultDrawer->HLRDeviationCoefficient();
2861  }
2862  
2863  //=======================================================================
2864  //function : SetHLRAngle
2865 -//purpose  : 
2866 +//purpose  :
2867  //=======================================================================
2868 -
2869 -void AIS_InteractiveContext::SetHLRAngle(const Standard_Real anAngle)
2870 +void AIS_InteractiveContext::SetHLRAngle (const Standard_Real theAngle)
2871  {
2872 -  myDefaultDrawer->SetHLRAngle(anAngle);
2873 +  myDefaultDrawer->SetHLRAngle (theAngle);
2874  }
2875  
2876  //=======================================================================
2877 @@ -1463,23 +1379,19 @@
2878  //           and set them in myHLRAngle and in myHLRDeviationCoefficient
2879  //           of myDefaultDrawer 
2880  //=======================================================================
2881 -
2882 -void AIS_InteractiveContext::SetHLRAngleAndDeviation(const Standard_Real anAngle)
2883 +void AIS_InteractiveContext::SetHLRAngleAndDeviation (const Standard_Real theAngle)
2884  {
2885 +  Standard_Real anOutAngl, anOutDefl;
2886 +  HLRBRep::PolyHLRAngleAndDeflection (theAngle, anOutAngl, anOutDefl);
2887  
2888 -  Standard_Real OutAngl,OutDefl;
2889 -  HLRBRep::PolyHLRAngleAndDeflection(anAngle,OutAngl,OutDefl);
2890 -
2891 -  myDefaultDrawer->SetHLRAngle(OutAngl);
2892 -  myDefaultDrawer->SetHLRDeviationCoefficient(OutDefl);
2893 -
2894 +  myDefaultDrawer->SetHLRAngle                (anOutAngl);
2895 +  myDefaultDrawer->SetHLRDeviationCoefficient (anOutDefl);
2896  }
2897  
2898  //=======================================================================
2899  //function : HLRAngle
2900 -//purpose  : 
2901 +//purpose  :
2902  //=======================================================================
2903 -
2904  Standard_Real AIS_InteractiveContext::HLRAngle() const 
2905  {
2906    return myDefaultDrawer->HLRAngle();
2907 @@ -1487,1348 +1399,1320 @@
2908  
2909  //=======================================================================
2910  //function : SetDisplayMode
2911 -//purpose  : 
2912 +//purpose  :
2913  //=======================================================================
2914 -
2915 -void AIS_InteractiveContext::SetDisplayMode(const AIS_DisplayMode aMode,
2916 -                                           const Standard_Boolean updateviewer)
2917 +void AIS_InteractiveContext::SetDisplayMode (const AIS_DisplayMode  theMode,
2918 +                                             const Standard_Boolean theToUpdateViewer)
2919  {
2920 -  if(aMode==myDisplayMode) return;
2921 -  AIS_DataMapIteratorOfDataMapOfIOStatus It(myObjects);
2922 +  if (theMode == myDisplayMode)
2923 +  {
2924 +    return;
2925 +  }
2926  
2927 -  for(;It.More();It.Next()){
2928 -    // CLE
2929 -    // const Handle(AIS_InteractiveObject)& anObj = It.Key();
2930 -    Handle(AIS_InteractiveObject) anObj = It.Key();
2931 -    // ENDCLE
2932 -    Standard_Boolean Processed = (anObj->IsKind(STANDARD_TYPE(AIS_Shape)) ||
2933 -                                  anObj->IsKind(STANDARD_TYPE(AIS_ConnectedInteractive)) ||
2934 -                                  anObj->IsKind(STANDARD_TYPE(AIS_MultipleConnectedInteractive)) );
2935 +  for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
2936 +  {
2937 +    Handle(AIS_InteractiveObject) anObj = anObjIter.Key();
2938 +    Standard_Boolean toProcess = anObj->IsKind (STANDARD_TYPE(AIS_Shape))
2939 +                              || anObj->IsKind (STANDARD_TYPE(AIS_ConnectedInteractive))
2940 +                              || anObj->IsKind (STANDARD_TYPE(AIS_MultipleConnectedInteractive));
2941      
2942 -    if ((!anObj->HasDisplayMode()) && Processed) 
2943 +    if (!toProcess
2944 +     ||  anObj->HasDisplayMode()
2945 +     || !anObj->AcceptDisplayMode (theMode))
2946 +    {
2947 +      continue;
2948 +    }
2949 +
2950 +    Handle(AIS_GlobalStatus) aStatus = anObjIter.Value();
2951 +    if (aStatus->IsDModeIn (myDisplayMode))
2952 +    {
2953 +      aStatus->RemoveDisplayMode (myDisplayMode);
2954 +    }
2955 +
2956 +    aStatus->AddDisplayMode (theMode);
2957 +    if (aStatus->GraphicStatus() == AIS_DS_Displayed)
2958 +    {
2959 +      myMainPM->SetVisibility (anObj, myDisplayMode, Standard_False);
2960 +      myMainPM->Display (anObj, theMode);
2961 +      if (aStatus->IsSubIntensityOn())
2962        {
2963 -        if(anObj->AcceptDisplayMode(aMode)){
2964 -          // CLE
2965 -          // const Handle(AIS_GlobalStatus)& STATUS = It.Value();
2966 -          Handle(AIS_GlobalStatus) STATUS = It.Value();
2967 -          // ENDCLE
2968 -          if(STATUS->IsDModeIn(myDisplayMode))
2969 -            STATUS->RemoveDisplayMode(myDisplayMode);
2970 -          
2971 -          STATUS->AddDisplayMode(aMode);
2972 -          
2973 -          if(STATUS->GraphicStatus()== AIS_DS_Displayed){
2974 -            myMainPM->SetVisibility (anObj, myDisplayMode, Standard_False);
2975 -            myMainPM->Display(anObj, aMode);
2976 -            if(STATUS->IsSubIntensityOn())
2977 -              myMainPM->Color(anObj,mySubIntensity,aMode);
2978 -          }
2979 -          //  myDisplayMode = aMode;
2980 -        }
2981 +        myMainPM->Color (anObj, mySubIntensity, theMode);
2982        }
2983 -    
2984 -  } 
2985 -  myDisplayMode = aMode;
2986 -  if(updateviewer) myMainVwr->Update();
2987 -}
2988 -
2989 +    }
2990 +  }
2991 +
2992 +  myDisplayMode = theMode;
2993 +  if (theToUpdateViewer)
2994 +  {
2995 +    myMainVwr->Update();
2996 +  }
2997 +}
2998 +
2999  //=======================================================================
3000  //function : SetDisplayMode
3001 -//purpose  : 
3002 +//purpose  :
3003  //=======================================================================
3004 -
3005 -void AIS_InteractiveContext::SetDisplayMode(const Handle(AIS_InteractiveObject)& anIObj, 
3006 -                                           const Standard_Integer aMode,
3007 -                                           const Standard_Boolean updateviewer)
3008 +void AIS_InteractiveContext::SetDisplayMode (const Handle(AIS_InteractiveObject)& theIObj,
3009 +                                             const Standard_Integer               theMode,
3010 +                                             const Standard_Boolean               theToUpdateViewer)
3011  {
3012 -  
3013 -  if(!anIObj->HasInteractiveContext())
3014 -    anIObj->SetContext(this);
3015 -  if(!HasOpenedContext()){
3016 -    
3017 -    if(!myObjects.IsBound(anIObj)) 
3018 -      anIObj->SetDisplayMode(aMode);
3019 -    else if( anIObj->AcceptDisplayMode(aMode) ) 
3020 -    {
3021 -      // CLE
3022 -      // const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
3023 -      Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
3024 -      // ENDCLE
3025 -      // SAN : erase presentations for all display modes different from <aMode>
3026 -      if(STATUS->GraphicStatus()==AIS_DS_Displayed){
3027 -        TColStd_ListOfInteger aModesToRemove;
3028 -        TColStd_ListIteratorOfListOfInteger ItL (STATUS->DisplayedModes());
3029 -        for(;ItL.More();ItL.Next()){
3030 -
3031 -          Standard_Integer OldMode = ItL.Value();
3032 -
3033 -          if(OldMode!=aMode){
3034 -            aModesToRemove.Append(OldMode);
3035 -            if(myMainPM->IsHighlighted(anIObj,OldMode))
3036 -              myMainPM->Unhighlight(anIObj,OldMode);
3037 -            myMainPM->SetVisibility (anIObj, OldMode, Standard_False);
3038 -          }
3039 -        }
3040 +  if (!theIObj->HasInteractiveContext())
3041 +  {
3042 +    theIObj->SetContext(this);
3043 +  }
3044 +
3045 +  if (HasOpenedContext())
3046 +  {
3047 +    return;
3048 +  }
3049  
3050 -        for(ItL.Initialize(aModesToRemove);ItL.More();ItL.Next())
3051 -          STATUS->RemoveDisplayMode(ItL.Value());
3052 +  if (!myObjects.IsBound (theIObj))
3053 +  {
3054 +    theIObj->SetDisplayMode (theMode);
3055 +    return;
3056 +  }
3057 +  else if (!theIObj->AcceptDisplayMode (theMode))
3058 +  {
3059 +    return;
3060 +  }
3061  
3062 -        if(!STATUS->IsDModeIn(aMode))
3063 -          STATUS->AddDisplayMode(aMode);
3064 +  Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
3065 +  if (aStatus->GraphicStatus() != AIS_DS_Displayed)
3066 +  {
3067 +    theIObj->SetDisplayMode (theMode);
3068 +    return;
3069 +  }
3070  
3071 -        myMainPM->Display(anIObj,aMode);
3072 -        Standard_Integer DM,HM,SM;
3073 -        GetDefModes(anIObj,DM,HM,SM);
3074 -        if(STATUS->IsHilighted()){
3075 -          myMainPM->Highlight(anIObj,HM);
3076 -        }
3077 -        if(STATUS->IsSubIntensityOn()){
3078 -          myMainPM->Color(anIObj,mySubIntensity,aMode);
3079 -        }
3080 -        if(anIObj->IsTransparent() && !myMainVwr->Viewer()->Transparency())
3081 -          myMainVwr->Viewer()->SetTransparency(Standard_True);
3082 -        
3083 -        if(updateviewer) myMainVwr->Update();
3084 +  // erase presentations for all display modes different from <aMode>
3085 +  TColStd_ListOfInteger aModesToRemove;
3086 +  for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
3087 +  {
3088 +    const Standard_Integer anOldMode = aDispModeIter.Value();
3089 +    if (anOldMode != theMode)
3090 +    {
3091 +      aModesToRemove.Append (anOldMode);
3092 +      if (myMainPM->IsHighlighted (theIObj, anOldMode))
3093 +      {
3094 +        myMainPM->Unhighlight (theIObj, anOldMode);
3095        }
3096 -      anIObj->SetDisplayMode(aMode);
3097 +      myMainPM->SetVisibility (theIObj, anOldMode, Standard_False);
3098      }
3099    }
3100 +
3101 +  for (TColStd_ListIteratorOfListOfInteger aRemModeIter (aModesToRemove); aRemModeIter.More(); aRemModeIter.Next())
3102 +  {
3103 +    aStatus->RemoveDisplayMode (aRemModeIter.Value());
3104 +  }
3105 +
3106 +  if (!aStatus->IsDModeIn (theMode))
3107 +  {
3108 +    aStatus->AddDisplayMode (theMode);
3109 +  }
3110 +
3111 +  myMainPM->Display (theIObj, theMode);
3112 +  Standard_Integer aDispMode, aHiMode, aSelMode;
3113 +  GetDefModes (theIObj, aDispMode, aHiMode, aSelMode);
3114 +  if (aStatus->IsHilighted())
3115 +  {
3116 +    myMainPM->Highlight (theIObj, aHiMode);
3117 +  }
3118 +  if (aStatus->IsSubIntensityOn())
3119 +  {
3120 +    myMainPM->Color (theIObj, mySubIntensity, theMode);
3121 +  }
3122 +
3123 +  if (theToUpdateViewer)
3124 +  {
3125 +    myMainVwr->Update();
3126 +  }
3127 +  theIObj->SetDisplayMode (theMode);
3128  }
3129  
3130  //=======================================================================
3131  //function : UnsetDisplayMode
3132 -//purpose  : 
3133 +//purpose  :
3134  //=======================================================================
3135 -
3136 -void AIS_InteractiveContext::
3137 -UnsetDisplayMode(const Handle(AIS_InteractiveObject)& anIObj,
3138 -                 const Standard_Boolean updateviewer)
3139 +void AIS_InteractiveContext::UnsetDisplayMode (const Handle(AIS_InteractiveObject)& theIObj,
3140 +                                               const Standard_Boolean               theToUpdateViewer)
3141  {
3142 -  if(anIObj.IsNull()) return ;
3143 -  if(!anIObj->HasDisplayMode()) return;
3144 -  
3145 -  if(!myObjects.IsBound(anIObj))
3146 -    anIObj->UnsetDisplayMode();
3147 -  else
3148 +  if (theIObj.IsNull()
3149 +  || !theIObj->HasDisplayMode())
3150 +  {
3151 +    return;
3152 +  }
3153 +
3154 +  if (!myObjects.IsBound (theIObj))
3155 +  {
3156 +    theIObj->UnsetDisplayMode();
3157 +    return;
3158 +  }
3159 +
3160 +  const Standard_Integer anOldMode = theIObj->DisplayMode();
3161 +  if (myDisplayMode == anOldMode)
3162 +  {
3163 +    return;
3164 +  }
3165 +
3166 +  const Handle(AIS_GlobalStatus)& aStatus = myObjects (theIObj);
3167 +  aStatus->RemoveDisplayMode (anOldMode);
3168 +  if (!aStatus->IsDModeIn(myDisplayMode))
3169 +  {
3170 +    aStatus->AddDisplayMode (myDisplayMode);
3171 +  }
3172 +
3173 +  if (aStatus->GraphicStatus() == AIS_DS_Displayed)
3174 +  {
3175 +    if (myMainPM->IsHighlighted (theIObj, anOldMode))
3176      {
3177 -      Standard_Integer OldMode = anIObj->DisplayMode();
3178 -      if(myDisplayMode==OldMode) return;
3179 -      const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
3180 -      STATUS->RemoveDisplayMode(OldMode);
3181 -      if(!STATUS->IsDModeIn(myDisplayMode))
3182 -        STATUS->AddDisplayMode(myDisplayMode);
3183 -      if(STATUS->GraphicStatus()==AIS_DS_Displayed){
3184 -        if(myMainPM->IsHighlighted(anIObj,OldMode))
3185 -          myMainPM->Unhighlight(anIObj,OldMode);
3186 -        myMainPM->SetVisibility (anIObj, OldMode, Standard_False);
3187 -        myMainPM->Display(anIObj,myDisplayMode);
3188 -        Standard_Integer DM,HM,SM;
3189 -        GetDefModes(anIObj,DM,HM,SM);
3190 -        if(STATUS->IsHilighted()){
3191 -          myMainPM->Highlight(anIObj,HM);
3192 -        }
3193 -        if(STATUS->IsSubIntensityOn()){
3194 -          myMainPM->Color(anIObj,mySubIntensity,myDisplayMode);
3195 -        }
3196 -        if(updateviewer) myMainVwr->Update();
3197 -      }
3198 -      anIObj->UnsetDisplayMode();
3199 -      
3200 +      myMainPM->Unhighlight (theIObj, anOldMode);
3201      }
3202 +    myMainPM->SetVisibility (theIObj, anOldMode, Standard_False);
3203 +    myMainPM->Display (theIObj, myDisplayMode);
3204 +
3205 +    Standard_Integer aDispMode, aHiMode, aSelMode;
3206 +    GetDefModes (theIObj, aDispMode, aHiMode, aSelMode);
3207 +    if (aStatus->IsHilighted())
3208 +    {
3209 +      myMainPM->Highlight (theIObj, aHiMode);
3210 +    }
3211 +    if (aStatus->IsSubIntensityOn())
3212 +    {
3213 +      myMainPM->Color (theIObj, mySubIntensity, myDisplayMode);
3214 +    }
3215 +
3216 +    if (theToUpdateViewer)
3217 +    {
3218 +      myMainVwr->Update();
3219 +    }
3220 +  }
3221 +
3222 +  theIObj->UnsetDisplayMode();
3223  }
3224  
3225  //=======================================================================
3226  //function : SetCurrentFacingModel
3227 -//purpose  : 
3228 +//purpose  :
3229  //=======================================================================
3230 -
3231 -void AIS_InteractiveContext::SetCurrentFacingModel(
3232 -                        const Handle(AIS_InteractiveObject)& anIObj,
3233 -                        const Aspect_TypeOfFacingModel aModel)
3234 +void AIS_InteractiveContext::SetCurrentFacingModel (const Handle(AIS_InteractiveObject)& theIObj,
3235 +                                                    const Aspect_TypeOfFacingModel       theModel)
3236  {
3237 -  if (  !anIObj.IsNull ()  )
3238 -    anIObj->SetCurrentFacingModel(aModel);
3239 +  if (!theIObj.IsNull())
3240 +  {
3241 +    theIObj->SetCurrentFacingModel (theModel);
3242 +  }
3243  }
3244  
3245  //=======================================================================
3246 -//function : SetColor
3247 -//purpose  : 
3248 +//function : redisplayPrsRecModes
3249 +//purpose  :
3250  //=======================================================================
3251 -
3252 -void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIObj, 
3253 -                                     const Quantity_NameOfColor aColor,
3254 -                                     const Standard_Boolean updateviewer)
3255 +void AIS_InteractiveContext::redisplayPrsRecModes (const Handle(AIS_InteractiveObject)& theIObj,
3256 +                                                   const Standard_Boolean               theToUpdateViewer)
3257  {
3258 -  SetColor(anIObj,Quantity_Color(aColor),updateviewer);
3259 +  if (theIObj->RecomputeEveryPrs())
3260 +  {
3261 +    theIObj->Redisplay();
3262 +  }
3263 +  else
3264 +  {
3265 +    for (TColStd_ListIteratorOfListOfInteger aModes (theIObj->ListOfRecomputeModes()); aModes.More(); aModes.Next())
3266 +    {
3267 +      theIObj->Update (aModes.Value(), Standard_False);
3268 +    }
3269 +    theIObj->SetRecomputeOk();
3270 +  }
3271 +
3272 +  if (theToUpdateViewer)
3273 +  {
3274 +    UpdateCurrentViewer();
3275 +  }
3276  }
3277  
3278 -void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIObj, 
3279 -                                     const Quantity_Color &aColor,
3280 -                                     const Standard_Boolean updateviewer)
3281 +//=======================================================================
3282 +//function : redisplayPrsModes
3283 +//purpose  :
3284 +//=======================================================================
3285 +void AIS_InteractiveContext::redisplayPrsModes (const Handle(AIS_InteractiveObject)& theIObj,
3286 +                                                const Standard_Boolean               theToUpdateViewer)
3287  {
3288 -  if(anIObj.IsNull()) return ;
3289
3290 -  if(!anIObj->HasInteractiveContext())
3291 -    anIObj->SetContext(this);
3292 -  anIObj->SetColor(aColor);
3293 -  if(anIObj->RecomputeEveryPrs())
3294 -    anIObj->Redisplay();
3295 +  if (theIObj->RecomputeEveryPrs())
3296 +  {
3297 +    theIObj->Redisplay();
3298 +  }
3299    else
3300 +  {
3301 +    TColStd_ListOfInteger aModes;
3302 +    theIObj->ToBeUpdated (aModes);
3303 +    for (TColStd_ListIteratorOfListOfInteger aModeIter (aModes); aModeIter.More(); aModeIter.Next())
3304      {
3305 -      Standard_Integer NbDisp=0;
3306 -      TColStd_ListIteratorOfListOfInteger ITI(anIObj->ListOfRecomputeModes());
3307 -      for (;ITI.More();ITI.Next())
3308 -        {
3309 -          anIObj->Update(ITI.Value(),Standard_False);
3310 -          NbDisp++;
3311 -        }
3312 -      anIObj->SetRecomputeOk();
3313 -#ifdef OCCT_DEBUG
3314 -      cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
3315 -#endif
3316 +      theIObj->Update (aModeIter.Value(), Standard_False);
3317      }
3318 +    theIObj->SetRecomputeOk();
3319 +  }
3320  
3321 -
3322 -#ifdef OCCT_DEBUG
3323 -//   // pour isg
3324 -//   if(anIObj->Type()==AIS_KOI_Datum && anIObj->Signature()==3){
3325 -//     Handle(AIS_Trihedron) Tr = *((Handle(AIS_Trihedron)*)&anIObj);
3326 -//     Standard_Real Lx = myDefaultDrawer->DatumAspect()->FirstAxisLength();
3327 -//     gp_Trsf T; 
3328 -//     gp_Dir D =Tr->Component()->XDirection();
3329 -//     gp_Pnt O = Tr->Component()->Location();
3330 -//     gp_Vec V(D);V*=Lx/5.;
3331 -//     T.SetRotation(gp_Ax1(O,D),M_PI/6.);
3332 -//     T.SetTranslationPart(V);
3333 -//     TopLoc_Location L,IncLoc(T);
3334 -   
3335 -//     for(Standard_Integer I=1;I<90;I++){
3336 -//       if(anIObj->HasLocation())
3337 -//      L = anIObj->Location() * IncLoc;
3338 -//       else
3339 -//      L = IncLoc;
3340 -//       SetLocation(anIObj,L);
3341 -//       UpdateCurrentViewer();
3342 -//     }
3343 -//      for(I=1;I<90;I++){
3344 -//        L = anIObj->Location() /IncLoc;
3345 -//       SetLocation(anIObj,L);
3346 -//       UpdateCurrentViewer();
3347 -//     }
3348 -//    ResetLocation(anIObj);
3349 -//   }
3350 - #endif
3351 -  if(updateviewer) UpdateCurrentViewer();
3352 +  if (theToUpdateViewer)
3353 +  {
3354 +    UpdateCurrentViewer();
3355 +  }
3356  }
3357  
3358  //=======================================================================
3359 -//function : SetDeviationCoefficient
3360 -//purpose  : 
3361 +//function : SetColor
3362 +//purpose  :
3363  //=======================================================================
3364 +void AIS_InteractiveContext::SetColor (const Handle(AIS_InteractiveObject)& theIObj,
3365 +                                       const Quantity_NameOfColor           theColor,
3366 +                                       const Standard_Boolean               theToUpdateViewer)
3367 +{
3368 +  SetColor (theIObj, Quantity_Color(theColor), theToUpdateViewer);
3369 +}
3370  
3371 -void AIS_InteractiveContext::SetDeviationCoefficient(
3372 -                                     const Handle(AIS_InteractiveObject)& anIObj, 
3373 -                                     const Standard_Real   aCoefficient,
3374 -                                     const Standard_Boolean updateviewer)
3375 +//=======================================================================
3376 +//function : SetColor
3377 +//purpose  :
3378 +//=======================================================================
3379 +void AIS_InteractiveContext::SetColor (const Handle(AIS_InteractiveObject)& theIObj,
3380 +                                       const Quantity_Color&                theColor,
3381 +                                       const Standard_Boolean               theToUpdateViewer)
3382  {
3383 -//  cout<<" Coefficient:"<< aCoefficient <<endl;
3384 -  if(anIObj.IsNull()) return ;
3385
3386 -  if(!anIObj->HasInteractiveContext())
3387 -    anIObj->SetContext(this);
3388 +  if (theIObj.IsNull())
3389 +  {
3390 +    return;
3391 +  }
3392  
3393 -  // To be modified after the related methods of AIS_Shape are passed to InteractiveObject
3394 -  if(anIObj->Type()!=AIS_KOI_Object && anIObj->Type()!=AIS_KOI_Shape) return;
3395 -  if(anIObj->Signature()!=0) return;
3396 -  (*((Handle(AIS_Shape)*)&anIObj))->SetOwnDeviationCoefficient(aCoefficient);
3397 +  if (!theIObj->HasInteractiveContext())
3398 +  {
3399 +    theIObj->SetContext (this);
3400 +  }
3401 +  theIObj->SetColor (theColor);
3402 +  redisplayPrsRecModes (theIObj, theToUpdateViewer);
3403 +}
3404  
3405 +//=======================================================================
3406 +//function : SetDeviationCoefficient
3407 +//purpose  :
3408 +//=======================================================================
3409 +void AIS_InteractiveContext::SetDeviationCoefficient (const Handle(AIS_InteractiveObject)& theIObj,
3410 +                                                      const Standard_Real                  theCoefficient,
3411 +                                                      const Standard_Boolean               theToUpdateViewer)
3412 +{
3413 +  if (theIObj.IsNull())
3414 +  {
3415 +    return;
3416 +  }
3417  
3418 +  if (!theIObj->HasInteractiveContext())
3419 +  {
3420 +    theIObj->SetContext (this);
3421 +  }
3422  
3423 -  if(anIObj->RecomputeEveryPrs())
3424 -    anIObj->Redisplay();
3425 -  else
3426 -    {
3427 -      Standard_Integer NbDisp=0;
3428 -      TColStd_ListOfInteger LL;
3429 -      anIObj->ToBeUpdated(LL);
3430 -      TColStd_ListIteratorOfListOfInteger ITI(LL);
3431 -      for (;ITI.More();ITI.Next())
3432 -        {
3433 -          anIObj->Update(ITI.Value(),Standard_False);
3434 -          NbDisp++;
3435 -        }
3436 -      anIObj->SetRecomputeOk();
3437 -#ifdef OCCT_DEBUG
3438 -      cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
3439 -#endif
3440 -    }
3441 -  if(updateviewer) UpdateCurrentViewer();
3442 +  // to be modified after the related methods of AIS_Shape are passed to InteractiveObject
3443 +  if (theIObj->Type() != AIS_KOI_Object
3444 +   && theIObj->Type() != AIS_KOI_Shape)
3445 +  {
3446 +    return;
3447 +  }
3448 +  else if (theIObj->Signature() != 0)
3449 +  {
3450 +    return;
3451 +  }
3452 +
3453 +  Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
3454 +  aShape->SetOwnDeviationCoefficient (theCoefficient);
3455 +  redisplayPrsModes (theIObj, theToUpdateViewer);
3456  }
3457  
3458  //=======================================================================
3459  //function : SetHLRDeviationCoefficient
3460 -//purpose  : 
3461 +//purpose  :
3462  //=======================================================================
3463 -
3464 -void AIS_InteractiveContext::SetHLRDeviationCoefficient(
3465 -                                     const Handle(AIS_InteractiveObject)& anIObj, 
3466 -                                     const Standard_Real    aCoefficient,
3467 -                                     const Standard_Boolean updateviewer)
3468 +void AIS_InteractiveContext::SetHLRDeviationCoefficient (const Handle(AIS_InteractiveObject)& theIObj,
3469 +                                                         const Standard_Real                  theCoefficient,
3470 +                                                         const Standard_Boolean               theToUpdateViewer)
3471  {
3472 -//  cout<<" HLRCoefficient:"<< aCoefficient <<endl;
3473 -  if(anIObj.IsNull()) return ;
3474 +  if (theIObj.IsNull())
3475 +  {
3476 +    return;
3477 +  }
3478 +
3479 +  if (!theIObj->HasInteractiveContext())
3480 +  {
3481 +    theIObj->SetContext (this);
3482 +  }
3483   
3484 -  if(!anIObj->HasInteractiveContext())
3485 -    anIObj->SetContext(this);
3486    // To be modified after the related methods of AIS_Shape are passed to InteractiveObject
3487 -  if(anIObj->Type()!=AIS_KOI_Object && anIObj->Type()!=AIS_KOI_Shape) return;
3488 -  if(anIObj->Signature()!=0) return;
3489 -  (*((Handle(AIS_Shape)*)&anIObj))->SetOwnHLRDeviationCoefficient(aCoefficient);
3490 -
3491 -
3492 -
3493 -  if(anIObj->RecomputeEveryPrs())
3494 -    anIObj->Redisplay();
3495 -  else
3496 -    {
3497 -      Standard_Integer NbDisp=0;
3498 +  if (theIObj->Type() != AIS_KOI_Object
3499 +   && theIObj->Type() != AIS_KOI_Shape)
3500 +  {
3501 +    return;
3502 +  }
3503 +  else if (theIObj->Signature() != 0)
3504 +  {
3505 +    return;
3506 +  }
3507  
3508 -      TColStd_ListOfInteger LL;
3509 -      anIObj->ToBeUpdated(LL);
3510 -      TColStd_ListIteratorOfListOfInteger ITI(LL);
3511 -      for (;ITI.More();ITI.Next())
3512 -        {
3513 -          anIObj->Update(ITI.Value(),Standard_False);
3514 -          NbDisp++;
3515 -        }
3516 -      anIObj->SetRecomputeOk();
3517 -#ifdef OCCT_DEBUG
3518 -      cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
3519 -#endif
3520 -    }
3521 -  if(updateviewer) UpdateCurrentViewer();
3522 +  Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
3523 +  aShape->SetOwnHLRDeviationCoefficient (theCoefficient);
3524 +  redisplayPrsModes (theIObj, theToUpdateViewer);
3525  }
3526  
3527 -
3528  //=======================================================================
3529  //function : SetDeviationAngle
3530 -//purpose  : 
3531 +//purpose  :
3532  //=======================================================================
3533 -
3534 -void AIS_InteractiveContext::SetDeviationAngle(
3535 -                                     const Handle(AIS_InteractiveObject)& anIObj, 
3536 -                                     const Standard_Real   anAngle,
3537 -                                     const Standard_Boolean updateviewer)
3538 +void AIS_InteractiveContext::SetDeviationAngle (const Handle(AIS_InteractiveObject)& theIObj,
3539 +                                                const Standard_Real                  theAngle,
3540 +                                                const Standard_Boolean               theToUpdateViewer)
3541  {
3542 -//  cout<<" Angle:"<< anAngle <<endl;
3543 -  if(anIObj.IsNull()) return ;
3544 +  if (theIObj.IsNull())
3545 +  {
3546 +    return;
3547 +  }
3548 +
3549 +  if (!theIObj->HasInteractiveContext())
3550 +  {
3551 +    theIObj->SetContext (this);
3552 +  }
3553   
3554 -  if(!anIObj->HasInteractiveContext())
3555 -    anIObj->SetContext(this);
3556    // To be modified after the related methods of AIS_Shape are passed to InteractiveObject
3557 -  if(anIObj->Type()!=AIS_KOI_Shape) return;
3558 -  if(anIObj->Signature()!=0) return;
3559 -  (*((Handle(AIS_Shape)*)&anIObj))->SetOwnDeviationAngle(anAngle);
3560 -
3561 +  if (theIObj->Type() != AIS_KOI_Shape)
3562 +  {
3563 +    return;
3564 +  }
3565 +  else if (theIObj->Signature() != 0)
3566 +  {
3567 +    return;
3568 +  }
3569  
3570 -  if(anIObj->RecomputeEveryPrs())
3571 -    anIObj->Redisplay();
3572 -  else
3573 -    {
3574 -      Standard_Integer NbDisp=0;
3575 -      TColStd_ListOfInteger LL;
3576 -      anIObj->ToBeUpdated(LL);
3577 -      TColStd_ListIteratorOfListOfInteger ITI(LL);
3578 -      for (;ITI.More();ITI.Next())
3579 -        {
3580 -          anIObj->Update(ITI.Value(),Standard_False);
3581 -          NbDisp++;
3582 -        }
3583 -      anIObj->SetRecomputeOk();
3584 -#ifdef OCCT_DEBUG
3585 -      cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
3586 -#endif
3587 -    }
3588 -  if(updateviewer) UpdateCurrentViewer();
3589 +  Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
3590 +  aShape->SetOwnDeviationAngle (theAngle);
3591 +  redisplayPrsModes (theIObj, theToUpdateViewer);
3592  }
3593 +
3594  //=======================================================================
3595 -//function : SetDeviationAngle
3596 -//purpose  : 
3597 +//function : SetAngleAndDeviation
3598 +//purpose  :
3599  //=======================================================================
3600 +void AIS_InteractiveContext::SetAngleAndDeviation (const Handle(AIS_InteractiveObject)& theIObj,
3601 +                                                   const Standard_Real                  theAngle,
3602 +                                                   const Standard_Boolean               theToUpdateViewer)
3603 +{
3604 +  if (theIObj.IsNull())
3605 +  {
3606 +    return;
3607 +  }
3608  
3609 -void AIS_InteractiveContext::SetAngleAndDeviation(
3610 -                                     const Handle(AIS_InteractiveObject)& anIObj, 
3611 -                                     const Standard_Real   anAngle,
3612 -                                     const Standard_Boolean updateviewer)
3613 -{
3614 -//  cout<<" Angle:"<< anAngle <<endl;
3615 -  if(anIObj.IsNull()) return ;
3616 -//   Standard_Real anAngleRad = M_PI*anAngle/180; test rob...
3617 -  if(!anIObj->HasInteractiveContext())
3618 -    anIObj->SetContext(this);
3619 +  if (!theIObj->HasInteractiveContext())
3620 +  {
3621 +    theIObj->SetContext (this);
3622 +  }
3623  
3624    // To be modified after the related methods of AIS_Shape are passed to InteractiveObject
3625 -  if(anIObj->Type()!=AIS_KOI_Shape) return;
3626 -  if(anIObj->Signature()!=0) return;
3627 -  (*((Handle(AIS_Shape)*)&anIObj))->SetAngleAndDeviation(anAngle);
3628 +  if (theIObj->Type() != AIS_KOI_Shape)
3629 +  {
3630 +    return;
3631 +  }
3632 +  if (theIObj->Signature() != 0)
3633 +  {
3634 +    return;
3635 +  }
3636  
3637 +  Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
3638 +  aShape->SetAngleAndDeviation (theAngle);
3639  
3640 -  if(anIObj->RecomputeEveryPrs())
3641 -    anIObj->Redisplay();
3642 +  if (theIObj->RecomputeEveryPrs())
3643 +  {
3644 +    theIObj->Redisplay();
3645 +  }
3646    else
3647 -    Update(anIObj,updateviewer);
3648 +  {
3649 +    Update (theIObj, theToUpdateViewer);
3650 +  }
3651  }
3652  
3653  //=======================================================================
3654 -//function : SetDeviationAngle
3655 -//purpose  : 
3656 +//function : SetHLRAngleAndDeviation
3657 +//purpose  :
3658  //=======================================================================
3659 +void AIS_InteractiveContext::SetHLRAngleAndDeviation (const Handle(AIS_InteractiveObject)& theIObj,
3660 +                                                      const Standard_Real                  theAngle,
3661 +                                                      const Standard_Boolean               theToUpdateViewer)
3662 +{
3663 +  if (theIObj.IsNull())
3664 +  {
3665 +    return;
3666 +  }
3667  
3668 -void AIS_InteractiveContext::SetHLRAngleAndDeviation(
3669 -                                     const Handle(AIS_InteractiveObject)& anIObj, 
3670 -                                     const Standard_Real   anAngle,
3671 -                                     const Standard_Boolean updateviewer)
3672 -{
3673 -//  cout<<" Angle:"<< anAngle <<endl;
3674 -
3675 -  if(anIObj.IsNull()) return ;
3676 -   if(!anIObj->HasInteractiveContext())
3677 -    anIObj->SetContext(this);
3678 +  if (!theIObj->HasInteractiveContext())
3679 +  {
3680 +    theIObj->SetContext (this);
3681 +  }
3682  
3683    // To be modified after the related methods of AIS_Shape are passed to InteractiveObject
3684 -  if(anIObj->Type()!=AIS_KOI_Shape) return;
3685 -  if(anIObj->Signature()!=0) return;
3686 -  (*((Handle(AIS_Shape)*)&anIObj))->SetHLRAngleAndDeviation(anAngle);
3687 -
3688 -
3689 -  if(anIObj->RecomputeEveryPrs())
3690 -    anIObj->Redisplay();
3691 -  else
3692 -    {
3693 -      Standard_Integer NbDisp=0;
3694 -
3695 -      TColStd_ListOfInteger LL;
3696 -      anIObj->ToBeUpdated(LL);
3697 -      TColStd_ListIteratorOfListOfInteger ITI(LL);
3698 -      for (;ITI.More();ITI.Next())
3699 -        {
3700 -          anIObj->Update(ITI.Value(),Standard_False);
3701 -          NbDisp++;
3702 -        }
3703 -      anIObj->SetRecomputeOk();
3704 -#ifdef OCCT_DEBUG
3705 -      cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
3706 -#endif
3707 -    }
3708 -  if(updateviewer) UpdateCurrentViewer();
3709 +  if (theIObj->Type() != AIS_KOI_Shape)
3710 +  {
3711 +    return;
3712 +  }
3713 +  if (theIObj->Signature() != 0)
3714 +  {
3715 +    return;
3716 +  }
3717 +  Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
3718 +  aShape->SetHLRAngleAndDeviation (theAngle);
3719 +  redisplayPrsModes (theIObj, theToUpdateViewer);
3720  }
3721  
3722  //=======================================================================
3723  //function : SetHLRDeviationAngle
3724 -//purpose  : 
3725 +//purpose  :
3726  //=======================================================================
3727 -
3728 -void AIS_InteractiveContext::SetHLRDeviationAngle(
3729 -                                     const Handle(AIS_InteractiveObject)& anIObj, 
3730 -                                     const Standard_Real   anAngle,
3731 -                                     const Standard_Boolean updateviewer)
3732 +void AIS_InteractiveContext::SetHLRDeviationAngle (const Handle(AIS_InteractiveObject)& theIObj,
3733 +                                                   const Standard_Real                  theAngle,
3734 +                                                   const Standard_Boolean               theToUpdateViewer)
3735  {
3736 -//  cout<<" HLRAngle:"<< anAngle <<endl;
3737 -  if(anIObj.IsNull()) return ;
3738
3739 -  if(!anIObj->HasInteractiveContext())
3740 -    anIObj->SetContext(this);
3741 -  // To be modified after the related methods of AIS_Shape are passed to InteractiveObject
3742 -  if( anIObj->Type()!=AIS_KOI_Shape) return;
3743 -  if(anIObj->Signature()!=0) return;
3744 -  (*((Handle(AIS_Shape)*)&anIObj))->SetOwnHLRDeviationAngle(anAngle);
3745 +  if (theIObj.IsNull())
3746 +  {
3747 +    return;
3748 +  }
3749  
3750 +  if (!theIObj->HasInteractiveContext())
3751 +  {
3752 +    theIObj->SetContext (this);
3753 +  }
3754  
3755 -  if(anIObj->RecomputeEveryPrs())
3756 -    anIObj->Redisplay();
3757 -  else
3758 -    {
3759 -      Standard_Integer NbDisp=0;
3760 -      TColStd_ListOfInteger LL;
3761 -      anIObj->ToBeUpdated(LL);
3762 -      TColStd_ListIteratorOfListOfInteger ITI(LL);
3763 -      for (;ITI.More();ITI.Next())
3764 -        {
3765 -          anIObj->Update(ITI.Value(),Standard_False);
3766 -          NbDisp++;
3767 -        }
3768 -      anIObj->SetRecomputeOk();
3769 -#ifdef OCCT_DEBUG
3770 -      cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
3771 -#endif
3772 -    }
3773 -  if(updateviewer) UpdateCurrentViewer();
3774 +  // To be modified after the related methods of AIS_Shape are passed to InteractiveObject
3775 +  if (theIObj->Type() != AIS_KOI_Shape)
3776 +  {
3777 +    return;
3778 +  }
3779 +  if (theIObj->Signature() != 0)
3780 +  {
3781 +    return;
3782 +  }
3783 +  Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
3784 +  aShape->SetOwnHLRDeviationAngle (theAngle);
3785 +  redisplayPrsModes (theIObj, theToUpdateViewer);
3786  }
3787  
3788  //=======================================================================
3789  //function : UnsetColor
3790 -//purpose  : 
3791 +//purpose  :
3792  //=======================================================================
3793 -
3794 -void AIS_InteractiveContext::UnsetColor(const Handle(AIS_InteractiveObject)& anIObj,
3795 -                                     const Standard_Boolean updateviewer)
3796 +void AIS_InteractiveContext::UnsetColor (const Handle(AIS_InteractiveObject)& theIObj,
3797 +                                         const Standard_Boolean               theToUpdateViewer)
3798  {
3799 -  if(anIObj.IsNull()) return ;
3800 -   anIObj->UnsetColor();
3801 -  if(anIObj->RecomputeEveryPrs())
3802 -    anIObj->Redisplay();
3803 -  else
3804 -    {
3805 -      Standard_Integer NbDisp =0;
3806 -      TColStd_ListIteratorOfListOfInteger ITI(anIObj->ListOfRecomputeModes());
3807 -      for (;ITI.More();ITI.Next())
3808 -        {
3809 -          anIObj->Update(ITI.Value(),Standard_False);
3810 -          NbDisp++;
3811 -        }
3812 -#ifdef OCCT_DEBUG
3813 -      cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
3814 -#endif
3815 -      anIObj->SetRecomputeOk();
3816 -    }
3817 -  if(updateviewer) 
3818 -    UpdateCurrentViewer();
3819 +  if (theIObj.IsNull())
3820 +  {
3821 +    return;
3822 +  }
3823 +
3824 +  theIObj->UnsetColor();
3825 +  redisplayPrsRecModes (theIObj, theToUpdateViewer);
3826  }
3827  
3828  //=======================================================================
3829  //function : HasColor
3830 -//purpose  : 
3831 +//purpose  :
3832  //=======================================================================
3833 -
3834 -Standard_Boolean AIS_InteractiveContext::HasColor(const Handle(AIS_InteractiveObject)& anIObj) const 
3835 +Standard_Boolean AIS_InteractiveContext::HasColor (const Handle(AIS_InteractiveObject)& theIObj) const
3836  {
3837 -  return anIObj->HasColor();
3838 -
3839 +  return theIObj->HasColor();
3840  }
3841  
3842  //=======================================================================
3843  //function : Color
3844 -//purpose  : 
3845 +//purpose  :
3846  //=======================================================================
3847 -
3848 -Quantity_NameOfColor AIS_InteractiveContext::Color(const Handle(AIS_InteractiveObject)& anIObj) const 
3849 +Quantity_NameOfColor AIS_InteractiveContext::Color (const Handle(AIS_InteractiveObject)& theIObj) const
3850  {
3851 -  return anIObj->Color();
3852 +  return theIObj->Color();
3853  }
3854  
3855 -void AIS_InteractiveContext::Color(const Handle(AIS_InteractiveObject)& anIObj,
3856 -                                   Quantity_Color &aColor) const
3857 +//=======================================================================
3858 +//function : Color
3859 +//purpose  :
3860 +//=======================================================================
3861 +void AIS_InteractiveContext::Color (const Handle(AIS_InteractiveObject)& theIObj,
3862 +                                    Quantity_Color&                      theColor) const
3863  {
3864 -  anIObj->Color(aColor);
3865 +  theIObj->Color (theColor);
3866  }
3867  
3868  //=======================================================================
3869  //function : Width
3870 -//purpose  : 
3871 +//purpose  :
3872  //=======================================================================
3873 -
3874 -Standard_Real AIS_InteractiveContext::Width(const Handle(AIS_InteractiveObject)& anIObj) const 
3875 +Standard_Real AIS_InteractiveContext::Width (const Handle(AIS_InteractiveObject)& theIObj) const
3876  {
3877 -  return anIObj->Width();
3878 +  return theIObj->Width();
3879  }
3880  
3881  //=======================================================================
3882  //function : SetWidth
3883 -//purpose  : 
3884 +//purpose  :
3885  //=======================================================================
3886 -
3887 -void AIS_InteractiveContext::SetWidth(const Handle(AIS_InteractiveObject)& anIObj,
3888 -                                     const Standard_Real aValue,
3889 -                                     const Standard_Boolean updateviewer)
3890 +void AIS_InteractiveContext::SetWidth (const Handle(AIS_InteractiveObject)& theIObj,
3891 +                                       const Standard_Real                  theWidth,
3892 +                                       const Standard_Boolean               theToUpdateViewer)
3893  {
3894 -  if(anIObj.IsNull()) return ;
3895
3896 -  if(!anIObj->HasInteractiveContext())
3897 -    anIObj->SetContext(this);
3898 -  anIObj->SetWidth(aValue);
3899 -  if(anIObj->RecomputeEveryPrs())
3900 -    anIObj->Redisplay();
3901 -  else
3902 -    {
3903 -      Standard_Integer NbDisp=0;
3904 -      TColStd_ListIteratorOfListOfInteger ITI(anIObj->ListOfRecomputeModes());
3905 -      for (;ITI.More();ITI.Next())
3906 -        {
3907 -          anIObj->Update(ITI.Value(),Standard_False);
3908 -          NbDisp++;
3909 -        }
3910 -#ifdef OCCT_DEBUG
3911 -      cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
3912 -#endif
3913 -      anIObj->SetRecomputeOk();
3914 -    }
3915 -   if(updateviewer) 
3916 -    UpdateCurrentViewer();
3917 +  if (theIObj.IsNull())
3918 +  {
3919 +    return;
3920 +  }
3921 +
3922 +  if (!theIObj->HasInteractiveContext())
3923 +  {
3924 +    theIObj->SetContext (this);
3925 +  }
3926 +
3927 +  theIObj->SetWidth (theWidth);
3928 +  redisplayPrsRecModes (theIObj, theToUpdateViewer);
3929  }
3930  
3931  //=======================================================================
3932  //function : UnsetWidth
3933 -//purpose  : 
3934 +//purpose  :
3935  //=======================================================================
3936 -
3937 -void AIS_InteractiveContext::UnsetWidth(const Handle(AIS_InteractiveObject)& anIObj,
3938 -                                       const Standard_Boolean updateviewer)
3939 +void AIS_InteractiveContext::UnsetWidth (const Handle(AIS_InteractiveObject)& theIObj,
3940 +                                         const Standard_Boolean               theToUpdateViewer)
3941  {
3942 -  if(anIObj.IsNull()) return ;
3943 -   anIObj->UnsetWidth();
3944 -  if(anIObj->RecomputeEveryPrs())
3945 -    anIObj->Redisplay();
3946 -  else
3947 -    {
3948 -      TColStd_ListIteratorOfListOfInteger ITI(anIObj->ListOfRecomputeModes());
3949 -      for (;ITI.More();ITI.Next())
3950 -        {
3951 -          anIObj->Update(ITI.Value(),Standard_False);
3952 -        }
3953 -      anIObj->SetRecomputeOk();
3954 -    }
3955 -   if(updateviewer) 
3956 -    UpdateCurrentViewer();
3957 +  if (theIObj.IsNull())
3958 +  {
3959 +    return;
3960 +  }
3961 +
3962 +  theIObj->UnsetWidth();
3963 +  redisplayPrsRecModes (theIObj, theToUpdateViewer);
3964  }
3965  
3966  //=======================================================================
3967  //function : SetMaterial
3968 -//purpose  : 
3969 +//purpose  :
3970  //=======================================================================
3971 +void AIS_InteractiveContext::SetMaterial (const Handle(AIS_InteractiveObject)& theIObj,
3972 +                                          const Graphic3d_NameOfMaterial       theName,
3973 +                                          const Standard_Boolean               theToUpdateViewer)
3974 +{
3975 +  if (theIObj.IsNull())
3976 +  {
3977 +    return;
3978 +  }
3979  
3980 -void AIS_InteractiveContext::SetMaterial(const Handle(AIS_InteractiveObject)& anIObj,
3981 -//POP pour K4L
3982 -                                        const Graphic3d_NameOfMaterial aName,
3983 -//                                      const Graphic3d_NameOfPhysicalMaterial aName,
3984 -                                        const Standard_Boolean updateviewer)
3985 -{
3986 -  if(!anIObj->HasInteractiveContext())
3987 -    anIObj->SetContext(this);
3988 -  anIObj->SetMaterial(aName);
3989 -  if(anIObj->RecomputeEveryPrs())
3990 -    anIObj->Redisplay();
3991 -  else
3992 -    {
3993 -      TColStd_ListIteratorOfListOfInteger ITI(anIObj->ListOfRecomputeModes());
3994 -      for (;ITI.More();ITI.Next())
3995 -        {
3996 -          anIObj->Update(ITI.Value(),Standard_False);
3997 -        }
3998 -      anIObj->SetRecomputeOk();
3999 -    }
4000 -   if(updateviewer)
4001 -    UpdateCurrentViewer();
4002 +  if (!theIObj->HasInteractiveContext())
4003 +  {
4004 +    theIObj->SetContext (this);
4005 +  }
4006  
4007 +  theIObj->SetMaterial (theName);
4008 +  redisplayPrsRecModes (theIObj, theToUpdateViewer);
4009  }
4010  
4011  //=======================================================================
4012  //function : UnsetMaterial
4013 -//purpose  : 
4014 +//purpose  :
4015  //=======================================================================
4016 -
4017 -void AIS_InteractiveContext::UnsetMaterial(const Handle(AIS_InteractiveObject)& anIObj,
4018 -                                          const Standard_Boolean updateviewer)
4019 +void AIS_InteractiveContext::UnsetMaterial (const Handle(AIS_InteractiveObject)& theIObj,
4020 +                                            const Standard_Boolean               theToUpdateViewer)
4021  {
4022 -  if(anIObj.IsNull()) return ;
4023 -  anIObj->UnsetMaterial();
4024 -  if(anIObj->RecomputeEveryPrs())
4025 -    anIObj->Redisplay();
4026 -  else
4027 -    {
4028 -      TColStd_ListIteratorOfListOfInteger ITI(anIObj->ListOfRecomputeModes());
4029 -      for (;ITI.More();ITI.Next())
4030 -        {
4031 -          anIObj->Update(ITI.Value(),Standard_False);
4032 -        }
4033 -      anIObj->SetRecomputeOk();
4034 -    }
4035 -  if(updateviewer)
4036 -    UpdateCurrentViewer();
4037 +  if (theIObj.IsNull())
4038 +  {
4039 +    return;
4040 +  }
4041 +  theIObj->UnsetMaterial();
4042 +  redisplayPrsRecModes (theIObj, theToUpdateViewer);
4043  }
4044  
4045  //=======================================================================
4046  //function : SetTransparency
4047 -//purpose  : 
4048 +//purpose  :
4049  //=======================================================================
4050 +void AIS_InteractiveContext::SetTransparency (const Handle(AIS_InteractiveObject)& theIObj,
4051 +                                              const Standard_Real                  theValue,
4052 +                                              const Standard_Boolean               theToUpdateViewer)
4053 +{
4054 +  if (theIObj.IsNull())
4055 +  {
4056 +    return;
4057 +  }
4058  
4059 -void AIS_InteractiveContext::SetTransparency(const Handle(AIS_InteractiveObject)& anIObj,
4060 -                                            const Standard_Real aValue,
4061 -                                            const Standard_Boolean updateviewer)
4062 -{
4063 -  if(anIObj.IsNull()) return ;
4064 -   if(!anIObj->HasInteractiveContext())
4065 -    anIObj->SetContext(this);
4066 -
4067 -#ifdef BUC60577 //right optimization
4068 -  if(!anIObj->IsTransparent() && aValue<=0.05) return;
4069 -#else  
4070 -//  if(!anIObj->IsTransparent() && aValue<=0.05) return;
4071 -#endif
4072 -  if(aValue<=0.05){
4073 -    UnsetTransparency(anIObj,updateviewer);
4074 +  if (!theIObj->HasInteractiveContext())
4075 +  {
4076 +    theIObj->SetContext (this);
4077 +  }
4078 +
4079 +  if (!theIObj->IsTransparent()
4080 +    && theValue <= 0.05)
4081 +  {
4082      return;
4083    }
4084 -  
4085 -  if(!myMainVwr->Viewer()->Transparency())
4086 -    myMainVwr->Viewer()->SetTransparency(Standard_True);
4087 -  anIObj->SetTransparency(aValue);
4088 -  if(anIObj->RecomputeEveryPrs())
4089 -    anIObj->Redisplay();
4090 -  else
4091 -    {
4092 -      TColStd_ListIteratorOfListOfInteger ITI(anIObj->ListOfRecomputeModes());
4093 -      for (;ITI.More();ITI.Next())
4094 -        {
4095 -          anIObj->Update(ITI.Value(),Standard_False);
4096 -        }
4097 -      anIObj->SetRecomputeOk();
4098 -    }
4099 -   if(updateviewer)
4100 -    UpdateCurrentViewer();
4101 +
4102 +  if (theValue <= 0.05)
4103 +  {
4104 +    UnsetTransparency (theIObj, theToUpdateViewer);
4105 +    return;
4106 +  }
4107 +
4108 +  theIObj->SetTransparency (theValue);
4109 +  redisplayPrsRecModes (theIObj, theToUpdateViewer);
4110  }
4111  
4112  //=======================================================================
4113  //function : UnsetTransparency
4114 -//purpose  : 
4115 +//purpose  :
4116  //=======================================================================
4117 -
4118 -void AIS_InteractiveContext::UnsetTransparency(const Handle(AIS_InteractiveObject)& anIObj,
4119 -                                              const Standard_Boolean updateviewer)
4120 +void AIS_InteractiveContext::UnsetTransparency (const Handle(AIS_InteractiveObject)& theIObj,
4121 +                                                const Standard_Boolean               theToUpdateViewer)
4122  {
4123 -  if(anIObj.IsNull()) return ;
4124 -   anIObj->UnsetTransparency();
4125 -  if(anIObj->RecomputeEveryPrs())
4126 -    anIObj->Redisplay();
4127 -  else
4128 -    {
4129 -      TColStd_ListIteratorOfListOfInteger ITI(anIObj->ListOfRecomputeModes());
4130 -      for (;ITI.More();ITI.Next())
4131 -        {
4132 -          anIObj->Update(ITI.Value(),Standard_False);
4133 -        }
4134 -      anIObj->SetRecomputeOk();
4135 -    }
4136 -
4137 -  // To Unset transparency in the viewer, if no other object is transparent ...(Speed)
4138 -  AIS_DataMapIteratorOfDataMapOfIOStatus It(myObjects);
4139 -  Standard_Boolean FoundTransp(Standard_False);
4140 -  for(;It.More() && !FoundTransp ;It.Next()){
4141 -    if(It.Key()->IsTransparent())
4142 -      FoundTransp = Standard_True;
4143 +  if (theIObj.IsNull())
4144 +  {
4145 +    return;
4146    }
4147 -  if(!FoundTransp)
4148 -    myMainVwr->Viewer()->SetTransparency(Standard_False);
4149 -  
4150 -  
4151 -  if(updateviewer)
4152 -    UpdateCurrentViewer();
4153 +
4154 +  theIObj->UnsetTransparency();
4155 +  redisplayPrsRecModes (theIObj, theToUpdateViewer);
4156  }
4157  
4158 -//=======================================================================
4159 -//function : SetSelectedAspect
4160 -//purpose  : 
4161 -//=======================================================================
4162 -void AIS_InteractiveContext::SetSelectedAspect(
4163 -                                const Handle(Prs3d_BasicAspect)& anAspect,
4164 -                                const Standard_Boolean globalChange,
4165 -                                const Standard_Boolean updateViewer)
4166 -{
4167 -  if( !HasOpenedContext() ) {
4168 -    Standard_Boolean found = Standard_False;
4169 -    Handle(AIS_Selection) sel = 
4170 -                AIS_Selection::Selection(myCurrentName.ToCString());
4171 -    Handle(AIS_InteractiveObject) object;
4172 -    for( sel->Init() ; sel->More() ; sel->Next()) {
4173 -      found = Standard_True;
4174 -      object = Handle(AIS_InteractiveObject)::DownCast(sel->Value());
4175 -      object->SetAspect(anAspect,globalChange);
4176 -    }
4177 -    if( found && updateViewer) {
4178 -      myMainVwr->Update();
4179 -    }
4180 +//=======================================================================
4181 +//function : SetSelectedAspect
4182 +//purpose  :
4183 +//=======================================================================
4184 +void AIS_InteractiveContext::SetSelectedAspect (const Handle(Prs3d_BasicAspect)& theAspect,
4185 +                                                const Standard_Boolean           theIsGlobalChange,
4186 +                                                const Standard_Boolean           theToUpdateViewer)
4187 +{
4188 +  if (HasOpenedContext())
4189 +  {
4190 +    return;
4191 +  }
4192 +
4193 +  Standard_Boolean isFound = Standard_False;
4194 +  Handle(AIS_Selection) aSelIter = AIS_Selection::Selection (myCurrentName.ToCString());
4195 +  for (aSelIter->Init(); aSelIter->More(); aSelIter->Next())
4196 +  {
4197 +    isFound = Standard_True;
4198 +    Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (aSelIter->Value());
4199 +    anObj->SetAspect (theAspect, theIsGlobalChange);
4200 +  }
4201 +
4202 +  if (isFound
4203 +   && theToUpdateViewer)
4204 +  {
4205 +    myMainVwr->Update();
4206    }
4207  }
4208  
4209  //=======================================================================
4210  //function : SetLocalAttributes
4211 -//purpose  : 
4212 +//purpose  :
4213  //=======================================================================
4214 +void AIS_InteractiveContext::SetLocalAttributes (const Handle(AIS_InteractiveObject)& theIObj,
4215 +                                                 const Handle(AIS_Drawer)&            theDrawer,
4216 +                                                 const Standard_Boolean               theToUpdateViewer)
4217 +{
4218 +  if (theIObj.IsNull())
4219 +  {
4220 +    return;
4221 +  }
4222  
4223 -void AIS_InteractiveContext::SetLocalAttributes(const Handle(AIS_InteractiveObject)& anIObj, 
4224 -                                                const Handle(AIS_Drawer)& aDrawer,
4225 -                                                const Standard_Boolean updateviewer)
4226 -{
4227 -  if(anIObj.IsNull()) return ;
4228 -  if(!anIObj->HasInteractiveContext())
4229 -    anIObj->SetContext(this);
4230 -  anIObj->SetAttributes(aDrawer);
4231 -  Update(anIObj,updateviewer);
4232 -  
4233 +  if (!theIObj->HasInteractiveContext())
4234 +  {
4235 +    theIObj->SetContext (this);
4236 +  }
4237 +
4238 +  theIObj->SetAttributes (theDrawer);
4239 +  Update (theIObj, theToUpdateViewer);
4240  }
4241  
4242  //=======================================================================
4243  //function : UnsetLocalAttributes
4244 -//purpose  : 
4245 +//purpose  :
4246  //=======================================================================
4247 -void AIS_InteractiveContext::UnsetLocalAttributes(const Handle(AIS_InteractiveObject)& anIObj,
4248 -                                                  const Standard_Boolean updateviewer)
4249 +void AIS_InteractiveContext::UnsetLocalAttributes (const Handle(AIS_InteractiveObject)& theIObj,
4250 +                                                   const Standard_Boolean               theToUpdateViewer)
4251  {
4252 -  if(anIObj.IsNull()) return ;
4253 -  if(!anIObj->HasInteractiveContext())
4254 -    anIObj->SetContext(this);
4255 -  anIObj->UnsetAttributes();
4256 -  Update(anIObj,updateviewer);
4257 -}
4258 +  if (theIObj.IsNull())
4259 +  {
4260 +    return;
4261 +  }
4262  
4263 +  if (!theIObj->HasInteractiveContext())
4264 +  {
4265 +    theIObj->SetContext (this);
4266 +  }
4267 +  theIObj->UnsetAttributes();
4268 +  Update (theIObj, theToUpdateViewer);
4269 +}
4270  
4271  //=======================================================================
4272  //function : Status
4273 -//purpose  : 
4274 +//purpose  :
4275  //=======================================================================
4276 -
4277 -void AIS_InteractiveContext::Status(const Handle(AIS_InteractiveObject)& anIObj, TCollection_ExtendedString& astatus) const 
4278 +void AIS_InteractiveContext::Status (const Handle(AIS_InteractiveObject)& theIObj,
4279 +                                     TCollection_ExtendedString&          theStatus) const
4280  {
4281 -  astatus = "";
4282 +  theStatus = "";
4283 +  if (theIObj.IsNull()
4284 +  || !myObjects.IsBound (theIObj))
4285 +  {
4286 +    return;
4287 +  }
4288  
4289 -  if(anIObj.IsNull()) return ;
4290 -  if(myObjects.IsBound(anIObj)){
4291 -    astatus += "\t ____________________________________________";
4292 -    astatus += "\t| Known at Neutral Point:\n\tDisplayStatus:";
4293 -    const Handle(AIS_GlobalStatus)& ST = myObjects(anIObj);
4294 -    switch(ST->GraphicStatus()){
4295 +  theStatus += "\t ____________________________________________";
4296 +  theStatus += "\t| Known at Neutral Point:\n\tDisplayStatus:";
4297 +  const Handle(AIS_GlobalStatus)& aStatus = myObjects (theIObj);
4298 +  switch (aStatus->GraphicStatus())
4299 +  {
4300      case AIS_DS_Displayed:
4301 -      {
4302 -        astatus +="\t| -->Displayed\n";
4303 -        break;
4304 -      }
4305 -    case AIS_DS_Erased:
4306 -      {
4307 -        astatus +="\t| -->Erased\n";
4308 -        break;
4309 -      }
4310 -    default:
4311 +    {
4312 +      theStatus += "\t| -->Displayed\n";
4313        break;
4314      }
4315 -    astatus += "\t| Active Display Modes in the MainViewer :\n";
4316 -    TColStd_ListIteratorOfListOfInteger ItL (ST->DisplayedModes());
4317 -    for(;ItL.More();ItL.Next()){
4318 -      astatus += "\t|\t Mode ";
4319 -      astatus += TCollection_AsciiString(ItL.Value());
4320 -      astatus+="\n";
4321 -    }   
4322 -    if(IsCurrent(anIObj)) astatus +="\t| Current\n";
4323 -    if(IsSelected(anIObj)) astatus +="\t| Selected\n";
4324 -
4325 -    astatus += "\t| Active Selection Modes in the MainViewer :\n";
4326 -    for(ItL.Initialize(ST->SelectionModes());ItL.More();ItL.Next()){
4327 -      astatus += "\t\t Mode ";
4328 -      astatus += TCollection_AsciiString(ItL.Value());
4329 -      astatus+="\n";
4330 -    }   
4331 -    astatus += "\t ____________________________________________";
4332 -      
4333 +    case AIS_DS_Erased:
4334 +    {
4335 +      theStatus += "\t| -->Erased\n";
4336 +      break;
4337      }
4338 -}
4339 +    default:
4340 +      break;
4341 +  }
4342  
4343 +  theStatus += "\t| Active Display Modes in the MainViewer :\n";
4344 +  for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
4345 +  {
4346 +    theStatus += "\t|\t Mode ";
4347 +    theStatus += TCollection_AsciiString (aDispModeIter.Value());
4348 +    theStatus += "\n";
4349 +  }
4350 +  if (IsCurrent (theIObj))  theStatus +="\t| Current\n";
4351 +  if (IsSelected(theIObj)) theStatus +="\t| Selected\n";
4352 +
4353 +  theStatus += "\t| Active Selection Modes in the MainViewer :\n";
4354 +  for (TColStd_ListIteratorOfListOfInteger aSelModeIter (aStatus->SelectionModes()); aSelModeIter.More(); aSelModeIter.Next())
4355 +  {
4356 +    theStatus += "\t\t Mode ";
4357 +    theStatus += TCollection_AsciiString (aSelModeIter.Value());
4358 +    theStatus += "\n";
4359 +  }
4360 +  theStatus += "\t ____________________________________________";
4361 +}
4362  
4363  //=======================================================================
4364  //function : GetDefModes
4365 -//purpose  : 
4366 +//purpose  :
4367  //=======================================================================
4368 +void AIS_InteractiveContext::GetDefModes (const Handle(AIS_InteractiveObject)& theIObj,
4369 +                                          Standard_Integer&                    theDispMode,
4370 +                                          Standard_Integer&                    theHiMode,
4371 +                                          Standard_Integer&                    theSelMode) const
4372 +{
4373 +  if (theIObj.IsNull())
4374 +  {
4375 +    return;
4376 +  }
4377  
4378 -void AIS_InteractiveContext::GetDefModes(const Handle(AIS_InteractiveObject)& anIObj,
4379 -                                     Standard_Integer& DispMode,
4380 -                                     Standard_Integer& HiMode,
4381 -                                     Standard_Integer& SelMode) const 
4382 -{
4383 -  if(anIObj.IsNull()) return ;
4384 -  DispMode = anIObj->HasDisplayMode() ? anIObj->DisplayMode() : 
4385 -  (anIObj->AcceptDisplayMode(myDisplayMode)? myDisplayMode : 0);
4386 -  
4387 -  HiMode = anIObj->HasHilightMode()? anIObj->HilightMode():DispMode;
4388 -#ifdef BUC61051
4389 -  SelMode = anIObj->HasSelectionMode()? anIObj->SelectionMode() : -1;
4390 -#else
4391 -  SelMode = anIObj->HasSelectionMode()? anIObj->SelectionMode() : 0;
4392 -#endif
4393 +  theDispMode = theIObj->HasDisplayMode()
4394 +              ? theIObj->DisplayMode()
4395 +              : (theIObj->AcceptDisplayMode (myDisplayMode)
4396 +               ? myDisplayMode
4397 +               : 0);
4398 +  theHiMode  = theIObj->HasHilightMode()   ? theIObj->HilightMode()   : theDispMode;
4399 +  theSelMode = theIObj->HasSelectionMode() ? theIObj->SelectionMode() : -1;
4400  }
4401  
4402 -
4403  //=======================================================================
4404  //function : EraseGlobal
4405 -//purpose  : 
4406 +//purpose  :
4407  //=======================================================================
4408 -
4409 -void AIS_InteractiveContext::EraseGlobal(const Handle(AIS_InteractiveObject)& anIObj, 
4410 -                                         const Standard_Boolean updateviewer)
4411 +void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& theIObj,
4412 +                                          const Standard_Boolean               theToUpdateviewer)
4413  {
4414 -  if(anIObj.IsNull()) return ;
4415 -  if(!myObjects.IsBound(anIObj)) return;
4416 +  if (theIObj.IsNull()
4417 +  || !myObjects.IsBound (theIObj))
4418 +  {
4419 +    return;
4420 +  }
4421  
4422 -  // CLE
4423 -  // const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
4424 -  Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
4425 -  // ENDCLE
4426 -  Standard_Integer Dmode = anIObj->HasHilightMode() ? anIObj->HilightMode() : 0;
4427 -  if(STATUS->GraphicStatus()==AIS_DS_Displayed){
4428 -    
4429 -    TColStd_ListIteratorOfListOfInteger ItL (STATUS->DisplayedModes());
4430 -    for(;ItL.More();ItL.Next()){
4431 -      if(myMainPM->IsHighlighted(anIObj,ItL.Value()))
4432 -        myMainPM->Unhighlight(anIObj,ItL.Value());
4433 -      myMainPM->SetVisibility (anIObj, ItL.Value(), Standard_False);
4434 +  Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
4435 +
4436 +  Standard_Integer aDispMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
4437 +  if (aStatus->GraphicStatus() == AIS_DS_Displayed)
4438 +  {
4439 +    for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
4440 +    {
4441 +      if (myMainPM->IsHighlighted (theIObj, aDispModeIter.Value()))
4442 +      {
4443 +        myMainPM->Unhighlight (theIObj, aDispModeIter.Value());
4444 +      }
4445 +      myMainPM->SetVisibility (theIObj, aDispModeIter.Value(), Standard_False);
4446 +    }
4447 +
4448 +    if (IsCurrent (theIObj)
4449 +    && !aStatus->IsDModeIn (aDispMode))
4450 +    {
4451 +      myMainPM->SetVisibility (theIObj, aDispMode, Standard_False);
4452 +    }
4453 +
4454 +    for (TColStd_ListIteratorOfListOfInteger aSelModeIter (aStatus->SelectionModes()); aSelModeIter.More(); aSelModeIter.Next())
4455 +    {
4456 +      mgrSelector->Deactivate (theIObj, aSelModeIter.Value(), myMainSel);
4457 +    }
4458 +
4459 +    if (theToUpdateviewer)
4460 +    {
4461 +      myMainVwr->Update();
4462      }
4463 -    if(IsCurrent(anIObj) && !STATUS->IsDModeIn(Dmode))
4464 -      myMainPM->SetVisibility (anIObj, Dmode, Standard_False);
4465 -    
4466 -    for(ItL.Initialize(STATUS->SelectionModes());ItL.More();ItL.Next())
4467 -      mgrSelector->Deactivate(anIObj,ItL.Value(),myMainSel);
4468 -    if(updateviewer) myMainVwr->Update();
4469    }
4470 -  STATUS->SetGraphicStatus(AIS_DS_Erased);
4471 -  
4472 +  aStatus->SetGraphicStatus (AIS_DS_Erased);
4473  }
4474  
4475  //=======================================================================
4476  //function : ClearGlobal
4477 -//purpose  : 
4478 +//purpose  :
4479  //=======================================================================
4480 -
4481 -void AIS_InteractiveContext::ClearGlobal(const Handle(AIS_InteractiveObject)& anIObj, 
4482 -                                         const Standard_Boolean updateviewer)
4483 +void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& theIObj,
4484 +                                          const Standard_Boolean               theToUpdateviewer)
4485  {
4486 -  if(anIObj.IsNull()) return ;
4487 -  if(!myObjects.IsBound(anIObj)) return;
4488 -  // CLE
4489 -  // const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
4490 -  Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
4491 -  // ENDCLE
4492 -   TColStd_ListIteratorOfListOfInteger ItL (STATUS->DisplayedModes());
4493 -   for(;ItL.More();ItL.Next()){
4494 -     if(STATUS->IsHilighted()){
4495 -       if(IsCurrent(anIObj))
4496 -#ifdef OCC204
4497 -         AddOrRemoveCurrentObject( anIObj, updateviewer );
4498 -#else
4499 -         AddOrRemoveCurrentObject(anIObj);
4500 -#endif
4501 -       else if(myMainPM->IsHighlighted(anIObj,ItL.Value()))
4502 -         myMainPM->Unhighlight(anIObj,ItL.Value());
4503 -     }
4504 -     myMainPM->Erase(anIObj,ItL.Value());
4505 -     myMainPM->Clear(anIObj,ItL.Value());
4506 -     if(anIObj->HasHilightMode()){
4507 -       Standard_Integer im = anIObj->HilightMode();
4508 -       myMainPM->Unhighlight(anIObj,im);
4509 -       myMainPM->Erase(anIObj,im);
4510 -  
4511 -     }
4512 -   }
4513 +  if (theIObj.IsNull()
4514 +  || !myObjects.IsBound (theIObj))
4515 +  {
4516 +    return;
4517 +  }
4518 +
4519 +  Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
4520 +  for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
4521 +  {
4522 +    if (aStatus->IsHilighted())
4523 +    {
4524 +      if (IsCurrent (theIObj))
4525 +      {
4526 +        AddOrRemoveCurrentObject (theIObj, theToUpdateviewer);
4527 +      }
4528 +      else if (myMainPM->IsHighlighted (theIObj, aDispModeIter.Value()))
4529 +      {
4530 +        myMainPM->Unhighlight (theIObj, aDispModeIter.Value());
4531 +      }
4532 +    }
4533 +    myMainPM->Erase (theIObj, aDispModeIter.Value());
4534 +    myMainPM->Clear (theIObj, aDispModeIter.Value());
4535 +    if (theIObj->HasHilightMode())
4536 +    {
4537 +      Standard_Integer im = theIObj->HilightMode();
4538 +      myMainPM->Unhighlight (theIObj, im);
4539 +      myMainPM->Erase       (theIObj, im);
4540 +    }
4541 +  }
4542  
4543 -  //Object removes from Detected sequence
4544 -  Standard_Integer i = 1;
4545 -  for(i = 1; i < myAISDetectedSeq.Length(); i++)
4546 +  // Object removes from Detected sequence
4547 +  for(Standard_Integer aDetIter = 1; aDetIter < myAISDetectedSeq.Length(); ++aDetIter)
4548    {
4549      Handle(AIS_InteractiveObject) anObj = DetectedCurrentObject();
4550 -    if( !anObj.IsNull() && anObj != anIObj )
4551 -      myAISDetectedSeq.Remove( i );
4552 +    if (!anObj.IsNull()
4553 +      && anObj != theIObj)
4554 +    {
4555 +      myAISDetectedSeq.Remove (aDetIter);
4556 +    }
4557    }
4558  
4559 -  if(myLastinMain == anIObj)
4560 +  if (myLastinMain == theIObj)
4561 +  {
4562      myLastinMain.Nullify();
4563 -
4564 -  if(myLastPicked == anIObj)
4565 +  }
4566 +  if (myLastPicked == theIObj)
4567 +  {
4568      myLastPicked.Nullify();
4569 +  }
4570 +
4571 +  // remove IO from the selection manager to avoid memory leaks
4572 +  mgrSelector->Remove (theIObj);
4573  
4574 -  // OCC21671: Remove IO from the selection manager in any case
4575 -  // to avoid memory leaks
4576 -  mgrSelector->Remove(anIObj);
4577 +  myObjects.UnBind (theIObj);
4578  
4579 -  if (updateviewer && (STATUS->GraphicStatus() == AIS_DS_Displayed))
4580 +  if (theToUpdateviewer
4581 +   && aStatus->GraphicStatus() == AIS_DS_Displayed)
4582    {
4583      myMainVwr->Update();
4584    }
4585 -
4586 -  myObjects.UnBind(anIObj);
4587 -  
4588  }
4589  
4590  //=======================================================================
4591  //function : ClearGlobalPrs
4592 -//purpose  : 
4593 +//purpose  :
4594  //=======================================================================
4595 +void AIS_InteractiveContext::ClearGlobalPrs (const Handle(AIS_InteractiveObject)& theIObj,
4596 +                                             const Standard_Integer               theMode,
4597 +                                             const Standard_Boolean               theToUpdateViewer)
4598 +{
4599 +  if (theIObj.IsNull()
4600 +  || !myObjects.IsBound (theIObj))
4601 +  {
4602 +    return;
4603 +  }
4604  
4605 -void AIS_InteractiveContext::ClearGlobalPrs(const Handle(AIS_InteractiveObject)& anIObj, 
4606 -                                            const Standard_Integer aMode,
4607 -                                            const Standard_Boolean updateviewer)
4608 -{
4609 -  if(anIObj.IsNull()) return ;
4610 -  if(!myObjects.IsBound(anIObj)) return;
4611 -  const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
4612 -  
4613 -  Standard_Integer DM = anIObj->HasHilightMode() ? anIObj->HilightMode() : 0; 
4614 -  if(STATUS->IsDModeIn(aMode)){
4615 -    if(DM==aMode && myMainPM->IsHighlighted(anIObj,aMode))
4616 -      myMainPM->Unhighlight(anIObj,aMode);
4617 -    
4618 -    myMainPM->Erase(anIObj,aMode);
4619 -    myMainPM->Clear(anIObj,aMode);
4620 +  const Handle(AIS_GlobalStatus)& aStatus = myObjects (theIObj);
4621 +  if (aStatus->IsDModeIn (theMode))
4622 +  {
4623 +    const Standard_Integer aDispMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
4624 +    if (aDispMode == theMode
4625 +     && myMainPM->IsHighlighted (theIObj, theMode))
4626 +    {
4627 +      myMainPM->Unhighlight (theIObj, theMode);
4628 +    }
4629 +
4630 +    myMainPM->Erase (theIObj, theMode);
4631 +    myMainPM->Clear (theIObj, theMode);
4632    }
4633 -  
4634  
4635 -  if(STATUS->GraphicStatus()==AIS_DS_Displayed && updateviewer)
4636 +  if (aStatus->GraphicStatus() == AIS_DS_Displayed
4637 +   && theToUpdateViewer)
4638 +  {
4639      myMainVwr->Update();
4640 +  }
4641  }
4642  
4643  //=======================================================================
4644  //function : DrawHiddenLine
4645 -//purpose  : 
4646 +//purpose  :
4647  //=======================================================================
4648 -
4649 -Standard_Boolean AIS_InteractiveContext::DrawHiddenLine () const {
4650 -
4651 +Standard_Boolean AIS_InteractiveContext::DrawHiddenLine() const
4652 +{
4653    return myDefaultDrawer->DrawHiddenLine();
4654  }
4655  
4656  //=======================================================================
4657  //function : EnableDrawHiddenLine
4658 -//purpose  : 
4659 +//purpose  :
4660  //=======================================================================
4661 -
4662 -void AIS_InteractiveContext::EnableDrawHiddenLine () const {
4663 +void AIS_InteractiveContext::EnableDrawHiddenLine() const
4664 +{
4665    myDefaultDrawer->EnableDrawHiddenLine();
4666  }
4667  
4668  //=======================================================================
4669  //function : DisableDrawHiddenLine 
4670 -//purpose  : 
4671 +//purpose  :
4672  //=======================================================================
4673 -
4674 -void AIS_InteractiveContext::DisableDrawHiddenLine () const {
4675 +void AIS_InteractiveContext::DisableDrawHiddenLine() const
4676 +{
4677    myDefaultDrawer->DisableDrawHiddenLine();
4678  }
4679  
4680  //=======================================================================
4681  //function : HiddenLineAspect
4682 -//purpose  : 
4683 +//purpose  :
4684  //=======================================================================
4685 -
4686 -Handle (Prs3d_LineAspect) AIS_InteractiveContext::HiddenLineAspect () const  {
4687 +Handle (Prs3d_LineAspect) AIS_InteractiveContext::HiddenLineAspect() const
4688 +{
4689    return myDefaultDrawer->HiddenLineAspect();
4690  }
4691  
4692  //=======================================================================
4693  //function : SetHiddenLineAspect
4694 -//purpose  : 
4695 +//purpose  :
4696  //=======================================================================
4697 -
4698 -void AIS_InteractiveContext::SetHiddenLineAspect ( const Handle(Prs3d_LineAspect)& anAspect) const {
4699 -  myDefaultDrawer->SetHiddenLineAspect(anAspect);
4700 +void AIS_InteractiveContext::SetHiddenLineAspect (const Handle(Prs3d_LineAspect)& theAspect) const
4701 +{
4702 +  myDefaultDrawer->SetHiddenLineAspect (theAspect);
4703  }
4704  
4705  //=======================================================================
4706  //function : SetIsoNumber
4707 -//purpose  : 
4708 +//purpose  :
4709  //=======================================================================
4710 -
4711 -void AIS_InteractiveContext::SetIsoNumber(const Standard_Integer Nb,const AIS_TypeOfIso Type)
4712 +void AIS_InteractiveContext::SetIsoNumber (const Standard_Integer theNb,
4713 +                                           const AIS_TypeOfIso    theType)
4714  {
4715 -  switch(Type){
4716 -  case AIS_TOI_IsoU:
4717 -    myDefaultDrawer->UIsoAspect()->SetNumber(Nb);
4718 -    break;
4719 -  case AIS_TOI_IsoV:
4720 -    myDefaultDrawer->VIsoAspect()->SetNumber(Nb);
4721 -    break;
4722 -  case AIS_TOI_Both:
4723 -    myDefaultDrawer->UIsoAspect()->SetNumber(Nb);
4724 -    myDefaultDrawer->VIsoAspect()->SetNumber(Nb);
4725 -    break;
4726
4727 +  switch (theType)
4728 +  {
4729 +    case AIS_TOI_IsoU:
4730 +      myDefaultDrawer->UIsoAspect()->SetNumber (theNb);
4731 +      break;
4732 +    case AIS_TOI_IsoV:
4733 +      myDefaultDrawer->VIsoAspect()->SetNumber (theNb);
4734 +      break;
4735 +    case AIS_TOI_Both:
4736 +      myDefaultDrawer->UIsoAspect()->SetNumber (theNb);
4737 +      myDefaultDrawer->VIsoAspect()->SetNumber (theNb);
4738 +      break;
4739    }
4740  }
4741 +
4742  //=======================================================================
4743  //function : IsoNumber
4744 -//purpose  : 
4745 +//purpose  :
4746  //=======================================================================
4747 -
4748 -Standard_Integer AIS_InteractiveContext::IsoNumber(const AIS_TypeOfIso Type)
4749 +Standard_Integer AIS_InteractiveContext::IsoNumber (const AIS_TypeOfIso theType)
4750  {
4751 -  
4752 -  switch(Type){
4753 -  case AIS_TOI_IsoU:
4754 -    return myDefaultDrawer->UIsoAspect()->Number();
4755 -  case AIS_TOI_IsoV:
4756 -    return myDefaultDrawer->VIsoAspect()->Number();
4757 -  case AIS_TOI_Both:
4758 -    return (myDefaultDrawer->UIsoAspect()->Number()==
4759 -            myDefaultDrawer->VIsoAspect()->Number()) ? 
4760 -              myDefaultDrawer->UIsoAspect()->Number(): -1;
4761 +  switch (theType)
4762 +  {
4763 +    case AIS_TOI_IsoU: return myDefaultDrawer->UIsoAspect()->Number();
4764 +    case AIS_TOI_IsoV: return myDefaultDrawer->VIsoAspect()->Number();
4765 +    case AIS_TOI_Both: return myDefaultDrawer->UIsoAspect()->Number() == myDefaultDrawer->VIsoAspect()->Number()
4766 +                            ? myDefaultDrawer->UIsoAspect()->Number()
4767 +                            : -1;
4768    }
4769    return 0;
4770  }
4771  
4772  //=======================================================================
4773  //function : IsoOnPlane
4774 -//purpose  : 
4775 +//purpose  :
4776  //=======================================================================
4777 -
4778 -void AIS_InteractiveContext::IsoOnPlane(const Standard_Boolean SwitchOn)
4779 +void AIS_InteractiveContext::IsoOnPlane (const Standard_Boolean theToSwitchOn)
4780  {
4781 -  myDefaultDrawer->SetIsoOnPlane(SwitchOn);
4782 +  myDefaultDrawer->SetIsoOnPlane (theToSwitchOn);
4783  }
4784  
4785  //=======================================================================
4786  //function : IsoOnPlane
4787 -//purpose  : 
4788 +//purpose  :
4789  //=======================================================================
4790 -
4791 -Standard_Boolean AIS_InteractiveContext::IsoOnPlane() const 
4792 +Standard_Boolean AIS_InteractiveContext::IsoOnPlane() const
4793  {
4794    return myDefaultDrawer->IsoOnPlane();
4795  }
4796  
4797  //=======================================================================
4798  //function : SetSelectionMode
4799 -//purpose  : 
4800 +//purpose  :
4801  //=======================================================================
4802 -
4803 -void AIS_InteractiveContext::SetSelectionMode(const Handle(AIS_InteractiveObject)&, const Standard_Integer )
4804 +void AIS_InteractiveContext::SetSelectionMode (const Handle(AIS_InteractiveObject)& ,
4805 +                                               const Standard_Integer )
4806  {
4807 +  //
4808  }
4809  
4810  //=======================================================================
4811  //function : UnsetSelectionMode
4812 -//purpose  : 
4813 +//purpose  :
4814  //=======================================================================
4815 -
4816 -void AIS_InteractiveContext::UnsetSelectionMode(const Handle(AIS_InteractiveObject)&)
4817 +void AIS_InteractiveContext::UnsetSelectionMode (const Handle(AIS_InteractiveObject)& )
4818  {
4819 +  //
4820  }
4821  
4822  //=======================================================================
4823  //function : SetSensitivityMode
4824 -//purpose  : 
4825 +//purpose  :
4826  //=======================================================================
4827 -
4828 -void AIS_InteractiveContext::SetSensitivityMode(const StdSelect_SensitivityMode aMode) {
4829 -
4830 -  if( HasOpenedContext() )
4831 -        myLocalContexts(myCurLocalIndex)->SetSensitivityMode(aMode);
4832 -  else {
4833 -    myMainSel->SetSensitivityMode(aMode);
4834 +void AIS_InteractiveContext::SetSensitivityMode (const StdSelect_SensitivityMode theMode)
4835 +{
4836 +  if (HasOpenedContext())
4837 +  {
4838 +    myLocalContexts (myCurLocalIndex)->SetSensitivityMode (theMode);
4839 +  }
4840 +  else
4841 +  {
4842 +    myMainSel->SetSensitivityMode (theMode);
4843    }
4844  }
4845  
4846  //=======================================================================
4847  //function : SensitivityMode
4848 -//purpose  : 
4849 +//purpose  :
4850  //=======================================================================
4851 -
4852 -StdSelect_SensitivityMode AIS_InteractiveContext::SensitivityMode() const {
4853 -
4854 -  if( HasOpenedContext() )
4855 -        return myLocalContexts(myCurLocalIndex)->SensitivityMode();
4856 -  return myMainSel->SensitivityMode();
4857 +StdSelect_SensitivityMode AIS_InteractiveContext::SensitivityMode() const
4858 +{
4859 +  return HasOpenedContext()
4860 +       ? myLocalContexts (myCurLocalIndex)->SensitivityMode()
4861 +       : myMainSel->SensitivityMode();
4862  }
4863  
4864  //=======================================================================
4865  //function : SetSensitivity
4866 -//purpose  : 
4867 +//purpose  :
4868  //=======================================================================
4869 -
4870 -void AIS_InteractiveContext::SetSensitivity(const Standard_Real aPrecision) {
4871 -
4872 -  if( HasOpenedContext() )
4873 -        myLocalContexts(myCurLocalIndex)->SetSensitivity(aPrecision);
4874 -  else {
4875 -    myMainSel->SetSensitivity(aPrecision);
4876 +void AIS_InteractiveContext::SetSensitivity (const Standard_Real thePrecision)
4877 +{
4878 +  if (HasOpenedContext())
4879 +  {
4880 +    myLocalContexts(myCurLocalIndex)->SetSensitivity (thePrecision);
4881 +  }
4882 +  else
4883 +  {
4884 +    myMainSel->SetSensitivity (thePrecision);
4885    }
4886  }
4887  
4888  //=======================================================================
4889  //function : Sensitivity
4890 -//purpose  : 
4891 +//purpose  :
4892  //=======================================================================
4893 -
4894 -Standard_Real AIS_InteractiveContext::Sensitivity() const {
4895 -
4896 -  if( HasOpenedContext() )
4897 -        return myLocalContexts(myCurLocalIndex)->Sensitivity();
4898 -  return myMainSel->Sensitivity();
4899 +Standard_Real AIS_InteractiveContext::Sensitivity() const
4900 +{
4901 +  return HasOpenedContext()
4902 +       ? myLocalContexts(myCurLocalIndex)->Sensitivity()
4903 +       : myMainSel->Sensitivity();
4904  }
4905  
4906  //=======================================================================
4907  //function : SetPixelTolerance
4908 -//purpose  : 
4909 +//purpose  :
4910  //=======================================================================
4911 -
4912 -void AIS_InteractiveContext::SetPixelTolerance(const Standard_Integer aPrecision) {
4913 -
4914 -  if( HasOpenedContext() )
4915 -        myLocalContexts(myCurLocalIndex)->SetPixelTolerance(aPrecision);
4916 -  else {
4917 -    myMainSel->SetPixelTolerance(aPrecision);
4918 +void AIS_InteractiveContext::SetPixelTolerance (const Standard_Integer thePrecision)
4919 +{
4920 +  if (HasOpenedContext())
4921 +  {
4922 +    myLocalContexts (myCurLocalIndex)->SetPixelTolerance (thePrecision);
4923 +  }
4924 +  else
4925 +  {
4926 +    myMainSel->SetPixelTolerance (thePrecision);
4927    }
4928  }
4929  
4930  //=======================================================================
4931  //function : PixelTolerance
4932 -//purpose  : 
4933 +//purpose  :
4934  //=======================================================================
4935 -
4936 -Standard_Integer AIS_InteractiveContext::PixelTolerance() const {
4937 -
4938 -  if( HasOpenedContext() )
4939 -        return myLocalContexts(myCurLocalIndex)->PixelTolerance();
4940 -  return myMainSel->PixelTolerance();
4941 +Standard_Integer AIS_InteractiveContext::PixelTolerance() const
4942 +{
4943 +  return HasOpenedContext()
4944 +       ? myLocalContexts (myCurLocalIndex)->PixelTolerance()
4945 +       : myMainSel->PixelTolerance();
4946  }
4947  
4948  //=======================================================================
4949  //function : IsInLocal
4950 -//purpose  : 
4951 +//purpose  :
4952  //=======================================================================
4953 -
4954 -Standard_Boolean AIS_InteractiveContext::IsInLocal(const Handle(AIS_InteractiveObject)& anIObj,
4955 -                                                   Standard_Integer& TheIndex) const 
4956 +Standard_Boolean AIS_InteractiveContext::IsInLocal (const Handle(AIS_InteractiveObject)& theIObj,
4957 +                                                    Standard_Integer&                    theIndex) const
4958  {
4959 -  if(anIObj.IsNull()) return Standard_False;
4960 +  if (theIObj.IsNull())
4961 +  {
4962 +    return Standard_False;
4963 +  }
4964 +
4965    // if it exists at neutral point 0 index is returned
4966 -  if(myObjects.IsBound(anIObj)) {
4967 -    TheIndex = 0;
4968 +  if (myObjects.IsBound (theIObj))
4969 +  {
4970 +    theIndex = 0;
4971      return Standard_False;
4972    }
4973 -  for(Standard_Integer I=1;I<=myLocalContexts.Extent();I++){
4974 -    if(myLocalContexts.IsBound(I)){
4975 -      if(myLocalContexts(I)->IsIn(anIObj)){
4976 -        TheIndex = I;
4977 +
4978 +  for (Standard_Integer aCtxIter = 1; aCtxIter <= myLocalContexts.Extent(); ++aCtxIter)
4979 +  {
4980 +    if (myLocalContexts.IsBound (aCtxIter))
4981 +    {
4982 +      if(myLocalContexts (aCtxIter)->IsIn (theIObj))
4983 +      {
4984 +        theIndex = aCtxIter;
4985          return Standard_True;
4986 -        
4987        }
4988      }
4989    }
4990 -  TheIndex =-1;
4991 +  theIndex = -1;
4992    return Standard_False;
4993 -}  
4994 -  
4995 +}
4996 +
4997  //=======================================================================
4998  //function : InitAttributes
4999 -//purpose  : 
5000 +//purpose  :
5001  //=======================================================================
5002 -
5003  void AIS_InteractiveContext::InitAttributes()
5004  {
5005 -
5006 -  mgrSelector->Add(myMainSel);
5007 +  mgrSelector->Add (myMainSel);
5008    myCurrentName   = AIS_Context_NewCurName();
5009    mySelectionName = AIS_Context_NewSelName();
5010  
5011 -  AIS_Selection::CreateSelection(mySelectionName.ToCString());
5012 -  AIS_Selection::CreateSelection(myCurrentName.ToCString());
5013 +  AIS_Selection::CreateSelection (mySelectionName.ToCString());
5014 +  AIS_Selection::CreateSelection (myCurrentName.ToCString());
5015  
5016 -  
5017 -  myDefaultDrawer->SetShadingAspectGlobal(Standard_False);
5018 -  Graphic3d_MaterialAspect aMat(Graphic3d_NOM_BRASS);
5019 -  myDefaultDrawer->ShadingAspect()->SetMaterial(aMat);
5020 +  myDefaultDrawer->SetShadingAspectGlobal (Standard_False);
5021 +  Graphic3d_MaterialAspect aMat (Graphic3d_NOM_BRASS);
5022 +  myDefaultDrawer->ShadingAspect()->SetMaterial (aMat);
5023  
5024  //  myDefaultDrawer->ShadingAspect()->SetColor(Quantity_NOC_GRAY70);
5025 -  Handle (Prs3d_LineAspect) HLA = myDefaultDrawer->HiddenLineAspect();
5026 -  HLA->SetColor(Quantity_NOC_GRAY20);
5027 -  HLA->SetWidth(1);
5028 -  HLA->SetTypeOfLine(Aspect_TOL_DASH);
5029 +  Handle(Prs3d_LineAspect) aLineAspect = myDefaultDrawer->HiddenLineAspect();
5030 +  aLineAspect->SetColor      (Quantity_NOC_GRAY20);
5031 +  aLineAspect->SetWidth      (1.0);
5032 +  aLineAspect->SetTypeOfLine (Aspect_TOL_DASH);
5033  
5034    // tolerance to 4 pixels...
5035    SetPixelTolerance();
5036  
5037    // Customizing the drawer for trihedrons and planes...
5038 -
5039 -  Handle (Prs3d_DatumAspect) DA = myDefaultDrawer->DatumAspect();
5040 -  Standard_Real aLength(100.);
5041 -  DA->SetAxisLength(aLength,aLength,aLength);
5042 -  Quantity_NameOfColor col = Quantity_NOC_LIGHTSTEELBLUE4;
5043 -  DA->FirstAxisAspect()->SetColor(col);
5044 -  DA->SecondAxisAspect()->SetColor(col);
5045 -  DA->ThirdAxisAspect()->SetColor(col);
5046 -
5047 -  Handle(Prs3d_PlaneAspect)PA = myDefaultDrawer->PlaneAspect();
5048 -  aLength =200.;
5049 -  PA->SetPlaneLength(aLength,aLength);
5050 -  PA->EdgesAspect()->SetColor(Quantity_NOC_SKYBLUE);
5051 -  
5052 -
5053 +  Handle(Prs3d_DatumAspect) aTrihAspect = myDefaultDrawer->DatumAspect();
5054 +  const Standard_Real aLength = 100.0;
5055 +  aTrihAspect->SetAxisLength (aLength, aLength, aLength);
5056 +  const Quantity_NameOfColor aColor = Quantity_NOC_LIGHTSTEELBLUE4;
5057 +  aTrihAspect->FirstAxisAspect() ->SetColor (aColor);
5058 +  aTrihAspect->SecondAxisAspect()->SetColor (aColor);
5059 +  aTrihAspect->ThirdAxisAspect() ->SetColor (aColor);
5060 +
5061 +  Handle(Prs3d_PlaneAspect) aPlaneAspect = myDefaultDrawer->PlaneAspect();
5062 +  const Standard_Real aPlaneLength = 200.0;
5063 +  aPlaneAspect->SetPlaneLength (aPlaneLength, aPlaneLength);
5064 +  aPlaneAspect->EdgesAspect()->SetColor (Quantity_NOC_SKYBLUE);
5065  }
5066  
5067 -
5068  //=======================================================================
5069  //function : TrihedronSize
5070 -//purpose  : 
5071 +//purpose  :
5072  //=======================================================================
5073  Standard_Real AIS_InteractiveContext::TrihedronSize() const
5074  {
5075    return myDefaultDrawer->DatumAspect()->FirstAxisLength();
5076  }
5077 +
5078  //=======================================================================
5079  //function : SetTrihedronSize
5080 -//purpose  : 
5081 +//purpose  :
5082  //=======================================================================
5083 -void AIS_InteractiveContext::SetTrihedronSize(const Standard_Real aVal,const Standard_Boolean /*updateviewer*/)
5084 +void AIS_InteractiveContext::SetTrihedronSize (const Standard_Real    theVal,
5085 +                                               const Standard_Boolean /*updateviewer*/)
5086  {
5087 -  myDefaultDrawer->DatumAspect()->SetAxisLength(aVal,aVal,aVal);
5088 -  Redisplay(AIS_KOI_Datum,3,Standard_False);
5089 -  Redisplay(AIS_KOI_Datum,4,Standard_True);
5090 +  myDefaultDrawer->DatumAspect()->SetAxisLength (theVal, theVal, theVal);
5091 +  Redisplay (AIS_KOI_Datum, 3, Standard_False);
5092 +  Redisplay (AIS_KOI_Datum, 4, Standard_True);
5093  }
5094  
5095 -
5096 -
5097  //=======================================================================
5098  //function : SetPlaneSize
5099 -//purpose  : 
5100 +//purpose  :
5101  //=======================================================================
5102 -void AIS_InteractiveContext::SetPlaneSize(const Standard_Real aValX,
5103 -                                          const Standard_Real aValY,
5104 +void AIS_InteractiveContext::SetPlaneSize(const Standard_Real    theValX,
5105 +                                          const Standard_Real    theValY,
5106                                            const Standard_Boolean /*updateviewer*/)
5107  {
5108 -  myDefaultDrawer->PlaneAspect()->SetPlaneLength(aValX,aValY);
5109 -  Redisplay(AIS_KOI_Datum,7);
5110 +  myDefaultDrawer->PlaneAspect()->SetPlaneLength (theValX, theValY);
5111 +  Redisplay (AIS_KOI_Datum, 7);
5112  }
5113  
5114  //=======================================================================
5115  //function : SetPlaneSize
5116 -//purpose  : 
5117 +//purpose  :
5118  //=======================================================================
5119 -
5120 -void AIS_InteractiveContext::SetPlaneSize(const Standard_Real aVal,
5121 -                                          const Standard_Boolean updateviewer)
5122 +void AIS_InteractiveContext::SetPlaneSize (const Standard_Real    theVal,
5123 +                                           const Standard_Boolean theToUpdateViewer)
5124  {
5125 -  SetPlaneSize(aVal,aVal,updateviewer);
5126 +  SetPlaneSize (theVal, theVal, theToUpdateViewer);
5127  }
5128  
5129  //=======================================================================
5130  //function : PlaneSize
5131 -//purpose  : 
5132 +//purpose  :
5133  //=======================================================================
5134 -
5135 -Standard_Boolean AIS_InteractiveContext::PlaneSize(Standard_Real& LX,Standard_Real& LY) const
5136 +Standard_Boolean AIS_InteractiveContext::PlaneSize (Standard_Real& theX,
5137 +                                                    Standard_Real& theY) const
5138  {
5139 -  LX = myDefaultDrawer->PlaneAspect()->PlaneXLength();
5140 -  LY =  myDefaultDrawer->PlaneAspect()->PlaneYLength();
5141 -  return (Abs(LX-LY)<=Precision::Confusion());
5142 +  theX = myDefaultDrawer->PlaneAspect()->PlaneXLength();
5143 +  theY = myDefaultDrawer->PlaneAspect()->PlaneYLength();
5144 +  return (Abs (theX - theY) <= Precision::Confusion());
5145  }
5146  
5147 -
5148 -
5149  //=======================================================================
5150 -//function :
5151 -//purpose  : 
5152 +//function : SetAutoActivateSelection
5153 +//purpose  :
5154  //=======================================================================
5155 -void AIS_InteractiveContext::SetAutoActivateSelection( const Standard_Boolean Auto )
5156 +void AIS_InteractiveContext::SetAutoActivateSelection (const Standard_Boolean theIsAuto)
5157  {
5158 -  myIsAutoActivateSelMode = Auto;
5159 +  myIsAutoActivateSelMode = theIsAuto;
5160  }
5161  
5162  //=======================================================================
5163 -//function :
5164 -//purpose  : 
5165 +//function : GetAutoActivateSelection
5166 +//purpose  :
5167  //=======================================================================
5168  Standard_Boolean AIS_InteractiveContext::GetAutoActivateSelection() const
5169  {
5170 @@ -2837,13 +2721,12 @@
5171  
5172  //=======================================================================
5173  //function : SetZLayer
5174 -//purpose  : 
5175 +//purpose  :
5176  //=======================================================================
5177 -
5178  void AIS_InteractiveContext::SetZLayer (const Handle(AIS_InteractiveObject)& theIObj,
5179                                          const Standard_Integer theLayerId)
5180  {
5181 -  if (theIObj.IsNull ())
5182 +  if (theIObj.IsNull())
5183      return;
5184  
5185    if (myObjects.IsBound (theIObj))
5186 @@ -2853,7 +2736,7 @@
5187        theIObj->SetZLayer (myMainPM, theLayerId);
5188      }
5189    }
5190 -  else if (HasOpenedContext ())
5191 +  else if (HasOpenedContext())
5192    {
5193      myLocalContexts (myCurLocalIndex)->SetZLayer (theIObj, theLayerId);
5194    }
5195 @@ -2861,19 +2744,18 @@
5196  
5197  //=======================================================================
5198  //function : GetZLayer
5199 -//purpose  : 
5200 +//purpose  :
5201  //=======================================================================
5202 -
5203  Standard_Integer AIS_InteractiveContext::GetZLayer (const Handle(AIS_InteractiveObject)& theIObj) const
5204  {
5205 -  if (theIObj.IsNull ())
5206 +  if (theIObj.IsNull())
5207      return -1;
5208  
5209    if (myObjects.IsBound (theIObj))
5210    {
5211      return theIObj->GetZLayer (myMainPM);
5212    }
5213 -  else if (HasOpenedContext ())
5214 +  else if (HasOpenedContext())
5215    {
5216      return myLocalContexts (myCurLocalIndex)->GetZLayer (theIObj);
5217    }
5218 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/AIS/AIS_LocalContext_1.cxx OCCT-6.8.0_SRC-patch/src/AIS/AIS_LocalContext_1.cxx
5219 --- OCCT-6.8.0_SRC/src/AIS/AIS_LocalContext_1.cxx       2014-11-11 17:46:38.000000000 +0300
5220 +++ OCCT-6.8.0_SRC-patch/src/AIS/AIS_LocalContext_1.cxx 2015-01-16 13:01:23.000000000 +0300
5221 @@ -153,6 +153,7 @@
5222    {
5223      if (mylastindex != 0 && mylastindex <= myMapOfOwner.Extent())
5224      {
5225 +      myMainPM->ClearImmediateDraw();
5226        Unhilight (myMapOfOwner (mylastindex), theView);
5227        if (theToRedrawImmediate)
5228        {
5229 @@ -376,6 +377,7 @@
5230  
5231      if(myAutoHilight)
5232      {
5233 +      myMainPM->ClearImmediateDraw();
5234        const Handle(V3d_Viewer)& aViewer = myCTX->CurrentViewer();
5235        for (aViewer->InitActiveViews(); aViewer->MoreActiveViews(); aViewer->NextActiveViews())
5236        {
5237 @@ -545,7 +547,6 @@
5238      return;
5239    }
5240  
5241 -  myMainPM->ClearImmediateDraw();
5242    const Standard_Integer aHilightMode = GetHiMod (Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable()));
5243    if (IsSelected (theOwner))
5244    {
5245 @@ -1044,6 +1045,10 @@
5246    myMapOfOwner.Clear();
5247    myMapOfOwner.Assign (anOwnersToKeep);
5248    mylastindex = myMapOfOwner.FindIndex (aLastPicked);
5249 +  if (!IsValidIndex (mylastindex))
5250 +  {
5251 +    myMainPM->ClearImmediateDraw();
5252 +  }
5253  
5254    if (!isAISRemainsDetected)
5255    {
5256 @@ -1197,6 +1202,7 @@
5257  {
5258    if (thePickOwner.IsNull())
5259    {
5260 +    myMainPM->ClearImmediateDraw();
5261      if (theToRedrawImmediate)
5262      {
5263        theView->RedrawImmediate();
5264 @@ -1248,6 +1254,7 @@
5265    if (aNewIndex != mylastindex
5266     || thePickOwner->IsForcedHilight())
5267    {
5268 +    myMainPM->ClearImmediateDraw();
5269      if (mylastindex != 0
5270       && mylastindex <= myMapOfOwner.Extent())
5271      {
5272 @@ -1270,7 +1277,7 @@
5273      mylastindex = aNewIndex;
5274    }
5275  
5276 -  if (mylastindex)
5277 +  if (mylastindex != 0)
5278    {
5279      mylastgood = mylastindex;
5280    }
5281 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/AIS/AIS_LocalContext.cxx OCCT-6.8.0_SRC-patch/src/AIS/AIS_LocalContext.cxx
5282 --- OCCT-6.8.0_SRC/src/AIS/AIS_LocalContext.cxx 2014-11-11 17:46:38.000000000 +0300
5283 +++ OCCT-6.8.0_SRC-patch/src/AIS/AIS_LocalContext.cxx   2015-01-16 12:59:32.000000000 +0300
5284 @@ -445,65 +445,67 @@
5285  
5286  Standard_Boolean AIS_LocalContext::Remove(const Handle(AIS_InteractiveObject)& aSelectable)
5287  {
5288 -  if(!myActiveObjects.IsBound(aSelectable)) return Standard_False;
5289 +  if(!myActiveObjects.IsBound (aSelectable))
5290 +  {
5291 +    return Standard_False;
5292 +  }
5293 +
5294 +  if (IsSelected (aSelectable))
5295 +  {
5296 +    AddOrRemoveSelected (aSelectable, Standard_False);
5297 +  }
5298 +
5299 +  const Handle(AIS_LocalStatus)& Att = myActiveObjects (aSelectable);
5300  
5301 -  if(IsSelected(aSelectable))
5302 -    AddOrRemoveSelected(aSelectable,Standard_False);
5303 -    
5304 -  const Handle(AIS_LocalStatus)& Att = myActiveObjects(aSelectable);
5305 -  
5306    TColStd_ListIteratorOfListOfInteger It;
5307 -  // it is checked which were the temporary attributes 
5308 -  // and they are set to 0
5309  
5310 -  // desactivate standard modes
5311 -  if(Att->Decomposed()){
5312 -    for(It.Initialize(myListOfStandardMode);It.More();It.Next()){
5313 -      mySM->Deactivate(aSelectable,It.Value(),myMainVS);
5314 +  // Deactivate standard modes
5315 +  if (Att->Decomposed())
5316 +  {
5317 +    for (It.Initialize (myListOfStandardMode); It.More(); It.Next())
5318 +    {
5319 +      mySM->Deactivate (aSelectable, It.Value(), myMainVS);
5320      }
5321    }
5322 -  
5323 -  // if object or temporary presentations...
5324 -  if(Att->IsTemporary())
5325 +
5326 +  // If object or temporary presentations
5327 +  if (Att->IsTemporary())
5328 +  {
5329 +    if (Att->IsSubIntensityOn())
5330      {
5331 -      if(Att->IsSubIntensityOn())
5332 -       myMainPM->Unhighlight(aSelectable,Att->HilightMode());
5333 -      
5334 -      // remove if bug on clear correct...
5335 -      myMainPM->Erase(aSelectable,Att->DisplayMode());
5336 -      myMainPM->Clear(aSelectable,Att->DisplayMode());
5337 -      if(myMainPM->IsDisplayed(aSelectable,Att->HilightMode()))
5338 -       myMainPM->Erase(aSelectable,Att->HilightMode());
5339 -      //       myMainPM->Clear(aSelectable,Att->HilightMode());
5340 +      myMainPM->Unhighlight (aSelectable, Att->HilightMode());
5341      }
5342 -  // if below intensity
5343 -  else
5344 +
5345 +    myMainPM->Erase (aSelectable, Att->DisplayMode());
5346 +    myMainPM->Clear (aSelectable, Att->DisplayMode());
5347 +    if (myMainPM->IsDisplayed (aSelectable, Att->HilightMode()))
5348      {
5349 -      if(Att->IsSubIntensityOn())
5350 -       myCTX->SubIntensityOff(aSelectable);
5351 +      myMainPM->Erase (aSelectable, Att->HilightMode());
5352      }
5353 -  // desactivate stored proper modes
5354 -  for(It.Initialize(Att->SelectionModes());It.More();It.Next()){
5355 -    mySM->Deactivate(aSelectable,It.Value(),myMainVS);
5356 -  }
5357 -// pop : si je laisses cela plantes dans les elements de construction  
5358 -//       alors a toi de jouer ROB
5359 -//  RemoveSelected(aSelectable);
5360 -
5361 -  if(IsSelected(aSelectable))
5362 -    AddOrRemoveSelected(aSelectable);
5363 -  myActiveObjects.UnBind(aSelectable);
5364 +  }
5365 +  // If subintensity used
5366 +  else if (Att->IsSubIntensityOn())
5367 +  {
5368 +    myCTX->SubIntensityOff (aSelectable);
5369 +  }
5370 +
5371 +  // Deactivate stored selection modes
5372 +  for (It.Initialize (Att->SelectionModes()); It.More(); It.Next())
5373 +  {
5374 +    mySM->Deactivate (aSelectable, It.Value(), myMainVS);
5375 +  }
5376  
5377    // Remove the interactive object from selection manager
5378    if (mySM->Contains (aSelectable))
5379    {
5380      mySM->Remove (aSelectable);
5381    }
5382 -
5383    UpdateSort();
5384 -
5385    ClearOutdatedSelection (aSelectable, Standard_True);
5386  
5387 +  // This should be done at the very end because most methods use
5388 +  // myActiveObjects even during clean-up
5389 +  myActiveObjects.UnBind (aSelectable);
5390    return Standard_True;
5391  }
5392  
5393 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/Blend/Blend_Walking_1.gxx OCCT-6.8.0_SRC-patch/src/Blend/Blend_Walking_1.gxx
5394 --- OCCT-6.8.0_SRC/src/Blend/Blend_Walking_1.gxx        2014-11-11 17:46:43.000000000 +0300
5395 +++ OCCT-6.8.0_SRC-patch/src/Blend/Blend_Walking_1.gxx  2015-01-16 12:59:38.000000000 +0300
5396 @@ -56,6 +56,7 @@
5397  
5398  void Blend_Walking::Perform(Blend_Function& Func,
5399                             Blend_FuncInv& FuncInv,
5400 +                            const Handle(ChFiDS_HElSpine)& HGuide,
5401                             const Standard_Real Pdep,   
5402                             const Standard_Real Pmax,
5403                             const Standard_Real MaxStep,
5404 @@ -154,7 +155,7 @@
5405      }
5406    }
5407  
5408 -  InternalPerform(Func,FuncInv,Pmax);
5409 +  InternalPerform(Func,FuncInv,HGuide,Pmax);
5410  
5411    done = Standard_True;
5412  }
5413 @@ -461,7 +462,8 @@
5414    previousP.ParametersOnS1(sol(1),sol(2));
5415    previousP.ParametersOnS2(sol(3),sol(4));
5416  
5417 -  InternalPerform(Func,FuncInv,P);
5418 +  Handle(ChFiDS_HElSpine) anHGuide;
5419 +  InternalPerform(Func,FuncInv,anHGuide,P);
5420    return Standard_True;
5421  }
5422  
5423 @@ -502,7 +504,8 @@
5424    if(OnS1) clasonS1 = Standard_False;
5425    else clasonS2 = Standard_False;
5426  
5427 -  InternalPerform(Func,FuncInv,P);
5428 +  Handle(ChFiDS_HElSpine) anHGuide;
5429 +  InternalPerform(Func,FuncInv,anHGuide,P);
5430  
5431    clasonS1 = Standard_True;
5432    clasonS2 = Standard_True;
5433 @@ -548,7 +551,8 @@
5434    previousP.ParametersOnS1(sol(1),sol(2));
5435    previousP.ParametersOnS2(sol(3),sol(4));
5436  
5437 -  InternalPerform(Func,FuncInv,Pmin);
5438 +  Handle(ChFiDS_HElSpine) anHGuide;
5439 +  InternalPerform(Func,FuncInv,anHGuide,Pmin);
5440  
5441    iscomplete = Standard_True;
5442    return Standard_True;
5443 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/Blend/Blend_Walking_4.gxx OCCT-6.8.0_SRC-patch/src/Blend/Blend_Walking_4.gxx
5444 --- OCCT-6.8.0_SRC/src/Blend/Blend_Walking_4.gxx        2014-11-11 17:46:43.000000000 +0300
5445 +++ OCCT-6.8.0_SRC-patch/src/Blend/Blend_Walking_4.gxx  2015-01-16 12:59:38.000000000 +0300
5446 @@ -12,6 +12,8 @@
5447  // Alternatively, this file may be used under the terms of Open CASCADE
5448  // commercial license or contractual agreement.
5449  
5450 +#include <gce_MakePln.hxx>
5451 +
5452  static void evalpinit(math_Vector& parinit,
5453                       const Blend_Point& previousP,
5454                       const Standard_Real parprec,
5455 @@ -65,6 +67,7 @@
5456  
5457  void Blend_Walking::InternalPerform(Blend_Function& Func,
5458                                     Blend_FuncInv& FuncInv,
5459 +                                    const Handle(ChFiDS_HElSpine)& HGuide,
5460                                     const Standard_Real Bound)
5461  {
5462  
5463 @@ -251,12 +254,64 @@
5464           // avec les surfaces periodiques.
5465           State = Blend_OnRst12;
5466           param =  (w1+w2)/2;
5467 +          gp_Pnt Pnt1, Pnt2;
5468           p2d = TheArcTool::Value(recdomain1->Value(),solrst1(1));
5469           sol(1) = p2d.X();
5470           sol(2) = p2d.Y();
5471 +          Pnt1 = TheSurfaceTool::Value(surf1,sol(1),sol(2));
5472           p2d = TheArcTool::Value(recdomain2->Value(),solrst2(1));
5473           sol(3) = p2d.X();
5474           sol(4) = p2d.Y();
5475 +          Pnt2 = TheSurfaceTool::Value(surf2,sol(3),sol(4));
5476 +          if (!HGuide.IsNull())
5477 +          {
5478 +            const Standard_Real TolProd = 1.e-5;
5479 +            Standard_Real SavedParams [2];
5480 +            Standard_Boolean SameDirs [2] = {Standard_False, Standard_False};
5481 +            ChFiDS_ElSpine& theElSpine = HGuide->ChangeCurve();
5482 +            SavedParams[0] = theElSpine.GetSavedFirstParameter();
5483 +            SavedParams[1] = theElSpine.GetSavedLastParameter();
5484 +            for (Standard_Integer ind = 0; ind < 2; ind++)
5485 +            {
5486 +              if (!Precision::IsInfinite(SavedParams[ind]))
5487 +              {
5488 +                //Check the original first and last parameters of guide curve
5489 +                //for equality to found parameter <param>:
5490 +                //check equality of tangent to guide curve and
5491 +                //normal to plane built on 3 points:
5492 +                //point on guide curve and points on restrictions of adjacent
5493 +                //surfaces.
5494 +                gp_Pnt Pnt0;
5495 +                gp_Vec Dir0;
5496 +                HGuide->D1(SavedParams[ind], Pnt0, Dir0);
5497 +                Standard_Real Length = Dir0.Magnitude();
5498 +                if (Length <= gp::Resolution())
5499 +                  continue;
5500 +                Dir0 /= Length;
5501 +                gce_MakePln PlaneBuilder(Pnt0, Pnt1, Pnt2);
5502 +                if (!PlaneBuilder.IsDone())
5503 +                  continue;
5504 +                gp_Pln thePlane = PlaneBuilder.Value();
5505 +                gp_Dir DirPlane = thePlane.Axis().Direction();
5506 +                gp_Vec theProd = Dir0 ^ DirPlane;
5507 +                Standard_Real ProdMod = theProd.Magnitude();
5508 +                if (ProdMod <= TolProd)
5509 +                  SameDirs[ind] = Standard_True;
5510 +              }
5511 +            }
5512 +            Standard_Real theParam = Precision::Infinite();
5513 +            //Choose the closest parameter
5514 +            if (SameDirs[0] && SameDirs[1])
5515 +              theParam = (Abs(param - SavedParams[0]) < Abs(param - SavedParams[1]))?
5516 +                SavedParams[0] : SavedParams[1];
5517 +            else if (SameDirs[0])
5518 +              theParam = SavedParams[0];
5519 +            else if (SameDirs[1])
5520 +              theParam = SavedParams[1];
5521 +            
5522 +            if (!Precision::IsInfinite(theParam))
5523 +              param = theParam;
5524 +          }
5525         }
5526         else if (recad1) {
5527           // sol sur 1
5528 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/Blend/Blend_Walking.cdl OCCT-6.8.0_SRC-patch/src/Blend/Blend_Walking.cdl
5529 --- OCCT-6.8.0_SRC/src/Blend/Blend_Walking.cdl  2014-11-11 17:46:43.000000000 +0300
5530 +++ OCCT-6.8.0_SRC-patch/src/Blend/Blend_Walking.cdl    2015-01-16 12:59:38.000000000 +0300
5531 @@ -45,6 +45,7 @@
5532       Transition       from IntSurf,
5533       Function         from Blend,
5534       FuncInv          from Blend,
5535 +     HElSpine         from ChFiDS,
5536       State            from TopAbs
5537  
5538  
5539 @@ -66,6 +67,7 @@
5540  
5541      Perform(me: in out; F       : in out Function from Blend;
5542                          FInv    : in out FuncInv  from Blend;
5543 +                       HGuide  : HElSpine from ChFiDS;
5544                          Pdep    : Real from Standard;
5545                          Pmax    : Real from Standard;
5546                         MaxStep : Real from Standard;
5547 @@ -164,6 +166,7 @@
5548  
5549      InternalPerform (me: in out;F       : in out Function from Blend;
5550                                  FInv    : in out FuncInv  from Blend;
5551 +                               HGuide  : HElSpine from ChFiDS;
5552                                  Bound   : Real from Standard)
5553                         
5554      is static private;
5555 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx OCCT-6.8.0_SRC-patch/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx
5556 --- OCCT-6.8.0_SRC/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx 2014-11-11 17:46:39.000000000 +0300
5557 +++ OCCT-6.8.0_SRC-patch/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx   2015-01-16 12:59:34.000000000 +0300
5558 @@ -684,8 +684,8 @@
5559        }
5560        //
5561        if (aInOutMap.IsBound (aHole)){
5562 -        const TopoDS_Shape& aHole2=aInOutMap(aHole);
5563 -        if (IsInside(aHole, aHole2, myContext)) {
5564 +        const TopoDS_Shape& aSolidWas=aInOutMap(aHole);
5565 +        if (IsInside(aSolid, aSolidWas, myContext)) {
5566            aInOutMap.UnBind(aHole);
5567            aInOutMap.Bind (aHole, aSolid);
5568          }
5569 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx OCCT-6.8.0_SRC-patch/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx
5570 --- OCCT-6.8.0_SRC/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx 2014-11-11 17:46:39.000000000 +0300
5571 +++ OCCT-6.8.0_SRC-patch/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx   2015-01-16 12:59:34.000000000 +0300
5572 @@ -267,7 +267,6 @@
5573      aPB->Indices(nV[0], nV[1]);
5574      //
5575      BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
5576 -    ////const BOPDS_IndexedMapOfPaveBlock& aMPBF=aFI.PaveBlocksOn();
5577      const BOPCol_MapOfInteger& aMIFOn=aFI.VerticesOn();
5578      const BOPCol_MapOfInteger& aMIFIn=aFI.VerticesIn();
5579      //~~~
5580 @@ -305,7 +304,9 @@
5581                aEF.SetIndices(nE, nF);
5582                aEF.SetCommonPart(aCP);
5583                myDS->AddInterf(nE, nF);
5584 -              // 3          
5585 +              //
5586 +              aMIEFC.Add(nF);
5587 +              //           
5588                BOPAlgo_Tools::FillMap(aPB, nF, aMPBLI, aAllocator);
5589                break;
5590              }
5591 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/BOPTools/BOPTools_AlgoTools_1.cxx OCCT-6.8.0_SRC-patch/src/BOPTools/BOPTools_AlgoTools_1.cxx
5592 --- OCCT-6.8.0_SRC/src/BOPTools/BOPTools_AlgoTools_1.cxx        2014-11-11 17:46:40.000000000 +0300
5593 +++ OCCT-6.8.0_SRC-patch/src/BOPTools/BOPTools_AlgoTools_1.cxx  2015-01-16 13:01:24.000000000 +0300
5594 @@ -344,6 +344,8 @@
5595                                   Standard_Real& theFVal) {
5596      try {
5597        const Standard_Real aPar = theX(1);
5598 +      if (!CheckParameter(aPar))
5599 +        return Standard_False;
5600        gp_Pnt aP1, aP2;
5601        gp_Pnt2d aP2d;
5602        my3DCurve->D0(aPar, aP1);
5603 @@ -367,7 +369,8 @@
5604                                      math_Vector& theGrad) {
5605      try {
5606        const Standard_Real aPar = theX(1);
5607 -      
5608 +      if (!CheckParameter(aPar))
5609 +        return Standard_False;
5610        gp_Pnt aP1, aP2;
5611        gp_Vec aDC3D, aDSU, aDSV;
5612        gp_Pnt2d aP2d;
5613 @@ -417,6 +420,19 @@
5614    }
5615    //
5616   private:
5617 +
5618 +  Standard_Boolean CheckParameter(const Standard_Real theParam)
5619 +  {
5620 +    if (theParam < my3DCurve->FirstParameter() ||
5621 +        theParam > my3DCurve->LastParameter()  ||
5622 +        theParam < my2DCurve->FirstParameter() ||
5623 +        theParam > my2DCurve->LastParameter() )
5624 +    {
5625 +      return Standard_False;
5626 +    }
5627 +    return Standard_True;
5628 +  }
5629 +
5630    Handle(Geom_Curve) my3DCurve;
5631    Handle(Geom2d_Curve) my2DCurve;
5632    Handle(Geom_Surface) mySurf;
5633 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/BOPTools/BOPTools_AlgoTools.cxx OCCT-6.8.0_SRC-patch/src/BOPTools/BOPTools_AlgoTools.cxx
5634 --- OCCT-6.8.0_SRC/src/BOPTools/BOPTools_AlgoTools.cxx  2014-11-11 17:46:40.000000000 +0300
5635 +++ OCCT-6.8.0_SRC-patch/src/BOPTools/BOPTools_AlgoTools.cxx    2015-01-16 13:01:24.000000000 +0300
5636 @@ -99,7 +99,8 @@
5637                                     gp_Pnt& aPOut,
5638                                     Handle(IntTools_Context)& theContext,
5639                                     GeomAPI_ProjectPointOnSurf& aProjPL,
5640 -                                   const Standard_Real aDt);
5641 +                                   const Standard_Real aDt,
5642 +                                   const Standard_Real aTolE);
5643  static 
5644    Standard_Real MinStep3D(const TopoDS_Edge& theE1,
5645                            const TopoDS_Face& theF1,
5646 @@ -1825,14 +1826,18 @@
5647                  GeomAPI_ProjectPointOnSurf& aProjPL,
5648                  const Standard_Real aDt)
5649  {
5650 +  Standard_Real aTolE;
5651 +  gp_Pnt aPx;
5652 +  //
5653    BOPTools_AlgoTools3D::GetNormalToFaceOnEdge(aE, aF, aT, aDN);
5654    if (aF.Orientation()==TopAbs_REVERSED){
5655      aDN.Reverse();
5656    }
5657 +  //
5658 +  aTolE=BRep_Tool::Tolerance(aE); 
5659    aDB = aDN^aDTgt;
5660    //
5661 -  gp_Pnt aPx;
5662 -  if (!FindPointInFace(aF, aP, aDB, aPx, theContext, aProjPL, aDt)) {
5663 +  if (!FindPointInFace(aF, aP, aDB, aPx, theContext, aProjPL, aDt, aTolE)) {
5664      BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge(aE, aF, aT, aPx, 
5665                                                        aDN, theContext);
5666      aProjPL.Perform(aPx);
5667 @@ -1841,7 +1846,6 @@
5668      aDB.SetXYZ(aVec.XYZ());
5669    }
5670  }
5671 -
5672  //=======================================================================
5673  //function : FindPointInFace
5674  //purpose  : Find a point in the face in direction of <aDB>
5675 @@ -1852,12 +1856,13 @@
5676                                   gp_Pnt& aPOut,
5677                                   Handle(IntTools_Context)& theContext,
5678                                   GeomAPI_ProjectPointOnSurf& aProjPL,
5679 -                                 const Standard_Real aDt)
5680 +                                 const Standard_Real aDt,
5681 +                                 const Standard_Real aTolE)
5682  {
5683    Standard_Integer aNbItMax;
5684    Standard_Real aDist, aDTol, aPM;
5685    Standard_Boolean bRet;
5686 -  gp_Pnt aP1;
5687 +  gp_Pnt aP1, aPS;
5688    //
5689    aDTol = Precision::Angular();
5690    aPM = aP.XYZ().Modulus();
5691 @@ -1869,10 +1874,27 @@
5692    //
5693    GeomAPI_ProjectPointOnSurf& aProj=theContext->ProjPS(aF);
5694    //
5695 +  aPS=aP;
5696 +  aProj.Perform(aPS);
5697 +  if (!aProj.IsDone()) {
5698 +    return bRet;
5699 +  }
5700 +  aPS=aProj.NearestPoint();
5701 +  aProjPL.Perform(aPS);
5702 +  aPS=aProjPL.NearestPoint();
5703 +  //
5704 +  aPS.SetXYZ(aPS.XYZ()+2.*aTolE*aDB.XYZ());
5705 +   aProj.Perform(aPS);
5706 +  if (!aProj.IsDone()) {
5707 +    return bRet;
5708 +  }
5709 +  aPS=aProj.NearestPoint();
5710 +  aProjPL.Perform(aPS);
5711 +  aPS=aProjPL.NearestPoint();
5712 +  //
5713 +  //
5714    do {
5715 -    aP1.SetCoord(aP.X()+aDt*aDB.X(),
5716 -                 aP.Y()+aDt*aDB.Y(),
5717 -                 aP.Z()+aDt*aDB.Z());
5718 +    aP1.SetXYZ(aPS.XYZ()+aDt*aDB.XYZ());
5719      //
5720      aProj.Perform(aP1);
5721      if (!aProj.IsDone()) {
5722 @@ -1884,7 +1906,7 @@
5723      aProjPL.Perform(aPOut);
5724      aPOut = aProjPL.NearestPoint();
5725      //
5726 -    gp_Vec aV(aP, aPOut);
5727 +    gp_Vec aV(aPS, aPOut);
5728      aDB.SetXYZ(aV.XYZ());
5729    } while (aDist > aDTol && --aNbItMax);
5730    //
5731 @@ -2006,8 +2028,8 @@
5732  //function : IsInvertedSolid
5733  //purpose  : 
5734  //=======================================================================
5735 -Standard_Boolean 
5736 -  BOPTools_AlgoTools::IsInvertedSolid(const TopoDS_Solid& aSolid)
5737 +Standard_Boolean BOPTools_AlgoTools::IsInvertedSolid
5738 +  (const TopoDS_Solid& aSolid)
5739  {
5740    Standard_Real aTolS;
5741    TopAbs_State aState;
5742 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/BRepFill/BRepFill_Pipe.cxx OCCT-6.8.0_SRC-patch/src/BRepFill/BRepFill_Pipe.cxx
5743 --- OCCT-6.8.0_SRC/src/BRepFill/BRepFill_Pipe.cxx       2014-11-11 17:46:41.000000000 +0300
5744 +++ OCCT-6.8.0_SRC-patch/src/BRepFill/BRepFill_Pipe.cxx 2015-01-16 12:59:36.000000000 +0300
5745 @@ -274,18 +274,9 @@
5746    }
5747  
5748    ShapeUpgrade_RemoveLocations RemLoc;
5749 +  RemLoc.SetRemoveLevel(TopAbs_COMPOUND);
5750    RemLoc.Remove(myFirst);
5751    myFirst = RemLoc.GetResult();
5752 -  TopLoc_Location theLoc = myFirst.Location();
5753 -  if (!theLoc.IsIdentity())
5754 -  {
5755 -    TopoDS_Shape NewMyFirst = BRepBuilderAPI_Copy(myFirst);
5756 -    RemLoc.Remove(NewMyFirst);
5757 -    NewMyFirst = RemLoc.GetResult();
5758 -    TopLoc_Location theIdentity;
5759 -    NewMyFirst.Location(theIdentity);
5760 -    myFirst = BRepBuilderAPI_Transform(NewMyFirst, theLoc.Transformation(), Standard_True);
5761 -  }
5762    
5763    myLoc->Law(myLoc->NbLaw())->GetDomain(first, last);
5764    myLoc->Law(myLoc->NbLaw())->D0(last,M, V);
5765 @@ -308,16 +299,6 @@
5766  
5767    RemLoc.Remove(myLast);
5768    myLast = RemLoc.GetResult();
5769 -  theLoc = myLast.Location();
5770 -  if (!theLoc.IsIdentity())
5771 -  {
5772 -    TopoDS_Shape NewMyLast = BRepBuilderAPI_Copy(myLast);
5773 -    RemLoc.Remove(NewMyLast);
5774 -    NewMyLast = RemLoc.GetResult();
5775 -    TopLoc_Location theIdentity;
5776 -    NewMyLast.Location(theIdentity);
5777 -    myLast = BRepBuilderAPI_Transform(NewMyLast, theLoc.Transformation(), Standard_True);
5778 -  }
5779    
5780  #if DRAW
5781    if (Affich) {
5782 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/ChFi3d/ChFi3d_Builder_2.cxx OCCT-6.8.0_SRC-patch/src/ChFi3d/ChFi3d_Builder_2.cxx
5783 --- OCCT-6.8.0_SRC/src/ChFi3d/ChFi3d_Builder_2.cxx      2014-11-11 17:46:44.000000000 +0300
5784 +++ OCCT-6.8.0_SRC-patch/src/ChFi3d/ChFi3d_Builder_2.cxx        2015-01-16 12:59:39.000000000 +0300
5785 @@ -1862,10 +1862,13 @@
5786    Standard_Real wl = Guide.LastParameter();
5787    Standard_Real locfleche = (wl - wf) * fleche;
5788    Standard_Real wfsav = wf, wlsav = wl;
5789 -  //Now the ElSpine is artificially extended to help rsnld.
5790 -  Standard_Real prab = 0.01;
5791 -  Guide.FirstParameter(wf-prab*(wl-wf));
5792 -  Guide.LastParameter (wl+prab*(wl-wf));
5793 +  if (!Guide.IsPeriodic())
5794 +  {
5795 +    //Now the ElSpine is artificially extended to help rsnld.
5796 +    Standard_Real prab = 0.01;
5797 +    Guide.FirstParameter(wf-prab*(wl-wf));
5798 +    Guide.LastParameter (wl+prab*(wl-wf));
5799 +  }
5800    Handle(ChFiDS_Spine)&  Spine = Stripe->ChangeSpine();
5801    Standard_Integer ii, nbed = Spine->NbEdges();
5802    Standard_Real lastedlastp = Spine->LastParameter(nbed);
5803 @@ -1920,7 +1923,9 @@
5804      Last = wf;
5805      if(Guide.IsPeriodic()) {
5806        Last = First - Guide.Period();
5807 +      Guide.SaveFirstParameter();
5808        Guide.FirstParameter(Last);
5809 +      Guide.SaveLastParameter();
5810        Guide.LastParameter (First * 1.1);//Extension to help rsnld.
5811      }
5812    }
5813 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/ChFi3d/ChFi3d_Builder_6.cxx OCCT-6.8.0_SRC-patch/src/ChFi3d/ChFi3d_Builder_6.cxx
5814 --- OCCT-6.8.0_SRC/src/ChFi3d/ChFi3d_Builder_6.cxx      2014-11-11 17:46:44.000000000 +0300
5815 +++ OCCT-6.8.0_SRC-patch/src/ChFi3d/ChFi3d_Builder_6.cxx        2015-01-16 12:59:39.000000000 +0300
5816 @@ -1573,7 +1573,7 @@
5817        if (5*TolGuide > MS) TolGuide = MS/5;
5818        if (5*TolEsp > MS) TolEsp = MS/5;
5819      }
5820 -    TheWalk.Perform(Func,FInv,NewFirst,Target,MS,TolGuide,
5821 +    TheWalk.Perform(Func,FInv,HGuide,NewFirst,Target,MS,TolGuide,
5822                     ParSol,TolEsp,Fleche,Appro);
5823      if (!TheWalk.IsDone()) {
5824  #ifdef OCCT_DEBUG
5825 @@ -2113,7 +2113,7 @@
5826        if (5*TolEsp > MS) TolEsp = MS/5;
5827      }
5828        
5829 -    TheWalk.Perform(Func,FInv,NewFirst,Target,MS,TolGuide,
5830 +    TheWalk.Perform(Func,FInv,HGuide,NewFirst,Target,MS,TolGuide,
5831                     ParSol,TolEsp,Fleche,Appro);
5832      
5833      if (!TheWalk.IsDone()) {
5834 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/ChFi3d/ChFi3d_Builder_C1.cxx OCCT-6.8.0_SRC-patch/src/ChFi3d/ChFi3d_Builder_C1.cxx
5835 --- OCCT-6.8.0_SRC/src/ChFi3d/ChFi3d_Builder_C1.cxx     2014-11-11 17:46:44.000000000 +0300
5836 +++ OCCT-6.8.0_SRC-patch/src/ChFi3d/ChFi3d_Builder_C1.cxx       2015-01-16 13:01:24.000000000 +0300
5837 @@ -371,8 +371,7 @@
5838      pared = ponc1.Parameter();
5839      parltg = ponc2.Parameter();
5840      if ((parltg > f) && (parltg < l)) {
5841 -#ifdef OCC23139
5842 -      ////modified by jgv, 10.05.2012 for the bug 23139////
5843 +      ////modified by jgv, 10.05.2012 for the bug 23139, 25657////
5844        Handle(Geom2d_Curve) PConF = fi.PCurveOnFace();
5845        if (!PConF.IsNull())
5846        {
5847 @@ -393,7 +392,6 @@
5848          }
5849        }
5850        /////////////////////////////////////////////////////
5851 -#endif
5852        fi.SetParameter(parltg,isfirst);
5853        cp.SetArc(cp.Tolerance(),cp.Arc(),pared,cp.TransitionOnArc());
5854        return Standard_True;
5855 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/ChFiDS/ChFiDS_ElSpine.cdl OCCT-6.8.0_SRC-patch/src/ChFiDS/ChFiDS_ElSpine.cdl
5856 --- OCCT-6.8.0_SRC/src/ChFiDS/ChFiDS_ElSpine.cdl        2014-11-11 17:46:44.000000000 +0300
5857 +++ OCCT-6.8.0_SRC-patch/src/ChFiDS/ChFiDS_ElSpine.cdl  2015-01-16 12:59:39.000000000 +0300
5858 @@ -50,6 +50,10 @@
5859      LastParameter(me) returns Real from Standard
5860      is redefined;
5861      
5862 +    GetSavedFirstParameter(me) returns Real from Standard;
5863 +    
5864 +    GetSavedLastParameter(me)  returns Real from Standard;
5865 +    
5866      Continuity(me) returns Shape from GeomAbs
5867      is redefined static;
5868  
5869 @@ -102,6 +106,10 @@
5870  
5871      LastParameter(me : in out; P : Real from Standard);
5872  
5873 +    SaveFirstParameter(me : in out);
5874 +
5875 +    SaveLastParameter(me : in out);
5876 +
5877      SetOrigin(me : in out; O : Real from Standard);
5878  
5879      FirstPointAndTgt(me; P : out Pnt from gp; T : out Vec from gp);
5880 @@ -188,5 +196,7 @@
5881  period    : Real     from Standard;
5882  periodic  : Boolean  from Standard; 
5883  
5884 +pfirstsav : Real     from Standard;
5885 +plastsav  : Real     from Standard;
5886  
5887  end ElSpine;
5888 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/ChFiDS/ChFiDS_ElSpine.cxx OCCT-6.8.0_SRC-patch/src/ChFiDS/ChFiDS_ElSpine.cxx
5889 --- OCCT-6.8.0_SRC/src/ChFiDS/ChFiDS_ElSpine.cxx        2014-11-11 17:46:44.000000000 +0300
5890 +++ OCCT-6.8.0_SRC-patch/src/ChFiDS/ChFiDS_ElSpine.cxx  2015-01-16 12:59:39.000000000 +0300
5891 @@ -27,6 +27,8 @@
5892  
5893  ChFiDS_ElSpine::ChFiDS_ElSpine():periodic(0)
5894  {
5895 +  pfirstsav = Precision::Infinite();
5896 +  plastsav  = Precision::Infinite();
5897  }
5898  
5899  
5900 @@ -52,6 +54,26 @@
5901  }
5902  
5903  //=======================================================================
5904 +//function : GetSavedFirstParameter
5905 +//purpose  : 
5906 +//=======================================================================
5907 +
5908 +Standard_Real ChFiDS_ElSpine::GetSavedFirstParameter() const
5909 +{
5910 +  return pfirstsav;
5911 +}
5912 +
5913 +//=======================================================================
5914 +//function : GetSavedLastParameter
5915 +//purpose  : 
5916 +//=======================================================================
5917 +
5918 +Standard_Real ChFiDS_ElSpine::GetSavedLastParameter() const
5919 +{
5920 +  return plastsav;
5921 +}
5922 +
5923 +//=======================================================================
5924  //function : Continuity
5925  //purpose  : 
5926  //=======================================================================
5927 @@ -229,6 +251,26 @@
5928    plast = P;
5929  }
5930  
5931 +//=======================================================================
5932 +//function : SaveFirstParameter
5933 +//purpose  : 
5934 +//=======================================================================
5935 +
5936 +void ChFiDS_ElSpine::SaveFirstParameter()
5937 +{
5938 +  pfirstsav = pfirst;
5939 +}
5940 +
5941 +//=======================================================================
5942 +//function : SaveLastParameter
5943 +//purpose  : 
5944 +//=======================================================================
5945 +
5946 +void ChFiDS_ElSpine::SaveLastParameter()
5947 +{
5948 +  plastsav = plast;
5949 +}
5950 +
5951  
5952  //=======================================================================
5953  //function : SetOrigin
5954 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/Graphic3d/Graphic3d_GraphicDriver.cdl OCCT-6.8.0_SRC-patch/src/Graphic3d/Graphic3d_GraphicDriver.cdl
5955 --- OCCT-6.8.0_SRC/src/Graphic3d/Graphic3d_GraphicDriver.cdl    2014-11-11 17:46:49.000000000 +0300
5956 +++ OCCT-6.8.0_SRC-patch/src/Graphic3d/Graphic3d_GraphicDriver.cdl      2015-01-16 13:01:24.000000000 +0300
5957 @@ -261,12 +261,6 @@
5958          is deferred;
5959      ---Purpose: call_togl_setvisualisation
5960  
5961 -    Transparency ( me       : mutable;
5962 -                   ACView   : CView from Graphic3d;
5963 -                   AFlag    : Boolean from Standard )
5964 -        is deferred;
5965 -    ---Purpose: call_togl_transparency
5966 -
5967      View ( me   : mutable;
5968             ACView   : in out CView from Graphic3d )
5969          returns Boolean from Standard
5970 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx OCCT-6.8.0_SRC-patch/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx
5971 --- OCCT-6.8.0_SRC/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx       2014-11-11 17:46:54.000000000 +0300
5972 +++ OCCT-6.8.0_SRC-patch/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx 2015-01-16 13:01:24.000000000 +0300
5973 @@ -1151,6 +1151,7 @@
5974                                          const Standard_Real theUlSurf1,
5975                                          const Standard_Real thePeriodOfSurf1,
5976                                          const Handle(IntSurf_LineOn2S)& theLine,
5977 +                                        const Standard_Real theTol3D,
5978                                          const Standard_Real theTol2D,
5979                                          const Standard_Boolean theFlForce)
5980  {
5981 @@ -1177,6 +1178,32 @@
5982                          thePntOnSurf2.X(), thePntOnSurf2.Y());
5983    }
5984  
5985 +  const Standard_Integer aNbPnts = theLine->NbPoints();
5986 +  if(aNbPnts > 0)
5987 +  {
5988 +    Standard_Real aUl = 0.0, aVl = 0.0;
5989 +    const IntSurf_PntOn2S aPlast = theLine->Value(aNbPnts);
5990 +    if(isTheReverse)
5991 +      aPlast.ParametersOnS2(aUl, aVl);
5992 +    else
5993 +      aPlast.ParametersOnS1(aUl, aVl);
5994 +
5995 +    if(anUpar <= aUl)
5996 +    {//Parameter value will be always increased.
5997 +      return Standard_False;
5998 +    }
5999 +
6000 +    //theTol2D is minimal step along parameter changed. 
6001 +    //Therefore, if we apply this minimal step two 
6002 +    //neighbour points will be always "same". Consequently,
6003 +    //we should reduce tolerance for IsSame checking.
6004 +    const Standard_Real aDTol = 1.0-Epsilon(1.0);
6005 +    if(aPnt.IsSame(aPlast, theTol3D*aDTol, theTol2D*aDTol))
6006 +    {
6007 +      theLine->RemovePoint(aNbPnts);
6008 +    }
6009 +  }
6010 +
6011    theLine->Add(aPnt);
6012    return Standard_True;
6013  }
6014 @@ -1191,6 +1218,7 @@
6015                                            const stCoeffsValue& theCoeffs,
6016                                            const Bnd_Box2d& theUVSurf1,
6017                                            const Bnd_Box2d& theUVSurf2,
6018 +                                          const Standard_Real theTol3D,
6019                                            const Standard_Real theTol2D,
6020                                            const Standard_Real thePeriod,
6021                                            const Standard_Real theNulValue,
6022 @@ -1281,7 +1309,7 @@
6023          AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
6024                            gp_Pnt2d(anUpar1, aV1), gp_Pnt2d(aU2, aV2),
6025                            aUSurf1f, aUSurf1l, thePeriod,
6026 -                          theWL->Curve(), theTol2D, theFlForce);
6027 +                          theWL->Curve(), theTol3D, theTol2D, theFlForce);
6028        }
6029        else
6030        {
6031 @@ -1313,7 +1341,7 @@
6032          AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
6033                          gp_Pnt2d(anUpar2, aV1), gp_Pnt2d(aU2, aV2),
6034                          aUSurf1f, aUSurf1l, thePeriod,
6035 -                        theWL->Curve(), theTol2D, theFlForce);
6036 +                        theWL->Curve(),theTol3D, theTol2D, theFlForce);
6037        }
6038        else
6039        {
6040 @@ -1346,7 +1374,7 @@
6041          AddPointIntoWL(theQuad1, theQuad2, isTheReverse, 
6042                          gp_Pnt2d(anUpar2, aV1), gp_Pnt2d(aU2, aV2),
6043                          aUSurf1f, aUSurf1l, thePeriod,
6044 -                        theWL->Curve(), theTol2D, theFlForce);
6045 +                        theWL->Curve(), theTol3D, theTol2D, theFlForce);
6046        }
6047        else
6048        {
6049 @@ -1376,7 +1404,7 @@
6050          AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
6051                          gp_Pnt2d(anUpar1, aV1), gp_Pnt2d(aU2, aV2),
6052                          aUSurf1f, aUSurf1l, thePeriod,
6053 -                        theWL->Curve(), theTol2D, theFlForce);
6054 +                        theWL->Curve(), theTol3D, theTol2D, theFlForce);
6055        }
6056        else
6057        {
6058 @@ -1545,7 +1573,8 @@
6059    {
6060      Standard_Real &a = theU1crit[i],
6061                    &b = theU1crit[i-1];
6062 -    if(Abs(a - b) < theTol2D)
6063 +    const Standard_Real aRemain = fmod(Abs(a - b), thePeriod); // >= 0, because Abs(a - b) >= 0
6064 +    if((Abs(a - b) < theTol2D) || (aRemain < theTol2D) || (Abs(aRemain - thePeriod) < theTol2D))
6065      {
6066        a = (a + b)/2.0;
6067        b = Precision::Infinite();
6068 @@ -1817,6 +1846,7 @@
6069      Standard_Boolean isAddedIntoWL1 = Standard_False, isAddedIntoWL2 = Standard_False;
6070  
6071      Standard_Real anUf = aU1f[aCurInterval], anUl = aU1l[aCurInterval];
6072 +    const Standard_Boolean isDeltaPeriod  = IsEqual(anUl-anUf, aPeriod);
6073  
6074      //Inscribe and sort critical points
6075      InscribeAndSortArray(anU1crit, aNbCritPointsMax, anUf, anUl, theTol2D, aPeriod);
6076 @@ -1830,6 +1860,8 @@
6077        Handle(IntPatch_WLine) aWLine2 = new IntPatch_WLine(aL2S2, Standard_False);
6078  
6079        Standard_Integer aWL1FindStatus = 0, aWL2FindStatus = 0;
6080 +      Standard_Boolean  isAddingWL1Enabled = Standard_True,
6081 +                        isAddingWL2Enabled = Standard_True;
6082  
6083        Standard_Real anU1 = anUf;
6084  
6085 @@ -1845,6 +1877,23 @@
6086  
6087        while(anU1 <= anUl)
6088        {
6089 +        if(isDeltaPeriod)
6090 +        {
6091 +          if(IsEqual(anU1, anUl))
6092 +          {
6093 +            //if isAddedIntoWL* == TRUE WLine contains only one point
6094 +            //(which was end point of previous WLine). If we will
6095 +            //add point found on the current step WLine will contain only
6096 +            //two points. At that both these points will be equal to the
6097 +            //points found earlier. Therefore, new WLine will repeat 
6098 +            //already existing WLine. Consequently, it is necessary 
6099 +            //to forbid building new line in this case.
6100 +
6101 +            isAddingWL1Enabled = !isAddedIntoWL1;
6102 +            isAddingWL2Enabled = !isAddedIntoWL2;
6103 +          }
6104 +        }
6105 +
6106          for(Standard_Integer i = 0; i < aNbCritPointsMax; i++)
6107          {
6108            if((anU1 - anU1crit[i])*aCriticalDelta[i] < 0.0)
6109 @@ -1995,123 +2044,129 @@
6110            isFirst = Standard_False;
6111          }
6112  
6113 -        if( ((aUSurf2f-aU21) <= theTol2D) && 
6114 -            ((aU21-aUSurf2l) <= theTol2D) &&
6115 -            ((aVSurf1f - aV11) <= theTol2D) && 
6116 -            ((aV11 - aVSurf1l) <= theTol2D) &&
6117 -            ((aVSurf2f - aV21) <= theTol2D) && ((aV21 - aVSurf2l) <= theTol2D))
6118 +        if(isAddingWL1Enabled)
6119          {
6120 -          Standard_Boolean isForce = Standard_False;
6121 -          if(!aWL1FindStatus)
6122 +          if( ((aUSurf2f-aU21) <= theTol2D) && 
6123 +              ((aU21-aUSurf2l) <= theTol2D) &&
6124 +              ((aVSurf1f - aV11) <= theTol2D) && 
6125 +              ((aV11 - aVSurf1l) <= theTol2D) &&
6126 +              ((aVSurf2f - aV21) <= theTol2D) && ((aV21 - aVSurf2l) <= theTol2D))
6127            {
6128 -            Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
6129 -
6130 -            if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
6131 +            Standard_Boolean isForce = Standard_False;
6132 +            if(!aWL1FindStatus)
6133              {
6134 -              isForce = Standard_True;
6135 -            }
6136 +              Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
6137  
6138 -            AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
6139 -                              theUVSurf1, theUVSurf2, theTol2D, aPeriod,
6140 -                              aNulValue, anU1, aU21, aV11, aV11Prev,
6141 -                              aV21, aV21Prev, isTheReverse,
6142 -                              1.0, isForce, isFound1, isFound2);
6143 +              if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
6144 +              {
6145 +                isForce = Standard_True;
6146 +              }
6147 +
6148 +              AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
6149 +                                theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
6150 +                                aNulValue, anU1, aU21, aV11, aV11Prev,
6151 +                                aV21, aV21Prev, isTheReverse,
6152 +                                1.0, isForce, isFound1, isFound2);
6153                
6154 -            if(isFound1 || isFound2)
6155 -            {
6156 -              aWL1FindStatus = 1;
6157 +              if(isFound1 || isFound2)
6158 +              {
6159 +                aWL1FindStatus = 1;
6160 +              }
6161              }
6162 -          }
6163  
6164 -          if((aWL1FindStatus != 2) || (aWLine1->NbPnts() >= 1))
6165 -          {
6166 -            if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse, 
6167 -                  gp_Pnt2d(anU1, aV11), gp_Pnt2d(aU21, aV21),
6168 -                  aUSurf1f, aUSurf1l, aPeriod,
6169 -                  aWLine1->Curve(), theTol2D, isForce))
6170 +            if((aWL1FindStatus != 2) || (aWLine1->NbPnts() >= 1))
6171              {
6172 -              if(!aWL1FindStatus)
6173 +              if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse, 
6174 +                    gp_Pnt2d(anU1, aV11), gp_Pnt2d(aU21, aV21),
6175 +                    aUSurf1f, aUSurf1l, aPeriod,
6176 +                    aWLine1->Curve(), theTol3D, theTol2D, isForce))
6177                {
6178 -                aWL1FindStatus = 1;
6179 +                if(!aWL1FindStatus)
6180 +                {
6181 +                  aWL1FindStatus = 1;
6182 +                }
6183                }
6184              }
6185            }
6186 -        }
6187 -        else
6188 -        {
6189 -          if(aWL1FindStatus == 1)
6190 +          else
6191            {
6192 -            Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
6193 +            if(aWL1FindStatus == 1)
6194 +            {
6195 +              Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
6196  
6197 -            AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
6198 -                              theUVSurf1, theUVSurf2, theTol2D, aPeriod,
6199 -                              aNulValue, anU1, aU21, aV11, aV11Prev,
6200 -                              aV21, aV21Prev, isTheReverse,
6201 -                              1.0, Standard_False, isFound1, isFound2);
6202 +              AddBoundaryPoint(theQuad1, theQuad2, aWLine1, anEquationCoeffs,
6203 +                                theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
6204 +                                aNulValue, anU1, aU21, aV11, aV11Prev,
6205 +                                aV21, aV21Prev, isTheReverse,
6206 +                                1.0, Standard_False, isFound1, isFound2);
6207  
6208 -            if(isFound1 || isFound2)
6209 -              aWL1FindStatus = 2; //start a new line
6210 +              if(isFound1 || isFound2)
6211 +                aWL1FindStatus = 2; //start a new line
6212 +            }
6213            }
6214          }
6215 -      
6216 -        if( ((aUSurf2f-aU22) <= theTol2D) &&
6217 -            ((aU22-aUSurf2l) <= theTol2D) && 
6218 -            ((aVSurf1f - aV12) <= theTol2D) &&
6219 -            ((aV12 - aVSurf1l) <= theTol2D) &&
6220 -            ((aVSurf2f - aV22) <= theTol2D) &&
6221 -            ((aV22 - aVSurf2l) <= theTol2D))
6222 +        
6223 +        if(isAddingWL2Enabled)
6224          {
6225 -          Standard_Boolean isForce = Standard_False;
6226 -
6227 -          if(!aWL2FindStatus)
6228 +          if( ((aUSurf2f-aU22) <= theTol2D) &&
6229 +              ((aU22-aUSurf2l) <= theTol2D) && 
6230 +              ((aVSurf1f - aV12) <= theTol2D) &&
6231 +              ((aV12 - aVSurf1l) <= theTol2D) &&
6232 +              ((aVSurf2f - aV22) <= theTol2D) &&
6233 +              ((aV22 - aVSurf2l) <= theTol2D))
6234            {
6235 -            Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
6236 +            Standard_Boolean isForce = Standard_False;
6237  
6238 -            if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
6239 +            if(!aWL2FindStatus)
6240              {
6241 -              isForce = Standard_True;
6242 -            }
6243 +              Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
6244  
6245 -            AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
6246 -                              theUVSurf1, theUVSurf2, theTol2D, aPeriod,
6247 -                              aNulValue, anU1, aU22, aV12, aV12Prev,
6248 -                              aV22, aV22Prev, isTheReverse,
6249 -                              -1.0, isForce, isFound1, isFound2);
6250 +              if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
6251 +              {
6252 +                isForce = Standard_True;
6253 +              }
6254 +
6255 +              AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
6256 +                                theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
6257 +                                aNulValue, anU1, aU22, aV12, aV12Prev,
6258 +                                aV22, aV22Prev, isTheReverse,
6259 +                                -1.0, isForce, isFound1, isFound2);
6260                
6261 -            if(isFound1 || isFound2)
6262 -            {
6263 -              aWL2FindStatus = 1;
6264 +              if(isFound1 || isFound2)
6265 +              {
6266 +                aWL2FindStatus = 1;
6267 +              }
6268              }
6269 -          }
6270  
6271 -          if((aWL2FindStatus != 2) || (aWLine2->NbPnts() >= 1))
6272 -          {
6273 -            if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
6274 -                  gp_Pnt2d(anU1, aV12), gp_Pnt2d(aU22, aV22),
6275 -                  aUSurf1f, aUSurf1l, aPeriod,
6276 -                  aWLine2->Curve(), theTol2D, isForce))
6277 +            if((aWL2FindStatus != 2) || (aWLine2->NbPnts() >= 1))
6278              {
6279 -              if(!aWL2FindStatus)
6280 +              if(AddPointIntoWL(theQuad1, theQuad2, isTheReverse,
6281 +                    gp_Pnt2d(anU1, aV12), gp_Pnt2d(aU22, aV22),
6282 +                    aUSurf1f, aUSurf1l, aPeriod,
6283 +                    aWLine2->Curve(), theTol3D, theTol2D, isForce))
6284                {
6285 -                aWL2FindStatus = 1;
6286 +                if(!aWL2FindStatus)
6287 +                {
6288 +                  aWL2FindStatus = 1;
6289 +                }
6290                }
6291              }
6292            }
6293 -        }
6294 -        else
6295 -        {
6296 -          if(aWL2FindStatus == 1)
6297 +          else
6298            {
6299 -            Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
6300 +            if(aWL2FindStatus == 1)
6301 +            {
6302 +              Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
6303  
6304 -            AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
6305 -                              theUVSurf1, theUVSurf2, theTol2D, aPeriod,
6306 -                              aNulValue, anU1, aU22, aV12, aV12Prev,
6307 -                              aV22, aV22Prev, isTheReverse,
6308 -                              -1.0, Standard_False, isFound1, isFound2);
6309 +              AddBoundaryPoint(theQuad1, theQuad2, aWLine2, anEquationCoeffs,
6310 +                                theUVSurf1, theUVSurf2, theTol3D, theTol2D, aPeriod,
6311 +                                aNulValue, anU1, aU22, aV12, aV12Prev,
6312 +                                aV22, aV22Prev, isTheReverse,
6313 +                                -1.0, Standard_False, isFound1, isFound2);
6314  
6315 -            if(isFound1 || isFound2)
6316 -              aWL2FindStatus = 2; //start a new line
6317 +              if(isFound1 || isFound2)
6318 +                aWL2FindStatus = 2; //start a new line
6319 +            }
6320            }
6321          }
6322  
6323 @@ -2237,15 +2292,29 @@
6324        }
6325        else if(aWLine1->NbPnts() > 1)
6326        {
6327 -        isTheEmpty = Standard_False;
6328 -        isAddedIntoWL1 = Standard_True;
6329 +        Standard_Boolean isGood = Standard_True;
6330 +
6331 +        if(aWLine1->NbPnts() == 2)
6332 +        {
6333 +          const IntSurf_PntOn2S& aPf = aWLine1->Point(1);
6334 +          const IntSurf_PntOn2S& aPl = aWLine1->Point(2);
6335  
6336 -        SeekAdditionalPoints(theQuad1, theQuad2, aWLine1->Curve(), 
6337 -                              anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
6338 -                              theTol2D, aPeriod, 1.0, isTheReverse);
6339 +          if(aPf.IsSame(aPl, Precision::Confusion()))
6340 +            isGood = Standard_False;
6341 +        }
6342  
6343 -        aWLine1->ComputeVertexParameters(theTol3D);
6344 -        theSlin.Append(aWLine1);
6345 +        if(isGood)
6346 +        {
6347 +          isTheEmpty = Standard_False;
6348 +          isAddedIntoWL1 = Standard_True;
6349 +
6350 +          SeekAdditionalPoints( theQuad1, theQuad2, aWLine1->Curve(), 
6351 +                                anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
6352 +                                theTol2D, aPeriod, 1.0, isTheReverse);
6353 +
6354 +          aWLine1->ComputeVertexParameters(theTol3D);
6355 +          theSlin.Append(aWLine1);
6356 +        }
6357        }
6358        else
6359        {
6360 @@ -2267,15 +2336,28 @@
6361        }
6362        else if(aWLine2->NbPnts() > 1)
6363        {
6364 -        isTheEmpty = Standard_False;
6365 -        isAddedIntoWL2 = Standard_True;
6366 +        Standard_Boolean isGood = Standard_True;
6367 +        if(aWLine2->NbPnts() == 2)
6368 +        {
6369 +          const IntSurf_PntOn2S& aPf = aWLine2->Point(1);
6370 +          const IntSurf_PntOn2S& aPl = aWLine2->Point(2);
6371 +
6372 +          if(aPf.IsSame(aPl, Precision::Confusion()))
6373 +            isGood = Standard_False;
6374 +        }
6375  
6376 -        SeekAdditionalPoints(theQuad1, theQuad2, aWLine2->Curve(),
6377 -                              anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
6378 -                              theTol2D, aPeriod, -1.0, isTheReverse);
6379 +        if(isGood)
6380 +        {
6381 +          isTheEmpty = Standard_False;
6382 +          isAddedIntoWL2 = Standard_True;
6383  
6384 -        aWLine2->ComputeVertexParameters(theTol3D);
6385 -        theSlin.Append(aWLine2);
6386 +          SeekAdditionalPoints(theQuad1, theQuad2, aWLine2->Curve(),
6387 +                                anEquationCoeffs, aNbPoints, aUSurf2f, aUSurf2l,
6388 +                                theTol2D, aPeriod, -1.0, isTheReverse);
6389 +
6390 +          aWLine2->ComputeVertexParameters(theTol3D);
6391 +          theSlin.Append(aWLine2);
6392 +        }
6393        }
6394        else
6395        {
6396 @@ -2284,6 +2366,203 @@
6397      }
6398    }
6399  
6400 +  if(theSlin.Length() > 0)
6401 +  {
6402 +    for(Standard_Integer aNumOfLine = 2; aNumOfLine <= theSlin.Length(); aNumOfLine++)
6403 +    {
6404 +      const Handle(IntPatch_WLine)& aWLine = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine));
6405 +
6406 +      const IntSurf_PntOn2S& aPntFWL = aWLine->Point(1);
6407 +
6408 +      Standard_Real aU1 = 0.0, aU2 = 0.0, aV1 = 0.0, aV2 = 0.0;
6409 +      aPntFWL.Parameters(aU1, aV1, aU2, aV2);
6410 +
6411 +      if( IsEqual(aU1, 0.0) || IsEqual(aU1, aPeriod))
6412 +      {
6413 +        theSlin.Exchange(1, aNumOfLine);
6414 +        break;
6415 +      }
6416 +    }
6417 +
6418 +    for(Standard_Integer aNumOfLine1 = 1; aNumOfLine1 <= theSlin.Length(); aNumOfLine1++)
6419 +    {
6420 +      const Handle(IntPatch_WLine)& aWLine1 = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine1));
6421 +
6422 +      const Standard_Integer aNbPntsWL1 = aWLine1->NbPnts();
6423 +      const IntSurf_PntOn2S& aPntFWL1 = aWLine1->Point(1);
6424 +      const IntSurf_PntOn2S& aPntLWL1 = aWLine1->Point(aNbPntsWL1);
6425 +
6426 +      for(Standard_Integer aNPt = 1; aNPt <= theSPnt.Length(); aNPt++)
6427 +      {
6428 +        const IntSurf_PntOn2S aPntCur = theSPnt.Value(aNPt).PntOn2S();
6429 +
6430 +        if( aPntCur.IsSame(aPntFWL1, Precision::Confusion()) ||
6431 +            aPntCur.IsSame(aPntLWL1, Precision::Confusion()))
6432 +        {
6433 +          theSPnt.Remove(aNPt);
6434 +          aNPt--;
6435 +        }
6436 +      }
6437 +
6438 +      Standard_Boolean hasBeenRemoved = Standard_False;
6439 +      for(Standard_Integer aNumOfLine2 = aNumOfLine1 + 1; aNumOfLine2 <= theSlin.Length(); aNumOfLine2++)
6440 +      {
6441 +        const Handle(IntPatch_WLine)& aWLine2 = Handle(IntPatch_WLine)::DownCast(theSlin.Value(aNumOfLine2));
6442 +
6443 +        const Standard_Integer aNbPntsWL1 = aWLine1->NbPnts();
6444 +        const Standard_Integer aNbPntsWL2 = aWLine2->NbPnts();
6445 +
6446 +        const IntSurf_PntOn2S& aPntFWL1 = aWLine1->Point(1);
6447 +        const IntSurf_PntOn2S& aPntLWL1 = aWLine1->Point(aNbPntsWL1);
6448 +
6449 +        const IntSurf_PntOn2S& aPntFWL2 = aWLine2->Point(1);
6450 +        const IntSurf_PntOn2S& aPntLWL2 = aWLine2->Point(aNbPntsWL2);
6451 +
6452 +        if(aPntFWL1.IsSame(aPntFWL2, Precision::Confusion()))
6453 +        {
6454 +          Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0;
6455 +          Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0;
6456 +
6457 +          aPntFWL1.Parameters(aU11, aV11, aU12, aV12);
6458 +          aPntFWL2.Parameters(aU21, aV21, aU22, aV22);
6459 +
6460 +          if( !(IsEqual(fmod(aU11, aPeriod), 0.0) ||
6461 +                IsEqual(fmod(aU12, aPeriod), 0.0) ||
6462 +                IsEqual(fmod(aU21, aPeriod), 0.0) ||
6463 +                IsEqual(fmod(aU22, aPeriod), 0.0) ||
6464 +                IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) ||
6465 +                IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) ||
6466 +                IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) ||
6467 +                IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l)))
6468 +          {
6469 +            aWLine1->ClearVertexes();
6470 +            for(Standard_Integer aNPt = 1; aNPt <= aNbPntsWL2; aNPt++)
6471 +            {
6472 +              const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt);
6473 +              aWLine1->Curve()->InsertBefore(1, aPt);
6474 +            }
6475 +
6476 +            aWLine1->ComputeVertexParameters(theTol3D);
6477 +
6478 +            theSlin.Remove(aNumOfLine2);
6479 +            aNumOfLine2--;
6480 +            hasBeenRemoved = Standard_True;
6481 +
6482 +            continue;
6483 +          }
6484 +        }
6485 +
6486 +        if(aPntFWL1.IsSame(aPntLWL2, Precision::Confusion()))
6487 +        {
6488 +          Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0;
6489 +          Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0;
6490 +
6491 +          aPntFWL1.Parameters(aU11, aV11, aU12, aV12);
6492 +          aPntLWL2.Parameters(aU21, aV21, aU22, aV22);
6493 +
6494 +          if( !(IsEqual(fmod(aU11, aPeriod), 0.0) ||
6495 +                IsEqual(fmod(aU12, aPeriod), 0.0) ||
6496 +                IsEqual(fmod(aU21, aPeriod), 0.0) ||
6497 +                IsEqual(fmod(aU22, aPeriod), 0.0) ||
6498 +                IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) ||
6499 +                IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) ||
6500 +                IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) ||
6501 +                IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l)))
6502 +          {
6503 +            aWLine1->ClearVertexes();
6504 +            for(Standard_Integer aNPt = aNbPntsWL2; aNPt >= 1; aNPt--)
6505 +            {
6506 +              const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt);
6507 +              aWLine1->Curve()->InsertBefore(1, aPt);
6508 +            }
6509 +
6510 +            aWLine1->ComputeVertexParameters(theTol3D);
6511 +
6512 +            theSlin.Remove(aNumOfLine2);
6513 +            aNumOfLine2--;
6514 +            hasBeenRemoved = Standard_True;
6515 +
6516 +            continue;
6517 +          }
6518 +        }
6519 +
6520 +        if(aPntLWL1.IsSame(aPntFWL2, Precision::Confusion()))
6521 +        {
6522 +          Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0;
6523 +          Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0;
6524 +
6525 +          aPntLWL1.Parameters(aU11, aV11, aU12, aV12);
6526 +          aPntFWL2.Parameters(aU21, aV21, aU22, aV22);
6527 +
6528 +          if( !(IsEqual(fmod(aU11, aPeriod), 0.0) ||
6529 +                IsEqual(fmod(aU12, aPeriod), 0.0) ||
6530 +                IsEqual(fmod(aU21, aPeriod), 0.0) ||
6531 +                IsEqual(fmod(aU22, aPeriod), 0.0) ||
6532 +                IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) ||
6533 +                IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) ||
6534 +                IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) ||
6535 +                IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l)))
6536 +          {
6537 +            aWLine1->ClearVertexes();
6538 +            for(Standard_Integer aNPt = 1; aNPt <= aNbPntsWL2; aNPt++)
6539 +            {
6540 +              const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt);
6541 +              aWLine1->Curve()->Add(aPt);
6542 +            }
6543 +
6544 +            aWLine1->ComputeVertexParameters(theTol3D);
6545 +
6546 +            theSlin.Remove(aNumOfLine2);
6547 +            aNumOfLine2--;
6548 +            hasBeenRemoved = Standard_True;
6549 +
6550 +            continue;
6551 +          }
6552 +        }
6553 +
6554 +        if(aPntLWL1.IsSame(aPntLWL2, Precision::Confusion()))
6555 +        {
6556 +          Standard_Real aU11 = 0.0, aU12 = 0.0, aV11 = 0.0, aV12 = 0.0;
6557 +          Standard_Real aU21 = 0.0, aU22 = 0.0, aV21 = 0.0, aV22 = 0.0;
6558 +
6559 +          aPntLWL1.Parameters(aU11, aV11, aU12, aV12);
6560 +          aPntLWL2.Parameters(aU21, aV21, aU22, aV22);
6561 +
6562 +          if( !(IsEqual(fmod(aU11, aPeriod), 0.0) ||
6563 +                IsEqual(fmod(aU12, aPeriod), 0.0) ||
6564 +                IsEqual(fmod(aU21, aPeriod), 0.0) ||
6565 +                IsEqual(fmod(aU22, aPeriod), 0.0) ||
6566 +                IsEqual(aU11, aUSurf1f) || IsEqual(aU11, aUSurf1l) ||
6567 +                IsEqual(aU21, aUSurf1f) || IsEqual(aU21, aUSurf1l) ||
6568 +                IsEqual(aU12, aUSurf2f) || IsEqual(aU12, aUSurf2l) ||
6569 +                IsEqual(aU22, aUSurf2f) || IsEqual(aU22, aUSurf2l)))
6570 +          {
6571 +            aWLine1->ClearVertexes();
6572 +            for(Standard_Integer aNPt = aNbPntsWL2; aNPt >= 1; aNPt--)
6573 +            {
6574 +              const IntSurf_PntOn2S& aPt = aWLine2->Point(aNPt);
6575 +              aWLine1->Curve()->Add(aPt);
6576 +            }
6577 +
6578 +            aWLine1->ComputeVertexParameters(theTol3D);
6579 +
6580 +            theSlin.Remove(aNumOfLine2);
6581 +            aNumOfLine2--;
6582 +            hasBeenRemoved = Standard_True;
6583 +
6584 +            continue;
6585 +          }
6586 +        }
6587 +      }
6588 +
6589 +      if(hasBeenRemoved)
6590 +        aNumOfLine1--;
6591 +
6592 +      //aWLine1->ComputeVertexParameters(theTol3D);
6593 +    }
6594 +  }//if(theSlin.Length() > 0)
6595 +
6596 +
6597    return Standard_True;
6598  }
6599  
6600 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/IntPatch/IntPatch_WLine.cdl OCCT-6.8.0_SRC-patch/src/IntPatch/IntPatch_WLine.cdl
6601 --- OCCT-6.8.0_SRC/src/IntPatch/IntPatch_WLine.cdl      2014-11-11 17:46:54.000000000 +0300
6602 +++ OCCT-6.8.0_SRC-patch/src/IntPatch/IntPatch_WLine.cdl        2015-01-16 12:59:50.000000000 +0300
6603 @@ -309,9 +309,21 @@
6604         ---C++: return const&
6605          returns HCurve2d from Adaptor2d;
6606  
6607 -    Dump(me)
6608 +    ClearVertexes(me: mutable)
6609 +      is static;
6610      
6611 -       is static;
6612 +    RemoveVertex(me: mutable;
6613 +                  theIndex : Integer from Standard)
6614 +      is static;
6615 +      
6616 +    InsertVertexBefore(me: mutable;
6617 +                        theIndex : Integer from Standard;
6618 +                        thePnt   : Point from IntPatch)
6619 +      is static;
6620 +    
6621 +         Dump(me)
6622 +    
6623 +      is static;
6624  
6625   
6626  fields
6627 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/IntPatch/IntPatch_WLine.lxx OCCT-6.8.0_SRC-patch/src/IntPatch/IntPatch_WLine.lxx
6628 --- OCCT-6.8.0_SRC/src/IntPatch/IntPatch_WLine.lxx      2014-11-11 17:46:54.000000000 +0300
6629 +++ OCCT-6.8.0_SRC-patch/src/IntPatch/IntPatch_WLine.lxx        2015-01-16 12:59:50.000000000 +0300
6630 @@ -97,3 +97,27 @@
6631  {
6632    return svtx(Index);
6633  }
6634 +
6635 +inline void IntPatch_WLine::ClearVertexes()
6636 +{
6637 +  svtx.Clear();
6638 +}
6639 +
6640 +inline void IntPatch_WLine::RemoveVertex(const Standard_Integer theIndex)
6641 +{
6642 +  if((theIndex < 1) || (theIndex > NbVertex()))
6643 +    Standard_OutOfRange::Raise("Cannot delete not existing vertex");
6644 +  svtx.Remove(theIndex);
6645 +}
6646 +
6647 +inline void IntPatch_WLine::InsertVertexBefore( const Standard_Integer theIndex,
6648 +                                                const IntPatch_Point& thePnt)
6649 +{
6650 +  const Standard_Integer aNbVertexes = NbVertex();
6651 +  Standard_Integer anIndex = Max(theIndex, 1);
6652 +
6653 +  if(anIndex > aNbVertexes)
6654 +    svtx.Append(thePnt);
6655 +  else
6656 +    svtx.InsertBefore(theIndex, thePnt);
6657 +}
6658 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/IntSurf/IntSurf_PntOn2S.cdl OCCT-6.8.0_SRC-patch/src/IntSurf/IntSurf_PntOn2S.cdl
6659 --- OCCT-6.8.0_SRC/src/IntSurf/IntSurf_PntOn2S.cdl      2014-11-11 17:46:54.000000000 +0300
6660 +++ OCCT-6.8.0_SRC-patch/src/IntSurf/IntSurf_PntOn2S.cdl        2015-01-16 13:01:24.000000000 +0300
6661 @@ -119,6 +119,15 @@
6662  
6663         is static;
6664  
6665 +    IsSame(me; theOterPoint : PntOn2S from IntSurf;
6666 +            theTol3D, theTol2D: Real from Standard = 0.0)
6667 +            
6668 +  ---Purpose: Returns TRUE if 2D- and 3D-coordinates of theOterPoint are equal to
6669 +   --         corresponding coordinates of me (with given tolerance).
6670 +   --         If theTol2D == 0.0 we will compare 3D-points only.
6671 +   
6672 +        returns Boolean from Standard;
6673 +  
6674  
6675  fields
6676  
6677 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/IntSurf/IntSurf_PntOn2S.cxx OCCT-6.8.0_SRC-patch/src/IntSurf/IntSurf_PntOn2S.cxx
6678 --- OCCT-6.8.0_SRC/src/IntSurf/IntSurf_PntOn2S.cxx      2014-11-11 17:46:54.000000000 +0300
6679 +++ OCCT-6.8.0_SRC-patch/src/IntSurf/IntSurf_PntOn2S.cxx        2015-01-16 12:59:51.000000000 +0300
6680 @@ -49,4 +49,31 @@
6681  }
6682  
6683  
6684 +Standard_Boolean IntSurf_PntOn2S::IsSame( const IntSurf_PntOn2S& theOterPoint,
6685 +                                          const Standard_Real theTol3D,
6686 +                                          const Standard_Real theTol2D) const
6687 +{
6688 +  if(pt.SquareDistance(theOterPoint.Value()) > theTol3D*theTol3D)
6689 +    return Standard_False;
6690  
6691 +  if(IsEqual(theTol2D, 0.0))
6692 +  {//We need not compare 2D-coordinates of the points
6693 +    return Standard_True;
6694 +  }
6695 +
6696 +  Standard_Real aU1 = 0.0, aV1 = 0.0, aU2 = 0.0, aV2 = 0.0;
6697 +  theOterPoint.Parameters(aU1, aV1, aU2, aV2);
6698 +
6699 +  gp_Pnt2d aP1(u1, v1), aP2(aU1, aV1);
6700 +
6701 +  if(!aP1.IsEqual(aP2, theTol2D))
6702 +    return Standard_False;
6703 +
6704 +  aP1.SetCoord(u2, v2);
6705 +  aP2.SetCoord(aU2, aV2);
6706 +
6707 +  if(!aP1.IsEqual(aP2, theTol2D))
6708 +    return Standard_False;
6709 +
6710 +  return Standard_True;
6711 +}
6712 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/IntTools/IntTools_EdgeFace.cxx OCCT-6.8.0_SRC-patch/src/IntTools/IntTools_EdgeFace.cxx
6713 --- OCCT-6.8.0_SRC/src/IntTools/IntTools_EdgeFace.cxx   2014-11-11 17:46:54.000000000 +0300
6714 +++ OCCT-6.8.0_SRC-patch/src/IntTools/IntTools_EdgeFace.cxx     2015-01-16 12:59:51.000000000 +0300
6715 @@ -1365,20 +1365,27 @@
6716    (const IntTools_CommonPrt& aCP,
6717     Standard_Real& aTx) 
6718  {
6719 -  Standard_Real aTF, aTL, Tol, U1f,U1l,V1f,V1l, af, al,aDist2, aMinDist2, aTm, aDist2New;
6720 -  Standard_Real aEpsT;
6721 +  Standard_Real aTF, aTL, Tol, U1f,U1l,V1f,V1l;
6722 +  Standard_Real aEpsT, af, al,aDist2, aMinDist2, aTm, aDist2New;
6723    Standard_Boolean theflag=Standard_False;
6724    Standard_Integer aNbExt, i, iLower ;
6725 -
6726 +  GeomAbs_CurveType aType;
6727 +  //
6728    aCP.Range1(aTF, aTL);
6729 +  aType=myC.GetType();
6730 +  //
6731    aEpsT=8.e-5;
6732 +  if (aType==GeomAbs_Line) {
6733 +    aEpsT=9.e-5;
6734 +  }
6735 +  //
6736    aTm=0.5*(aTF+aTL);
6737    aDist2=DistanceFunction(aTm);
6738    aDist2 *= aDist2;
6739  
6740    Tol = Precision::PConfusion();
6741  
6742 -  const Handle(Geom_Curve)&  Curve   =BRep_Tool::Curve  (myC.Edge(), af, al);
6743 +  const Handle(Geom_Curve)&  Curve =BRep_Tool::Curve  (myC.Edge(), af, al);
6744    const Handle(Geom_Surface)& Surface=BRep_Tool::Surface(myS.Face());
6745  
6746    Surface->Bounds(U1f,U1l,V1f,V1l);
6747 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/IntTools/IntTools_FaceFace.cxx OCCT-6.8.0_SRC-patch/src/IntTools/IntTools_FaceFace.cxx
6748 --- OCCT-6.8.0_SRC/src/IntTools/IntTools_FaceFace.cxx   2014-11-11 17:46:54.000000000 +0300
6749 +++ OCCT-6.8.0_SRC-patch/src/IntTools/IntTools_FaceFace.cxx     2015-01-16 12:59:51.000000000 +0300
6750 @@ -1243,10 +1243,9 @@
6751        return;
6752      }
6753    }
6754 +  //
6755    // Do the Curve
6756 -  
6757 -  
6758 -  typl=L->ArcType();
6759 +  //
6760    switch (typl) {
6761    //########################################  
6762    // Line, Parabola, Hyperbola
6763 @@ -1276,10 +1275,14 @@
6764      //
6765      aNbParts=myLConstruct.NbParts();
6766      for (i=1; i<=aNbParts; i++) {
6767 +      Standard_Boolean bFNIt, bLPIt;
6768 +      //
6769        myLConstruct.Part(i, fprm, lprm);
6770 -      
6771 -      if (!Precision::IsNegativeInfinite(fprm) && 
6772 -          !Precision::IsPositiveInfinite(lprm)) {
6773 +      //
6774 +      bFNIt=Precision::IsNegativeInfinite(fprm);
6775 +      bLPIt=Precision::IsPositiveInfinite(lprm);
6776 +      //
6777 +      if (!bFNIt && !bLPIt) {
6778          //
6779          IntTools_Curve aCurve;
6780          //
6781 @@ -1309,7 +1312,7 @@
6782              //
6783              aCurve.SetFirstCurve2d(H1);
6784            }
6785 -        
6786 +        //
6787          if(myApprox2) { 
6788            Handle (Geom2d_Curve) C2d;
6789            BuildPCurves(fprm,lprm,Tolpc,myHS2->ChangeSurface().Surface(),newc,C2d);
6790 @@ -1325,25 +1328,24 @@
6791            aCurve.SetSecondCurve2d(H1);
6792          }
6793          mySeqOfCurve.Append(aCurve);
6794 -      } // end of if (!Precision::IsNegativeInfinite(fprm) &&  !Precision::IsPositiveInfinite(lprm))
6795 +      } //if (!bFNIt && !bLPIt) {
6796        else {
6797          //  on regarde si on garde
6798          //
6799 -        Standard_Boolean bFNIt, bLPIt;
6800          Standard_Real aTestPrm, dT=100.;
6801 -
6802 -        bFNIt=Precision::IsNegativeInfinite(fprm);
6803 -        bLPIt=Precision::IsPositiveInfinite(lprm);
6804 -        
6805 +        //
6806          aTestPrm=0.;
6807 -        
6808          if (bFNIt && !bLPIt) {
6809            aTestPrm=lprm-dT;
6810          }
6811          else if (!bFNIt && bLPIt) {
6812            aTestPrm=fprm+dT;
6813          }
6814 -        
6815 +        else {
6816 +          // i.e, if (bFNIt && bLPIt)
6817 +          aTestPrm=IntTools_Tools::IntermediatePoint(-dT, dT);
6818 +        }
6819 +        //
6820          gp_Pnt ptref(newc->Value(aTestPrm));
6821          //
6822          GeomAbs_SurfaceType typS1 = myHS1->GetType();
6823 @@ -1353,8 +1355,7 @@
6824              typS1 == GeomAbs_SurfaceOfRevolution ||
6825              typS2 == GeomAbs_SurfaceOfExtrusion ||
6826              typS2 == GeomAbs_OffsetSurface ||
6827 -            typS2 == GeomAbs_SurfaceOfRevolution) 
6828 -        {
6829 +            typS2 == GeomAbs_SurfaceOfRevolution) {
6830            Handle(Geom2d_BSplineCurve) H1;
6831            mySeqOfCurve.Append(IntTools_Curve(newc, H1, H1));
6832            continue;
6833 @@ -1373,7 +1374,7 @@
6834            mySeqOfCurve.Append(IntTools_Curve(newc, H1, H1));
6835          }
6836        }
6837 -    }// end of for (i=1; i<=myLConstruct.NbParts(); i++)
6838 +    }// for (i=1; i<=aNbParts; i++) {
6839    }// case IntPatch_Lin:  case IntPatch_Parabola:  case IntPatch_Hyperbola:
6840      break;
6841  
6842 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/math/math_Recipes.cxx OCCT-6.8.0_SRC-patch/src/math/math_Recipes.cxx
6843 --- OCCT-6.8.0_SRC/src/math/math_Recipes.cxx    2014-11-11 17:47:18.000000000 +0300
6844 +++ OCCT-6.8.0_SRC-patch/src/math/math_Recipes.cxx      2015-01-16 13:01:25.000000000 +0300
6845 @@ -177,7 +177,7 @@
6846                       math_Vector& vv,
6847                       Standard_Real    TINY) { 
6848  
6849 -     Standard_Integer i, imax=0, j, k;
6850 +     Standard_Integer i, imax=1, j, k;
6851       Standard_Real big, dum, sum, temp;
6852  
6853       Standard_Integer n = a.RowNumber();
6854 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/OpenGl/OpenGl_GraphicDriver_7.cxx OCCT-6.8.0_SRC-patch/src/OpenGl/OpenGl_GraphicDriver_7.cxx
6855 --- OCCT-6.8.0_SRC/src/OpenGl/OpenGl_GraphicDriver_7.cxx        2014-11-11 17:46:58.000000000 +0300
6856 +++ OCCT-6.8.0_SRC-patch/src/OpenGl/OpenGl_GraphicDriver_7.cxx  2015-01-16 13:01:24.000000000 +0300
6857 @@ -470,13 +470,6 @@
6858    }
6859  }
6860  
6861 -void OpenGl_GraphicDriver::Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag)
6862 -{
6863 -  const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
6864 -  if (aCView)
6865 -    aCView->WS->UseTransparency(AFlag);
6866 -}
6867 -
6868  // =======================================================================
6869  // function : InvalidateBVHData
6870  // purpose  :
6871 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/OpenGl/OpenGl_GraphicDriver.hxx OCCT-6.8.0_SRC-patch/src/OpenGl/OpenGl_GraphicDriver.hxx
6872 --- OCCT-6.8.0_SRC/src/OpenGl/OpenGl_GraphicDriver.hxx  2014-11-11 17:46:58.000000000 +0300
6873 +++ OCCT-6.8.0_SRC-patch/src/OpenGl/OpenGl_GraphicDriver.hxx    2015-01-16 13:01:24.000000000 +0300
6874 @@ -167,7 +167,6 @@
6875    Standard_EXPORT void SetClipPlanes (const Graphic3d_CView& theCView);
6876    Standard_EXPORT void SetCamera (const Graphic3d_CView& theCView);
6877    Standard_EXPORT void SetVisualisation (const Graphic3d_CView& ACView);
6878 -  Standard_EXPORT void Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag);
6879    Standard_EXPORT Standard_Boolean View (Graphic3d_CView& ACView);
6880    Standard_EXPORT void Environment (const Graphic3d_CView& ACView);
6881    Standard_EXPORT void ZBufferTriedronSetup (const Quantity_NameOfColor XColor = Quantity_NOC_RED, const Quantity_NameOfColor YColor = Quantity_NOC_GREEN, const Quantity_NameOfColor ZColor = Quantity_NOC_BLUE1, const Standard_Real SizeRatio = 0.8, const Standard_Real AxisDiametr = 0.05, const Standard_Integer NbFacettes = 12);
6882 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/OpenGl/OpenGl_View.cxx OCCT-6.8.0_SRC-patch/src/OpenGl/OpenGl_View.cxx
6883 --- OCCT-6.8.0_SRC/src/OpenGl/OpenGl_View.cxx   2014-11-11 17:46:58.000000000 +0300
6884 +++ OCCT-6.8.0_SRC-patch/src/OpenGl/OpenGl_View.cxx     2015-01-16 12:59:55.000000000 +0300
6885 @@ -54,7 +54,7 @@
6886  
6887  OpenGl_View::OpenGl_View (const CALL_DEF_VIEWCONTEXT &AContext,
6888                            OpenGl_StateCounter*       theCounter)
6889 -: mySurfaceDetail(Visual3d_TOD_NONE),
6890 +: mySurfaceDetail(Visual3d_TOD_ALL),
6891    myBackfacing(0),
6892    myBgTexture(myDefaultBgTexture),
6893    myBgGradient(myDefaultBgGradient),
6894 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/OpenGl/OpenGl_Workspace_5.cxx OCCT-6.8.0_SRC-patch/src/OpenGl/OpenGl_Workspace_5.cxx
6895 --- OCCT-6.8.0_SRC/src/OpenGl/OpenGl_Workspace_5.cxx    2014-11-11 17:46:58.000000000 +0300
6896 +++ OCCT-6.8.0_SRC-patch/src/OpenGl/OpenGl_Workspace_5.cxx      2015-01-16 13:01:24.000000000 +0300
6897 @@ -119,7 +119,7 @@
6898        NamedStatus |= OPENGL_NS_2NDPASSNEED;
6899      }
6900  
6901 -    if (myUseTransparency && aProps->trans != 1.0f)
6902 +    if (aProps->trans != 1.0f)
6903      {
6904        // render transparent
6905        myMatTmp.Diffuse.a() = aProps->trans;
6906 @@ -349,7 +349,7 @@
6907                               ? TelCullNone
6908                               : (TelCullMode )AspectFace_set->CullingMode();
6909      if (aCullingMode != TelCullNone
6910 -     && myUseTransparency && !(NamedStatus & OPENGL_NS_2NDPASSDO))
6911 +     && !(NamedStatus & OPENGL_NS_2NDPASSDO))
6912      {
6913        // disable culling in case of translucent shading aspect
6914        if (AspectFace_set->IntFront().trans != 1.0f)
6915 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/OpenGl/OpenGl_Workspace.cxx OCCT-6.8.0_SRC-patch/src/OpenGl/OpenGl_Workspace.cxx
6916 --- OCCT-6.8.0_SRC/src/OpenGl/OpenGl_Workspace.cxx      2014-11-11 17:46:58.000000000 +0300
6917 +++ OCCT-6.8.0_SRC-patch/src/OpenGl/OpenGl_Workspace.cxx        2015-01-16 13:01:24.000000000 +0300
6918 @@ -156,7 +156,6 @@
6919    myTransientDrawToFront (Standard_True),
6920    myBackBufferRestored   (Standard_False),
6921    myIsImmediateDrawn     (Standard_False),
6922 -  myUseTransparency (Standard_False),
6923    myUseZBuffer (Standard_False),
6924    myUseDepthTest (Standard_True),
6925    myUseGLLight (Standard_True),
6926 @@ -255,15 +254,6 @@
6927    return Standard_True;
6928  }
6929  
6930 -// =======================================================================
6931 -// function : UseTransparency
6932 -// purpose  : call_togl_transparency
6933 -// =======================================================================
6934 -void OpenGl_Workspace::UseTransparency (const Standard_Boolean theFlag)
6935 -{
6936 -  myUseTransparency = theFlag;
6937 -}
6938 -
6939  //=======================================================================
6940  //function : ResetAppliedAspect
6941  //purpose  : Sets default values of GL parameters in accordance with default aspects
6942 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/OpenGl/OpenGl_Workspace.hxx OCCT-6.8.0_SRC-patch/src/OpenGl/OpenGl_Workspace.hxx
6943 --- OCCT-6.8.0_SRC/src/OpenGl/OpenGl_Workspace.hxx      2014-11-11 17:46:58.000000000 +0300
6944 +++ OCCT-6.8.0_SRC-patch/src/OpenGl/OpenGl_Workspace.hxx        2015-01-16 13:01:24.000000000 +0300
6945 @@ -184,7 +184,6 @@
6946                                 Image_PixMap&               theImage,
6947                                 const Graphic3d_BufferType& theBufferType);
6948  
6949 -  void UseTransparency (const Standard_Boolean theFlag);
6950    Standard_Boolean& UseZBuffer()   { return myUseZBuffer; }
6951    Standard_Boolean& UseDepthTest() { return myUseDepthTest; }
6952    Standard_Boolean& UseGLLight()   { return myUseGLLight; }
6953 @@ -671,7 +670,6 @@
6954    Standard_Boolean       myTransientDrawToFront; //!< optimization flag for immediate mode (to render directly to the front buffer)
6955    Standard_Boolean       myBackBufferRestored;
6956    Standard_Boolean       myIsImmediateDrawn;     //!< flag indicates that immediate mode buffer contains some data
6957 -  Standard_Boolean       myUseTransparency;
6958    Standard_Boolean       myUseZBuffer;
6959    Standard_Boolean       myUseDepthTest;
6960    Standard_Boolean       myUseGLLight;
6961 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/ProjLib/ProjLib_ProjectedCurve.cxx OCCT-6.8.0_SRC-patch/src/ProjLib/ProjLib_ProjectedCurve.cxx
6962 --- OCCT-6.8.0_SRC/src/ProjLib/ProjLib_ProjectedCurve.cxx       2014-11-11 17:47:00.000000000 +0300
6963 +++ OCCT-6.8.0_SRC-patch/src/ProjLib/ProjLib_ProjectedCurve.cxx 2015-01-16 12:59:57.000000000 +0300
6964 @@ -53,6 +53,7 @@
6965  #include <Geom2d_TrimmedCurve.hxx>
6966  #include <ElCLib.hxx>
6967  #include <GeomLib.hxx>
6968 +#include <Extrema_ExtPC.hxx>
6969  
6970  //=======================================================================
6971  //function : IsoIsDeg
6972 @@ -482,7 +483,16 @@
6973              IsTrimmed[0] = Standard_True;
6974              f = f + dt;
6975              myCurve = myCurve->Trim(f, l, Precision::Confusion());
6976 -            Vsingular[0] = ElCLib::Parameter(L, P);
6977 +            // Searching the parameter on the basis curve for surface of revolution
6978 +            Extrema_ExtPC anExtr(P, mySurface->BasisCurve()->Curve(), myTolerance);
6979 +            if (anExtr.IsDone())
6980 +            {
6981 +              Standard_Integer anIndex = 1;
6982 +              while (!anExtr.IsMin(anIndex) && anIndex < anExtr.NbExt()) anIndex++;
6983 +              Vsingular[0] = anExtr.Point(anIndex).Parameter();
6984 +            }
6985 +            else
6986 +              Vsingular[0] = ElCLib::Parameter(L, P);
6987              //SingularCase[0] = 3;
6988            }
6989  
6990 @@ -492,7 +502,16 @@
6991              IsTrimmed[1] = Standard_True;
6992              l = l - dt;
6993              myCurve = myCurve->Trim(f, l, Precision::Confusion());
6994 -            Vsingular[1] = ElCLib::Parameter(L, P);
6995 +            // Searching the parameter on the basis curve for surface of revolution
6996 +            Extrema_ExtPC anExtr(P, mySurface->BasisCurve()->Curve(), myTolerance);
6997 +            if (anExtr.IsDone())
6998 +            {
6999 +              Standard_Integer anIndex = 1;
7000 +              while (!anExtr.IsMin(anIndex) && anIndex < anExtr.NbExt()) anIndex++;
7001 +              Vsingular[1] = anExtr.Point(anIndex).Parameter();
7002 +            }
7003 +            else
7004 +              Vsingular[1] = ElCLib::Parameter(L, P);
7005              //SingularCase[1] = 4;
7006            }
7007          }
7008 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/QABugs/QABugs_11.cxx OCCT-6.8.0_SRC-patch/src/QABugs/QABugs_11.cxx
7009 --- OCCT-6.8.0_SRC/src/QABugs/QABugs_11.cxx     2014-11-11 17:47:00.000000000 +0300
7010 +++ OCCT-6.8.0_SRC-patch/src/QABugs/QABugs_11.cxx       2015-01-16 13:01:24.000000000 +0300
7011 @@ -236,10 +236,10 @@
7012    anAISCtx->AddOrRemoveCurrentObject(aSh4);
7013  
7014    //remove all this objects from context
7015 -  anAISCtx->Clear(aSh1, Standard_False);
7016 -  anAISCtx->Clear(aSh2, Standard_False);
7017 -  anAISCtx->Clear(aSh3, Standard_False);
7018 -  anAISCtx->Clear(aSh4, Standard_False);
7019 +  anAISCtx->Remove (aSh1, Standard_False);
7020 +  anAISCtx->Remove (aSh2, Standard_False);
7021 +  anAISCtx->Remove (aSh3, Standard_False);
7022 +  anAISCtx->Remove (aSh4, Standard_False);
7023    return 0;
7024  }
7025  
7026 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/SelectMgr/SelectMgr_EntityOwner.cxx OCCT-6.8.0_SRC-patch/src/SelectMgr/SelectMgr_EntityOwner.cxx
7027 --- OCCT-6.8.0_SRC/src/SelectMgr/SelectMgr_EntityOwner.cxx      2014-11-11 17:47:04.000000000 +0300
7028 +++ OCCT-6.8.0_SRC-patch/src/SelectMgr/SelectMgr_EntityOwner.cxx        2015-01-16 13:00:02.000000000 +0300
7029 @@ -129,7 +129,7 @@
7030  
7031  TopLoc_Location SelectMgr_EntityOwner::Location() const
7032  {
7033 -  return !HasSelectable() ? TopLoc_Location() : TopLoc_Location(mySelectable->Transformation());
7034 +  return !HasLocation() ? TopLoc_Location() : TopLoc_Location(mySelectable->Transformation());
7035  }
7036  
7037  void SelectMgr_EntityOwner::ResetLocation()
7038 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/ShapeFix/ShapeFix_Shape.cdl OCCT-6.8.0_SRC-patch/src/ShapeFix/ShapeFix_Shape.cdl
7039 --- OCCT-6.8.0_SRC/src/ShapeFix/ShapeFix_Shape.cdl      2014-11-11 17:47:05.000000000 +0300
7040 +++ OCCT-6.8.0_SRC-patch/src/ShapeFix/ShapeFix_Shape.cdl        2015-01-16 13:00:03.000000000 +0300
7041 @@ -135,6 +135,12 @@
7042         ---C++: inline
7043          ---Purpose: Returns (modifiable) the mode for applying 
7044          --          ShapeFix::FixVertexPosition before all fixes, by default False.
7045 +        
7046 +        FixVertexTolMode (me: mutable) returns Integer;
7047 +       ---C++: return &
7048 +       ---C++: inline
7049 +        ---Purpose: Returns (modifiable) the mode for fixing tolerances of vertices on whole shape 
7050 +        --         after performing all fixes
7051  fields  
7052  
7053      myResult    : Shape from TopoDS is protected;
7054 @@ -147,6 +153,7 @@
7055      myFixWireMode          : Integer is protected;
7056      myFixSameParameterMode : Integer is protected;
7057      myFixVertexPositionMode : Integer is protected;
7058 +    myFixVertexTolMode      : Integer is protected;
7059      myStatus    : Integer is protected;
7060  
7061  end Shape;
7062 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/ShapeFix/ShapeFix_Shape.cxx OCCT-6.8.0_SRC-patch/src/ShapeFix/ShapeFix_Shape.cxx
7063 --- OCCT-6.8.0_SRC/src/ShapeFix/ShapeFix_Shape.cxx      2014-11-11 17:47:05.000000000 +0300
7064 +++ OCCT-6.8.0_SRC-patch/src/ShapeFix/ShapeFix_Shape.cxx        2015-01-16 13:00:03.000000000 +0300
7065 @@ -53,6 +53,7 @@
7066    myFixWireMode  = -1;
7067    myFixSameParameterMode = -1;
7068    myFixVertexPositionMode =0;
7069 +  myFixVertexTolMode = -1;
7070    myFixSolid = new ShapeFix_Solid;
7071  }
7072  
7073 @@ -71,6 +72,7 @@
7074    myFixSameParameterMode = -1;
7075    myFixSolid = new ShapeFix_Solid;
7076    myFixVertexPositionMode =0;
7077 +  myFixVertexTolMode = -1;
7078    Init(shape);
7079  }
7080  
7081 @@ -97,7 +99,7 @@
7082  Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator)& theProgress) 
7083  {
7084    Standard_Integer savFixSmallAreaWireMode = 0;
7085 -
7086 +  Standard_Integer savFixVertexTolMode =  myFixVertexTolMode;
7087    Handle(ShapeFix_Face) fft = Handle(ShapeFix_Face)::DownCast( FixFaceTool() );
7088    if ( !fft.IsNull() ) {
7089      savFixSmallAreaWireMode = fft->FixSmallAreaWireMode();
7090 @@ -142,7 +144,7 @@
7091      TopoDS_Shape shape = myShape;
7092      Standard_Boolean savFixSameParameterMode = myFixSameParameterMode;
7093      myFixSameParameterMode = Standard_False;
7094 -
7095 +    myFixVertexTolMode = Standard_False;
7096      Standard_Integer aShapesNb = 0;
7097      for ( TopoDS_Iterator anIter(S); anIter.More(); anIter.Next() )
7098        ++aShapesNb;
7099 @@ -159,6 +161,7 @@
7100        return Standard_False; // aborted execution
7101  
7102      myFixSameParameterMode = savFixSameParameterMode;
7103 +    myFixVertexTolMode = savFixVertexTolMode;
7104      myShape = shape;
7105      break;
7106    }
7107 @@ -242,6 +245,26 @@
7108    {
7109      SameParameter(myResult, Standard_False, theProgress);
7110    }
7111 +  if( NeedFix( myFixVertexTolMode))
7112 +  {
7113 +    Standard_Integer nbF = 0;
7114 +    TopExp_Explorer anExpF(myResult, TopAbs_FACE);
7115 +    for( ; anExpF.More() && nbF <= 1; anExpF.Next())
7116 +      nbF++;
7117 +    if( nbF > 1)
7118 +    {
7119 +      //fix for bug  0025455 
7120 +      // for case when vertex belong to the different faces it is necessary to check vertices tolerances
7121 +      //after all fixes.
7122 +      //This fix it should be performed for example for case when cutting edge was performed.
7123 +
7124 +      Handle(ShapeFix_Edge) sfe = FixEdgeTool();
7125 +      TopExp_Explorer anExpE (myResult, TopAbs_EDGE);
7126 +      for ( ; anExpE.More(); anExpE.Next()) 
7127 +        sfe->FixVertexTolerance( TopoDS::Edge (anExpE.Current()));
7128 +
7129 +    }
7130 +  }
7131  
7132    if ( !fft.IsNull() )
7133      fft->FixSmallAreaWireMode() = savFixSmallAreaWireMode;
7134 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/ShapeFix/ShapeFix_Shape.lxx OCCT-6.8.0_SRC-patch/src/ShapeFix/ShapeFix_Shape.lxx
7135 --- OCCT-6.8.0_SRC/src/ShapeFix/ShapeFix_Shape.lxx      2014-11-11 17:47:05.000000000 +0300
7136 +++ OCCT-6.8.0_SRC-patch/src/ShapeFix/ShapeFix_Shape.lxx        2015-01-16 13:00:03.000000000 +0300
7137 @@ -122,3 +122,13 @@
7138  {
7139    return myFixVertexPositionMode;
7140  }
7141 +
7142 +//=======================================================================
7143 +//function : FixVertexTolMode
7144 +//purpose  : 
7145 +//=======================================================================
7146 +
7147 +inline Standard_Integer& ShapeFix_Shape::FixVertexTolMode() 
7148 +{
7149 +  return myFixVertexTolMode;
7150 +}
7151 \ No newline at end of file
7152 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/V3d/V3d_Plane.cxx OCCT-6.8.0_SRC-patch/src/V3d/V3d_Plane.cxx
7153 --- OCCT-6.8.0_SRC/src/V3d/V3d_Plane.cxx        2014-11-11 17:47:15.000000000 +0300
7154 +++ OCCT-6.8.0_SRC-patch/src/V3d/V3d_Plane.cxx  2015-01-16 13:00:15.000000000 +0300
7155 @@ -70,7 +70,6 @@
7156    Graphic3d_MaterialAspect aPlastic (Graphic3d_NOM_PLASTIC);
7157    aPlastic.SetColor (theColor);
7158    aPlastic.SetTransparency (0.5);
7159 -  theView->SetTransparency (Standard_True);
7160    anAsp->SetFrontMaterial (aPlastic);
7161    anAsp->SetInteriorStyle (Aspect_IS_HATCH);
7162    anAsp->SetHatchStyle (Aspect_HS_GRID_DIAGONAL_WIDE);
7163 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/V3d/V3d_View_2.cxx OCCT-6.8.0_SRC-patch/src/V3d/V3d_View_2.cxx
7164 --- OCCT-6.8.0_SRC/src/V3d/V3d_View_2.cxx       2014-11-11 17:47:15.000000000 +0300
7165 +++ OCCT-6.8.0_SRC-patch/src/V3d/V3d_View_2.cxx 2015-01-16 13:01:25.000000000 +0300
7166 @@ -21,7 +21,6 @@
7167       --------------------------------
7168        00-09-92 : GG  ; Creation.
7169        24-12-97 : FMN ; Suppression de GEOMLITE
7170 -      21-02-00 : GG  ; Add Transparency() method
7171        23-11-00 : GG  ; Add IsActiveLight() and IsActivePlane() methods
7172  
7173  ************************************************************************/
7174 @@ -102,18 +101,6 @@
7175  
7176  }
7177  
7178 -void V3d_View::SetTransparency(const Standard_Boolean AnActivity) {
7179 -
7180 -  MyTransparencyFlag = AnActivity;
7181 -  MyView->SetTransparency(AnActivity);
7182 -}
7183 -
7184 -
7185 -Standard_Boolean V3d_View::Transparency() const {
7186 -
7187 -  return MyTransparencyFlag;
7188 -}
7189 -
7190  void V3d_View::InitActiveLights() {
7191  myActiveLightsIterator.Initialize(MyActiveLights);
7192  }
7193 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/V3d/V3d_View.cdl OCCT-6.8.0_SRC-patch/src/V3d/V3d_View.cdl
7194 --- OCCT-6.8.0_SRC/src/V3d/V3d_View.cdl 2014-11-11 17:47:15.000000000 +0300
7195 +++ OCCT-6.8.0_SRC-patch/src/V3d/V3d_View.cdl   2015-01-16 13:01:25.000000000 +0300
7196 @@ -35,8 +35,6 @@
7197  --              -> Add SetProjModel() method.
7198  --      VKH - 15/11/99 : G004
7199  --              -> Add method Dump()
7200 ---      GG  - IMP210200
7201 ---              -> Add Transparency() method
7202  --      THA  - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
7203  --              -> Add Print method (works only under Windows).
7204  --      GG  - IMP231100
7205 @@ -415,10 +413,6 @@
7206          ---Level: Public
7207          ---Purpose: Returns TRUE when the light is active in this view.
7208  
7209 -        SetTransparency( me : mutable ; AnActivity : Boolean = Standard_False);
7210 -        ---Level: Public
7211 -        ---Purpose: Activate/Deactivate the transparency in this view.
7212 -
7213          SetImmediateUpdate(me: mutable; theImmediateUpdate: Boolean from Standard)
7214          returns Boolean from Standard;
7215           ---Purpose: sets the immediate update mode and returns the previous one.
7216 @@ -1141,10 +1135,6 @@
7217          ---Level: Public
7218          -- purpose: return the current environment texture used
7219  
7220 -        Transparency(me) returns Boolean from Standard;
7221 -        ---Level: Public
7222 -        ---Purpose: Returns the transparency activity.
7223 -
7224          Visualization ( me ) returns TypeOfVisualization from V3d;
7225          ---Level: Public
7226          ---Purpose: Returns the current visualisation mode.
7227 @@ -1638,7 +1628,6 @@
7228          MyGridEchoStructure             :       Structure from Graphic3d;
7229          MyGridEchoGroup                 :       Group from Graphic3d;
7230  
7231 -        MyTransparencyFlag      : Boolean from Standard;
7232          myImmediateUpdate: Boolean from Standard is protected;
7233  
7234          myXscreenAxis           : Vector from Graphic3d;
7235 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/V3d/V3d_View.cxx OCCT-6.8.0_SRC-patch/src/V3d/V3d_View.cxx
7236 --- OCCT-6.8.0_SRC/src/V3d/V3d_View.cxx 2014-11-11 17:47:15.000000000 +0300
7237 +++ OCCT-6.8.0_SRC-patch/src/V3d/V3d_View.cxx   2015-01-16 13:00:15.000000000 +0300
7238 @@ -251,8 +251,6 @@
7239    aCamera->SetProjectionType ((Type == V3d_ORTHOGRAPHIC)
7240      ? Graphic3d_Camera::Projection_Orthographic
7241      : Graphic3d_Camera::Projection_Perspective);
7242 -
7243 -  MyTransparencyFlag = Standard_False;
7244  }
7245  
7246  //=============================================================================
7247 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/ViewerTest/ViewerTest.cxx OCCT-6.8.0_SRC-patch/src/ViewerTest/ViewerTest.cxx
7248 --- OCCT-6.8.0_SRC/src/ViewerTest/ViewerTest.cxx        2014-11-11 17:47:15.000000000 +0300
7249 +++ OCCT-6.8.0_SRC-patch/src/ViewerTest/ViewerTest.cxx  2015-01-16 13:01:25.000000000 +0300
7250 @@ -241,7 +241,7 @@
7251         Handle(AIS_InteractiveObject)::DownCast (aMap.Find2 (theName));
7252  
7253      if (!anOldObj.IsNull())
7254 -      aContextAIS->Clear (anOldObj, Standard_True);
7255 +      aContextAIS->Remove (anOldObj, Standard_True);
7256  
7257      // remove name and old object from map
7258      aMap.UnBind2 (theName);
7259 @@ -2751,7 +2751,7 @@
7260    }
7261    else
7262    {
7263 -    anAISContext->Clear (anIO, Standard_False);
7264 +    anAISContext->Remove (anIO, Standard_False);
7265      aTexturedIO = new AIS_TexturedShape (DBRep::Get (theArgv[1]));
7266      GetMapOfAIS().UnBind1 (anIO);
7267      GetMapOfAIS().UnBind2 (aShapeName);
7268 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/Visual3d/Visual3d_ContextView.cxx OCCT-6.8.0_SRC-patch/src/Visual3d/Visual3d_ContextView.cxx
7269 --- OCCT-6.8.0_SRC/src/Visual3d/Visual3d_ContextView.cxx        2014-11-11 17:47:15.000000000 +0300
7270 +++ OCCT-6.8.0_SRC-patch/src/Visual3d/Visual3d_ContextView.cxx  2015-01-16 13:00:15.000000000 +0300
7271 @@ -57,7 +57,7 @@
7272  MyVisual (Visual3d_TOV_WIREFRAME),
7273  MyLights (),
7274  MyTextureEnv(),
7275 -MySurfaceDetail(Visual3d_TOD_NONE),
7276 +MySurfaceDetail(Visual3d_TOD_ALL),
7277  myClipPlanes()
7278  {
7279  }
7280 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/Visual3d/Visual3d_View.cdl OCCT-6.8.0_SRC-patch/src/Visual3d/Visual3d_View.cdl
7281 --- OCCT-6.8.0_SRC/src/Visual3d/Visual3d_View.cdl       2014-11-11 17:47:15.000000000 +0300
7282 +++ OCCT-6.8.0_SRC-patch/src/Visual3d/Visual3d_View.cdl 2015-01-16 13:00:15.000000000 +0300
7283 @@ -1045,15 +1045,6 @@
7284          -- or insufficient memory.
7285         --  Warning: Works only under Windows.
7286  
7287 -       SetTransparency ( me : mutable;
7288 -               AFlag : Boolean from Standard )
7289 -               is static;
7290 -       ---Level: Advanced
7291 -       ---Purpose: if <AFlag> is Standard_True then the transparency
7292 -       --          is managed in the view <me>.
7293 -       --          Default Standard_False
7294 -       ---Category: Internal methods
7295 -
7296         ZBufferIsActivated ( me )
7297                 returns Boolean from Standard
7298                 is static;
7299 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/Visual3d/Visual3d_View.cxx OCCT-6.8.0_SRC-patch/src/Visual3d/Visual3d_View.cxx
7300 --- OCCT-6.8.0_SRC/src/Visual3d/Visual3d_View.cxx       2014-11-11 17:47:15.000000000 +0300
7301 +++ OCCT-6.8.0_SRC-patch/src/Visual3d/Visual3d_View.cxx 2015-01-16 13:00:15.000000000 +0300
7302 @@ -805,7 +805,6 @@
7303    {
7304      myGraphicDriver->ActivateView (MyCView);
7305      myGraphicDriver->Background   (MyCView);
7306 -    myGraphicDriver->Transparency (MyCView, myViewManager->Transparency());
7307  
7308      MyCView.Active = 1;
7309  
7310 @@ -1801,22 +1800,6 @@
7311  }
7312  
7313  // =======================================================================
7314 -// function : SetTransparency
7315 -// purpose  :
7316 -// =======================================================================
7317 -void Visual3d_View::SetTransparency (const Standard_Boolean theActivity)
7318 -{
7319 -  if (IsDeleted()
7320 -  || !IsDefined()
7321 -  || !IsActive())
7322 -  {
7323 -    return;
7324 -  }
7325 -
7326 -  myGraphicDriver->Transparency (MyCView, theActivity);
7327 -}
7328 -
7329 -// =======================================================================
7330  // function : SetZBufferActivity
7331  // purpose  :
7332  // =======================================================================
7333 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/Visual3d/Visual3d_ViewManager.cdl OCCT-6.8.0_SRC-patch/src/Visual3d/Visual3d_ViewManager.cdl
7334 --- OCCT-6.8.0_SRC/src/Visual3d/Visual3d_ViewManager.cdl        2014-11-11 17:47:15.000000000 +0300
7335 +++ OCCT-6.8.0_SRC-patch/src/Visual3d/Visual3d_ViewManager.cdl  2015-01-16 13:00:15.000000000 +0300
7336 @@ -411,24 +411,6 @@
7337         --          if <AStructure> is displayed in <AProjector> and TOS_COMPUTED.
7338         ---Category: Private methods
7339  
7340 -       Transparency ( me )
7341 -               returns Boolean from Standard
7342 -               is static;
7343 -       ---Level: Advanced
7344 -       ---Purpose: Returns Standard_True if the transparency
7345 -       --          is activated in all activated views.
7346 -       --          Default Standard_False
7347 -       ---Category: Internal methods
7348 -
7349 -       SetTransparency ( me : mutable;
7350 -               AFlag : Boolean from Standard )
7351 -               is static;
7352 -       ---Level: Advanced
7353 -       ---Purpose: if <AFlag> is Standard_True then the transparency
7354 -       --          is managed.
7355 -       --          Default Standard_False
7356 -       ---Category: Internal methods
7357 -
7358         ZBufferAuto ( me )
7359                 returns Boolean from Standard
7360                 is static;
7361 @@ -473,7 +455,6 @@
7362  
7363         -- advanced
7364         MyZBufferAuto                   :       Boolean from Standard;
7365 -       MyTransparency                  :       Boolean from Standard;
7366  
7367          -- Z layer indexes
7368          myLayerIds                      :       MapOfInteger from TColStd;
7369 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/src/Visual3d/Visual3d_ViewManager.cxx OCCT-6.8.0_SRC-patch/src/Visual3d/Visual3d_ViewManager.cxx
7370 --- OCCT-6.8.0_SRC/src/Visual3d/Visual3d_ViewManager.cxx        2014-11-11 17:47:15.000000000 +0300
7371 +++ OCCT-6.8.0_SRC-patch/src/Visual3d/Visual3d_ViewManager.cxx  2015-01-16 13:01:25.000000000 +0300
7372 @@ -83,8 +83,7 @@
7373  Graphic3d_StructureManager (theDriver),
7374  MyDefinedView (),
7375  MyViewGenId (View_IDMIN+((View_IDMIN+View_IDMAX)/(Visual3d_ViewManager::Limit ()))*(Visual3d_ViewManager::CurrentId ()-1),View_IDMIN+((View_IDMIN+View_IDMAX)/(Visual3d_ViewManager::Limit ()))*Visual3d_ViewManager::CurrentId ()-1),
7376 -MyZBufferAuto (Standard_False),
7377 -MyTransparency (Standard_False)
7378 +MyZBufferAuto (Standard_False)
7379  {
7380    // default layer is always presented in display layer sequence
7381    // it can not be removed
7382 @@ -558,24 +557,6 @@
7383    MyViewGenId.Free(aViewId);
7384  }
7385  
7386 -void Visual3d_ViewManager::SetTransparency (const Standard_Boolean AFlag)
7387 -{
7388 -  if (MyTransparency && AFlag) return;
7389 -  if (! MyTransparency && ! AFlag) return;
7390 -
7391 -  for(int i=1; i<=MyDefinedView.Length(); i++)
7392 -  {
7393 -    (MyDefinedView.Value(i))->SetTransparency(AFlag);
7394 -  }
7395 -
7396 -  MyTransparency = AFlag;
7397 -}
7398 -
7399 -Standard_Boolean Visual3d_ViewManager::Transparency () const
7400 -{
7401 -  return (MyTransparency);
7402 -}
7403 -
7404  void Visual3d_ViewManager::SetZBufferAuto (const Standard_Boolean AFlag)
7405  {
7406    if (MyZBufferAuto && AFlag) return;
7407 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/boolean/bcut_complex/N9 OCCT-6.8.0_SRC-patch/tests/boolean/bcut_complex/N9
7408 --- OCCT-6.8.0_SRC/tests/boolean/bcut_complex/N9        2014-11-11 17:47:21.000000000 +0300
7409 +++ OCCT-6.8.0_SRC-patch/tests/boolean/bcut_complex/N9  2015-01-16 13:00:21.000000000 +0300
7410 @@ -1,8 +1,8 @@
7411  # Original bug : pro14942
7412  # Date : 26Aout98
7413  
7414 -#CR23958 puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_"
7415 -#CR23958 puts "TODO #22911 ALL: Error : The area of the resulting shape is"
7416 +puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_"
7417 +puts "TODO #22911 ALL: Error : The area of the resulting shape is"
7418  
7419  restore [locate_data_file CTO904_pro14942a.rle] a 
7420  restore [locate_data_file pro14942b.rle] b
7421 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/boolean/bfuse_complex/P1 OCCT-6.8.0_SRC-patch/tests/boolean/bfuse_complex/P1
7422 --- OCCT-6.8.0_SRC/tests/boolean/bfuse_complex/P1       2014-11-11 17:47:22.000000000 +0300
7423 +++ OCCT-6.8.0_SRC-patch/tests/boolean/bfuse_complex/P1 2015-01-16 13:00:23.000000000 +0300
7424 @@ -1,4 +1,5 @@
7425  puts "TODO ?OCC24157 ALL: Error : The area of the resulting shape is"
7426 +puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_"
7427  # cts17861
7428  
7429  restore [locate_data_file CTO900_cts17861a.rle] a
7430 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/boolean/bopcommon_complex/J1 OCCT-6.8.0_SRC-patch/tests/boolean/bopcommon_complex/J1
7431 --- OCCT-6.8.0_SRC/tests/boolean/bopcommon_complex/J1   2014-11-11 17:47:23.000000000 +0300
7432 +++ OCCT-6.8.0_SRC-patch/tests/boolean/bopcommon_complex/J1     2015-01-16 13:00:24.000000000 +0300
7433 @@ -1,3 +1,6 @@
7434 +puts "TODO #22911 ALL: Error : The bopcommon is not valid. The area is"
7435 +puts "TODO #22911 ALL: Error : The area of the resulting shape is"
7436 +
7437  restore [locate_data_file a158] a
7438  restore [locate_data_file b148] b
7439  
7440 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/begin OCCT-6.8.0_SRC-patch/tests/bugs/begin
7441 --- OCCT-6.8.0_SRC/tests/bugs/begin     2014-11-11 17:47:29.000000000 +0300
7442 +++ OCCT-6.8.0_SRC-patch/tests/bugs/begin       2015-01-16 13:01:25.000000000 +0300
7443 @@ -253,7 +253,7 @@
7444  }
7445  
7446  # Check if list of xdistcs-command is valid
7447 -proc checkList {List Tolerance D_good} {
7448 +proc checkList {List Tolerance D_good Limit_Tol} {
7449     set L1 [llength ${List}]
7450     set L2 10
7451     set L3 5
7452 @@ -266,7 +266,14 @@
7453        set D [lindex ${List} ${j2}]
7454        #puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}"
7455        if { [expr abs(${D} - ${D_good})] > ${Tolerance} } {
7456 -         puts "Error: i=${i} T=${T} D=${D}"
7457 +         puts "Error : T=${T} D=${D}"
7458 +      }
7459 +      
7460 +      if { ${Tolerance} > ${Limit_Tol} } {
7461 +        if { [expr abs(${D} - ${D_good})] > ${Limit_Tol} 
7462 +             && [expr abs(${D} - ${D_good})] <= ${Tolerance} } {
7463 +           puts "Attention (critical value of tolerance) : T=${T} D=${D}"
7464 +        }
7465        }
7466     }
7467  }
7468 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/heal/bug25455 OCCT-6.8.0_SRC-patch/tests/bugs/heal/bug25455
7469 --- OCCT-6.8.0_SRC/tests/bugs/heal/bug25455     1970-01-01 03:00:00.000000000 +0300
7470 +++ OCCT-6.8.0_SRC-patch/tests/bugs/heal/bug25455       2015-01-16 13:00:32.000000000 +0300
7471 @@ -0,0 +1,21 @@
7472 +puts "============"
7473 +puts "OCC25455"
7474 +puts "============"
7475 +puts ""
7476 +######################################################
7477 +# fixshape works at the second attempt
7478 +######################################################
7479 +
7480 +restore [locate_data_file bug25455_rx.brep] rx
7481 +
7482 +fixshape rx rx
7483 +
7484 +set info [checkshape rx]
7485 +
7486 +# Resume
7487 +puts ""
7488 +if { [regexp {This shape seems to be valid} ${info}] } {
7489 +   puts "OK: fixshape works properly"
7490 +} else {
7491 +   puts "Error: fixshape works bad"
7492 +}
7493 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_1/bug16517_1 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_1/bug16517_1
7494 --- OCCT-6.8.0_SRC/tests/bugs/modalg_1/bug16517_1       2014-11-11 17:47:31.000000000 +0300
7495 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_1/bug16517_1 2015-01-16 13:01:25.000000000 +0300
7496 @@ -22,16 +22,16 @@
7497    renamevar p_1 result
7498  
7499    set status 0
7500 -  set length 110.161
7501 -  set nb_v_good 4
7502 -  set nb_e_good 4
7503 +  set length 110.167
7504 +  set nb_v_good 1
7505 +  set nb_e_good 1
7506    set nb_w_good 1
7507    set nb_f_good 0
7508    set nb_sh_good 0
7509    set nb_sol_good 0
7510    set nb_compsol_good 0
7511    set nb_compound_good 0
7512 -  set nb_shape_good 9
7513 +  set nb_shape_good 3
7514  }
7515  
7516  if { ${mistake} != 0 } {
7517 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_1/bug16517_2 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_1/bug16517_2
7518 --- OCCT-6.8.0_SRC/tests/bugs/modalg_1/bug16517_2       2014-11-11 17:47:31.000000000 +0300
7519 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_1/bug16517_2 2015-01-16 13:01:25.000000000 +0300
7520 @@ -22,16 +22,16 @@
7521    renamevar p_2 result
7522    set status 0
7523  
7524 -  set length 110.171
7525 -  set nb_v_good 4
7526 -  set nb_e_good 4
7527 +  set length 110.167
7528 +  set nb_v_good 1
7529 +  set nb_e_good 1
7530    set nb_w_good 1
7531    set nb_f_good 0
7532    set nb_sh_good 0
7533    set nb_sol_good 0
7534    set nb_compsol_good 0
7535    set nb_compound_good 0
7536 -  set nb_shape_good 9
7537 +  set nb_shape_good 3
7538  }
7539  
7540  # Resume
7541 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_2/bug22864 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_2/bug22864
7542 --- OCCT-6.8.0_SRC/tests/bugs/modalg_2/bug22864 2014-11-11 17:47:32.000000000 +0300
7543 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_2/bug22864   2015-01-16 13:00:34.000000000 +0300
7544 @@ -18,15 +18,15 @@
7545  #
7546  set status 0
7547  #
7548 -set nb_v_good 8
7549 -set nb_e_good 12
7550 -set nb_w_good 4
7551 -set nb_f_good 4
7552 +set nb_v_good 2
7553 +set nb_e_good 3
7554 +set nb_w_good 1
7555 +set nb_f_good 1
7556  set nb_sh_good 0
7557  set nb_sol_good 0
7558  set nb_compsol_good 0
7559  set nb_compound_good 1
7560 -set nb_shape_good 29
7561 +set nb_shape_good 8
7562  #
7563  set Numbers 11
7564  #
7565 @@ -95,7 +95,7 @@
7566      puts "Faulty ${BugNumber}"
7567  }
7568  
7569 -set square 8444.76
7570 +set square 6606.88
7571  set 2dviewer 0
7572  
7573  
7574 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_2/bug22967 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_2/bug22967
7575 --- OCCT-6.8.0_SRC/tests/bugs/modalg_2/bug22967 2014-11-11 17:47:32.000000000 +0300
7576 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_2/bug22967   2015-01-16 13:00:34.000000000 +0300
7577 @@ -7,7 +7,7 @@
7578  ###########################################################################################################
7579  
7580  set BugNumber OCC22967
7581 -set check_value 3.46945e-006
7582 +set check_value 8.46459e-006
7583  
7584  restore [locate_data_file bug22967_Cylinder_1.brep] b1 
7585  restore [locate_data_file bug22967_Scale_1.brep] b2 
7586 @@ -54,6 +54,6 @@
7587     puts "OK ${BugNumber}"
7588  }
7589  
7590 -set square 669221
7591 +set square 668843
7592  set 2dviewer 0
7593  
7594 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_2/bug23218 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_2/bug23218
7595 --- OCCT-6.8.0_SRC/tests/bugs/modalg_2/bug23218 2014-11-11 17:47:32.000000000 +0300
7596 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_2/bug23218   2015-01-16 13:00:35.000000000 +0300
7597 @@ -19,7 +19,7 @@
7598  puts $result
7599  puts "Finish project operation ..."
7600  
7601 -set GoodToleranceReached 2.4950140688989345e-006
7602 +set GoodToleranceReached 6.3315853638232248e-007
7603  regexp {Tolerance Reached=([-0-9.+eE]+)} $result full ToleranceReached
7604  
7605  proc GetPercent {Value GoodValue} {
7606 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_2/bug472_3 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_2/bug472_3
7607 --- OCCT-6.8.0_SRC/tests/bugs/modalg_2/bug472_3 2014-11-11 17:47:32.000000000 +0300
7608 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_2/bug472_3   2015-01-16 13:00:35.000000000 +0300
7609 @@ -1,7 +1,7 @@
7610  #puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_"
7611  #puts "TODO OCC12345 ALL: Error : The square of result shape is"
7612 -puts "TODO OCC12345 ALL: Error : The command is not valid"
7613 -puts "TODO OCC12345 ALL: Error : Result shape is WRONG because it must contains"
7614 +#puts "TODO OCC12345 ALL: Error : The command is not valid"
7615 +#puts "TODO OCC12345 ALL: Error : Result shape is WRONG because it must contains"
7616  
7617  puts "========================"
7618  puts " OCC472 "
7619 @@ -20,8 +20,8 @@
7620  
7621  bfuse result b1 b2
7622  
7623 -set nb_v_good 5
7624 -set nb_e_edge 7
7625 -set square 0
7626 +set nb_v_good 66
7627 +set nb_e_edge 107
7628 +set square 31657.5
7629  set 2dviewer 0
7630  
7631 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_2/bug497_3 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_2/bug497_3
7632 --- OCCT-6.8.0_SRC/tests/bugs/modalg_2/bug497_3 2014-11-11 17:47:32.000000000 +0300
7633 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_2/bug497_3   2015-01-16 13:00:35.000000000 +0300
7634 @@ -15,5 +15,5 @@
7635  
7636  bcut result a_1 a_2
7637  
7638 -set square 1773.6
7639 +set square 2471.48
7640  set 2dviewer 0
7641 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug24154 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug24154
7642 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug24154 2014-11-11 17:47:34.000000000 +0300
7643 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug24154   2015-01-16 13:01:25.000000000 +0300
7644 @@ -12,18 +12,19 @@
7645  bop b1 b2
7646  bopcut result
7647  
7648 -set square 2.68434e+06
7649 +#set square 2.68434e+06
7650 +set square 5.21269e+06
7651  set volume 7.35468e+07
7652  
7653  # Analysis of "nbshapes res"
7654  set nb_v_good 18
7655 -set nb_e_good 27
7656 -set nb_w_good 11
7657 -set nb_f_good 11
7658 +set nb_e_good 36
7659 +set nb_w_good 18
7660 +set nb_f_good 18
7661  set nb_sh_good 1
7662  set nb_sol_good 1
7663  set nb_compsol_good 0
7664  set nb_compound_good 1
7665 -set nb_shape_good 70
7666 +set nb_shape_good 93
7667  
7668  set 2dviewer 1
7669 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug24798 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug24798
7670 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug24798 2014-11-11 17:47:34.000000000 +0300
7671 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug24798   2015-01-16 13:00:37.000000000 +0300
7672 @@ -12,17 +12,17 @@
7673  bop b1 b2
7674  bopcut result
7675  
7676 -set square 1826.15
7677 +set square 1826.16
7678  
7679  # Analysis of "nbshapes res"
7680 -set nb_v_good 49
7681 -set nb_e_good 72
7682 +set nb_v_good 44
7683 +set nb_e_good 67
7684  set nb_w_good 29
7685  set nb_f_good 22
7686  set nb_sh_good 1
7687  set nb_sol_good 1
7688  set nb_compsol_good 0
7689  set nb_compound_good 1
7690 -set nb_shape_good 175
7691 +set nb_shape_good 165
7692  
7693  set 2dviewer 1
7694 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug24825_common OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug24825_common
7695 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug24825_common  2014-11-11 17:47:34.000000000 +0300
7696 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug24825_common    2015-01-16 13:00:37.000000000 +0300
7697 @@ -43,16 +43,16 @@
7698  bfillds
7699  bbop result 0
7700  
7701 -set square 10008.5
7702 +set square 10008.9
7703  
7704 -set nb_v_good 260
7705 -set nb_e_good 306
7706 +set nb_v_good 140
7707 +set nb_e_good 186
7708  set nb_w_good 126
7709  set nb_f_good 126
7710  set nb_sh_good 40
7711  set nb_sol_good 40
7712  set nb_compsol_good 0
7713  set nb_compound_good 1
7714 -set nb_shape_good 899
7715 +set nb_shape_good 659
7716  
7717  set 2dviewer 1
7718 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug24825_cut OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug24825_cut
7719 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug24825_cut     2014-11-11 17:47:34.000000000 +0300
7720 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug24825_cut       2015-01-16 13:00:37.000000000 +0300
7721 @@ -45,14 +45,14 @@
7722  
7723  set square 103838
7724  
7725 -set nb_v_good 280
7726 -set nb_e_good 338
7727 +set nb_v_good 160
7728 +set nb_e_good 218
7729  set nb_w_good 142
7730  set nb_f_good 80
7731  set nb_sh_good 3
7732  set nb_sol_good 3
7733  set nb_compsol_good 0
7734  set nb_compound_good 1
7735 -set nb_shape_good 847
7736 +set nb_shape_good 607
7737  
7738  set 2dviewer 1
7739 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug24825_fuse OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug24825_fuse
7740 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug24825_fuse    2014-11-11 17:47:34.000000000 +0300
7741 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug24825_fuse      2015-01-16 13:00:37.000000000 +0300
7742 @@ -46,14 +46,14 @@
7743  
7744  set square 157211
7745  
7746 -set nb_v_good 280
7747 -set nb_e_good 338
7748 +set nb_v_good 160
7749 +set nb_e_good 218
7750  set nb_w_good 142
7751  set nb_f_good 80
7752  set nb_sh_good 1
7753  set nb_sol_good 1
7754  set nb_compsol_good 0
7755  set nb_compound_good 1
7756 -set nb_shape_good 843
7757 +set nb_shape_good 603
7758  
7759  set 2dviewer 1
7760 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug24981 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug24981
7761 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug24981 2014-11-11 17:47:34.000000000 +0300
7762 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug24981   2015-01-16 13:00:37.000000000 +0300
7763 @@ -20,14 +20,14 @@
7764  bfillds
7765  bbuild result
7766  
7767 -set nb_v_good 268
7768 -set nb_e_good 366
7769 +set nb_v_good 170
7770 +set nb_e_good 268
7771  set nb_w_good 243
7772  set nb_f_good 195
7773  set nb_sh_good 75
7774  set nb_sol_good 75
7775  set nb_compsol_good 0
7776  set nb_compound_good  1
7777 -set nb_shape_good 1223
7778 +set nb_shape_good 1027
7779  
7780  set 2dviewer 1
7781 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_11 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_11
7782 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_11      2014-11-11 17:47:34.000000000 +0300
7783 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_11        2015-01-16 13:00:37.000000000 +0300
7784 @@ -6,6 +6,12 @@
7785  # Face/Face intersection algorithm gives different results for different order of the arguments
7786  #######################################################################
7787  
7788 +puts "##############################"
7789 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
7790 +puts "##############################"
7791 +puts ""
7792 +puts ""
7793 +
7794  # bopcurves command
7795  
7796  restore [locate_data_file bug25292_Input_0.brep] b1
7797 @@ -21,11 +27,17 @@
7798  #############################
7799  
7800  regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
7801 +
7802 +#This value must be equal to the analogical value in bug25292_11 and bug25292_12 of "bugs modalg_5" testgrid. 
7803  set MaxTol 1.e-7
7804 +
7805 +#This value must be equal to the analogical value in bug25292_11, bug25292_12, bug25292_15 and bug25292_16 of "bugs modalg_5" testgrid. 
7806 +set GoodNbCurv 4
7807 +
7808  if {${Toler} > ${MaxTol}} {
7809    puts "Error: Tolerance is too big!"
7810  }
7811 -set GoodNbCurv 7
7812 +
7813  if {${NbCurv} != ${GoodNbCurv}} {
7814    puts "Error: Curve Number is bad!"
7815  }
7816 @@ -34,105 +46,54 @@
7817  
7818  # 1
7819  puts ""
7820 -puts "First curve"
7821  
7822  mksurface s1 f1
7823  mksurface s2 f2
7824  
7825 -dlog reset
7826 -dlog on
7827 -xdistcs c_1 s1 0 1 10
7828 -set Log1 [dlog get]
7829 -
7830 -set List1 [split ${Log1} {TD= \t\n}]
7831 -set Tolerance 1.0e-7
7832 -set D_good 0.
7833 -checkList ${List1} ${Tolerance} ${D_good}
7834 -
7835 -# 2
7836 -puts ""
7837 -puts "Second curve"
7838 -
7839 -dlog reset
7840 -dlog on
7841 -xdistcs c_2 s1 0 1 10
7842 -set Log2 [dlog get]
7843 -
7844 -set List2 [split ${Log2} {TD= \t\n}]
7845 -set Tolerance 1.0e-7
7846 -set D_good 0.
7847 -checkList ${List2} ${Tolerance} ${D_good}
7848 -
7849 -# 3
7850 -puts ""
7851 -puts "Third curve"
7852 -
7853 -dlog reset
7854 -dlog on
7855 -xdistcs c_3 s1 0 1 10
7856 -set Log3 [dlog get]
7857 -
7858 -set List3 [split ${Log3} {TD= \t\n}]
7859 -set Tolerance 1.0e-7
7860 -set D_good 0.
7861 -checkList ${List3} ${Tolerance} ${D_good}
7862 -
7863 -# 4
7864 -puts ""
7865 -puts "Fourth curve"
7866 -
7867 -dlog reset
7868 -dlog on
7869 -xdistcs c_4 s1 0 1 10
7870 -set Log4 [dlog get]
7871 -
7872 -set List4 [split ${Log4} {TD= \t\n}]
7873 -set Tolerance 1.0e-7
7874 -set D_good 0.
7875 -checkList ${List4} ${Tolerance} ${D_good}
7876 -
7877 -# 5
7878 -puts ""
7879 -puts "Fifth curve"
7880 -
7881 -dlog reset
7882 -dlog on
7883 -xdistcs c_5 s1 0 1 10
7884 -set Log5 [dlog get]
7885 -
7886 -set List5 [split ${Log5} {TD= \t\n}]
7887 -set Tolerance 1.0e-7
7888 -set D_good 0.
7889 -checkList ${List5} ${Tolerance} ${D_good}
7890 -
7891 -# 6
7892 -puts ""
7893 -puts "Sixth curve"
7894 -
7895 -dlog reset
7896 -dlog on
7897 -xdistcs c_6 s1 0 1 10
7898 -set Log6 [dlog get]
7899 -
7900 -set List6 [split ${Log6} {TD= \t\n}]
7901 -set Tolerance 1.0e-7
7902 -set D_good 0.
7903 -checkList ${List6} ${Tolerance} ${D_good}
7904 -
7905 -# 7
7906 -puts ""
7907 -puts "Seventh curve"
7908 -
7909 -dlog reset
7910 -dlog on
7911 -xdistcs c_7 s1 0 1 10
7912 -set Log7 [dlog get]
7913 -
7914 -set List7 [split ${Log7} {TD= \t\n}]
7915 -set Tolerance 1.0e-7
7916 -set D_good 0.
7917 -checkList ${List7} ${Tolerance} ${D_good}
7918 -
7919 +for {set i 1} {$i <= ${NbCurv}} {incr i} {
7920 +  set log [dump c_$i]
7921 +  
7922 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
7923 +  puts "Degree=${Degree}"
7924 +  puts "Poles=${Poles}"
7925 +  puts "KnotsPoles=${KnotsPoles}"
7926 +  puts ""
7927 +
7928 +  set Knot 1
7929 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
7930 +  regexp ${exp_string} ${log} full U1 Mult1
7931 +
7932 +  set Knot ${KnotsPoles}
7933 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
7934 +  regexp ${exp_string} ${log} full U2 Mult2
7935 +
7936 +  puts "U1=${U1}"
7937 +  puts "U2=${U2}"
7938 +  
7939 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
7940 +    puts "Error: Wrong curve's range!"
7941 +  }
7942 +
7943 +  dlog reset
7944 +  dlog on
7945 +  xdistcs c_$i s1 ${U1} ${U2} 10
7946 +  set Log2 [dlog get]
7947 +  set List2 [split ${Log2} {TD= \t\n}]
7948 +  set Tolerance 1.0e-7
7949 +  set Limit_Tol 1.0e-7
7950 +  set D_good 0.
7951 +  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
7952 +
7953 +  dlog reset
7954 +  dlog on
7955 +  xdistcs c_$i s2 ${U1} ${U2} 10
7956 +  set Log2 [dlog get]
7957 +  set List2 [split ${Log2} {TD= \t\n}]
7958 +  set Tolerance 1.0e-7
7959 +  set Limit_Tol 1.0e-7
7960 +  set D_good 0.
7961 +  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
7962 +}
7963  
7964  v2d
7965  2dfit
7966 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_12 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_12
7967 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_12      2014-11-11 17:47:34.000000000 +0300
7968 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_12        2015-01-16 13:00:37.000000000 +0300
7969 @@ -1,5 +1,3 @@
7970 -puts "TODO OCC225404 Debian60-64 Windows: Error: Curve Number is bad!"
7971 -
7972  puts "================"
7973  puts "OCC25292"
7974  puts "================"
7975 @@ -8,6 +6,12 @@
7976  # Face/Face intersection algorithm gives different results for different order of the arguments
7977  #######################################################################
7978  
7979 +puts "##############################"
7980 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
7981 +puts "##############################"
7982 +puts ""
7983 +puts ""
7984 +
7985  # bopcurves command
7986  
7987  restore [locate_data_file bug25292_Input_0.brep] b1
7988 @@ -23,11 +27,17 @@
7989  #############################
7990  
7991  regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
7992 +
7993 +#This value must be equal to the analogical value in bug25292_11 and bug25292_12 of "bugs modalg_5" testgrid. 
7994  set MaxTol 1.e-7
7995 +
7996 +#This value must be equal to the analogical value in bug25292_11, bug25292_12, bug25292_15 and bug25292_16 of "bugs modalg_5" testgrid. 
7997 +set GoodNbCurv 4
7998 +
7999  if {${Toler} > ${MaxTol}} {
8000    puts "Error: Tolerance is too big!"
8001  }
8002 -set GoodNbCurv 7
8003 +
8004  if {${NbCurv} != ${GoodNbCurv}} {
8005    puts "Error: Curve Number is bad!"
8006  }
8007 @@ -36,112 +46,55 @@
8008  
8009  # 1
8010  puts ""
8011 -puts "First curve"
8012  
8013  mksurface s1 f1
8014  mksurface s2 f2
8015  
8016 -dlog reset
8017 -dlog on
8018 -xdistcs c_1 s1 0 1 10
8019 -set Log1 [dlog get]
8020 -
8021 -set List1 [split ${Log1} {TD= \t\n}]
8022 -set Tolerance 1.0e-7
8023 -set D_good 0.
8024 -checkList ${List1} ${Tolerance} ${D_good}
8025 -
8026 -# 2
8027 -puts ""
8028 -puts "Second curve"
8029 -
8030 -dlog reset
8031 -dlog on
8032 -xdistcs c_2 s1 0 1 10
8033 -set Log2 [dlog get]
8034 -
8035 -set List2 [split ${Log2} {TD= \t\n}]
8036 -set Tolerance 1.0e-7
8037 -set D_good 0.
8038 -checkList ${List2} ${Tolerance} ${D_good}
8039 -
8040 -# 3
8041 -puts ""
8042 -puts "Third curve"
8043 -
8044 -dlog reset
8045 -dlog on
8046 -xdistcs c_3 s1 0 1 10
8047 -set Log3 [dlog get]
8048 -
8049 -set List3 [split ${Log3} {TD= \t\n}]
8050 -set Tolerance 1.0e-7
8051 -set D_good 0.
8052 -checkList ${List3} ${Tolerance} ${D_good}
8053 -
8054 -# 4
8055 -puts ""
8056 -puts "Fourth curve"
8057 -
8058 -dlog reset
8059 -dlog on
8060 -xdistcs c_4 s1 0 1 10
8061 -set Log4 [dlog get]
8062 -
8063 -set List4 [split ${Log4} {TD= \t\n}]
8064 -set Tolerance 1.0e-7
8065 -set D_good 0.
8066 -checkList ${List4} ${Tolerance} ${D_good}
8067 -
8068 -# 5
8069 -if { [info exist c_5] } {
8070 -puts ""
8071 -puts "Fifth curve"
8072 -
8073 -dlog reset
8074 -dlog on
8075 -xdistcs c_5 s1 0 1 10
8076 -set Log5 [dlog get]
8077 -
8078 -set List5 [split ${Log5} {TD= \t\n}]
8079 -set Tolerance 1.0e-7
8080 -set D_good 0.
8081 -checkList ${List5} ${Tolerance} ${D_good}
8082 -}
8083 -
8084 -# 6
8085 -if { [info exist c_6] } {
8086 -puts ""
8087 -puts "Sixth curve"
8088 -
8089 -dlog reset
8090 -dlog on
8091 -xdistcs c_6 s1 0 1 10
8092 -set Log6 [dlog get]
8093 -
8094 -set List6 [split ${Log6} {TD= \t\n}]
8095 -set Tolerance 1.0e-7
8096 -set D_good 0.
8097 -checkList ${List6} ${Tolerance} ${D_good}
8098 +for {set i 1} {$i <= ${NbCurv}} {incr i} {
8099 +  set log [dump c_$i]
8100 +  
8101 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
8102 +  puts "Degree=${Degree}"
8103 +  puts "Poles=${Poles}"
8104 +  puts "KnotsPoles=${KnotsPoles}"
8105 +  puts ""
8106 +
8107 +  set Knot 1
8108 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
8109 +  regexp ${exp_string} ${log} full U1 Mult1
8110 +
8111 +  set Knot ${KnotsPoles}
8112 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
8113 +  regexp ${exp_string} ${log} full U2 Mult2
8114 +
8115 +  puts "U1=${U1}"
8116 +  puts "U2=${U2}"
8117 +  
8118 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
8119 +    puts "Error: Wrong curve's range!"
8120 +  }
8121 +
8122 +  dlog reset
8123 +  dlog on
8124 +  xdistcs c_$i s1 ${U1} ${U2} 10
8125 +  set Log2 [dlog get]
8126 +  set List2 [split ${Log2} {TD= \t\n}]
8127 +  set Tolerance 1.0e-7
8128 +  set Limit_Tol 1.0e-7
8129 +  set D_good 0.
8130 +  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
8131 +
8132 +  dlog reset
8133 +  dlog on
8134 +  xdistcs c_$i s2 ${U1} ${U2} 10
8135 +  set Log2 [dlog get]
8136 +  set List2 [split ${Log2} {TD= \t\n}]
8137 +  set Tolerance 1.0e-7
8138 +  set Limit_Tol 1.0e-7
8139 +  set D_good 0.
8140 +  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
8141  }
8142  
8143 -# 7
8144 -if { [info exist c_7] } {
8145 -puts ""
8146 -puts "Seventh curve"
8147 -
8148 -dlog reset
8149 -dlog on
8150 -xdistcs c_7 s1 0 1 10
8151 -set Log7 [dlog get]
8152 -
8153 -set List7 [split ${Log7} {TD= \t\n}]
8154 -set Tolerance 1.0e-7
8155 -set D_good 0.
8156 -checkList ${List7} ${Tolerance} ${D_good}
8157 -}
8158 -
8159 -
8160  v2d
8161  2dfit
8162  set only_screen_axo 1
8163 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_13 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_13
8164 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_13      2014-11-11 17:47:34.000000000 +0300
8165 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_13        2015-01-16 13:00:37.000000000 +0300
8166 @@ -23,14 +23,14 @@
8167  
8168  set square 289.348
8169  
8170 -set nb_v_good 12
8171 -set nb_e_good 18
8172 +set nb_v_good 9
8173 +set nb_e_good 15
8174  set nb_w_good 10
8175  set nb_f_good 10
8176  set nb_sh_good 3
8177  set nb_sol_good 3
8178  set nb_compsol_good 0
8179  set nb_compound_good 1
8180 -set nb_shape_good 57
8181 +set nb_shape_good 51
8182  
8183  set 3dviewer 1
8184 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_14 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_14
8185 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_14      2014-11-11 17:47:34.000000000 +0300
8186 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_14        2015-01-16 13:00:37.000000000 +0300
8187 @@ -1,7 +1,3 @@
8188 -puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 12 vertices instead of 9"
8189 -puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 18 edges instead of 15"
8190 -puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 57 shapes instead of 51"
8191 -
8192  puts "================"
8193  puts "OCC25292"
8194  puts "================"
8195 @@ -27,14 +23,14 @@
8196  
8197  set square 289.348
8198  
8199 -set nb_v_good 12
8200 -set nb_e_good 18
8201 +set nb_v_good 9
8202 +set nb_e_good 15
8203  set nb_w_good 10
8204  set nb_f_good 10
8205  set nb_sh_good 3
8206  set nb_sol_good 3
8207  set nb_compsol_good 0
8208  set nb_compound_good 1
8209 -set nb_shape_good 57
8210 +set nb_shape_good 51
8211  
8212  set 3dviewer 1
8213 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_15 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_15
8214 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_15      2014-11-11 17:47:34.000000000 +0300
8215 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_15        2015-01-16 13:01:25.000000000 +0300
8216 @@ -6,8 +6,37 @@
8217  # Face/Face intersection algorithm gives different results for different order of the arguments
8218  #######################################################################
8219  
8220 +proc GetRange { curve } {
8221 +  global U1
8222 +  global U2
8223 +  
8224 +  set log [uplevel dump $curve]
8225 +  
8226 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
8227 +  puts "Degree=${Degree}"
8228 +  puts "Poles=${Poles}"
8229 +  puts "KnotsPoles=${KnotsPoles}"
8230 +  puts ""
8231 +
8232 +  set Knot 1
8233 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
8234 +  regexp ${exp_string} ${log} full U1 Mult1
8235 +
8236 +  set Knot ${KnotsPoles}
8237 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
8238 +  regexp ${exp_string} ${log} full U2 Mult2
8239 +}
8240 +
8241 +puts "##############################"
8242 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
8243 +puts "##############################"
8244 +puts ""
8245 +
8246  # intersect command
8247  
8248 +#This value must be equal to the analogical value in bug25292_11, bug25292_12, bug25292_15 and bug25292_16 of "bugs modalg_5" testgrid. 
8249 +set GoodNbCurv 4
8250 +
8251  restore [locate_data_file bug25292_Input_0.brep] b1
8252  restore [locate_data_file bug25292_Input_1.brep] b2
8253  
8254 @@ -20,11 +49,98 @@
8255  mksurface s2 f2
8256  
8257  #################
8258 -intersect i s1 s2
8259 +intersect res s1 s2
8260  #################
8261 -
8262 -if { [info exist i_7] } {
8263 -  puts "OK: Curve Number is good!"
8264 +set che [whatis res]
8265 +set ind [string first "3d curve" $che]
8266 +if {${ind} >= 0} {
8267 +  #Only variable "res" exists
8268 +  
8269 +  if { $GoodNbCurv == 1 } {
8270 +    puts "OK: Curve Number is good!"
8271 +  } else {
8272 +    puts "Error: Curve Number is bad!"
8273 +  }
8274 +  
8275 +  set U1 0.0
8276 +  set U2 0.0
8277 +  
8278 +  GetRange res
8279 +
8280 +  puts "U1 = ${U1}"
8281 +  puts "U2 = ${U2}"
8282 +
8283 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
8284 +    puts "Error: Wrong curve's range!"
8285 +  }
8286 +  
8287 +  dlog reset
8288 +  dlog on
8289 +  xdistcs res s1 ${U1} ${U2} 10
8290 +  set Log1 [dlog get]
8291 +  set List1 [split ${Log1} {TD= \t\n}]
8292 +  set Tolerance 3.0e-7
8293 +  set Limit_Tol 1.0e-7
8294 +  set D_good 0.
8295 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
8296 +  
8297 +  dlog reset
8298 +  dlog on
8299 +  xdistcs res s2 ${U1} ${U2} 10
8300 +  set Log1 [dlog get]
8301 +  set List1 [split ${Log1} {TD= \t\n}]
8302 +  set Tolerance 3.0e-7
8303 +  set Limit_Tol 1.0e-7
8304 +  set D_good 0.
8305 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
8306  } else {
8307 -  puts "Error: Curve Number is bad!"
8308 +  set ic 1
8309 +  set AllowRepeate 1
8310 +  while { $AllowRepeate != 0 } {
8311 +    set che [whatis res_$ic]
8312 +    set ind [string first "3d curve" $che]
8313 +    if {${ind} < 0} {
8314 +      set AllowRepeate 0
8315 +    } else {
8316 +      set U1 0.0
8317 +      set U2 0.0
8318 +      
8319 +      GetRange res_$ic
8320 +      
8321 +      puts "U1 = ${U1}"
8322 +      puts "U2 = ${U2}"
8323 +      
8324 +      if {[expr {$U2 - $U1}] < 1.0e-20} {
8325 +        puts "Error: Wrong curve's range!"
8326 +      }
8327 +      
8328 +      dlog reset
8329 +      dlog on
8330 +      xdistcs res_$ic s1 ${U1} ${U2} 10
8331 +      set Log1 [dlog get]
8332 +      set List1 [split ${Log1} {TD= \t\n}]
8333 +      set Tolerance 3.0e-7
8334 +      set Limit_Tol 1.0e-7
8335 +      set D_good 0.
8336 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
8337 +      
8338 +      dlog reset
8339 +      dlog on
8340 +      xdistcs res_$ic s2 0 1 10
8341 +      set Log1 [dlog get]
8342 +      set List1 [split ${Log1} {TD= \t\n}]
8343 +      set Tolerance 3.0e-7
8344 +      set Limit_Tol 1.0e-7
8345 +      set D_good 0.
8346 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
8347 +      
8348 +      incr ic
8349 +    }
8350 +  }
8351 +  
8352 +  if {[expr {$ic - 1}] == $GoodNbCurv} {
8353 +    puts "OK: Curve Number is good!"
8354 +  } else {
8355 +    puts "Error: Curve Number is bad!"
8356 +  }
8357  }
8358 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_16 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_16
8359 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_16      2014-11-11 17:47:34.000000000 +0300
8360 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_16        2015-01-16 13:01:25.000000000 +0300
8361 @@ -1,5 +1,3 @@
8362 -puts "TODO OCC225404 Debian60-64 Windows: Error: Curve Number is bad!"
8363 -
8364  puts "================"
8365  puts "OCC25292"
8366  puts "================"
8367 @@ -8,8 +6,37 @@
8368  # Face/Face intersection algorithm gives different results for different order of the arguments
8369  #######################################################################
8370  
8371 +proc GetRange { curve } {
8372 +  global U1
8373 +  global U2
8374 +  
8375 +  set log [uplevel dump $curve]
8376 +  
8377 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
8378 +  puts "Degree=${Degree}"
8379 +  puts "Poles=${Poles}"
8380 +  puts "KnotsPoles=${KnotsPoles}"
8381 +  puts ""
8382 +
8383 +  set Knot 1
8384 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
8385 +  regexp ${exp_string} ${log} full U1 Mult1
8386 +
8387 +  set Knot ${KnotsPoles}
8388 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
8389 +  regexp ${exp_string} ${log} full U2 Mult2
8390 +}
8391 +
8392 +puts "##############################"
8393 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
8394 +puts "##############################"
8395 +puts ""
8396 +
8397  # intersect command
8398  
8399 +#This value must be equal to the analogical value in bug25292_11, bug25292_12, bug25292_15 and bug25292_16 of "bugs modalg_5" testgrid. 
8400 +set GoodNbCurv 4
8401 +
8402  restore [locate_data_file bug25292_Input_0.brep] b1
8403  restore [locate_data_file bug25292_Input_1.brep] b2
8404  
8405 @@ -22,11 +49,99 @@
8406  mksurface s2 f2
8407  
8408  #################
8409 -intersect i s2 s1
8410 +intersect res s2 s1
8411  #################
8412  
8413 -if { [info exist i_7] } {
8414 -  puts "OK: Curve Number is good!"
8415 +set che [whatis res]
8416 +set ind [string first "3d curve" $che]
8417 +if {${ind} >= 0} {
8418 +  #Only variable "res" exists
8419 +  
8420 +  if { $GoodNbCurv == 1 } {
8421 +    puts "OK: Curve Number is good!"
8422 +  } else {
8423 +    puts "Error: Curve Number is bad!"
8424 +  }
8425 +  
8426 +  set U1 0.0
8427 +  set U2 0.0
8428 +  
8429 +  GetRange res
8430 +
8431 +  puts "U1 = ${U1}"
8432 +  puts "U2 = ${U2}"
8433 +
8434 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
8435 +    puts "Error: Wrong curve's range!"
8436 +  }
8437 +  
8438 +  dlog reset
8439 +  dlog on
8440 +  xdistcs res s1 ${U1} ${U2} 10
8441 +  set Log1 [dlog get]
8442 +  set List1 [split ${Log1} {TD= \t\n}]
8443 +  set Tolerance 3.0e-7
8444 +  set Limit_Tol 1.0e-7
8445 +  set D_good 0.
8446 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
8447 +  
8448 +  dlog reset
8449 +  dlog on
8450 +  xdistcs res s2 ${U1} ${U2} 10
8451 +  set Log1 [dlog get]
8452 +  set List1 [split ${Log1} {TD= \t\n}]
8453 +  set Tolerance 3.0e-7
8454 +  set Limit_Tol 1.0e-7
8455 +  set D_good 0.
8456 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
8457  } else {
8458 -  puts "Error: Curve Number is bad!"
8459 +  set ic 1
8460 +  set AllowRepeate 1
8461 +  while { $AllowRepeate != 0 } {
8462 +    set che [whatis res_$ic]
8463 +    set ind [string first "3d curve" $che]
8464 +    if {${ind} < 0} {
8465 +      set AllowRepeate 0
8466 +    } else {
8467 +      set U1 0.0
8468 +      set U2 0.0
8469 +      
8470 +      GetRange res_$ic
8471 +      
8472 +      puts "U1 = ${U1}"
8473 +      puts "U2 = ${U2}"
8474 +      
8475 +      if {[expr {$U2 - $U1}] < 1.0e-20} {
8476 +        puts "Error: Wrong curve's range!"
8477 +      }
8478 +      
8479 +      dlog reset
8480 +      dlog on
8481 +      xdistcs res_$ic s1 ${U1} ${U2} 10
8482 +      set Log1 [dlog get]
8483 +      set List1 [split ${Log1} {TD= \t\n}]
8484 +      set Tolerance 3.0e-7
8485 +      set Limit_Tol 1.0e-7
8486 +      set D_good 0.
8487 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
8488 +      
8489 +      dlog reset
8490 +      dlog on
8491 +      xdistcs res_$ic s2 0 1 10
8492 +      set Log1 [dlog get]
8493 +      set List1 [split ${Log1} {TD= \t\n}]
8494 +      set Tolerance 3.0e-7
8495 +      set Limit_Tol 1.0e-7
8496 +      set D_good 0.
8497 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
8498 +      
8499 +      incr ic
8500 +    }
8501 +  }
8502 +  
8503 +  if {[expr {$ic - 1}] == $GoodNbCurv} {
8504 +    puts "OK: Curve Number is good!"
8505 +  } else {
8506 +    puts "Error: Curve Number is bad!"
8507 +  }
8508  }
8509 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_21 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_21
8510 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_21      2014-11-11 17:47:34.000000000 +0300
8511 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_21        2015-01-16 13:00:37.000000000 +0300
8512 @@ -6,6 +6,12 @@
8513  # Face/Face intersection algorithm gives different results for different order of the arguments
8514  #######################################################################
8515  
8516 +puts "##############################"
8517 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
8518 +puts "##############################"
8519 +puts ""
8520 +puts ""
8521 +
8522  # bopcurves command
8523  
8524  restore [locate_data_file bug25292_Input_3.brep] b1
8525 @@ -17,66 +23,74 @@
8526  copy b2_1 f2
8527  
8528  #########################
8529 -set log [bopcurves f1 f2]
8530 +set log [bopcurves f1 f2 -2d]
8531  #########################
8532  
8533  regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
8534 +
8535 +#This value must be equal to the analogical value in bug25292_21 and bug25292_22 of "bugs modalg_5" testgrid. 
8536  set MaxTol 1.e-7
8537 +
8538 +#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid. 
8539 +set GoodNbCurv 2
8540 +
8541  if {${Toler} > ${MaxTol}} {
8542    puts "Error: Tolerance is too big!"
8543  }
8544 -set GoodNbCurv 3
8545 +
8546  if {${NbCurv} != ${GoodNbCurv}} {
8547    puts "Error: Curve Number is bad!"
8548  }
8549  
8550  #-------------
8551  
8552 -# 1
8553 -puts ""
8554 -puts "First curve"
8555 -
8556  mksurface s1 f1
8557  mksurface s2 f2
8558  
8559 -dlog reset
8560 -dlog on
8561 -xdistcs c_1 s1 0 1 10
8562 -set Log1 [dlog get]
8563 -
8564 -set List1 [split ${Log1} {TD= \t\n}]
8565 -set Tolerance 1.0e-7
8566 -set D_good 0.
8567 -checkList ${List1} ${Tolerance} ${D_good}
8568 -
8569 -# 2
8570 -puts ""
8571 -puts "Second curve"
8572 -
8573 -dlog reset
8574 -dlog on
8575 -xdistcs c_2 s1 0 1 10
8576 -set Log2 [dlog get]
8577 -
8578 -set List2 [split ${Log2} {TD= \t\n}]
8579 -set Tolerance 1.0e-7
8580 -set D_good 0.
8581 -checkList ${List2} ${Tolerance} ${D_good}
8582 -
8583 -# 3
8584 -puts ""
8585 -puts "Third curve"
8586 -
8587 -dlog reset
8588 -dlog on
8589 -xdistcs c_3 s1 0 1 10
8590 -set Log3 [dlog get]
8591 -
8592 -set List3 [split ${Log3} {TD= \t\n}]
8593 -set Tolerance 1.0e-7
8594 -set D_good 0.
8595 -checkList ${List3} ${Tolerance} ${D_good}
8596 -
8597 +for {set i 1} {$i <= ${NbCurv}} {incr i} {
8598 +  set log [dump c_$i]
8599 +  
8600 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
8601 +  puts "Degree=${Degree}"
8602 +  puts "Poles=${Poles}"
8603 +  puts "KnotsPoles=${KnotsPoles}"
8604 +  puts ""
8605 +
8606 +  set Knot 1
8607 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
8608 +  regexp ${exp_string} ${log} full U1 Mult1
8609 +
8610 +  set Knot ${KnotsPoles}
8611 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
8612 +  regexp ${exp_string} ${log} full U2 Mult2
8613 +
8614 +  puts "U1=${U1}"
8615 +  puts "U2=${U2}"
8616 +  
8617 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
8618 +    puts "Error: Wrong curve's range!"
8619 +  }
8620 +
8621 +  dlog reset
8622 +  dlog on
8623 +  xdistcs c_$i s1 ${U1} ${U2} 10
8624 +  set Log2 [dlog get]
8625 +  set List2 [split ${Log2} {TD= \t\n}]
8626 +  set Tolerance 1.0e-7
8627 +  set Limit_Tol 1.0e-7
8628 +  set D_good 0.
8629 +  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
8630 +
8631 +  dlog reset
8632 +  dlog on
8633 +  xdistcs c_$i s2 ${U1} ${U2} 10
8634 +  set Log2 [dlog get]
8635 +  set List2 [split ${Log2} {TD= \t\n}]
8636 +  set Tolerance 1.0e-7
8637 +  set Limit_Tol 1.0e-7
8638 +  set D_good 0.
8639 +  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
8640 +}
8641  
8642  smallview
8643  fit
8644 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_22 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_22
8645 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_22      2014-11-11 17:47:34.000000000 +0300
8646 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_22        2015-01-16 13:00:37.000000000 +0300
8647 @@ -1,5 +1,3 @@
8648 -puts "TODO OCC225404 Debian60-64 Windows: Error: Curve Number is bad!"
8649 -
8650  puts "================"
8651  puts "OCC25292"
8652  puts "================"
8653 @@ -8,6 +6,12 @@
8654  # Face/Face intersection algorithm gives different results for different order of the arguments
8655  #######################################################################
8656  
8657 +puts "##############################"
8658 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
8659 +puts "##############################"
8660 +puts ""
8661 +puts ""
8662 +
8663  # bopcurves command
8664  
8665  restore [locate_data_file bug25292_Input_3.brep] b1
8666 @@ -19,69 +23,75 @@
8667  copy b2_1 f2
8668  
8669  #########################
8670 -set log [bopcurves f2 f1]
8671 +set log [bopcurves f2 f1 -2d]
8672  #########################
8673  
8674  regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
8675 +
8676 +#This value must be equal to the analogical value in bug25292_21 and bug25292_22 of "bugs modalg_5" testgrid. 
8677  set MaxTol 1.e-7
8678 +
8679 +#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid. 
8680 +set GoodNbCurv 2
8681 +
8682  if {${Toler} > ${MaxTol}} {
8683    puts "Error: Tolerance is too big!"
8684  }
8685 -set GoodNbCurv 3
8686 +
8687  if {${NbCurv} != ${GoodNbCurv}} {
8688    puts "Error: Curve Number is bad!"
8689  }
8690  
8691  #-------------
8692  
8693 -# 1
8694 -puts ""
8695 -puts "First curve"
8696 -
8697  mksurface s1 f1
8698  mksurface s2 f2
8699  
8700 -dlog reset
8701 -dlog on
8702 -xdistcs c_1 s1 0 1 10
8703 -set Log1 [dlog get]
8704 -
8705 -set List1 [split ${Log1} {TD= \t\n}]
8706 -set Tolerance 1.0e-7
8707 -set D_good 0.
8708 -checkList ${List1} ${Tolerance} ${D_good}
8709 -
8710 -# 2
8711 -puts ""
8712 -puts "Second curve"
8713 -
8714 -dlog reset
8715 -dlog on
8716 -xdistcs c_2 s1 0 1 10
8717 -set Log2 [dlog get]
8718 -
8719 -set List2 [split ${Log2} {TD= \t\n}]
8720 -set Tolerance 1.0e-7
8721 -set D_good 0.
8722 -checkList ${List2} ${Tolerance} ${D_good}
8723 -
8724 -# 3
8725 -if { [info exist c_3] } {
8726 -puts ""
8727 -puts "Third curve"
8728 -
8729 -dlog reset
8730 -dlog on
8731 -xdistcs c_3 s1 0 1 10
8732 -set Log3 [dlog get]
8733 -
8734 -set List3 [split ${Log3} {TD= \t\n}]
8735 -set Tolerance 1.0e-7
8736 -set D_good 0.
8737 -checkList ${List3} ${Tolerance} ${D_good}
8738 +for {set i 1} {$i <= ${NbCurv}} {incr i} {
8739 +  set log [dump c_$i]
8740 +  
8741 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
8742 +  puts "Degree=${Degree}"
8743 +  puts "Poles=${Poles}"
8744 +  puts "KnotsPoles=${KnotsPoles}"
8745 +  puts ""
8746 +
8747 +  set Knot 1
8748 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
8749 +  regexp ${exp_string} ${log} full U1 Mult1
8750 +
8751 +  set Knot ${KnotsPoles}
8752 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
8753 +  regexp ${exp_string} ${log} full U2 Mult2
8754 +
8755 +  puts "U1=${U1}"
8756 +  puts "U2=${U2}"
8757 +  
8758 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
8759 +    puts "Error: Wrong curve's range!"
8760 +  }
8761 +
8762 +  dlog reset
8763 +  dlog on
8764 +  xdistcs c_$i s1 ${U1} ${U2} 10
8765 +  set Log2 [dlog get]
8766 +  set List2 [split ${Log2} {TD= \t\n}]
8767 +  set Tolerance 1.0e-7
8768 +  set Limit_Tol 1.0e-7
8769 +  set D_good 0.
8770 +  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
8771 +
8772 +  dlog reset
8773 +  dlog on
8774 +  xdistcs c_$i s2 ${U1} ${U2} 10
8775 +  set Log2 [dlog get]
8776 +  set List2 [split ${Log2} {TD= \t\n}]
8777 +  set Tolerance 1.0e-7
8778 +  set Limit_Tol 1.0e-7
8779 +  set D_good 0.
8780 +  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
8781  }
8782  
8783 -
8784  smallview
8785  fit
8786  set only_screen_axo 1
8787 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_23 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_23
8788 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_23      2014-11-11 17:47:34.000000000 +0300
8789 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_23        2015-01-16 13:00:37.000000000 +0300
8790 @@ -21,16 +21,17 @@
8791  bfillds
8792  bbuild result
8793  
8794 +#These values must be equal to the analogical values in bug25292_23 and bug25292_24 of "bugs modalg_5" testgrid. 
8795  set square 31.6797
8796  
8797 -set nb_v_good 11
8798 -set nb_e_good 20
8799 +set nb_v_good 10
8800 +set nb_e_good 19
8801  set nb_w_good 13
8802  set nb_f_good 13
8803  set nb_sh_good 3
8804  set nb_sol_good 3
8805  set nb_compsol_good 0
8806  set nb_compound_good 1
8807 -set nb_shape_good 64
8808 +set nb_shape_good 62
8809  
8810  set 3dviewer 1
8811 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_24 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_24
8812 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_24      2014-11-11 17:47:34.000000000 +0300
8813 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_24        2015-01-16 13:00:37.000000000 +0300
8814 @@ -1,8 +1,3 @@
8815 -puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 11 vertices instead of 10"
8816 -puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 20 edges instead of 19"
8817 -puts "TODO OCC225404 Debian60-64 Windows: Error : Result shape is WRONG because it must contains 64 shapes instead of 62"
8818 -
8819 -
8820  puts "================"
8821  puts "OCC25292"
8822  puts "================"
8823 @@ -26,16 +21,17 @@
8824  bfillds
8825  bbuild result
8826  
8827 +#These values must be equal to the analogical values in bug25292_23 and bug25292_24 of "bugs modalg_5" testgrid. 
8828  set square 31.6797
8829  
8830 -set nb_v_good 11
8831 -set nb_e_good 20
8832 +set nb_v_good 10
8833 +set nb_e_good 19
8834  set nb_w_good 13
8835  set nb_f_good 13
8836  set nb_sh_good 3
8837  set nb_sol_good 3
8838  set nb_compsol_good 0
8839  set nb_compound_good 1
8840 -set nb_shape_good 64
8841 +set nb_shape_good 62
8842  
8843  set 3dviewer 1
8844 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_25 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_25
8845 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_25      2014-11-11 17:47:34.000000000 +0300
8846 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_25        2015-01-16 13:01:25.000000000 +0300
8847 @@ -6,8 +6,37 @@
8848  # Face/Face intersection algorithm gives different results for different order of the arguments
8849  #######################################################################
8850  
8851 +proc GetRange { curve } {
8852 +  global U1
8853 +  global U2
8854 +  
8855 +  set log [uplevel dump $curve]
8856 +  
8857 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
8858 +  puts "Degree=${Degree}"
8859 +  puts "Poles=${Poles}"
8860 +  puts "KnotsPoles=${KnotsPoles}"
8861 +  puts ""
8862 +
8863 +  set Knot 1
8864 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
8865 +  regexp ${exp_string} ${log} full U1 Mult1
8866 +
8867 +  set Knot ${KnotsPoles}
8868 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
8869 +  regexp ${exp_string} ${log} full U2 Mult2
8870 +}
8871 +
8872 +puts "##############################"
8873 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
8874 +puts "##############################"
8875 +puts ""
8876 +
8877  # intersect command
8878  
8879 +#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid. 
8880 +set GoodNbCurv 2
8881 +
8882  restore [locate_data_file bug25292_Input_3.brep] b1
8883  restore [locate_data_file bug25292_Input_11.brep] b2
8884  
8885 @@ -20,11 +49,100 @@
8886  mksurface s2 f2
8887  
8888  #################
8889 -intersect i s1 s2
8890 +intersect res s1 s2
8891  #################
8892  
8893 -if { [info exist i_3] } {
8894 -  puts "OK: Curve Number is good!"
8895 +set che [whatis res]
8896 +set ind [string first "3d curve" $che]
8897 +if {${ind} >= 0} {
8898 +  #Only variable "res" exists
8899 +  
8900 +  if { $GoodNbCurv == 1 } {
8901 +    puts "OK: Curve Number is good!"
8902 +  } else {
8903 +    puts "Error: Curve Number is bad!"
8904 +  }
8905 +  
8906 +  set U1 0.0
8907 +  set U2 0.0
8908 +  
8909 +  GetRange res
8910 +
8911 +  puts "U1 = ${U1}"
8912 +  puts "U2 = ${U2}"
8913 +
8914 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
8915 +    puts "Error: Wrong curve's range!"
8916 +  }
8917 +  
8918 +  dlog reset
8919 +  dlog on
8920 +  xdistcs res s1 ${U1} ${U2} 10
8921 +  set Log1 [dlog get]
8922 +  set List1 [split ${Log1} {TD= \t\n}]
8923 +  set Tolerance 1.1e-7
8924 +  set Limit_Tol 1.0e-7
8925 +  set D_good 0.
8926 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
8927 +  
8928 +  dlog reset
8929 +  dlog on
8930 +  xdistcs res s2 ${U1} ${U2} 10
8931 +  set Log1 [dlog get]
8932 +  set List1 [split ${Log1} {TD= \t\n}]
8933 +  set Tolerance 1.1e-7
8934 +  set Limit_Tol 1.0e-7
8935 +  set D_good 0.
8936 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
8937  } else {
8938 -  puts "Error: Curve Number is bad!"
8939 +  set ic 1
8940 +  set AllowRepeate 1
8941 +  while { $AllowRepeate != 0 } {
8942 +    set che [whatis res_$ic]
8943 +    set ind [string first "3d curve" $che]
8944 +    if {${ind} < 0} {
8945 +      set AllowRepeate 0
8946 +    } else {
8947 +      set U1 0.0
8948 +      set U2 0.0
8949 +      
8950 +      GetRange res_$ic
8951 +      
8952 +      puts "U1 = ${U1}"
8953 +      puts "U2 = ${U2}"
8954 +      
8955 +      if {[expr {$U2 - $U1}] < 1.0e-20} {
8956 +        puts "Error: Wrong curve's range!"
8957 +      }
8958 +      
8959 +      dlog reset
8960 +      dlog on
8961 +      xdistcs res_$ic s1 ${U1} ${U2} 10
8962 +      set Log1 [dlog get]
8963 +      set List1 [split ${Log1} {TD= \t\n}]
8964 +      set Tolerance 1.1e-7
8965 +      set Limit_Tol 1.0e-7
8966 +      set D_good 0.
8967 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
8968 +      
8969 +      dlog reset
8970 +      dlog on
8971 +      xdistcs res_$ic s2 0 1 10
8972 +      set Log1 [dlog get]
8973 +      set List1 [split ${Log1} {TD= \t\n}]
8974 +      set Tolerance 1.1e-7
8975 +      set Limit_Tol 1.0e-7
8976 +      set D_good 0.
8977 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
8978 +      
8979 +      incr ic
8980 +    }
8981 +  }
8982 +  
8983 +  if {[expr {$ic - 1}] == $GoodNbCurv} {
8984 +    puts "OK: Curve Number is good!"
8985 +  } else {
8986 +    puts "Error: Curve Number is bad!"
8987 +  }
8988  }
8989 +
8990 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_26 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_26
8991 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_26      2014-11-11 17:47:34.000000000 +0300
8992 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_26        2015-01-16 13:01:25.000000000 +0300
8993 @@ -1,5 +1,3 @@
8994 -puts "TODO OCC225404 Debian60-64 Windows: Error: Curve Number is bad!"
8995 -
8996  puts "================"
8997  puts "OCC25292"
8998  puts "================"
8999 @@ -8,8 +6,37 @@
9000  # Face/Face intersection algorithm gives different results for different order of the arguments
9001  #######################################################################
9002  
9003 +proc GetRange { curve } {
9004 +  global U1
9005 +  global U2
9006 +  
9007 +  set log [uplevel dump $curve]
9008 +  
9009 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
9010 +  puts "Degree=${Degree}"
9011 +  puts "Poles=${Poles}"
9012 +  puts "KnotsPoles=${KnotsPoles}"
9013 +  puts ""
9014 +
9015 +  set Knot 1
9016 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9017 +  regexp ${exp_string} ${log} full U1 Mult1
9018 +
9019 +  set Knot ${KnotsPoles}
9020 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9021 +  regexp ${exp_string} ${log} full U2 Mult2
9022 +}
9023 +
9024 +puts "##############################"
9025 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
9026 +puts "##############################"
9027 +puts ""
9028 +
9029  # intersect command
9030  
9031 +#This value must be equal to the analogical value in bug25292_21, bug25292_22, bug25292_25 and bug25292_26 of "bugs modalg_5" testgrid. 
9032 +set GoodNbCurv 2
9033 +
9034  restore [locate_data_file bug25292_Input_3.brep] b1
9035  restore [locate_data_file bug25292_Input_11.brep] b2
9036  
9037 @@ -22,12 +49,99 @@
9038  mksurface s2 f2
9039  
9040  #################
9041 -intersect i s2 s1
9042 +intersect res s2 s1
9043  #################
9044  
9045 -if { [info exist i_3] } {
9046 -  puts "OK: Curve Number is good!"
9047 +set che [whatis res]
9048 +set ind [string first "3d curve" $che]
9049 +if {${ind} >= 0} {
9050 +  #Only variable "res" exists
9051 +  
9052 +  if { $GoodNbCurv == 1 } {
9053 +    puts "OK: Curve Number is good!"
9054 +  } else {
9055 +    puts "Error: Curve Number is bad!"
9056 +  }
9057 +  
9058 +  set U1 0.0
9059 +  set U2 0.0
9060 +  
9061 +  GetRange res
9062 +
9063 +  puts "U1 = ${U1}"
9064 +  puts "U2 = ${U2}"
9065 +
9066 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
9067 +    puts "Error: Wrong curve's range!"
9068 +  }
9069 +  
9070 +  dlog reset
9071 +  dlog on
9072 +  xdistcs res s1 ${U1} ${U2} 10
9073 +  set Log1 [dlog get]
9074 +  set List1 [split ${Log1} {TD= \t\n}]
9075 +  set Tolerance 1.1e-7
9076 +  set Limit_Tol 1.0e-7
9077 +  set D_good 0.
9078 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9079 +  
9080 +  dlog reset
9081 +  dlog on
9082 +  xdistcs res s2 ${U1} ${U2} 10
9083 +  set Log1 [dlog get]
9084 +  set List1 [split ${Log1} {TD= \t\n}]
9085 +  set Tolerance 1.1e-7
9086 +  set Limit_Tol 1.0e-7
9087 +  set D_good 0.
9088 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9089  } else {
9090 -  puts "Error: Curve Number is bad!"
9091 +  set ic 1
9092 +  set AllowRepeate 1
9093 +  while { $AllowRepeate != 0 } {
9094 +    set che [whatis res_$ic]
9095 +    set ind [string first "3d curve" $che]
9096 +    if {${ind} < 0} {
9097 +      set AllowRepeate 0
9098 +    } else {
9099 +      set U1 0.0
9100 +      set U2 0.0
9101 +      
9102 +      GetRange res_$ic
9103 +      
9104 +      puts "U1 = ${U1}"
9105 +      puts "U2 = ${U2}"
9106 +      
9107 +      if {[expr {$U2 - $U1}] < 1.0e-20} {
9108 +        puts "Error: Wrong curve's range!"
9109 +      }
9110 +      
9111 +      dlog reset
9112 +      dlog on
9113 +      xdistcs res_$ic s1 ${U1} ${U2} 10
9114 +      set Log1 [dlog get]
9115 +      set List1 [split ${Log1} {TD= \t\n}]
9116 +      set Tolerance 1.1e-7
9117 +      set Limit_Tol 1.0e-7
9118 +      set D_good 0.
9119 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9120 +      
9121 +      dlog reset
9122 +      dlog on
9123 +      xdistcs res_$ic s2 0 1 10
9124 +      set Log1 [dlog get]
9125 +      set List1 [split ${Log1} {TD= \t\n}]
9126 +      set Tolerance 1.1e-7
9127 +      set Limit_Tol 1.0e-7
9128 +      set D_good 0.
9129 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9130 +      
9131 +      incr ic
9132 +    }
9133 +  }
9134 +  
9135 +  if {[expr {$ic - 1}] == $GoodNbCurv} {
9136 +    puts "OK: Curve Number is good!"
9137 +  } else {
9138 +    puts "Error: Curve Number is bad!"
9139 +  }
9140  }
9141 -
9142 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_31 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_31
9143 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_31      2014-11-11 17:47:34.000000000 +0300
9144 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_31        2015-01-16 13:01:25.000000000 +0300
9145 @@ -6,6 +6,12 @@
9146  # Face/Face intersection algorithm gives different results for different order of the arguments
9147  #######################################################################
9148  
9149 +puts "##############################"
9150 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
9151 +puts "##############################"
9152 +puts ""
9153 +puts ""
9154 +
9155  # bopcurves command
9156  
9157  restore [locate_data_file bug25292_f1.brep] f1
9158 @@ -16,48 +22,69 @@
9159  #############################
9160  
9161  regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
9162 -set MaxTol 1.e-3
9163 +
9164 +#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid. 
9165 +set MaxTol 3.e-4
9166 +
9167 +#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid. 
9168 +set GoodNbCurv 1
9169 +
9170  if {${Toler} > ${MaxTol}} {
9171    puts "Error: Tolerance is too big!"
9172  }
9173 -set GoodNbCurv 2
9174  if {${NbCurv} != ${GoodNbCurv}} {
9175    puts "Error: Curve Number is bad!!"
9176  }
9177  
9178  #-------------
9179  
9180 -# 1
9181 -puts ""
9182 -puts "First curve"
9183 -
9184  mksurface s1 f1
9185  mksurface s2 f2
9186  
9187 -dlog reset
9188 -dlog on
9189 -xdistcs c_1 s1 0 1 10
9190 -set Log1 [dlog get]
9191 -
9192 -set List1 [split ${Log1} {TD= \t\n}]
9193 -set Tolerance 1.0e-4
9194 -set D_good 0.
9195 -checkList ${List1} ${Tolerance} ${D_good}
9196 -
9197 -# 2
9198 -puts ""
9199 -puts "Second curve"
9200 -
9201 -dlog reset
9202 -dlog on
9203 -xdistcs c_2 s1 0 1 10
9204 -set Log2 [dlog get]
9205 -
9206 -set List2 [split ${Log2} {TD= \t\n}]
9207 -set Tolerance 1.0e-4
9208 -set D_good 0.
9209 -checkList ${List2} ${Tolerance} ${D_good}
9210 -
9211 +for {set i 1} {$i <= ${NbCurv}} {incr i} {
9212 +  set log [dump c_$i]
9213 +  
9214 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
9215 +  puts "Degree=${Degree}"
9216 +  puts "Poles=${Poles}"
9217 +  puts "KnotsPoles=${KnotsPoles}"
9218 +  puts ""
9219 +
9220 +  set Knot 1
9221 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9222 +  regexp ${exp_string} ${log} full U1 Mult1
9223 +
9224 +  set Knot ${KnotsPoles}
9225 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9226 +  regexp ${exp_string} ${log} full U2 Mult2
9227 +
9228 +  puts "U1=${U1}"
9229 +  puts "U2=${U2}"
9230 +  
9231 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
9232 +    puts "Error: Wrong curve's range!"
9233 +  }
9234 +
9235 +  dlog reset
9236 +  dlog on
9237 +  xdistcs c_$i s1 ${U1} ${U2} 10
9238 +  set Log2 [dlog get]
9239 +  set List2 [split ${Log2} {TD= \t\n}]
9240 +  set Tolerance MaxTol
9241 +  set Limit_Tol 1.0e-7
9242 +  set D_good 0.
9243 +  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
9244 +
9245 +  dlog reset
9246 +  dlog on
9247 +  xdistcs c_$i s2 ${U1} ${U2} 10
9248 +  set Log2 [dlog get]
9249 +  set List2 [split ${Log2} {TD= \t\n}]
9250 +  set Tolerance MaxTol
9251 +  set Limit_Tol 1.0e-7
9252 +  set D_good 0.
9253 +  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
9254 +}
9255  
9256  smallview
9257  fit
9258 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_32 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_32
9259 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_32      2014-11-11 17:47:34.000000000 +0300
9260 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_32        2015-01-16 13:01:25.000000000 +0300
9261 @@ -1,3 +1,5 @@
9262 +puts "TODO OCC25331 Debian60-64: Error: Tolerance is too big!"
9263 +
9264  puts "================"
9265  puts "OCC25292"
9266  puts "================"
9267 @@ -6,6 +8,12 @@
9268  # Face/Face intersection algorithm gives different results for different order of the arguments
9269  #######################################################################
9270  
9271 +puts "##############################"
9272 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
9273 +puts "##############################"
9274 +puts ""
9275 +puts ""
9276 +
9277  # bopcurves command
9278  
9279  restore [locate_data_file bug25292_f1.brep] f1
9280 @@ -16,48 +24,69 @@
9281  #############################
9282  
9283  regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
9284 -set MaxTol 1.e-3
9285 +
9286 +#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid. 
9287 +set MaxTol 3.e-4
9288 +
9289 +#This value must be equal to the analogical value in bug25292_31 and bug25292_32 of "bugs modalg_5" testgrid. 
9290 +set GoodNbCurv 1
9291 +
9292  if {${Toler} > ${MaxTol}} {
9293    puts "Error: Tolerance is too big!"
9294  }
9295 -set GoodNbCurv 2
9296  if {${NbCurv} != ${GoodNbCurv}} {
9297    puts "Error: Curve Number is bad!!"
9298  }
9299  
9300  #-------------
9301  
9302 -# 1
9303 -puts ""
9304 -puts "First curve"
9305 -
9306  mksurface s1 f1
9307  mksurface s2 f2
9308  
9309 -dlog reset
9310 -dlog on
9311 -xdistcs c_1 s1 0 1 10
9312 -set Log1 [dlog get]
9313 -
9314 -set List1 [split ${Log1} {TD= \t\n}]
9315 -set Tolerance 1.0e-4
9316 -set D_good 0.
9317 -checkList ${List1} ${Tolerance} ${D_good}
9318 -
9319 -# 2
9320 -puts ""
9321 -puts "Second curve"
9322 -
9323 -dlog reset
9324 -dlog on
9325 -xdistcs c_2 s1 0 1 10
9326 -set Log2 [dlog get]
9327 -
9328 -set List2 [split ${Log2} {TD= \t\n}]
9329 -set Tolerance 1.0e-4
9330 -set D_good 0.
9331 -checkList ${List2} ${Tolerance} ${D_good}
9332 -
9333 +for {set i 1} {$i <= ${NbCurv}} {incr i} {
9334 +  set log [dump c_$i]
9335 +  
9336 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
9337 +  puts "Degree=${Degree}"
9338 +  puts "Poles=${Poles}"
9339 +  puts "KnotsPoles=${KnotsPoles}"
9340 +  puts ""
9341 +
9342 +  set Knot 1
9343 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9344 +  regexp ${exp_string} ${log} full U1 Mult1
9345 +
9346 +  set Knot ${KnotsPoles}
9347 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9348 +  regexp ${exp_string} ${log} full U2 Mult2
9349 +
9350 +  puts "U1=${U1}"
9351 +  puts "U2=${U2}"
9352 +  
9353 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
9354 +    puts "Error: Wrong curve's range!"
9355 +  }
9356 +
9357 +  dlog reset
9358 +  dlog on
9359 +  xdistcs c_$i s1 ${U1} ${U2} 10
9360 +  set Log2 [dlog get]
9361 +  set List2 [split ${Log2} {TD= \t\n}]
9362 +  set Tolerance MaxTol
9363 +  set Limit_Tol 1.0e-7
9364 +  set D_good 0.
9365 +  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
9366 +
9367 +  dlog reset
9368 +  dlog on
9369 +  xdistcs c_$i s2 ${U1} ${U2} 10
9370 +  set Log2 [dlog get]
9371 +  set List2 [split ${Log2} {TD= \t\n}]
9372 +  set Tolerance MaxTol
9373 +  set Limit_Tol 1.0e-7
9374 +  set D_good 0.
9375 +  checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}
9376 +}
9377  
9378  smallview
9379  fit
9380 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_33 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_33
9381 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_33      2014-11-11 17:47:34.000000000 +0300
9382 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_33        2015-01-16 13:00:37.000000000 +0300
9383 @@ -6,8 +6,37 @@
9384  # Face/Face intersection algorithm gives different results for different order of the arguments
9385  #######################################################################
9386  
9387 +proc GetRange { curve } {
9388 +  global U1
9389 +  global U2
9390 +  
9391 +  set log [uplevel dump $curve]
9392 +  
9393 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
9394 +  puts "Degree=${Degree}"
9395 +  puts "Poles=${Poles}"
9396 +  puts "KnotsPoles=${KnotsPoles}"
9397 +  puts ""
9398 +
9399 +  set Knot 1
9400 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9401 +  regexp ${exp_string} ${log} full U1 Mult1
9402 +
9403 +  set Knot ${KnotsPoles}
9404 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9405 +  regexp ${exp_string} ${log} full U2 Mult2
9406 +}
9407 +
9408 +puts "##############################"
9409 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
9410 +puts "##############################"
9411 +puts ""
9412 +
9413  # intersect command
9414  
9415 +#This value must be equal to the analogical value in bug25292_33 and bug25292_34 of "bugs modalg_5" testgrid. 
9416 +set GoodNbCurv 1
9417 +
9418  restore [locate_data_file bug25292_f1.brep] f1
9419  restore [locate_data_file bug25292_f2.brep] f2
9420  
9421 @@ -15,11 +44,99 @@
9422  mksurface s2 f2
9423  
9424  #################
9425 -intersect i s1 s2
9426 +intersect res s1 s2
9427  #################
9428  
9429 -if { [info exist i] } {
9430 -  puts "OK: Curve Number is good!"
9431 +set che [whatis res]
9432 +set ind [string first "3d curve" $che]
9433 +if {${ind} >= 0} {
9434 +  #Only variable "res" exists
9435 +  
9436 +  if { $GoodNbCurv == 1 } {
9437 +    puts "OK: Curve Number is good!"
9438 +  } else {
9439 +    puts "Error: Curve Number is bad!"
9440 +  }
9441 +  
9442 +  set U1 0.0
9443 +  set U2 0.0
9444 +  
9445 +  GetRange res
9446 +
9447 +  puts "U1 = ${U1}"
9448 +  puts "U2 = ${U2}"
9449 +
9450 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
9451 +    puts "Error: Wrong curve's range!"
9452 +  }
9453 +  
9454 +  dlog reset
9455 +  dlog on
9456 +  xdistcs res s1 ${U1} ${U2} 10
9457 +  set Log1 [dlog get]
9458 +  set List1 [split ${Log1} {TD= \t\n}]
9459 +  set Tolerance 1.0e-6
9460 +  set Limit_Tol 1.0e-7
9461 +  set D_good 0.
9462 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9463 +  
9464 +  dlog reset
9465 +  dlog on
9466 +  xdistcs res s2 ${U1} ${U2} 10
9467 +  set Log1 [dlog get]
9468 +  set List1 [split ${Log1} {TD= \t\n}]
9469 +  set Tolerance 1.0e-6
9470 +  set Limit_Tol 1.0e-7
9471 +  set D_good 0.
9472 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9473  } else {
9474 -  puts "Error: Curve Number is bad!"
9475 +  set ic 1
9476 +  set AllowRepeate 1
9477 +  while { $AllowRepeate != 0 } {
9478 +    set che [whatis res_$ic]
9479 +    set ind [string first "3d curve" $che]
9480 +    if {${ind} < 0} {
9481 +      set AllowRepeate 0
9482 +    } else {
9483 +      set U1 0.0
9484 +      set U2 0.0
9485 +      
9486 +      GetRange res_$ic
9487 +      
9488 +      puts "U1 = ${U1}"
9489 +      puts "U2 = ${U2}"
9490 +      
9491 +      if {[expr {$U2 - $U1}] < 1.0e-20} {
9492 +        puts "Error: Wrong curve's range!"
9493 +      }
9494 +      
9495 +      dlog reset
9496 +      dlog on
9497 +      xdistcs res_$ic s1 ${U1} ${U2} 10
9498 +      set Log1 [dlog get]
9499 +      set List1 [split ${Log1} {TD= \t\n}]
9500 +      set Tolerance 1.0e-6
9501 +      set Limit_Tol 1.0e-7
9502 +      set D_good 0.
9503 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9504 +      
9505 +      dlog reset
9506 +      dlog on
9507 +      xdistcs res_$ic s2 0 1 10
9508 +      set Log1 [dlog get]
9509 +      set List1 [split ${Log1} {TD= \t\n}]
9510 +      set Tolerance 1.0e-6
9511 +      set Limit_Tol 1.0e-7
9512 +      set D_good 0.
9513 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9514 +      
9515 +      incr ic
9516 +    }
9517 +  }
9518 +  
9519 +  if {[expr {$ic - 1}] == $GoodNbCurv} {
9520 +    puts "OK: Curve Number is good!"
9521 +  } else {
9522 +    puts "Error: Curve Number is bad!"
9523 +  }
9524  }
9525 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_34 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_34
9526 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_34      2014-11-11 17:47:34.000000000 +0300
9527 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_34        2015-01-16 13:00:37.000000000 +0300
9528 @@ -6,8 +6,37 @@
9529  # Face/Face intersection algorithm gives different results for different order of the arguments
9530  #######################################################################
9531  
9532 +proc GetRange { curve } {
9533 +  global U1
9534 +  global U2
9535 +  
9536 +  set log [uplevel dump $curve]
9537 +  
9538 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
9539 +  puts "Degree=${Degree}"
9540 +  puts "Poles=${Poles}"
9541 +  puts "KnotsPoles=${KnotsPoles}"
9542 +  puts ""
9543 +
9544 +  set Knot 1
9545 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9546 +  regexp ${exp_string} ${log} full U1 Mult1
9547 +
9548 +  set Knot ${KnotsPoles}
9549 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9550 +  regexp ${exp_string} ${log} full U2 Mult2
9551 +}
9552 +
9553 +puts "##############################"
9554 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
9555 +puts "##############################"
9556 +puts ""
9557 +
9558  # intersect command
9559  
9560 +#This value must be equal to the analogical value in bug25292_33 and bug25292_34 of "bugs modalg_5" testgrid. 
9561 +set GoodNbCurv 1
9562 +
9563  restore [locate_data_file bug25292_f1.brep] f1
9564  restore [locate_data_file bug25292_f2.brep] f2
9565  
9566 @@ -15,11 +44,99 @@
9567  mksurface s2 f2
9568  
9569  #################
9570 -intersect i s2 s1
9571 +intersect res s2 s1
9572  #################
9573  
9574 -if { [info exist i] } {
9575 -  puts "OK: Curve Number is good!"
9576 +set che [whatis res]
9577 +set ind [string first "3d curve" $che]
9578 +if {${ind} >= 0} {
9579 +  #Only variable "res" exists
9580 +  
9581 +  if { $GoodNbCurv == 1 } {
9582 +    puts "OK: Curve Number is good!"
9583 +  } else {
9584 +    puts "Error: Curve Number is bad!"
9585 +  }
9586 +  
9587 +  set U1 0.0
9588 +  set U2 0.0
9589 +  
9590 +  GetRange res
9591 +
9592 +  puts "U1 = ${U1}"
9593 +  puts "U2 = ${U2}"
9594 +
9595 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
9596 +    puts "Error: Wrong curve's range!"
9597 +  }
9598 +  
9599 +  dlog reset
9600 +  dlog on
9601 +  xdistcs res s1 ${U1} ${U2} 10
9602 +  set Log1 [dlog get]
9603 +  set List1 [split ${Log1} {TD= \t\n}]
9604 +  set Tolerance 1.0e-6
9605 +  set Limit_Tol 1.0e-7
9606 +  set D_good 0.
9607 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9608 +  
9609 +  dlog reset
9610 +  dlog on
9611 +  xdistcs res s2 ${U1} ${U2} 10
9612 +  set Log1 [dlog get]
9613 +  set List1 [split ${Log1} {TD= \t\n}]
9614 +  set Tolerance 1.0e-6
9615 +  set Limit_Tol 1.0e-7
9616 +  set D_good 0.
9617 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9618  } else {
9619 -  puts "Error: Curve Number is bad!"
9620 +  set ic 1
9621 +  set AllowRepeate 1
9622 +  while { $AllowRepeate != 0 } {
9623 +    set che [whatis res_$ic]
9624 +    set ind [string first "3d curve" $che]
9625 +    if {${ind} < 0} {
9626 +      set AllowRepeate 0
9627 +    } else {
9628 +      set U1 0.0
9629 +      set U2 0.0
9630 +      
9631 +      GetRange res_$ic
9632 +      
9633 +      puts "U1 = ${U1}"
9634 +      puts "U2 = ${U2}"
9635 +      
9636 +      if {[expr {$U2 - $U1}] < 1.0e-20} {
9637 +        puts "Error: Wrong curve's range!"
9638 +      }
9639 +      
9640 +      dlog reset
9641 +      dlog on
9642 +      xdistcs res_$ic s1 ${U1} ${U2} 10
9643 +      set Log1 [dlog get]
9644 +      set List1 [split ${Log1} {TD= \t\n}]
9645 +      set Tolerance 1.0e-6
9646 +      set Limit_Tol 1.0e-7
9647 +      set D_good 0.
9648 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9649 +      
9650 +      dlog reset
9651 +      dlog on
9652 +      xdistcs res_$ic s2 0 1 10
9653 +      set Log1 [dlog get]
9654 +      set List1 [split ${Log1} {TD= \t\n}]
9655 +      set Tolerance 1.0e-6
9656 +      set Limit_Tol 1.0e-7
9657 +      set D_good 0.
9658 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9659 +      
9660 +      incr ic
9661 +    }
9662 +  }
9663 +  
9664 +  if {[expr {$ic - 1}] == $GoodNbCurv} {
9665 +    puts "OK: Curve Number is good!"
9666 +  } else {
9667 +    puts "Error: Curve Number is bad!"
9668 +  }
9669  }
9670 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_35 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_35
9671 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_35      2014-11-11 17:47:34.000000000 +0300
9672 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_35        2015-01-16 13:01:25.000000000 +0300
9673 @@ -6,8 +6,38 @@
9674  # Face/Face intersection algorithm gives different results for different order of the arguments
9675  #######################################################################
9676  
9677 +proc GetRange { curve } {
9678 +  global U1
9679 +  global U2
9680 +  
9681 +  set log [uplevel dump $curve]
9682 +  
9683 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
9684 +  puts "Degree=${Degree}"
9685 +  puts "Poles=${Poles}"
9686 +  puts "KnotsPoles=${KnotsPoles}"
9687 +  puts ""
9688 +
9689 +  set Knot 1
9690 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9691 +  regexp ${exp_string} ${log} full U1 Mult1
9692 +
9693 +  set Knot ${KnotsPoles}
9694 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9695 +  regexp ${exp_string} ${log} full U2 Mult2
9696 +}
9697 +
9698 +puts "##############################"
9699 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
9700 +puts "##############################"
9701 +puts ""
9702 +puts ""
9703 +
9704  # intersect command for trimmed surfaces
9705  
9706 +#This value must be equal to the analogical value in bug25292_35 and bug25292_36 of "bugs modalg_5" testgrid. 
9707 +set GoodNbCurv 2
9708 +
9709  restore [locate_data_file bug25292_f1.brep] f1
9710  restore [locate_data_file bug25292_f2.brep] f2
9711  
9712 @@ -21,11 +51,99 @@
9713  trim s2t s2 0. 1.570796326795 -275 275
9714  
9715  ###################
9716 -intersect k s1t s2t
9717 +intersect res s1t s2t
9718  ###################
9719  
9720 -if { [info exist k_2] } {
9721 -  puts "OK: Curve Number is good!"
9722 +set che [whatis res]
9723 +set ind [string first "3d curve" $che]
9724 +if {${ind} >= 0} {
9725 +  #Only variable "res" exists
9726 +  
9727 +  if { $GoodNbCurv == 1 } {
9728 +    puts "OK: Curve Number is good!"
9729 +  } else {
9730 +    puts "Error: Curve Number is bad!"
9731 +  }
9732 +  
9733 +  set U1 0.0
9734 +  set U2 0.0
9735 +  
9736 +  GetRange res
9737 +
9738 +  puts "U1 = ${U1}"
9739 +  puts "U2 = ${U2}"
9740 +
9741 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
9742 +    puts "Error: Wrong curve's range!"
9743 +  }
9744 +  
9745 +  dlog reset
9746 +  dlog on
9747 +  xdistcs res s1 ${U1} ${U2} 10
9748 +  set Log1 [dlog get]
9749 +  set List1 [split ${Log1} {TD= \t\n}]
9750 +  set Tolerance 3.0e-4
9751 +  set Limit_Tol 1.0e-7
9752 +  set D_good 0.
9753 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9754 +  
9755 +  dlog reset
9756 +  dlog on
9757 +  xdistcs res s2 ${U1} ${U2} 10
9758 +  set Log1 [dlog get]
9759 +  set List1 [split ${Log1} {TD= \t\n}]
9760 +  set Tolerance 3.0e-4
9761 +  set Limit_Tol 1.0e-7
9762 +  set D_good 0.
9763 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9764  } else {
9765 -  puts "Error: Curve Number is bad!"
9766 +  set ic 1
9767 +  set AllowRepeate 1
9768 +  while { $AllowRepeate != 0 } {
9769 +    set che [whatis res_$ic]
9770 +    set ind [string first "3d curve" $che]
9771 +    if {${ind} < 0} {
9772 +      set AllowRepeate 0
9773 +    } else {
9774 +      set U1 0.0
9775 +      set U2 0.0
9776 +      
9777 +      GetRange res_$ic
9778 +      
9779 +      puts "U1 = ${U1}"
9780 +      puts "U2 = ${U2}"
9781 +      
9782 +      if {[expr {$U2 - $U1}] < 1.0e-20} {
9783 +        puts "Error: Wrong curve's range!"
9784 +      }
9785 +      
9786 +      dlog reset
9787 +      dlog on
9788 +      xdistcs res_$ic s1 ${U1} ${U2} 10
9789 +      set Log1 [dlog get]
9790 +      set List1 [split ${Log1} {TD= \t\n}]
9791 +      set Tolerance 3.0e-4
9792 +      set Limit_Tol 1.0e-7
9793 +      set D_good 0.
9794 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9795 +      
9796 +      dlog reset
9797 +      dlog on
9798 +      xdistcs res_$ic s2 0 1 10
9799 +      set Log1 [dlog get]
9800 +      set List1 [split ${Log1} {TD= \t\n}]
9801 +      set Tolerance 3.0e-4
9802 +      set Limit_Tol 1.0e-7
9803 +      set D_good 0.
9804 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9805 +      
9806 +      incr ic
9807 +    }
9808 +  }
9809 +  
9810 +  if {[expr {$ic - 1}] == $GoodNbCurv} {
9811 +    puts "OK: Curve Number is good!"
9812 +  } else {
9813 +    puts "Error: Curve Number is bad!"
9814 +  }
9815  }
9816 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_36 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_36
9817 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25292_36      2014-11-11 17:47:34.000000000 +0300
9818 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25292_36        2015-01-16 13:01:25.000000000 +0300
9819 @@ -6,8 +6,38 @@
9820  # Face/Face intersection algorithm gives different results for different order of the arguments
9821  #######################################################################
9822  
9823 +proc GetRange { curve } {
9824 +  global U1
9825 +  global U2
9826 +  
9827 +  set log [uplevel dump $curve]
9828 +  
9829 +  regexp {Degree +([-0-9.+eE]+), +([-0-9.+eE]+) Poles, +([-0-9.+eE]+)} ${log} full Degree Poles KnotsPoles
9830 +  puts "Degree=${Degree}"
9831 +  puts "Poles=${Poles}"
9832 +  puts "KnotsPoles=${KnotsPoles}"
9833 +  puts ""
9834 +
9835 +  set Knot 1
9836 +  set exp_string "Knots :\n\n +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9837 +  regexp ${exp_string} ${log} full U1 Mult1
9838 +
9839 +  set Knot ${KnotsPoles}
9840 +  set exp_string " +${Knot} :  +(\[-0-9.+eE\]+) +(\[-0-9.+eE\]+)"
9841 +  regexp ${exp_string} ${log} full U2 Mult2
9842 +}
9843 +
9844 +puts "##############################"
9845 +puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!"
9846 +puts "##############################"
9847 +puts ""
9848 +puts ""
9849 +
9850  # intersect command for trimmed surfaces
9851  
9852 +#This value must be equal to the analogical value in bug25292_35 and bug25292_36 of "bugs modalg_5" testgrid. 
9853 +set GoodNbCurv 2
9854 +
9855  restore [locate_data_file bug25292_f1.brep] f1
9856  restore [locate_data_file bug25292_f2.brep] f2
9857  
9858 @@ -21,11 +51,99 @@
9859  trim s2t s2 0. 1.570796326795 -275 275
9860  
9861  ###################
9862 -intersect k s2t s1t
9863 +intersect res s2t s1t
9864  ###################
9865  
9866 -if { [info exist k_2] } {
9867 -  puts "OK: Curve Number is good!"
9868 +set che [whatis res]
9869 +set ind [string first "3d curve" $che]
9870 +if {${ind} >= 0} {
9871 +  #Only variable "res" exists
9872 +  
9873 +  if { $GoodNbCurv == 1 } {
9874 +    puts "OK: Curve Number is good!"
9875 +  } else {
9876 +    puts "Error: Curve Number is bad!"
9877 +  }
9878 +  
9879 +  set U1 0.0
9880 +  set U2 0.0
9881 +  
9882 +  GetRange res
9883 +
9884 +  puts "U1 = ${U1}"
9885 +  puts "U2 = ${U2}"
9886 +
9887 +  if {[expr {$U2 - $U1}] < 1.0e-20} {
9888 +    puts "Error: Wrong curve's range!"
9889 +  }
9890 +  
9891 +  dlog reset
9892 +  dlog on
9893 +  xdistcs res s1 ${U1} ${U2} 10
9894 +  set Log1 [dlog get]
9895 +  set List1 [split ${Log1} {TD= \t\n}]
9896 +  set Tolerance 3.0e-4
9897 +  set Limit_Tol 1.0e-7
9898 +  set D_good 0.
9899 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9900 +  
9901 +  dlog reset
9902 +  dlog on
9903 +  xdistcs res s2 ${U1} ${U2} 10
9904 +  set Log1 [dlog get]
9905 +  set List1 [split ${Log1} {TD= \t\n}]
9906 +  set Tolerance 3.0e-4
9907 +  set Limit_Tol 1.0e-7
9908 +  set D_good 0.
9909 +  checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9910  } else {
9911 -  puts "Error: Curve Number is bad!"
9912 +  set ic 1
9913 +  set AllowRepeate 1
9914 +  while { $AllowRepeate != 0 } {
9915 +    set che [whatis res_$ic]
9916 +    set ind [string first "3d curve" $che]
9917 +    if {${ind} < 0} {
9918 +      set AllowRepeate 0
9919 +    } else {
9920 +      set U1 0.0
9921 +      set U2 0.0
9922 +      
9923 +      GetRange res_$ic
9924 +      
9925 +      puts "U1 = ${U1}"
9926 +      puts "U2 = ${U2}"
9927 +      
9928 +      if {[expr {$U2 - $U1}] < 1.0e-20} {
9929 +        puts "Error: Wrong curve's range!"
9930 +      }
9931 +      
9932 +      dlog reset
9933 +      dlog on
9934 +      xdistcs res_$ic s1 ${U1} ${U2} 10
9935 +      set Log1 [dlog get]
9936 +      set List1 [split ${Log1} {TD= \t\n}]
9937 +      set Tolerance 3.0e-4
9938 +      set Limit_Tol 1.0e-7
9939 +      set D_good 0.
9940 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9941 +      
9942 +      dlog reset
9943 +      dlog on
9944 +      xdistcs res_$ic s2 0 1 10
9945 +      set Log1 [dlog get]
9946 +      set List1 [split ${Log1} {TD= \t\n}]
9947 +      set Tolerance 3.0e-4
9948 +      set Limit_Tol 1.0e-7
9949 +      set D_good 0.
9950 +      checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol}
9951 +      
9952 +      incr ic
9953 +    }
9954 +  }
9955 +  
9956 +  if {[expr {$ic - 1}] == $GoodNbCurv} {
9957 +    puts "OK: Curve Number is good!"
9958 +  } else {
9959 +    puts "Error: Curve Number is bad!"
9960 +  }
9961  }
9962 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25432 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25432
9963 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25432 1970-01-01 03:00:00.000000000 +0300
9964 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25432   2015-01-16 13:00:38.000000000 +0300
9965 @@ -0,0 +1,33 @@
9966 +puts "============"
9967 +puts "OCC25432"
9968 +puts "============"
9969 +puts ""
9970 +#########################################################################
9971 +# Wrong result obtained by MakerVolume operator.
9972 +#########################################################################
9973 +
9974 +restore [locate_data_file bug25432_qz.brep] q
9975 +
9976 +explode q f
9977 +mkvolume result q_1 q_2 q_3 q_4 q_5 q_6 q_7 q_8 q_9 q_10 q_11 -ni
9978 +
9979 +regexp {Mass +: +([-0-9.+eE]+)} [vprops result] full volume
9980 +
9981 +set expected_volume 0.26776
9982 +set tol_abs_volume 1.0e-4
9983 +set tol_rel_volume 0.0001
9984 +checkreal "Volume" ${volume} ${expected_volume} ${tol_abs_volume} ${tol_rel_volume}
9985 +
9986 +set square 3.59972
9987 +
9988 +set nb_v_good 12
9989 +set nb_e_good 20
9990 +set nb_w_good 11
9991 +set nb_f_good 11
9992 +set nb_sh_good 2
9993 +set nb_sol_good 2
9994 +set nb_compsol_good 0
9995 +set nb_compound_good 1
9996 +set nb_shape_good 59
9997 +
9998 +set 2dviewer 1
9999 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25449 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25449
10000 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25449 1970-01-01 03:00:00.000000000 +0300
10001 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25449   2015-01-16 13:00:38.000000000 +0300
10002 @@ -0,0 +1,31 @@
10003 +puts "================"
10004 +puts "OCC25449"
10005 +puts "================"
10006 +puts ""
10007 +#######################################################################
10008 +# Excess vertex in result of General Fuse operation.
10009 +#######################################################################
10010 +
10011 +restore [locate_data_file bug25449_fz351.brep] b1
10012 +restore [locate_data_file bug25449_ez679.brep] b2
10013 +
10014 +bclearobjects
10015 +bcleartools
10016 +baddobjects b1 b2
10017 +
10018 +bfillds -t
10019 +bbuild result
10020 +
10021 +set square 21.1115
10022 +
10023 +set nb_v_good 4
10024 +set nb_e_good 4
10025 +set nb_w_good 1
10026 +set nb_f_good 1
10027 +set nb_sh_good 0
10028 +set nb_sol_good 0
10029 +set nb_compsol_good 0
10030 +set nb_compound_good 1
10031 +set nb_shape_good 11
10032 +
10033 +set 3dviewer 1
10034 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25450_1 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25450_1
10035 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25450_1       1970-01-01 03:00:00.000000000 +0300
10036 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25450_1 2015-01-16 13:00:38.000000000 +0300
10037 @@ -0,0 +1,26 @@
10038 +puts "================"
10039 +puts "OCC25450"
10040 +puts "================"
10041 +puts ""
10042 +####################################
10043 +# Common operation returns wrong shape
10044 +####################################
10045 +
10046 +restore [locate_data_file bug25450_Shape.brep] a
10047 +
10048 +explode a
10049 +bcommon result a_1 a_2
10050 +
10051 +set square 142153
10052 +
10053 +set nb_v_good 8
10054 +set nb_e_good 12
10055 +set nb_w_good 4
10056 +set nb_f_good 4
10057 +set nb_sh_good 1
10058 +set nb_sol_good 0
10059 +set nb_compsol_good 0
10060 +set nb_compound_good 1
10061 +set nb_shape_good 30
10062 +
10063 +set 3dviewer 1
10064 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25450_2 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25450_2
10065 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25450_2       1970-01-01 03:00:00.000000000 +0300
10066 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25450_2 2015-01-16 13:00:38.000000000 +0300
10067 @@ -0,0 +1,27 @@
10068 +puts "================"
10069 +puts "OCC25450"
10070 +puts "================"
10071 +puts ""
10072 +####################################
10073 +# Common operation returns wrong shape
10074 +####################################
10075 +
10076 +restore [locate_data_file bug25450_b1.brep] b1
10077 +restore [locate_data_file bug25450_b2.brep] b2
10078 +
10079 +bop b1 b2
10080 +bopcommon result
10081 +
10082 +set square 35538.3
10083 +
10084 +set nb_v_good 4
10085 +set nb_e_good 4
10086 +set nb_w_good 1
10087 +set nb_f_good 1
10088 +set nb_sh_good 1
10089 +set nb_sol_good 0
10090 +set nb_compsol_good 0
10091 +set nb_compound_good 1
10092 +set nb_shape_good 12
10093 +
10094 +set 3dviewer 1
10095 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25456 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25456
10096 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25456 1970-01-01 03:00:00.000000000 +0300
10097 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25456   2015-01-16 13:00:38.000000000 +0300
10098 @@ -0,0 +1,17 @@
10099 +puts "============"
10100 +puts "OCC25456"
10101 +puts "============"
10102 +puts ""
10103 +###############################
10104 +## BOPAlgo_CheckerSI reports an error on the given shape
10105 +###############################
10106 +
10107 +restore [locate_data_file bug25456_shape.brep] a
10108 +
10109 +set info [bopcheck a]
10110 +
10111 +if {[string compare ${info} " This shape seems to be OK.\n"] == 0} {
10112 +    puts "OK: BOPAlgo_CheckerSI report is good"
10113 +} else {
10114 +    puts "Error : BOPAlgo_CheckerSI report is wrong"
10115 +}
10116 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25465_1 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25465_1
10117 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25465_1       1970-01-01 03:00:00.000000000 +0300
10118 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25465_1 2015-01-16 13:00:38.000000000 +0300
10119 @@ -0,0 +1,31 @@
10120 +puts "========"
10121 +puts "OCC25465"
10122 +puts "========"
10123 +puts ""
10124 +################################################
10125 +# Excess vertex in the result of CUT operation
10126 +################################################
10127 +
10128 +restore [locate_data_file OCC25465_Gorivo.brep] b1
10129 +restore [locate_data_file OCC25465_Translation_1.brep] b2
10130 +
10131 +explode b1 f
10132 +explode b2 f
10133 +set bug_info [bopcurves b1_3 b2_4]
10134 +bop b1 b2
10135 +bopcut result
10136 +
10137 +# It is strictly forbidden to change nb_v_good and nb_e_good values (see OCC25465)
10138 +set nb_v_good 11
10139 +set nb_e_good 17
10140 +set nb_w_good 8
10141 +set nb_f_good 8
10142 +set nb_sh_good 1
10143 +set nb_sol_good 1
10144 +set nb_compsol_good 0
10145 +set nb_compound_good 1
10146 +set nb_shape_good 47
10147 +
10148 +if {[lindex $bug_info 2] != 3} {
10149 +  puts "ERROR: OCC25465 is reproduced."
10150 +}
10151 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25465_2 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25465_2
10152 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25465_2       1970-01-01 03:00:00.000000000 +0300
10153 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25465_2 2015-01-16 13:00:38.000000000 +0300
10154 @@ -0,0 +1,31 @@
10155 +puts "========"
10156 +puts "OCC25465"
10157 +puts "========"
10158 +puts ""
10159 +################################################
10160 +# Excess vertex in the result of CUT operation
10161 +################################################
10162 +
10163 +restore [locate_data_file OCC25465_t_boite1.brep] b1
10164 +restore [locate_data_file OCC25465_c_cyl.brep] b2
10165 +
10166 +explode b1 f
10167 +explode b2 f
10168 +set bug_info [bopcurves b1_6 b2_1]
10169 +bop b1 b2
10170 +bopcut result
10171 +
10172 +# It is strictly forbidden to change nb_v_good and nb_e_good values (see OCC25465)
10173 +set nb_v_good 13
10174 +set nb_e_good 20
10175 +set nb_w_good 11
10176 +set nb_f_good 8
10177 +set nb_sh_good 1
10178 +set nb_sol_good 1
10179 +set nb_compsol_good 0
10180 +set nb_compound_good 1
10181 +set nb_shape_good 55
10182 +
10183 +if {[lindex $bug_info 2] != 2} {
10184 +  puts "ERROR: OCC25465 is reproduced."
10185 +}
10186 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25480 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25480
10187 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25480 1970-01-01 03:00:00.000000000 +0300
10188 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25480   2015-01-16 13:00:38.000000000 +0300
10189 @@ -0,0 +1,26 @@
10190 +puts "============"
10191 +puts "OCC25480"
10192 +puts "============"
10193 +puts ""
10194 +#######################################################################
10195 +# Incorrect result of BRepOffsetAPI_MakePipe
10196 +#######################################################################
10197 +
10198 +restore [locate_data_file bug25480_part1.brep] a
10199 +restore [locate_data_file bug25480_part2.brep] b
10200 +
10201 +pipe result b a 1
10202 +
10203 +set square 48441
10204 +
10205 +set nb_v_good 224
10206 +set nb_e_good 392
10207 +set nb_w_good 196
10208 +set nb_f_good 196
10209 +set nb_sh_good 14
10210 +set nb_sol_good 14
10211 +set nb_compsol_good 0
10212 +set nb_compound_good 8
10213 +set nb_shape_good 1044
10214 +
10215 +set 2dviewer 1
10216 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25488 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25488
10217 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25488 1970-01-01 03:00:00.000000000 +0300
10218 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25488   2015-01-16 13:01:25.000000000 +0300
10219 @@ -0,0 +1,34 @@
10220 +puts "========"
10221 +puts "OCC25488"
10222 +puts "========"
10223 +puts ""
10224 +######################################################
10225 +# Wrong result of two trimmed cylinders intersection
10226 +######################################################
10227 +
10228 +set Tolerance 3.0e-7
10229 +set D_good 0.
10230 +set Limit_Tol 1.0e-7
10231 +
10232 +restore [locate_data_file OCC25488_sb1_1t.draw] sb1
10233 +restore [locate_data_file OCC25488_sb2_1t.draw] sb2
10234 +
10235 +set bug_info [intersect res sb1 sb2]
10236 +
10237 +set i 0
10238 +while {$i != [llength $bug_info]} {
10239 +  set res_i [lindex $bug_info $i]
10240 +  dlog reset
10241 +  dlog on
10242 +  xdistcs ${res_i} sb1 0 1 10
10243 +  set BugLog [dlog get]
10244 +  set BugList [split ${BugLog} {TD= \t\n}]
10245 +  checkList ${BugList} ${Tolerance} ${D_good} ${Limit_Tol}
10246 +  dlog reset
10247 +  dlog on
10248 +  xdistcs ${res_i} sb2 0 1 10
10249 +  set BugLog [dlog get]
10250 +  set BugList [split ${BugLog} {TD= \t\n}]
10251 +  checkList ${BugList} ${Tolerance} ${D_good} ${Limit_Tol}
10252 +  set i [expr {$i + 1}]
10253 +}
10254 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25505 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25505
10255 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25505 1970-01-01 03:00:00.000000000 +0300
10256 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25505   2015-01-16 13:00:38.000000000 +0300
10257 @@ -0,0 +1,39 @@
10258 +puts "============"
10259 +puts "OCC25505"
10260 +puts "============"
10261 +puts ""
10262 +###############################
10263 +## General Fuse produces self-intersection shape
10264 +###############################
10265 +
10266 +restore [locate_data_file bug25505_q.brep] q
10267 +
10268 +explode q
10269 +
10270 +bclearobjects
10271 +bcleartools
10272 +baddobjects q_1 q_2 q_3 q_4
10273 +bfillds
10274 +bbuild result
10275 +
10276 +set info [bopcheck result]
10277 +
10278 +if {[string compare ${info} " This shape seems to be OK.\n"] == 0} {
10279 +    puts "OK: General Fuse produces good shape"
10280 +} else {
10281 +    puts "Error : General Fuse produces self-intersection shape"
10282 +}
10283 +
10284 +set square 68796.4
10285 +
10286 +set nb_v_good 14
10287 +set nb_e_good 21
10288 +set nb_w_good 9
10289 +set nb_f_good 9
10290 +set nb_sh_good 7
10291 +set nb_sol_good 4
10292 +set nb_compsol_good 0
10293 +set nb_compound_good  1
10294 +set nb_shape_good 65
10295 +
10296 +set 3dviewer 1
10297 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25592 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25592
10298 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25592 1970-01-01 03:00:00.000000000 +0300
10299 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25592   2015-01-16 13:00:38.000000000 +0300
10300 @@ -0,0 +1,50 @@
10301 +puts "============"
10302 +puts "OCC25592"
10303 +puts "============"
10304 +puts ""
10305 +######################################################
10306 +# Bad result of Fillet operation
10307 +######################################################
10308 +
10309 +restore [locate_data_file bug25592_tshape.brep] t
10310 +explode t e
10311 +shape c c
10312 +add t_4 c
10313 +add t_6 c
10314 +fillet r t 30 c
10315 +explode r f
10316 +
10317 +set info1 [bopargcheck r_2 #f]
10318 +if { [regexp "to be valid for BOP" ${info1}] == 1 } {
10319 +    puts "1. OK : Good result of Fillet operation\n"
10320 +} else {
10321 +    puts "1. Error : Bad result of Fillet operation\n"
10322 +}
10323 +
10324 +set info2 [bopargcheck r_1 #f]
10325 +if { [regexp "to be valid for BOP" ${info2}] == 1 } {
10326 +    puts "2. OK : Good result of Fillet operation\n"
10327 +} else {
10328 +    puts "2. Error : Bad result of Fillet operation\n"
10329 +}
10330 +
10331 +set info3 [bopargcheck r_6 #f]
10332 +if { [regexp "to be valid for BOP" ${info3}] == 1 } {
10333 +    puts "3. OK : Good result of Fillet operation\n"
10334 +} else {
10335 +    puts "3. Error : Bad result of Fillet operation\n"
10336 +}
10337 +
10338 +set info4 [bopargcheck r_7 #f]
10339 +if { [regexp "to be valid for BOP" ${info4}] == 1 } {
10340 +    puts "4. OK : Good result of Fillet operation\n"
10341 +} else {
10342 +    puts "4. Error : Bad result of Fillet operation\n"
10343 +}
10344 +
10345 +set info5 [bopargcheck r_9 #f]
10346 +if { [regexp "to be valid for BOP" ${info5}] == 1 } {
10347 +    puts "5. OK : Good result of Fillet operation\n"
10348 +} else {
10349 +    puts "5. Error : Bad result of Fillet operation\n"
10350 +}
10351 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25657 OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25657
10352 --- OCCT-6.8.0_SRC/tests/bugs/modalg_5/bug25657 1970-01-01 03:00:00.000000000 +0300
10353 +++ OCCT-6.8.0_SRC-patch/tests/bugs/modalg_5/bug25657   2015-01-16 13:01:25.000000000 +0300
10354 @@ -0,0 +1,25 @@
10355 +puts "========"
10356 +puts "OCC25657"
10357 +puts "========"
10358 +puts ""
10359 +###########################################################################################
10360 +#  Bad result of Fillet operation
10361 +###########################################################################################
10362 +
10363 +restore [locate_data_file bug25657_r4.brep] r4
10364 +explode r4 e
10365 +shape c c
10366 +add r4_15 c
10367 +fillet res r4 20 c
10368 +
10369 +explode res f
10370 +
10371 +pcurve res_2
10372 +# exception
10373 +
10374 +pcurve res_5
10375 +# exception
10376 +
10377 +smallview
10378 +fit
10379 +set only_screen_axo 1
10380 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/moddata_2/bug26_1 OCCT-6.8.0_SRC-patch/tests/bugs/moddata_2/bug26_1
10381 --- OCCT-6.8.0_SRC/tests/bugs/moddata_2/bug26_1 2014-11-11 17:47:35.000000000 +0300
10382 +++ OCCT-6.8.0_SRC-patch/tests/bugs/moddata_2/bug26_1   2015-01-16 13:00:39.000000000 +0300
10383 @@ -1,3 +1,5 @@
10384 +puts "TODO CR25432 ALL: Error : The square of result shape is"
10385 +
10386  puts "================"
10387  puts "OCC26"
10388  puts "================"
10389 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/moddata_2/bug26_2 OCCT-6.8.0_SRC-patch/tests/bugs/moddata_2/bug26_2
10390 --- OCCT-6.8.0_SRC/tests/bugs/moddata_2/bug26_2 2014-11-11 17:47:35.000000000 +0300
10391 +++ OCCT-6.8.0_SRC-patch/tests/bugs/moddata_2/bug26_2   2015-01-16 13:00:39.000000000 +0300
10392 @@ -1,3 +1,5 @@
10393 +puts "TODO CR25432 ALL: Error : The square of result shape is"
10394 +
10395  puts "================"
10396  puts "OCC26"
10397  puts "================"
10398 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/moddata_3/bug25494 OCCT-6.8.0_SRC-patch/tests/bugs/moddata_3/bug25494
10399 --- OCCT-6.8.0_SRC/tests/bugs/moddata_3/bug25494        1970-01-01 03:00:00.000000000 +0300
10400 +++ OCCT-6.8.0_SRC-patch/tests/bugs/moddata_3/bug25494  2015-01-16 13:00:40.000000000 +0300
10401 @@ -0,0 +1,14 @@
10402 +puts "================"
10403 +puts "OCC25494"
10404 +puts "================"
10405 +puts ""
10406 +#######################################################################
10407 +# Wrong result obtained by projection algorithm
10408 +#######################################################################
10409 +
10410 +restore [locate_data_file bug25494_s.draw] s
10411 +restore [locate_data_file bug25494_c.draw] c
10412 +
10413 +project c2d c s
10414 +
10415 +dump c2d
10416 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/vis/bug25492 OCCT-6.8.0_SRC-patch/tests/bugs/vis/bug25492
10417 --- OCCT-6.8.0_SRC/tests/bugs/vis/bug25492      1970-01-01 03:00:00.000000000 +0300
10418 +++ OCCT-6.8.0_SRC-patch/tests/bugs/vis/bug25492        2015-01-16 13:00:41.000000000 +0300
10419 @@ -0,0 +1,32 @@
10420 +puts "============"
10421 +puts "CR25492"
10422 +puts "============"
10423 +puts ""
10424 +#######################################################################
10425 +# The selected subshape does not have topological relationship
10426 +# with orginal shape in OCC680
10427 +#######################################################################
10428 +pload ALL
10429 +
10430 +set isEqual 0
10431 +vinit
10432 +box aShape 5 5 5 3 3 3
10433 +vdisplay aShape
10434 +vfit
10435 +vselmode 4 1
10436 +vselect 100 200
10437 +vpickselected aSub
10438 +explode aShape F
10439 +
10440 +
10441 +for {set i 1} {$i <= 6 } {incr i} {
10442 +  set aRes [compare aShape_$i aSub];
10443 +  if { [lsearch $aRes equal] != -1} {
10444 +    set isEqual 1
10445 +  }
10446 +}
10447 +
10448 +if {$isEqual == 0} {
10449 +puts "Error: No selected sub-shape was found in exploded sub-shapes"
10450 +}
10451 +set only_screen 1
10452 diff -Naur --exclude=CVS --exclude=.git OCCT-6.8.0_SRC/tests/bugs/vis/bug25528 OCCT-6.8.0_SRC-patch/tests/bugs/vis/bug25528
10453 --- OCCT-6.8.0_SRC/tests/bugs/vis/bug25528      1970-01-01 03:00:00.000000000 +0300
10454 +++ OCCT-6.8.0_SRC-patch/tests/bugs/vis/bug25528        2015-01-16 13:00:41.000000000 +0300
10455 @@ -0,0 +1,25 @@
10456 +puts "============"
10457 +puts "OCC25528"
10458 +puts "============"
10459 +puts ""
10460 +####################################################################################
10461 +# Visualization - Exception on removing an interactive object from 
10462 +# a local context
10463 +# vremove -local <obj_name> crashes if there is an opened local context
10464 +####################################################################################
10465 +
10466 +pload ALL
10467 +box b 1 2 3
10468 +vinit
10469 +vdisplay b
10470 +vfit
10471 +
10472 +# opening a local context for local selection
10473 +vselmode b 4 1
10474 +# Select a face just to simulate the scenario used in a real application
10475 +vselect 200 200
10476 +# This line should not lead to exception
10477 +vremove -local b
10478 +
10479 +# Screenshot should be empty (box removed successfully)
10480 +vdump ${imagedir}/${casename}.png