+ Replace OCC_HEX_VERSION with OCC_VERSION_HEX

This commit is contained in:
wmayer 2014-07-18 14:51:54 +02:00
parent c4bd838c55
commit 80cc2e4710
5 changed files with 9 additions and 15 deletions

View File

@ -84,11 +84,5 @@
#include <Standard_Version.hxx> #include <Standard_Version.hxx>
#endif #endif
#if defined(OCC_VERSION_MAJOR) && defined(OCC_VERSION_MINOR) && defined(OCC_VERSION_MAINTENANCE)
# define OCC_HEX_VERSION ((OCC_VERSION_MAJOR<<16)+(OCC_VERSION_MINOR<<8)+(OCC_VERSION_MAINTENANCE))
#else
# define OCC_HEX_VERSION 0x050000 // use an old version
#endif
#endif #endif

View File

@ -282,7 +282,7 @@ App::DocumentObjectExecReturn *Plane::execute(void)
case BRepBuilderAPI_ParametersOutOfRange: case BRepBuilderAPI_ParametersOutOfRange:
error = "parameters out of range"; error = "parameters out of range";
break; break;
#if OCC_HEX_VERSION < 0x060500 #if OCC_VERSION_HEX < 0x060500
case BRepBuilderAPI_SurfaceNotC2: case BRepBuilderAPI_SurfaceNotC2:
error = "surface not C2"; error = "surface not C2";
break; break;

View File

@ -183,7 +183,7 @@ const char* BRepBuilderAPI_FaceErrorText(BRepBuilderAPI_FaceError et)
return "Curve projection failed"; return "Curve projection failed";
case BRepBuilderAPI_ParametersOutOfRange: case BRepBuilderAPI_ParametersOutOfRange:
return "Parameters out of range"; return "Parameters out of range";
#if OCC_HEX_VERSION < 0x060500 #if OCC_VERSION_HEX < 0x060500
case BRepBuilderAPI_SurfaceNotC2: case BRepBuilderAPI_SurfaceNotC2:
return "Surface not C2-continous"; return "Surface not C2-continous";
#endif #endif
@ -620,16 +620,16 @@ void TopoShape::importBrep(const char *FileName)
// read brep-file // read brep-file
BRep_Builder aBuilder; BRep_Builder aBuilder;
TopoDS_Shape aShape; TopoDS_Shape aShape;
#if OCC_HEX_VERSION >= 0x060300 #if OCC_VERSION_HEX >= 0x060300
Handle_Message_ProgressIndicator pi = new ProgressIndicator(100); Handle_Message_ProgressIndicator pi = new ProgressIndicator(100);
pi->NewScope(100, "Reading BREP file..."); pi->NewScope(100, "Reading BREP file...");
pi->Show(); pi->Show();
QString fn = QString::fromUtf8(FileName); QString fn = QString::fromUtf8(FileName);
BRepTools::Read(aShape,(const char*)fn.toLocal8Bit(),aBuilder,pi); BRepTools::Read(aShape,(const char*)fn.toLocal8Bit(),aBuilder,pi);
pi->EndScope(); pi->EndScope();
#else #else
BRepTools::Read(aShape,(const Standard_CString)FileName,aBuilder); BRepTools::Read(aShape,(const Standard_CString)FileName,aBuilder);
#endif #endif
this->_Shape = aShape; this->_Shape = aShape;
} }
catch (Standard_Failure) { catch (Standard_Failure) {
@ -644,7 +644,7 @@ void TopoShape::importBrep(std::istream& str)
// read brep-file // read brep-file
BRep_Builder aBuilder; BRep_Builder aBuilder;
TopoDS_Shape aShape; TopoDS_Shape aShape;
#if OCC_HEX_VERSION >= 0x060300 #if OCC_VERSION_HEX >= 0x060300
Handle_Message_ProgressIndicator pi = new ProgressIndicator(100); Handle_Message_ProgressIndicator pi = new ProgressIndicator(100);
pi->NewScope(100, "Reading BREP file..."); pi->NewScope(100, "Reading BREP file...");
pi->Show(); pi->Show();

View File

@ -215,7 +215,7 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
case BRepBuilderAPI_ParametersOutOfRange: case BRepBuilderAPI_ParametersOutOfRange:
Standard_Failure::Raise("Parameters out of range"); Standard_Failure::Raise("Parameters out of range");
break; break;
#if OCC_HEX_VERSION < 0x060500 #if OCC_VERSION_HEX < 0x060500
case BRepBuilderAPI_SurfaceNotC2: case BRepBuilderAPI_SurfaceNotC2:
Standard_Failure::Raise("Surface not C2"); Standard_Failure::Raise("Surface not C2");
break; break;

View File

@ -155,7 +155,7 @@ PyObject* TopoShapeShellPy::getFreeEdges(PyObject *args)
return NULL; return NULL;
ShapeAnalysis_Shell as; ShapeAnalysis_Shell as;
as.LoadShells(getTopoShapePtr()->_Shape); as.LoadShells(getTopoShapePtr()->_Shape);
#if OCC_HEX_VERSION < 0x060500 #if OCC_VERSION_HEX < 0x060500
as.CheckOrientedShells(getTopoShapePtr()->_Shape, Standard_True); as.CheckOrientedShells(getTopoShapePtr()->_Shape, Standard_True);
#else #else
as.CheckOrientedShells(getTopoShapePtr()->_Shape, Standard_True, Standard_True); as.CheckOrientedShells(getTopoShapePtr()->_Shape, Standard_True, Standard_True);
@ -170,7 +170,7 @@ PyObject* TopoShapeShellPy::getBadEdges(PyObject *args)
return NULL; return NULL;
ShapeAnalysis_Shell as; ShapeAnalysis_Shell as;
as.LoadShells(getTopoShapePtr()->_Shape); as.LoadShells(getTopoShapePtr()->_Shape);
#if OCC_HEX_VERSION < 0x060500 #if OCC_VERSION_HEX < 0x060500
as.CheckOrientedShells(getTopoShapePtr()->_Shape, Standard_True); as.CheckOrientedShells(getTopoShapePtr()->_Shape, Standard_True);
#else #else
as.CheckOrientedShells(getTopoShapePtr()->_Shape, Standard_True, Standard_True); as.CheckOrientedShells(getTopoShapePtr()->_Shape, Standard_True, Standard_True);