Specialized viewproviders for datum features, create points from intersection of edges and faces

This commit is contained in:
jrheinlaender
2013-04-27 20:40:52 +04:30
committed by Stefan Tröger
parent 9ca63b603a
commit 696bdf9a2a
10 changed files with 457 additions and 174 deletions

View File

@@ -611,20 +611,16 @@ void CmdPartDesignNewSketch::activated(int iMsg)
firstValidPlane = planes.begin();
}
//TODO: Allow user to choose front or back of the plane
App::Plane* plane = static_cast<App::Plane*>(*firstValidPlane);
Base::Vector3d p = plane->Placement.getValue().getPosition();
Base::Rotation r = plane->Placement.getValue().getRotation();
// TODO: Allow user to choose front or back of the plane
App::Plane* plane = static_cast<App::Plane*>(*firstValidPlane);
std::string FeatName = getUniqueObjectName("Sketch");
std::string supportString = std::string("(App.activeDocument().") + plane->getNameInDocument() + ", ['front'])";
openCommand("Create a new Sketch");
doCommand(Doc,"App.activeDocument().addObject('Sketcher::SketchObject','%s')",FeatName.c_str());
doCommand(Doc,"App.activeDocument().%s.Support = %s",FeatName.c_str(),supportString.c_str());
//doCommand(Doc,"App.activeDocument().%s.Placement = App.Placement(App.Vector(%f,%f,%f),App.Rotation(%f,%f,%f,%f))",
// FeatName.c_str(),p.x,p.y,p.z,r[0],r[1],r[2],r[3]);
updateActive(); // Make sure the Support's Placement property is updated
doCommand(Doc,"App.activeDocument().%s.addFeature(App.activeDocument().%s)",
pcActiveBody->getNameInDocument(), FeatName.c_str());
//doCommand(Gui,"Gui.activeDocument().activeView().setCamera('%s')",cam.c_str());