From e6f7c9d83cb7a3d4cbbe01924810544050532367 Mon Sep 17 00:00:00 2001 From: Ian Rees Date: Sun, 24 Jan 2016 11:59:30 +1300 Subject: [PATCH] Clean up docstrings to conform to PEP 8, tidy up. --- src/Mod/Mesh/App/AppMeshPy.cpp | 36 ++++++++++----------- src/Mod/Mesh/App/Exporter.cpp | 4 +-- src/Mod/Mesh/App/Exporter.h | 7 ++-- src/Mod/Mesh/App/PreCompiled.h | 2 ++ src/Mod/Mesh/Gui/DlgSettingsImportExport.ui | 5 ++- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/Mod/Mesh/App/AppMeshPy.cpp b/src/Mod/Mesh/App/AppMeshPy.cpp index af26e74aa..367959169 100644 --- a/src/Mod/Mesh/App/AppMeshPy.cpp +++ b/src/Mod/Mesh/App/AppMeshPy.cpp @@ -62,16 +62,6 @@ using namespace MeshCore; namespace Mesh { class Module : public Py::ExtensionModule { - struct add_offset { - unsigned long i; - add_offset(unsigned long i) : i(i) - { - } - void operator()(unsigned long& v) - { - v += i; - } - }; public: Module() : Py::ExtensionModule("Mesh") { @@ -79,10 +69,13 @@ public: "Read a mesh from a file and returns a Mesh object." ); add_varargs_method("open",&Module::open, - "open(string) -- Create a new document and a Mesh::Import feature to load the file into the document." + "open(string)\n" + "Create a new document and a Mesh::Import feature to load the file into\n" + "the document." ); add_varargs_method("insert",&Module::importer, - "insert(string|mesh,[string]) -- Load or insert a mesh into the given or active document." + "insert(string|mesh,[string])\n" + "Load or insert a mesh into the given or active document." ); add_keyword_method("export",&Module::exporter, "export(objects, filename, [tolerance=0.1, exportAmfCompressed=True])\n" @@ -117,7 +110,8 @@ public: "Create a tessellated torus" ); add_varargs_method("calculateEigenTransform",&Module::calculateEigenTransform, - "calculateEigenTransform(seq(Base.Vector)) -- Calculates the eigen Transformation from a list of points.\n" + "calculateEigenTransform(seq(Base.Vector))\n" + "Calculates the eigen Transformation from a list of points.\n" "calculate the point's local coordinate system with the center\n" "of gravity as origin. The local coordinate system is computed\n" "this way that u has minimum and w has maximum expansion.\n" @@ -127,15 +121,19 @@ public: "polynomialFit(seq(Base.Vector)) -- Calculates a polynomial fit." ); add_varargs_method("minimumVolumeOrientedBox",&Module::minimumVolumeOrientedBox, - "minimumVolumeOrientedBox(seq(Base.Vector)) -- Calculates the minimum volume oriented box containing all points.\n" - "The return value is a tuple of seven items: center, u, v, w directions and the lengths of the three vectors." + "minimumVolumeOrientedBox(seq(Base.Vector)) -- Calculates the minimum\n" + "volume oriented box containing all points. The return value is a\n" + "tuple of seven items:\n" + " center, u, v, w directions and the lengths of the three vectors.\n" ); initialize("The functions in this module allow working with mesh objects.\n" - "A set of functions are provided that allow to read in registered mesh file formats\n" - "to either an newly created or already exising document.\n" + "A set of functions are provided for reading in registered mesh\n" + "file formats to either an new or exising document.\n" "\n" - "open(string) -- Create a new document and a Mesh::Import feature to load the file into the document.\n" - "insert(string, string) -- Create a Mesh::Import feature to load the file into the given document.\n" + "open(string) -- Create a new document and a Mesh::Import feature\n" + " to load the file into the document.\n" + "insert(string, string) -- Create a Mesh::Import feature to load\n" + " the file into the given document.\n" "Mesh() -- Create an empty mesh object.\n" "\n"); } diff --git a/src/Mod/Mesh/App/Exporter.cpp b/src/Mod/Mesh/App/Exporter.cpp index cc6afa23c..ea040e9c8 100644 --- a/src/Mod/Mesh/App/Exporter.cpp +++ b/src/Mod/Mesh/App/Exporter.cpp @@ -114,7 +114,7 @@ bool MergeExporter::addMesh(Mesh::Feature *meshFeat) indices.resize(mergingMesh.countFacets() - countFacets); std::generate(indices.begin(), indices.end(), Base::iotaGen(countFacets)); Segment segm(&mergingMesh, indices, true); - // TODO: pass in the object? segm.setName(obj->Label.getValue()); + segm.setName(meshFeat->Label.getValue()); mergingMesh.addSegment(segm); } @@ -149,7 +149,7 @@ bool MergeExporter::addPart(App::DocumentObject *obj, float tol) indices.resize(mergingMesh.countFacets() - countFacets); std::generate(indices.begin(), indices.end(), Base::iotaGen(countFacets)); Segment segm(&mergingMesh, indices, true); - // TODO: pass in the object? segm.setName(obj->Label.getValue()); + segm.setName(obj->Label.getValue()); mergingMesh.addSegment(segm); return true; diff --git a/src/Mod/Mesh/App/Exporter.h b/src/Mod/Mesh/App/Exporter.h index b2bc15cf8..67d9ea9d2 100644 --- a/src/Mod/Mesh/App/Exporter.h +++ b/src/Mod/Mesh/App/Exporter.h @@ -23,11 +23,8 @@ #ifndef MESH_EXPORTER_H #define MESH_EXPORTER_H -#include "PreCompiled.h" -#ifndef _PreComp_ - #include - #include -#endif // #ifndef _PreComp_ +#include +#include #include diff --git a/src/Mod/Mesh/App/PreCompiled.h b/src/Mod/Mesh/App/PreCompiled.h index 964b92d87..9664300df 100644 --- a/src/Mod/Mesh/App/PreCompiled.h +++ b/src/Mod/Mesh/App/PreCompiled.h @@ -77,6 +77,8 @@ //# include #endif +#include + // Python #include diff --git a/src/Mod/Mesh/Gui/DlgSettingsImportExport.ui b/src/Mod/Mesh/Gui/DlgSettingsImportExport.ui index 925fb121a..ba8c1531d 100644 --- a/src/Mod/Mesh/Gui/DlgSettingsImportExport.ui +++ b/src/Mod/Mesh/Gui/DlgSettingsImportExport.ui @@ -79,6 +79,9 @@ + + true + ExportAmfCompressed @@ -101,7 +104,7 @@ QWidget
Gui/PrefWidgets.h
- + Gui::PrefCheckBox QCheckBox
Gui/PrefWidgets.h