Skip to content

Commit

Permalink
+ Replace OCC_HEX_VERSION with OCC_VERSION_HEX
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jul 18, 2014
1 parent c4bd838 commit 80cc2e4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
6 changes: 0 additions & 6 deletions src/Mod/Part/App/PreCompiled.h
Expand Up @@ -84,11 +84,5 @@
#include <Standard_Version.hxx>
#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
2 changes: 1 addition & 1 deletion src/Mod/Part/App/PrimitiveFeature.cpp
Expand Up @@ -282,7 +282,7 @@ App::DocumentObjectExecReturn *Plane::execute(void)
case BRepBuilderAPI_ParametersOutOfRange:
error = "parameters out of range";
break;
#if OCC_HEX_VERSION < 0x060500
#if OCC_VERSION_HEX < 0x060500
case BRepBuilderAPI_SurfaceNotC2:
error = "surface not C2";
break;
Expand Down
10 changes: 5 additions & 5 deletions src/Mod/Part/App/TopoShape.cpp
Expand Up @@ -183,7 +183,7 @@ const char* BRepBuilderAPI_FaceErrorText(BRepBuilderAPI_FaceError et)
return "Curve projection failed";
case BRepBuilderAPI_ParametersOutOfRange:
return "Parameters out of range";
#if OCC_HEX_VERSION < 0x060500
#if OCC_VERSION_HEX < 0x060500
case BRepBuilderAPI_SurfaceNotC2:
return "Surface not C2-continous";
#endif
Expand Down Expand Up @@ -620,16 +620,16 @@ void TopoShape::importBrep(const char *FileName)
// read brep-file
BRep_Builder aBuilder;
TopoDS_Shape aShape;
#if OCC_HEX_VERSION >= 0x060300
#if OCC_VERSION_HEX >= 0x060300
Handle_Message_ProgressIndicator pi = new ProgressIndicator(100);
pi->NewScope(100, "Reading BREP file...");
pi->Show();
QString fn = QString::fromUtf8(FileName);
BRepTools::Read(aShape,(const char*)fn.toLocal8Bit(),aBuilder,pi);
pi->EndScope();
#else
#else
BRepTools::Read(aShape,(const Standard_CString)FileName,aBuilder);
#endif
#endif
this->_Shape = aShape;
}
catch (Standard_Failure) {
Expand All @@ -644,7 +644,7 @@ void TopoShape::importBrep(std::istream& str)
// read brep-file
BRep_Builder aBuilder;
TopoDS_Shape aShape;
#if OCC_HEX_VERSION >= 0x060300
#if OCC_VERSION_HEX >= 0x060300
Handle_Message_ProgressIndicator pi = new ProgressIndicator(100);
pi->NewScope(100, "Reading BREP file...");
pi->Show();
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Part/App/TopoShapeFacePyImp.cpp
Expand Up @@ -215,7 +215,7 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
case BRepBuilderAPI_ParametersOutOfRange:
Standard_Failure::Raise("Parameters out of range");
break;
#if OCC_HEX_VERSION < 0x060500
#if OCC_VERSION_HEX < 0x060500
case BRepBuilderAPI_SurfaceNotC2:
Standard_Failure::Raise("Surface not C2");
break;
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Part/App/TopoShapeShellPyImp.cpp
Expand Up @@ -155,7 +155,7 @@ PyObject* TopoShapeShellPy::getFreeEdges(PyObject *args)
return NULL;
ShapeAnalysis_Shell as;
as.LoadShells(getTopoShapePtr()->_Shape);
#if OCC_HEX_VERSION < 0x060500
#if OCC_VERSION_HEX < 0x060500
as.CheckOrientedShells(getTopoShapePtr()->_Shape, Standard_True);
#else
as.CheckOrientedShells(getTopoShapePtr()->_Shape, Standard_True, Standard_True);
Expand All @@ -170,7 +170,7 @@ PyObject* TopoShapeShellPy::getBadEdges(PyObject *args)
return NULL;
ShapeAnalysis_Shell as;
as.LoadShells(getTopoShapePtr()->_Shape);
#if OCC_HEX_VERSION < 0x060500
#if OCC_VERSION_HEX < 0x060500
as.CheckOrientedShells(getTopoShapePtr()->_Shape, Standard_True);
#else
as.CheckOrientedShells(getTopoShapePtr()->_Shape, Standard_True, Standard_True);
Expand Down

0 comments on commit 80cc2e4

Please sign in to comment.