void ViewProviderDrawingView::updateData(const App::Property* prop)
{
    if (prop == &(getViewObject()->Rotation)  ) {
        // redraw QGIVP
        QGIView* qgiv = getQView();
        if (qgiv) {
            qgiv->updateView(true);
        }
     }

    Gui::ViewProviderDocumentObject::updateData(prop);
}
void ViewProviderDimension::onChanged(const App::Property* p)
{
    if ((p == &Font)  ||
        (p == &Fontsize) ||
        (p == &LineWidth) ) {
        QGIView* qgiv = getQView();
        if (qgiv) {
            qgiv->updateView(true);
        }
    }
    Gui::ViewProviderDocumentObject::onChanged(p);
}
void MDIViewPage::clearSelection()
{
  blockSelection(true);
  std::vector<QGIView *> views = m_view->getViews();

  // Iterate through all views and unselect all
  for (std::vector<QGIView *>::iterator it = views.begin(); it != views.end(); ++it) {
      QGIView *item = *it;
      item->setSelected(false);
      item->updateView();
  }

  blockSelection(false);
}
void ViewProviderViewSection::updateData(const App::Property* prop)
{
    Base::Console().Log("ViewProviderViewSection::updateData - Update View: %s\n",prop->getName());
    if (prop == &(getViewObject()->ShowCutSurface)   ||
        prop == &(getViewObject()->CutSurfaceColor) ) {
        // redraw QGIVP
        QGIView* qgiv = getQView();
        if (qgiv) {
            qgiv->updateView(true);
        }
     }

    ViewProviderViewPart::updateData(prop);
}
void ViewProviderDrawingView::onGuiRepaint(const TechDraw::DrawView* dv) 
{
    if (dv == getViewObject()) {
        QGIView* qgiv = getQView();
        if (qgiv) {
            qgiv->updateView(true);
        } else {                                //we are not part of the Gui page yet. ask page to add us.
            auto page = dv->findParentPage();
            if (page != nullptr) {
                page->requestPaint();
            }
        }
    }
}
//!Update QGVPage's selection based on Selection made outside Drawing Interface
//invoked from VPP
void MDIViewPage::selectFeature(App::DocumentObject *obj, const bool isSelected)
{
    App::DocumentObject* objCopy = obj;
    TechDraw::DrawHatch* hatchObj = dynamic_cast<TechDraw::DrawHatch*>(objCopy);
    if (hatchObj) {                                                    //Hatch does not have a QGIV of it's own. mark parent as selected.
        objCopy = hatchObj->getSourceView();                           //possible to highlight subObject?
    }
    QGIView *view = m_view->findQViewForDocObj(objCopy);

    blockSelection(true);
    if(view) {
        view->setSelected(isSelected);
        view->updateView();
    }
    blockSelection(false);
}
void ViewProviderViewClip::updateData(const App::Property* prop)
{
    //Base::Console().Log("ViewProviderViewClip::updateData - Update View: %s\n",prop->getName());
    if (prop == &(getViewObject()->Height)      ||
        prop == &(getViewObject()->Width)       ||
        prop == &(getViewObject()->ShowFrame)   ||
        prop == &(getViewObject()->ShowLabels)  ||
        prop == &(getViewObject()->Views) ) {
        // redraw QGIVP
        QGIView* qgiv = getQView();
        if (qgiv) {
            qgiv->updateView(true);
        }
     }
     ViewProviderDrawingView::updateData(prop);
}
Exemple #8
0
void ViewProviderProjGroup::updateData(const App::Property* prop)
{
    ViewProviderDrawingView::updateData(prop);

    if(prop == &(getObject()->Scale) ||
       prop == &(getObject()->ScaleType) ||
       prop == &(getObject()->Views) ||
       prop == &(getObject()->ProjectionType) ||
       prop == &(getObject()->LockPosition) ) {
        QGIView* qgiv = getQView();
        if (qgiv) {
            qgiv->updateView(true);
        }
    }

 }
void ViewProviderViewPart::updateData(const App::Property* prop)
{
    if (prop == &(getViewObject()->LineWidth)   ||
        prop == &(getViewObject()->HiddenWidth) ||
        prop == &(getViewObject()->ArcCenterMarks) ||
        prop == &(getViewObject()->CenterScale) ||
        prop == &(getViewObject()->ShowSectionLine)  ||
        prop == &(getViewObject()->HorizCenterLine)  ||
        prop == &(getViewObject()->VertCenterLine) ) {
        // redraw QGIVP
        QGIView* qgiv = getQView();
        if (qgiv) {
            qgiv->updateView(true);
        }
     }


    ViewProviderDrawingView::updateData(prop);
}
void ViewProviderDrawingView::onChanged(const App::Property *prop)
{
    App::DocumentObject* obj = getObject();
    if (!obj || obj->isRestoring()) {
            Gui::ViewProviderDocumentObject::onChanged(prop);
            return;
    }

    if (prop == &Visibility) {
       if(Visibility.getValue()) {
            show();
        } else {
            hide();
        }
    } else if (prop == &KeepLabel) {
        QGIView* qgiv = getQView();
        if (qgiv) {
            qgiv->updateView(true);
        }
    }

    Gui::ViewProviderDocumentObject::onChanged(prop);
}