[TD]replace GeometryObject only after all changes are done

This commit is contained in:
wandererfan
2022-08-25 12:07:56 -04:00
committed by WandererFan
parent 67ce559bc5
commit c0d69f7d8e
4 changed files with 37 additions and 42 deletions

View File

@@ -71,15 +71,11 @@
#include <Mod/Part/App/PartFeature.h>
#include "Preferences.h"
#include "Geometry.h"
#include "GeometryObject.h"
#include "Cosmetic.h"
#include "HatchLine.h"
#include "EdgeWalker.h"
#include "DrawUtil.h"
#include "DrawProjGroupItem.h"
#include "DrawProjectSplit.h"
#include "DrawGeomHatch.h"
#include "DrawHatch.h"
#include "DrawViewSection.h"
@@ -279,10 +275,6 @@ void DrawViewSection::sectionExec(TopoDS_Shape& baseShape)
//should be caught before this
return;
}
if (geometryObject) {
delete geometryObject;
geometryObject = nullptr;
}
try {
//note that &m_cutWatcher in the third parameter is not strictly required, but using the
@@ -430,7 +422,7 @@ void DrawViewSection::onSectionCutFinished()
postSectionCutTasks();
//display geometry for cut shape is in geometryObject as in DVP
geometryObject = buildGeometryObject(m_scaledShape, m_viewAxis);
m_tempGeometryObject = buildGeometryObject(m_scaledShape, m_viewAxis);
}
//activities that depend on updated geometry object