Miscellaneous fixes

This commit is contained in:
jrheinlaender 2013-05-17 20:14:00 +04:30 committed by Stefan Tröger
parent c751eefc00
commit b18958b3d9
6 changed files with 14 additions and 12 deletions

View File

@ -140,10 +140,10 @@ App::DocumentObjectExecReturn *Pad::execute(void)
Base::Vector3d SketchVector(0,0,1);
SketchOrientation.multVec(SketchVector,SketchVector);
this->positionBySketch();
TopLoc_Location invObjLoc = this->getLocation().Inverted();
try {
this->positionBySketch();
TopLoc_Location invObjLoc = this->getLocation().Inverted();
base.Move(invObjLoc);
gp_Dir dir(SketchVector.x,SketchVector.y,SketchVector.z);

View File

@ -118,10 +118,10 @@ App::DocumentObjectExecReturn *Pocket::execute(void)
// turn around for pockets
SketchVector *= -1;
this->positionBySketch();
TopLoc_Location invObjLoc = this->getLocation().Inverted();
try {
this->positionBySketch();
TopLoc_Location invObjLoc = this->getLocation().Inverted();
base.Move(invObjLoc);
gp_Dir dir(SketchVector.x,SketchVector.y,SketchVector.z);

View File

@ -121,6 +121,8 @@ void SketchBased::positionBySketch(void)
Part::Part2DObject *sketch = static_cast<Part::Part2DObject*>(Sketch.getValue());
if (sketch && sketch->getTypeId().isDerivedFrom(Part::Part2DObject::getClassTypeId())) {
App::DocumentObject* support = sketch->Support.getValue();
if (support == NULL)
throw Base::Exception("Sketch with NULL support");
if (support->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) {
Part::Feature *part = static_cast<Part::Feature*>(support);
this->Placement.setValue(part->Placement.getValue());

View File

@ -334,7 +334,7 @@ int TaskPadParameters::getMode(void) const
QByteArray TaskPadParameters::getFaceName(void) const
{
if ((getMode() >= 1) && (getMode() <= 3))
if (getMode() == 3)
return getFaceReference(ui->lineFaceName->text(), ui->lineFaceName->property("FaceName").toString()).toLatin1();
else
return "";

View File

@ -314,7 +314,7 @@ int TaskPocketParameters::getMode(void) const
QByteArray TaskPocketParameters::getFaceName(void) const
{
if ((getMode() >= 1) && (getMode() <= 3))
if (getMode() == 3)
return getFaceReference(ui->lineFaceName->text(), ui->lineFaceName->property("FaceName").toString()).toLatin1();
else
return "";

View File

@ -50,10 +50,7 @@ ViewProvider::~ViewProvider()
}
bool ViewProvider::doubleClicked(void)
{
std::string Msg("Edit ");
Msg += this->pcObject->Label.getValue();
Gui::Command::openCommand(Msg.c_str());
{
if (PartDesignGui::ActivePartObject != NULL) {
// Drop into insert mode so that the user doesn't see all the geometry that comes later in the tree
// Also, this way the user won't be tempted to use future geometry as external references for the sketch
@ -67,6 +64,9 @@ bool ViewProvider::doubleClicked(void)
}
try {
std::string Msg("Edit ");
Msg += this->pcObject->Label.getValue();
Gui::Command::openCommand(Msg.c_str());
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().setEdit('%s',0)",this->pcObject->getNameInDocument());
}
catch (const Base::Exception&) {