Part: [skip ci] include OCC hesder to PCHs, fix compiler warning when trying to delete void pointer

This commit is contained in:
wmayer
2020-09-28 20:23:33 +02:00
parent 904574d368
commit 1a15d566d5
6 changed files with 9 additions and 16 deletions

View File

@@ -62,16 +62,6 @@ PyObjectBase::~PyObjectBase()
Py_XDECREF(attrDict);
}
void PyObjectBase::setPointer(void* ptr, bool del)
{
if (_pcTwinPointer == ptr)
return;
if (del)
delete _pcTwinPointer;
_pcTwinPointer = ptr;
}
/*------------------------------
* PyObjectBase Type -- Every class, even the abstract one should have a Type
------------------------------*/

View File

@@ -212,6 +212,11 @@ protected:
/// destructor
virtual ~PyObjectBase();
/// Overrides the pointer to the twin object
void setTwinPointer(void* ptr) {
_pcTwinPointer = ptr;
}
public:
/** Constructor
* Sets the Type of the object (for inheritance) and decrease the
@@ -294,9 +299,6 @@ public:
_pcTwinPointer = 0;
}
/// Overrides the pointer to the twin object
void setPointer(void* ptr, bool del=false);
bool isValid() {
return StatusBits.test(Valid);
}

View File

@@ -116,7 +116,7 @@ int BuildPlateSurfacePy::PyInit(PyObject* args, PyObject* kwds)
ptr->LoadInitSurface(handle);
}
setPointer(ptr.release());
setTwinPointer(ptr.release());
return 0;
}

View File

@@ -93,7 +93,7 @@ int CurveConstraintPy::PyInit(PyObject* args, PyObject* kwds)
ptr.reset(new GeomPlate_CurveConstraint);
}
setPointer(ptr.release());
setTwinPointer(ptr.release());
return 0;
}

View File

@@ -58,7 +58,7 @@ int PointConstraintPy::PyInit(PyObject* args, PyObject* kwds)
Base::Vector3d v = static_cast<Base::VectorPy*>(pt)->value();
ptr.reset(new GeomPlate_PointConstraint(gp_Pnt(v.x, v.y, v.z), order, tolDist));
setPointer(ptr.release());
setTwinPointer(ptr.release());
return 0;
}

View File

@@ -321,6 +321,7 @@
#include <Geom2d_Line.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2dAdaptor_HCurve.hxx>
#include <Geom2dAPI_ExtremaCurveCurve.hxx>
#include <Geom2dAPI_InterCurveCurve.hxx>
#include <Geom2dAPI_Interpolate.hxx>