0030153: Visualization, TKOpenGl - AIS_ColoredShape::SynchronizeAspects() doesn't...
[occt.git] / src / ChFi3d / ChFi3d_FilBuilder_C3.cxx
old mode 100755 (executable)
new mode 100644 (file)
index b2e31b4..732c6cf
 // Created on: 1995-04-26
 // Created by: Modelistation
 // Copyright (c) 1995-1999 Matra Datavision
-// Copyright (c) 1999-2012 OPEN CASCADE SAS
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
 //
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
 //
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
 //
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 
-
-#include <ChFi3d_FilBuilder.jxx>
-#include <ChFi3d_Builder_0.hxx>
+#include <Adaptor3d_CurveOnSurface.hxx>
+#include <Adaptor3d_HSurface.hxx>
+#include <Adaptor3d_TopolTool.hxx>
+#include <BRepAdaptor_Curve.hxx>
+#include <BRepAdaptor_HCurve.hxx>
+#include <BRepAdaptor_HCurve2d.hxx>
+#include <BRepAdaptor_HSurface.hxx>
+#include <BRepAdaptor_Surface.hxx>
+#include <BRepBlend_ConstRad.hxx>
+#include <BRepBlend_ConstRadInv.hxx>
+#include <BRepBlend_EvolRad.hxx>
+#include <BRepBlend_EvolRadInv.hxx>
+#include <BRepBlend_Line.hxx>
+#include <BRepTopAdaptor_TopolTool.hxx>
 #include <ChFi3d.hxx>
-
-#include <Precision.hxx>
-
-#include <Standard_Failure.hxx>
-#include <Standard_NotImplemented.hxx>
-#include <TColStd_ListOfInteger.hxx>
-
-#include <math_Vector.hxx>
-
-#include <gp_Pnt.hxx>
-#include <gp_Vec.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Pnt2d.hxx>
-#include <gp_Ax2.hxx>
-#include <gp_Ax3.hxx>
-#include <gp_Lin.hxx>
+#include <ChFi3d_Builder_0.hxx>
+#include <ChFi3d_FilBuilder.hxx>
+#include <ChFiDS_CommonPoint.hxx>
+#include <ChFiDS_FaceInterference.hxx>
+#include <ChFiDS_HData.hxx>
+#include <ChFiDS_HElSpine.hxx>
+#include <ChFiDS_ListIteratorOfListOfStripe.hxx>
+#include <ChFiDS_Regul.hxx>
+#include <ChFiDS_SequenceOfSurfData.hxx>
+#include <ChFiDS_Spine.hxx>
+#include <ChFiDS_Stripe.hxx>
+#include <ChFiDS_SurfData.hxx>
+#include <ChFiKPart_ComputeData.hxx>
 #include <ElCLib.hxx>
 #include <ElSLib.hxx>
-
-#include <TColgp_Array1OfPnt2d.hxx>
-
-#include <Geom_Plane.hxx>
-#include <Geom_Circle.hxx>
-#include <Geom_BezierCurve.hxx>
 #include <Geom2d_BezierCurve.hxx>
 #include <Geom2d_Curve.hxx>
-#include <Geom2d_TrimmedCurve.hxx>
 #include <Geom2d_Line.hxx>
-
-#include <IntAna_QuadQuadGeo.hxx>
-#include <IntCurveSurface_IntersectionPoint.hxx>
-
-#include <TopoDS.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Vertex.hxx>
-
-#include <Adaptor3d_HSurface.hxx>
-#include <Adaptor3d_CurveOnSurface.hxx>
-#include <Adaptor3d_TopolTool.hxx>
+#include <Geom2d_TrimmedCurve.hxx>
 #include <Geom2dAdaptor_Curve.hxx>
 #include <Geom2dAdaptor_HCurve.hxx>
+#include <Geom_BezierCurve.hxx>
+#include <Geom_BSplineSurface.hxx>
+#include <Geom_Circle.hxx>
+#include <Geom_Plane.hxx>
 #include <GeomAdaptor_Curve.hxx>
 #include <GeomAdaptor_HCurve.hxx>
-#include <GeomAdaptor_Surface.hxx>
 #include <GeomAdaptor_HSurface.hxx>
-#include <BRepAdaptor_Curve.hxx>
-#include <BRepAdaptor_HCurve.hxx>
-#include <BRepAdaptor_Surface.hxx>
-#include <BRepAdaptor_HSurface.hxx>
-#include <BRepTopAdaptor_TopolTool.hxx>
-
+#include <GeomAdaptor_Surface.hxx>
+#include <gp_Ax2.hxx>
+#include <gp_Ax3.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Lin.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Pnt2d.hxx>
+#include <gp_Vec.hxx>
+#include <gp_XY.hxx>
+#include <IntAna_QuadQuadGeo.hxx>
+#include <IntCurveSurface_IntersectionPoint.hxx>
+#include <Law_Function.hxx>
+#include <Law_S.hxx>
+#include <math_Vector.hxx>
+#include <Precision.hxx>
+#include <Standard_Failure.hxx>
+#include <Standard_NotImplemented.hxx>
+#include <TColgp_Array1OfPnt2d.hxx>
+#include <TColStd_ListOfInteger.hxx>
 #include <TopAbs.hxx>
 #include <TopAbs_Orientation.hxx>
-
-#include <ChFiDS_SurfData.hxx>
-#include <ChFiDS_CommonPoint.hxx>
-#include <ChFiDS_FaceInterference.hxx>
-#include <ChFiDS_Spine.hxx>
-#include <ChFiDS_SequenceOfSurfData.hxx>
-#include <ChFiDS_Stripe.hxx>
-#include <ChFiDS_HData.hxx>
-#include <ChFiDS_ListIteratorOfListOfStripe.hxx>
-#include <ChFiDS_Regul.hxx>
-
-#include <TopOpeBRepDS_HDataStructure.hxx>
-#include <TopOpeBRepDS_DataStructure.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
 #include <TopOpeBRepDS_Curve.hxx>
+#include <TopOpeBRepDS_DataStructure.hxx>
+#include <TopOpeBRepDS_HDataStructure.hxx>
 #include <TopOpeBRepDS_Surface.hxx>
 
-#include <ChFiKPart_ComputeData.hxx>
-#include <BRepBlend_Line.hxx>
-#include <BRepBlend_ConstRad.hxx>
-#include <BRepBlend_ConstRadInv.hxx>
-#include <BRepBlend_EvolRad.hxx>
-#include <BRepBlend_EvolRadInv.hxx>
-#include <Law_S.hxx>
-
 #ifdef DRAW
 #include <DrawTrSurf.hxx>
 #endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
 #include <Geom_TrimmedCurve.hxx>
 extern Standard_Boolean ChFi3d_GettraceDRAWSPINE();
 extern Standard_Boolean ChFi3d_GetcontextSPINEBEZIER();
@@ -228,7 +215,7 @@ static Standard_Boolean ToricCorner(const TopoDS_Face& F,
 void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
 {
   
-#ifdef DEB 
+#ifdef OCCT_DEBUG
   OSD_Chronometer ch;
   ChFi3d_InitChron(ch); // init perf initialisation 
 #endif 
@@ -296,7 +283,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
     // 3 concavities identic.
     pivot = SearchPivot(sens,p,tol2d);
     if(pivot < 0){ 
-#ifdef DEB
+#ifdef OCCT_DEBUG
       cout<<"pivot not found, plate is called"<<endl;
 #endif
       PerformMoreThreeCorner(Jndex, 3);
@@ -318,14 +305,14 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
   ifacdeb = CD[deb]->ChangeSetOfSurfData()->Value(i[deb][pivot])->Index(3-jf[deb][pivot]);
   ifacfin = CD[fin]->ChangeSetOfSurfData()->Value(i[fin][pivot])->Index(3-jf[fin][pivot]);
   if(ifacfin != ifacdeb){
-#ifdef DEB
+#ifdef OCCT_DEBUG
     cout<<"several base faces, plate is called"<<endl;
 #endif
     PerformMoreThreeCorner(Jndex, 3);
     return;
   }
   if(i[pivot][deb] != i[pivot][fin]){
-#ifdef DEB
+#ifdef OCCT_DEBUG
     cout<<"load surfdata on the pivot, plate is called"<<endl;
 #endif
     PerformMoreThreeCorner(Jndex, 3);
@@ -494,17 +481,17 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
     Interference(jf[pivot][fin]).PCurveOnSurf()->Value(p[pivot][fin]);
   
   done = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if(ChFi3d_GetcontextFORCEFILLING()) c1spheric = c1toric = 0;
 #endif
   
-#ifdef DEB 
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch , t_t3cornerinit); // result perf initialisations 
 #endif 
   
   if (c1toric){
     
-#ifdef DEB 
+#ifdef OCCT_DEBUG
     ChFi3d_InitChron(ch); // init perf case torus 
 #endif 
     
@@ -513,21 +500,21 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
     done = ChFiKPart_ComputeData::ComputeCorner
       (DStr,coin,Fac,Surf,oo1,oo2,o1,o2,Rdeb,Rdp,pfac1,pfac2,psurf1,psurf2);
     
-#ifdef DEB 
+#ifdef OCCT_DEBUG
     ChFi3d_ResultChron(ch , t_torique); // result perf case torus 
 #endif 
     
   }
   else if(c1spheric){
     
-#ifdef DEB   
+#ifdef OCCT_DEBUG
     ChFi3d_InitChron(ch); //init perf case sphere 
 #endif 
     
     done = ChFiKPart_ComputeData::ComputeCorner
       (DStr,coin,Fac,Surf,oo1,oo2,o1,o2,Rdp,pfac1,psurf1,psurf2);
     
-#ifdef DEB  
+#ifdef OCCT_DEBUG
     ChFi3d_ResultChron(ch , t_spherique);// result perf cas sphere 
 #endif 
     
@@ -538,7 +525,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
   if(!done){
     if(!filling) {
       
-#ifdef DEB   
+#ifdef OCCT_DEBUG
       ChFi3d_InitChron(ch);// init perf not filling 
 #endif
       
@@ -596,11 +583,11 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
        finv.Set(Rdeb,choix);
        Standard_Real TolGuide = cornerspine->Resolution(tolesp); 
        
-       Standard_Boolean intf = 3, intl = 3;
+       Standard_Integer intf = 3, intl = 3;
        done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
                           func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla,
                           0,0,1,Soldep,intf,intl,Gd1,Gd2,Gf1,Gf2,0,1);
-#ifdef DEB
+#ifdef OCCT_DEBUG
        if(ChFi3d_GetcontextFORCEFILLING()) done = 0;
 #endif
        if(done && Gf2){
@@ -618,11 +605,11 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
        func.Set(myShape);
        finv.Set(choix);
        Standard_Real TolGuide = cornerspine->Resolution(tolesp);
-       Standard_Boolean intf = 3, intl = 3;
+       Standard_Integer intf = 3, intl = 3;
        done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
                           func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla,
                           0,0,1,Soldep,intf,intl,Gd1,Gd2,Gf1,Gf2,0,1);
-#ifdef DEB
+#ifdef OCCT_DEBUG
        if(ChFi3d_GetcontextFORCEFILLING()) done = 0;
 #endif
        if(done && Gf2){
@@ -632,7 +619,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
        else filling = 1;
       }
       
-#ifdef DEB  
+#ifdef OCCT_DEBUG
       ChFi3d_ResultChron(ch , t_notfilling);// result perf not filling 
 #endif
       
@@ -640,7 +627,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
     
     if(filling) {
       
-#ifdef DEB    
+#ifdef OCCT_DEBUG
       ChFi3d_InitChron(ch); // init perf filling
 #endif
       
@@ -700,7 +687,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
                          Surf,PCurveOnPiv,fdpiv->Orientation(),0,
                          0,0,0,0);
       
-#ifdef DEB 
+#ifdef OCCT_DEBUG
       ChFi3d_ResultChron(ch , t_filling);// result perf filling 
 #endif 
       
@@ -716,7 +703,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
     // Update of 4 Stripes and the DS
     // -------------------------------------
     
-#ifdef DEB  
+#ifdef OCCT_DEBUG
     ChFi3d_InitChron(ch);// init perf update DS
 #endif 
     
@@ -924,7 +911,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
   corner->SetSolidIndex(CD[pivot]->SolidIndex());
   myListStripe.Append(corner);
   
-#ifdef DEB  
+#ifdef OCCT_DEBUG
   ChFi3d_ResultChron(ch , t_t3cornerDS);// result perf update DS
 #endif 
 }