Merge branch 'master' of git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad
This commit is contained in:
commit
26735ef19b
|
@ -182,12 +182,14 @@ PyObject* DocumentPy::removeObject(PyObject *args)
|
|||
|
||||
PyObject* DocumentPy::copyObject(PyObject *args)
|
||||
{
|
||||
PyObject *obj, *rec=0, *keep=0;
|
||||
PyObject *obj, *rec=Py_False, *keep=Py_False;
|
||||
if (!PyArg_ParseTuple(args, "O!|O!O!",&(DocumentObjectPy::Type),&obj,&PyBool_Type,&rec,&PyBool_Type,&keep))
|
||||
return NULL; // NULL triggers exception
|
||||
|
||||
DocumentObjectPy* docObj = static_cast<DocumentObjectPy*>(obj);
|
||||
DocumentObject* copy = getDocumentPtr()->copyObject(docObj->getDocumentObjectPtr(), rec==Py_True, keep==Py_True);
|
||||
DocumentObject* copy = getDocumentPtr()->copyObject(docObj->getDocumentObjectPtr(),
|
||||
PyObject_IsTrue(rec) ? true : false,
|
||||
PyObject_IsTrue(keep)? true : false);
|
||||
if (copy) {
|
||||
return copy->getPyObject();
|
||||
}
|
||||
|
@ -199,12 +201,12 @@ PyObject* DocumentPy::copyObject(PyObject *args)
|
|||
|
||||
PyObject* DocumentPy::moveObject(PyObject *args)
|
||||
{
|
||||
PyObject *obj, *rec=0;
|
||||
PyObject *obj, *rec=Py_False;
|
||||
if (!PyArg_ParseTuple(args, "O!|O!",&(DocumentObjectPy::Type),&obj,&PyBool_Type,&rec))
|
||||
return NULL; // NULL triggers exception
|
||||
|
||||
DocumentObjectPy* docObj = static_cast<DocumentObjectPy*>(obj);
|
||||
DocumentObject* move = getDocumentPtr()->moveObject(docObj->getDocumentObjectPtr(), rec==Py_True);
|
||||
DocumentObject* move = getDocumentPtr()->moveObject(docObj->getDocumentObjectPtr(), PyObject_IsTrue(rec) ? true : false);
|
||||
if (move) {
|
||||
return move->getPyObject();
|
||||
}
|
||||
|
@ -309,36 +311,36 @@ PyObject* DocumentPy::findObjects(PyObject *args)
|
|||
char *sType="App::DocumentObject", *sName=0;
|
||||
if (!PyArg_ParseTuple(args, "|ss",&sType, &sName)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
|
||||
Base::Type type = Base::Type::fromName(sType);
|
||||
if (type == Base::Type::badType()) {
|
||||
PyErr_Format(PyExc_Exception, "'%s' is not a valid type", sType);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!type.isDerivedFrom(App::DocumentObject::getClassTypeId())) {
|
||||
PyErr_Format(PyExc_Exception, "Type '%s' does not inherit from 'App::DocumentObject'", sType);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
std::vector<DocumentObject*> res;
|
||||
|
||||
if (sName) {
|
||||
try {
|
||||
res = getDocumentPtr()->findObjects(type, sName);
|
||||
}
|
||||
catch (const boost::regex_error& e) {
|
||||
PyErr_SetString(PyExc_RuntimeError, e.what());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
res = getDocumentPtr()->getObjectsOfType(type);
|
||||
}
|
||||
|
||||
Py_ssize_t index=0;
|
||||
PyObject* list = PyList_New((Py_ssize_t)res.size());
|
||||
for (std::vector<DocumentObject*>::const_iterator It = res.begin();It != res.end();++It, index++)
|
||||
|
||||
Base::Type type = Base::Type::fromName(sType);
|
||||
if (type == Base::Type::badType()) {
|
||||
PyErr_Format(PyExc_Exception, "'%s' is not a valid type", sType);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!type.isDerivedFrom(App::DocumentObject::getClassTypeId())) {
|
||||
PyErr_Format(PyExc_Exception, "Type '%s' does not inherit from 'App::DocumentObject'", sType);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
std::vector<DocumentObject*> res;
|
||||
|
||||
if (sName) {
|
||||
try {
|
||||
res = getDocumentPtr()->findObjects(type, sName);
|
||||
}
|
||||
catch (const boost::regex_error& e) {
|
||||
PyErr_SetString(PyExc_RuntimeError, e.what());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
res = getDocumentPtr()->getObjectsOfType(type);
|
||||
}
|
||||
|
||||
Py_ssize_t index=0;
|
||||
PyObject* list = PyList_New((Py_ssize_t)res.size());
|
||||
for (std::vector<DocumentObject*>::const_iterator It = res.begin();It != res.end();++It, index++)
|
||||
PyList_SetItem(list, index, (*It)->getPyObject());
|
||||
return list;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,8 @@ PyObject* FeaturePythonPy::addProperty(PyObject *args)
|
|||
return NULL; // NULL triggers exception
|
||||
|
||||
Property* prop=0;
|
||||
prop = getFeaturePythonPtr()->addDynamicProperty(sType,sName,sGroup,sDoc,attr,ro==Py_True,hd==Py_True);
|
||||
prop = getFeaturePythonPtr()->addDynamicProperty(sType,sName,sGroup,sDoc,attr,
|
||||
PyObject_IsTrue(ro) ? true : false, PyObject_IsTrue(hd) ? true : false);
|
||||
|
||||
if (!prop) {
|
||||
std::stringstream str;
|
||||
|
|
|
@ -1347,7 +1347,7 @@ PyObject *PropertyBool::getPyObject(void)
|
|||
void PropertyBool::setPyObject(PyObject *value)
|
||||
{
|
||||
if (PyBool_Check(value))
|
||||
setValue(value == Py_True);
|
||||
setValue(PyObject_IsTrue(value)!=0);
|
||||
else if(PyInt_Check(value))
|
||||
setValue(PyInt_AsLong(value)!=0);
|
||||
else {
|
||||
|
|
|
@ -97,25 +97,26 @@
|
|||
#include <xercesc/sax2/SAX2XMLReader.hpp>
|
||||
#include <xercesc/sax2/XMLReaderFactory.hpp>
|
||||
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/filesystem/exception.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/filesystem/exception.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
// QtCore
|
||||
#include <QBuffer>
|
||||
#include <QByteArray>
|
||||
|
||||
// QtCore
|
||||
#include <QBuffer>
|
||||
#include <QByteArray>
|
||||
#include <QCoreApplication>
|
||||
#include <QEvent>
|
||||
#include <QIODevice>
|
||||
#include <QDataStream>
|
||||
#include <QIODevice>
|
||||
#include <QDataStream>
|
||||
#include <QWriteLocker>
|
||||
#include <QReadLocker>
|
||||
#include <QReadWriteLock>
|
||||
#include <QMutex>
|
||||
#include <QMutexLocker>
|
||||
#include <QUuid>
|
||||
|
||||
|
||||
|
||||
#endif //_PreComp_
|
||||
|
||||
#endif // BASE_PRECOMPILED_H
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#ifndef _PreComp_
|
||||
# ifdef FC_OS_WIN32
|
||||
# include <Rpc.h>
|
||||
# else
|
||||
# include <QUuid>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
@ -63,7 +65,6 @@ Uuid::~Uuid()
|
|||
//**************************************************************************
|
||||
// Get the UUID
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
std::string Uuid::CreateUuid(void)
|
||||
{
|
||||
#ifdef FC_OS_WIN32
|
||||
|
@ -82,6 +83,12 @@ std::string Uuid::CreateUuid(void)
|
|||
/* convert it from rcp memory to our own */
|
||||
//container = nssUTF8_Duplicate(uuidStr, NULL);
|
||||
RpcStringFree(&uuidStr);
|
||||
#elif 1
|
||||
std::string Uuid;
|
||||
QString uuid = QUuid::createUuid().toString();
|
||||
uuid = uuid.mid(1);
|
||||
uuid.chop(1);
|
||||
Uuid = (const char*)uuid.toAscii();
|
||||
#else
|
||||
// use Python's implemententation
|
||||
std::string Uuid;
|
||||
|
@ -100,3 +107,4 @@ std::string Uuid::CreateUuid(void)
|
|||
#endif
|
||||
return Uuid;
|
||||
}
|
||||
|
||||
|
|
|
@ -83,6 +83,9 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
|||
// which influence the seek mode itself -- these are handled further
|
||||
// up the inheritance hierarchy.
|
||||
if (this->isSeekMode()) { return inherited::processSoEvent(ev); }
|
||||
// Switch off viewing mode (Bug #0000911)
|
||||
if (!this->isSeekMode() && this->isViewing())
|
||||
this->setViewing(false); // by default disable viewing mode to render the scene
|
||||
|
||||
const SoType type(ev->getTypeId());
|
||||
|
||||
|
|
|
@ -85,6 +85,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
|||
// up the inheritance hierarchy.
|
||||
if (this->isSeekMode()) { return inherited::processSoEvent(ev); }
|
||||
#else
|
||||
// Switch off viewing mode (Bug #0000911)
|
||||
if (!this->isSeekMode() && this->isViewing())
|
||||
this->setViewing(false); // by default disable viewing mode to render the scene
|
||||
#endif
|
||||
|
|
|
@ -164,14 +164,16 @@ StdCmdMacroStartDebug::StdCmdMacroStartDebug()
|
|||
|
||||
void StdCmdMacroStartDebug::activated(int iMsg)
|
||||
{
|
||||
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"StartDebug\")");
|
||||
PythonDebugger* dbg = Application::Instance->macroManager()->debugger();
|
||||
if (!dbg->isRunning())
|
||||
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"StartDebug\")");
|
||||
else
|
||||
dbg->stepRun();
|
||||
}
|
||||
|
||||
bool StdCmdMacroStartDebug::isActive(void)
|
||||
{
|
||||
static PythonDebugger* dbg = Application::Instance->macroManager()->debugger();
|
||||
return (!dbg->isRunning() &&
|
||||
getGuiApplication()->sendHasMsgToActiveView("StartDebug"));
|
||||
return getGuiApplication()->sendHasMsgToActiveView("StartDebug");
|
||||
}
|
||||
|
||||
DEF_STD_CMD_A(StdCmdMacroStopDebug);
|
||||
|
@ -226,6 +228,32 @@ bool StdCmdMacroStepOver::isActive(void)
|
|||
return dbg->isRunning();
|
||||
}
|
||||
|
||||
DEF_STD_CMD_A(StdCmdMacroStepInto);
|
||||
|
||||
StdCmdMacroStepInto::StdCmdMacroStepInto()
|
||||
: Command("Std_MacroStepInto")
|
||||
{
|
||||
sGroup = QT_TR_NOOP("Macro");
|
||||
sMenuText = QT_TR_NOOP("Step into");
|
||||
sToolTipText = QT_TR_NOOP("Step into");
|
||||
//sWhatsThis = "Std_MacroStepOver";
|
||||
sStatusTip = QT_TR_NOOP("Step into");
|
||||
sPixmap = 0;
|
||||
sAccel = "F11";
|
||||
eType = 0;
|
||||
}
|
||||
|
||||
void StdCmdMacroStepInto::activated(int iMsg)
|
||||
{
|
||||
Application::Instance->macroManager()->debugger()->stepInto();
|
||||
}
|
||||
|
||||
bool StdCmdMacroStepInto::isActive(void)
|
||||
{
|
||||
static PythonDebugger* dbg = Application::Instance->macroManager()->debugger();
|
||||
return dbg->isRunning();
|
||||
}
|
||||
|
||||
DEF_STD_CMD_A(StdCmdToggleBreakpoint);
|
||||
|
||||
StdCmdToggleBreakpoint::StdCmdToggleBreakpoint()
|
||||
|
@ -263,6 +291,7 @@ void CreateMacroCommands(void)
|
|||
rcCmdMgr.addCommand(new StdCmdMacroStartDebug());
|
||||
rcCmdMgr.addCommand(new StdCmdMacroStopDebug());
|
||||
rcCmdMgr.addCommand(new StdCmdMacroStepOver());
|
||||
rcCmdMgr.addCommand(new StdCmdMacroStepInto());
|
||||
rcCmdMgr.addCommand(new StdCmdToggleBreakpoint());
|
||||
}
|
||||
|
||||
|
|
|
@ -507,7 +507,7 @@ bool PythonEditorView::onMsg(const char* pMsg,const char** ppReturn)
|
|||
return true;
|
||||
}
|
||||
else if (strcmp(pMsg,"StartDebug")==0) {
|
||||
startDebug();
|
||||
QTimer::singleShot(300, this, SLOT(startDebug()));
|
||||
return true;
|
||||
}
|
||||
else if (strcmp(pMsg,"ToggleBreakpoint")==0) {
|
||||
|
|
|
@ -83,6 +83,9 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
|||
// which influence the seek mode itself -- these are handled further
|
||||
// up the inheritance hierarchy.
|
||||
if (this->isSeekMode()) { return inherited::processSoEvent(ev); }
|
||||
// Switch off viewing mode (Bug #0000911)
|
||||
if (!this->isSeekMode() && this->isViewing())
|
||||
this->setViewing(false); // by default disable viewing mode to render the scene
|
||||
|
||||
const SoType type(ev->getTypeId());
|
||||
|
||||
|
|
|
@ -236,9 +236,10 @@ Py::Object PythonDebugStderr::repr()
|
|||
Py::Object PythonDebugStderr::write(const Py::Tuple& args)
|
||||
{
|
||||
char *msg;
|
||||
PyObject* pObj;
|
||||
//PyObject* pObj;
|
||||
//args contains a single parameter which is the string to write.
|
||||
if (!PyArg_ParseTuple(args.ptr(), "Os:OutputDebugString", &pObj, &msg))
|
||||
//if (!PyArg_ParseTuple(args.ptr(), "Os:OutputDebugString", &pObj, &msg))
|
||||
if (!PyArg_ParseTuple(args.ptr(), "s:OutputDebugString", &msg))
|
||||
throw Py::Exception();
|
||||
|
||||
if (strlen(msg) > 0)
|
||||
|
@ -248,6 +249,7 @@ Py::Object PythonDebugStderr::write(const Py::Tuple& args)
|
|||
|
||||
//send it to the debugger as well
|
||||
//g_DebugSocket.SendMessage(eMSG_TRACE, msg);
|
||||
Base::Console().Error("%s", msg);
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
|
@ -417,9 +419,42 @@ void PythonDebugger::runFile(const QString& fn)
|
|||
{
|
||||
try {
|
||||
RunningState state(d->running);
|
||||
Base::Interpreter().runFile((const char*)fn.toUtf8(), true);
|
||||
QByteArray pxFileName = fn.toUtf8();
|
||||
#ifdef FC_OS_WIN32
|
||||
Base::FileInfo fi((const char*)pxFileName);
|
||||
FILE *fp = _wfopen(fi.toStdWString().c_str(),L"r");
|
||||
#else
|
||||
FILE *fp = fopen((const char*)pxFileName,"r");
|
||||
#endif
|
||||
if (!fp) return;
|
||||
|
||||
Base::PyGILStateLocker locker;
|
||||
PyObject *module, *dict;
|
||||
module = PyImport_AddModule("__main__");
|
||||
dict = PyModule_GetDict(module);
|
||||
dict = PyDict_Copy(dict);
|
||||
if (PyDict_GetItemString(dict, "__file__") == NULL) {
|
||||
PyObject *f = PyString_FromString((const char*)pxFileName);
|
||||
if (f == NULL)
|
||||
return;
|
||||
if (PyDict_SetItemString(dict, "__file__", f) < 0) {
|
||||
Py_DECREF(f);
|
||||
return;
|
||||
}
|
||||
Py_DECREF(f);
|
||||
}
|
||||
|
||||
PyObject *result = PyRun_File(fp, (const char*)pxFileName, Py_file_input, dict, dict);
|
||||
fclose(fp);
|
||||
Py_DECREF(dict);
|
||||
|
||||
if (!result)
|
||||
PyErr_Print();
|
||||
else
|
||||
Py_DECREF(result);
|
||||
}
|
||||
catch (const Base::PyException&) {
|
||||
catch (const Base::PyException&/* e*/) {
|
||||
//PySys_WriteStderr("Exception: %s\n", e.what());
|
||||
}
|
||||
catch (...) {
|
||||
Base::Console().Warning("Unknown exception thrown during macro debugging\n");
|
||||
|
@ -474,6 +509,16 @@ void PythonDebugger::stepOver()
|
|||
signalNextStep();
|
||||
}
|
||||
|
||||
void PythonDebugger::stepInto()
|
||||
{
|
||||
signalNextStep();
|
||||
}
|
||||
|
||||
void PythonDebugger::stepRun()
|
||||
{
|
||||
signalNextStep();
|
||||
}
|
||||
|
||||
void PythonDebugger::showDebugMarker(const QString& fn, int line)
|
||||
{
|
||||
PythonEditorView* edit = 0;
|
||||
|
@ -524,7 +569,7 @@ int PythonDebugger::tracer_callback(PyObject *obj, PyFrameObject *frame, int wha
|
|||
//int no;
|
||||
|
||||
//no = frame->f_tstate->recursion_depth;
|
||||
//char* name = PyString_AsString(frame->f_code->co_name);
|
||||
//std::string funcname = PyString_AsString(frame->f_code->co_name);
|
||||
QString file = QString::fromUtf8(PyString_AsString(frame->f_code->co_filename));
|
||||
switch (what) {
|
||||
case PyTrace_CALL:
|
||||
|
|
|
@ -169,6 +169,8 @@ public:
|
|||
bool stop();
|
||||
void tryStop();
|
||||
void stepOver();
|
||||
void stepInto();
|
||||
void stepRun();
|
||||
void showDebugMarker(const QString&, int line);
|
||||
void hideDebugMarker(const QString&);
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@ public:
|
|||
PythonEditor(QWidget *parent = 0);
|
||||
~PythonEditor();
|
||||
|
||||
void startDebug();
|
||||
void toggleBreakpoint();
|
||||
void showDebugMarker(int line);
|
||||
void hideDebugMarker();
|
||||
|
@ -62,6 +61,7 @@ public Q_SLOTS:
|
|||
*/
|
||||
void onUncomment();
|
||||
void setFileName(const QString&);
|
||||
void startDebug();
|
||||
|
||||
protected:
|
||||
/** Pops up the context menu with some extensions */
|
||||
|
|
|
@ -1,3 +1,24 @@
|
|||
/***************************************************************************
|
||||
* Copyright (c) 2009 Juergen Riegel (FreeCAD@juergen-riegel.net) *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
|
|
|
@ -105,8 +105,6 @@ SoFCUnifiedSelection::SoFCUnifiedSelection() : viewer(0)
|
|||
SO_NODE_SET_SF_ENUM_TYPE (highlightMode, HighlightModes);
|
||||
|
||||
highlighted = FALSE;
|
||||
bShift = FALSE;
|
||||
bCtrl = FALSE;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -414,22 +412,6 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action)
|
|||
}
|
||||
}
|
||||
}
|
||||
// key press events
|
||||
else if (event->isOfType(SoKeyboardEvent ::getClassTypeId())) {
|
||||
SoKeyboardEvent * const e = (SoKeyboardEvent *) event;
|
||||
if (SoKeyboardEvent::isKeyPressEvent(e,SoKeyboardEvent::LEFT_SHIFT) ||
|
||||
SoKeyboardEvent::isKeyPressEvent(e,SoKeyboardEvent::RIGHT_SHIFT) )
|
||||
bShift = true;
|
||||
if (SoKeyboardEvent::isKeyReleaseEvent(e,SoKeyboardEvent::LEFT_SHIFT) ||
|
||||
SoKeyboardEvent::isKeyReleaseEvent(e,SoKeyboardEvent::RIGHT_SHIFT) )
|
||||
bShift = false;
|
||||
if (SoKeyboardEvent::isKeyPressEvent(e,SoKeyboardEvent::LEFT_CONTROL) ||
|
||||
SoKeyboardEvent::isKeyPressEvent(e,SoKeyboardEvent::RIGHT_CONTROL) )
|
||||
bCtrl = true;
|
||||
if (SoKeyboardEvent::isKeyReleaseEvent(e,SoKeyboardEvent::LEFT_CONTROL) ||
|
||||
SoKeyboardEvent::isKeyReleaseEvent(e,SoKeyboardEvent::RIGHT_CONTROL) )
|
||||
bCtrl = false;
|
||||
}
|
||||
// mouse press events for (de)selection
|
||||
else if (event->isOfType(SoMouseButtonEvent::getClassTypeId()) &&
|
||||
selectionMode.getValue() == SoFCUnifiedSelection::ON) {
|
||||
|
@ -449,7 +431,7 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action)
|
|||
std::string documentName = vpd->getObject()->getDocument()->getName();
|
||||
std::string objectName = vpd->getObject()->getNameInDocument();
|
||||
std::string subElementName = vpd->getElement(pp ? pp->getDetail() : 0);
|
||||
if (bCtrl) {
|
||||
if (event->wasCtrlDown()) {
|
||||
if (Gui::Selection().isSelected(documentName.c_str()
|
||||
,objectName.c_str()
|
||||
,subElementName.c_str())) {
|
||||
|
|
|
@ -107,9 +107,6 @@ private:
|
|||
|
||||
SbBool highlighted;
|
||||
SoColorPacker colorpacker;
|
||||
|
||||
SbBool bShift;
|
||||
SbBool bCtrl;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -83,6 +83,9 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
|
|||
// which influence the seek mode itself -- these are handled further
|
||||
// up the inheritance hierarchy.
|
||||
if (this->isSeekMode()) { return inherited::processSoEvent(ev); }
|
||||
// Switch off viewing mode (Bug #0000911)
|
||||
if (!this->isSeekMode() && this->isViewing())
|
||||
this->setViewing(false); // by default disable viewing mode to render the scene
|
||||
|
||||
const SoType type(ev->getTypeId());
|
||||
|
||||
|
|
|
@ -525,9 +525,14 @@ void View3DInventorViewer::savePicture(const char* filename, int w, int h,
|
|||
// if we use transparency then we must not set a background color
|
||||
switch(eBackgroundType){
|
||||
case Current:
|
||||
useBackground = true;
|
||||
cb = new SoCallback;
|
||||
cb->setCallback(clearBuffer);
|
||||
if (backgroundroot->findChild(pcBackGround) == -1) {
|
||||
renderer.setBackgroundColor(this->getBackgroundColor());
|
||||
}
|
||||
else {
|
||||
useBackground = true;
|
||||
cb = new SoCallback;
|
||||
cb->setCallback(clearBuffer);
|
||||
}
|
||||
break;
|
||||
case White:
|
||||
renderer.setBackgroundColor( SbColor(1.0, 1.0, 1.0) );
|
||||
|
@ -595,9 +600,14 @@ void View3DInventorViewer::savePicture(int w, int h, int eBackgroundType, QImage
|
|||
// if we use transparency then we must not set a background color
|
||||
switch(eBackgroundType){
|
||||
case Current:
|
||||
useBackground = true;
|
||||
cb = new SoCallback;
|
||||
cb->setCallback(clearBuffer);
|
||||
if (backgroundroot->findChild(pcBackGround) == -1) {
|
||||
renderer.setBackgroundColor(this->getBackgroundColor());
|
||||
}
|
||||
else {
|
||||
useBackground = true;
|
||||
cb = new SoCallback;
|
||||
cb->setCallback(clearBuffer);
|
||||
}
|
||||
break;
|
||||
case White:
|
||||
renderer.setBackgroundColor( SbColor(1.0, 1.0, 1.0) );
|
||||
|
|
|
@ -464,7 +464,7 @@ Py::Object View3DInventorPy::viewRotateRight(const Py::Tuple& args)
|
|||
Py::Object View3DInventorPy::setCameraOrientation(const Py::Tuple& args)
|
||||
{
|
||||
PyObject* o;
|
||||
PyObject* m=0;
|
||||
PyObject* m=Py_False;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "O!|O!", &PyTuple_Type, &o, &PyBool_Type, &m))
|
||||
throw Py::Exception();
|
||||
|
||||
|
@ -474,7 +474,7 @@ Py::Object View3DInventorPy::setCameraOrientation(const Py::Tuple& args)
|
|||
float q1 = (float)Py::Float(tuple[1]);
|
||||
float q2 = (float)Py::Float(tuple[2]);
|
||||
float q3 = (float)Py::Float(tuple[3]);
|
||||
_view->getViewer()->setCameraOrientation(SbRotation(q0, q1, q2, q3), m==Py_True);
|
||||
_view->getViewer()->setCameraOrientation(SbRotation(q0, q1, q2, q3), PyObject_IsTrue(m));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
|
|
|
@ -290,6 +290,11 @@ void ViewProviderGeometryObject::unsetEdit(int ModNum)
|
|||
// The manipulator has a sensor as user data and this sensor contains the view provider
|
||||
SoCenterballManip * manip = static_cast<SoCenterballManip*>(path->getTail());
|
||||
SoNodeSensor* sensor = reinterpret_cast<SoNodeSensor*>(manip->getUserData());
|
||||
// #0000939: Pressing Escape while pivoting a box crashes
|
||||
// #0000942: Crash when 2xdouble-click on part
|
||||
SoDragger* dragger = manip->getDragger();
|
||||
if (dragger && dragger->getHandleEventAction())
|
||||
dragger->grabEventsCleanup();
|
||||
|
||||
// detach sensor
|
||||
sensor->detach();
|
||||
|
|
|
@ -73,7 +73,8 @@ PyObject* ViewProviderPythonFeaturePy::addProperty(PyObject *args)
|
|||
return NULL; // NULL triggers exception
|
||||
|
||||
App::Property* prop=0;
|
||||
prop = getViewProviderPythonFeaturePtr()->addDynamicProperty(sType,sName,sGroup,sDoc,attr,ro==Py_True,hd==Py_True);
|
||||
prop = getViewProviderPythonFeaturePtr()->addDynamicProperty(sType,sName,sGroup,sDoc,attr,
|
||||
PyObject_IsTrue(ro) ? true : false, PyObject_IsTrue(hd) ? true : false);
|
||||
|
||||
if (!prop) {
|
||||
std::stringstream str;
|
||||
|
|
|
@ -499,7 +499,8 @@ MenuItem* StdWorkbench::setupMenuBar() const
|
|||
macro->setCommand("&Macro");
|
||||
*macro << "Std_DlgMacroRecord" << "Std_MacroStopRecord" << "Std_DlgMacroExecute"
|
||||
<< "Separator" << "Std_DlgMacroExecuteDirect" << "Std_MacroStartDebug"
|
||||
<< "Std_MacroStopDebug" << "Std_MacroStepOver" << "Std_ToggleBreakpoint";
|
||||
<< "Std_MacroStopDebug" << "Std_MacroStepOver" << "Std_MacroStepInto"
|
||||
<< "Std_ToggleBreakpoint";
|
||||
|
||||
// Windows
|
||||
MenuItem* wnd = new MenuItem( menuBar );
|
||||
|
|
|
@ -59,8 +59,8 @@ public:
|
|||
}
|
||||
void run()
|
||||
{
|
||||
int argc = 0;
|
||||
char **argv = {0};
|
||||
static int argc = 0;
|
||||
static char **argv = {0};
|
||||
QApplication app(argc, argv);
|
||||
if (setupMainWindow()) {
|
||||
app.exec();
|
||||
|
@ -82,29 +82,33 @@ FilterProc(int nCode, WPARAM wParam, LPARAM lParam) {
|
|||
static PyObject *
|
||||
FreeCADGui_showMainWindow(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
PyObject* inThread = Py_False;
|
||||
if (!PyArg_ParseTuple(args, "|O!", &PyBool_Type, &inThread))
|
||||
return NULL;
|
||||
|
||||
static GUIThread* thr = 0;
|
||||
if (!qApp) {
|
||||
#if 0
|
||||
if (!thr) thr = new GUIThread();
|
||||
thr->start();
|
||||
#elif defined(Q_OS_WIN)
|
||||
static int argc = 0;
|
||||
static char **argv = {0};
|
||||
(void)new QApplication(argc, argv);
|
||||
// When QApplication is constructed
|
||||
hhook = SetWindowsHookEx(WH_GETMESSAGE,
|
||||
FilterProc, 0, GetCurrentThreadId());
|
||||
if (PyObject_IsTrue(inThread)) {
|
||||
if (!thr) thr = new GUIThread();
|
||||
thr->start();
|
||||
}
|
||||
else {
|
||||
#if defined(Q_OS_WIN)
|
||||
static int argc = 0;
|
||||
static char **argv = {0};
|
||||
(void)new QApplication(argc, argv);
|
||||
// When QApplication is constructed
|
||||
hhook = SetWindowsHookEx(WH_GETMESSAGE,
|
||||
FilterProc, 0, GetCurrentThreadId());
|
||||
#elif !defined(QT_NO_GLIB)
|
||||
static int argc = 0;
|
||||
static char **argv = {0};
|
||||
(void)new QApplication(argc, argv);
|
||||
static int argc = 0;
|
||||
static char **argv = {0};
|
||||
(void)new QApplication(argc, argv);
|
||||
#else
|
||||
PyErr_SetString(PyExc_RuntimeError, "Must construct a QApplication before a QPaintDevice\n");
|
||||
return NULL;
|
||||
PyErr_SetString(PyExc_RuntimeError, "Must construct a QApplication before a QPaintDevice\n");
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (!qobject_cast<QApplication*>(qApp)) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Cannot create widget when no GUI is being used\n");
|
||||
|
@ -240,6 +244,7 @@ QWidget* setupMainWindow()
|
|||
}
|
||||
|
||||
if (!Gui::MainWindow::getInstance()) {
|
||||
Base::PyGILStateLocker lock;
|
||||
PyObject* input = PySys_GetObject("stdin");
|
||||
Gui::MainWindow *mw = new Gui::MainWindow();
|
||||
QIcon icon = qApp->windowIcon();
|
||||
|
|
|
@ -65,6 +65,8 @@ Gui::MenuItem* Workbench::setupMenuBar() const
|
|||
*part << "Drawing_Annotation";
|
||||
*part << "Drawing_Clip";
|
||||
*part << "Drawing_ExportPage";
|
||||
*part << "Separator";
|
||||
*part << "Drawing_ProjectShape";
|
||||
|
||||
return root;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,8 @@ PyObject* FeaturePythonPy::addProperty(PyObject *args)
|
|||
return NULL; // NULL triggers exception
|
||||
|
||||
App::Property* prop=0;
|
||||
prop = getFeaturePtr()->addDynamicProperty(sType,sName,sGroup,sDoc,attr,ro==Py_True,hd==Py_True);
|
||||
prop = getFeaturePtr()->addDynamicProperty(sType,sName,sGroup,sDoc,attr,
|
||||
PyObject_IsTrue(ro) ? true : false, PyObject_IsTrue(hd) ? true : false);
|
||||
|
||||
if (!prop) {
|
||||
std::stringstream str;
|
||||
|
|
|
@ -127,9 +127,9 @@ PyObject* MeshPy::copy(PyObject *args)
|
|||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
|
||||
|
||||
const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
|
||||
return new MeshPy(new MeshObject(kernel));
|
||||
return new MeshPy(new MeshObject(kernel));
|
||||
}
|
||||
|
||||
PyObject* MeshPy::read(PyObject *args)
|
||||
|
@ -238,7 +238,7 @@ PyObject* MeshPy::offsetSpecial(PyObject *args)
|
|||
PyObject* MeshPy::crossSections(PyObject *args)
|
||||
{
|
||||
PyObject *obj;
|
||||
PyObject *poly=0;
|
||||
PyObject *poly=Py_False;
|
||||
float min_eps = 1.0e-2f;
|
||||
if (!PyArg_ParseTuple(args, "O!|fO!", &PyList_Type, &obj, &min_eps, &PyBool_Type, &poly))
|
||||
return 0;
|
||||
|
@ -278,7 +278,7 @@ PyObject* MeshPy::crossSections(PyObject *args)
|
|||
}
|
||||
|
||||
std::vector<MeshObject::TPolylines> sections;
|
||||
getMeshObjectPtr()->crossSections(csPlanes, sections, min_eps, (poly == Py_True));
|
||||
getMeshObjectPtr()->crossSections(csPlanes, sections, min_eps, PyObject_IsTrue(poly) ? true : false);
|
||||
|
||||
// convert to Python objects
|
||||
Py::List crossSections;
|
||||
|
|
|
@ -28,7 +28,8 @@ set(all_files ${OpenSCAD_SRCS} ${ply_SRCS})
|
|||
ADD_CUSTOM_TARGET(OpenSCAD ALL
|
||||
SOURCES ${allfiles}
|
||||
)
|
||||
fc_copy_sources(OpenSCAD "${CMAKE_BINARY_DIR}/Mod/OpenSCAD" ${all_files})
|
||||
|
||||
fc_copy_sources(OpenSCAD "${CMAKE_BINARY_DIR}/Mod/OpenSCAD" ${all_files})
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
|
|
|
@ -1147,8 +1147,8 @@ static PyObject * makeLoft(PyObject *self, PyObject *args)
|
|||
return new BSplineSurfacePy(new GeomBSplineSurface(aRes));
|
||||
#else
|
||||
PyObject *pcObj;
|
||||
PyObject *psolid=0;
|
||||
PyObject *pruled=0;
|
||||
PyObject *psolid=Py_False;
|
||||
PyObject *pruled=Py_False;
|
||||
if (!PyArg_ParseTuple(args, "O!|O!O!", &(PyList_Type), &pcObj,
|
||||
&(PyBool_Type), &psolid,
|
||||
&(PyBool_Type), &pruled))
|
||||
|
@ -1166,8 +1166,8 @@ static PyObject * makeLoft(PyObject *self, PyObject *args)
|
|||
}
|
||||
|
||||
TopoShape myShape;
|
||||
Standard_Boolean anIsSolid = (psolid == Py_True) ? Standard_True : Standard_False;
|
||||
Standard_Boolean anIsRuled = (pruled == Py_True) ? Standard_True : Standard_False;
|
||||
Standard_Boolean anIsSolid = PyObject_IsTrue(psolid) ? Standard_True : Standard_False;
|
||||
Standard_Boolean anIsRuled = PyObject_IsTrue(pruled) ? Standard_True : Standard_False;
|
||||
TopoDS_Shape aResult = myShape.makeLoft(profiles, anIsSolid, anIsRuled);
|
||||
return new TopoShapePy(new TopoShape(aResult));
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setFrenetMode(PyObject *args)
|
|||
PyObject *obj;
|
||||
if (!PyArg_ParseTuple(args, "O!",&PyBool_Type,&obj))
|
||||
return 0;
|
||||
this->getBRepOffsetAPI_MakePipeShellPtr()->SetMode(obj==Py_True);
|
||||
this->getBRepOffsetAPI_MakePipeShellPtr()->SetMode(PyObject_IsTrue(obj) ? Standard_True : Standard_False);
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
|
@ -121,19 +121,19 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setAuxiliarySpine(PyObject *args)
|
|||
PyErr_SetString(PyExc_TypeError, "spine is not a wire");
|
||||
return 0;
|
||||
}
|
||||
this->getBRepOffsetAPI_MakePipeShellPtr()->SetMode(TopoDS::Wire(s), curv==Py_True, keep==Py_True);
|
||||
this->getBRepOffsetAPI_MakePipeShellPtr()->SetMode(TopoDS::Wire(s), PyObject_IsTrue(curv), PyObject_IsTrue(keep));
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args)
|
||||
{
|
||||
PyObject *prof, *curv=0, *keep=0;
|
||||
PyObject *prof, *curv=Py_False, *keep=Py_False;
|
||||
if (!PyArg_ParseTuple(args, "O!|O!O!",&Part::TopoShapePy::Type,&prof
|
||||
,&PyBool_Type,&curv
|
||||
,&PyBool_Type,&keep))
|
||||
return 0;
|
||||
const TopoDS_Shape& s = static_cast<Part::TopoShapePy*>(prof)->getTopoShapePtr()->_Shape;
|
||||
this->getBRepOffsetAPI_MakePipeShellPtr()->Add(s, curv==Py_True, keep==Py_True);
|
||||
this->getBRepOffsetAPI_MakePipeShellPtr()->Add(s, PyObject_IsTrue(curv), PyObject_IsTrue(keep));
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ PyObject* BSplineCurvePy::insertKnot(PyObject * args)
|
|||
try {
|
||||
Handle_Geom_BSplineCurve curve = Handle_Geom_BSplineCurve::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
curve->InsertKnot(U,M,tol,(add==Py_True));
|
||||
curve->InsertKnot(U,M,tol,PyObject_IsTrue(add));
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
|
@ -223,7 +223,7 @@ PyObject* BSplineCurvePy::insertKnots(PyObject * args)
|
|||
|
||||
Handle_Geom_BSplineCurve curve = Handle_Geom_BSplineCurve::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
curve->InsertKnots(k,m,tol,(add==Py_True));
|
||||
curve->InsertKnots(k,m,tol,PyObject_IsTrue(add));
|
||||
Py_Return;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
|
@ -755,7 +755,7 @@ PyObject* BSplineCurvePy::interpolate(PyObject *args)
|
|||
Standard_Failure::Raise("not enough points given");
|
||||
}
|
||||
|
||||
GeomAPI_Interpolate aBSplineInterpolation(interpolationPoints, (closed == Py_True), tol3d);
|
||||
GeomAPI_Interpolate aBSplineInterpolation(interpolationPoints, PyObject_IsTrue(closed), tol3d);
|
||||
if (t1 && t2) {
|
||||
Base::Vector3d v1 = Py::Vector(t1,false).toVector();
|
||||
Base::Vector3d v2 = Py::Vector(t1,false).toVector();
|
||||
|
@ -811,7 +811,7 @@ PyObject* BSplineCurvePy::buildFromPoles(PyObject *args)
|
|||
mults.SetValue(1, degree+1);
|
||||
mults.SetValue(knots.Length(), degree+1);
|
||||
|
||||
Handle_Geom_BSplineCurve spline = new Geom_BSplineCurve(poles, knots, mults, degree, (closed == Py_True));
|
||||
Handle_Geom_BSplineCurve spline = new Geom_BSplineCurve(poles, knots, mults, degree, PyObject_IsTrue(closed));
|
||||
if (!spline.IsNull()) {
|
||||
this->getGeomBSplineCurvePtr()->setHandle(spline);
|
||||
Py_Return;
|
||||
|
|
|
@ -293,7 +293,7 @@ PyObject* BSplineSurfacePy::insertUKnot(PyObject *args)
|
|||
try {
|
||||
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
surf->InsertUKnot(U,M,tol,(add==Py_True));
|
||||
surf->InsertUKnot(U,M,tol,PyObject_IsTrue(add));
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
|
@ -333,7 +333,7 @@ PyObject* BSplineSurfacePy::insertUKnots(PyObject *args)
|
|||
|
||||
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
surf->InsertUKnots(k,m,tol,(add==Py_True));
|
||||
surf->InsertUKnots(k,m,tol,PyObject_IsTrue(add));
|
||||
Py_Return;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
|
@ -356,7 +356,7 @@ PyObject* BSplineSurfacePy::insertVKnot(PyObject *args)
|
|||
try {
|
||||
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
surf->InsertVKnot(V,M,tol,(add==Py_True));
|
||||
surf->InsertVKnot(V,M,tol,PyObject_IsTrue(add));
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
|
@ -396,7 +396,7 @@ PyObject* BSplineSurfacePy::insertVKnots(PyObject *args)
|
|||
|
||||
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
surf->InsertVKnots(k,m,tol,(add==Py_True));
|
||||
surf->InsertVKnots(k,m,tol,PyObject_IsTrue(add));
|
||||
Py_Return;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
|
|
|
@ -47,7 +47,8 @@ PyObject* FeaturePythonPy::addProperty(PyObject *args)
|
|||
return NULL; // NULL triggers exception
|
||||
|
||||
App::Property* prop=0;
|
||||
prop = getFeaturePythonPtr()->addDynamicProperty(sType,sName,sGroup,sDoc,attr,ro==Py_True,hd==Py_True);
|
||||
prop = getFeaturePythonPtr()->addDynamicProperty(sType,sName,sGroup,sDoc,attr,
|
||||
PyObject_IsTrue(ro) ? true : false, PyObject_IsTrue(hd) ? true : false);
|
||||
|
||||
if (!prop) {
|
||||
std::stringstream str;
|
||||
|
|
|
@ -59,18 +59,18 @@ int RectangularTrimmedSurfacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
|||
getGeomTrimmedSurfacePtr()->setHandle(new Geom_RectangularTrimmedSurface(
|
||||
Handle_Geom_Surface::DownCast(static_cast<GeometrySurfacePy*>(surf)->
|
||||
getGeomSurfacePtr()->handle()),
|
||||
u1, u2, v1, v2, (usense==Py_True), (vsense==Py_True)
|
||||
u1, u2, v1, v2, PyObject_IsTrue(usense), PyObject_IsTrue(vsense)
|
||||
));
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
double param1,param2;
|
||||
PyObject *utrim=0, *sense=Py_True;
|
||||
PyObject *utrim=Py_False, *sense=Py_True;
|
||||
if (PyArg_ParseTuple(args, "O!ddO!|O!",&(Part::GeometrySurfacePy::Type),&surf,
|
||||
¶m1,¶m2,&PyBool_Type,&utrim,&PyBool_Type,&sense)) {
|
||||
Standard_Boolean UTrim = (utrim==Py_True);
|
||||
Standard_Boolean Sense = (sense==Py_True);
|
||||
Standard_Boolean UTrim = PyObject_IsTrue(utrim);
|
||||
Standard_Boolean Sense = PyObject_IsTrue(sense);
|
||||
getGeomTrimmedSurfacePtr()->setHandle(new Geom_RectangularTrimmedSurface(
|
||||
Handle_Geom_Surface::DownCast(static_cast<GeometrySurfacePy*>(surf)->
|
||||
getGeomSurfacePtr()->handle()),
|
||||
|
|
|
@ -122,7 +122,7 @@ PyObject* TopoShapeCompoundPy::connectEdgesToWires(PyObject *args)
|
|||
for (TopExp_Explorer xp(s, TopAbs_EDGE); xp.More(); xp.Next())
|
||||
hEdges->Append(xp.Current());
|
||||
|
||||
ShapeAnalysis_FreeBounds::ConnectEdgesToWires(hEdges, tol, (shared==Py_True), hWires);
|
||||
ShapeAnalysis_FreeBounds::ConnectEdgesToWires(hEdges, tol, PyObject_IsTrue(shared), hWires);
|
||||
|
||||
TopoDS_Compound comp;
|
||||
BRep_Builder builder;
|
||||
|
|
|
@ -1046,7 +1046,7 @@ PyObject* TopoShapePy::makeThickness(PyObject *args)
|
|||
}
|
||||
|
||||
TopoDS_Shape shape = this->getTopoShapePtr()->makeThickSolid(facesToRemove, offset, tolerance,
|
||||
(inter == Py_True), (self_inter == Py_True), offsetMode, join);
|
||||
PyObject_IsTrue(inter) ? true : false, PyObject_IsTrue(self_inter) ? true : false, offsetMode, join);
|
||||
return new TopoShapeSolidPy(new TopoShape(shape));
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
|
@ -1073,7 +1073,9 @@ PyObject* TopoShapePy::makeOffsetShape(PyObject *args)
|
|||
|
||||
try {
|
||||
TopoDS_Shape shape = this->getTopoShapePtr()->makeOffsetShape(offset, tolerance,
|
||||
(inter == Py_True), (self_inter == Py_True), offsetMode, join, (fill == Py_True));
|
||||
PyObject_IsTrue(inter) ? true : false,
|
||||
PyObject_IsTrue(self_inter) ? true : false, offsetMode, join,
|
||||
PyObject_IsTrue(fill) ? true : false);
|
||||
return new TopoShapePy(new TopoShape(shape));
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
|
@ -1324,7 +1326,7 @@ PyObject* TopoShapePy::isInside(PyObject *args)
|
|||
gp_Pnt vertex = gp_Pnt(pnt.x,pnt.y,pnt.z);
|
||||
solidClassifier.Perform(vertex, tolerance);
|
||||
Standard_Boolean test = (solidClassifier.State() == stateIn);
|
||||
if ( (checkFace == Py_True) && (solidClassifier.IsOnAFace()) )
|
||||
if (PyObject_IsTrue(checkFace) && (solidClassifier.IsOnAFace()))
|
||||
test = Standard_True;
|
||||
return Py_BuildValue("O", (test ? Py_True : Py_False));
|
||||
}
|
||||
|
|
|
@ -1464,12 +1464,8 @@ void ViewProviderSketch::doBoxSelection(const SbVec2s &startPos, const SbVec2s &
|
|||
|
||||
Gui::ViewVolumeProjection proj(viewer->getCamera()->getViewVolume());
|
||||
|
||||
App::Document* doc = App::GetApplication().getActiveDocument();
|
||||
Sketcher::SketchObject *sketchObject = NULL;
|
||||
if (doc)
|
||||
sketchObject = dynamic_cast<Sketcher::SketchObject *>(doc->getActiveObject());
|
||||
if (!sketchObject)
|
||||
return;
|
||||
Sketcher::SketchObject *sketchObject = getSketchObject();
|
||||
App::Document *doc = sketchObject->getDocument();
|
||||
|
||||
Base::Placement Plm = sketchObject->Placement.getValue();
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ SET /P M=Reebuild and press enter
|
|||
|
||||
rem making of the bin zip file
|
||||
|
||||
"c:\Program Files\7-Zip\7z.exe" a -t7z FreeCAD.7z "-xr!*.idb" "-xr!*.pdb" "-xr!*.ilk" "-xr!*.rule" "-xr!*.svn-base" "-xr!*.pyc" "-xr!*.stamp" "-xr!*.cmake" "-xr!*.svn*" "-xr!*.vcproj" "-xr!*.am" "-xr!CMakeFiles" "-xr!*.dir" ..\..\bin ..\..\Mod ..\..\Doc ..\..\data
|
||||
c:\Programme\7-Zip\7z.exe a -t7z FreeCAD.7z "-xr!*.idb" "-xr!*.pdb" "-xr!*.ilk" "-xr!*.pyc" "-xr!?.git\*" "-xr!*.am" "-xr!CMakeFiles" "..\..\bin" "..\..\Mod" "..\..\Doc" "..\..\data"
|
||||
|
||||
call CopyRelease.bat
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
|
||||
copy FreeCAD.msi FreeCAD_0.13.$WCREV$_x86_unstable_setup.msi
|
||||
copy FreeCAD.7z FreeCAD_0.13.$WCREV$_x86_unstable_bin.7z
|
||||
copy FreeCAD.msi FreeCAD_0.13.$WCREV$_x86_RC_setup.msi
|
||||
copy FreeCAD.7z FreeCAD_0.13.$WCREV$_x86_RC_bin.7z
|
Loading…
Reference in New Issue
Block a user