Improvements on mesh flattening commands:

comment out import of pivy because it's not used and pivy.graphics isn't available on all platforms
Add MeshPart_ prefix to command names for consistency reasons and to make Qt help working correctly
When adding commands to Mesh workbench make sure the commands could be created beforehand to avoid annoying warnings
This commit is contained in:
wmayer
2018-04-23 11:09:26 +02:00
parent c518744e39
commit a099eb3caf
2 changed files with 13 additions and 6 deletions

View File

@@ -30,6 +30,8 @@
#endif
#include "Workbench.h"
#include <Gui/Application.h>
#include <Gui/Command.h>
#include <Gui/MenuManager.h>
#include <Gui/ToolBarManager.h>
#include <Gui/Selection.h>
@@ -193,7 +195,12 @@ Gui::MenuItem* Workbench::setupMenuBar() const
<< "Mesh_Merge" << "Mesh_PolySelect" << "Mesh_PolyCut"
<< "Mesh_PolySplit" << "Mesh_PolySegm" << "Mesh_PolyTrim" << "Separator"
<< "Mesh_TrimByPlane" << "Mesh_SectionByPlane" << "Mesh_Segmentation"
<< "Mesh_VertexCurvature" << "CreateFlatMesh" << "CreateFlatFace";
<< "Mesh_VertexCurvature";
Gui::CommandManager& mgr = Gui::Application::Instance->commandManager();
if (mgr.getCommandByName("MeshPart_CreateFlatMesh"))
*mesh << "MeshPart_CreateFlatMesh";
if (mgr.getCommandByName("MeshPart_CreateFlatFace"))
*mesh << "MeshPart_CreateFlatFace";
return root;
}