diff --git a/src/App/DocumentObserverPython.cpp b/src/App/DocumentObserverPython.cpp index e844ca7b7..ba94b55b1 100644 --- a/src/App/DocumentObserverPython.cpp +++ b/src/App/DocumentObserverPython.cpp @@ -199,7 +199,7 @@ void DocumentObserverPython::slotChangedObject(const App::DocumentObject& Obj, Py::Callable method(this->inst.getAttr(std::string("slotChangedObject"))); Py::Tuple args(2); args.setItem(0, Py::Object(const_cast(Obj).getPyObject(), true)); - std::string prop_name = Obj.getName(&Prop); + std::string prop_name = Obj.getPropertyName(&Prop); args.setItem(1, Py::String(prop_name)); method.apply(args); } diff --git a/src/App/DynamicProperty.cpp b/src/App/DynamicProperty.cpp index 02f00c42d..38aed4d11 100644 --- a/src/App/DynamicProperty.cpp +++ b/src/App/DynamicProperty.cpp @@ -106,13 +106,13 @@ void DynamicProperty::addDynamicProperties(const PropertyContainer* cont) } } -const char* DynamicProperty::getName(const Property* prop) const +const char* DynamicProperty::getPropertyName(const Property* prop) const { for (std::map::const_iterator it = props.begin(); it != props.end(); ++it) { if (it->second.property == prop) return it->first.c_str(); } - return this->pc->PropertyContainer::getName(prop); + return this->pc->PropertyContainer::getPropertyName(prop); } unsigned int DynamicProperty::getMemSize (void) const diff --git a/src/App/DynamicProperty.h b/src/App/DynamicProperty.h index 5ebfc4195..afff5016e 100644 --- a/src/App/DynamicProperty.h +++ b/src/App/DynamicProperty.h @@ -74,7 +74,7 @@ public: std::vector getDynamicPropertyNames() const; void addDynamicProperties(const PropertyContainer*); /// get the name of a property - const char* getName(const Property* prop) const; + const char* getPropertyName(const Property* prop) const; //@} /** @name Property attributes */ diff --git a/src/App/FeaturePython.cpp b/src/App/FeaturePython.cpp index 9348ace12..573efdebd 100644 --- a/src/App/FeaturePython.cpp +++ b/src/App/FeaturePython.cpp @@ -88,7 +88,7 @@ void FeaturePythonImp::onChanged(const Property* prop) if (feature.hasAttr("__object__")) { Py::Callable method(feature.getAttr(std::string("onChanged"))); Py::Tuple args(1); - std::string prop_name = object->getName(prop); + std::string prop_name = object->getPropertyName(prop); args.setItem(0, Py::String(prop_name)); method.apply(args); } @@ -96,7 +96,7 @@ void FeaturePythonImp::onChanged(const Property* prop) Py::Callable method(feature.getAttr(std::string("onChanged"))); Py::Tuple args(2); args.setItem(0, Py::Object(object->getPyObject(), true)); - std::string prop_name = object->getName(prop); + std::string prop_name = object->getPropertyName(prop); args.setItem(1, Py::String(prop_name)); method.apply(args); } diff --git a/src/App/FeaturePython.h b/src/App/FeaturePython.h index bffb4d5b7..b3fd60400 100644 --- a/src/App/FeaturePython.h +++ b/src/App/FeaturePython.h @@ -124,8 +124,8 @@ public: return props->getPropertyByName(name); } /// get the name of a property - virtual const char* getName(const Property* prop) const { - return props->getName(prop); + virtual const char* getPropertyName(const Property* prop) const { + return props->getPropertyName(prop); } //@} diff --git a/src/App/Property.cpp b/src/App/Property.cpp index 3b750ff20..6a318aab3 100644 --- a/src/App/Property.cpp +++ b/src/App/Property.cpp @@ -58,7 +58,7 @@ Property::~Property() const char* Property::getName(void) const { - return father->getName(this); + return father->getPropertyName(this); } short Property::getType(void) const diff --git a/src/App/PropertyContainer.cpp b/src/App/PropertyContainer.cpp index ca917e740..6a4f9ad83 100644 --- a/src/App/PropertyContainer.cpp +++ b/src/App/PropertyContainer.cpp @@ -143,7 +143,7 @@ bool PropertyContainer::isHidden(const char *name) const return (getPropertyData().getType(this,name) & Prop_Hidden) == Prop_Hidden; } -const char* PropertyContainer::getName(const Property* prop)const +const char* PropertyContainer::getPropertyName(const Property* prop)const { return getPropertyData().getName(this,prop); } diff --git a/src/App/PropertyContainer.h b/src/App/PropertyContainer.h index fac9e5666..34907c297 100644 --- a/src/App/PropertyContainer.h +++ b/src/App/PropertyContainer.h @@ -104,7 +104,7 @@ public: /// find a property by its name virtual Property *getPropertyByName(const char* name) const; /// get the name of a property - virtual const char* getName(const Property* prop) const; + virtual const char* getPropertyName(const Property* prop) const; /// get all properties of the class (including properties of the parent) virtual void getPropertyMap(std::map &Map) const; /// get all properties of the class (including properties of the parent) diff --git a/src/CXX/Python2/Objects.hxx b/src/CXX/Python2/Objects.hxx index d0f557767..2252f6e2e 100644 --- a/src/CXX/Python2/Objects.hxx +++ b/src/CXX/Python2/Objects.hxx @@ -1130,7 +1130,7 @@ namespace Py // TMM: added this seqref ctor for use with STL algorithms seqref (Object& obj) : s(dynamic_cast< SeqBase&>(obj)) - , offset( NULL ) + , offset( 0 ) , the_item(s.getItem(offset)) {} ~seqref() diff --git a/src/Gui/Command.cpp b/src/Gui/Command.cpp index 4c7891664..0b6bf8df2 100644 --- a/src/Gui/Command.cpp +++ b/src/Gui/Command.cpp @@ -863,7 +863,7 @@ void PythonCommand::languageChange() } } -const char* PythonCommand::getHelpUrl(void) +const char* PythonCommand::getHelpUrl(void) const { PyObject* pcTemp; pcTemp = Interpreter().runMethodObject(_pcPyCommand, "CmdHelpURL"); diff --git a/src/Gui/Command.h b/src/Gui/Command.h index 72016d901..1aea9972c 100644 --- a/src/Gui/Command.h +++ b/src/Gui/Command.h @@ -328,7 +328,7 @@ protected: /// if the command is not always active virtual bool isActive(void); /// Get the help URL - const char* getHelpUrl(void); + const char* getHelpUrl(void) const; /// Creates the used Action virtual Action * createAction(void); //@} diff --git a/src/Gui/DlgDisplayPropertiesImp.cpp b/src/Gui/DlgDisplayPropertiesImp.cpp index 7493bddf5..e776d4560 100644 --- a/src/Gui/DlgDisplayPropertiesImp.cpp +++ b/src/Gui/DlgDisplayPropertiesImp.cpp @@ -151,7 +151,7 @@ void DlgDisplayPropertiesImp::slotChangedObject(const Gui::ViewProvider& obj, std::bind2nd(std::equal_to(), const_cast(&obj))); if (vp != Provider.end()) { - std::string prop_name = obj.getName(&prop); + std::string prop_name = obj.getPropertyName(&prop); if (prop.getTypeId() == App::PropertyColor::getClassTypeId()) { App::Color value = static_cast(prop).getValue(); if (prop_name == "ShapeColor") { diff --git a/src/Gui/ManualAlignment.cpp b/src/Gui/ManualAlignment.cpp index b8824b434..8e3082651 100644 --- a/src/Gui/ManualAlignment.cpp +++ b/src/Gui/ManualAlignment.cpp @@ -1240,7 +1240,7 @@ bool ManualAlignment::applyPickedProbe(Gui::ViewProviderDocumentObject* prov, co // add to the list for the non-aligned view in the left view if (myAlignModel.activeGroup().hasView(prov)) { - std::vector pts = prov->getPickedPoints(pnt); + std::vector pts = prov->getModelPoints(pnt); if (pts.empty()) return false; myAlignModel.activeGroup().addPoint(pts.front()); @@ -1249,7 +1249,7 @@ bool ManualAlignment::applyPickedProbe(Gui::ViewProviderDocumentObject* prov, co return true; } else if (myFixedGroup.hasView(prov)) { - std::vector pts = prov->getPickedPoints(pnt); + std::vector pts = prov->getModelPoints(pnt); if (pts.empty()) return false; myFixedGroup.addPoint(pts.front()); diff --git a/src/Gui/PropertyView.cpp b/src/Gui/PropertyView.cpp index e57e7d28f..461d68edc 100644 --- a/src/Gui/PropertyView.cpp +++ b/src/Gui/PropertyView.cpp @@ -134,7 +134,7 @@ void PropertyView::onSelectionChanged(const SelectionChanges& msg) if (ob) { for (pt = dataList.begin(); pt != dataList.end(); ++pt) { PropInfo nameType; - nameType.propName = ob->getName(*pt); + nameType.propName = ob->getPropertyName(*pt); nameType.propId = (*pt)->getTypeId().getKey(); if (!ob->isHidden(*pt) && !(*pt)->StatusBits.test(3)) { diff --git a/src/Gui/SelectionView.cpp b/src/Gui/SelectionView.cpp index c770f3c21..7cca78ccf 100644 --- a/src/Gui/SelectionView.cpp +++ b/src/Gui/SelectionView.cpp @@ -126,9 +126,8 @@ void SelectionView::onUpdate(void) { } -bool SelectionView::onMsg(const char* pMsg) +bool SelectionView::onMsg(const char* pMsg,const char** ppReturn) { - // no messages yet return false; } /// @endcond diff --git a/src/Gui/SelectionView.h b/src/Gui/SelectionView.h index 596f39c95..5a618f986 100644 --- a/src/Gui/SelectionView.h +++ b/src/Gui/SelectionView.h @@ -75,7 +75,7 @@ public: Gui::SelectionSingleton::MessageType Reason); - bool onMsg(const char* pMsg); + bool onMsg(const char* pMsg,const char** ppReturn); virtual const char *getName(void) const {return "SelectionView";} diff --git a/src/Gui/TaskPanelView.cpp b/src/Gui/TaskPanelView.cpp index 4c385ae85..890530f91 100644 --- a/src/Gui/TaskPanelView.cpp +++ b/src/Gui/TaskPanelView.cpp @@ -169,9 +169,8 @@ void TaskPanelView::onUpdate(void) { } -bool TaskPanelView::onMsg(const char* pMsg) +bool TaskPanelView::onMsg(const char* pMsg,const char** ppReturn) { - // no messages yet return false; } /// @endcond diff --git a/src/Gui/TaskPanelView.h b/src/Gui/TaskPanelView.h index 54a98e99e..8ac0707b4 100644 --- a/src/Gui/TaskPanelView.h +++ b/src/Gui/TaskPanelView.h @@ -55,8 +55,7 @@ public: Gui::SelectionSingleton::MessageType Reason); - bool onMsg(const char* pMsg); - + virtual bool onMsg(const char* pMsg,const char** ppReturn); virtual const char *getName(void) const {return "TaskPanelView";} /// get called when the document is changed or updated diff --git a/src/Gui/TaskView/TaskAppearance.cpp b/src/Gui/TaskView/TaskAppearance.cpp index bfef66cf5..d89cbb324 100644 --- a/src/Gui/TaskView/TaskAppearance.cpp +++ b/src/Gui/TaskView/TaskAppearance.cpp @@ -103,7 +103,7 @@ void TaskAppearance::slotChangedObject(const Gui::ViewProvider& obj, std::bind2nd(std::equal_to(), const_cast(&obj))); if (vp != Provider.end()) { - std::string prop_name = obj.getName(&prop); + std::string prop_name = obj.getPropertyName(&prop); if (prop.getTypeId().isDerivedFrom(App::PropertyInteger::getClassTypeId())) { long value = static_cast(prop).getValue(); if (prop_name == "Transparency") { diff --git a/src/Gui/ViewProvider.cpp b/src/Gui/ViewProvider.cpp index c329f380f..dcdede3e1 100644 --- a/src/Gui/ViewProvider.cpp +++ b/src/Gui/ViewProvider.cpp @@ -387,7 +387,7 @@ SoPickedPoint* ViewProvider::getPointOnRay(const SbVec3f& pos,const SbVec3f& dir return (pick ? new SoPickedPoint(*pick) : 0); } -std::vector ViewProvider::getPickedPoints(const SoPickedPoint* pp) const +std::vector ViewProvider::getModelPoints(const SoPickedPoint* pp) const { // the default implementation just returns the picked point from the visual representation std::vector pts; diff --git a/src/Gui/ViewProvider.h b/src/Gui/ViewProvider.h index d1679a4af..7dfa5f662 100644 --- a/src/Gui/ViewProvider.h +++ b/src/Gui/ViewProvider.h @@ -121,7 +121,7 @@ public: /// return a hit element to the selection path or 0 virtual std::string getElement(const SoDetail *) const { return std::string(); } virtual SoDetail* getDetail(const char*) const { return 0; } - virtual std::vector getPickedPoints(const SoPickedPoint *) const; + virtual std::vector getModelPoints(const SoPickedPoint *) const; /// return the higlight lines for a given element or the whole shape virtual std::vector getSelectionShape(const char* Element) const { return std::vector(); } diff --git a/src/Gui/ViewProviderPythonFeature.cpp b/src/Gui/ViewProviderPythonFeature.cpp index 248a25779..d3659e24f 100644 --- a/src/Gui/ViewProviderPythonFeature.cpp +++ b/src/Gui/ViewProviderPythonFeature.cpp @@ -562,7 +562,7 @@ void ViewProviderPythonFeatureImp::updateData(const App::Property* prop) if (vp.hasAttr("__object__")) { Py::Callable method(vp.getAttr(std::string("updateData"))); Py::Tuple args(1); - const char* prop_name = object->getObject()->getName(prop); + const char* prop_name = object->getObject()->getPropertyName(prop); if (prop_name) { args.setItem(0, Py::String(prop_name)); method.apply(args); @@ -572,7 +572,7 @@ void ViewProviderPythonFeatureImp::updateData(const App::Property* prop) Py::Callable method(vp.getAttr(std::string("updateData"))); Py::Tuple args(2); args.setItem(0, Py::Object(object->getObject()->getPyObject(), true)); - const char* prop_name = object->getObject()->getName(prop); + const char* prop_name = object->getObject()->getPropertyName(prop); if (prop_name) { args.setItem(1, Py::String(prop_name)); method.apply(args); @@ -599,7 +599,7 @@ void ViewProviderPythonFeatureImp::onChanged(const App::Property* prop) if (vp.hasAttr("__object__")) { Py::Callable method(vp.getAttr(std::string("onChanged"))); Py::Tuple args(1); - std::string prop_name = object->getName(prop); + std::string prop_name = object->getPropertyName(prop); args.setItem(0, Py::String(prop_name)); method.apply(args); } @@ -607,7 +607,7 @@ void ViewProviderPythonFeatureImp::onChanged(const App::Property* prop) Py::Callable method(vp.getAttr(std::string("onChanged"))); Py::Tuple args(2); args.setItem(0, Py::Object(object->getPyObject(), true)); - std::string prop_name = object->getName(prop); + std::string prop_name = object->getPropertyName(prop); args.setItem(1, Py::String(prop_name)); method.apply(args); } diff --git a/src/Gui/ViewProviderPythonFeature.h b/src/Gui/ViewProviderPythonFeature.h index f92363d0b..b891efafb 100644 --- a/src/Gui/ViewProviderPythonFeature.h +++ b/src/Gui/ViewProviderPythonFeature.h @@ -219,8 +219,8 @@ public: return props->getPropertyByName(name); } /// get the name of a property - virtual const char* getName(const App::Property* prop) const { - return props->getName(prop); + virtual const char* getPropertyName(const App::Property* prop) const { + return props->getPropertyName(prop); } //@} diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 76b0f2621..678cd531f 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -193,7 +193,7 @@ QString PropertyItem::pythonIdentifier(const App::Property* prop) const if (parent->getTypeId() == App::Document::getClassTypeId()) { App::Document* doc = static_cast(parent); QString docName = QString::fromAscii(App::GetApplication().getDocumentName(doc)); - QString propName = QString::fromAscii(parent->getName(prop)); + QString propName = QString::fromAscii(parent->getPropertyName(prop)); return QString::fromAscii("FreeCAD.getDocument(\"%1\").%2").arg(docName).arg(propName); } if (parent->getTypeId().isDerivedFrom(App::DocumentObject::getClassTypeId())) { @@ -201,7 +201,7 @@ QString PropertyItem::pythonIdentifier(const App::Property* prop) const App::Document* doc = obj->getDocument(); QString docName = QString::fromAscii(App::GetApplication().getDocumentName(doc)); QString objName = QString::fromAscii(obj->getNameInDocument()); - QString propName = QString::fromAscii(parent->getName(prop)); + QString propName = QString::fromAscii(parent->getPropertyName(prop)); return QString::fromAscii("FreeCAD.getDocument(\"%1\").getObject(\"%2\").%3") .arg(docName).arg(objName).arg(propName); } @@ -210,7 +210,7 @@ QString PropertyItem::pythonIdentifier(const App::Property* prop) const App::Document* doc = obj->getDocument(); QString docName = QString::fromAscii(App::GetApplication().getDocumentName(doc)); QString objName = QString::fromAscii(obj->getNameInDocument()); - QString propName = QString::fromAscii(parent->getName(prop)); + QString propName = QString::fromAscii(parent->getPropertyName(prop)); return QString::fromAscii("FreeCADGui.getDocument(\"%1\").getObject(\"%2\").%3") .arg(docName).arg(objName).arg(propName); } diff --git a/src/Mod/Fem/Gui/ViewProviderFemMeshPyImp.cpp b/src/Mod/Fem/Gui/ViewProviderFemMeshPyImp.cpp index 20b458c5d..7a9fe29e4 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemMeshPyImp.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemMeshPyImp.cpp @@ -54,6 +54,7 @@ App::Color calcColor(double value,double min, double max) return App::Color (0.0,1-((value-(min/2.0)) / (min/2.0)),1.0); if ( value < 0.0 ) return App::Color (0.0,1.0,value/(min/2.0)) ; + return App::Color (0,0,0); } diff --git a/src/Mod/Import/App/StepShape.cpp b/src/Mod/Import/App/StepShape.cpp index 67092a597..66b926ef7 100644 --- a/src/Mod/Import/App/StepShape.cpp +++ b/src/Mod/Import/App/StepShape.cpp @@ -99,4 +99,6 @@ int StepShape::read(const char* fileName) model->PrintLabel(entity,msg); std::cout << ";"<< entity->DynamicType()->Name() << std::endl; } + + return 0; } diff --git a/src/Mod/Part/Gui/ViewProviderExt.cpp b/src/Mod/Part/Gui/ViewProviderExt.cpp index 823d44ec0..c3f1ee67e 100644 --- a/src/Mod/Part/Gui/ViewProviderExt.cpp +++ b/src/Mod/Part/Gui/ViewProviderExt.cpp @@ -476,7 +476,7 @@ SoDetail* ViewProviderPartExt::getDetail(const char* subelement) const return detail; } -std::vector ViewProviderPartExt::getPickedPoints(const SoPickedPoint* pp) const +std::vector ViewProviderPartExt::getModelPoints(const SoPickedPoint* pp) const { try { std::vector pts; diff --git a/src/Mod/Part/Gui/ViewProviderExt.h b/src/Mod/Part/Gui/ViewProviderExt.h index 23cfad12b..c9e2fd00b 100644 --- a/src/Mod/Part/Gui/ViewProviderExt.h +++ b/src/Mod/Part/Gui/ViewProviderExt.h @@ -101,7 +101,7 @@ public: /// return a hit element to the selection path or 0 virtual std::string getElement(const SoDetail*) const; virtual SoDetail* getDetail(const char*) const; - virtual std::vector getPickedPoints(const SoPickedPoint *) const; + virtual std::vector getModelPoints(const SoPickedPoint *) const; /// return the higlight lines for a given element or the whole shape virtual std::vector getSelectionShape(const char* Element) const; //@} diff --git a/src/Mod/PartDesign/App/FeatureDraft.cpp b/src/Mod/PartDesign/App/FeatureDraft.cpp index 5b3a94f4a..81e8fd63c 100644 --- a/src/Mod/PartDesign/App/FeatureDraft.cpp +++ b/src/Mod/PartDesign/App/FeatureDraft.cpp @@ -146,7 +146,7 @@ App::DocumentObjectExecReturn *Draft::execute(void) TopoDS_Shape face = TopShape.getSubShape(SubVals[0].c_str()); TopTools_IndexedMapOfShape mapOfEdges; TopExp::MapShapes(face, TopAbs_EDGE, mapOfEdges); - bool found; + bool found = false; for (int i = 1; i <= mapOfEdges.Extent(); i++) { // Note: What happens if mapOfEdges(i) is the degenerated edge of a cone? @@ -212,7 +212,7 @@ App::DocumentObjectExecReturn *Draft::execute(void) if (refEdge.IsNull()) throw Base::Exception("Failed to extract neutral plane reference edge"); BRepAdaptor_Curve c(refEdge); - if (!c.GetType() == GeomAbs_Line) + if (c.GetType() != GeomAbs_Line) throw Base::Exception("Neutral plane reference edge must be linear"); double a = c.Line().Angle(gp_Lin(c.Value(c.FirstParameter()), pullDirection)); if (std::fabs(a - M_PI_2) > Precision::Confusion()) diff --git a/src/Mod/Sketcher/App/freegcs/GCS.cpp b/src/Mod/Sketcher/App/freegcs/GCS.cpp index 2bd96f906..7c6625a7e 100644 --- a/src/Mod/Sketcher/App/freegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/freegcs/GCS.cpp @@ -889,6 +889,8 @@ int System::solve(SubSystem *subsys, bool isFine, Algorithm alg) return solve_LM(subsys); else if (alg == DogLeg) return solve_DL(subsys); + else + return Failed; } int System::solve_BFGS(SubSystem *subsys, bool isFine)