Performance improvements Ph1

This commit is contained in:
WandererFan
2016-09-28 20:18:44 -04:00
parent b27a526cd6
commit 8459cdad5a
11 changed files with 150 additions and 134 deletions

View File

@@ -127,30 +127,11 @@ DrawViewDimension::~DrawViewDimension()
void DrawViewDimension::onChanged(const App::Property* prop)
{
if (!isRestoring()) {
if (prop == &References2D ||
prop == &Font ||
prop == &Fontsize ||
prop == &FormatSpec ||
//prop == &CentreLines ||
prop == &LineWidth) {
try {
App::DocumentObjectExecReturn *ret = recompute();
delete ret;
}
catch (...) {
}
}
if (prop == &MeasureType) {
if (MeasureType.isValue("True") && !measurement->has3DReferences()) {
Base::Console().Warning("Dimension %s missing Reference to 3D model. Must be Projected.\n", getNameInDocument());
MeasureType.setValue("Projected");
}
try {
App::DocumentObjectExecReturn *ret = recompute();
delete ret;
}
catch (...) {
}
}
if (prop == &References3D) { //have to rebuild the Measurement object
clear3DMeasurements();
@@ -176,14 +157,15 @@ void DrawViewDimension::onDocumentRestored()
short DrawViewDimension::mustExecute() const
{
bool result = 0;
if (References2D.isTouched() ||
Type.isTouched() ||
MeasureType.isTouched()) {
result = 1;
} else {
result = 0;
if (!isRestoring()) {
result = (References2D.isTouched() ||
Type.isTouched() ||
MeasureType.isTouched());
}
return result;
if (result) {
return result;
}
return DrawView::mustExecute();
}
App::DocumentObjectExecReturn *DrawViewDimension::execute(void)