project polyline on mesh and create edge

This commit is contained in:
wmayer
2017-04-19 23:30:15 +02:00
parent 33cd945195
commit 6f4131bece
12 changed files with 1179 additions and 3 deletions

View File

@@ -180,10 +180,45 @@ void CmdSurfaceGeomFillSurface::activated(int iMsg)
doCommand(Doc, "Gui.ActiveDocument.setEdit('%s',0)", FeatName.c_str());
}
DEF_STD_CMD_A(CmdSurfaceCurveOnMesh)
CmdSurfaceCurveOnMesh::CmdSurfaceCurveOnMesh()
: Command("Surface_CurveOnMesh")
{
sAppModule = "MeshPart";
sGroup = QT_TR_NOOP("Surface");
sMenuText = QT_TR_NOOP("Curve on mesh...");
sToolTipText = QT_TR_NOOP("Curve on mesh");
sWhatsThis = "Surface_CurveOnMesh";
sStatusTip = sToolTipText;
}
void CmdSurfaceCurveOnMesh::activated(int)
{
doCommand(Doc,"import MeshPartGui, FreeCADGui\n"
"FreeCADGui.runCommand('MeshPart_CurveOnMesh')\n");
}
bool CmdSurfaceCurveOnMesh::isActive(void)
{
if (Gui::Control().activeDialog())
return false;
// Check for the selected mesh feature (all Mesh types)
Base::Type meshType = Base::Type::fromName("Mesh::Feature");
App::Document* doc = App::GetApplication().getActiveDocument();
if (doc && doc->countObjectsOfType(meshType) > 0)
return true;
return false;
}
void CreateSurfaceCommands(void)
{
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
/* rcCmdMgr.addCommand(new CmdSurfaceFilling());
rcCmdMgr.addCommand(new CmdSurfaceCut());*/
rcCmdMgr.addCommand(new CmdSurfaceGeomFillSurface());
rcCmdMgr.addCommand(new CmdSurfaceCurveOnMesh());
}

View File

@@ -146,7 +146,7 @@ void ViewProviderGeomFillSurface::highlightReferences(bool on)
for (auto jt : it.second) {
std::size_t idx = static_cast<std::size_t>(std::stoi(jt.substr(4)) - 1);
assert (idx >= 0 && idx < colors.size());
assert (idx < colors.size());
colors[idx] = App::Color(1.0,0.0,1.0); // magenta
}

View File

@@ -52,7 +52,8 @@ Gui::MenuItem* Workbench::setupMenuBar() const
Gui::MenuItem* surface = new Gui::MenuItem;
root->insertItem( item, surface );
surface->setCommand("Surface");
*surface << "Surface_GeomFillSurface";
*surface << "Surface_CurveOnMesh"
<< "Surface_GeomFillSurface";
/* *surface << "Surface_Filling";
*surface << "Surface_Cut";*/