Performance improvements Ph1
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user