[TD]Eliminate replace fcns for Cosmetic objs
This commit is contained in:
@@ -281,17 +281,21 @@ PyObject* DrawViewPartPy::removeCosmeticVertex(PyObject *args)
|
||||
|
||||
PyObject* DrawViewPartPy::replaceCosmeticVertex(PyObject *args)
|
||||
{
|
||||
PyObject* pNewCV = nullptr;
|
||||
if (!PyArg_ParseTuple(args, "O!", &(TechDraw::CosmeticVertexPy::Type), &pNewCV)) {
|
||||
throw Py::TypeError("expected (CosmeticVertex)");
|
||||
}
|
||||
DrawViewPart* dvp = getDrawViewPartPtr();
|
||||
TechDraw::CosmeticVertexPy* cvPy = static_cast<TechDraw::CosmeticVertexPy*>(pNewCV);
|
||||
TechDraw::CosmeticVertex* cv = cvPy->getCosmeticVertexPtr();
|
||||
bool result = dvp->replaceCosmeticVertex(cv);
|
||||
dvp->refreshCVGeoms();
|
||||
dvp->requestPaint();
|
||||
return PyBool_FromLong((long) result);
|
||||
(void) args;
|
||||
Base::Console().Message("DVPP::replaceCosmeticVertex() - deprecated. do not use.\n");
|
||||
return PyBool_FromLong(0l);
|
||||
|
||||
// PyObject* pNewCV = nullptr;
|
||||
// if (!PyArg_ParseTuple(args, "O!", &(TechDraw::CosmeticVertexPy::Type), &pNewCV)) {
|
||||
// throw Py::TypeError("expected (CosmeticVertex)");
|
||||
// }
|
||||
// DrawViewPart* dvp = getDrawViewPartPtr();
|
||||
// TechDraw::CosmeticVertexPy* cvPy = static_cast<TechDraw::CosmeticVertexPy*>(pNewCV);
|
||||
// TechDraw::CosmeticVertex* cv = cvPy->getCosmeticVertexPtr();
|
||||
// bool result = dvp->replaceCosmeticVertex(cv);
|
||||
// dvp->refreshCVGeoms();
|
||||
// dvp->requestPaint();
|
||||
// return PyBool_FromLong((long) result);
|
||||
}
|
||||
|
||||
|
||||
@@ -464,8 +468,6 @@ PyObject* DrawViewPartPy::getCosmeticEdge(PyObject *args)
|
||||
DrawViewPart* dvp = getDrawViewPartPtr();
|
||||
TechDraw::CosmeticEdge* ce = dvp->getCosmeticEdge(tag);
|
||||
if (ce != nullptr) {
|
||||
// result = new CosmeticEdgePy(new CosmeticEdge(ce));
|
||||
// result = new CosmeticEdgePy(ce->clone());
|
||||
result = ce->getPyObject();
|
||||
} else {
|
||||
Base::Console().Error("DVPPI::getCosmeticEdge - edge %s not found\n", tag);
|
||||
@@ -487,7 +489,6 @@ PyObject* DrawViewPartPy::getCosmeticEdgeBySelection(PyObject *args)
|
||||
TechDraw::CosmeticEdge* ce = dvp->getCosmeticEdgeBySelection(name);
|
||||
if (ce != nullptr) {
|
||||
result = ce->getPyObject();
|
||||
// result = new CosmeticEdgePy(ce->clone());
|
||||
} else {
|
||||
Base::Console().Error("DVPPI::getCosmeticEdgebySelection - edge for name %s not found\n", name);
|
||||
}
|
||||
@@ -496,21 +497,25 @@ PyObject* DrawViewPartPy::getCosmeticEdgeBySelection(PyObject *args)
|
||||
|
||||
PyObject* DrawViewPartPy::replaceCosmeticEdge(PyObject *args)
|
||||
{
|
||||
(void) args;
|
||||
Base::Console().Message("DVPP::replaceCosmeticEdge() - deprecated. do not use.\n");
|
||||
return PyBool_FromLong(0l);
|
||||
|
||||
// Base::Console().Message("DVPPI::replaceCosmeticEdge()\n");
|
||||
bool result = false;
|
||||
PyObject* pNewCE;
|
||||
if (!PyArg_ParseTuple(args, "O!", &(TechDraw::CosmeticEdgePy::Type), &pNewCE)) {
|
||||
throw Py::TypeError("expected (CosmeticEdge)");
|
||||
}
|
||||
DrawViewPart* dvp = getDrawViewPartPtr();
|
||||
TechDraw::CosmeticEdgePy* cePy = static_cast<TechDraw::CosmeticEdgePy*>(pNewCE);
|
||||
TechDraw::CosmeticEdge* ce = cePy->getCosmeticEdgePtr();
|
||||
if (ce != nullptr) {
|
||||
result = dvp->replaceCosmeticEdge(ce); //<<<
|
||||
dvp->refreshCEGeoms();
|
||||
dvp->requestPaint();
|
||||
}
|
||||
return PyBool_FromLong((long) result);
|
||||
// bool result = false;
|
||||
// PyObject* pNewCE;
|
||||
// if (!PyArg_ParseTuple(args, "O!", &(TechDraw::CosmeticEdgePy::Type), &pNewCE)) {
|
||||
// throw Py::TypeError("expected (CosmeticEdge)");
|
||||
// }
|
||||
// DrawViewPart* dvp = getDrawViewPartPtr();
|
||||
// TechDraw::CosmeticEdgePy* cePy = static_cast<TechDraw::CosmeticEdgePy*>(pNewCE);
|
||||
// TechDraw::CosmeticEdge* ce = cePy->getCosmeticEdgePtr();
|
||||
// if (ce != nullptr) {
|
||||
// result = dvp->replaceCosmeticEdge(ce); //<<<
|
||||
// dvp->refreshCEGeoms();
|
||||
// dvp->requestPaint();
|
||||
// }
|
||||
// return PyBool_FromLong((long) result);
|
||||
}
|
||||
|
||||
PyObject* DrawViewPartPy::removeCosmeticEdge(PyObject *args)
|
||||
@@ -589,7 +594,7 @@ PyObject* DrawViewPartPy::getCenterLine(PyObject *args)
|
||||
DrawViewPart* dvp = getDrawViewPartPtr();
|
||||
TechDraw::CenterLine* cl = dvp->getCenterLine(tag);
|
||||
if (cl != nullptr) {
|
||||
result = new CenterLinePy(cl->clone());
|
||||
result = cl->getPyObject();
|
||||
} else {
|
||||
Base::Console().Error("DVPPI::getCenterLine - centerLine %s not found\n", tag);
|
||||
}
|
||||
@@ -609,7 +614,7 @@ PyObject* DrawViewPartPy::getCenterLineBySelection(PyObject *args)
|
||||
|
||||
TechDraw::CenterLine* cl = dvp->getCenterLineBySelection(tag);
|
||||
if (cl != nullptr) {
|
||||
result = new CenterLinePy(cl->clone());
|
||||
result = cl->getPyObject();
|
||||
} else {
|
||||
Base::Console().Error("DVPPI::getCenterLinebySelection - centerLine for tag %s not found\n", tag);
|
||||
}
|
||||
@@ -618,18 +623,22 @@ PyObject* DrawViewPartPy::getCenterLineBySelection(PyObject *args)
|
||||
|
||||
PyObject* DrawViewPartPy::replaceCenterLine(PyObject *args)
|
||||
{
|
||||
(void) args;
|
||||
Base::Console().Message("DVPP::replaceCenterLine() - deprecated. do not use.\n");
|
||||
return PyBool_FromLong(0l);
|
||||
|
||||
// Base::Console().Message("DVPPI::replace CenterLine()\n");
|
||||
PyObject* pNewCL;
|
||||
if (!PyArg_ParseTuple(args, "O!", &(TechDraw::CenterLinePy::Type), &pNewCL)) {
|
||||
throw Py::TypeError("expected (CenterLine)");
|
||||
}
|
||||
DrawViewPart* dvp = getDrawViewPartPtr();
|
||||
TechDraw::CenterLinePy* clPy = static_cast<TechDraw::CenterLinePy*>(pNewCL);
|
||||
TechDraw::CenterLine* cl = clPy->getCenterLinePtr();
|
||||
bool result = dvp->replaceCenterLine(cl);
|
||||
dvp->refreshCLGeoms();
|
||||
dvp->requestPaint();
|
||||
return PyBool_FromLong((long) result);
|
||||
// PyObject* pNewCL;
|
||||
// if (!PyArg_ParseTuple(args, "O!", &(TechDraw::CenterLinePy::Type), &pNewCL)) {
|
||||
// throw Py::TypeError("expected (CenterLine)");
|
||||
// }
|
||||
// DrawViewPart* dvp = getDrawViewPartPtr();
|
||||
// TechDraw::CenterLinePy* clPy = static_cast<TechDraw::CenterLinePy*>(pNewCL);
|
||||
// TechDraw::CenterLine* cl = clPy->getCenterLinePtr();
|
||||
// bool result = dvp->replaceCenterLine(cl);
|
||||
// dvp->refreshCLGeoms();
|
||||
// dvp->requestPaint();
|
||||
// return PyBool_FromLong((long) result);
|
||||
}
|
||||
|
||||
PyObject* DrawViewPartPy::removeCenterLine(PyObject *args)
|
||||
|
||||
Reference in New Issue
Block a user