Compare commits
14 Commits
fixSignCommand
...
0.14
| Author | SHA1 | Date | |
|---|---|---|---|
| f25e6e4716 | |||
| 3ecaf8778d | |||
| c6edd47334 | |||
| b3368125c6 | |||
| 32f5aae0a6 | |||
| 3dbcf24d71 | |||
| a3a6ec2184 | |||
| e46ec63540 | |||
| df36b5d22d | |||
| 3d70df7745 | |||
| 52561adbd8 | |||
| d802958860 | |||
| e517e3b634 | |||
| 5fe6e0c48f |
@@ -2003,6 +2003,10 @@ std::string Application::FindHomePath(const char* sCall)
|
|||||||
*i = '/';
|
*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;
|
return TempHomePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,14 +27,14 @@ Quantity(string) -- arbitrary mixture of numbers and chars defining a Quantity
|
|||||||
</UserDocu>
|
</UserDocu>
|
||||||
<DeveloperDocu>Quantity</DeveloperDocu>
|
<DeveloperDocu>Quantity</DeveloperDocu>
|
||||||
</Documentation>
|
</Documentation>
|
||||||
<Methode Name="getUserPreferred">
|
<Methode Name="getUserPreferred" Const="true">
|
||||||
<Documentation>
|
<Documentation>
|
||||||
<UserDocu>
|
<UserDocu>
|
||||||
returns a quantity with the translation factor and a string with the prevered unit
|
returns a quantity with the translation factor and a string with the prevered unit
|
||||||
</UserDocu>
|
</UserDocu>
|
||||||
</Documentation>
|
</Documentation>
|
||||||
</Methode>
|
</Methode>
|
||||||
<Methode Name="getValueAs">
|
<Methode Name="getValueAs" Const="true">
|
||||||
<Documentation>
|
<Documentation>
|
||||||
<UserDocu>
|
<UserDocu>
|
||||||
returns a floating point value as the provided unit
|
returns a floating point value as the provided unit
|
||||||
|
|||||||
+12
-4
@@ -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
|
// 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
|
// remove number from end to avoid lengthy names
|
||||||
size_t lastpos = label.length()-1;
|
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--;
|
lastpos--;
|
||||||
|
}
|
||||||
|
|
||||||
label = label.substr(0, lastpos+1);
|
label = label.substr(0, lastpos+1);
|
||||||
label = Base::Tools::getUniqueName(label, objectLabels, 3);
|
label = Base::Tools::getUniqueName(label, objectLabels, 3);
|
||||||
this->current = &obj;
|
this->current = &obj;
|
||||||
@@ -1621,11 +1629,11 @@ void Application::runApplication(void)
|
|||||||
}
|
}
|
||||||
#if QT_VERSION >= 0x040200
|
#if QT_VERSION >= 0x040200
|
||||||
if (!QGLFramebufferObject::hasOpenGLFramebufferObjects()) {
|
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
|
#endif
|
||||||
if (!QGLPixelBuffer::hasOpenGLPbuffers()) {
|
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 ();
|
QGLFormat::OpenGLVersionFlags version = QGLFormat::openGLVersionFlags ();
|
||||||
|
|||||||
@@ -697,8 +697,12 @@ void Document::RestoreDocFile(Base::Reader &reader)
|
|||||||
sMsg += ppReturn;
|
sMsg += ppReturn;
|
||||||
if (strcmp(ppReturn, "") != 0) { // non-empty attribute
|
if (strcmp(ppReturn, "") != 0) { // non-empty attribute
|
||||||
try {
|
try {
|
||||||
if (d->_pcAppWnd->sendHasMsgToActiveView("SetCamera"))
|
const char** pReturnIgnore=0;
|
||||||
d->_pcAppWnd->sendMsgToActiveView(sMsg.c_str());
|
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) {
|
catch (const Base::Exception& e) {
|
||||||
Base::Console().Error("%s\n", e.what());
|
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)
|
bool Gui::GUIApplicationNativeEventAware::processSpaceballEvent(QObject *object, QEvent *event)
|
||||||
{
|
{
|
||||||
|
if (!activeWindow())
|
||||||
|
return true;
|
||||||
|
|
||||||
QApplication::notify(object, event);
|
QApplication::notify(object, event);
|
||||||
if (event->type() == Spaceball::MotionEvent::MotionEventType)
|
if (event->type() == Spaceball::MotionEvent::MotionEventType)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -483,6 +483,8 @@ void InputField::focusInEvent(QFocusEvent * event)
|
|||||||
if (!this->hasSelectedText())
|
if (!this->hasSelectedText())
|
||||||
selectNumber();
|
selectNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QLineEdit::focusInEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputField::keyPressEvent(QKeyEvent *event)
|
void InputField::keyPressEvent(QKeyEvent *event)
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
# include <qevent.h>
|
# include <qevent.h>
|
||||||
# include <qpainter.h>
|
# include <qpainter.h>
|
||||||
# include <qpixmap.h>
|
# include <qpixmap.h>
|
||||||
|
# include <QGLFramebufferObject>
|
||||||
# include <QMenu>
|
# include <QMenu>
|
||||||
# include <Inventor/SbBox.h>
|
# include <Inventor/SbBox.h>
|
||||||
# include <Inventor/events/SoEvent.h>
|
# include <Inventor/events/SoEvent.h>
|
||||||
@@ -852,7 +853,9 @@ void RubberbandSelection::initialize()
|
|||||||
{
|
{
|
||||||
d = new Private(_pcView3D);
|
d = new Private(_pcView3D);
|
||||||
_pcView3D->addGraphicsItem(d);
|
_pcView3D->addGraphicsItem(d);
|
||||||
_pcView3D->setRenderFramebuffer(true);
|
if (QGLFramebufferObject::hasOpenGLFramebufferObjects()) {
|
||||||
|
_pcView3D->setRenderFramebuffer(true);
|
||||||
|
}
|
||||||
_pcView3D->scheduleRedraw();
|
_pcView3D->scheduleRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -860,7 +863,9 @@ void RubberbandSelection::terminate()
|
|||||||
{
|
{
|
||||||
_pcView3D->removeGraphicsItem(d);
|
_pcView3D->removeGraphicsItem(d);
|
||||||
delete d; d = 0;
|
delete d; d = 0;
|
||||||
_pcView3D->setRenderFramebuffer(false);
|
if (QGLFramebufferObject::hasOpenGLFramebufferObjects()) {
|
||||||
|
_pcView3D->setRenderFramebuffer(false);
|
||||||
|
}
|
||||||
_pcView3D->scheduleRedraw();
|
_pcView3D->scheduleRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-5
@@ -410,7 +410,8 @@ def formatObject(target,origin=None):
|
|||||||
if not grp:
|
if not grp:
|
||||||
grp = doc.addObject("App::DocumentObjectGroup",gname)
|
grp = doc.addObject("App::DocumentObjectGroup",gname)
|
||||||
grp.addObject(target)
|
grp.addObject(target)
|
||||||
obrep.Transparency = 80
|
if hasattr(obrep,"Transparency"):
|
||||||
|
obrep.Transparency = 80
|
||||||
else:
|
else:
|
||||||
col = ui.getDefaultColor("ui")
|
col = ui.getDefaultColor("ui")
|
||||||
fcol = ui.getDefaultColor("face")
|
fcol = ui.getDefaultColor("face")
|
||||||
@@ -3059,6 +3060,8 @@ class _ViewProviderDimension(_ViewProviderDraft):
|
|||||||
self.font3d = coin.SoFont()
|
self.font3d = coin.SoFont()
|
||||||
self.text = coin.SoAsciiText()
|
self.text = coin.SoAsciiText()
|
||||||
self.text3d = coin.SoText2()
|
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.textpos = coin.SoTransform()
|
||||||
self.text.justification = self.text3d.justification = coin.SoAsciiText.CENTER
|
self.text.justification = self.text3d.justification = coin.SoAsciiText.CENTER
|
||||||
label = coin.SoSeparator()
|
label = coin.SoSeparator()
|
||||||
@@ -3211,9 +3214,9 @@ class _ViewProviderDimension(_ViewProviderDraft):
|
|||||||
# set text value
|
# set text value
|
||||||
l = self.p3.sub(self.p2).Length
|
l = self.p3.sub(self.p2).Length
|
||||||
if hasattr(obj.ViewObject,"Decimals"):
|
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:
|
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 hasattr(obj.ViewObject,"Override"):
|
||||||
if obj.ViewObject.Override:
|
if obj.ViewObject.Override:
|
||||||
try:
|
try:
|
||||||
@@ -3426,6 +3429,8 @@ class _ViewProviderAngularDimension(_ViewProviderDraft):
|
|||||||
self.font3d = coin.SoFont()
|
self.font3d = coin.SoFont()
|
||||||
self.text = coin.SoAsciiText()
|
self.text = coin.SoAsciiText()
|
||||||
self.text3d = coin.SoText2()
|
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.text.justification = self.text3d.justification = coin.SoAsciiText.CENTER
|
||||||
self.textpos = coin.SoTransform()
|
self.textpos = coin.SoTransform()
|
||||||
label = coin.SoSeparator()
|
label = coin.SoSeparator()
|
||||||
@@ -3472,6 +3477,7 @@ class _ViewProviderAngularDimension(_ViewProviderDraft):
|
|||||||
if hasattr(self,"arc"):
|
if hasattr(self,"arc"):
|
||||||
from pivy import coin
|
from pivy import coin
|
||||||
import Part, DraftGeomUtils
|
import Part, DraftGeomUtils
|
||||||
|
import DraftGui
|
||||||
text = None
|
text = None
|
||||||
ivob = None
|
ivob = None
|
||||||
arcsegs = 24
|
arcsegs = 24
|
||||||
@@ -3497,9 +3503,9 @@ class _ViewProviderAngularDimension(_ViewProviderDraft):
|
|||||||
if hasattr(obj.ViewObject,"ShowUnit"):
|
if hasattr(obj.ViewObject,"ShowUnit"):
|
||||||
su = obj.ViewObject.ShowUnit
|
su = obj.ViewObject.ShowUnit
|
||||||
if hasattr(obj.ViewObject,"Decimals"):
|
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:
|
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:
|
if obj.ViewObject.Override:
|
||||||
try:
|
try:
|
||||||
from pivy import coin
|
from pivy import coin
|
||||||
|
|||||||
@@ -453,7 +453,7 @@ class DraftToolBar:
|
|||||||
QtCore.QObject.connect(self.radiusValue,QtCore.SIGNAL("returnPressed()"),self.validatePoint)
|
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("textChanged(QString)"),self.storeCurrentText)
|
||||||
QtCore.QObject.connect(self.textValue,QtCore.SIGNAL("returnPressed()"),self.sendText)
|
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("down()"),self.sendText)
|
||||||
QtCore.QObject.connect(self.textValue,QtCore.SIGNAL("up()"),self.lineUp)
|
QtCore.QObject.connect(self.textValue,QtCore.SIGNAL("up()"),self.lineUp)
|
||||||
QtCore.QObject.connect(self.zValue,QtCore.SIGNAL("returnPressed()"),self.xValue.setFocus)
|
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.hasFill,QtCore.SIGNAL("stateChanged(int)"),self.setFill)
|
||||||
QtCore.QObject.connect(self.currentViewButton,QtCore.SIGNAL("clicked()"),self.selectCurrentView)
|
QtCore.QObject.connect(self.currentViewButton,QtCore.SIGNAL("clicked()"),self.selectCurrentView)
|
||||||
QtCore.QObject.connect(self.resetPlaneButton,QtCore.SIGNAL("clicked()"),self.selectResetPlane)
|
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.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.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.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("resized()"),self.relocate)
|
||||||
QtCore.QObject.connect(self.baseWidget,QtCore.SIGNAL("retranslate()"),self.retranslateUi)
|
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("valueChanged(double)"),self.changeSSizeValue)
|
||||||
QtCore.QObject.connect(self.SSizeValue,QtCore.SIGNAL("returnPressed()"),self.validateSNumeric)
|
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("valueChanged(double)"),self.changeSTrackValue)
|
||||||
QtCore.QObject.connect(self.STrackValue,QtCore.SIGNAL("returnPressed()"),self.validateSNumeric)
|
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("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.chooserButton,QtCore.SIGNAL("pressed()"),self.pickFile)
|
||||||
QtCore.QObject.connect(self.FFileValue,QtCore.SIGNAL("returnPressed()"),self.validateFile)
|
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
|
# if Ui changed to have Size & Track visible at same time, use this
|
||||||
# QtCore.QObject.connect(self.SSizeValue,QtCore.SIGNAL("returnPressed()"),self.checkSSize)
|
# QtCore.QObject.connect(self.SSizeValue,QtCore.SIGNAL("returnPressed()"),self.checkSSize)
|
||||||
|
|||||||
@@ -3984,10 +3984,10 @@ class Array(Modifier):
|
|||||||
self.view.removeEventCallback("SoEvent",self.call)
|
self.view.removeEventCallback("SoEvent",self.call)
|
||||||
if FreeCADGui.Selection.getSelection():
|
if FreeCADGui.Selection.getSelection():
|
||||||
obj = FreeCADGui.Selection.getSelection()[0]
|
obj = FreeCADGui.Selection.getSelection()[0]
|
||||||
FreeCAD.ActiveDocument.openTransaction("Array")
|
self.commit(translate("draft","Array"),
|
||||||
Draft.makeArray(obj,Vector(1,0,0),Vector(0,1,0),2,2)
|
['import Draft',
|
||||||
FreeCAD.ActiveDocument.commitTransaction()
|
'Draft.makeArray(FreeCAD.ActiveDocument.'+obj.Name+',FreeCAD.Vector(1,0,0),FreeCAD.Vector(0,1,0),2,2)',
|
||||||
FreeCAD.ActiveDocument.recompute()
|
'FreeCAD.ActiveDocument.recompute()'])
|
||||||
self.finish()
|
self.finish()
|
||||||
|
|
||||||
class PathArray(Modifier):
|
class PathArray(Modifier):
|
||||||
|
|||||||
@@ -155,23 +155,31 @@ App::DocumentObjectExecReturn *FeaturePage::execute(void)
|
|||||||
|
|
||||||
// checking for freecad editable texts
|
// checking for freecad editable texts
|
||||||
string outfragment(ofile.str());
|
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>");
|
boost::regex e1 ("<text.*?freecad:editable=\"(.*?)\".*?<tspan.*?>(.*?)</tspan>");
|
||||||
string::const_iterator begin, end;
|
string::const_iterator begin, end;
|
||||||
begin = outfragment.begin();
|
begin = outfragment.begin();
|
||||||
end = outfragment.end();
|
end = outfragment.end();
|
||||||
boost::match_results<std::string::const_iterator> what;
|
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)) {
|
while (boost::regex_search(begin, end, what, e1)) {
|
||||||
if (count < EditableTexts.getSize()) {
|
if (count < editText.size()) {
|
||||||
// change values of editable texts
|
// change values of editable texts
|
||||||
boost::regex e2 ("(<text.*?freecad:editable=\""+what[1].str()+"\".*?<tspan.*?)>(.*?)(</tspan>)");
|
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;
|
begin = what[0].second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// now copy the rest
|
||||||
|
newfragment.insert(newfragment.end(), begin, end);
|
||||||
|
outfragment = newfragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
// restoring linebreaks and saving the file
|
// restoring linebreaks and saving the file
|
||||||
@@ -184,13 +192,6 @@ App::DocumentObjectExecReturn *FeaturePage::execute(void)
|
|||||||
|
|
||||||
PageResult.setValue(tempName.c_str());
|
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;
|
return App::DocumentObject::StdReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
#include <Base/Stream.h>
|
#include <Base/Stream.h>
|
||||||
#include <Base/gzstream.h>
|
#include <Base/gzstream.h>
|
||||||
#include <Base/PyObjectBase.h>
|
#include <Base/PyObjectBase.h>
|
||||||
|
#include <Gui/Document.h>
|
||||||
#include <Gui/FileDialog.h>
|
#include <Gui/FileDialog.h>
|
||||||
#include <Gui/WaitCursor.h>
|
#include <Gui/WaitCursor.h>
|
||||||
|
|
||||||
@@ -312,6 +313,20 @@ bool DrawingView::onMsg(const char* pMsg, const char** ppReturn)
|
|||||||
viewAll();
|
viewAll();
|
||||||
return true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -319,12 +334,16 @@ bool DrawingView::onHasMsg(const char* pMsg) const
|
|||||||
{
|
{
|
||||||
if (strcmp("ViewFit",pMsg) == 0)
|
if (strcmp("ViewFit",pMsg) == 0)
|
||||||
return true;
|
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)
|
else if (strcmp("Print",pMsg) == 0)
|
||||||
return true;
|
return true;
|
||||||
else if (strcmp("PrintPreview",pMsg) == 0)
|
else if (strcmp("PrintPreview",pMsg) == 0)
|
||||||
return true;
|
return true;
|
||||||
else if (strcmp("PrintPdf",pMsg) == 0)
|
else if (strcmp("PrintPdf",pMsg) == 0)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ App::DocumentObjectExecReturn *Sweep::execute(void)
|
|||||||
}
|
}
|
||||||
path = mkWire.Wire();
|
path = mkWire.Wire();
|
||||||
}
|
}
|
||||||
if (shape._Shape.ShapeType() == TopAbs_EDGE) {
|
else if (shape._Shape.ShapeType() == TopAbs_EDGE) {
|
||||||
path = shape._Shape;
|
path = shape._Shape;
|
||||||
}
|
}
|
||||||
else if (shape._Shape.ShapeType() == TopAbs_WIRE) {
|
else if (shape._Shape.ShapeType() == TopAbs_WIRE) {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
# include <BRepTools.hxx>
|
# include <BRepTools.hxx>
|
||||||
# include <BRepTools_ReShape.hxx>
|
# include <BRepTools_ReShape.hxx>
|
||||||
# include <BRepTools_ShapeSet.hxx>
|
# include <BRepTools_ShapeSet.hxx>
|
||||||
#include <BRepFill_CompatibleWires.hxx>
|
# include <BRepFill_CompatibleWires.hxx>
|
||||||
# include <GCE2d_MakeSegment.hxx>
|
# include <GCE2d_MakeSegment.hxx>
|
||||||
# include <Geom2d_Line.hxx>
|
# include <Geom2d_Line.hxx>
|
||||||
# include <Geom2d_TrimmedCurve.hxx>
|
# include <Geom2d_TrimmedCurve.hxx>
|
||||||
@@ -91,6 +91,7 @@
|
|||||||
# include <Handle_Law_BSpline.hxx>
|
# include <Handle_Law_BSpline.hxx>
|
||||||
# include <Handle_TopTools_HSequenceOfShape.hxx>
|
# include <Handle_TopTools_HSequenceOfShape.hxx>
|
||||||
# include <Law_BSpFunc.hxx>
|
# include <Law_BSpFunc.hxx>
|
||||||
|
# include <Law_Constant.hxx>
|
||||||
# include <Law_Linear.hxx>
|
# include <Law_Linear.hxx>
|
||||||
# include <Law_S.hxx>
|
# include <Law_S.hxx>
|
||||||
# include <TopTools_HSequenceOfShape.hxx>
|
# include <TopTools_HSequenceOfShape.hxx>
|
||||||
@@ -691,12 +692,10 @@ void TopoShape::write(const char *FileName) const
|
|||||||
|
|
||||||
void TopoShape::exportIges(const char *filename) const
|
void TopoShape::exportIges(const char *filename) const
|
||||||
{
|
{
|
||||||
Interface_Static::SetCVal("write.iges.unit","IN");
|
|
||||||
try {
|
try {
|
||||||
// write iges file
|
// write iges file
|
||||||
IGESControl_Controller::Init();
|
IGESControl_Controller::Init();
|
||||||
IGESControl_Writer aWriter;
|
IGESControl_Writer aWriter;
|
||||||
//IGESControl_Writer aWriter(Interface_Static::CVal("write.iges.unit"), 1);
|
|
||||||
aWriter.AddShape(this->_Shape);
|
aWriter.AddShape(this->_Shape);
|
||||||
aWriter.ComputeModel();
|
aWriter.ComputeModel();
|
||||||
QString fn = QString::fromUtf8(filename);
|
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_BSpline aBs;
|
||||||
//Handle_Law_BSpFunc aFunc = new Law_BSpFunc (aBs, theFirst, theLast);
|
//Handle_Law_BSpFunc aFunc = new Law_BSpFunc (aBs, theFirst, theLast);
|
||||||
Handle_Law_Linear aFunc = new Law_Linear();
|
Handle_Law_Constant aFunc = new Law_Constant();
|
||||||
aFunc->Set(theFirst, theRadius, theLast, theRadius);
|
aFunc->Set(1, theFirst, theLast);
|
||||||
return aFunc;
|
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
|
// http://opencascade.blogspot.com/2009/11/surface-modeling-part3.html
|
||||||
Standard_Real theTol = tol;
|
Standard_Real theTol = tol;
|
||||||
|
Standard_Real theRadius = radius;
|
||||||
//Standard_Boolean theIsPolynomial = Standard_True;
|
//Standard_Boolean theIsPolynomial = Standard_True;
|
||||||
Standard_Boolean myIsElem = Standard_True;
|
Standard_Boolean myIsElem = Standard_True;
|
||||||
GeomAbs_Shape theContinuity = GeomAbs_Shape(cont);
|
GeomAbs_Shape theContinuity = GeomAbs_Shape(cont);
|
||||||
@@ -1500,11 +1500,11 @@ TopoDS_Shape TopoShape::makeTube(double radius, double tol, int cont, int maxdeg
|
|||||||
}
|
}
|
||||||
|
|
||||||
//circular profile
|
//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.);
|
aCirc->Rotate (gp::OZ(), M_PI/2.);
|
||||||
|
|
||||||
//perpendicular section
|
//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_SectionLaw) aSec = new GeomFill_EvolvedSection(aCirc, myEvol);
|
||||||
Handle(GeomFill_LocationLaw) aLoc = new GeomFill_CurveAndTrihedron(new GeomFill_CorrectedFrenet);
|
Handle(GeomFill_LocationLaw) aLoc = new GeomFill_CurveAndTrihedron(new GeomFill_CorrectedFrenet);
|
||||||
aLoc->SetCurve (myPath);
|
aLoc->SetCurve (myPath);
|
||||||
|
|||||||
@@ -234,6 +234,8 @@ const TopoDS_Shape& SketchBased::getSupportShape() const {
|
|||||||
int SketchBased::getSketchAxisCount(void) const
|
int SketchBased::getSketchAxisCount(void) const
|
||||||
{
|
{
|
||||||
Part::Part2DObject *sketch = static_cast<Part::Part2DObject*>(Sketch.getValue());
|
Part::Part2DObject *sketch = static_cast<Part::Part2DObject*>(Sketch.getValue());
|
||||||
|
if (!sketch)
|
||||||
|
return -1; // the link to the sketch is lost
|
||||||
return sketch->getAxisCount();
|
return sketch->getAxisCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#include "ViewProvider.h"
|
#include "ViewProvider.h"
|
||||||
#include <Mod/Part/App/PropertyTopoShape.h>
|
#include <Mod/Part/App/PropertyTopoShape.h>
|
||||||
#include <Gui/Command.h>
|
#include <Gui/Command.h>
|
||||||
//#include <Gui/Document.h>
|
#include <Base/Exception.h>
|
||||||
|
|
||||||
using namespace PartDesignGui;
|
using namespace PartDesignGui;
|
||||||
|
|
||||||
@@ -48,7 +48,12 @@ bool ViewProvider::doubleClicked(void)
|
|||||||
std::string Msg("Edit ");
|
std::string Msg("Edit ");
|
||||||
Msg += this->pcObject->Label.getValue();
|
Msg += this->pcObject->Label.getValue();
|
||||||
Gui::Command::openCommand(Msg.c_str());
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,16 @@ void ViewProviderGroove::setupContextMenu(QMenu* menu, QObject* receiver, const
|
|||||||
bool ViewProviderGroove::setEdit(int ModNum)
|
bool ViewProviderGroove::setEdit(int ModNum)
|
||||||
{
|
{
|
||||||
if (ModNum == ViewProvider::Default ) {
|
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
|
// When double-clicking on the item for this pad the
|
||||||
// object unsets and sets its edit mode without closing
|
// object unsets and sets its edit mode without closing
|
||||||
// the task panel
|
// the task panel
|
||||||
|
|||||||
@@ -67,6 +67,16 @@ void ViewProviderRevolution::setupContextMenu(QMenu* menu, QObject* receiver, co
|
|||||||
bool ViewProviderRevolution::setEdit(int ModNum)
|
bool ViewProviderRevolution::setEdit(int ModNum)
|
||||||
{
|
{
|
||||||
if (ModNum == ViewProvider::Default ) {
|
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
|
// When double-clicking on the item for this pad the
|
||||||
// object unsets and sets its edit mode without closing
|
// object unsets and sets its edit mode without closing
|
||||||
// the task panel
|
// the task panel
|
||||||
|
|||||||
@@ -355,7 +355,18 @@ PyObject* SketchObjectPy::getPoint(PyObject *args)
|
|||||||
if (!PyArg_ParseTuple(args, "ii", &GeoId, &PointType))
|
if (!PyArg_ParseTuple(args, "ii", &GeoId, &PointType))
|
||||||
return 0;
|
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)
|
PyObject* SketchObjectPy::getAxis(PyObject *args)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ def main():
|
|||||||
revision='%04d' % (info.count('\n'))
|
revision='%04d' % (info.count('\n'))
|
||||||
|
|
||||||
PACKAGE_NAME = 'freecad'
|
PACKAGE_NAME = 'freecad'
|
||||||
version = "0.13.%s" % (revision)
|
version = "0.14.%s" % (revision)
|
||||||
|
|
||||||
DIRNAME = "%(p)s-%(v)s" % {'p': PACKAGE_NAME, 'v': version}
|
DIRNAME = "%(p)s-%(v)s" % {'p': PACKAGE_NAME, 'v': version}
|
||||||
TARNAME = DIRNAME + '.tar'
|
TARNAME = DIRNAME + '.tar'
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ section "install"
|
|||||||
setOutPath $INSTDIR\bin
|
setOutPath $INSTDIR\bin
|
||||||
# Files added here should be removed by the uninstaller (see section "uninstall")
|
# Files added here should be removed by the uninstaller (see section "uninstall")
|
||||||
file /r /X *.idb /X *.pyc /X *.pyo "..\..\bin\"
|
file /r /X *.idb /X *.pyc /X *.pyo "..\..\bin\"
|
||||||
|
setOutPath $INSTDIR\lib
|
||||||
|
file /r /X *.lib /X *.pyc /X *.pyo "..\..\lib\"
|
||||||
setOutPath $INSTDIR\Mod
|
setOutPath $INSTDIR\Mod
|
||||||
file /r /X *.idb "..\..\Mod\"
|
file /r /X *.idb "..\..\Mod\"
|
||||||
setOutPath $INSTDIR\doc
|
setOutPath $INSTDIR\doc
|
||||||
@@ -139,12 +141,14 @@ section "uninstall"
|
|||||||
|
|
||||||
# Remove files
|
# Remove files
|
||||||
rmDir /r "$INSTDIR\bin"
|
rmDir /r "$INSTDIR\bin"
|
||||||
|
rmDir /r "$INSTDIR\lib"
|
||||||
rmDir /r "$INSTDIR\doc"
|
rmDir /r "$INSTDIR\doc"
|
||||||
rmDir /r "$INSTDIR\data"
|
rmDir /r "$INSTDIR\data"
|
||||||
rmDir /r "$INSTDIR\Mod"
|
rmDir /r "$INSTDIR\Mod"
|
||||||
|
|
||||||
# Always delete uninstaller as the last action
|
# Always delete uninstaller as the last action
|
||||||
delete $INSTDIR\uninstall.exe
|
delete $INSTDIR\uninstall.exe
|
||||||
|
delete $INSTDIR\vcredist_x86.exe
|
||||||
# Try to remove the install directory - this will only happen if it is empty
|
# Try to remove the install directory - this will only happen if it is empty
|
||||||
rmDir $INSTDIR
|
rmDir $INSTDIR
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user