Compare commits

...

14 Commits

Author SHA1 Message Date
wmayer f25e6e4716 0001714: FreeCAD 0.14 Stable crashes when importing a step model 2014-09-02 11:43:51 +02:00
wmayer 3ecaf8778d - fix focus issue with InputField
- on document load set camera setting of the MDI views
- do not try to use framebuffer objects when it's not supported on the system
0001690: sketch.getPoint crashes FreeCAD if the point does not exist
0001630: IGES-Export in [mm] turns to [Inches]
0001684: Sweep ignores the list of subshapes
0001667: 'Save file' disabled when viewing a drawing
0001682: Crash after updating editable texts in drawing
0001659: 3dconnexion space navigator moves view even when FreeCAD is not the active application
0001696: Quantity.getValueAs('rad') touches the Property
0001638: Not possible to draw anything
2014-08-28 15:27:35 +02:00
Yorik van Havre c6edd47334 Updated version number in makedist.py script 2014-07-14 12:42:02 -03:00
Yorik van Havre b3368125c6 Draft: Array tool now prints commands in the python console 2014-07-13 12:33:02 -03:00
wmayer 32f5aae0a6 + fix crash when trying to edit broken revolve object 2014-07-13 11:51:30 +02:00
wmayer 3dbcf24d71 + fix crash when trying to edit broken revolve object 2014-07-13 11:51:14 +02:00
Yorik van Havre a3a6ec2184 Draft: Further fix in text encodings 2014-07-11 18:05:33 -03:00
Yorik van Havre e46ec63540 Merge branch 'releases/FreeCAD-0-14' of ssh://git.code.sf.net/p/free-cad/code into releases/FreeCAD-0-14 2014-07-11 18:05:09 -03:00
Yorik van Havre df36b5d22d Draft: Fixed escape() bug in Draft GUI 2014-07-11 11:57:00 -03:00
Yorik van Havre 3d70df7745 Draft - fixed some text encodings in dimensions 2014-07-11 11:56:03 -03:00
wmayer 52561adbd8 + fix Part.makeTube 2014-07-08 12:30:05 +02:00
Yorik van Havre d802958860 Draft: Fixed escape() bug in Draft GUI 2014-07-08 12:28:50 +02:00
wmayer e517e3b634 + update NSIS installer 2014-07-05 15:46:20 +02:00
Yorik van Havre 5fe6e0c48f Draft: fix in angular dimension 2014-07-04 10:23:31 +02:00
21 changed files with 152 additions and 55 deletions
+4
View File
@@ -2003,6 +2003,10 @@ std::string Application::FindHomePath(const char* sCall)
*i = '/';
}
// fixes #0001638 to avoid to load DLLs from Windows' system directories before FreeCAD's bin folder
std::string binPath = TempHomePath;
binPath += "bin";
SetDllDirectory(binPath.c_str());
return TempHomePath;
}
+2 -2
View File
@@ -27,14 +27,14 @@ Quantity(string) -- arbitrary mixture of numbers and chars defining a Quantity
</UserDocu>
<DeveloperDocu>Quantity</DeveloperDocu>
</Documentation>
<Methode Name="getUserPreferred">
<Methode Name="getUserPreferred" Const="true">
<Documentation>
<UserDocu>
returns a quantity with the translation factor and a string with the prevered unit
</UserDocu>
</Documentation>
</Methode>
<Methode Name="getValueAs">
<Methode Name="getValueAs" Const="true">
<Documentation>
<UserDocu>
returns a floating point value as the provided unit
+12 -4
View File
@@ -214,11 +214,19 @@ void ObjectLabelObserver::slotRelabelObject(const App::DocumentObject& obj, cons
}
// make sure that there is a name conflict otherwise we don't have to do anything
if (match) {
if (match && !label.empty()) {
// remove number from end to avoid lengthy names
size_t lastpos = label.length()-1;
while (label[lastpos] >= 48 && label[lastpos] <= 57)
while (label[lastpos] >= 48 && label[lastpos] <= 57) {
// if 'lastpos' becomes 0 then all characters are digits. In this case we use
// the complete label again
if (lastpos == 0) {
lastpos = label.length()-1;
break;
}
lastpos--;
}
label = label.substr(0, lastpos+1);
label = Base::Tools::getUniqueName(label, objectLabels, 3);
this->current = &obj;
@@ -1621,11 +1629,11 @@ void Application::runApplication(void)
}
#if QT_VERSION >= 0x040200
if (!QGLFramebufferObject::hasOpenGLFramebufferObjects()) {
Base::Console().Log("This system does not support framebuffer objects");
Base::Console().Log("This system does not support framebuffer objects\n");
}
#endif
if (!QGLPixelBuffer::hasOpenGLPbuffers()) {
Base::Console().Log("This system does not support pbuffers");
Base::Console().Log("This system does not support pbuffers\n");
}
QGLFormat::OpenGLVersionFlags version = QGLFormat::openGLVersionFlags ();
+6 -2
View File
@@ -697,8 +697,12 @@ void Document::RestoreDocFile(Base::Reader &reader)
sMsg += ppReturn;
if (strcmp(ppReturn, "") != 0) { // non-empty attribute
try {
if (d->_pcAppWnd->sendHasMsgToActiveView("SetCamera"))
d->_pcAppWnd->sendMsgToActiveView(sMsg.c_str());
const char** pReturnIgnore=0;
std::list<MDIView*> mdi = getMDIViews();
for (std::list<MDIView*>::iterator it = mdi.begin(); it != mdi.end(); ++it) {
if ((*it)->onHasMsg("SetCamera"))
(*it)->onMsg(sMsg.c_str(), pReturnIgnore);
}
}
catch (const Base::Exception& e) {
Base::Console().Error("%s\n", e.what());
@@ -100,6 +100,9 @@ void Gui::GUIApplicationNativeEventAware::initSpaceball(QMainWindow *window)
bool Gui::GUIApplicationNativeEventAware::processSpaceballEvent(QObject *object, QEvent *event)
{
if (!activeWindow())
return true;
QApplication::notify(object, event);
if (event->type() == Spaceball::MotionEvent::MotionEventType)
{
+2
View File
@@ -483,6 +483,8 @@ void InputField::focusInEvent(QFocusEvent * event)
if (!this->hasSelectedText())
selectNumber();
}
QLineEdit::focusInEvent(event);
}
void InputField::keyPressEvent(QKeyEvent *event)
+7 -2
View File
@@ -28,6 +28,7 @@
# include <qevent.h>
# include <qpainter.h>
# include <qpixmap.h>
# include <QGLFramebufferObject>
# include <QMenu>
# include <Inventor/SbBox.h>
# include <Inventor/events/SoEvent.h>
@@ -852,7 +853,9 @@ void RubberbandSelection::initialize()
{
d = new Private(_pcView3D);
_pcView3D->addGraphicsItem(d);
_pcView3D->setRenderFramebuffer(true);
if (QGLFramebufferObject::hasOpenGLFramebufferObjects()) {
_pcView3D->setRenderFramebuffer(true);
}
_pcView3D->scheduleRedraw();
}
@@ -860,7 +863,9 @@ void RubberbandSelection::terminate()
{
_pcView3D->removeGraphicsItem(d);
delete d; d = 0;
_pcView3D->setRenderFramebuffer(false);
if (QGLFramebufferObject::hasOpenGLFramebufferObjects()) {
_pcView3D->setRenderFramebuffer(false);
}
_pcView3D->scheduleRedraw();
}
+11 -5
View File
@@ -410,7 +410,8 @@ def formatObject(target,origin=None):
if not grp:
grp = doc.addObject("App::DocumentObjectGroup",gname)
grp.addObject(target)
obrep.Transparency = 80
if hasattr(obrep,"Transparency"):
obrep.Transparency = 80
else:
col = ui.getDefaultColor("ui")
fcol = ui.getDefaultColor("face")
@@ -3059,6 +3060,8 @@ class _ViewProviderDimension(_ViewProviderDraft):
self.font3d = coin.SoFont()
self.text = coin.SoAsciiText()
self.text3d = coin.SoText2()
self.text.string = "d" # some versions of coin crash if string is not set
self.text3d.string = "d"
self.textpos = coin.SoTransform()
self.text.justification = self.text3d.justification = coin.SoAsciiText.CENTER
label = coin.SoSeparator()
@@ -3211,9 +3214,9 @@ class _ViewProviderDimension(_ViewProviderDraft):
# set text value
l = self.p3.sub(self.p2).Length
if hasattr(obj.ViewObject,"Decimals"):
self.string = DraftGui.displayExternal(l,obj.ViewObject.Decimals,'Length',su)
self.string = DraftGui.displayExternal(l,obj.ViewObject.Decimals,'Length',su).decode("latin1").encode("utf8")
else:
self.string = DraftGui.displayExternal(l,getParam("dimPrecision",2),'Length',su)
self.string = DraftGui.displayExternal(l,getParam("dimPrecision",2),'Length',su).decode("latin1").encode("utf8")
if hasattr(obj.ViewObject,"Override"):
if obj.ViewObject.Override:
try:
@@ -3426,6 +3429,8 @@ class _ViewProviderAngularDimension(_ViewProviderDraft):
self.font3d = coin.SoFont()
self.text = coin.SoAsciiText()
self.text3d = coin.SoText2()
self.text.string = "d" # some versions of coin crash if string is not set
self.text3d.string = "d"
self.text.justification = self.text3d.justification = coin.SoAsciiText.CENTER
self.textpos = coin.SoTransform()
label = coin.SoSeparator()
@@ -3472,6 +3477,7 @@ class _ViewProviderAngularDimension(_ViewProviderDraft):
if hasattr(self,"arc"):
from pivy import coin
import Part, DraftGeomUtils
import DraftGui
text = None
ivob = None
arcsegs = 24
@@ -3497,9 +3503,9 @@ class _ViewProviderAngularDimension(_ViewProviderDraft):
if hasattr(obj.ViewObject,"ShowUnit"):
su = obj.ViewObject.ShowUnit
if hasattr(obj.ViewObject,"Decimals"):
self.string = DraftGui.displayExternal(a,obj.ViewObject.Decimals,'Angle',su)
self.string = DraftGui.displayExternal(a,obj.ViewObject.Decimals,'Angle',su).decode("latin1").encode("utf8")
else:
self.string = DraftGui.displayExternal(a,getParam("dimPrecision",2),'Angle',su)
self.string = DraftGui.displayExternal(a,getParam("dimPrecision",2),'Angle',su).decode("latin1").encode("utf8")
if obj.ViewObject.Override:
try:
from pivy import coin
+12 -9
View File
@@ -453,7 +453,7 @@ class DraftToolBar:
QtCore.QObject.connect(self.radiusValue,QtCore.SIGNAL("returnPressed()"),self.validatePoint)
QtCore.QObject.connect(self.textValue,QtCore.SIGNAL("textChanged(QString)"),self.storeCurrentText)
QtCore.QObject.connect(self.textValue,QtCore.SIGNAL("returnPressed()"),self.sendText)
QtCore.QObject.connect(self.textValue,QtCore.SIGNAL("escaped()"),self.escape)
#QtCore.QObject.connect(self.textValue,QtCore.SIGNAL("escaped()"),self.escape)
QtCore.QObject.connect(self.textValue,QtCore.SIGNAL("down()"),self.sendText)
QtCore.QObject.connect(self.textValue,QtCore.SIGNAL("up()"),self.lineUp)
QtCore.QObject.connect(self.zValue,QtCore.SIGNAL("returnPressed()"),self.xValue.setFocus)
@@ -477,26 +477,29 @@ class DraftToolBar:
QtCore.QObject.connect(self.hasFill,QtCore.SIGNAL("stateChanged(int)"),self.setFill)
QtCore.QObject.connect(self.currentViewButton,QtCore.SIGNAL("clicked()"),self.selectCurrentView)
QtCore.QObject.connect(self.resetPlaneButton,QtCore.SIGNAL("clicked()"),self.selectResetPlane)
QtCore.QObject.connect(self.xValue,QtCore.SIGNAL("escaped()"),self.escape)
QtCore.QObject.connect(self.xValue,QtCore.SIGNAL("undo()"),self.undoSegment)
QtCore.QObject.connect(self.yValue,QtCore.SIGNAL("escaped()"),self.escape)
QtCore.QObject.connect(self.yValue,QtCore.SIGNAL("undo()"),self.undoSegment)
QtCore.QObject.connect(self.zValue,QtCore.SIGNAL("escaped()"),self.escape)
QtCore.QObject.connect(self.zValue,QtCore.SIGNAL("undo()"),self.undoSegment)
QtCore.QObject.connect(self.radiusValue,QtCore.SIGNAL("escaped()"),self.escape)
QtCore.QObject.connect(self.baseWidget,QtCore.SIGNAL("resized()"),self.relocate)
QtCore.QObject.connect(self.baseWidget,QtCore.SIGNAL("retranslate()"),self.retranslateUi)
QtCore.QObject.connect(self.SSizeValue,QtCore.SIGNAL("valueChanged(double)"),self.changeSSizeValue)
QtCore.QObject.connect(self.SSizeValue,QtCore.SIGNAL("returnPressed()"),self.validateSNumeric)
QtCore.QObject.connect(self.SSizeValue,QtCore.SIGNAL("escaped()"),self.escape)
QtCore.QObject.connect(self.STrackValue,QtCore.SIGNAL("valueChanged(double)"),self.changeSTrackValue)
QtCore.QObject.connect(self.STrackValue,QtCore.SIGNAL("returnPressed()"),self.validateSNumeric)
QtCore.QObject.connect(self.STrackValue,QtCore.SIGNAL("escaped()"),self.escape)
QtCore.QObject.connect(self.SStringValue,QtCore.SIGNAL("returnPressed()"),self.validateSString)
QtCore.QObject.connect(self.SStringValue,QtCore.SIGNAL("escaped()"),self.escape)
QtCore.QObject.connect(self.chooserButton,QtCore.SIGNAL("pressed()"),self.pickFile)
QtCore.QObject.connect(self.FFileValue,QtCore.SIGNAL("returnPressed()"),self.validateFile)
QtCore.QObject.connect(self.FFileValue,QtCore.SIGNAL("escaped()"),self.escape)
# following lines can cause a crash and are not needed anymore when using the task panel
# http://forum.freecadweb.org/viewtopic.php?f=3&t=6952
#QtCore.QObject.connect(self.FFileValue,QtCore.SIGNAL("escaped()"),self.escape)
#QtCore.QObject.connect(self.xValue,QtCore.SIGNAL("escaped()"),self.escape)
#QtCore.QObject.connect(self.yValue,QtCore.SIGNAL("escaped()"),self.escape)
#QtCore.QObject.connect(self.zValue,QtCore.SIGNAL("escaped()"),self.escape)
#QtCore.QObject.connect(self.radiusValue,QtCore.SIGNAL("escaped()"),self.escape)
#QtCore.QObject.connect(self.SSizeValue,QtCore.SIGNAL("escaped()"),self.escape)
#QtCore.QObject.connect(self.STrackValue,QtCore.SIGNAL("escaped()"),self.escape)
#QtCore.QObject.connect(self.SStringValue,QtCore.SIGNAL("escaped()"),self.escape)
# if Ui changed to have Size & Track visible at same time, use this
# QtCore.QObject.connect(self.SSizeValue,QtCore.SIGNAL("returnPressed()"),self.checkSSize)
+4 -4
View File
@@ -3984,10 +3984,10 @@ class Array(Modifier):
self.view.removeEventCallback("SoEvent",self.call)
if FreeCADGui.Selection.getSelection():
obj = FreeCADGui.Selection.getSelection()[0]
FreeCAD.ActiveDocument.openTransaction("Array")
Draft.makeArray(obj,Vector(1,0,0),Vector(0,1,0),2,2)
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()
self.commit(translate("draft","Array"),
['import Draft',
'Draft.makeArray(FreeCAD.ActiveDocument.'+obj.Name+',FreeCAD.Vector(1,0,0),FreeCAD.Vector(0,1,0),2,2)',
'FreeCAD.ActiveDocument.recompute()'])
self.finish()
class PathArray(Modifier):
+13 -12
View File
@@ -155,23 +155,31 @@ App::DocumentObjectExecReturn *FeaturePage::execute(void)
// checking for freecad editable texts
string outfragment(ofile.str());
if (EditableTexts.getSize() > 0) {
const std::vector<std::string>& editText = EditableTexts.getValues();
if (!editText.empty()) {
boost::regex e1 ("<text.*?freecad:editable=\"(.*?)\".*?<tspan.*?>(.*?)</tspan>");
string::const_iterator begin, end;
begin = outfragment.begin();
end = outfragment.end();
boost::match_results<std::string::const_iterator> what;
int count = 0;
std::size_t count = 0;
std::string newfragment;
newfragment.reserve(outfragment.size());
while (boost::regex_search(begin, end, what, e1)) {
if (count < EditableTexts.getSize()) {
if (count < editText.size()) {
// change values of editable texts
boost::regex e2 ("(<text.*?freecad:editable=\""+what[1].str()+"\".*?<tspan.*?)>(.*?)(</tspan>)");
outfragment = boost::regex_replace(outfragment, e2, "$1>"+EditableTexts.getValues()[count]+"$3");
boost::re_detail::string_out_iterator<std::string > out(newfragment);
boost::regex_replace(out, begin, what[0].second, e2, "$1>"+editText[count]+"$3");
}
count ++;
count++;
begin = what[0].second;
}
// now copy the rest
newfragment.insert(newfragment.end(), begin, end);
outfragment = newfragment;
}
// restoring linebreaks and saving the file
@@ -184,13 +192,6 @@ App::DocumentObjectExecReturn *FeaturePage::execute(void)
PageResult.setValue(tempName.c_str());
//const char* text = "lskdfjlsd";
//const char* regex = "lskdflds";
//boost::regex e(regex);
//boost::smatch what;
//if(boost::regex_match(string(text), what, e))
//{
//}
return App::DocumentObject::StdReturn;
}
+22 -3
View File
@@ -58,6 +58,7 @@
#include <Base/Stream.h>
#include <Base/gzstream.h>
#include <Base/PyObjectBase.h>
#include <Gui/Document.h>
#include <Gui/FileDialog.h>
#include <Gui/WaitCursor.h>
@@ -312,6 +313,20 @@ bool DrawingView::onMsg(const char* pMsg, const char** ppReturn)
viewAll();
return true;
}
else if (strcmp("Save",pMsg) == 0) {
Gui::Document *doc = getGuiDocument();
if (doc) {
doc->save();
return true;
}
}
else if (strcmp("SaveAs",pMsg) == 0) {
Gui::Document *doc = getGuiDocument();
if (doc) {
doc->saveAs();
return true;
}
}
return false;
}
@@ -319,12 +334,16 @@ bool DrawingView::onHasMsg(const char* pMsg) const
{
if (strcmp("ViewFit",pMsg) == 0)
return true;
else if (strcmp("Save",pMsg) == 0)
return getGuiDocument() != 0;
else if (strcmp("SaveAs",pMsg) == 0)
return getGuiDocument() != 0;
else if (strcmp("Print",pMsg) == 0)
return true;
return true;
else if (strcmp("PrintPreview",pMsg) == 0)
return true;
return true;
else if (strcmp("PrintPdf",pMsg) == 0)
return true;
return true;
return false;
}
+1 -1
View File
@@ -349,7 +349,7 @@ App::DocumentObjectExecReturn *Sweep::execute(void)
}
path = mkWire.Wire();
}
if (shape._Shape.ShapeType() == TopAbs_EDGE) {
else if (shape._Shape.ShapeType() == TopAbs_EDGE) {
path = shape._Shape;
}
else if (shape._Shape.ShapeType() == TopAbs_WIRE) {
+7 -7
View File
@@ -75,7 +75,7 @@
# include <BRepTools.hxx>
# include <BRepTools_ReShape.hxx>
# include <BRepTools_ShapeSet.hxx>
#include <BRepFill_CompatibleWires.hxx>
# include <BRepFill_CompatibleWires.hxx>
# include <GCE2d_MakeSegment.hxx>
# include <Geom2d_Line.hxx>
# include <Geom2d_TrimmedCurve.hxx>
@@ -91,6 +91,7 @@
# include <Handle_Law_BSpline.hxx>
# include <Handle_TopTools_HSequenceOfShape.hxx>
# include <Law_BSpFunc.hxx>
# include <Law_Constant.hxx>
# include <Law_Linear.hxx>
# include <Law_S.hxx>
# include <TopTools_HSequenceOfShape.hxx>
@@ -691,12 +692,10 @@ void TopoShape::write(const char *FileName) const
void TopoShape::exportIges(const char *filename) const
{
Interface_Static::SetCVal("write.iges.unit","IN");
try {
// write iges file
IGESControl_Controller::Init();
IGESControl_Writer aWriter;
//IGESControl_Writer aWriter(Interface_Static::CVal("write.iges.unit"), 1);
aWriter.AddShape(this->_Shape);
aWriter.ComputeModel();
QString fn = QString::fromUtf8(filename);
@@ -1463,8 +1462,8 @@ static Handle(Law_Function) CreateBsFunction (const Standard_Real theFirst, cons
{
//Handle_Law_BSpline aBs;
//Handle_Law_BSpFunc aFunc = new Law_BSpFunc (aBs, theFirst, theLast);
Handle_Law_Linear aFunc = new Law_Linear();
aFunc->Set(theFirst, theRadius, theLast, theRadius);
Handle_Law_Constant aFunc = new Law_Constant();
aFunc->Set(1, theFirst, theLast);
return aFunc;
}
@@ -1472,6 +1471,7 @@ TopoDS_Shape TopoShape::makeTube(double radius, double tol, int cont, int maxdeg
{
// http://opencascade.blogspot.com/2009/11/surface-modeling-part3.html
Standard_Real theTol = tol;
Standard_Real theRadius = radius;
//Standard_Boolean theIsPolynomial = Standard_True;
Standard_Boolean myIsElem = Standard_True;
GeomAbs_Shape theContinuity = GeomAbs_Shape(cont);
@@ -1500,11 +1500,11 @@ TopoDS_Shape TopoShape::makeTube(double radius, double tol, int cont, int maxdeg
}
//circular profile
Handle(Geom_Circle) aCirc = new Geom_Circle (gp::XOY(), radius);
Handle(Geom_Circle) aCirc = new Geom_Circle (gp::XOY(), theRadius);
aCirc->Rotate (gp::OZ(), M_PI/2.);
//perpendicular section
Handle(Law_Function) myEvol = ::CreateBsFunction (myPath->FirstParameter(), myPath->LastParameter(), radius);
Handle(Law_Function) myEvol = ::CreateBsFunction (myPath->FirstParameter(), myPath->LastParameter(), theRadius);
Handle(GeomFill_SectionLaw) aSec = new GeomFill_EvolvedSection(aCirc, myEvol);
Handle(GeomFill_LocationLaw) aLoc = new GeomFill_CurveAndTrihedron(new GeomFill_CorrectedFrenet);
aLoc->SetCurve (myPath);
@@ -234,6 +234,8 @@ const TopoDS_Shape& SketchBased::getSupportShape() const {
int SketchBased::getSketchAxisCount(void) const
{
Part::Part2DObject *sketch = static_cast<Part::Part2DObject*>(Sketch.getValue());
if (!sketch)
return -1; // the link to the sketch is lost
return sketch->getAxisCount();
}
+7 -2
View File
@@ -29,7 +29,7 @@
#include "ViewProvider.h"
#include <Mod/Part/App/PropertyTopoShape.h>
#include <Gui/Command.h>
//#include <Gui/Document.h>
#include <Base/Exception.h>
using namespace PartDesignGui;
@@ -48,7 +48,12 @@ bool ViewProvider::doubleClicked(void)
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());
try {
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().setEdit('%s',0)",this->pcObject->getNameInDocument());
}
catch (const Base::Exception&) {
Gui::Command::abortCommand();
}
return true;
}
@@ -67,6 +67,16 @@ void ViewProviderGroove::setupContextMenu(QMenu* menu, QObject* receiver, const
bool ViewProviderGroove::setEdit(int ModNum)
{
if (ModNum == ViewProvider::Default ) {
PartDesign::Groove* pcGroove = static_cast<PartDesign::Groove*>(getObject());
if (pcGroove->getSketchAxisCount() < 0) {
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Critical);
msgBox.setWindowTitle(QObject::tr("Lost link to base sketch"));
msgBox.setText(QObject::tr("The object can't be edited because the link to the the base sketch is lost."));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
return false;
}
// When double-clicking on the item for this pad the
// object unsets and sets its edit mode without closing
// the task panel
@@ -67,6 +67,16 @@ void ViewProviderRevolution::setupContextMenu(QMenu* menu, QObject* receiver, co
bool ViewProviderRevolution::setEdit(int ModNum)
{
if (ModNum == ViewProvider::Default ) {
PartDesign::Revolution* pcRevolution = static_cast<PartDesign::Revolution*>(getObject());
if (pcRevolution->getSketchAxisCount() < 0) {
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Critical);
msgBox.setWindowTitle(QObject::tr("Lost link to base sketch"));
msgBox.setText(QObject::tr("The object can't be edited because the link to the the base sketch is lost."));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
return false;
}
// When double-clicking on the item for this pad the
// object unsets and sets its edit mode without closing
// the task panel
+12 -1
View File
@@ -355,7 +355,18 @@ PyObject* SketchObjectPy::getPoint(PyObject *args)
if (!PyArg_ParseTuple(args, "ii", &GeoId, &PointType))
return 0;
return new Base::VectorPy(new Base::Vector3d(this->getSketchObjectPtr()->getPoint(GeoId,(Sketcher::PointPos)PointType)));
if (PointType < 0 || PointType > 3) {
PyErr_SetString(PyExc_ValueError, "Invalid point type");
return 0;
}
SketchObject* obj = this->getSketchObjectPtr();
if (GeoId > obj->getHighestCurveIndex() || -GeoId > obj->getExternalGeometryCount()) {
PyErr_SetString(PyExc_ValueError, "Invalid geometry Id");
return 0;
}
return new Base::VectorPy(new Base::Vector3d(obj->getPoint(GeoId,(Sketcher::PointPos)PointType)));
}
PyObject* SketchObjectPy::getAxis(PyObject *args)
+1 -1
View File
@@ -43,7 +43,7 @@ def main():
revision='%04d' % (info.count('\n'))
PACKAGE_NAME = 'freecad'
version = "0.13.%s" % (revision)
version = "0.14.%s" % (revision)
DIRNAME = "%(p)s-%(v)s" % {'p': PACKAGE_NAME, 'v': version}
TARNAME = DIRNAME + '.tar'
@@ -77,6 +77,8 @@ section "install"
setOutPath $INSTDIR\bin
# Files added here should be removed by the uninstaller (see section "uninstall")
file /r /X *.idb /X *.pyc /X *.pyo "..\..\bin\"
setOutPath $INSTDIR\lib
file /r /X *.lib /X *.pyc /X *.pyo "..\..\lib\"
setOutPath $INSTDIR\Mod
file /r /X *.idb "..\..\Mod\"
setOutPath $INSTDIR\doc
@@ -139,12 +141,14 @@ section "uninstall"
# Remove files
rmDir /r "$INSTDIR\bin"
rmDir /r "$INSTDIR\lib"
rmDir /r "$INSTDIR\doc"
rmDir /r "$INSTDIR\data"
rmDir /r "$INSTDIR\Mod"
# Always delete uninstaller as the last action
delete $INSTDIR\uninstall.exe
delete $INSTDIR\vcredist_x86.exe
# Try to remove the install directory - this will only happen if it is empty
rmDir $INSTDIR