diff --git a/src/Mod/TechDraw/App/AppTechDrawPy.cpp b/src/Mod/TechDraw/App/AppTechDrawPy.cpp index e2e5dca25c..e092d9592c 100644 --- a/src/Mod/TechDraw/App/AppTechDrawPy.cpp +++ b/src/Mod/TechDraw/App/AppTechDrawPy.cpp @@ -242,7 +242,6 @@ private: } if (edgeList.empty()) { - Base::Console().Log("LOG - edgeWalker: input is empty\n"); return Py::None(); } @@ -369,7 +368,6 @@ private: } if (edgeList.empty()) { - Base::Console().Log("LOG - ATDP::findShapeOutline: input is empty\n"); return Py::None(); } diff --git a/src/Mod/TechDraw/App/DrawGeomHatch.cpp b/src/Mod/TechDraw/App/DrawGeomHatch.cpp index 2a6d33bcbd..744a4c1b58 100644 --- a/src/Mod/TechDraw/App/DrawGeomHatch.cpp +++ b/src/Mod/TechDraw/App/DrawGeomHatch.cpp @@ -243,7 +243,6 @@ std::vector DrawGeomHatch::getTrimmedLines(int i) //get the trimmed DrawViewPart* source = getSourceView(); if (!source || !source->hasGeometry()) { - Base::Console().Log("DGH::getTrimmedLines - no source geometry\n"); return result; } return getTrimmedLines(source, m_lineSets, i, ScalePattern.getValue(), @@ -310,7 +309,6 @@ std::vector DrawGeomHatch::getTrimmedLines(DrawViewPart* source, std::vector result; if (lineSets.empty()) { - Base::Console().Log("DGH::getTrimmedLines - no LineSets!\n"); return result; } @@ -350,7 +348,6 @@ std::vector DrawGeomHatch::getTrimmedLines(DrawViewPart* source, BRepAlgoAPI_Common mkCommon(face, grid); if ((!mkCommon.IsDone()) || (mkCommon.Shape().IsNull()) ) { - Base::Console().Log("INFO - DGH::getTrimmedLines - Common creation failed\n"); return result; } TopoDS_Shape common = mkCommon.Shape(); @@ -368,7 +365,6 @@ std::vector DrawGeomHatch::getTrimmedLines(DrawViewPart* source, for ( int i = 1 ; i <= mapOfEdges.Extent() ; i++ ) { //remember, TopExp makes no promises about the order it finds edges const TopoDS_Edge& edge = TopoDS::Edge(mapOfEdges(i)); if (edge.IsNull()) { - Base::Console().Log("INFO - DGH::getTrimmedLines - edge: %d is NULL\n", i); continue; } resultEdges.push_back(edge); @@ -379,7 +375,6 @@ std::vector DrawGeomHatch::getTrimmedLines(DrawViewPart* source, for (auto& e: resultEdges) { TechDraw::BaseGeomPtr base = BaseGeom::baseFactory(e); if (!base) { - Base::Console().Log("FAIL - DGH::getTrimmedLines - baseFactory failed for edge: %d\n", i); throw Base::ValueError("DGH::getTrimmedLines - baseFactory failed"); } resultGeoms.push_back(base); @@ -519,7 +514,6 @@ std::vector DrawGeomHatch::getFaceOverlay(int fdx) DrawViewPart* source = getSourceView(); if (!source || !source->hasGeometry()) { - Base::Console().Log("DGH::getFaceOverlay - no source geometry\n"); return result; } @@ -541,7 +535,6 @@ std::vector DrawGeomHatch::getFaceOverlay(int fdx) for (auto& e: candidates) { TechDraw::BaseGeomPtr base = BaseGeom::baseFactory(e); if (!base) { - Base::Console().Log("FAIL - DGH::getFaceOverlay - baseFactory failed for edge: %d\n", i); throw Base::ValueError("DGH::getFaceOverlay - baseFactory failed"); } resultGeoms.push_back(base); @@ -575,7 +568,6 @@ TopoDS_Face DrawGeomHatch::extractFace(DrawViewPart* source, int iface ) mkFace.Add(*itWire); } if (!mkFace.IsDone()) { - Base::Console().Log("INFO - DGH::extractFace - face creation failed\n"); return result; } TopoDS_Face face = mkFace.Face(); @@ -589,7 +581,6 @@ TopoDS_Face DrawGeomHatch::extractFace(DrawViewPart* source, int iface ) temp = mkTrf.Shape(); } catch (...) { - Base::Console().Log("DGH::extractFace - mirror failed.\n"); return result; } result = TopoDS::Face(temp); diff --git a/src/Mod/TechDraw/App/DrawLeaderLine.cpp b/src/Mod/TechDraw/App/DrawLeaderLine.cpp index e1db3276f7..a1056066e8 100644 --- a/src/Mod/TechDraw/App/DrawLeaderLine.cpp +++ b/src/Mod/TechDraw/App/DrawLeaderLine.cpp @@ -179,9 +179,6 @@ double DrawLeaderLine::getBaseScale() const DrawView* parent = getBaseView(); if (parent) { result = parent->getScale(); - } else { - //TARFU - Base::Console().Log("DrawLeaderLine - %s - scale not found. Using 1.0. \n", getNameInDocument()); } return result; } @@ -194,9 +191,6 @@ double DrawLeaderLine::getScale() const DrawView* parent = getBaseView(); if (parent) { result = parent->getScale(); - } else { - //TARFU - Base::Console().Log("DrawLeaderLine - %s - scale not found. Using 1.0. \n", getNameInDocument()); } } return result; diff --git a/src/Mod/TechDraw/App/DrawPage.cpp b/src/Mod/TechDraw/App/DrawPage.cpp index e419dcea9c..933eee49c4 100644 --- a/src/Mod/TechDraw/App/DrawPage.cpp +++ b/src/Mod/TechDraw/App/DrawPage.cpp @@ -420,10 +420,6 @@ void DrawPage::unsetupObject() docName.c_str(), viewName.c_str()); } - else { - Base::Console().Log("DP::unsetupObject - v(%s) is not in document. skipping\n", - pageName.c_str()); - } } std::vector emptyViews;//probably superfluous Views.setValues(emptyViews); @@ -466,11 +462,6 @@ void DrawPage::handleChangedPropertyType(Base::XMLReader& reader, const char* Ty Scale.setValue(1.0); } } - else { - // has Scale prop that isn't Float! - Base::Console().Log("DrawPage::Restore - old Document Scale is Not Float!\n"); - // no idea - } } } diff --git a/src/Mod/TechDraw/App/DrawProjGroup.cpp b/src/Mod/TechDraw/App/DrawProjGroup.cpp index 95e19ad143..5c19708466 100644 --- a/src/Mod/TechDraw/App/DrawProjGroup.cpp +++ b/src/Mod/TechDraw/App/DrawProjGroup.cpp @@ -24,12 +24,12 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include -# include -# include -# include -# include -# include +#include +#include +#include +#include +#include +#include #endif #include @@ -40,30 +40,32 @@ #include #include -#include "DrawProjGroup.h" -#include "DrawProjGroupPy.h" // generated from DrawProjGroupPy.xml #include "DrawPage.h" +#include "DrawProjGroup.h" #include "DrawProjGroupItem.h" +#include "DrawProjGroupPy.h"// generated from DrawProjGroupPy.xml #include "DrawUtil.h" #include "Preferences.h" using namespace TechDraw; -const char* DrawProjGroup::ProjectionTypeEnums[] = {"First Angle", - "Third Angle", - "Default", //Use Page setting +const char* DrawProjGroup::ProjectionTypeEnums[] = {"First Angle", "Third Angle", + "Default",//Use Page setting nullptr}; PROPERTY_SOURCE(TechDraw::DrawProjGroup, TechDraw::DrawViewCollection) DrawProjGroup::DrawProjGroup() { - static const char *group = "Base"; - static const char *agroup = "Distribute"; + static const char* group = "Base"; + static const char* agroup = "Distribute"; - Base::Reference hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")-> - GetGroup("Preferences")->GetGroup("Mod/TechDraw/General"); + Base::Reference hGrp = App::GetApplication() + .GetUserParameter() + .GetGroup("BaseApp") + ->GetGroup("Preferences") + ->GetGroup("Mod/TechDraw/General"); bool autoDist = hGrp->GetBool("AutoDist", true); ADD_PROPERTY_TYPE(Source, (nullptr), group, App::Prop_None, "Shape to view"); @@ -71,25 +73,30 @@ DrawProjGroup::DrawProjGroup() Source.setAllowExternal(true); ADD_PROPERTY_TYPE(XSource, (nullptr), group, App::Prop_None, "External 3D Shape to view"); - ADD_PROPERTY_TYPE(Anchor, (nullptr), group, App::Prop_None, "The root view to align projections with"); + ADD_PROPERTY_TYPE(Anchor, (nullptr), group, App::Prop_None, + "The root view to align projections with"); Anchor.setScope(App::LinkScope::Global); ProjectionType.setEnums(ProjectionTypeEnums); - ADD_PROPERTY_TYPE(ProjectionType, ((long)getDefProjConv()), group, - App::Prop_None, "First or Third angle projection"); + ADD_PROPERTY_TYPE(ProjectionType, ((long)getDefProjConv()), group, App::Prop_None, + "First or Third angle projection"); - ADD_PROPERTY_TYPE(AutoDistribute, (autoDist), agroup, - App::Prop_None, "Distribute views automatically or manually"); - ADD_PROPERTY_TYPE(spacingX, (15), agroup, App::Prop_None, "If AutoDistribute is on, this is the horizontal \nspacing between the borders of views \n(if label width is not wider than the object)"); - ADD_PROPERTY_TYPE(spacingY, (15), agroup, App::Prop_None, "If AutoDistribute is on, this is the vertical \nspacing between the borders of views"); - Rotation.setStatus(App::Property::Hidden, true); //DPG does not rotate + ADD_PROPERTY_TYPE(AutoDistribute, (autoDist), agroup, App::Prop_None, + "Distribute views automatically or manually"); + ADD_PROPERTY_TYPE(spacingX, (15), agroup, App::Prop_None, + "If AutoDistribute is on, this is the horizontal \nspacing between the " + "borders of views \n(if label width is not wider than the object)"); + ADD_PROPERTY_TYPE( + spacingY, (15), agroup, App::Prop_None, + "If AutoDistribute is on, this is the vertical \nspacing between the borders of views"); + Rotation.setStatus(App::Property::Hidden, true);//DPG does not rotate Caption.setStatus(App::Property::Hidden, true); } //TODO: this duplicates code in DVP std::vector DrawProjGroup::getAllSources() const { -// Base::Console().Message("DPG::getAllSources()\n"); + // Base::Console().Message("DPG::getAllSources()\n"); const std::vector links = Source.getValues(); std::vector xLinks; XSource.getLinks(xLinks); @@ -109,7 +116,7 @@ void DrawProjGroup::onChanged(const App::Property* prop) return TechDraw::DrawViewCollection::onChanged(prop); } - TechDraw::DrawPage *page = getPage(); + TechDraw::DrawPage* page = getPage(); if (prop == &Scale) { updateChildrenScale(); @@ -122,14 +129,12 @@ void DrawProjGroup::onChanged(const App::Property* prop) return; } - if ( prop == &Source || - prop == &XSource ) { + if (prop == &Source || prop == &XSource) { updateChildrenSource(); return; } - if ( prop == &spacingX || - prop == &spacingY ) { + if (prop == &spacingX || prop == &spacingY) { updateChildrenEnforce(); return; } @@ -142,24 +147,23 @@ void DrawProjGroup::onChanged(const App::Property* prop) if (prop == &ScaleType) { if (ScaleType.isValue("Page")) { double newScale = page->Scale.getValue(); - if(std::abs(getScale() - newScale) > FLT_EPSILON) { + if (std::abs(getScale() - newScale) > FLT_EPSILON) { Scale.setValue(newScale); updateChildrenScale(); } } } -// if ( ScaleType.isValue("Automatic") || -// ScaleType.isValue("Custom") ){ -// //just documenting that nothing is required here -// //DrawView::onChanged will sort out Scale hidden/readonly/etc -// } + // if ( ScaleType.isValue("Automatic") || + // ScaleType.isValue("Custom") ){ + // //just documenting that nothing is required here + // //DrawView::onChanged will sort out Scale hidden/readonly/etc + // } if (prop == &Rotation) { if (!DrawUtil::fpCompare(Rotation.getValue(), 0.0)) { Rotation.setValue(0.0); purgeTouched(); - Base::Console().Log("DPG: Projection Groups do not rotate. Change ignored.\n"); } return; } @@ -167,10 +171,10 @@ void DrawProjGroup::onChanged(const App::Property* prop) TechDraw::DrawViewCollection::onChanged(prop); } -App::DocumentObjectExecReturn *DrawProjGroup::execute() +App::DocumentObjectExecReturn* DrawProjGroup::execute() { -// Base::Console().Message("DPG::execute() - %s - waitingForChildren: %d\n", -// getNameInDocument(), waitingForChildren()); + // Base::Console().Message("DPG::execute() - %s - waitingForChildren: %d\n", + // getNameInDocument(), waitingForChildren()); if (!keepUpdated()) return App::DocumentObject::StdReturn; @@ -207,17 +211,10 @@ short DrawProjGroup::mustExecute() const { short result = 0; if (!isRestoring()) { - result = Views.isTouched() || - Source.isTouched() || - XSource.isTouched() || - Scale.isTouched() || - ScaleType.isTouched() || - ProjectionType.isTouched() || - Anchor.isTouched() || - AutoDistribute.isTouched() || - LockPosition.isTouched()|| - spacingX.isTouched() || - spacingY.isTouched(); + result = Views.isTouched() || Source.isTouched() || XSource.isTouched() || Scale.isTouched() + || ScaleType.isTouched() || ProjectionType.isTouched() || Anchor.isTouched() + || AutoDistribute.isTouched() || LockPosition.isTouched() || spacingX.isTouched() + || spacingY.isTouched(); } if (result) return result; @@ -226,7 +223,7 @@ short DrawProjGroup::mustExecute() const void DrawProjGroup::reportReady() { -// Base::Console().Message("DPG::reportReady - waitingForChildren: %d\n", waitingForChildren()); + // Base::Console().Message("DPG::reportReady - waitingForChildren: %d\n", waitingForChildren()); if (waitingForChildren()) { //not ready yet return; @@ -239,45 +236,41 @@ void DrawProjGroup::reportReady() bool DrawProjGroup::waitingForChildren() const { - for(const auto v : Views.getValues()) { + for (const auto v : Views.getValues()) { DrawProjGroupItem* dpgi = static_cast(v); - if (dpgi->waitingForHlr() || //dpgi is still thinking - dpgi->isTouched()) { //dpgi needs to execute + if (dpgi->waitingForHlr() ||//dpgi is still thinking + dpgi->isTouched()) { //dpgi needs to execute return true; } } return false; } -TechDraw::DrawPage * DrawProjGroup::getPage() const -{ - return findParentPage(); -} +TechDraw::DrawPage* DrawProjGroup::getPage() const { return findParentPage(); } //does the unscaled DPG fit on the page? bool DrawProjGroup::checkFit() const { -// Base::Console().Message("DPG::checkFit() - %s\n", getNameInDocument()); + // Base::Console().Message("DPG::checkFit() - %s\n", getNameInDocument()); if (waitingForChildren()) { //assume everything fits since we don't know what size the children are return true; } auto page = findParentPage(); if (!page) - throw Base::RuntimeError("No page is assigned to this feature"); + throw Base::RuntimeError("No page is assigned to this feature"); return checkFit(page); } bool DrawProjGroup::checkFit(DrawPage* page) const { -// Base::Console().Message("DPG::checkFit(page) - %s\n", getNameInDocument()); + // Base::Console().Message("DPG::checkFit(page) - %s\n", getNameInDocument()); if (waitingForChildren()) { return true; } QRectF bigBox = getRect(false); - if ( bigBox.width() <= page->getPageWidth() && - bigBox.height() <= page->getPageHeight() ) { + if (bigBox.width() <= page->getPageWidth() && bigBox.height() <= page->getPageHeight()) { return true; } return false; @@ -286,36 +279,33 @@ bool DrawProjGroup::checkFit(DrawPage* page) const //calculate a scale that fits all views on page double DrawProjGroup::autoScale() const { -// Base::Console().Message("DPG::autoScale() - %s\n", getNameInDocument()); + // Base::Console().Message("DPG::autoScale() - %s\n", getNameInDocument()); auto page = findParentPage(); if (!page) { - throw Base::RuntimeError("No page is assigned to this feature"); + throw Base::RuntimeError("No page is assigned to this feature"); } return autoScale(page->getPageWidth(), page->getPageHeight()); } double DrawProjGroup::autoScale(double w, double h) const { -// Base::Console().Message("DPG::autoScale(%.3f, %.3f) - %s\n", w, h, getNameInDocument()); + // Base::Console().Message("DPG::autoScale(%.3f, %.3f) - %s\n", w, h, getNameInDocument()); //get the space used by views + white space at 1:1 scale - QRectF bigBox = getRect(false); //unscaled box + QRectF bigBox = getRect(false);//unscaled box - double xScale = w / bigBox.width(); // > 1 page bigger than figure - double yScale = h / bigBox.height(); // < 1 page is smaller than figure + double xScale = w / bigBox.width(); // > 1 page bigger than figure + double yScale = h / bigBox.height();// < 1 page is smaller than figure double newScale = std::min(xScale, yScale); return DrawUtil::sensibleScale(newScale); } //returns the bounding rectangle of all the views in the current scale -QRectF DrawProjGroup::getRect() const -{ - return getRect(true); -} +QRectF DrawProjGroup::getRect() const { return getRect(true); } QRectF DrawProjGroup::getRect(bool scaled) const { -// Base::Console().Message("DPG::getRect - views: %d\n", Views.getValues().size()); + // Base::Console().Message("DPG::getRect - views: %d\n", Views.getValues().size()); std::array viewPtrs; arrangeViewPointers(viewPtrs); double totalWidth, totalHeight; @@ -324,17 +314,16 @@ QRectF DrawProjGroup::getRect(bool scaled) const double ySpace = spacingY.getValue() * 2.0; double rectW = totalWidth + xSpace; double rectH = totalHeight + ySpace; - double fudge = 1.2; //make rect a little big to make sure it fits + double fudge = 1.2;//make rect a little big to make sure it fits rectW *= fudge; rectH *= fudge; - return { 0, 0, rectW, rectH }; + return {0, 0, rectW, rectH}; } //find area consumed by Views only - scaled or unscaled void DrawProjGroup::getViewArea(std::array& viewPtrs, - double &width, double &height, - bool scaled) const + double& width, double& height, bool scaled) const { // Get the child view bounding boxes std::array bboxes; @@ -342,29 +331,35 @@ void DrawProjGroup::getViewArea(std::array(it) ); + for (auto it : Views.getValues()) { + auto projPtr(dynamic_cast(it)); if (!projPtr) { //if an element in Views is not a DPGI, something really bad has happened somewhere - Base::Console().Log("PROBLEM - DPG::getProjObj - non DPGI entry in Views! %s / %s\n", - getNameInDocument(), viewProjType); + Base::Console().Error("PROBLEM - DPG::getProjObj - non DPGI entry in Views! %s / %s\n", + getNameInDocument(), viewProjType); throw Base::TypeError("Error: projection in DPG list is not a DPGI!"); - } else if(strcmp(viewProjType, projPtr->Type.getValueAsString()) == 0 ) { + } + else if (strcmp(viewProjType, projPtr->Type.getValueAsString()) == 0) { return it; } } @@ -372,31 +367,25 @@ App::DocumentObject * DrawProjGroup::getProjObj(const char *viewProjType) const return nullptr; } -DrawProjGroupItem* DrawProjGroup::getProjItem(const char *viewProjType) const +DrawProjGroupItem* DrawProjGroup::getProjItem(const char* viewProjType) const { App::DocumentObject* docObj = getProjObj(viewProjType); - auto result( dynamic_cast(docObj) ); + auto result(dynamic_cast(docObj)); if (!result && docObj) { //should never have a item in DPG that is not a DPGI. - Base::Console().Log("PROBLEM - DPG::getProjItem finds non-DPGI in Group %s / %s\n", - getNameInDocument(), viewProjType); + Base::Console().Error("PROBLEM - DPG::getProjItem finds non-DPGI in Group %s / %s\n", + getNameInDocument(), viewProjType); throw Base::TypeError("Error: projection in DPG list is not a DPGI!"); } return result; } -bool DrawProjGroup::checkViewProjType(const char *in) +bool DrawProjGroup::checkViewProjType(const char* in) { - if ( strcmp(in, "Front") == 0 || - strcmp(in, "Left") == 0 || - strcmp(in, "Right") == 0 || - strcmp(in, "Top") == 0 || - strcmp(in, "Bottom") == 0 || - strcmp(in, "Rear") == 0 || - strcmp(in, "FrontTopLeft") == 0 || - strcmp(in, "FrontTopRight") == 0 || - strcmp(in, "FrontBottomLeft") == 0 || - strcmp(in, "FrontBottomRight") == 0) { + if (strcmp(in, "Front") == 0 || strcmp(in, "Left") == 0 || strcmp(in, "Right") == 0 + || strcmp(in, "Top") == 0 || strcmp(in, "Bottom") == 0 || strcmp(in, "Rear") == 0 + || strcmp(in, "FrontTopLeft") == 0 || strcmp(in, "FrontTopRight") == 0 + || strcmp(in, "FrontBottomLeft") == 0 || strcmp(in, "FrontBottomRight") == 0) { return true; } return false; @@ -405,38 +394,38 @@ bool DrawProjGroup::checkViewProjType(const char *in) //******************************** // ProjectionItem A/D/I //******************************** -bool DrawProjGroup::hasProjection(const char *viewProjType) const +bool DrawProjGroup::hasProjection(const char* viewProjType) const { - for( const auto it : Views.getValues() ) { - auto view( dynamic_cast(it) ); + for (const auto it : Views.getValues()) { + auto view(dynamic_cast(it)); if (!view) { //should never have a item in DPG that is not a DPGI. - Base::Console().Log("PROBLEM - DPG::hasProjection finds non-DPGI in Group %s / %s\n", - getNameInDocument(), viewProjType); + Base::Console().Error("PROBLEM - DPG::hasProjection finds non-DPGI in Group %s / %s\n", + getNameInDocument(), viewProjType); throw Base::TypeError("Error: projection in DPG list is not a DPGI!"); } - if (strcmp(viewProjType, view->Type.getValueAsString()) == 0 ) { + if (strcmp(viewProjType, view->Type.getValueAsString()) == 0) { return true; } } return false; } -bool DrawProjGroup::canDelete(const char *viewProjType) const +bool DrawProjGroup::canDelete(const char* viewProjType) const { -// Base::Console().Message("DPG::canDelete(%s)\n", viewProjType); + // Base::Console().Message("DPG::canDelete(%s)\n", viewProjType); TechDraw::DrawProjGroupItem* foundItem(nullptr); - for( const auto it : Views.getValues() ) { - auto view( dynamic_cast(it) ); + for (const auto it : Views.getValues()) { + auto view(dynamic_cast(it)); if (!view) { //should never have a item in DPG that is not a DPGI. - Base::Console().Log("PROBLEM - DPG::hasProjection finds non-DPGI in Group %s / %s\n", - getNameInDocument(), viewProjType); + Base::Console().Error("PROBLEM - DPG::hasProjection finds non-DPGI in Group %s / %s\n", + getNameInDocument(), viewProjType); throw Base::TypeError("Error: projection in DPG list is not a DPGI!"); } - if (strcmp(viewProjType, view->Type.getValueAsString()) == 0 ) { + if (strcmp(viewProjType, view->Type.getValueAsString()) == 0) { foundItem = view; break; } @@ -456,62 +445,66 @@ bool DrawProjGroup::canDelete(const char *viewProjType) const return true; } -App::DocumentObject * DrawProjGroup::addProjection(const char *viewProjType) +App::DocumentObject* DrawProjGroup::addProjection(const char* viewProjType) { - DrawProjGroupItem *view( nullptr ); + DrawProjGroupItem* view(nullptr); std::pair vecs; DrawPage* dp = findParentPage(); if (!dp) - Base::Console().Error("DPG:addProjection - %s - DPG is not on a page!\n", getNameInDocument()); + Base::Console().Error("DPG:addProjection - %s - DPG is not on a page!\n", + getNameInDocument()); - if ( checkViewProjType(viewProjType) && !hasProjection(viewProjType) ) { + if (checkViewProjType(viewProjType) && !hasProjection(viewProjType)) { std::string FeatName = getDocument()->getUniqueObjectName("ProjItem"); - auto docObj( getDocument()->addObject( "TechDraw::DrawProjGroupItem", //add to Document - FeatName.c_str() ) ); - view = dynamic_cast(docObj); + auto docObj(getDocument()->addObject("TechDraw::DrawProjGroupItem",//add to Document + FeatName.c_str())); + view = dynamic_cast(docObj); if (!view && docObj) { //should never happen that we create a DPGI that isn't a DPGI!! - Base::Console().Log("PROBLEM - DPG::addProjection - created a non DPGI! %s / %s\n", - getNameInDocument(), viewProjType); + Base::Console().Error("PROBLEM - DPG::addProjection - created a non DPGI! %s / %s\n", + getNameInDocument(), viewProjType); throw Base::TypeError("Error: new projection is not a DPGI!"); } - if (view) { //coverity CID 151722 + if (view) {//coverity CID 151722 // the label must be set before the view is added view->Label.setValue(viewProjType); - addView(view); //from DrawViewCollection + addView(view);//from DrawViewCollection view->Source.setValues(Source.getValues()); -// std::vector xLinks; -// XSource.getLinks(xLinks); -// view->XSource.setValues(xLinks); + // std::vector xLinks; + // XSource.getLinks(xLinks); + // view->XSource.setValues(xLinks); view->XSource.setValues(XSource.getValues()); // the Scale is already set by DrawView view->Type.setValue(viewProjType); - if (strcmp(viewProjType, "Front") != 0 ) { //not Front! + if (strcmp(viewProjType, "Front") != 0) {//not Front! vecs = getDirsFromFront(view); view->Direction.setValue(vecs.first); view->XDirection.setValue(vecs.second); view->recomputeFeature(); - } else { //Front + } + else {//Front Anchor.setValue(view); Anchor.purgeTouched(); - requestPaint(); //make sure the group object is on the Gui page - view->LockPosition.setValue(true); //lock "Front" position within DPG (note not Page!). - view->LockPosition.setStatus(App::Property::ReadOnly, true); //Front should stay locked. + requestPaint();//make sure the group object is on the Gui page + view->LockPosition.setValue( + true);//lock "Front" position within DPG (note not Page!). + view->LockPosition.setStatus(App::Property::ReadOnly, + true);//Front should stay locked. view->LockPosition.purgeTouched(); } - // addView(view); //from DrawViewCollection - // if (view != getAnchor()) { //anchor is done elsewhere - // view->recomputeFeature(); - // } + // addView(view); //from DrawViewCollection + // if (view != getAnchor()) { //anchor is done elsewhere + // view->recomputeFeature(); + // } } } return view; } //NOTE: projections can be deleted without using removeProjection - ie regular DocObject deletion process. -int DrawProjGroup::removeProjection(const char *viewProjType) +int DrawProjGroup::removeProjection(const char* viewProjType) { // TODO: shouldn't be able to delete "Front" unless deleting whole group if (checkViewProjType(viewProjType)) { @@ -521,17 +514,19 @@ int DrawProjGroup::removeProjection(const char *viewProjType) // Iterate through the child views and find the projection type for (auto it : Views.getValues()) { - auto projPtr( dynamic_cast(it) ); + auto projPtr(dynamic_cast(it)); if (projPtr) { if (strcmp(viewProjType, projPtr->Type.getValueAsString()) == 0) { - removeView(projPtr); // Remove from collection - getDocument()->removeObject( it->getNameInDocument() ); // Remove from the document + removeView(projPtr); // Remove from collection + getDocument()->removeObject(it->getNameInDocument());// Remove from the document return Views.getValues().size(); } - } else { + } + else { //if an element in Views is not a DPGI, something really bad has happened somewhere - Base::Console().Log("PROBLEM - DPG::removeProjection - tries to remove non DPGI! %s / %s\n", - getNameInDocument(), viewProjType); + Base::Console().Error( + "PROBLEM - DPG::removeProjection - tries to remove non DPGI! %s / %s\n", + getNameInDocument(), viewProjType); throw Base::TypeError("Error: projection in DPG list is not a DPGI!"); } } @@ -543,18 +538,19 @@ int DrawProjGroup::removeProjection(const char *viewProjType) //removes all DPGI - used when deleting DPG int DrawProjGroup::purgeProjections() { - while (!Views.getValues().empty()) { + while (!Views.getValues().empty()) { std::vector views = Views.getValues(); DrawProjGroupItem* dpgi; - DocumentObject* dObj = views.back(); + DocumentObject* dObj = views.back(); dpgi = dynamic_cast(dObj); if (dpgi) { std::string itemName = dpgi->Type.getValueAsString(); removeProjection(itemName.c_str()); - } else { + } + else { //if an element in Views is not a DPGI, something really bad has happened somewhere - Base::Console().Log("PROBLEM - DPG::purgeProjection - tries to remove non DPGI! %s\n", - getNameInDocument()); + Base::Console().Error("PROBLEM - DPG::purgeProjection - tries to remove non DPGI! %s\n", + getNameInDocument()); throw Base::TypeError("Error: projection in DPG list is not a DPGI!"); } } @@ -576,7 +572,7 @@ std::pair DrawProjGroup::getDirsFromFront(DrawPr std::pair DrawProjGroup::getDirsFromFront(std::string viewType) { -// Base::Console().Message("DPG::getDirsFromFront(%s)\n", viewType.c_str()); + // Base::Console().Message("DPG::getDirsFromFront(%s)\n", viewType.c_str()); std::pair result; Base::Vector3d projDir, rotVec; @@ -601,59 +597,57 @@ std::pair DrawProjGroup::getDirsFromFront(std::s gp_Dir gNewDir; gp_Dir gNewXDir; - double angle = M_PI / 2.0; //90* + double angle = M_PI / 2.0;//90* if (viewType == "Right") { newCS = anchorCS.Rotated(gUpAxis, angle); projDir = dir2vec(newCS.Direction()); - rotVec = dir2vec(newCS.XDirection()); - } else if (viewType == "Left") { + rotVec = dir2vec(newCS.XDirection()); + } + else if (viewType == "Left") { newCS = anchorCS.Rotated(gUpAxis, -angle); projDir = dir2vec(newCS.Direction()); - rotVec = dir2vec(newCS.XDirection()); - } else if (viewType == "Top") { + rotVec = dir2vec(newCS.XDirection()); + } + else if (viewType == "Top") { projDir = dir2vec(gYDir); - rotVec = dir2vec(gXDir); - } else if (viewType == "Bottom") { + rotVec = dir2vec(gXDir); + } + else if (viewType == "Bottom") { projDir = dir2vec(gYDir.Reversed()); - rotVec = dir2vec(gXDir); - } else if (viewType == "Rear") { + rotVec = dir2vec(gXDir); + } + else if (viewType == "Rear") { projDir = dir2vec(gDir.Reversed()); - rotVec = dir2vec(gXDir.Reversed()); - } else if (viewType == "FrontTopLeft") { - gp_Dir newDir = gp_Dir(gp_Vec(gDir) - - gp_Vec(gXDir) + - gp_Vec(gYDir)); + rotVec = dir2vec(gXDir.Reversed()); + } + else if (viewType == "FrontTopLeft") { + gp_Dir newDir = gp_Dir(gp_Vec(gDir) - gp_Vec(gXDir) + gp_Vec(gYDir)); projDir = dir2vec(newDir); - gp_Dir newXDir = gp_Dir(gp_Vec(gXDir) + - gp_Vec(gDir)); + gp_Dir newXDir = gp_Dir(gp_Vec(gXDir) + gp_Vec(gDir)); rotVec = dir2vec(newXDir); - } else if (viewType == "FrontTopRight") { - gp_Dir newDir = gp_Dir(gp_Vec(gDir) + - gp_Vec(gXDir) + - gp_Vec(gYDir)); + } + else if (viewType == "FrontTopRight") { + gp_Dir newDir = gp_Dir(gp_Vec(gDir) + gp_Vec(gXDir) + gp_Vec(gYDir)); projDir = dir2vec(newDir); - gp_Dir newXDir = gp_Dir(gp_Vec(gXDir) - - gp_Vec(gDir)); + gp_Dir newXDir = gp_Dir(gp_Vec(gXDir) - gp_Vec(gDir)); rotVec = dir2vec(newXDir); - } else if (viewType == "FrontBottomLeft") { - gp_Dir newDir = gp_Dir(gp_Vec(gDir) - - gp_Vec(gXDir) - - gp_Vec(gYDir)); + } + else if (viewType == "FrontBottomLeft") { + gp_Dir newDir = gp_Dir(gp_Vec(gDir) - gp_Vec(gXDir) - gp_Vec(gYDir)); projDir = dir2vec(newDir); - gp_Dir newXDir = gp_Dir(gp_Vec(gXDir) + - gp_Vec(gDir)); + gp_Dir newXDir = gp_Dir(gp_Vec(gXDir) + gp_Vec(gDir)); rotVec = dir2vec(newXDir); - } else if (viewType == "FrontBottomRight") { - gp_Dir newDir = gp_Dir(gp_Vec(gDir) + - gp_Vec(gXDir) - - gp_Vec(gYDir)); + } + else if (viewType == "FrontBottomRight") { + gp_Dir newDir = gp_Dir(gp_Vec(gDir) + gp_Vec(gXDir) - gp_Vec(gYDir)); projDir = dir2vec(newDir); - gp_Dir newXDir = gp_Dir(gp_Vec(gXDir) - - gp_Vec(gDir)); + gp_Dir newXDir = gp_Dir(gp_Vec(gXDir) - gp_Vec(gDir)); rotVec = dir2vec(newXDir); - } else { - Base::Console().Error("DrawProjGroup - %s unknown projection: %s\n", getNameInDocument(), viewType.c_str()); + } + else { + Base::Console().Error("DrawProjGroup - %s unknown projection: %s\n", getNameInDocument(), + viewType.c_str()); return result; } @@ -663,24 +657,20 @@ std::pair DrawProjGroup::getDirsFromFront(std::s Base::Vector3d DrawProjGroup::dir2vec(gp_Dir d) { - Base::Vector3d result(d.X(), - d.Y(), - d.Z()); + Base::Vector3d result(d.X(), d.Y(), d.Z()); return result; } gp_Dir DrawProjGroup::vec2dir(Base::Vector3d v) { - gp_Dir result(v.x, - v.y, - v.z); + gp_Dir result(v.x, v.y, v.z); return result; } //this can be improved. this implementation positions views too far apart. -Base::Vector3d DrawProjGroup::getXYPosition(const char *viewTypeCStr) +Base::Vector3d DrawProjGroup::getXYPosition(const char* viewTypeCStr) { -// Base::Console().Message("DPG::getXYPosition(%s)\n", Label.getValue()); + // Base::Console().Message("DPG::getXYPosition(%s)\n", Label.getValue()); // Third Angle: FTL T FTRight 0 1 2 // L F Right Rear 3 4 5 6 // FBL B FBRight 7 8 9 @@ -691,7 +681,7 @@ Base::Vector3d DrawProjGroup::getXYPosition(const char *viewTypeCStr) Base::Vector3d result(0.0, 0.0, 0.0); //Front view position is always (0, 0) - if (strcmp(viewTypeCStr, "Front") == 0 ) { // Front! + if (strcmp(viewTypeCStr, "Front") == 0) {// Front! return result; } const int idxCount = MAXPROJECTIONCOUNT; @@ -699,8 +689,8 @@ Base::Vector3d DrawProjGroup::getXYPosition(const char *viewTypeCStr) arrangeViewPointers(viewPtrs); int viewIndex = getViewIndex(viewTypeCStr); - //TODO: bounding boxes do not take view orientation into account - // i.e. X&Y widths might be swapped on page + //TODO: bounding boxes do not take view orientation into account + // i.e. X&Y widths might be swapped on page if (viewPtrs[viewIndex]->LockPosition.getValue()) { result.x = viewPtrs[viewIndex]->X.getValue(); @@ -713,10 +703,10 @@ Base::Vector3d DrawProjGroup::getXYPosition(const char *viewTypeCStr) // Calculate bounding boxes for each displayed view std::array bboxes; - makeViewBbs(viewPtrs, bboxes); //scaled + makeViewBbs(viewPtrs, bboxes);//scaled - double xSpacing = spacingX.getValue(); //in mm, no scale - double ySpacing = spacingY.getValue(); //in mm, no scale + double xSpacing = spacingX.getValue();//in mm, no scale + double ySpacing = spacingY.getValue();//in mm, no scale std::array topRowBoxes {0, 1, 2}; std::array middleRowBoxes {3, 4, 5}; @@ -724,108 +714,90 @@ Base::Vector3d DrawProjGroup::getXYPosition(const char *viewTypeCStr) std::array leftColBoxes {0, 3, 7}; std::array middleColBoxes {1, 4, 8}; std::array rightColBoxes {2, 5, 9}; - double bigHeightTop = getMaxRowHeight(topRowBoxes, bboxes); - double bigHeightMiddle = getMaxRowHeight(middleRowBoxes, bboxes); - double bigHeightBottom = getMaxRowHeight(bottomRowBoxes, bboxes); - double bigWidthLeft = getMaxColWidth(leftColBoxes, bboxes); - double bigWidthMiddle = getMaxColWidth(middleColBoxes, bboxes); - double bigWidthRight = getMaxColWidth(rightColBoxes, bboxes); + double bigHeightTop = getMaxRowHeight(topRowBoxes, bboxes); + double bigHeightMiddle = getMaxRowHeight(middleRowBoxes, bboxes); + double bigHeightBottom = getMaxRowHeight(bottomRowBoxes, bboxes); + double bigWidthLeft = getMaxColWidth(leftColBoxes, bboxes); + double bigWidthMiddle = getMaxColWidth(middleColBoxes, bboxes); + double bigWidthRight = getMaxColWidth(rightColBoxes, bboxes); double bigWidthFarRight = 0.0; if (bboxes[6].IsValid()) { bigWidthFarRight = bboxes[6].LengthX(); } - if (viewPtrs[4] && //Front + if (viewPtrs[4] &&//Front bboxes[4].IsValid()) { position[4].x = 0.0; position[4].y = 0.0; } - if (viewPtrs[3] && // L/R (third/first) middle/left - bboxes[3].IsValid() && - bboxes[4].IsValid()) { - position[3].x = -(0.5 * bigWidthMiddle + xSpacing + - 0.5 * bigWidthLeft); + if (viewPtrs[3] &&// L/R (third/first) middle/left + bboxes[3].IsValid() && bboxes[4].IsValid()) { + position[3].x = -(0.5 * bigWidthMiddle + xSpacing + 0.5 * bigWidthLeft); position[3].y = 0.0; } - if (viewPtrs[5] && // R/L (third/first) middle/right - bboxes[5].IsValid() && - bboxes[4].IsValid()) { - position[5].x = 0.5 * bigWidthMiddle + xSpacing + - 0.5 * bigWidthRight; + if (viewPtrs[5] &&// R/L (third/first) middle/right + bboxes[5].IsValid() && bboxes[4].IsValid()) { + position[5].x = 0.5 * bigWidthMiddle + xSpacing + 0.5 * bigWidthRight; position[5].y = 0.0; } - if (viewPtrs[6] && - bboxes[6].IsValid()) { //"Rear" middle/far right - if (viewPtrs[5] && - bboxes[5].IsValid()) { + if (viewPtrs[6] && bboxes[6].IsValid()) {//"Rear" middle/far right + if (viewPtrs[5] && bboxes[5].IsValid()) { //there is a view between Front and Rear - position[6].x = 0.5 * bigWidthMiddle + xSpacing + - bigWidthRight + xSpacing + - 0.5 * bigWidthFarRight; + position[6].x = 0.5 * bigWidthMiddle + xSpacing + bigWidthRight + xSpacing + + 0.5 * bigWidthFarRight; position[6].y = 0.0; - } else if (viewPtrs[4] && - bboxes[4].IsValid()) { + } + else if (viewPtrs[4] && bboxes[4].IsValid()) { // there is no view between Front and Rear position[6].x = 0.5 * bigWidthMiddle + xSpacing + 0.5 * bigWidthRight; position[6].y = 0.0; } } - if (viewPtrs[1] && // T/B (third/first) top/middle - bboxes[1].IsValid() && - bboxes[4].IsValid()) { + if (viewPtrs[1] &&// T/B (third/first) top/middle + bboxes[1].IsValid() && bboxes[4].IsValid()) { position[1].x = 0.0; - position[1].y = 0.5 * bigHeightMiddle + ySpacing + - 0.5 * bigHeightTop; + position[1].y = 0.5 * bigHeightMiddle + ySpacing + 0.5 * bigHeightTop; } - if (viewPtrs[8] && // B/T (third/first) bottom/middle - bboxes[8].IsValid() && - bboxes[4].IsValid()) { + if (viewPtrs[8] &&// B/T (third/first) bottom/middle + bboxes[8].IsValid() && bboxes[4].IsValid()) { position[8].x = 0.0; - position[8].y = -(0.5 * bigHeightMiddle + ySpacing + - 0.5 * bigHeightBottom); + position[8].y = -(0.5 * bigHeightMiddle + ySpacing + 0.5 * bigHeightBottom); } - if (viewPtrs[0] && // iso top left + if (viewPtrs[0] &&// iso top left bboxes[0].IsValid()) { - position[0].x = -(0.5 * bigWidthMiddle + xSpacing + - 0.5 * bigWidthLeft); - position[0].y = 0.5 * bigHeightMiddle + ySpacing + - 0.5 * bigHeightTop; + position[0].x = -(0.5 * bigWidthMiddle + xSpacing + 0.5 * bigWidthLeft); + position[0].y = 0.5 * bigHeightMiddle + ySpacing + 0.5 * bigHeightTop; } - if (viewPtrs[2] && // iso top right + if (viewPtrs[2] &&// iso top right bboxes[2].IsValid()) { - position[2].x = 0.5 * bigWidthMiddle + xSpacing + - 0.5 * bigWidthRight; - position[2].y = 0.5 * bigHeightMiddle + ySpacing + - 0.5 * bigHeightTop; + position[2].x = 0.5 * bigWidthMiddle + xSpacing + 0.5 * bigWidthRight; + position[2].y = 0.5 * bigHeightMiddle + ySpacing + 0.5 * bigHeightTop; } - if (viewPtrs[7] && // iso bottom left + if (viewPtrs[7] &&// iso bottom left bboxes[7].IsValid()) { - position[7].x = -(0.5 * bigWidthMiddle + xSpacing + - 0.5 * bigWidthLeft); - position[7].y = -(0.5 * bigHeightMiddle + ySpacing + - 0.5 * bigHeightBottom); + position[7].x = -(0.5 * bigWidthMiddle + xSpacing + 0.5 * bigWidthLeft); + position[7].y = -(0.5 * bigHeightMiddle + ySpacing + 0.5 * bigHeightBottom); } - if (viewPtrs[9] && // iso bottom right + if (viewPtrs[9] &&// iso bottom right bboxes[9].IsValid()) { - position[9].x = 0.5 * bigWidthMiddle + xSpacing + - 0.5 * bigWidthRight; - position[9].y = -(0.5 * bigHeightMiddle + ySpacing + - 0.5 * bigHeightBottom); + position[9].x = 0.5 * bigWidthMiddle + xSpacing + 0.5 * bigWidthRight; + position[9].y = -(0.5 * bigHeightMiddle + ySpacing + 0.5 * bigHeightBottom); } result.x = position[viewIndex].x; result.y = position[viewIndex].y; - } else { + } + else { result.x = viewPtrs[viewIndex]->X.getValue(); result.y = viewPtrs[viewIndex]->Y.getValue(); } @@ -846,7 +818,7 @@ double DrawProjGroup::getMaxRowHeight(std::array list, } double DrawProjGroup::getMaxColWidth(std::array list, - std::array bboxes) + std::array bboxes) { double bigWidth = 0.0; for (auto index : list) { @@ -858,27 +830,29 @@ double DrawProjGroup::getMaxColWidth(std::array list, return bigWidth; } -int DrawProjGroup::getViewIndex(const char *viewTypeCStr) const +int DrawProjGroup::getViewIndex(const char* viewTypeCStr) const { - int result = 4; //default to front view's position + int result = 4;//default to front view's position // Determine layout - should be either "First Angle" or "Third Angle" const char* projType; DrawPage* dp = findParentPage(); if (ProjectionType.isValue("Default")) { if (dp) { projType = dp->ProjectionType.getValueAsString(); - } else { - Base::Console().Warning("DPG: %s - can not find parent page. Using default Projection Type. (1)\n", - getNameInDocument()); + } + else { + Base::Console().Warning( + "DPG: %s - can not find parent page. Using default Projection Type. (1)\n", + getNameInDocument()); int projConv = getDefProjConv(); projType = ProjectionTypeEnums[projConv]; } - } else { + } + else { projType = ProjectionType.getValueAsString(); } - if ( strcmp(projType, "Third Angle") == 0 || - strcmp(projType, "First Angle") == 0 ) { + if (strcmp(projType, "Third Angle") == 0 || strcmp(projType, "First Angle") == 0) { // Third Angle: FTL T FTRight 0 1 2 // L F Right Rear 3 4 5 6 // FBL B FBRight 7 8 9 @@ -890,36 +864,48 @@ int DrawProjGroup::getViewIndex(const char *viewTypeCStr) const bool thirdAngle = (strcmp(projType, "Third Angle") == 0); if (strcmp(viewTypeCStr, "Front") == 0) { result = 4; - } else if (strcmp(viewTypeCStr, "Left") == 0) { + } + else if (strcmp(viewTypeCStr, "Left") == 0) { result = thirdAngle ? 3 : 5; - } else if (strcmp(viewTypeCStr, "Right") == 0) { + } + else if (strcmp(viewTypeCStr, "Right") == 0) { result = thirdAngle ? 5 : 3; - } else if (strcmp(viewTypeCStr, "Top") == 0) { + } + else if (strcmp(viewTypeCStr, "Top") == 0) { result = thirdAngle ? 1 : 8; - } else if (strcmp(viewTypeCStr, "Bottom") == 0) { + } + else if (strcmp(viewTypeCStr, "Bottom") == 0) { result = thirdAngle ? 8 : 1; - } else if (strcmp(viewTypeCStr, "Rear") == 0) { + } + else if (strcmp(viewTypeCStr, "Rear") == 0) { result = 6; - } else if (strcmp(viewTypeCStr, "FrontTopLeft") == 0) { + } + else if (strcmp(viewTypeCStr, "FrontTopLeft") == 0) { result = thirdAngle ? 0 : 9; - } else if (strcmp(viewTypeCStr, "FrontTopRight") == 0) { + } + else if (strcmp(viewTypeCStr, "FrontTopRight") == 0) { result = thirdAngle ? 2 : 7; - } else if (strcmp(viewTypeCStr, "FrontBottomLeft") == 0) { + } + else if (strcmp(viewTypeCStr, "FrontBottomLeft") == 0) { result = thirdAngle ? 7 : 2; - } else if (strcmp(viewTypeCStr, "FrontBottomRight") == 0) { + } + else if (strcmp(viewTypeCStr, "FrontBottomRight") == 0) { result = thirdAngle ? 9 : 0; - } else { + } + else { throw Base::TypeError("Unknown view type in DrawProjGroup::getViewIndex()"); } - } else { + } + else { throw Base::ValueError("Unknown Projection convention in DrawProjGroup::getViewIndex()"); } return result; } -void DrawProjGroup::arrangeViewPointers(std::array &viewPtrs) const +void DrawProjGroup::arrangeViewPointers( + std::array& viewPtrs) const { - for (int i=0; i < MAXPROJECTIONCOUNT; ++i) { + for (int i = 0; i < MAXPROJECTIONCOUNT; ++i) { viewPtrs[i] = nullptr; } @@ -929,21 +915,23 @@ void DrawProjGroup::arrangeViewPointers(std::arrayProjectionType.getValueAsString(); - } else { + } + else { Base::Console().Error("DPG:arrangeViewPointers - %s - DPG is not on a page!\n", - getNameInDocument()); - Base::Console().Warning("DPG:arrangeViewPointers - using system default Projection Type\n", - getNameInDocument()); + getNameInDocument()); + Base::Console().Warning( + "DPG:arrangeViewPointers - using system default Projection Type\n", + getNameInDocument()); int projConv = getDefProjConv(); projType = ProjectionTypeEnums[projConv + 1]; } - } else { + } + else { projType = ProjectionType.getValueAsString(); } // Iterate through views and populate viewPtrs - if ( strcmp(projType, "Third Angle") == 0 || - strcmp(projType, "First Angle") == 0 ) { + if (strcmp(projType, "Third Angle") == 0 || strcmp(projType, "First Angle") == 0) { // Third Angle: FTL T FTRight 0 1 2 // L F Right Rear 3 4 5 6 // FBL B FBRight 7 8 9 @@ -954,51 +942,67 @@ void DrawProjGroup::arrangeViewPointers(std::array(it) ); + auto oView(dynamic_cast(it)); if (!oView) { //if an element in Views is not a DPGI, something really bad has happened somewhere - Base::Console().Log("PROBLEM - DPG::arrangeViewPointers - non DPGI in Views! %s\n", - getNameInDocument()); + Base::Console().Error( + "PROBLEM - DPG::arrangeViewPointers - non DPGI in Views! %s\n", + getNameInDocument()); throw Base::TypeError("Error: projection in DPG list is not a DPGI!"); - } else { - const char *viewTypeCStr = oView->Type.getValueAsString(); + } + else { + const char* viewTypeCStr = oView->Type.getValueAsString(); if (strcmp(viewTypeCStr, "Front") == 0) { - //viewPtrs[thirdAngle ? 4 : 4] = oView; + //viewPtrs[thirdAngle ? 4 : 4] = oView; viewPtrs[4] = oView; - } else if (strcmp(viewTypeCStr, "Left") == 0) { + } + else if (strcmp(viewTypeCStr, "Left") == 0) { viewPtrs[thirdAngle ? 3 : 5] = oView; - } else if (strcmp(viewTypeCStr, "Right") == 0) { + } + else if (strcmp(viewTypeCStr, "Right") == 0) { viewPtrs[thirdAngle ? 5 : 3] = oView; - } else if (strcmp(viewTypeCStr, "Top") == 0) { + } + else if (strcmp(viewTypeCStr, "Top") == 0) { viewPtrs[thirdAngle ? 1 : 8] = oView; - } else if (strcmp(viewTypeCStr, "Bottom") == 0) { + } + else if (strcmp(viewTypeCStr, "Bottom") == 0) { viewPtrs[thirdAngle ? 8 : 1] = oView; - } else if (strcmp(viewTypeCStr, "Rear") == 0) { + } + else if (strcmp(viewTypeCStr, "Rear") == 0) { viewPtrs[6] = oView; - } else if (strcmp(viewTypeCStr, "FrontTopLeft") == 0) { + } + else if (strcmp(viewTypeCStr, "FrontTopLeft") == 0) { viewPtrs[thirdAngle ? 0 : 9] = oView; - } else if (strcmp(viewTypeCStr, "FrontTopRight") == 0) { + } + else if (strcmp(viewTypeCStr, "FrontTopRight") == 0) { viewPtrs[thirdAngle ? 2 : 7] = oView; - } else if (strcmp(viewTypeCStr, "FrontBottomLeft") == 0) { + } + else if (strcmp(viewTypeCStr, "FrontBottomLeft") == 0) { viewPtrs[thirdAngle ? 7 : 2] = oView; - } else if (strcmp(viewTypeCStr, "FrontBottomRight") == 0) { + } + else if (strcmp(viewTypeCStr, "FrontBottomRight") == 0) { viewPtrs[thirdAngle ? 9 : 0] = oView; - } else { + } + else { Base::Console().Warning("DPG: %s - unknown view type: %s. \n", getNameInDocument(), viewTypeCStr); - throw Base::TypeError("Unknown view type in DrawProjGroup::arrangeViewPointers."); + throw Base::TypeError( + "Unknown view type in DrawProjGroup::arrangeViewPointers."); } } } - } else { - Base::Console().Warning("DPG: %s - unknown Projection convention: %s\n", getNameInDocument(), projType); - throw Base::ValueError("Unknown Projection convention in DrawProjGroup::arrangeViewPointers"); + } + else { + Base::Console().Warning("DPG: %s - unknown Projection convention: %s\n", + getNameInDocument(), projType); + throw Base::ValueError( + "Unknown Projection convention in DrawProjGroup::arrangeViewPointers"); } } -void DrawProjGroup::makeViewBbs(std::array &viewPtrs, - std::array &bboxes, - bool scaled) const +void DrawProjGroup::makeViewBbs(std::array& viewPtrs, + std::array& bboxes, + bool scaled) const { Base::BoundBox3d empty(Base::Vector3d(0.0, 0.0, 0.0), 0.0); for (int i = 0; i < MAXPROJECTIONCOUNT; ++i) { @@ -1006,8 +1010,8 @@ void DrawProjGroup::makeViewBbs(std::arraygetBoundingBox(); if (!scaled) { - double scale = 1.0 / viewPtrs[i]->getScale(); //convert bbx to 1:1 scale -// double scale = 1.0 / viewPtrs[i]->getLastScale(); //convert bbx to 1:1 scale + double scale = 1.0 / viewPtrs[i]->getScale();//convert bbx to 1:1 scale + // double scale = 1.0 / viewPtrs[i]->getLastScale(); //convert bbx to 1:1 scale bboxes[i].ScaleX(scale); bboxes[i].ScaleY(scale); bboxes[i].ScaleZ(scale); @@ -1018,12 +1022,13 @@ void DrawProjGroup::makeViewBbs(std::array(it) ); + // Base::Console().Message("DPG::recomputeChildren() - waiting: %d\n", waitingForChildren()); + for (const auto it : Views.getValues()) { + auto view(dynamic_cast(it)); if (!view) { throw Base::TypeError("Error: projection in DPG list is not a DPGI!"); - } else { + } + else { view->recomputeFeature(); } } @@ -1031,14 +1036,15 @@ void DrawProjGroup::recomputeChildren() void DrawProjGroup::autoPositionChildren() { -// Base::Console().Message("DPG::autoPositionChildren() - %s - waiting: %d\n", -// getNameInDocument(), waitingForChildren()); - for( const auto it : Views.getValues() ) { - auto view( dynamic_cast(it) ); + // Base::Console().Message("DPG::autoPositionChildren() - %s - waiting: %d\n", + // getNameInDocument(), waitingForChildren()); + for (const auto it : Views.getValues()) { + auto view(dynamic_cast(it)); if (!view) { //if an element in Views is not a DPGI, something really bad has happened somewhere throw Base::TypeError("Error: projection in DPG list is not a DPGI!"); - } else { + } + else { view->autoPosition(); } } @@ -1049,13 +1055,14 @@ void DrawProjGroup::autoPositionChildren() */ void DrawProjGroup::updateChildrenScale() { -// Base::Console().Message("DPG::updateChildrenScale() - waiting: %d\n", waitingForChildren()); - for( const auto it : Views.getValues() ) { - auto view( dynamic_cast(it) ); + // Base::Console().Message("DPG::updateChildrenScale() - waiting: %d\n", waitingForChildren()); + for (const auto it : Views.getValues()) { + auto view(dynamic_cast(it)); if (!view) { //if an element in Views is not a DPGI, something really bad has happened somewhere throw Base::TypeError("Error: projection in DPG list is not a DPGI!"); - } else { + } + else { view->Scale.setValue(getScale()); view->Scale.purgeTouched(); view->purgeTouched(); @@ -1068,14 +1075,16 @@ void DrawProjGroup::updateChildrenScale() */ void DrawProjGroup::updateChildrenSource() { - for( const auto it : Views.getValues() ) { - auto view( dynamic_cast(it) ); + for (const auto it : Views.getValues()) { + auto view(dynamic_cast(it)); if (!view) { //if an element in Views is not a DPGI, something really bad has happened somewhere - Base::Console().Log("PROBLEM - DPG::updateChildrenSource - non DPGI entry in Views! %s\n", - getNameInDocument()); + Base::Console().Error( + "PROBLEM - DPG::updateChildrenSource - non DPGI entry in Views! %s\n", + getNameInDocument()); throw Base::TypeError("Error: projection in DPG list is not a DPGI!"); - } else { + } + else { if (view->Source.getValues() != Source.getValues()) { view->Source.setValues(Source.getValues()); } @@ -1092,14 +1101,16 @@ void DrawProjGroup::updateChildrenSource() */ void DrawProjGroup::updateChildrenLock() { - for( const auto it : Views.getValues() ) { - auto view( dynamic_cast(it) ); + for (const auto it : Views.getValues()) { + auto view(dynamic_cast(it)); if (!view) { //if an element in Views is not a DPGI, something really bad has happened somewhere - Base::Console().Log("PROBLEM - DPG::updateChildrenLock - non DPGI entry in Views! %s\n", - getNameInDocument()); + Base::Console().Error( + "PROBLEM - DPG::updateChildrenLock - non DPGI entry in Views! %s\n", + getNameInDocument()); throw Base::TypeError("Error: projection in DPG list is not a DPGI!"); - } else { + } + else { view->requestPaint(); } } @@ -1107,14 +1118,16 @@ void DrawProjGroup::updateChildrenLock() void DrawProjGroup::updateChildrenEnforce(void) { - for( const auto it : Views.getValues() ) { - auto view( dynamic_cast(it) ); + for (const auto it : Views.getValues()) { + auto view(dynamic_cast(it)); if (!view) { //if an element in Views is not a DPGI, something really bad has happened somewhere - Base::Console().Log("PROBLEM - DPG::updateChildrenEnforce - non DPGI entry in Views! %s\n", - getNameInDocument()); + Base::Console().Error( + "PROBLEM - DPG::updateChildrenEnforce - non DPGI entry in Views! %s\n", + getNameInDocument()); throw Base::TypeError("Error: projection in DPG list is not a DPGI!"); - } else { + } + else { view->enforceRecompute(); } } @@ -1125,7 +1138,7 @@ App::Enumeration DrawProjGroup::usedProjectionType() //TODO: Would've been nice to have an Enumeration(const PropertyEnumeration &) constructor App::Enumeration ret(ProjectionTypeEnums, ProjectionType.getValueAsString()); if (ret.isValue("Default")) { - TechDraw::DrawPage * page = getPage(); + TechDraw::DrawPage* page = getPage(); if (page) { ret.setValue(page->ProjectionType.getValueAsString()); } @@ -1167,8 +1180,6 @@ Base::Vector3d DrawProjGroup::getAnchorDirection() if (docObj) { DrawProjGroupItem* item = static_cast(docObj); result = item->Direction.getValue(); - } else { - Base::Console().Log("ERROR - DPG::getAnchorDir - no Anchor!!\n"); } return result; } @@ -1185,74 +1196,75 @@ void DrawProjGroup::updateSecondaryDirs() Base::Vector3d anchDir = anchor->Direction.getValue(); Base::Vector3d anchRot = anchor->getXDirection(); - std::map > saveVals; + std::map> saveVals; std::string key; std::pair data; - for (auto& docObj: Views.getValues()) { + for (auto& docObj : Views.getValues()) { std::pair newDirs; std::string pic; DrawProjGroupItem* v = static_cast(docObj); ProjItemType t = static_cast(v->Type.getValue()); switch (t) { - case Front : + case Front: data.first = anchDir; data.second = anchRot; key = "Front"; saveVals[key] = data; break; - case Rear : + case Rear: key = "Rear"; newDirs = getDirsFromFront(key); saveVals[key] = newDirs; break; - case Left : + case Left: key = "Left"; newDirs = getDirsFromFront(key); saveVals[key] = newDirs; break; - case Right : - key = "Right"; + case Right: + key = "Right"; newDirs = getDirsFromFront(key); saveVals[key] = newDirs; break; - case Top : + case Top: key = "Top"; newDirs = getDirsFromFront(key); saveVals[key] = newDirs; break; - case Bottom : + case Bottom: key = "Bottom"; newDirs = getDirsFromFront(key); saveVals[key] = newDirs; break; - case FrontTopLeft : + case FrontTopLeft: key = "FrontTopLeft"; newDirs = getDirsFromFront(key); saveVals[key] = newDirs; break; - case FrontTopRight : + case FrontTopRight: key = "FrontTopRight"; newDirs = getDirsFromFront(key); saveVals[key] = newDirs; break; - case FrontBottomLeft : + case FrontBottomLeft: key = "FrontBottomLeft"; newDirs = getDirsFromFront(key); saveVals[key] = newDirs; break; - case FrontBottomRight : + case FrontBottomRight: key = "FrontBottomRight"; newDirs = getDirsFromFront(key); saveVals[key] = newDirs; break; default: { //TARFU invalid secondary type - Base::Console().Message("ERROR - DPG::updateSecondaryDirs - invalid projection type\n"); + Base::Console().Message( + "ERROR - DPG::updateSecondaryDirs - invalid projection type\n"); } } } - for (auto& docObj: Views.getValues()) { + for (auto& docObj : Views.getValues()) { DrawProjGroupItem* v = static_cast(docObj); std::string type = v->Type.getValueAsString(); data = saveVals[type]; @@ -1264,12 +1276,17 @@ void DrawProjGroup::updateSecondaryDirs() recomputeChildren(); } -void DrawProjGroup::rotate(const std::string &rotationdirection) { +void DrawProjGroup::rotate(const std::string& rotationdirection) +{ std::pair newDirs; - if(rotationdirection == "Right") newDirs = getDirsFromFront("Left"); // Front -> Right -> Rear -> Left -> Front - else if(rotationdirection == "Left") newDirs = getDirsFromFront("Right"); // Front -> Left -> Rear -> Right -> Front - else if(rotationdirection == "Up") newDirs = getDirsFromFront("Bottom"); // Front -> Top -> Rear -> Bottom -> Front - else if(rotationdirection == "Down") newDirs = getDirsFromFront("Top"); // Front -> Bottom -> Rear -> Top -> Front + if (rotationdirection == "Right") + newDirs = getDirsFromFront("Left");// Front -> Right -> Rear -> Left -> Front + else if (rotationdirection == "Left") + newDirs = getDirsFromFront("Right");// Front -> Left -> Rear -> Right -> Front + else if (rotationdirection == "Up") + newDirs = getDirsFromFront("Bottom");// Front -> Top -> Rear -> Bottom -> Front + else if (rotationdirection == "Down") + newDirs = getDirsFromFront("Top");// Front -> Bottom -> Rear -> Top -> Front DrawProjGroupItem* anchor = getAnchor(); anchor->Direction.setValue(newDirs.first); @@ -1278,11 +1295,13 @@ void DrawProjGroup::rotate(const std::string &rotationdirection) { updateSecondaryDirs(); } -void DrawProjGroup::spin(const std::string &spindirection) +void DrawProjGroup::spin(const std::string& spindirection) { double angle; - if(spindirection == "CW") angle = M_PI / 2.0; // Top -> Right -> Bottom -> Left -> Top - if(spindirection == "CCW") angle = - M_PI / 2.0; // Top -> Left -> Bottom -> Right -> Top + if (spindirection == "CW") + angle = M_PI / 2.0;// Top -> Right -> Bottom -> Left -> Top + if (spindirection == "CCW") + angle = -M_PI / 2.0;// Top -> Left -> Bottom -> Right -> Top DrawProjGroupItem* anchor = getAnchor(); Base::Vector3d org(0.0, 0.0, 0.0); @@ -1298,25 +1317,22 @@ std::vector DrawProjGroup::getViewsAsDPGI() { std::vector result; auto views = Views.getValues(); - for (auto& v:views) { + for (auto& v : views) { DrawProjGroupItem* item = static_cast(v); result.push_back(item); } return result; } -int DrawProjGroup::getDefProjConv() const -{ - return Preferences::projectionAngle(); -} +int DrawProjGroup::getDefProjConv() const { return Preferences::projectionAngle(); } /*! *dumps the current iso DPGI's */ -void DrawProjGroup::dumpISO(const char * title) +void DrawProjGroup::dumpISO(const char* title) { Base::Console().Message("DPG ISO: %s\n", title); - for (auto& docObj: Views.getValues()) { + for (auto& docObj : Views.getValues()) { Base::Vector3d dir; Base::Vector3d axis; DrawProjGroupItem* v = static_cast(docObj); @@ -1324,12 +1340,12 @@ void DrawProjGroup::dumpISO(const char * title) dir = v->Direction.getValue(); axis = v->getXDirection(); - Base::Console().Message("%s: %s/%s\n", - t.c_str(), DrawUtil::formatVector(dir).c_str(), DrawUtil::formatVector(axis).c_str()); + Base::Console().Message("%s: %s/%s\n", t.c_str(), DrawUtil::formatVector(dir).c_str(), + DrawUtil::formatVector(axis).c_str()); } } -PyObject *DrawProjGroup::getPyObject() +PyObject* DrawProjGroup::getPyObject() { if (PythonObject.is(Py::_None())) { // ref counter is set to 1 @@ -1338,7 +1354,8 @@ PyObject *DrawProjGroup::getPyObject() return Py::new_reference_to(PythonObject); } -void DrawProjGroup::handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property *prop) +void DrawProjGroup::handleChangedPropertyType(Base::XMLReader& reader, const char* TypeName, + App::Property* prop) // transforms properties that had been changed { // also check for changed properties of the base class diff --git a/src/Mod/TechDraw/App/DrawProjGroupItem.cpp b/src/Mod/TechDraw/App/DrawProjGroupItem.cpp index 0fa1a67de7..948b50403d 100644 --- a/src/Mod/TechDraw/App/DrawProjGroupItem.cpp +++ b/src/Mod/TechDraw/App/DrawProjGroupItem.cpp @@ -325,7 +325,6 @@ double DrawProjGroupItem::getScale(void) const if (pgroup) { result = pgroup->getScale(); if (!(result > 0.0)) { - Base::Console().Log("DPGI - %s - bad scale found (%.3f) using 1.0\n", getNameInDocument(), Scale.getValue()); result = 1.0; //kludgy protective fix. autoscale sometimes serves up 0.0! } } diff --git a/src/Mod/TechDraw/App/DrawSVGTemplate.cpp b/src/Mod/TechDraw/App/DrawSVGTemplate.cpp index f05e847306..f9e58f5704 100644 --- a/src/Mod/TechDraw/App/DrawSVGTemplate.cpp +++ b/src/Mod/TechDraw/App/DrawSVGTemplate.cpp @@ -222,14 +222,14 @@ std::map DrawSVGTemplate::getEditableTextsFromTemplate tfi.setFile(App::Application::getResourceDir() + "Mod/Drawing/Templates/" + tfi.fileName()); // try the redirect if (!tfi.isReadable()) { - Base::Console().Log("DrawSVGTemplate::getEditableTextsFromTemplate() not able to open %s!\n", Template.getValue()); + Base::Console().Error("DrawSVGTemplate::getEditableTextsFromTemplate() not able to open %s!\n", Template.getValue()); return editables; } } QFile templateFile(QString::fromUtf8(tfi.filePath().c_str())); if (!templateFile.open(QIODevice::ReadOnly)) { - Base::Console().Log("DrawSVGTemplate::getEditableTextsFromTemplate() can't read template %s!\n", Template.getValue()); + Base::Console().Error("DrawSVGTemplate::getEditableTextsFromTemplate() can't read template %s!\n", Template.getValue()); return editables; } diff --git a/src/Mod/TechDraw/App/DrawUtil.cpp b/src/Mod/TechDraw/App/DrawUtil.cpp index 6844a7dbb1..261483da23 100644 --- a/src/Mod/TechDraw/App/DrawUtil.cpp +++ b/src/Mod/TechDraw/App/DrawUtil.cpp @@ -87,7 +87,6 @@ using namespace TechDraw; std::stringstream ErrorMsg; if (geomName.empty()) { - Base::Console().Log("DU::getIndexFromName(%s) - empty geometry name\n", geomName.c_str()); throw Base::ValueError("getIndexFromName - empty geometry name"); } @@ -998,11 +997,9 @@ bool DrawUtil::isCrazy(TopoDS_Edge e) double edgeLength = GCPnts_AbscissaPoint::Length(adapt, Precision::Confusion()); if (edgeLength < 0.00001) {//edge is scaled. this is 0.00001 mm on paper - Base::Console().Log("DU::isCrazy - edge crazy short: %.7f\n", edgeLength); return true; } if (edgeLength > 9999.9) {//edge is scaled. this is 10 m on paper. can't be right? - Base::Console().Log("DU::isCrazy - edge crazy long: %.3f\n", edgeLength); return true; } @@ -1023,11 +1020,9 @@ bool DrawUtil::isCrazy(TopoDS_Edge e) double major = ellp.MajorRadius(); double minor = ellp.MinorRadius(); if (minor < 0.001) {//too narrow - Base::Console().Log("DU::isCrazy - ellipse is crazy narrow: %.7f\n", minor); return true; } else if (major > 9999.9) {//too big - Base::Console().Log("DU::isCrazy - ellipse is crazy wide: %.3f\n", major); return true; } } diff --git a/src/Mod/TechDraw/App/DrawView.cpp b/src/Mod/TechDraw/App/DrawView.cpp index e52e80082d..33ea81810a 100644 --- a/src/Mod/TechDraw/App/DrawView.cpp +++ b/src/Mod/TechDraw/App/DrawView.cpp @@ -457,7 +457,6 @@ double DrawView::getScale() const } if (!(result > 0.0)) { result = 1.0; - Base::Console().Log("DrawView - %s - bad scale found (%.3f) using 1.0\n", getNameInDocument(), Scale.getValue()); } return result; } @@ -489,11 +488,7 @@ void DrawView::handleChangedPropertyType(Base::XMLReader &reader, const char * T } else { Scale.setValue(1.0); } - } else { - // has Scale prop that isn't Float! - Base::Console().Log("DrawPage::Restore - old Document Scale is Not Float!\n"); - // no idea - } + } } else if (prop->isDerivedFrom(App::PropertyLinkList::getClassTypeId()) && strcmp(prop->getName(), "Source") == 0) { diff --git a/src/Mod/TechDraw/App/DrawViewMulti.cpp b/src/Mod/TechDraw/App/DrawViewMulti.cpp index cdf809b9da..30e49da8a8 100644 --- a/src/Mod/TechDraw/App/DrawViewMulti.cpp +++ b/src/Mod/TechDraw/App/DrawViewMulti.cpp @@ -127,7 +127,6 @@ App::DocumentObjectExecReturn *DrawViewMulti::execute() #endif //#if MOD_TECHDRAW_HANDLE_FACES } catch (Standard_Failure& e1) { - Base::Console().Log("LOG - DVM::execute - projection failed for %s - %s **\n", getNameInDocument(), e1.GetMessageString()); return new App::DocumentObjectExecReturn(e1.GetMessageString()); } diff --git a/src/Mod/TechDraw/App/DrawViewPart.cpp b/src/Mod/TechDraw/App/DrawViewPart.cpp index 21e93cf9a0..3db27403cb 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.cpp +++ b/src/Mod/TechDraw/App/DrawViewPart.cpp @@ -577,10 +577,6 @@ void DrawViewPart::extractFaces() if (!DrawUtil::isZeroEdge(e)) { nonZero.push_back(e); } - else { - Base::Console().Log("INFO - DVP::extractFaces for %s found ZeroEdge!\n", - getNameInDocument()); - } } //HLR algo does not provide all edge intersections for edge endpoints. @@ -595,13 +591,9 @@ void DrawViewPart::extractFaces() BRepBndLib::AddOptimal(*itOuter, sOuter); sOuter.SetGap(0.1); if (sOuter.IsVoid()) { - Base::Console().Log("DVP::Extract Faces - outer Bnd_Box is void for %s\n", - getNameInDocument()); continue; } if (DrawUtil::isZeroEdge(*itOuter)) { - Base::Console().Log("DVP::extractFaces - outerEdge: %d is ZeroEdge\n", - iOuter);//this is not finding ZeroEdges continue; //skip zero length edges. shouldn't happen ;) } int iInner = 0; @@ -618,9 +610,6 @@ void DrawViewPart::extractFaces() BRepBndLib::AddOptimal(*itInner, sInner); sInner.SetGap(0.1); if (sInner.IsVoid()) { - Base::Console().Log( - "INFO - DVP::Extract Faces - inner Bnd_Box is void for %s\n", - getNameInDocument()); continue; } if (sOuter.IsOut(sInner)) {//bboxes of edges don't intersect, don't bother @@ -654,7 +643,6 @@ void DrawViewPart::extractFaces() std::vector newEdges = DrawProjectSplit::splitEdges(nonZero, sorted); if (newEdges.empty()) { - Base::Console().Log("DVP::extractFaces - no newEdges\n"); return; } @@ -844,8 +832,6 @@ TechDraw::BaseGeomPtr DrawViewPart::getGeomByIndex(int idx) const { const std::vector& geoms = getEdgeGeometry(); if (geoms.empty()) { - Base::Console().Log("DVP::getGeomByIndex(%d) - no Edge Geometry. Probably restoring?\n", - idx); return nullptr; } if ((unsigned)idx >= geoms.size()) { @@ -861,8 +847,6 @@ TechDraw::VertexPtr DrawViewPart::getProjVertexByIndex(int idx) const { const std::vector& geoms = getVertexGeometry(); if (geoms.empty()) { - Base::Console().Log( - "DVP::getProjVertexByIndex(%d) - no Vertex Geometry. Probably restoring?\n", idx); return nullptr; } if ((unsigned)idx >= geoms.size()) { @@ -877,7 +861,6 @@ TechDraw::VertexPtr DrawViewPart::getProjVertexByCosTag(std::string cosTag) TechDraw::VertexPtr result = nullptr; std::vector gVerts = getVertexGeometry(); if (gVerts.empty()) { - Base::Console().Log("INFO - getProjVertexByCosTag(%s) - no Vertex Geometry.\n"); return result; } @@ -902,7 +885,7 @@ std::vector DrawViewPart::getFaceEdgesByIndex(int idx) co for (auto& g : w->geoms) { if (g->cosmetic) { //if g is cosmetic, we should skip it - Base::Console().Log("DVP::getFaceEdgesByIndex - found cosmetic edge\n"); + continue; } else { result.push_back(g); @@ -1299,8 +1282,6 @@ bool DrawViewPart::checkXDirection() const Base::Vector3d dir = Direction.getValue(); Base::Vector3d origin(0.0, 0.0, 0.0); Base::Vector3d xDir = getLegacyX(origin, dir); - Base::Console().Log("DVP - %s - XDirection property not set. Trying %s\n", - getNameInDocument(), DrawUtil::formatVector(xDir).c_str()); return false; } return true; diff --git a/src/Mod/TechDraw/App/DrawViewSection.cpp b/src/Mod/TechDraw/App/DrawViewSection.cpp index 6107e2eb9c..5333defa53 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.cpp +++ b/src/Mod/TechDraw/App/DrawViewSection.cpp @@ -910,8 +910,6 @@ gp_Ax2 DrawViewSection::getCSFromBase(const std::string sectionName) const dvsXDir = gp_Dir(sectionXDir.x, sectionXDir.y, sectionXDir.z); } else { - Base::Console().Log("Error - DVS::getCSFromBase - bad sectionName: %s\n", - sectionName.c_str()); dvsDir = dvpRight; dvsXDir = dvpDir; } @@ -940,7 +938,7 @@ gp_Ax2 DrawViewSection::getSectionCS() const sectionCS = gp_Ax2(gOrigin, gNormal, gXDir); } catch (...) { - Base::Console().Log("DVS::getSectionCS - %s - failed to create section CS\n", + Base::Console().Error("DVS::getSectionCS - %s - failed to create section CS\n", getNameInDocument()); } return sectionCS; diff --git a/src/Mod/TechDraw/App/Geometry.cpp b/src/Mod/TechDraw/App/Geometry.cpp index 2e779aa841..95c16bea10 100644 --- a/src/Mod/TechDraw/App/Geometry.cpp +++ b/src/Mod/TechDraw/App/Geometry.cpp @@ -102,9 +102,7 @@ Wire::Wire(const TopoDS_Wire &w) BaseGeomPtr bg = BaseGeom::baseFactory(edge); if (bg) { geoms.push_back(bg); - } else { - Base::Console().Log("G::Wire - baseFactory returned null geom ptr\n"); - } + } } } @@ -1209,15 +1207,12 @@ BSpline::BSpline(const TopoDS_Edge &e) } else if (approx.HasResult()) { //result, but not within tolerance spline = approx.Curve(); - Base::Console().Log("Geometry::BSpline - result not within tolerance\n"); } else { f = c.FirstParameter(); l = c.LastParameter(); s = c.Value(f); ePt = c.Value(l); - Base::Console().Log("Error - Geometry::BSpline - no result- from:(%.3f, %.3f) to:(%.3f, %.3f) poles: %d\n", - s.X(), s.Y(),ePt.X(),ePt.Y(),spline->NbPoles()); TColgp_Array1OfPnt controlPoints(0, 1); controlPoints.SetValue(0, s); controlPoints.SetValue(1, ePt); @@ -1230,9 +1225,6 @@ BSpline::BSpline(const TopoDS_Edge &e) for (Standard_Integer i = 1; i <= crt.NbArcs(); ++i) { BezierSegment tempSegment; Handle(Geom_BezierCurve) bezier = crt.Arc(i); - if (bezier->Degree() > 3) { - Base::Console().Log("Geometry::BSpline - converted curve degree > 3\n"); - } tempSegment.poles = bezier->NbPoles(); tempSegment.degree = bezier->Degree(); for (int pole = 1; pole <= tempSegment.poles; ++pole) { @@ -1326,9 +1318,6 @@ BezierSegment::BezierSegment(const TopoDS_Edge &e) Handle(Geom_BezierCurve) bez = c.Bezier(); poles = bez->NbPoles(); degree = bez->Degree(); - if (poles > 4) { - Base::Console().Log("Warning - BezierSegment has degree > 3: %d\n", degree); - } for (int i = 1; i <= poles; ++i) { gp_Pnt controlPoint = bez->Pole(i); pnts.emplace_back(controlPoint.X(), controlPoint.Y(), controlPoint.Z()); @@ -1528,9 +1517,6 @@ BaseGeomPtrVector GeometryUtils::chainGeoms(BaseGeomPtrVector geoms) } else { atPoint = nextEdge->getEndPoint(); } - } else { - Base::Console().Log("Error - Geometry::chainGeoms - couldn't find next edge\n"); - //TARFU } } } diff --git a/src/Mod/TechDraw/App/GeometryObject.cpp b/src/Mod/TechDraw/App/GeometryObject.cpp index 2c8bafdfd2..5469b02225 100644 --- a/src/Mod/TechDraw/App/GeometryObject.cpp +++ b/src/Mod/TechDraw/App/GeometryObject.cpp @@ -536,7 +536,6 @@ void GeometryObject::addGeomFromCompound(TopoDS_Shape edgeCompound, edgeClass ca { // Base::Console().Message("GO::addGeomFromCompound(%d, %d)\n", category, hlrVisible); if (edgeCompound.IsNull()) { - Base::Console().Log("TechDraw::GeometryObject::addGeomFromCompound edgeCompound is NULL\n"); return;// There is no OpenCascade Geometry to be calculated } @@ -546,22 +545,17 @@ void GeometryObject::addGeomFromCompound(TopoDS_Shape edgeCompound, edgeClass ca for (; edges.More(); edges.Next(), i++) { const TopoDS_Edge& edge = TopoDS::Edge(edges.Current()); if (edge.IsNull()) { - Base::Console().Log("GO::addGeomFromCompound - edge: %d is NULL\n", i); continue; } if (DU::isZeroEdge(edge)) { - Base::Console().Log("GO::addGeomFromCompound - edge: %d is zeroEdge\n", i); continue; } if (DU::isCrazy(edge)) { - Base::Console().Log("GO::addGeomFromCompound - edge: %d is crazy\n", i); continue; } base = BaseGeom::baseFactory(edge); if (!base) { - Base::Console().Log( - "Error - GO::addGeomFromCompound - baseFactory failed for edge: %d\n", i); continue; // throw Base::ValueError("GeometryObject::addGeomFromCompound - baseFactory failed"); } @@ -830,10 +824,7 @@ Base::BoundBox3d GeometryObject::calcBoundingBox() const } double xMin = 0, xMax = 0, yMin = 0, yMax = 0, zMin = 0, zMax = 0; - if (testBox.IsVoid()) { - Base::Console().Log("INFO - GO::calcBoundingBox - testBox is void\n"); - } - else { + if (!testBox.IsVoid()) { testBox.Get(xMin, yMin, zMin, xMax, yMax, zMax); } Base::BoundBox3d bbox(xMin, yMin, zMin, xMax, yMax, zMax); @@ -1084,7 +1075,6 @@ TopoDS_Shape TechDraw::mirrorShape(const TopoDS_Shape& input, const gp_Pnt& inpu transShape = mkTrf.Shape(); } catch (...) { - Base::Console().Log("GeometryObject::mirrorShape - mirror/scale failed.\n"); return transShape; } return transShape; @@ -1109,7 +1099,6 @@ TopoDS_Shape TechDraw::rotateShape(const TopoDS_Shape& input, const gp_Ax2& view transShape = mkTrf.Shape(); } catch (...) { - Base::Console().Log("GeometryObject::rotateShape - rotate failed.\n"); return transShape; } return transShape; @@ -1127,7 +1116,6 @@ TopoDS_Shape TechDraw::scaleShape(const TopoDS_Shape& input, double scale) transShape = mkTrf.Shape(); } catch (...) { - Base::Console().Log("GeometryObject::scaleShape - scale failed.\n"); return transShape; } return transShape; @@ -1145,7 +1133,6 @@ TopoDS_Shape TechDraw::moveShape(const TopoDS_Shape& input, const Base::Vector3d transShape = mkTrf.Shape(); } catch (...) { - Base::Console().Log("GeometryObject::moveShape - move failed.\n"); return transShape; } return transShape; @@ -1166,7 +1153,6 @@ TopoDS_Shape TechDraw::moveShapeRestricted(const TopoDS_Shape& input, const Base transShape = mkTrf.Shape(); } catch (...) { - Base::Console().Log("GeometryObject::moveShapeRestricted - move failed.\n"); return transShape; } return transShape; @@ -1187,7 +1173,6 @@ TopoDS_Shape TechDraw::moveShapeRestricted(const TopoDS_Shape& input, const Base transShape = mkTrf.Shape(); } catch (...) { - Base::Console().Log("GeometryObject::moveShapeRestricted - move failed.\n"); return transShape; } return transShape; diff --git a/src/Mod/TechDraw/App/HatchLine.cpp b/src/Mod/TechDraw/App/HatchLine.cpp index 30aaee18c9..9749bb6654 100644 --- a/src/Mod/TechDraw/App/HatchLine.cpp +++ b/src/Mod/TechDraw/App/HatchLine.cpp @@ -213,8 +213,6 @@ Base::Vector3d LineSet::getPatternStartPoint(TechDraw::BaseGeomPtr g, double &of offset = ceil(patsStartOrg) - patsStartOrg; //fraction of a patternLength patstartorg to repeat point offset = offset * patternLength; } - } else { - Base::Console().Log("ERROR - HL::getPatternStart - something has gone wrong!\n"); } } return result; @@ -316,8 +314,7 @@ std::vector PATLineSpec::getSpecsForPattern(std::string& parmFile, if (status) { lineSpecs = loadPatternDef(inFile); } else { - //this message can come up when changing PAT file or pattern name - Base::Console().Log( "Could not find pattern: %s\n", parmName.c_str() ); + //this can come up when changing PAT file or pattern name return result; } diff --git a/src/Mod/TechDraw/App/ShapeExtractor.cpp b/src/Mod/TechDraw/App/ShapeExtractor.cpp index b1c7d77a42..1907a9c165 100644 --- a/src/Mod/TechDraw/App/ShapeExtractor.cpp +++ b/src/Mod/TechDraw/App/ShapeExtractor.cpp @@ -269,16 +269,12 @@ std::vector ShapeExtractor::getShapesFromObject(const App::Documen result.insert(result.end(), shapes.begin(), shapes.end()); } } - } else { - Base::Console().Log("SE::getShapesFromObject - Group is not a PropertyLinkList!\n"); } } else if (sProp) { //has a Shape property Part::PropertyPartShape* shape = dynamic_cast(sProp); if (shape) { TopoDS_Shape occShape = shape->getValue(); result.push_back(occShape); - } else { - Base::Console().Log("SE::getShapesFromObject - Shape is not a PropertyPartShape!\n"); } } return result; diff --git a/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp b/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp index e395d1df23..0661a9e6c9 100644 --- a/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp +++ b/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp @@ -88,7 +88,7 @@ void loadTechDrawResource() QFontDatabase fontDB; int rc = fontDB.addApplicationFont(fontFile); if (rc) { - Base::Console().Log("TechDraw failed to load osifont file: %d from: %s\n", rc, qPrintable(fontFile)); + Base::Console().Warning("TechDraw failed to load osifont file: %d from: %s\n", rc, qPrintable(fontFile)); } } diff --git a/src/Mod/TechDraw/Gui/Command.cpp b/src/Mod/TechDraw/Gui/Command.cpp index 14d145c0df..0390a9d837 100644 --- a/src/Mod/TechDraw/Gui/Command.cpp +++ b/src/Mod/TechDraw/Gui/Command.cpp @@ -138,10 +138,6 @@ void CmdTechDrawPageDefault::activated(int iMsg) if (dvp) { dvp->show(); } - else { - Base::Console().Log("INFO - Template: %s for Page: %s NOT Found\n", PageName.c_str(), - TemplateName.c_str()); - } } else { QMessageBox::critical(Gui::getMainWindow(), QLatin1String("No template"), @@ -219,10 +215,6 @@ void CmdTechDrawPageTemplate::activated(int iMsg) if (dvp) { dvp->show(); } - else { - Base::Console().Log("INFO - Template: %s for Page: %s NOT Found\n", PageName.c_str(), - TemplateName.c_str()); - } } else { QMessageBox::critical(Gui::getMainWindow(), QLatin1String("No template"), diff --git a/src/Mod/TechDraw/Gui/CommandDecorate.cpp b/src/Mod/TechDraw/Gui/CommandDecorate.cpp index cf004bdccf..7ba909c65a 100644 --- a/src/Mod/TechDraw/Gui/CommandDecorate.cpp +++ b/src/Mod/TechDraw/Gui/CommandDecorate.cpp @@ -203,7 +203,6 @@ void CmdTechDrawGeometricHatch::activated(int iMsg) Gui::ViewProvider* vp = Gui::Application::Instance->getDocument(getDocument())->getViewProvider(geomhatch); TechDrawGui::ViewProviderGeomHatch* hvp = dynamic_cast(vp); if (!hvp) { - Base::Console().Log("ERROR - CommandDecorate - GeomHatch has no ViewProvider\n"); return; } diff --git a/src/Mod/TechDraw/Gui/DrawGuiUtil.cpp b/src/Mod/TechDraw/Gui/DrawGuiUtil.cpp index 264b707b7d..624e766b78 100644 --- a/src/Mod/TechDraw/Gui/DrawGuiUtil.cpp +++ b/src/Mod/TechDraw/Gui/DrawGuiUtil.cpp @@ -380,7 +380,6 @@ std::pair DrawGuiUtil::get3DDirAndRot() } } if (!viewer) { - Base::Console().Log("LOG - DrawGuiUtil could not find a 3D viewer\n"); return std::make_pair(viewDir, viewRight); } @@ -434,9 +433,6 @@ std::pair DrawGuiUtil::getProjDirFromFace(App::D projDir = projDir * (-1.0); } } - else { - Base::Console().Log("Selected Face has no normal at midpoint\n"); - } dirs = std::make_pair(projDir, rotVec); return dirs; diff --git a/src/Mod/TechDraw/Gui/MDIViewPage.cpp b/src/Mod/TechDraw/Gui/MDIViewPage.cpp index 4e2a21580d..b3733608c9 100644 --- a/src/Mod/TechDraw/Gui/MDIViewPage.cpp +++ b/src/Mod/TechDraw/Gui/MDIViewPage.cpp @@ -892,9 +892,6 @@ void MDIViewPage::onSelectionChanged(const Gui::SelectionChanges& msg) } blockSceneSelection(false); } - else { - Base::Console().Log("MDIVP::onSelectionChanged - unhandled: %d\n", msg.Type); - } } //! maintain QGScene selected items in selection order diff --git a/src/Mod/TechDraw/Gui/QGIPrimPath.cpp b/src/Mod/TechDraw/Gui/QGIPrimPath.cpp index 4e9998718d..b1a10681dd 100644 --- a/src/Mod/TechDraw/Gui/QGIPrimPath.cpp +++ b/src/Mod/TechDraw/Gui/QGIPrimPath.cpp @@ -286,7 +286,6 @@ void QGIPrimPath::mousePressEvent(QGraphicsSceneMouseEvent * event) } else { // qparent->mousePressEvent(event); //protected! QGraphicsPathItem::mousePressEvent(event); - Base::Console().Log("QGIPP::mousePressEvent - no QGIView parent\n"); } } else { // Base::Console().Message("QGIPP::mousePressEvent - passing event to ancestor\n"); diff --git a/src/Mod/TechDraw/Gui/QGIRichAnno.cpp b/src/Mod/TechDraw/Gui/QGIRichAnno.cpp index 00fb204c33..c5f7a0fd20 100644 --- a/src/Mod/TechDraw/Gui/QGIRichAnno.cpp +++ b/src/Mod/TechDraw/Gui/QGIRichAnno.cpp @@ -97,7 +97,6 @@ void QGIRichAnno::updateView(bool update) Q_UNUSED(update); auto annoFeat( dynamic_cast(getViewObject()) ); if (!annoFeat) { - Base::Console().Log("QGIRA::updateView - no feature!\n"); return; } diff --git a/src/Mod/TechDraw/Gui/QGIView.cpp b/src/Mod/TechDraw/Gui/QGIView.cpp index bf2e954698..c0398536f1 100644 --- a/src/Mod/TechDraw/Gui/QGIView.cpp +++ b/src/Mod/TechDraw/Gui/QGIView.cpp @@ -303,8 +303,6 @@ double QGIView::getYInClip(double y) QGIViewClip* QGIView::getClipGroup() { if (!getViewObject()->isInClip()) { - Base::Console().Log( "Logic Error - getClipGroup called for child " - "(%s) not in Clip\n", getViewName() ); return nullptr; } diff --git a/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp b/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp index 45410438c1..5b567e06a9 100644 --- a/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp @@ -874,9 +874,6 @@ void QGIViewBalloon::drawBalloon(bool dragged) if (parentItem()) { parentItem()->update(); } - else { - Base::Console().Log("INFO - QGIVB::draw - no parent to update\n"); - } } void QGIViewBalloon::setPrettyPre(void) diff --git a/src/Mod/TechDraw/Gui/QGIViewDimension.cpp b/src/Mod/TechDraw/Gui/QGIViewDimension.cpp index a4040133ed..2df08d82b6 100644 --- a/src/Mod/TechDraw/Gui/QGIViewDimension.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewDimension.cpp @@ -790,9 +790,6 @@ void QGIViewDimension::draw() //TODO: parent redraw still required with new frame/label?? parentItem()->update(); } - else { - Base::Console().Log("INFO - QGIVD::draw - no parent to update\n"); - } } double QGIViewDimension::getAnglePlacementFactor(double testAngle, double endAngle, diff --git a/src/Mod/TechDraw/Gui/QGSPage.cpp b/src/Mod/TechDraw/Gui/QGSPage.cpp index 8d6508181e..5464a566a2 100644 --- a/src/Mod/TechDraw/Gui/QGSPage.cpp +++ b/src/Mod/TechDraw/Gui/QGSPage.cpp @@ -156,7 +156,6 @@ void QGSPage::updateTemplate(bool forceUpdate) App::DocumentObject *templObj = m_vpPage->getDrawPage()->Template.getValue(); // TODO: what if template has been deleted? templObj will be NULL. segfault? if (!templObj) { - Base::Console().Log("INFO - QGSPage::updateTemplate - Page: %s has NO template!!\n", m_vpPage->getDrawPage()->getNameInDocument()); return; } @@ -383,9 +382,6 @@ bool QGSPage::attachView(App::DocumentObject *obj) } else if (typeId.isDerivedFrom(TechDraw::DrawHatch::getClassTypeId()) ) { //Hatch is not attached like other Views (since it isn't really a View) return true; - - } else { - Base::Console().Log("Logic Error - Unknown view type in QGSPage::attachView\n"); } return (qview != nullptr); diff --git a/src/Mod/TechDraw/Gui/QGTracker.cpp b/src/Mod/TechDraw/Gui/QGTracker.cpp index e48f53fddd..b41ca3674a 100644 --- a/src/Mod/TechDraw/Gui/QGTracker.cpp +++ b/src/Mod/TechDraw/Gui/QGTracker.cpp @@ -382,7 +382,6 @@ void QGTracker::setPathFromPoints(std::vector pts) { // Base::Console().Message("QGTracker::setPathFromPoints()\n"); if (pts.empty()) { - Base::Console().Log("QGTracker::setPathFromPoints - no pts!\n"); return; } prepareGeometryChange(); @@ -399,7 +398,6 @@ void QGTracker::setSquareFromPoints(std::vector pts) { // Base::Console().Message("QGTracker::setSquareFromPoints()\n"); if (pts.empty()) { - Base::Console().Log("QGTracker::setSquareFromPoints - no pts!\n"); return; } prepareGeometryChange(); @@ -416,7 +414,6 @@ void QGTracker::setCircleFromPoints(std::vector pts) { // Base::Console().Message("QGTracker::setCircleFromPoints()\n"); if (pts.empty()) { - Base::Console().Log("QGTracker::setCircleFromPoints - no pts!\n"); return; } prepareGeometryChange(); diff --git a/src/Mod/TechDraw/Gui/TaskCenterLine.cpp b/src/Mod/TechDraw/Gui/TaskCenterLine.cpp index 53ff1de0b1..b5079e8bb0 100644 --- a/src/Mod/TechDraw/Gui/TaskCenterLine.cpp +++ b/src/Mod/TechDraw/Gui/TaskCenterLine.cpp @@ -309,7 +309,6 @@ void TaskCenterLine::createCenterLine() } if (!cl) { - Base::Console().Log("TCL::createCenterLine - CenterLine creation failed!\n"); Gui::Command::abortCommand(); return; } diff --git a/src/Mod/TechDraw/Gui/TaskComplexSection.cpp b/src/Mod/TechDraw/Gui/TaskComplexSection.cpp index ae9a5e83b0..9eb6a1fd5f 100644 --- a/src/Mod/TechDraw/Gui/TaskComplexSection.cpp +++ b/src/Mod/TechDraw/Gui/TaskComplexSection.cpp @@ -414,8 +414,6 @@ void TaskComplexSection::scaleTypeChanged(int index) } } else { - Base::Console().Log( - "Error - TaskComplexSection::scaleTypeChanged - unknown scale type: %d\n", index); return; } } diff --git a/src/Mod/TechDraw/Gui/TaskLeaderLine.cpp b/src/Mod/TechDraw/Gui/TaskLeaderLine.cpp index 534fa353e5..389794efd3 100644 --- a/src/Mod/TechDraw/Gui/TaskLeaderLine.cpp +++ b/src/Mod/TechDraw/Gui/TaskLeaderLine.cpp @@ -443,9 +443,7 @@ void TaskLeaderLine::removeFeature() if (Gui::Command::hasPendingCommand()) { std::vector undos = Gui::Application::Instance->activeDocument()->getUndoVector(); Gui::Application::Instance->activeDocument()->undo(1); - } else { - Base::Console().Log("TaskLeaderLine: Edit mode - NO command is active\n"); - } + } } } diff --git a/src/Mod/TechDraw/Gui/TaskProjGroup.cpp b/src/Mod/TechDraw/Gui/TaskProjGroup.cpp index c93fc2110a..e7d06ac4e3 100644 --- a/src/Mod/TechDraw/Gui/TaskProjGroup.cpp +++ b/src/Mod/TechDraw/Gui/TaskProjGroup.cpp @@ -263,9 +263,6 @@ void TaskProjGroup::scaleTypeChanged(int index) double scale = (double) a / (double) b; multiView->Scale.setValue(scale); //unblock recompute - } else { - Base::Console().Log("Error - TaskProjGroup::scaleTypeChanged - unknown scale type: %d\n", index); - return; } } @@ -549,8 +546,6 @@ bool TaskProjGroup::reject() // Gui::Application::Instance->activeDocument()->undo(1); // multiView->rebuildViewList(); // apply(); - } else { - Base::Console().Log("TaskProjGroup: Edit mode - NO command is active\n"); } } Gui::Command::runCommand(Gui::Command::Gui, "Gui.ActiveDocument.resetEdit()"); diff --git a/src/Mod/TechDraw/Gui/TaskRichAnno.cpp b/src/Mod/TechDraw/Gui/TaskRichAnno.cpp index f4929673ac..b875002fc4 100644 --- a/src/Mod/TechDraw/Gui/TaskRichAnno.cpp +++ b/src/Mod/TechDraw/Gui/TaskRichAnno.cpp @@ -388,8 +388,6 @@ void TaskRichAnno::removeFeature() if (Gui::Command::hasPendingCommand()) { std::vector undos = Gui::Application::Instance->activeDocument()->getUndoVector(); Gui::Application::Instance->activeDocument()->undo(1); - } else { - Base::Console().Log("TaskRichAnno: Edit mode - NO command is active\n"); } } } diff --git a/src/Mod/TechDraw/Gui/TaskSectionView.cpp b/src/Mod/TechDraw/Gui/TaskSectionView.cpp index 6ff82a4cc1..ee4a1ee779 100644 --- a/src/Mod/TechDraw/Gui/TaskSectionView.cpp +++ b/src/Mod/TechDraw/Gui/TaskSectionView.cpp @@ -382,8 +382,6 @@ void TaskSectionView::scaleTypeChanged(int index) } } else { - Base::Console().Log("Error - TaskSectionView::scaleTypeChanged - unknown scale type: %d\n", - index); return; } } diff --git a/src/Mod/TechDraw/Gui/ViewProviderPage.cpp b/src/Mod/TechDraw/Gui/ViewProviderPage.cpp index c96d9837c5..b5aba665d7 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderPage.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderPage.cpp @@ -119,9 +119,6 @@ void ViewProviderPage::attach(App::DocumentObject* pcFeat) m_pageName = feature->getNameInDocument(); m_graphicsScene->setObjectName(QString::fromLocal8Bit(m_pageName.c_str())); } - else { - Base::Console().Log("VPP::attach has no Feature!\n"); - } } void ViewProviderPage::setDisplayMode(const char* ModeName) @@ -526,7 +523,6 @@ TechDraw::DrawPage* ViewProviderPage::getDrawPage() const { //during redo, pcObject can become invalid, but non-zero?? if (!pcObject) { - Base::Console().Log("VPP::getDrawPage - no Page Object!\n"); return nullptr; } return dynamic_cast(pcObject);