Skip to content

Commit

Permalink
+ For MeshGui remove dependency to MeshPartGui when loading the workb…
Browse files Browse the repository at this point in the history
…ench
  • Loading branch information
wwmayer committed Dec 12, 2013
1 parent 90af2d5 commit df53ad4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
27 changes: 27 additions & 0 deletions src/Mod/Mesh/Gui/Command.cpp
Expand Up @@ -448,6 +448,32 @@ bool CmdMeshFromGeometry::isActive(void)
return getSelection().countObjectsOfType(App::GeoFeature::getClassTypeId()) >= 1;
}

//===========================================================================
// Mesh_FromPart
//===========================================================================
DEF_STD_CMD_A(CmdMeshFromPartShape);

CmdMeshFromPartShape::CmdMeshFromPartShape()
: Command("Mesh_FromPartShape")
{
sAppModule = "Mesh";
sGroup = QT_TR_NOOP("Mesh");
sMenuText = QT_TR_NOOP("Create mesh from shape...");
sToolTipText = QT_TR_NOOP("Tessellate shape");
sWhatsThis = sToolTipText;
sStatusTip = sToolTipText;
}

void CmdMeshFromPartShape::activated(int iMsg)
{
doCommand(Doc,"import MeshPartGui, FreeCADGui\nFreeCADGui.runCommand('MeshPart_Mesher')\n");
}

bool CmdMeshFromPartShape::isActive(void)
{
return (hasActiveDocument() && !Gui::Control().activeDialog());
}

//--------------------------------------------------------------------------------------

DEF_STD_CMD_A(CmdMeshVertexCurvature);
Expand Down Expand Up @@ -1542,5 +1568,6 @@ void CreateMeshCommands(void)
rcCmdMgr.addCommand(new CmdMeshFillInteractiveHole());
rcCmdMgr.addCommand(new CmdMeshRemoveCompByHand());
rcCmdMgr.addCommand(new CmdMeshFromGeometry());
rcCmdMgr.addCommand(new CmdMeshFromPartShape());
rcCmdMgr.addCommand(new CmdMeshSegmentation());
}
2 changes: 1 addition & 1 deletion src/Mod/Mesh/Gui/Workbench.cpp
Expand Up @@ -185,7 +185,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
*boolean << "Mesh_Union" << "Mesh_Intersection" << "Mesh_Difference";

mesh->setCommand("&Meshes");
*mesh << "Mesh_Import" << "Mesh_Export" << "MeshPart_Mesher" << "Separator"
*mesh << "Mesh_Import" << "Mesh_Export" << "Mesh_FromPartShape" << "Separator"
<< analyze << "Mesh_HarmonizeNormals" << "Mesh_FlipNormals" << "Separator"
<< "Mesh_FillupHoles" << "Mesh_FillInteractiveHole" << "Mesh_RemoveComponents"
<< "Mesh_RemoveCompByHand" << "Mesh_AddFacet" << "Mesh_Smoothing" << "Separator"
Expand Down
4 changes: 0 additions & 4 deletions src/Mod/Mesh/InitGui.py
Expand Up @@ -69,10 +69,6 @@ class MeshWorkbench ( Workbench ):
def Initialize(self):
# load the module
import MeshGui
try:
import MeshPartGui
except:
pass
def GetClassName(self):
return "MeshGui::Workbench"

Expand Down

0 comments on commit df53ad4

Please sign in to comment.