change isDeleting to isUnsetting

- DocumentObject::isDeleting was changed to isRemoving.
  This commit just prevents future confusion.
This commit is contained in:
WandererFan
2017-09-17 11:50:52 -04:00
committed by Yorik van Havre
parent 4b3ab9e74e
commit 4b8d04f528
8 changed files with 19 additions and 32 deletions

View File

@@ -73,7 +73,7 @@ const char* DrawPage::ProjectionTypeEnums[] = { "First Angle",
DrawPage::DrawPage(void)
{
static const char *group = "Page";
nowDeleting = false;
nowUnsetting = false;
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
@@ -115,7 +115,7 @@ void DrawPage::onChanged(const App::Property* prop)
if ((prop == &KeepUpdated) &&
KeepUpdated.getValue()) {
if (!isRestoring() &&
!isDeleting()) {
!isUnsetting()) {
//would be nice if this message was displayed immediately instead of after the recomputeFeature
Base::Console().Message("Rebuilding Views for: %s/%s\n",getNameInDocument(),Label.getValue());
auto views(Views.getValues());
@@ -132,7 +132,7 @@ void DrawPage::onChanged(const App::Property* prop)
}
} else if (prop == &Template) {
if (!isRestoring() &&
!isDeleting()) {
!isUnsetting()) {
//nothing to page to do??
}
} else if(prop == &Scale) {
@@ -328,7 +328,7 @@ void DrawPage::onDocumentRestored()
void DrawPage::unsetupObject()
{
nowDeleting = true;
nowUnsetting = true;
// Remove the Page's views & template from document
App::Document* doc = getDocument();

View File

@@ -86,7 +86,7 @@ public:
*/
double getPageHeight() const;
const char* getPageOrientation() const;
bool isDeleting(void) { return nowDeleting; }
bool isUnsetting(void) { return nowUnsetting; }
void requestPaint(void);
@@ -99,7 +99,7 @@ protected:
private:
static const char* ProjectionTypeEnums[];
bool nowDeleting;
bool nowUnsetting;
static App::PropertyFloatConstraint::Constraints scaleRange;
};

View File

@@ -175,7 +175,7 @@ void DrawProjGroupItem::unsetupObject()
if (getPGroup() != nullptr) {
if (getPGroup()->hasProjection(Type.getValueAsString()) ) {
if ((getPGroup()->getAnchor() == this) &&
!getPGroup()->isDeleting() ) {
!getPGroup()->isUnsetting() ) {
Base::Console().Warning("Warning - DPG (%s/%s) may be corrupt - Anchor deleted\n",
getPGroup()->getNameInDocument(),getPGroup()->Label.getValue());
getPGroup()->Anchor.setValue(nullptr); //this catches situation where DPGI is deleted w/o DPG::removeProjection

View File

@@ -44,7 +44,7 @@ PROPERTY_SOURCE(TechDraw::DrawViewCollection, TechDraw::DrawView)
DrawViewCollection::DrawViewCollection()
{
nowDeleting = false;
nowUnsetting = false;
static const char *group = "Drawing view";
ADD_PROPERTY_TYPE(Views ,(0), group, App::Prop_None,"Attached Views");
@@ -145,7 +145,7 @@ void DrawViewCollection::onChanged(const App::Property* prop)
void DrawViewCollection::unsetupObject()
{
nowDeleting = true;
nowUnsetting = true;
// Remove the collection's views from document
App::Document* doc = getDocument();

View File

@@ -49,7 +49,7 @@ public:
int addView(DrawView *view);
int removeView(DrawView *view);
void rebuildViewList(void);
bool isDeleting(void) { return nowDeleting; }
bool isUnsetting(void) { return nowUnsetting; }
int countChildren();
@@ -65,7 +65,7 @@ public:
protected:
void onChanged(const App::Property* prop);
bool nowDeleting;
bool nowUnsetting;
};
} //namespace TechDraw

View File

@@ -114,7 +114,7 @@ DrawViewPart::DrawViewPart(void) : geometryObject(0)
static const char *group = "Projection";
static const char *fgroup = "Format";
static const char *sgroup = "Show";
nowDeleting = false;
nowUnsetting = false;
//properties that affect Geometry
ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"3D Shape to view");
@@ -199,12 +199,7 @@ App::DocumentObjectExecReturn *DrawViewPart::execute(void)
getScale());
gp_Ax2 viewAxis = getViewAxis(shapeCentroid,Direction.getValue());
// Base::Console().Message("Removing Hidden Lines from %s/%s\n",getNameInDocument(),Label.getValue());
geometryObject = buildGeometryObject(mirroredShape,viewAxis);
// Base::Console().Message("Finished Removing Hidden Lines\n");
//Base::Console().Message("TRACE - DVP::execute - u: %s v: %s w: %s\n",
// DrawUtil::formatVector(getUDir()).c_str(), DrawUtil::formatVector(getVDir()).c_str(), DrawUtil::formatVector(getWDir()).c_str());
#if MOD_TECHDRAW_HANDLE_FACES
if (handleFaces()) {
@@ -218,9 +213,6 @@ App::DocumentObjectExecReturn *DrawViewPart::execute(void)
}
#endif //#if MOD_TECHDRAW_HANDLE_FACES
// Base::Console().Message("TRACE _ DVP::exec - %s/%s u: %s v: %s w: %s\n",getNameInDocument(),Label.getValue(),
// DrawUtil::formatVector(getUDir()).c_str(), DrawUtil::formatVector(getVDir()).c_str(),DrawUtil::formatVector(getWDir()).c_str());
Base::Console().Message("TRACE - DVP::execute - requesting paint\n");
requestPaint();
return App::DocumentObject::StdReturn;
}
@@ -251,7 +243,6 @@ void DrawViewPart::onChanged(const App::Property* prop)
//note: slightly different than routine with same name in DrawProjectSplit
TechDrawGeometry::GeometryObject* DrawViewPart::buildGeometryObject(TopoDS_Shape shape, gp_Ax2 viewAxis)
{
Base::Console().Message("TRACE - DVP::buildGO - shape.IsNull: %d\n",shape.IsNull());
TechDrawGeometry::GeometryObject* go = new TechDrawGeometry::GeometryObject(getNameInDocument(), this);
go->setIsoCount(IsoCount.getValue());
@@ -524,7 +515,6 @@ std::vector<TechDrawGeometry::BaseGeom*> DrawViewPart::getProjFaceByIndex(int id
std::vector<TopoDS_Wire> DrawViewPart::getWireForFace(int idx) const
{
// Base::Console().Message("TRACE - DVP::getWireForFace(%d)\n",idx);
std::vector<TopoDS_Wire> result;
std::vector<TopoDS_Edge> edges;
const std::vector<TechDrawGeometry::Face *>& faces = getFaceGeometry();
@@ -542,7 +532,6 @@ std::vector<TopoDS_Wire> DrawViewPart::getWireForFace(int idx) const
result.push_back(occwire);
}
// Base::Console().Message("TRACE - DVP::getWireForFace(%d) returns %d wires\n",idx,result.size());
return result;
}
@@ -617,7 +606,6 @@ gp_Ax2 DrawViewPart::getViewAxis(const Base::Vector3d& pt,
void DrawViewPart::saveParamSpace(const Base::Vector3d& direction, const Base::Vector3d& xAxis)
{
//Base::Console().Message("TRACE - DVP::saveParamSpace()\n");
(void)xAxis;
Base::Vector3d origin(0.0,0.0,0.0);
gp_Ax2 viewAxis = getViewAxis(origin,direction);
@@ -677,7 +665,6 @@ void DrawViewPart::getRunControl()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
m_sectionEdges = hGrp->GetBool("ShowSectionEdges", 0l);
m_handleFaces = hGrp->GetBool("HandleFaces", 1l);
//Base::Console().Message("TRACE - DVP::getRunControl - handleFaces: %d\n",m_handleFaces);
}
bool DrawViewPart::handleFaces(void)
@@ -694,7 +681,7 @@ bool DrawViewPart::showSectionEdges(void)
//! hatches, geomhatches, dimensions,...
void DrawViewPart::unsetupObject()
{
nowDeleting = true;
nowUnsetting = true;
App::Document* doc = getDocument();
std::string docName = doc->getName();

View File

@@ -150,7 +150,7 @@ public:
}
//return PyObject as DrawViewPartPy
virtual PyObject *getPyObject(void);
bool isDeleting(void) { return nowDeleting; }
bool isUnsetting(void) { return nowUnsetting; }
gp_Pln getProjPlane(void) const;
virtual std::vector<TopoDS_Wire> getWireForFace(int idx) const;
@@ -178,7 +178,7 @@ protected:
bool m_handleFaces;
private:
bool nowDeleting;
bool nowUnsetting;
};

View File

@@ -135,7 +135,7 @@ void ViewProviderPage::updateData(const App::Property* prop)
if (getDrawPage()->KeepUpdated.getValue()) {
sPixmap = "TechDraw_Tree_Page";
if (!m_mdiView.isNull() &&
!getDrawPage()->isDeleting()) {
!getDrawPage()->isUnsetting()) {
m_mdiView->updateDrawing();
}
} else {
@@ -146,13 +146,13 @@ void ViewProviderPage::updateData(const App::Property* prop)
//if a view is added/deleted, rebuild the visual
if (prop == &(getDrawPage()->Views)) {
if(!m_mdiView.isNull() &&
!getDrawPage()->isDeleting()) {
!getDrawPage()->isUnsetting()) {
m_mdiView->updateDrawing();
}
//if the template is changed, rebuild the visual
} else if (prop == &(getDrawPage()->Template)) {
if(m_mdiView &&
!getDrawPage()->isDeleting()) {
!getDrawPage()->isUnsetting()) {
m_mdiView->updateTemplate();
}
}
@@ -359,7 +359,7 @@ void ViewProviderPage::onGuiRepaint(const TechDraw::DrawPage* dp)
{
if (dp == getDrawPage()) {
if(!m_mdiView.isNull() &&
!getDrawPage()->isDeleting()) {
!getDrawPage()->isUnsetting()) {
m_mdiView->updateDrawing();
}
}