Skip to content

Commit

Permalink
Merge branch 'master' into PathStock
Browse files Browse the repository at this point in the history
  • Loading branch information
gauna85 committed Dec 13, 2020
2 parents 8c3bad6 + 68eba58 commit 5cbd8e1
Show file tree
Hide file tree
Showing 22 changed files with 236 additions and 260 deletions.
11 changes: 2 additions & 9 deletions src/Base/Interpreter.cpp
Expand Up @@ -544,15 +544,8 @@ void InterpreterSingleton::addType(PyTypeObject* Type,PyObject* Module, const ch
void InterpreterSingleton::addPythonPath(const char* Path)
{
PyGILStateLocker locker;
PyObject *list = PySys_GetObject("path");
#if PY_MAJOR_VERSION >= 3
PyObject *path = PyUnicode_FromString(Path);
#else
PyObject *path = PyString_FromString(Path);
#endif
PyList_Append(list, path);
Py_DECREF(path);
PySys_SetObject("path", list);
Py::List list(PySys_GetObject("path"));
list.append(Py::String(Path));
}

const char* InterpreterSingleton::init(int argc,char *argv[])
Expand Down
10 changes: 5 additions & 5 deletions src/Mod/Mesh/Gui/Command.cpp
Expand Up @@ -706,7 +706,7 @@ void CmdMeshVertexCurvatureInfo::activated(int)
viewer->setEditing(true);
viewer->setRedirectToSceneGraph(true);
viewer->setSelectionEnabled(false);
viewer->setEditingCursor(QCursor(Gui::BitmapFactory().pixmapFromSvg("mesh_pipette",QSize(32,32)),4,29));
viewer->setEditingCursor(QCursor(Gui::BitmapFactory().pixmapFromSvg("Mesh_Pipette",QSize(32,32)),4,29));
viewer->addEventCallback(SoEvent::getClassTypeId(),
MeshGui::ViewProviderMeshCurvature::curvatureInfoCallback);
}
Expand Down Expand Up @@ -896,7 +896,7 @@ CmdMeshPolyCut::CmdMeshPolyCut()
sToolTipText = QT_TR_NOOP("Cuts a mesh with a picked polygon");
sWhatsThis = "Mesh_PolyCut";
sStatusTip = QT_TR_NOOP("Cuts a mesh with a picked polygon");
sPixmap = "mesh_cut";
sPixmap = "Mesh_Cut";
}

void CmdMeshPolyCut::activated(int)
Expand Down Expand Up @@ -1199,7 +1199,7 @@ CmdMeshEvaluateFacet::CmdMeshEvaluateFacet()
sToolTipText = QT_TR_NOOP("Information about face");
sWhatsThis = "Mesh_EvaluateFacet";
sStatusTip = QT_TR_NOOP("Information about face");
sPixmap = "mesh_pipette";
sPixmap = "Mesh_Pipette";
}

void CmdMeshEvaluateFacet::activated(int)
Expand All @@ -1209,7 +1209,7 @@ void CmdMeshEvaluateFacet::activated(int)
if (view) {
Gui::View3DInventorViewer* viewer = view->getViewer();
viewer->setEditing(true);
viewer->setEditingCursor(QCursor(Gui::BitmapFactory().pixmapFromSvg("mesh_pipette",QSize(32,32)),4,29));
viewer->setEditingCursor(QCursor(Gui::BitmapFactory().pixmapFromSvg("Mesh_Pipette",QSize(32,32)),4,29));
viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), MeshGui::ViewProviderMeshFaceSet::faceInfoCallback);
}
}
Expand Down Expand Up @@ -1675,7 +1675,7 @@ CmdMeshFillInteractiveHole::CmdMeshFillInteractiveHole()
sToolTipText = QT_TR_NOOP("Close holes interactively");
sWhatsThis = "Mesh_FillInteractiveHole";
sStatusTip = QT_TR_NOOP("Close holes interactively");
sPixmap = "mesh_boundary";
sPixmap = "Mesh_Boundary";
}

void CmdMeshFillInteractiveHole::activated(int)
Expand Down
52 changes: 26 additions & 26 deletions src/Mod/Mesh/Gui/Resources/Mesh.qrc
@@ -1,40 +1,40 @@
<RCC>
<qresource>
<file>icons/mesh_boundary.svg</file>
<file>icons/mesh_cut.svg</file>
<file>icons/mesh_pipette.svg</file>
<file>icons/Tree_Mesh.svg</file>
<qresource>
<file>icons/Mesh_Add_Facet.svg</file>
<file>icons/Mesh_Boundary.svg</file>
<file>icons/Mesh_Bounding_Box.svg</file>
<file>icons/Mesh_Cross_Sections.svg</file>
<file>icons/Mesh_Curvature_Info.svg</file>
<file>icons/Mesh_Curvature_Plot.svg</file>
<file>icons/Mesh_Cut.svg</file>
<file>icons/Mesh_Decimating.svg</file>
<file>icons/Mesh_Difference.svg</file>
<file>icons/Mesh_Evaluate_Solid.svg</file>
<file>icons/Mesh_Evaluation.svg</file>
<file>icons/Mesh_Export_Mesh.svg</file>
<file>icons/Mesh_Import_Mesh.svg</file>
<file>icons/Mesh_Mesh_from_Shape.svg</file>
<file>icons/Mesh_Flip_Normals.svg</file>
<file>icons/Mesh_Harmonize_Normals.svg</file>
<file>icons/Mesh_Import_Mesh.svg</file>
<file>icons/Mesh_Intersection.svg</file>
<file>icons/Mesh_Merge.svg</file>
<file>icons/Mesh_Mesh_from_Shape.svg</file>
<file>icons/Mesh_Pipette.svg</file>
<file>icons/Mesh_Poly_Trim.svg</file>
<file>icons/Mesh_Regular_Solid.svg</file>
<file>icons/Mesh_Remesh_Gmsh.svg</file>
<file>icons/Mesh_Remove_Comp_by_Hand.svg</file>
<file>icons/Mesh_Remove_Components.svg</file>
<file>icons/Mesh_Tree_Curvature_Plot.svg</file>
<file>icons/MeshWorkbench.svg</file>
<file>icons/Mesh_Scale.svg</file>
<file>icons/Mesh_Section_by_Plane.svg</file>
<file>icons/Mesh_Fill_up_Holes.svg</file>
<file>icons/Mesh_Union.svg</file>
<file>icons/Mesh_Smoothing.svg</file>
<file>icons/Mesh_Segmentation_Best_Fit.svg</file>
<file>icons/Mesh_Segmentation.svg</file>
<file>icons/Mesh_Section_by_Plane.svg</file>
<file>icons/Mesh_Scale.svg</file>
<file>icons/Mesh_Remove_Comp_by_Hand.svg</file>
<file>icons/Mesh_Remesh_Gmsh.svg</file>
<file>icons/Mesh_Poly_Trim.svg</file>
<file>icons/Mesh_Merge.svg</file>
<file>icons/Mesh_Intersection.svg</file>
<file>icons/Mesh_Evaluation.svg</file>
<file>icons/Mesh_Evaluate_Solid.svg</file>
<file>icons/Mesh_Difference.svg</file>
<file>icons/Mesh_Decimating.svg</file>
<file>icons/Mesh_Curvature_Info.svg</file>
<file>icons/Mesh_Cross_Sections.svg</file>
<file>icons/Mesh_Bounding_Box.svg</file>
<file>icons/Mesh_Add_Facet.svg</file>
<file>icons/Mesh_Smoothing.svg</file>
<file>icons/Mesh_Tree.svg</file>
<file>icons/Mesh_Tree_Curvature_Plot.svg</file>
<file>icons/Mesh_Trim_by_Plane.svg</file>
<file>icons/Mesh_Union.svg</file>
<file>icons/MeshWorkbench.svg</file>
<file>icons/RegularSolids/Mesh_Cone.svg</file>
<file>icons/RegularSolids/Mesh_Cube.svg</file>
<file>icons/RegularSolids/Mesh_Cylinder.svg</file>
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Mod/Mesh/Gui/ViewProvider.cpp
Expand Up @@ -503,7 +503,7 @@ void ViewProviderMesh::updateData(const App::Property* prop)
QIcon ViewProviderMesh::getIcon() const
{
#if 1
static QIcon icon = Gui::BitmapFactory().pixmap("Tree_Mesh");
static QIcon icon = Gui::BitmapFactory().pixmap("Mesh_Tree");
return icon;
#else
static const char * const Mesh_Feature_xpm[] = {
Expand Down
25 changes: 11 additions & 14 deletions src/Mod/Part/App/AppPartPy.cpp
Expand Up @@ -793,21 +793,20 @@ class Module : public Py::ExtensionModule<Module>
Py::Object getFacets(const Py::Tuple& args)
{
PyObject *shape;
PyObject *list = PyList_New(0);
Py::List list;
if (!PyArg_ParseTuple(args.ptr(), "O", &shape))
throw Py::Exception();
auto theShape = static_cast<Part::TopoShapePy*>(shape)->getTopoShapePtr()->getShape();
for(TopExp_Explorer ex(theShape, TopAbs_FACE); ex.More(); ex.Next())
{
for (TopExp_Explorer ex(theShape, TopAbs_FACE); ex.More(); ex.Next()) {
TopoDS_Face currentFace = TopoDS::Face(ex.Current());
TopLoc_Location loc;
Handle(Poly_Triangulation) facets = BRep_Tool::Triangulation(currentFace, loc);
const TopAbs_Orientation anOrientation = currentFace.Orientation();
bool flip = (anOrientation == TopAbs_REVERSED);
if(!facets.IsNull()){
if (!facets.IsNull()) {
const TColgp_Array1OfPnt& nodes = facets->Nodes();
const Poly_Array1OfTriangle& triangles = facets->Triangles();
for(int i = 1; i <= triangles.Length(); i++){
for (int i = 1; i <= triangles.Length(); i++) {
Standard_Integer n1,n2,n3;
triangles(i).Get(n1, n2, n3);
gp_Pnt p1 = nodes(n1);
Expand All @@ -821,19 +820,17 @@ class Module : public Py::ExtensionModule<Module>
PyObject *t1 = PyTuple_Pack(3, PyFloat_FromDouble(p1.X()), PyFloat_FromDouble(p1.Y()), PyFloat_FromDouble(p1.Z()));
PyObject *t2 = PyTuple_Pack(3, PyFloat_FromDouble(p2.X()), PyFloat_FromDouble(p2.Y()), PyFloat_FromDouble(p2.Z()));
PyObject *t3 = PyTuple_Pack(3, PyFloat_FromDouble(p3.X()), PyFloat_FromDouble(p3.Y()), PyFloat_FromDouble(p3.Z()));
PyObject *points;
if(flip)
{
points = PyTuple_Pack(3, t2, t1, t3);
} else {
points = PyTuple_Pack(3, t1, t2, t3);
if (flip) {
list.append(Py::asObject(PyTuple_Pack(3, t2, t1, t3)));
}
else {
list.append(Py::asObject(PyTuple_Pack(3, t1, t2, t3)));
}
PyList_Append(list, points);
}
}
}
}
return Py::asObject(list);
}
return list;
}
Py::Object makeCompound(const Py::Tuple& args)
{
Expand Down

0 comments on commit 5cbd8e1

Please sign in to comment.