Merge branch 'master' of ssh://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad
This commit is contained in:
@@ -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<std::string> args;
|
||||
bool merge=false;
|
||||
for (int i=1; i<ac; i++) {
|
||||
if (merge) {
|
||||
merge = false;
|
||||
args.back() += "=";
|
||||
args.back() += av[i];
|
||||
}
|
||||
else {
|
||||
args.push_back(av[i]);
|
||||
}
|
||||
if (strcmp(av[i],"-style") == 0) {
|
||||
merge = true;
|
||||
}
|
||||
else if (strcmp(av[i],"-stylesheet") == 0) {
|
||||
merge = true;
|
||||
}
|
||||
else if (strcmp(av[i],"-session") == 0) {
|
||||
merge = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 0000659: SIGABRT on startup in boost::program_options (Boost 1.49)
|
||||
// Add some text to the constructor
|
||||
@@ -1492,7 +1514,7 @@ void Application::ParseOptions(int ac, char ** av)
|
||||
|
||||
variables_map vm;
|
||||
try {
|
||||
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);
|
||||
|
||||
std::ifstream ifs("FreeCAD.cfg");
|
||||
@@ -1535,7 +1557,7 @@ void Application::ParseOptions(int ac, char ** av)
|
||||
vector<string> 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -748,7 +748,7 @@ void Document::exportObjects(const std::vector<App::DocumentObject*>& 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 App::DocumentObject*,ViewProvider*>::const_iterator jt;
|
||||
for (jt = views.begin(); jt != views.end(); ++jt) {
|
||||
|
||||
@@ -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<zipios::ZipInputStream&>(reader));
|
||||
}
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -46,6 +46,16 @@ void MeshSurfaceSegment::AddSegment(const std::vector<unsigned long>& segm)
|
||||
}
|
||||
}
|
||||
|
||||
MeshSegment MeshSurfaceSegment::FindSegment(unsigned long index) const
|
||||
{
|
||||
for (std::vector<MeshSegment>::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)
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
virtual void AddFacet(const MeshFacet& rclFacet);
|
||||
void AddSegment(const std::vector<unsigned long>&);
|
||||
const std::vector<MeshSegment>& GetSegments() const { return segments; }
|
||||
MeshSegment FindSegment(unsigned long) const;
|
||||
|
||||
protected:
|
||||
std::vector<MeshSegment> segments;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -59,14 +59,20 @@ int PointsPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
*getPointKernelPtr() = *(static_cast<PointsPy*>(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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user