DCQ : OCC 4.0 compatibilty

This commit is contained in:
dcq 2004-05-26 11:12:04 +00:00
parent 76f04deded
commit 82738c83d4
2 changed files with 17 additions and 4 deletions

View File

@ -2735,12 +2735,13 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::ImportIGES(const char* filename)
THROW_SALOME_CORBA_EXCEPTION("Error in reading import file", SALOME::BAD_PARAM); } THROW_SALOME_CORBA_EXCEPTION("Error in reading import file", SALOME::BAD_PARAM); }
MESSAGE("ImportIGES : all Geometry Transfer" << endl ) ; MESSAGE("ImportIGES : all Geometry Transfer" << endl ) ;
//OCC 5.1.2 porting #if OCC_VERSION_MAJOR >= 5
// aReader.Clear();
// aReader.TransferRoots(false);
aReader.ClearShapes(); aReader.ClearShapes();
aReader.TransferRoots(); aReader.TransferRoots();
#else
aReader.Clear();
aReader.TransferRoots(false);
#endif
MESSAGE("ImportIGES : count of shapes produced = " << aReader.NbShapes() << endl ); MESSAGE("ImportIGES : count of shapes produced = " << aReader.NbShapes() << endl );
TopoDS_Shape shape = aReader.OneShape(); TopoDS_Shape shape = aReader.OneShape();
@ -4891,7 +4892,11 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeFillet( GEOM::GEOM_Shape_ptr shape,
fill.Add(E); fill.Add(E);
} }
for (int i = 1;i<=fill.NbContours();i++) { for (int i = 1;i<=fill.NbContours();i++) {
#if OCC_VERSION_MAJOR >= 5
fill.SetRadius(radius,i,i); fill.SetRadius(radius,i,i);
#else
fill.SetRadius(radius,i);
#endif
} }
tds = fill.Shape(); tds = fill.Shape();
@ -4906,7 +4911,11 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeFillet( GEOM::GEOM_Shape_ptr shape,
} }
} }
for (int i = 1;i<=fill.NbContours();i++) { for (int i = 1;i<=fill.NbContours();i++) {
#if OCC_VERSION_MAJOR >= 5
fill.SetRadius(radius,i,i); fill.SetRadius(radius,i,i);
#else
fill.SetRadius(radius,i);
#endif
} }
tds = fill.Shape(); tds = fill.Shape();
} }

View File

@ -449,7 +449,11 @@ void OperationGUI_FilletDlg::MakePreview()
for(int i = 1; i <= fill.NbContours(); i++) { for(int i = 1; i <= fill.NbContours(); i++) {
try { try {
#if OCC_VERSION_MAJOR >= 5
fill.SetRadius(myRadius,i,i); fill.SetRadius(myRadius,i,i);
#else
fill.SetRadius(myRadius,i);
#endif
} }
catch(Standard_Failure) { catch(Standard_Failure) {
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();