Skip to content

Commit 2e19e5f

Browse files
aapo-aapoWandererFan
authored andcommitted
[TD] DrawViewPart: Fix Dimension attachment on Cosmetic CenterLines upon document restore
1 parent 7a8a453 commit 2e19e5f

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

src/Mod/TechDraw/App/DrawViewPart.cpp

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,8 @@ void DrawViewPart::postHlrTasks(void)
432432
addReferencesToGeom();
433433
addShapes2d();
434434

435-
//dimensions and balloons need to be recomputed here because their
435+
//balloons need to be recomputed here because their
436436
//references will be invalid until the geometry exists
437-
std::vector<TechDraw::DrawViewDimension*> dims = getDimensions();
438-
for (auto& d : dims) {
439-
d->recomputeFeature();
440-
}
441437
std::vector<TechDraw::DrawViewBalloon*> bals = getBalloons();
442438
for (auto& b : bals) {
443439
b->recomputeFeature();
@@ -457,6 +453,24 @@ void DrawViewPart::postHlrTasks(void)
457453
requestPaint();
458454
}
459455

456+
//run any tasks that need to been done after faces are available
457+
void DrawViewPart::postFaceExtractionTasks(void)
458+
{
459+
// Some centerlines depend on faces so we could not add CL geometry before now
460+
addCenterLinesToGeom();
461+
462+
// Dimensions need to be recomputed here because their
463+
// references will be invalid until all the geometry exists,
464+
// specifically cosmetic centerlines
465+
std::vector<TechDraw::DrawViewDimension*> dims = getDimensions();
466+
for (auto& d : dims) {
467+
d->recomputeFeature();
468+
}
469+
470+
requestPaint();
471+
}
472+
473+
460474
//! make faces from the edge geometry
461475
void DrawViewPart::extractFaces()
462476
{
@@ -662,8 +676,9 @@ void DrawViewPart::onFacesFinished(void)
662676
QObject::disconnect(connectFaceWatcher);
663677
showProgressMessage(getNameInDocument(), "has finished extracting faces");
664678

665-
//some centerlines depend on faces so we could not add CL geometry before now
666-
addCenterLinesToGeom();
679+
// Now we can recompute Dimensions and do other tasks possibly depending on Face extraction
680+
postFaceExtractionTasks();
681+
667682
requestPaint();
668683
}
669684

src/Mod/TechDraw/App/DrawViewPart.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ class TechDrawExport DrawViewPart : public DrawView, public CosmeticExtension
173173
double getSizeAlongVector(Base::Vector3d alignmentVector);
174174

175175
virtual void postHlrTasks(void);
176+
virtual void postFaceExtractionTasks(void);
176177

177178
bool isIso() const;
178179

0 commit comments

Comments
 (0)