Part: modernize C++11
* use nullptr
This commit is contained in:
@@ -223,7 +223,7 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
PyObject *bound=0;
|
||||
PyObject *bound=nullptr;
|
||||
if (PyArg_ParseTuple(args, "O!|O!", &(GeometryPy::Type), &surf, &(PyList_Type), &bound)) {
|
||||
try {
|
||||
Handle(Geom_Surface) S = Handle(Geom_Surface)::DownCast
|
||||
@@ -326,7 +326,7 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
}
|
||||
}
|
||||
|
||||
char* className = 0;
|
||||
char* className = nullptr;
|
||||
PyObject* pcPyShapeOrList = nullptr;
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTuple(args, "Os", &pcPyShapeOrList, &className)) {
|
||||
@@ -429,12 +429,12 @@ PyObject* TopoShapeFacePy::makeOffset(PyObject *args)
|
||||
{
|
||||
double dist;
|
||||
if (!PyArg_ParseTuple(args, "d",&dist))
|
||||
return 0;
|
||||
return nullptr;
|
||||
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
|
||||
BRepBuilderAPI_FindPlane findPlane(f);
|
||||
if (!findPlane.Found()) {
|
||||
PyErr_SetString(PartExceptionOCCError, "No planar face");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
BRepOffsetAPI_MakeOffset mkOffset(f);
|
||||
@@ -507,7 +507,7 @@ PyObject* TopoShapeFacePy::valueAt(PyObject *args)
|
||||
{
|
||||
double u,v;
|
||||
if (!PyArg_ParseTuple(args, "dd",&u,&v))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
|
||||
|
||||
@@ -540,14 +540,14 @@ PyObject* TopoShapeFacePy::normalAt(PyObject *args)
|
||||
PyObject* TopoShapeFacePy::getUVNodes(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
|
||||
TopLoc_Location aLoc;
|
||||
Handle (Poly_Triangulation) mesh = BRep_Tool::Triangulation(f,aLoc);
|
||||
if (mesh.IsNull()) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Face has no triangulation");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Py::List list;
|
||||
@@ -581,7 +581,7 @@ PyObject* TopoShapeFacePy::tangentAt(PyObject *args)
|
||||
{
|
||||
double u,v;
|
||||
if (!PyArg_ParseTuple(args, "dd",&u,&v))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
gp_Dir dir;
|
||||
Py::Tuple tuple(2);
|
||||
@@ -595,7 +595,7 @@ PyObject* TopoShapeFacePy::tangentAt(PyObject *args)
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PartExceptionOCCError, "tangent in u not defined");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
if (prop.IsTangentVDefined()) {
|
||||
prop.TangentV(dir);
|
||||
@@ -603,7 +603,7 @@ PyObject* TopoShapeFacePy::tangentAt(PyObject *args)
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PartExceptionOCCError, "tangent in v not defined");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return Py::new_reference_to(tuple);
|
||||
@@ -613,7 +613,7 @@ PyObject* TopoShapeFacePy::curvatureAt(PyObject *args)
|
||||
{
|
||||
double u,v;
|
||||
if (!PyArg_ParseTuple(args, "dd",&u,&v))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
Py::Tuple tuple(2);
|
||||
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
|
||||
@@ -626,7 +626,7 @@ PyObject* TopoShapeFacePy::curvatureAt(PyObject *args)
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PartExceptionOCCError, "curvature not defined");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return Py::new_reference_to(tuple);
|
||||
@@ -636,7 +636,7 @@ PyObject* TopoShapeFacePy::derivative1At(PyObject *args)
|
||||
{
|
||||
double u,v;
|
||||
if (!PyArg_ParseTuple(args, "dd",&u,&v))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
Py::Tuple tuple(2);
|
||||
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
|
||||
@@ -652,7 +652,7 @@ PyObject* TopoShapeFacePy::derivative1At(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -660,7 +660,7 @@ PyObject* TopoShapeFacePy::derivative2At(PyObject *args)
|
||||
{
|
||||
double u,v;
|
||||
if (!PyArg_ParseTuple(args, "dd",&u,&v))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
Py::Tuple tuple(2);
|
||||
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
|
||||
@@ -676,7 +676,7 @@ PyObject* TopoShapeFacePy::derivative2At(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -684,7 +684,7 @@ PyObject* TopoShapeFacePy::isPartOfDomain(PyObject *args)
|
||||
{
|
||||
double u,v;
|
||||
if (!PyArg_ParseTuple(args, "dd",&u,&v))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
const TopoDS_Face& face = TopoDS::Face(getTopoShapePtr()->getShape());
|
||||
|
||||
@@ -702,7 +702,7 @@ PyObject* TopoShapeFacePy::isPartOfDomain(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -710,7 +710,7 @@ PyObject* TopoShapeFacePy::makeHalfSpace(PyObject *args)
|
||||
{
|
||||
PyObject* pPnt;
|
||||
if (!PyArg_ParseTuple(args, "O!",&(Base::VectorPy::Type),&pPnt))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
try {
|
||||
Base::Vector3d pt = Py::Vector(pPnt,false).toVector();
|
||||
@@ -719,14 +719,14 @@ PyObject* TopoShapeFacePy::makeHalfSpace(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* TopoShapeFacePy::validate(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
try {
|
||||
const TopoDS_Face& face = TopoDS::Face(getTopoShapePtr()->getShape());
|
||||
@@ -770,7 +770,7 @@ PyObject* TopoShapeFacePy::validate(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -778,13 +778,13 @@ PyObject* TopoShapeFacePy::curveOnSurface(PyObject *args)
|
||||
{
|
||||
PyObject* e;
|
||||
if (!PyArg_ParseTuple(args, "O!", &(TopoShapeEdgePy::Type), &e))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
try {
|
||||
TopoDS_Shape shape = static_cast<TopoShapeEdgePy*>(e)->getTopoShapePtr()->getShape();
|
||||
if (shape.IsNull()) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "invalid shape");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TopoDS_Edge edge = TopoDS::Edge(shape);
|
||||
@@ -804,13 +804,13 @@ PyObject* TopoShapeFacePy::curveOnSurface(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* TopoShapeFacePy::cutHoles(PyObject *args)
|
||||
{
|
||||
PyObject *holes=0;
|
||||
PyObject *holes=nullptr;
|
||||
if (PyArg_ParseTuple(args, "O!", &(PyList_Type), &holes)) {
|
||||
try {
|
||||
std::vector<TopoDS_Wire> wires;
|
||||
@@ -867,11 +867,11 @@ PyObject* TopoShapeFacePy::cutHoles(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
PyErr_SetString(PyExc_RuntimeError, "invalid list of wires");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -879,7 +879,7 @@ Py::Object TopoShapeFacePy::getSurface() const
|
||||
{
|
||||
const TopoDS_Face& f = TopoDS::Face(getTopoShapePtr()->getShape());
|
||||
BRepAdaptor_Surface adapt(f);
|
||||
Base::PyObjectBase* surface = 0;
|
||||
Base::PyObjectBase* surface = nullptr;
|
||||
switch(adapt.GetType())
|
||||
{
|
||||
case GeomAbs_Plane:
|
||||
@@ -1141,7 +1141,7 @@ Py::Dict TopoShapeFacePy::getPrincipalProperties(void) const
|
||||
|
||||
PyObject *TopoShapeFacePy::getCustomAttributes(const char* ) const
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int TopoShapeFacePy::setCustomAttributes(const char* , PyObject *)
|
||||
|
||||
Reference in New Issue
Block a user