Example #1
0
void vtkIOPWCallback::Execute(vtkObject *caller, unsigned long, void*) {
    vtkImplicitPlaneWidget2 *planeWidget = reinterpret_cast<vtkImplicitPlaneWidget2*>(caller);
    vtkMAFImplicitPlaneRepresentation *rep = reinterpret_cast<vtkMAFImplicitPlaneRepresentation*>(planeWidget->GetRepresentation());
    double ori[3];
    rep->GetOrigin(ori);
    mafCore::mafPoint *o = new mafCore::mafPoint(ori);
    QVariant vo;
    vo.setValue<mafCore::mafPointPointer>(o);
    Tool->setProperty("origin", vo);
    Tool->setModified();
    mafDEL(o);
}
Example #2
0
void vtkIPWCallback::Execute(vtkObject *caller, unsigned long, void*) {
    vtkImplicitPlaneWidget2 *planeWidget = reinterpret_cast<vtkImplicitPlaneWidget2*>(caller);
    vtkMAFImplicitPlaneRepresentation *rep = reinterpret_cast<vtkMAFImplicitPlaneRepresentation*>(planeWidget->GetRepresentation());
    double ori[3], nor[3];
    rep->GetOrigin(ori);
    rep->GetNormal(nor);
    mafResources::mafPoint *o, *n;
    o = new mafResources::mafPoint(ori);
    n = new mafResources::mafPoint(nor);
    QVariant vo, vn;
    vo.setValue<mafResources::mafPointPointer>(o);
    vn.setValue<mafResources::mafPointPointer>(n);
    Tool->setProperty("origin", vo);
    Tool->setProperty("normal", vn);
    Tool->setModified();
    mafDEL(o);
    mafDEL(n);
}