diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 30033380a1..17b99601fb 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -1475,6 +1475,28 @@ void Application::ParseOptions(int ac, char ** av) //x11.add_options() // ("display", boost::program_options::value< string >(), "set the X-Server") // ; + //0000723: improper handling of qt specific comand line arguments + std::vector args; + bool merge=false; + for (int i=1; i args; copy(tok.begin(), tok.end(), back_inserter(args)); // Parse the file and store the options - store( boost::program_options::command_line_parser(ac, av). + store( boost::program_options::command_line_parser(args). options(cmdline_options).positional(p).extra_parser(customSyntax).run(), vm); } diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp index 4a0880ffa8..0192d3e86e 100644 --- a/src/Gui/Document.cpp +++ b/src/Gui/Document.cpp @@ -748,7 +748,7 @@ void Document::exportObjects(const std::vector& obj, Base: << views.size() <<"\">" << std::endl; bool xml = writer.isForceXML(); - writer.setForceXML(true); + //writer.setForceXML(true); writer.incInd(); // indention for 'ViewProvider name' std::map::const_iterator jt; for (jt = views.begin(); jt != views.end(); ++jt) { diff --git a/src/Gui/MergeDocuments.cpp b/src/Gui/MergeDocuments.cpp index a1fc7172a7..7addd29bed 100644 --- a/src/Gui/MergeDocuments.cpp +++ b/src/Gui/MergeDocuments.cpp @@ -235,4 +235,8 @@ void MergeDocuments::RestoreDocFile(Base::Reader & reader) } xmlReader.readEndElement("Document"); + + // In the file GuiDocument.xml new data files might be added + if (!xmlReader.getFilenames().empty()) + xmlReader.readFiles(static_cast(reader)); } diff --git a/src/Mod/Draft/DraftGeomUtils.py b/src/Mod/Draft/DraftGeomUtils.py index 16468ad0c1..7ce4a57f00 100755 --- a/src/Mod/Draft/DraftGeomUtils.py +++ b/src/Mod/Draft/DraftGeomUtils.py @@ -765,7 +765,7 @@ def isReallyClosed(wire): def getNormal(shape): "finds the normal of a shape, if possible" n = Vector(0,0,1) - if shape.ShapeType == "Face": + if (shape.ShapeType == "Face") and hasattr(shape,"normalAt"): n = shape.normalAt(0.5,0.5) elif shape.ShapeType == "Edge": if isinstance(shape.Curve,Part.Circle): diff --git a/src/Mod/Mesh/App/Core/Segmentation.cpp b/src/Mod/Mesh/App/Core/Segmentation.cpp index 01d99fb11f..9d0d69f325 100644 --- a/src/Mod/Mesh/App/Core/Segmentation.cpp +++ b/src/Mod/Mesh/App/Core/Segmentation.cpp @@ -46,6 +46,16 @@ void MeshSurfaceSegment::AddSegment(const std::vector& segm) } } +MeshSegment MeshSurfaceSegment::FindSegment(unsigned long index) const +{ + for (std::vector::const_iterator it = segments.begin(); it != segments.end(); ++it) { + if (std::find(it->begin(), it->end(), index) != it->end()) + return *it; + } + + return MeshSegment(); +} + // -------------------------------------------------------- MeshDistancePlanarSegment::MeshDistancePlanarSegment(const MeshKernel& mesh, unsigned long minFacets, float tol) diff --git a/src/Mod/Mesh/App/Core/Segmentation.h b/src/Mod/Mesh/App/Core/Segmentation.h index 1b29f4bff9..9416028b69 100644 --- a/src/Mod/Mesh/App/Core/Segmentation.h +++ b/src/Mod/Mesh/App/Core/Segmentation.h @@ -46,6 +46,7 @@ public: virtual void AddFacet(const MeshFacet& rclFacet); void AddSegment(const std::vector&); const std::vector& GetSegments() const { return segments; } + MeshSegment FindSegment(unsigned long) const; protected: std::vector segments; diff --git a/src/Mod/Mesh/App/Makefile.am b/src/Mod/Mesh/App/Makefile.am index 27537e0605..5ba606444c 100644 --- a/src/Mod/Mesh/App/Makefile.am +++ b/src/Mod/Mesh/App/Makefile.am @@ -359,7 +359,7 @@ Mesh_la_DEPENDENCIES = libMesh.la # set the include path found by configure AM_CXXFLAGS = -I$(top_srcdir)/src/3rdParty -I$(top_srcdir)/src -I$(top_builddir)/src $(GTS_CFLAGS) \ - $(all_includes) $(QT4_CORE_CXXFLAGS) + $(all_includes) -I$(EIGEN3_INC) $(QT4_CORE_CXXFLAGS) includedir = @includedir@/Mod/Mesh/App libdir = $(prefix)/Mod/Mesh diff --git a/src/Mod/Points/App/PointsPyImp.cpp b/src/Mod/Points/App/PointsPyImp.cpp index 75df742c8e..b0b2819ac8 100644 --- a/src/Mod/Points/App/PointsPyImp.cpp +++ b/src/Mod/Points/App/PointsPyImp.cpp @@ -59,14 +59,20 @@ int PointsPy::PyInit(PyObject* args, PyObject* /*kwd*/) *getPointKernelPtr() = *(static_cast(pcObj)->getPointKernelPtr()); } else if (PyList_Check(pcObj)) { - addPoints(args); + if (!addPoints(args)) + return -1; } else if (PyTuple_Check(pcObj)) { - addPoints(args); + if (!addPoints(args)) + return -1; } else if (PyString_Check(pcObj)) { getPointKernelPtr()->load(PyString_AsString(pcObj)); } + else { + PyErr_SetString(PyExc_TypeError, "optional argument must be list, tuple or string"); + return -1; + } return 0; }