Eliminate some redundant executes

- excessive calls to DrawView::execute were
  slowing data entry in PropertyEditor.
This commit is contained in:
wandererfan
2018-05-04 10:28:03 -04:00
committed by Yorik van Havre
parent 6b91a3ec32
commit 8a183a0ba0
12 changed files with 58 additions and 86 deletions

View File

@@ -137,17 +137,21 @@ void DrawPage::onChanged(const App::Property* prop)
}
} else if(prop == &Scale) {
// touch all views in the Page as they may be dependent on this scale
const std::vector<App::DocumentObject*> &vals = Views.getValues();
for(std::vector<App::DocumentObject *>::const_iterator it = vals.begin(); it < vals.end(); ++it) {
TechDraw::DrawView *view = dynamic_cast<TechDraw::DrawView *>(*it);
if (view != NULL && view->ScaleType.isValue("Page")) {
if(std::abs(view->Scale.getValue() - Scale.getValue()) > FLT_EPSILON) {
view->Scale.setValue(Scale.getValue());
// WF: not sure this loop is required. Views figure out their scale as required. but maybe
// this is needed just to mark the Views to recompute??
if (!isRestoring()) {
const std::vector<App::DocumentObject*> &vals = Views.getValues();
for(std::vector<App::DocumentObject *>::const_iterator it = vals.begin(); it < vals.end(); ++it) {
TechDraw::DrawView *view = dynamic_cast<TechDraw::DrawView *>(*it);
if (view != NULL && view->ScaleType.isValue("Page")) {
if(std::abs(view->Scale.getValue() - Scale.getValue()) > FLT_EPSILON) {
view->Scale.setValue(Scale.getValue());
}
}
}
}
} else if (prop == &ProjectionType) {
// touch all ortho views in the Page as they may be dependent on Projection Type
// touch all ortho views in the Page as they may be dependent on Projection Type //(is this true?)
const std::vector<App::DocumentObject*> &vals = Views.getValues();
for(std::vector<App::DocumentObject *>::const_iterator it = vals.begin(); it < vals.end(); ++it) {
TechDraw::DrawProjGroup *view = dynamic_cast<TechDraw::DrawProjGroup *>(*it);