Skip to content

Commit

Permalink
+ Fix compiler warnings with OCC 6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Dec 5, 2013
1 parent eb5cc8e commit d62ed23
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 34 deletions.
6 changes: 3 additions & 3 deletions src/Mod/Part/App/ArcOfCirclePyImp.cpp
Expand Up @@ -78,12 +78,12 @@ int ArcOfCirclePy::PyInit(PyObject* args, PyObject* kwds)
{
PyObject* o;
double u1, u2;
int sense=1;
if (PyArg_ParseTuple(args, "O!dd|i", &(Part::CirclePy::Type), &o, &u1, &u2, &sense)) {
PyObject *sense=Py_True;
if (PyArg_ParseTuple(args, "O!dd|O!", &(Part::CirclePy::Type), &o, &u1, &u2, &PyBool_Type, &sense)) {
try {
Handle_Geom_Circle circle = Handle_Geom_Circle::DownCast
(static_cast<CirclePy*>(o)->getGeomCirclePtr()->handle());
GC_MakeArcOfCircle arc(circle->Circ(), u1, u2, sense);
GC_MakeArcOfCircle arc(circle->Circ(), u1, u2, PyObject_IsTrue(sense) ? Standard_True : Standard_False);
if (!arc.IsDone()) {
PyErr_SetString(PyExc_Exception, gce_ErrorStatusText(arc.Status()));
return -1;
Expand Down
10 changes: 5 additions & 5 deletions src/Mod/Part/App/ArcPyImp.cpp
Expand Up @@ -61,12 +61,12 @@ int ArcPy::PyInit(PyObject* args, PyObject* /*kwd*/)
{
PyObject* o;
double u1, u2;
int sense=1;
if (PyArg_ParseTuple(args, "O!dd|i", &(Part::CirclePy::Type), &o, &u1, &u2, &sense)) {
PyObject *sense=Py_True;
if (PyArg_ParseTuple(args, "O!dd|O!", &(Part::CirclePy::Type), &o, &u1, &u2, &PyBool_Type, &sense)) {
try {
Handle_Geom_Circle circle = Handle_Geom_Circle::DownCast
(static_cast<CirclePy*>(o)->getGeomCirclePtr()->handle());
GC_MakeArcOfCircle arc(circle->Circ(), u1, u2, sense);
GC_MakeArcOfCircle arc(circle->Circ(), u1, u2, PyObject_IsTrue(sense) ? Standard_True : Standard_False);
if (!arc.IsDone()) {
PyErr_SetString(PyExc_Exception, gce_ErrorStatusText(arc.Status()));
return -1;
Expand Down Expand Up @@ -108,11 +108,11 @@ int ArcPy::PyInit(PyObject* args, PyObject* /*kwd*/)
}

PyErr_Clear();
if (PyArg_ParseTuple(args, "O!dd|i", &(Part::EllipsePy::Type), &o, &u1, &u2, &sense)) {
if (PyArg_ParseTuple(args, "O!dd|O!", &(Part::EllipsePy::Type), &o, &u1, &u2, &PyBool_Type, &sense)) {
try {
Handle_Geom_Ellipse ellipse = Handle_Geom_Ellipse::DownCast
(static_cast<EllipsePy*>(o)->getGeomEllipsePtr()->handle());
GC_MakeArcOfEllipse arc(ellipse->Elips(), u1, u2, sense);
GC_MakeArcOfEllipse arc(ellipse->Elips(), u1, u2, PyObject_IsTrue(sense) ? Standard_True : Standard_False);
if (!arc.IsDone()) {
PyErr_SetString(PyExc_Exception, gce_ErrorStatusText(arc.Status()));
return -1;
Expand Down
10 changes: 8 additions & 2 deletions src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp
Expand Up @@ -121,7 +121,11 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setAuxiliarySpine(PyObject *args)
PyErr_SetString(PyExc_TypeError, "spine is not a wire");
return 0;
}
this->getBRepOffsetAPI_MakePipeShellPtr()->SetMode(TopoDS::Wire(s), PyObject_IsTrue(curv), PyObject_IsTrue(keep));

this->getBRepOffsetAPI_MakePipeShellPtr()->SetMode(
TopoDS::Wire(s),
PyObject_IsTrue(curv) ? Standard_True : Standard_False,
PyObject_IsTrue(keep) ? Standard_True : Standard_False);
Py_Return;
}

Expand All @@ -133,7 +137,9 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args)
,&PyBool_Type,&keep))
return 0;
const TopoDS_Shape& s = static_cast<Part::TopoShapePy*>(prof)->getTopoShapePtr()->_Shape;
this->getBRepOffsetAPI_MakePipeShellPtr()->Add(s, PyObject_IsTrue(curv), PyObject_IsTrue(keep));
this->getBRepOffsetAPI_MakePipeShellPtr()->Add(s,
PyObject_IsTrue(curv) ? Standard_True : Standard_False,
PyObject_IsTrue(keep) ? Standard_True : Standard_False);
Py_Return;
}

Expand Down
12 changes: 8 additions & 4 deletions src/Mod/Part/App/BSplineCurvePyImp.cpp
Expand Up @@ -183,7 +183,7 @@ PyObject* BSplineCurvePy::insertKnot(PyObject * args)
try {
Handle_Geom_BSplineCurve curve = Handle_Geom_BSplineCurve::DownCast
(getGeometryPtr()->handle());
curve->InsertKnot(U,M,tol,PyObject_IsTrue(add));
curve->InsertKnot(U,M,tol,PyObject_IsTrue(add) ? Standard_True : Standard_False);
}
catch (Standard_Failure) {
Handle_Standard_Failure e = Standard_Failure::Caught();
Expand Down Expand Up @@ -223,7 +223,7 @@ PyObject* BSplineCurvePy::insertKnots(PyObject * args)

Handle_Geom_BSplineCurve curve = Handle_Geom_BSplineCurve::DownCast
(getGeometryPtr()->handle());
curve->InsertKnots(k,m,tol,PyObject_IsTrue(add));
curve->InsertKnots(k,m,tol,PyObject_IsTrue(add) ? Standard_True : Standard_False);
Py_Return;
}
catch (Standard_Failure) {
Expand Down Expand Up @@ -763,7 +763,8 @@ PyObject* BSplineCurvePy::interpolate(PyObject *args)
Standard_Failure::Raise("not enough points given");
}

GeomAPI_Interpolate aBSplineInterpolation(interpolationPoints, PyObject_IsTrue(periodic), tol3d);
GeomAPI_Interpolate aBSplineInterpolation(interpolationPoints,
PyObject_IsTrue(periodic) ? Standard_True : Standard_False, tol3d);
if (t1 && t2) {
Base::Vector3d v1 = Py::Vector(t1,false).toVector();
Base::Vector3d v2 = Py::Vector(t2,false).toVector();
Expand Down Expand Up @@ -991,7 +992,10 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *key
Standard_Failure::Raise("number of poles and sum of mults mismatch");
return(0);
}
Handle_Geom_BSplineCurve spline = new Geom_BSplineCurve(occpoles,occweights,occknots,occmults,degree,PyObject_IsTrue(periodic),PyObject_IsTrue(CheckRational));

Handle_Geom_BSplineCurve spline = new Geom_BSplineCurve(occpoles,occweights,occknots,occmults,degree,
PyObject_IsTrue(periodic) ? Standard_True : Standard_False,
PyObject_IsTrue(CheckRational) ? Standard_True : Standard_False);
if (!spline.IsNull()) {
this->getGeomBSplineCurvePtr()->setHandle(spline);
Py_Return;
Expand Down
13 changes: 7 additions & 6 deletions src/Mod/Part/App/BSplineSurfacePyImp.cpp
Expand Up @@ -293,7 +293,7 @@ PyObject* BSplineSurfacePy::insertUKnot(PyObject *args)
try {
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
(getGeometryPtr()->handle());
surf->InsertUKnot(U,M,tol,PyObject_IsTrue(add));
surf->InsertUKnot(U,M,tol,PyObject_IsTrue(add) ? Standard_True : Standard_False);
}
catch (Standard_Failure) {
Handle_Standard_Failure e = Standard_Failure::Caught();
Expand Down Expand Up @@ -333,7 +333,7 @@ PyObject* BSplineSurfacePy::insertUKnots(PyObject *args)

Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
(getGeometryPtr()->handle());
surf->InsertUKnots(k,m,tol,PyObject_IsTrue(add));
surf->InsertUKnots(k,m,tol,PyObject_IsTrue(add) ? Standard_True : Standard_False);
Py_Return;
}
catch (Standard_Failure) {
Expand All @@ -356,7 +356,7 @@ PyObject* BSplineSurfacePy::insertVKnot(PyObject *args)
try {
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
(getGeometryPtr()->handle());
surf->InsertVKnot(V,M,tol,PyObject_IsTrue(add));
surf->InsertVKnot(V,M,tol,PyObject_IsTrue(add) ? Standard_True : Standard_False);
}
catch (Standard_Failure) {
Handle_Standard_Failure e = Standard_Failure::Caught();
Expand Down Expand Up @@ -396,7 +396,7 @@ PyObject* BSplineSurfacePy::insertVKnots(PyObject *args)

Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
(getGeometryPtr()->handle());
surf->InsertVKnots(k,m,tol,PyObject_IsTrue(add));
surf->InsertVKnots(k,m,tol,PyObject_IsTrue(add) ? Standard_True : Standard_False);
Py_Return;
}
catch (Standard_Failure) {
Expand Down Expand Up @@ -1429,7 +1429,7 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
Standard_Integer lv = col.size();
TColgp_Array2OfPnt occpoles(1, lu, 1, lv);
TColStd_Array2OfReal occweights(1, lu, 1, lv);
Standard_Boolean genweights = PyObject_Not(weights) ; //cache
Standard_Boolean genweights = PyObject_Not(weights) ? Standard_True : Standard_False; //cache
Standard_Integer index1 = 0;
Standard_Integer index2 = 0;
for (Py::Sequence::iterator it1 = list.begin(); it1 != list.end(); ++it1) {
Expand Down Expand Up @@ -1532,7 +1532,8 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
}
Handle_Geom_BSplineSurface spline = new Geom_BSplineSurface(occpoles,occweights,
occuknots,occvknots,occumults,occvmults,udegree,vdegree,
PyObject_IsTrue(uperiodic),PyObject_IsTrue(vperiodic));
PyObject_IsTrue(uperiodic) ? Standard_True : Standard_False,
PyObject_IsTrue(vperiodic) ? Standard_True : Standard_False);
if (!spline.IsNull()) {
this->getGeomBSplineSurfacePtr()->setHandle(spline);
Py_Return;
Expand Down
8 changes: 5 additions & 3 deletions src/Mod/Part/App/RectangularTrimmedSurfacePyImp.cpp
Expand Up @@ -59,7 +59,9 @@ int RectangularTrimmedSurfacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
getGeomTrimmedSurfacePtr()->setHandle(new Geom_RectangularTrimmedSurface(
Handle_Geom_Surface::DownCast(static_cast<GeometrySurfacePy*>(surf)->
getGeomSurfacePtr()->handle()),
u1, u2, v1, v2, PyObject_IsTrue(usense), PyObject_IsTrue(vsense)
u1, u2, v1, v2,
PyObject_IsTrue(usense) ? Standard_True : Standard_False,
PyObject_IsTrue(vsense) ? Standard_True : Standard_False
));
return 0;
}
Expand All @@ -69,8 +71,8 @@ int RectangularTrimmedSurfacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
PyObject *utrim=Py_False, *sense=Py_True;
if (PyArg_ParseTuple(args, "O!ddO!|O!",&(Part::GeometrySurfacePy::Type),&surf,
&param1,&param2,&PyBool_Type,&utrim,&PyBool_Type,&sense)) {
Standard_Boolean UTrim = PyObject_IsTrue(utrim);
Standard_Boolean Sense = PyObject_IsTrue(sense);
Standard_Boolean UTrim = PyObject_IsTrue(utrim) ? Standard_True : Standard_False;
Standard_Boolean Sense = PyObject_IsTrue(sense) ? Standard_True : Standard_False;
getGeomTrimmedSurfacePtr()->setHandle(new Geom_RectangularTrimmedSurface(
Handle_Geom_Surface::DownCast(static_cast<GeometrySurfacePy*>(surf)->
getGeomSurfacePtr()->handle()),
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Part/App/TopoShapeCompoundPyImp.cpp
Expand Up @@ -122,7 +122,7 @@ PyObject* TopoShapeCompoundPy::connectEdgesToWires(PyObject *args)
for (TopExp_Explorer xp(s, TopAbs_EDGE); xp.More(); xp.Next())
hEdges->Append(xp.Current());

ShapeAnalysis_FreeBounds::ConnectEdgesToWires(hEdges, tol, PyObject_IsTrue(shared), hWires);
ShapeAnalysis_FreeBounds::ConnectEdgesToWires(hEdges, tol, PyObject_IsTrue(shared) ? Standard_True : Standard_False, hWires);

TopoDS_Compound comp;
BRep_Builder builder;
Expand Down
18 changes: 12 additions & 6 deletions src/Mod/Part/App/TopoShapeWirePyImp.cpp
Expand Up @@ -242,11 +242,14 @@ PyObject* TopoShapeWirePy::makePipe(PyObject *args)
PyObject* TopoShapeWirePy::makePipeShell(PyObject *args)
{
PyObject *obj;
int make_solid = 0;
int is_Frenet = 0;
int transition = 0;

if (PyArg_ParseTuple(args, "O|iii", &obj, &make_solid, &is_Frenet, &transition)) {
PyObject *make_solid = Py_False;
PyObject *is_Frenet = Py_False;
PyObject *transition = Py_False;

if (PyArg_ParseTuple(args, "O|O!O!O!", &obj,
&PyBool_Type, &make_solid,
&PyBool_Type, &is_Frenet,
&PyBool_Type, &transition)) {
try {
TopTools_ListOfShape sections;
Py::Sequence list(obj);
Expand All @@ -256,7 +259,10 @@ PyObject* TopoShapeWirePy::makePipeShell(PyObject *args)
sections.Append(shape);
}
}
TopoDS_Shape shape = this->getTopoShapePtr()->makePipeShell(sections, make_solid, is_Frenet, transition);
TopoDS_Shape shape = this->getTopoShapePtr()->makePipeShell(sections,
PyObject_IsTrue(make_solid) ? Standard_True : Standard_False,
PyObject_IsTrue(is_Frenet) ? Standard_True : Standard_False,
PyObject_IsTrue(transition) ? Standard_True : Standard_False);
return new TopoShapePy(new TopoShape(shape));
}
catch (Standard_Failure) {
Expand Down
8 changes: 4 additions & 4 deletions src/Mod/Raytracing/Gui/DlgSettingsRay.ui
Expand Up @@ -13,7 +13,7 @@
<property name="windowTitle">
<string>Raytracing</string>
</property>
<layout class="QGridLayout">
<layout class="QGridLayout" name="gridLayout1">
<property name="margin">
<number>9</number>
</property>
Expand Down Expand Up @@ -110,7 +110,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<layout class="QGridLayout" name="gridLayout2">
<item row="0" column="1">
<widget class="Gui::PrefFileChooser" name="prefFileChooser2">
<property name="toolTip">
Expand Down Expand Up @@ -240,15 +240,15 @@
<property name="title">
<string>Directories</string>
</property>
<layout class="QGridLayout">
<layout class="QGridLayout" name="gridLayout3">
<property name="margin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout">
<layout class="QGridLayout" name="gridLayout4">
<property name="margin">
<number>0</number>
</property>
Expand Down

0 comments on commit d62ed23

Please sign in to comment.