Porting samples for OCCT 6.5.2
authorbugmaster <>
Mon, 26 Sep 2011 12:45:55 +0000 (12:45 +0000)
committerbugmaster <bugmaster@opencascade.com>
Mon, 5 Mar 2012 15:30:29 +0000 (19:30 +0400)
samples/mfc/standard/01_Geometry/src/GeometryDoc.cpp
samples/mfc/standard/02_Modeling/src/ModelingDoc.cpp
samples/mfc/standard/04_Viewer3d/src/OCCDemo_Presentation.cpp
samples/mfc/standard/06_Ocaf/src/OcafDoc.cpp
samples/mfc/standard/07_Triangulation/src/OCCDemo_Presentation.cpp
samples/mfc/standard/09_Animation/src/AnimationDoc.cpp
samples/mfc/standard/10_Convert/src/OCCDemo_Presentation.cpp

index 1b418ef..7ed9335 100755 (executable)
@@ -924,7 +924,7 @@ void CGeometryDoc::OnCreateSol()
   
                if (sol.IsDone() == Standard_True){
                        Handle(Geom_BSplineSurface) GeomSol = sol.Surface();
   
                if (sol.IsDone() == Standard_True){
                        Handle(Geom_BSplineSurface) GeomSol = sol.Surface();
-                       TopoDS_Face aface = BRepBuilderAPI_MakeFace(GeomSol);
+                       TopoDS_Face aface = BRepBuilderAPI_MakeFace(GeomSol, Precision::Confusion());
                        if (!BRepAlgo::IsValid(aface))
                                MessageBox(AfxGetApp()->m_pMainWnd->m_hWnd,"Error : The plate surface is not valid!","CasCade Error",MB_ICONERROR);
                        Handle_AIS_Shape anAISShape=new AIS_Shape(aface);
                        if (!BRepAlgo::IsValid(aface))
                                MessageBox(AfxGetApp()->m_pMainWnd->m_hWnd,"Error : The plate surface is not valid!","CasCade Error",MB_ICONERROR);
                        Handle_AIS_Shape anAISShape=new AIS_Shape(aface);
@@ -1337,7 +1337,7 @@ Handle_AIS_InteractiveObject CGeometryDoc::drawSurface
   fixParam(v2);
 
   Handle_AIS_Shape aGraphicSurface = 
   fixParam(v2);
 
   Handle_AIS_Shape aGraphicSurface = 
-    new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2));
+    new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2, Precision::Confusion()));
 
   myAISContext->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
   myAISContext->SetColor(aGraphicSurface, theColor, toDisplay);
 
   myAISContext->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
   myAISContext->SetColor(aGraphicSurface, theColor, toDisplay);
index 04fbf39..47ff40d 100755 (executable)
@@ -1786,7 +1786,7 @@ void CModelingDoc::OnPrismLocal()
        aline = GCE2d_MakeLine(p1,p2).Value();
        MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));
        BRepBuilderAPI_MakeFace MKF;
        aline = GCE2d_MakeLine(p1,p2).Value();
        MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));
        BRepBuilderAPI_MakeFace MKF;
-       MKF.Init(surf,Standard_False);
+       MKF.Init(surf,Standard_False, Precision::Confusion());
        MKF.Add(MW.Wire());
        TopoDS_Shape FP = MKF.Face();
        BRepLib::BuildCurves3d(FP);
        MKF.Add(MW.Wire());
        TopoDS_Shape FP = MKF.Face();
        BRepLib::BuildCurves3d(FP);
@@ -1820,7 +1820,7 @@ void CModelingDoc::OnPrismLocal()
        aline = GCE2d_MakeLine(p1,p2).Value();
        MW2.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));
        BRepBuilderAPI_MakeFace MKF2;
        aline = GCE2d_MakeLine(p1,p2).Value();
        MW2.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));
        BRepBuilderAPI_MakeFace MKF2;
-       MKF2.Init(surf,Standard_False);
+       MKF2.Init(surf,Standard_False, Precision::Confusion());
        MKF2.Add(MW2.Wire());
        FP = MKF2.Face();
        BRepLib::BuildCurves3d(FP);
        MKF2.Add(MW2.Wire());
        FP = MKF2.Face();
        BRepLib::BuildCurves3d(FP);
@@ -1941,7 +1941,7 @@ void CModelingDoc::OnDprismLocal()
        MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,PI));
        MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,PI,2.*PI));
        BRepBuilderAPI_MakeFace MKF;
        MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,PI));
        MW.Add(BRepBuilderAPI_MakeEdge(aline,surf,PI,2.*PI));
        BRepBuilderAPI_MakeFace MKF;
-       MKF.Init(surf,Standard_False);
+       MKF.Init(surf,Standard_False, Precision::Confusion());
        MKF.Add(MW.Wire());
        TopoDS_Face FP = MKF.Face();
        BRepLib::BuildCurves3d(FP);
        MKF.Add(MW.Wire());
        TopoDS_Face FP = MKF.Face();
        BRepLib::BuildCurves3d(FP);
@@ -2034,7 +2034,7 @@ void CModelingDoc::OnRevolLocal()
        aline = GCE2d_MakeLine(p1,p2).Value();
        MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));
        BRepBuilderAPI_MakeFace MKF1;
        aline = GCE2d_MakeLine(p1,p2).Value();
        MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));
        BRepBuilderAPI_MakeFace MKF1;
-       MKF1.Init(surf,Standard_False);
+       MKF1.Init(surf,Standard_False, Precision::Confusion());
        MKF1.Add(MW1.Wire());
        TopoDS_Face FP = MKF1.Face();
        BRepLib::BuildCurves3d(FP);
        MKF1.Add(MW1.Wire());
        TopoDS_Face FP = MKF1.Face();
        BRepLib::BuildCurves3d(FP);
@@ -2290,7 +2290,7 @@ void CModelingDoc::OnPipeLocal()
        aline = GCE2d_MakeLine(p1,p2).Value();
        MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));
        BRepBuilderAPI_MakeFace MKF1;
        aline = GCE2d_MakeLine(p1,p2).Value();
        MW1.Add(BRepBuilderAPI_MakeEdge(aline,surf,0.,p1.Distance(p2)));
        BRepBuilderAPI_MakeFace MKF1;
-       MKF1.Init(surf,Standard_False);
+       MKF1.Init(surf,Standard_False, Precision::Confusion());
        MKF1.Add(MW1.Wire());
        TopoDS_Face FP = MKF1.Face();
        BRepLib::BuildCurves3d(FP);
        MKF1.Add(MW1.Wire());
        TopoDS_Face FP = MKF1.Face();
        BRepLib::BuildCurves3d(FP);
@@ -3038,7 +3038,7 @@ void CModelingDoc::OnFace()
        array.SetValue(3,2,P6);
        Handle (Geom_BSplineSurface) curve = GeomAPI_PointsToBSplineSurface(array,3,8,GeomAbs_C2,0.001);
 
        array.SetValue(3,2,P6);
        Handle (Geom_BSplineSurface) curve = GeomAPI_PointsToBSplineSurface(array,3,8,GeomAbs_C2,0.001);
 
-       RedFace = BRepBuilderAPI_MakeFace(curve);
+       RedFace = BRepBuilderAPI_MakeFace(curve, Precision::Confusion());
 
 ////////////////////
 
 
 ////////////////////
 
@@ -3075,7 +3075,7 @@ void CModelingDoc::OnFace()
        
        Handle (Geom_BSplineSurface) BSplineSurf = GeomAPI_PointsToBSplineSurface(array2,3,8,GeomAbs_C2,0.001);
        
        
        Handle (Geom_BSplineSurface) BSplineSurf = GeomAPI_PointsToBSplineSurface(array2,3,8,GeomAbs_C2,0.001);
        
-       TopoDS_Face aFace = BRepBuilderAPI_MakeFace(BSplineSurf);
+       TopoDS_Face aFace = BRepBuilderAPI_MakeFace(BSplineSurf, Precision::Confusion());
 
        //2d lines
        gp_Pnt2d P12d(0.9,0.1);
 
        //2d lines
        gp_Pnt2d P12d(0.9,0.1);
@@ -3262,7 +3262,7 @@ void CModelingDoc::OnShell()
        
        Handle (Geom_BSplineSurface) BSpline = new Geom_BSplineSurface(Poles,UKnots,VKnots,UMults,VMults,UDegree,VDegree);
        
        
        Handle (Geom_BSplineSurface) BSpline = new Geom_BSplineSurface(Poles,UKnots,VKnots,UMults,VMults,UDegree,VDegree);
        
-       TopoDS_Face WhiteFace = BRepBuilderAPI_MakeFace(BSpline);
+       TopoDS_Face WhiteFace = BRepBuilderAPI_MakeFace(BSpline, Precision::Confusion());
 
        
        Handle(AIS_Shape) white = new AIS_Shape(WhiteFace);
 
        
        Handle(AIS_Shape) white = new AIS_Shape(WhiteFace);
@@ -3400,7 +3400,7 @@ void CModelingDoc::OnSewing()
        gp_Vec V(0,0,1);
        Handle(Geom_Plane) Pi=new Geom_Plane(P,V);
        Handle(Geom_RectangularTrimmedSurface) GeometricSurface=new Geom_RectangularTrimmedSurface(Pi,0.,100.,0.,100.);
        gp_Vec V(0,0,1);
        Handle(Geom_Plane) Pi=new Geom_Plane(P,V);
        Handle(Geom_RectangularTrimmedSurface) GeometricSurface=new Geom_RectangularTrimmedSurface(Pi,0.,100.,0.,100.);
-       TopoDS_Shape FirstShape = BRepBuilderAPI_MakeFace(GeometricSurface);
+       TopoDS_Shape FirstShape = BRepBuilderAPI_MakeFace(GeometricSurface, Precision::Confusion());
        
        Handle(AIS_Shape) white1 = new AIS_Shape(FirstShape);
        
        
        Handle(AIS_Shape) white1 = new AIS_Shape(FirstShape);
        
@@ -3426,7 +3426,7 @@ void CModelingDoc::OnSewing()
        Array.SetValue(3,2,P6);
 
        Handle (Geom_BSplineSurface) aSurf = GeomAPI_PointsToBSplineSurface(Array,3,8,GeomAbs_C2,0.00001);
        Array.SetValue(3,2,P6);
 
        Handle (Geom_BSplineSurface) aSurf = GeomAPI_PointsToBSplineSurface(Array,3,8,GeomAbs_C2,0.00001);
-       TopoDS_Shape SecondShape = BRepBuilderAPI_MakeFace(aSurf);
+       TopoDS_Shape SecondShape = BRepBuilderAPI_MakeFace(aSurf, Precision::Confusion());
        
        Handle(AIS_Shape) white2 = new AIS_Shape(SecondShape);
        
        
        Handle(AIS_Shape) white2 = new AIS_Shape(SecondShape);
        
@@ -4083,7 +4083,7 @@ void CModelingDoc::OnGeometrie()
        gp_Vec V(0,0,1);
        Handle(Geom_Plane) Pi=new Geom_Plane(P,V);
        Handle(Geom_RectangularTrimmedSurface) Surface=new Geom_RectangularTrimmedSurface(Pi,0.,100.,0.,100.);
        gp_Vec V(0,0,1);
        Handle(Geom_Plane) Pi=new Geom_Plane(P,V);
        Handle(Geom_RectangularTrimmedSurface) Surface=new Geom_RectangularTrimmedSurface(Pi,0.,100.,0.,100.);
-       TopoDS_Face RedFace = BRepBuilderAPI_MakeFace(Surface);
+       TopoDS_Face RedFace = BRepBuilderAPI_MakeFace(Surface, Precision::Confusion());
 
        Handle(AIS_Shape) red = new AIS_Shape(RedFace);
        myAISContext->SetColor(red,Quantity_NOC_RED,Standard_False);
 
        Handle(AIS_Shape) red = new AIS_Shape(RedFace);
        myAISContext->SetColor(red,Quantity_NOC_RED,Standard_False);
@@ -4440,7 +4440,7 @@ void CModelingDoc::OnSurface()
        fill.Init(C1,C2,C3,C4,GeomFill_CoonsStyle);
        Handle(Geom_BSplineSurface) BSS = fill.Surface();
 
        fill.Init(C1,C2,C3,C4,GeomFill_CoonsStyle);
        Handle(Geom_BSplineSurface) BSS = fill.Surface();
 
-       TopoDS_Shape S = BRepBuilderAPI_MakeFace(BSS).Face();
+       TopoDS_Shape S = BRepBuilderAPI_MakeFace(BSS, Precision::Confusion()).Face();
 
        Handle(AIS_Shape) ais1 = new AIS_Shape(S);
        myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); 
 
        Handle(AIS_Shape) ais1 = new AIS_Shape(S);
        myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False); 
index b1280d1..a0b2baa 100755 (executable)
@@ -90,7 +90,7 @@ Handle_AIS_InteractiveObject OCCDemo_Presentation::drawSurface
   fixParam(v2);
 
   Handle_AIS_Shape aGraphicSurface = 
   fixParam(v2);
 
   Handle_AIS_Shape aGraphicSurface = 
-    new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2));
+    new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2, Precision::Confusion()));
 
   getAISContext()->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
   getAISContext()->SetColor(aGraphicSurface, theColor, toDisplay);
 
   getAISContext()->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
   getAISContext()->SetColor(aGraphicSurface, theColor, toDisplay);
index 26c8b03..75234c6 100755 (executable)
@@ -1132,8 +1132,8 @@ BOOL COcafDoc::OnOpenDocument(LPCTSTR lpszPathName)
        PathName=lpszPathName;
 
        // open the document in the current application
        PathName=lpszPathName;
 
        // open the document in the current application
-
-       CDF_RetrievableStatus RS = m_App->Open(TPath,myOcafDoc);
+       PCDM_ReaderStatus RS = m_App->Open(TPath,myOcafDoc);
+//     CDF_RetrievableStatus RS = m_App->Open(TPath,myOcafDoc);
 
        //connect the document CAF (myDoc) with the AISContext (myAISContext)
 //     TPrsStd_AISViewer::Has(myOcafDoc->Main());
 
        //connect the document CAF (myDoc) with the AISContext (myAISContext)
 //     TPrsStd_AISViewer::Has(myOcafDoc->Main());
index ba3c7c3..3732e01 100755 (executable)
@@ -91,7 +91,7 @@ Handle_AIS_InteractiveObject OCCDemo_Presentation::drawSurface
   fixParam(v2);
 
   Handle_AIS_Shape aGraphicSurface = 
   fixParam(v2);
 
   Handle_AIS_Shape aGraphicSurface = 
-    new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2));
+    new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2, Precision::Confusion()));
 
   getAISContext()->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
   getAISContext()->SetColor(aGraphicSurface, theColor, toDisplay);
 
   getAISContext()->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
   getAISContext()->SetColor(aGraphicSurface, theColor, toDisplay);
index 3c527c4..02693a6 100755 (executable)
@@ -392,7 +392,7 @@ void CAnimationDoc::OnFileLoadgrid()
          gp_Trsf T;
          T.SetTranslation(V);
          mySurface->Transform(T);
          gp_Trsf T;
          T.SetTranslation(V);
          mySurface->Transform(T);
-         BRepBuilderAPI_MakeFace aMkFace(mySurface);
+         BRepBuilderAPI_MakeFace aMkFace(mySurface, Precision::Confusion());
          myFace = aMkFace.Face();
 
          // Remove all other shapes
          myFace = aMkFace.Face();
 
          // Remove all other shapes
index b8e9129..391571d 100755 (executable)
@@ -90,7 +90,7 @@ Handle_AIS_InteractiveObject OCCDemo_Presentation::drawSurface
   fixParam(v2);
 
   Handle_AIS_Shape aGraphicSurface = 
   fixParam(v2);
 
   Handle_AIS_Shape aGraphicSurface = 
-    new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2));
+    new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2, Precision::Confusion()));
 
   getAISContext()->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
   getAISContext()->SetColor(aGraphicSurface, theColor, toDisplay);
 
   getAISContext()->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay);
   getAISContext()->SetColor(aGraphicSurface, theColor, toDisplay);