[TD] Landmark Dim minor clean ups

- clean up reference vertices on delete

- protect fail on close empty Page

- hide unimplemented functions
This commit is contained in:
wandererfan
2020-02-26 09:35:30 -05:00
committed by WandererFan
parent 75dea4bc24
commit fd240e9ea2
5 changed files with 71 additions and 30 deletions

View File

@@ -115,7 +115,7 @@ App::DocumentObjectExecReturn *LandmarkDimension::execute(void)
std::vector<DocumentObject*> features = References3D.getValues();
//if distance, required size = 2
//if angle, required size = 3;
//if angle, required size = 3; //not implemented yet
unsigned int requiredSize = 2;
if (features.size() < requiredSize) {
return App::DocumentObject::StdReturn;
@@ -147,7 +147,7 @@ App::DocumentObjectExecReturn *LandmarkDimension::execute(void)
m_linearPoints.first = points.front();
m_linearPoints.second = points.back();
//m_anglePoints.first =
//m_anglePoints.first = //not implemented yet
App::DocumentObjectExecReturn* dvdResult = DrawViewDimension::execute();
@@ -258,6 +258,23 @@ void LandmarkDimension::onDocumentRestored()
DrawViewDimension::onDocumentRestored();
}
void LandmarkDimension::unsetupObject()
{
// bool isRemoving = testStatus(App::ObjectStatus::Remove);
// Base::Console().Message("LD::unsetupObject - isRemove: %d status: %X\n",
// isRemoving, getStatus());
TechDraw::DrawViewPart* dvp = getViewPart();
std::vector<std::string> tags = ReferenceTags.getValues();
for (auto& t: tags) {
dvp->removeReferenceVertex(t);
}
dvp->resetReferenceVerts();
dvp->requestPaint();
}
//??? why does getPyObject work sometimes and no others???
//PyObject *LandmarkDimension::getPyObject(void)
//{