- 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
This commit is contained in:
parent
c6edd47334
commit
3ecaf8778d
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1621,11 +1621,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 ();
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -483,6 +483,8 @@ void InputField::focusInEvent(QFocusEvent * event)
|
|||
if (!this->hasSelectedText())
|
||||
selectNumber();
|
||||
}
|
||||
|
||||
QLineEdit::focusInEvent(event);
|
||||
}
|
||||
|
||||
void InputField::keyPressEvent(QKeyEvent *event)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -692,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);
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user