Skip to content

Commit

Permalink
[TD] DrawViewPart: Fix Dimension attachment on Cosmetic CenterLines u…
Browse files Browse the repository at this point in the history
…pon document restore
  • Loading branch information
aapo-aapo authored and WandererFan committed Nov 18, 2022
1 parent 7a8a453 commit 2e19e5f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
29 changes: 22 additions & 7 deletions src/Mod/TechDraw/App/DrawViewPart.cpp
Expand Up @@ -432,12 +432,8 @@ void DrawViewPart::postHlrTasks(void)
addReferencesToGeom();
addShapes2d();

//dimensions and balloons need to be recomputed here because their
//balloons need to be recomputed here because their
//references will be invalid until the geometry exists
std::vector<TechDraw::DrawViewDimension*> dims = getDimensions();
for (auto& d : dims) {
d->recomputeFeature();
}
std::vector<TechDraw::DrawViewBalloon*> bals = getBalloons();
for (auto& b : bals) {
b->recomputeFeature();
Expand All @@ -457,6 +453,24 @@ void DrawViewPart::postHlrTasks(void)
requestPaint();
}

//run any tasks that need to been done after faces are available
void DrawViewPart::postFaceExtractionTasks(void)
{
// Some centerlines depend on faces so we could not add CL geometry before now
addCenterLinesToGeom();

// Dimensions need to be recomputed here because their
// references will be invalid until all the geometry exists,
// specifically cosmetic centerlines
std::vector<TechDraw::DrawViewDimension*> dims = getDimensions();
for (auto& d : dims) {
d->recomputeFeature();
}

requestPaint();
}


//! make faces from the edge geometry
void DrawViewPart::extractFaces()
{
Expand Down Expand Up @@ -662,8 +676,9 @@ void DrawViewPart::onFacesFinished(void)
QObject::disconnect(connectFaceWatcher);
showProgressMessage(getNameInDocument(), "has finished extracting faces");

//some centerlines depend on faces so we could not add CL geometry before now
addCenterLinesToGeom();
// Now we can recompute Dimensions and do other tasks possibly depending on Face extraction
postFaceExtractionTasks();

requestPaint();
}

Expand Down
1 change: 1 addition & 0 deletions src/Mod/TechDraw/App/DrawViewPart.h
Expand Up @@ -173,6 +173,7 @@ class TechDrawExport DrawViewPart : public DrawView, public CosmeticExtension
double getSizeAlongVector(Base::Vector3d alignmentVector);

virtual void postHlrTasks(void);
virtual void postFaceExtractionTasks(void);

bool isIso() const;

Expand Down

0 comments on commit 2e19e5f

Please sign in to comment.