From 9a148b08df103b34293218ec9432e263a6cf2b59 Mon Sep 17 00:00:00 2001 From: oan Date: Fri, 11 Jul 2014 11:02:27 +0400 Subject: [PATCH] Fix compilation errors for mfc samples. --- .../mfc/standard/01_Geometry/src/GeometryDoc.cpp | 2 +- samples/mfc/standard/01_Geometry/src/StdAfx.h | 2 +- samples/mfc/standard/07_Triangulation/src/StdAfx.h | 2 +- .../src/Tesselate_Presentation.cpp | 4 ++-- .../07_Triangulation/src/TriangulationDoc.cpp | 6 +++--- samples/mfc/standard/Common/User_Cylinder.cxx | 14 ++++++-------- src/StdPrs/StdPrs_ToolShadedShape.hxx | 10 +++++----- 7 files changed, 19 insertions(+), 21 deletions(-) diff --git a/samples/mfc/standard/01_Geometry/src/GeometryDoc.cpp b/samples/mfc/standard/01_Geometry/src/GeometryDoc.cpp index 0376c6bfc8..0a70fb4aca 100755 --- a/samples/mfc/standard/01_Geometry/src/GeometryDoc.cpp +++ b/samples/mfc/standard/01_Geometry/src/GeometryDoc.cpp @@ -1304,7 +1304,7 @@ void CGeometryDoc::simplify(const TopoDS_Shape& aShape) //and all the polygons on the triangulations of the edges BRepTools::Clean(aShape); // adds a triangulation of the shape aShape with the deflection aDeflection - BRepMesh::Mesh(aShape,aDeflection); + BRepMesh_IncrementalMesh(aShape,aDeflection); Standard_Integer aIndex = 1, nbNodes = 0; diff --git a/samples/mfc/standard/01_Geometry/src/StdAfx.h b/samples/mfc/standard/01_Geometry/src/StdAfx.h index 971d2d4267..9a0a9262b2 100755 --- a/samples/mfc/standard/01_Geometry/src/StdAfx.h +++ b/samples/mfc/standard/01_Geometry/src/StdAfx.h @@ -89,6 +89,7 @@ #include #include +#include #include #include #include @@ -100,7 +101,6 @@ #include #include #include -#include #include #include diff --git a/samples/mfc/standard/07_Triangulation/src/StdAfx.h b/samples/mfc/standard/07_Triangulation/src/StdAfx.h index c0541da06e..2386e70a4b 100755 --- a/samples/mfc/standard/07_Triangulation/src/StdAfx.h +++ b/samples/mfc/standard/07_Triangulation/src/StdAfx.h @@ -90,7 +90,6 @@ #include "BRepPrimAPI_MakeSphere.hxx" #include "gp_Pnt.hxx" #include "BRepAlgoAPI_Cut.hxx" -#include "BRepMesh.hxx" #include "TopExp_Explorer.hxx" #include "TopoDS_Face.hxx" #include "TopLoc_Location.hxx" @@ -108,6 +107,7 @@ #include "BRepBuilderAPI_MakeVertex.hxx" #include "TopoDS.hxx" #include "BRepTools.hxx" +#include "BRepMesh_IncrementalMesh.hxx" #include diff --git a/samples/mfc/standard/07_Triangulation/src/Tesselate_Presentation.cpp b/samples/mfc/standard/07_Triangulation/src/Tesselate_Presentation.cpp index d882bc07c4..277e9185b8 100755 --- a/samples/mfc/standard/07_Triangulation/src/Tesselate_Presentation.cpp +++ b/samples/mfc/standard/07_Triangulation/src/Tesselate_Presentation.cpp @@ -16,9 +16,9 @@ #include #include #include -#include #include #include +#include #include #include @@ -189,7 +189,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape) //========================================================================== BRepTools::Clean(aShape); - BRepMesh::Mesh(aShape,aDeflection); + BRepMesh_IncrementalMesh(aShape,aDeflection); BRep_Builder aBuilder,aBuild1,aBuild2; TopoDS_Compound aCompound,aComp1,aComp2; diff --git a/samples/mfc/standard/07_Triangulation/src/TriangulationDoc.cpp b/samples/mfc/standard/07_Triangulation/src/TriangulationDoc.cpp index 67d9008a01..598c70992c 100755 --- a/samples/mfc/standard/07_Triangulation/src/TriangulationDoc.cpp +++ b/samples/mfc/standard/07_Triangulation/src/TriangulationDoc.cpp @@ -81,7 +81,7 @@ void CTriangulationDoc::OnTriangu() TopoDS_Shape theBox = BRepPrimAPI_MakeBox(200,60,60); TopoDS_Shape theSphere = BRepPrimAPI_MakeSphere(gp_Pnt(100,20,20),80); TopoDS_Shape ShapeFused = BRepAlgoAPI_Fuse(theSphere,theBox); - BRepMesh::Mesh(ShapeFused,1); + BRepMesh_IncrementalMesh(ShapeFused,1); Handle (AIS_Shape) aSection = new AIS_Shape(ShapeFused); myAISContext->SetDisplayMode(aSection,1); @@ -139,7 +139,7 @@ void CTriangulationDoc::OnVisu() TopoDS_Shape theBox = BRepPrimAPI_MakeBox(200,60,60); TopoDS_Shape theSphere = BRepPrimAPI_MakeSphere(gp_Pnt(100,20,20),80); TopoDS_Shape ShapeFused = BRepAlgoAPI_Fuse(theSphere,theBox); -BRepMesh::Mesh(ShapeFused,1); +BRepMesh_IncrementalMesh(ShapeFused,1); Handle (AIS_Shape) aSection = new AIS_Shape(ShapeFused); myAISContext->SetDisplayMode(aSection,1); @@ -264,7 +264,7 @@ void CTriangulationDoc::OnClear() TopoDS_Shape theBox = BRepPrimAPI_MakeBox(200,60,60); TopoDS_Shape theSphere = BRepPrimAPI_MakeSphere(gp_Pnt(100,20,20),80); TopoDS_Shape ShapeFused = BRepAlgoAPI_Fuse(theSphere,theBox); -BRepMesh::Mesh(ShapeFused,1); +BRepMesh_IncrementalMesh(ShapeFused,1); Handle (AIS_Shape) aSection = new AIS_Shape(ShapeFused); diff --git a/samples/mfc/standard/Common/User_Cylinder.cxx b/samples/mfc/standard/Common/User_Cylinder.cxx index 7048c01947..c62dba8629 100755 --- a/samples/mfc/standard/Common/User_Cylinder.cxx +++ b/samples/mfc/standard/Common/User_Cylinder.cxx @@ -12,7 +12,6 @@ IMPLEMENT_STANDARD_RTTIEXT(User_Cylinder,AIS_InteractiveObject) #include #include #include -#include #include #include #include @@ -22,6 +21,7 @@ IMPLEMENT_STANDARD_RTTIEXT(User_Cylinder,AIS_InteractiveObject) #include #include #include +#include #include @@ -108,7 +108,7 @@ case 6: //color myAspect->SetEdgeOn(); myDeflection = AIS_Shape::GetDeflection(myShape,myDrawer); - BRepMesh::Mesh(myShape,myDeflection); + BRepMesh_IncrementalMesh(myShape,myDeflection); myX1OnOff = Standard_False; myXBlueOnOff = Standard_False; @@ -151,8 +151,6 @@ case 6: //color cout <<"Deflection = " << myDeflection << "\n" << endl; #endif - StdPrs_ToolShadedShape SST; - Standard_Integer NumFace; TopExp_Explorer ExpFace; @@ -191,7 +189,7 @@ case 6: //color { // triangles(nt).Get(n1,n2,n3); // le triangle est n1,n2,n3 - if (SST.Orientation(myFace) == TopAbs_REVERSED) // si la face est "reversed" + if (myFace.Orientation() == TopAbs_REVERSED) // si la face est "reversed" triangles(nt).Get(n1,n3,n2); // le triangle est n1,n3,n2 else triangles(nt).Get(n1,n2,n3); // le triangle est n1,n2,n3 @@ -242,7 +240,7 @@ case 6: //color const Poly_Array1OfTriangle& triangles = myT->Triangles(); TColgp_Array1OfDir myNormal(Nodes.Lower(), Nodes.Upper()); - SST.Normal(myFace, pc, myNormal); + StdPrs_ToolShadedShape::Normal(myFace, pc, myNormal); BRepTools::UVBounds(myFace,Umin, Umax, Vmin, Vmax); dUmax = (Umax - Umin); dVmax = (Vmax - Vmin); @@ -258,7 +256,7 @@ case 6: //color for (nt = 1; nt <= nnn; nt++) { // triangles(nt).Get(n1,n2,n3); // le triangle est n1,n2,n3 - if (SST.Orientation(myFace) == TopAbs_REVERSED) // si la face est "reversed" + if (myFace.Orientation() == TopAbs_REVERSED) // si la face est "reversed" triangles(nt).Get(n1,n3,n2); // le triangle est n1,n3,n2 else triangles(nt).Get(n1,n2,n3); // le triangle est n1,n2,n3 @@ -278,7 +276,7 @@ case 6: //color #ifdef DEBUG cout << "On traite actuellement le triangle : "<< nt <<"\n"; #endif - if (SST.Orientation(myFace) == TopAbs_REVERSED) // si la face est "reversed" + if (myFace.Orientation() == TopAbs_REVERSED) // si la face est "reversed" triangles(nt).Get(n1,n3,n2); // le triangle est n1,n3,n2 else triangles(nt).Get(n1,n2,n3); // le triangle est n1,n2,n3 diff --git a/src/StdPrs/StdPrs_ToolShadedShape.hxx b/src/StdPrs/StdPrs_ToolShadedShape.hxx index be0ae3272f..76d2a87477 100644 --- a/src/StdPrs/StdPrs_ToolShadedShape.hxx +++ b/src/StdPrs/StdPrs_ToolShadedShape.hxx @@ -34,14 +34,14 @@ public: //! Checks back faces visibility for specified shape (to activate back-face culling).
//! @return true if shape is closed Solid or compound of closed Solids.
- static Standard_Boolean IsClosed(const TopoDS_Shape& theShape); + Standard_EXPORT static Standard_Boolean IsClosed(const TopoDS_Shape& theShape); - static Handle_Poly_Triangulation Triangulation(const TopoDS_Face& aFace, + Standard_EXPORT static Handle_Poly_Triangulation Triangulation(const TopoDS_Face& aFace, TopLoc_Location& loc); - static void Normal(const TopoDS_Face& aFace, - Poly_Connect& PC, - TColgp_Array1OfDir& Nor); + Standard_EXPORT static void Normal(const TopoDS_Face& aFace, + Poly_Connect& PC, + TColgp_Array1OfDir& Nor); }; #endif