How to delete original entity after moving in c++
Posted: Wed Mar 06, 2019 3:20 pm
Hi,
I am trying to create and entity and move it using moveReferencePoint funtion. The entity moves but i see the original one as well. How do we delete or keep copies =1 using c++ ?
QSharedPointer<RCircleEntity> myCircle;
void function1()
{
myCircle = QSharedPointer<RCircleEntity>(new RCircleEntity(document, RCircleData(centre, radius)));
RAddObjectOperation op = new RAddObjectOperation(myCircle, false);
documentInterface->applyOperation(op);
}
void function2()
{
myCircle.moveReferencePoint(centre, targetCentre);
RModifyObjectOperation op = new RModifyObjectOperation(myCircle, false);
documentInterface->applyOperation(op); ---> This moves the circle to new centre but I can also see the original circle.
}
Please let me know how to delete the previous circle.
I am using QCAD version : 3.20.1.5
Thanks,
EZM
I am trying to create and entity and move it using moveReferencePoint funtion. The entity moves but i see the original one as well. How do we delete or keep copies =1 using c++ ?
QSharedPointer<RCircleEntity> myCircle;
void function1()
{
myCircle = QSharedPointer<RCircleEntity>(new RCircleEntity(document, RCircleData(centre, radius)));
RAddObjectOperation op = new RAddObjectOperation(myCircle, false);
documentInterface->applyOperation(op);
}
void function2()
{
myCircle.moveReferencePoint(centre, targetCentre);
RModifyObjectOperation op = new RModifyObjectOperation(myCircle, false);
documentInterface->applyOperation(op); ---> This moves the circle to new centre but I can also see the original circle.
}
Please let me know how to delete the previous circle.
I am using QCAD version : 3.20.1.5
Thanks,
EZM