diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 2aa62f41dc..8cdf9610aa 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -1776,6 +1776,9 @@ void Application::ParseOptions(int ac, char ** av) else if (strcmp(av[i],"-session") == 0) { merge = true; } + else if (strcmp(av[i],"-graphicssystem") == 0) { + merge = true; + } } // 0000659: SIGABRT on startup in boost::program_options (Boost 1.49) diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index a05c6d3376..7678b9be44 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -291,8 +291,14 @@ void PropertyLinkList::Save(Base::Writer &writer) const { writer.Stream() << writer.ind() << "" << endl; writer.incInd(); - for (int i = 0; igetNameInDocument() << "\"/>" << endl;; + for (int i = 0; igetNameInDocument() << "\"/>" << endl; + else + writer.Stream() << writer.ind() << "" << endl; + } + writer.decInd(); writer.Stream() << writer.ind() << "" << endl; } diff --git a/src/Base/PyObjectBase.h b/src/Base/PyObjectBase.h index 1b9ae3fc01..a1fcd50f42 100644 --- a/src/Base/PyObjectBase.h +++ b/src/Base/PyObjectBase.h @@ -84,6 +84,21 @@ */ #define PYFUNCIMP_S(CLASS,SFUNC) PyObject* CLASS::SFUNC (PyObject *self,PyObject *args,PyObject *kwd) + +/** Macro for initialization function of Python modules. + */ +#if PY_MAJOR_VERSION >= 3 +# define PyMOD_INIT_FUNC(name) PyMODINIT_FUNC PyInit_##name(void) +#else +# define PyMOD_INIT_FUNC(name) PyMODINIT_FUNC init##name(void) +#endif + +#if PY_MAJOR_VERSION >= 3 +# define PyMOD_Return(name) return name +#else +# define PyMOD_Return(name) return (void)name +#endif + /** * Union to convert from PyTypeObject to PyObject pointer. */ diff --git a/src/Gui/CombiView.cpp b/src/Gui/CombiView.cpp index ca840c8ba4..a46d10974b 100644 --- a/src/Gui/CombiView.cpp +++ b/src/Gui/CombiView.cpp @@ -57,7 +57,6 @@ CombiView::CombiView(Gui::Document* pcDocument, QWidget *parent) tabs = new QTabWidget (); tabs->setObjectName(QString::fromUtf8("combiTab")); tabs->setTabPosition(QTabWidget::North); - //tabs->setTabShape(QTabWidget::Triangular); pLayout->addWidget( tabs, 0, 0 ); // splitter between tree and property view diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index a7211bd8ec..a81a156b33 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -2519,13 +2519,12 @@ StdCmdSceneInspector::StdCmdSceneInspector() void StdCmdSceneInspector::activated(int iMsg) { Q_UNUSED(iMsg); - View3DInventor* child = qobject_cast(getMainWindow()->activeWindow()); - if (child) { - View3DInventorViewer* viewer = child->getViewer(); + Gui::Document* doc = Application::Instance->activeDocument(); + if (doc) { static QPointer dlg = 0; if (!dlg) dlg = new Gui::Dialog::DlgInspector(getMainWindow()); - dlg->setNode(viewer->getSceneGraph()); + dlg->setDocument(doc); dlg->setAttribute(Qt::WA_DeleteOnClose); dlg->show(); } diff --git a/src/Gui/DlgGeneralImp.cpp b/src/Gui/DlgGeneralImp.cpp index 7cab8a575c..2c5efba8e3 100644 --- a/src/Gui/DlgGeneralImp.cpp +++ b/src/Gui/DlgGeneralImp.cpp @@ -238,14 +238,17 @@ void DlgGeneralImp::loadSettings() } } - int size = QApplication::style()->pixelMetric(QStyle::PM_ToolBarIconSize); int current = getMainWindow()->iconSize().width(); - this->toolbarIconSize->addItem(tr("Default (%1 x %1)").arg(size), QVariant((int)size)); - this->toolbarIconSize->addItem(tr("Small (%1 x %1)").arg(16), QVariant((int)16)); - this->toolbarIconSize->addItem(tr("Large (%1 x %1)").arg(32), QVariant((int)32)); - this->toolbarIconSize->addItem(tr("Extra large (%1 x %1)").arg(48), QVariant((int)48)); + this->toolbarIconSize->addItem(tr("Small (%1px)").arg(16), QVariant((int)16)); + this->toolbarIconSize->addItem(tr("Medium (%1px)").arg(24), QVariant((int)24)); + this->toolbarIconSize->addItem(tr("Large (%1px)").arg(32), QVariant((int)32)); + this->toolbarIconSize->addItem(tr("Extra large (%1px)").arg(48), QVariant((int)48)); index = this->toolbarIconSize->findData(QVariant(current)); - if (index > -1) this->toolbarIconSize->setCurrentIndex(index); + if (index < 0) { + this->toolbarIconSize->addItem(tr("Custom (%1px)").arg(current), QVariant((int)current)); + index = this->toolbarIconSize->findData(QVariant(current)); + } + this->toolbarIconSize->setCurrentIndex(index); hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/MainWindow"); this->tiledBackground->setChecked(hGrp->GetBool("TiledBackground", false)); diff --git a/src/Gui/PropertyView.cpp b/src/Gui/PropertyView.cpp index f2ff9b70a9..ee984fee79 100644 --- a/src/Gui/PropertyView.cpp +++ b/src/Gui/PropertyView.cpp @@ -70,7 +70,9 @@ PropertyView::PropertyView(QWidget *parent) tabs = new QTabWidget (this); tabs->setObjectName(QString::fromUtf8("propertyTab")); tabs->setTabPosition(QTabWidget::South); +#if defined(Q_OS_WIN32) tabs->setTabShape(QTabWidget::Triangular); +#endif pLayout->addWidget(tabs, 0, 0); propertyEditorView = new Gui::PropertyEditor::PropertyEditor(); diff --git a/src/Gui/SceneInspector.cpp b/src/Gui/SceneInspector.cpp index 5bc6e3804f..013520d182 100644 --- a/src/Gui/SceneInspector.cpp +++ b/src/Gui/SceneInspector.cpp @@ -23,15 +23,18 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include +# include # include #endif #include "SceneInspector.h" #include "ui_SceneInspector.h" -#include "MainWindow.h" #include "View3DInventor.h" #include "View3DInventorViewer.h" +#include "ViewProviderDocumentObject.h" +#include "Document.h" +#include "Application.h" +#include using namespace Gui::Dialog; @@ -97,15 +100,21 @@ void SceneModel::setNode(QModelIndex index, SoNode* node) for (int i=0; igetNumChildren();i++) { SoNode* child = group->getChild(i); setNode(this->index(i, 0, index), child); - // See ViewProviderDocumentObject::updateData - QByteArray name(child->getName()); - name = QByteArray::fromPercentEncoding(name); - this->setData(this->index(i, 1, index), QVariant(QString::fromUtf8(name))); + + QMap::iterator it = nodeNames.find(child); + if (it != nodeNames.end()) { + this->setData(this->index(i, 1, index), QVariant(it.value())); + } } } // insert icon } +void SceneModel::setNodeNames(const QMap& names) +{ + nodeNames = names; +} + // -------------------------------------------------------- /* TRANSLATOR Gui::Dialog::DlgInspector */ @@ -130,6 +139,18 @@ DlgInspector::~DlgInspector() delete ui; } +void DlgInspector::setDocument(Gui::Document* doc) +{ + setNodeNames(doc); + + View3DInventor* view = qobject_cast(doc->getActiveView()); + if (view) { + View3DInventorViewer* viewer = view->getViewer(); + setNode(viewer->getSceneGraph()); + ui->treeView->expandToDepth(3); + } +} + void DlgInspector::setNode(SoNode* node) { SceneModel* model = static_cast(ui->treeView->model()); @@ -145,6 +166,32 @@ void DlgInspector::setNode(SoNode* node) #endif } +void DlgInspector::setNodeNames(Gui::Document* doc) +{ + std::vector vps = doc->getViewProvidersOfType + (Gui::ViewProviderDocumentObject::getClassTypeId()); + QMap nodeNames; + for (std::vector::iterator it = vps.begin(); it != vps.end(); ++it) { + Gui::ViewProviderDocumentObject* vp = static_cast(*it); + App::DocumentObject* obj = vp->getObject(); + if (obj) { + QString label = QString::fromUtf8(obj->Label.getValue()); + nodeNames[vp->getRoot()] = label; + } + + std::vector modes = vp->getDisplayMaskModes(); + for (std::vector::iterator jt = modes.begin(); jt != modes.end(); ++jt) { + SoNode* node = vp->getDisplayMaskMode(jt->c_str()); + if (node) { + nodeNames[node] = QString::fromStdString(*jt); + } + } + } + + SceneModel* model = static_cast(ui->treeView->model()); + model->setNodeNames(nodeNames); +} + void DlgInspector::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { @@ -156,11 +203,16 @@ void DlgInspector::changeEvent(QEvent *e) void DlgInspector::on_refreshButton_clicked() { - View3DInventor* child = qobject_cast(getMainWindow()->activeWindow()); - if (child) { - View3DInventorViewer* viewer = child->getViewer(); - setNode(viewer->getSceneGraph()); - ui->treeView->expandToDepth(3); + Gui::Document* doc = Application::Instance->activeDocument(); + if (doc) { + setNodeNames(doc); + + View3DInventor* view = qobject_cast(doc->getActiveView()); + if (view) { + View3DInventorViewer* viewer = view->getViewer(); + setNode(viewer->getSceneGraph()); + ui->treeView->expandToDepth(3); + } } else { SceneModel* model = static_cast(ui->treeView->model()); diff --git a/src/Gui/SceneInspector.h b/src/Gui/SceneInspector.h index a7b187c71d..27ff489ef2 100644 --- a/src/Gui/SceneInspector.h +++ b/src/Gui/SceneInspector.h @@ -25,10 +25,12 @@ #include #include +#include class SoNode; namespace Gui { +class Document; namespace Dialog { class Ui_SceneInspector; @@ -53,11 +55,14 @@ public: bool setHeaderData (int section, Qt::Orientation orientation, const QVariant & value, int role = Qt::EditRole); /// insert the first node in tree void setNode(SoNode* node); + /// set names per node + void setNodeNames(const QMap& names); /// returns standard parent's flags Qt::ItemFlags flags (const QModelIndex & index) const; private: void setNode(QModelIndex, SoNode*); + QMap nodeNames; }; /// Dialog window to display scenegraph model as a tree @@ -69,13 +74,15 @@ public: DlgInspector(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~DlgInspector(); - void setNode(SoNode* node); + void setDocument(Gui::Document* doc); private Q_SLOTS: void on_refreshButton_clicked(); protected: void changeEvent(QEvent *e); + void setNode(SoNode* node); + void setNodeNames(Gui::Document*); private: Ui_SceneInspector* ui; diff --git a/src/Gui/Splashscreen.cpp b/src/Gui/Splashscreen.cpp index 8795282405..ec8e5bb0da 100644 --- a/src/Gui/Splashscreen.cpp +++ b/src/Gui/Splashscreen.cpp @@ -34,6 +34,10 @@ # include #endif +#if QT_VERSION < 0x050000 +# include +#endif + #include #include "Splashscreen.h" @@ -140,10 +144,16 @@ public: return; } - splash->showMessage(msg.replace(QLatin1String("\n"), QString()), alignment, textColor); - QMutex mutex; - QMutexLocker ml(&mutex); - QWaitCondition().wait(&mutex, 50); +#if QT_VERSION < 0x050000 + const QGLContext* ctx = QGLContext::currentContext(); + if (!ctx) +#endif + { + splash->showMessage(msg.replace(QLatin1String("\n"), QString()), alignment, textColor); + QMutex mutex; + QMutexLocker ml(&mutex); + QWaitCondition().wait(&mutex, 50); + } } private: diff --git a/src/Gui/ViewProvider.cpp b/src/Gui/ViewProvider.cpp index 7e89d675c8..4eaf744d47 100644 --- a/src/Gui/ViewProvider.cpp +++ b/src/Gui/ViewProvider.cpp @@ -275,21 +275,6 @@ SbMatrix ViewProvider::convert(const Base::Matrix4D &rcMatrix) const void ViewProvider::addDisplayMaskMode(SoNode *node, const char* type) { - if (type) { - std::string name = type; - for (std::string::iterator it = name.begin(); it != name.end(); ++it) { - if (it == name.begin()) { - if (!SbName::isBaseNameStartChar(*it)) - *it = '_'; - } - else { - if (!SbName::isBaseNameChar(*it)) - *it = '_'; - } - } - node->setName(name.c_str()); - } - _sDisplayMaskModes[type] = pcModeSwitch->getNumChildren(); pcModeSwitch->addChild(node); } diff --git a/src/Gui/ViewProviderDocumentObject.cpp b/src/Gui/ViewProviderDocumentObject.cpp index bbaca4ca48..89dfdb190c 100644 --- a/src/Gui/ViewProviderDocumentObject.cpp +++ b/src/Gui/ViewProviderDocumentObject.cpp @@ -190,14 +190,6 @@ void ViewProviderDocumentObject::attach(App::DocumentObject *pcObj) void ViewProviderDocumentObject::updateData(const App::Property* prop) { - if (pcObject && prop == &pcObject->Label) { - // SoBase::setName() replaces characters that according to the - // VRML standard are invalid. To avoid the replacement we use - // the percent encoding. - QByteArray ba(pcObject->Label.getValue()); - QByteArray name = ba.toPercentEncoding(); - pcRoot->setName(name.constData()); - } ViewProvider::updateData(prop); } diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index 30a5443dea..a07b28641b 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -707,7 +707,7 @@ def pruneIncluded(objectslist,strict=False): for obj in objectslist: toplevel = True if obj.isDerivedFrom("Part::Feature"): - if not (Draft.getType(obj) in ["Window","Clone","Pipe"]): + if not (Draft.getType(obj) in ["Window","Clone","Pipe","Rebar"]): for parent in obj.InList: if parent.isDerivedFrom("Part::Feature") and not (Draft.getType(parent) in ["Facebinder"]): if not parent.isDerivedFrom("Part::Part2DObject"): diff --git a/src/Mod/Arch/ArchRebar.py b/src/Mod/Arch/ArchRebar.py index 655411c13a..c65b14f84d 100644 --- a/src/Mod/Arch/ArchRebar.py +++ b/src/Mod/Arch/ArchRebar.py @@ -183,6 +183,56 @@ class _Rebar(ArchComponent.Component): v = DraftGeomUtils.vec(e).normalize() return e.Vertexes[0].Point,v return None,None + + def getRebarData(self,obj): + if len(obj.InList) != 1: + return + if Draft.getType(obj.InList[0]) != "Structure": + return + if not obj.InList[0].Shape: + return + if not obj.Base: + return + if not obj.Base.Shape: + return + if not obj.Base.Shape.Wires: + return + if not obj.Diameter.Value: + return + if not obj.Amount: + return + father = obj.InList[0] + wire = obj.Base.Shape.Wires[0] + axis = obj.Base.Placement.Rotation.multVec(FreeCAD.Vector(0,0,-1)) + size = (ArchCommands.projectToVector(father.Shape.copy(),axis)).Length + if hasattr(obj,"Rounding"): + if obj.Rounding: + radius = obj.Rounding * obj.Diameter.Value + import DraftGeomUtils + wire = DraftGeomUtils.filletWire(wire,radius) + wires = [] + if obj.Amount == 1: + offset = DraftVecUtils.scaleTo(axis,size/2) + wire.translate(offset) + wires.append(wire) + else: + if obj.OffsetStart.Value: + baseoffset = DraftVecUtils.scaleTo(axis,obj.OffsetStart.Value) + else: + baseoffset = None + interval = size - (obj.OffsetStart.Value + obj.OffsetEnd.Value) + interval = interval / (obj.Amount - 1) + vinterval = DraftVecUtils.scaleTo(axis,interval) + for i in range(obj.Amount): + if i == 0: + if baseoffset: + wire.translate(baseoffset) + wires.append(wire) + else: + wire = wire.copy() + wire.translate(vinterval) + wires.append(wire) + return [wires,obj.Diameter.Value/2] def execute(self,obj): diff --git a/src/Mod/Arch/ArchSite.py b/src/Mod/Arch/ArchSite.py index 02af353bc0..e05e4fb1e9 100644 --- a/src/Mod/Arch/ArchSite.py +++ b/src/Mod/Arch/ArchSite.py @@ -431,7 +431,10 @@ class _Site(ArchFloor._Floor): if obj.Perimeter.Value != l: obj.Perimeter = l # compute volumes - shapesolid = obj.Terrain.Shape.extrude(obj.ExtrusionVector) + if obj.Terrain.Shape.Solids: + shapesolid = obj.Terrain.Shape.copy() + else: + shapesolid = obj.Terrain.Shape.extrude(obj.ExtrusionVector) addvol = 0 subvol = 0 for sub in obj.Subtractions: diff --git a/src/Mod/Arch/importIFC.py b/src/Mod/Arch/importIFC.py index 14fa677d38..e19c89594f 100644 --- a/src/Mod/Arch/importIFC.py +++ b/src/Mod/Arch/importIFC.py @@ -21,6 +21,8 @@ #* * #*************************************************************************** +from __future__ import print_function + __title__ = "FreeCAD IFC importer - Enhanced ifcopenshell-only version" __author__ = "Yorik van Havre","Jonathan Wiedemann" __url__ = "http://www.freecadweb.org" @@ -344,7 +346,7 @@ def insert(filename,docname,skip=[],only=[],root=None): FreeCAD.Console.PrintError("IfcOpenShell was not found on this system. IFC support is disabled\n") return - if DEBUG: print("Opening ",filename,"...",) + if DEBUG: print("Opening ",filename,"...",end="") try: doc = FreeCAD.getDocument(docname) except: @@ -358,8 +360,6 @@ def insert(filename,docname,skip=[],only=[],root=None): if root: ROOT_ELEMENT = root - if DEBUG: print ("done.") - #global ifcfile # keeping global for debugging purposes filename = decode(filename,utf=True) ifcfile = ifcopenshell.open(filename) @@ -380,7 +380,7 @@ def insert(filename,docname,skip=[],only=[],root=None): annotations = ifcfile.by_type("IfcAnnotation") materials = ifcfile.by_type("IfcMaterial") - if DEBUG: print("Building relationships table...",) + if DEBUG: print("Building relationships table...",end="") # building relations tables objects = {} # { id:object, ... } @@ -476,7 +476,7 @@ def insert(filename,docname,skip=[],only=[],root=None): pid = product.id() guid = product.GlobalId ptype = product.is_a() - if DEBUG: print(count+1,"/",len(products)," creating object #",pid," : ",ptype,) + if DEBUG: print(count+1,"/",len(products)," creating object #",pid," : ",ptype,end="") name = str(ptype[3:]) if product.Name: name = product.Name.encode("utf8") @@ -491,9 +491,9 @@ def insert(filename,docname,skip=[],only=[],root=None): if ptype in structuralifcobjects: archobj = False structobj = True - if DEBUG: print(" (struct)",) + if DEBUG: print(" (struct)",end="") else: - if DEBUG: print(" (arch)",) + if DEBUG: print(" (arch)",end="") if MERGE_MODE_ARCH == 4 and archobj: if DEBUG: print(" skipped.") continue @@ -514,7 +514,7 @@ def insert(filename,docname,skip=[],only=[],root=None): try: prepr = product.Representation except: - if DEBUG: print(" ERROR unable to get object representation",) + if DEBUG: print(" ERROR unable to get object representation",end="") if prepr and (MERGE_MODE_ARCH == 0) and archobj and CREATE_CLONES: for s in prepr.Representations: @@ -538,7 +538,7 @@ def insert(filename,docname,skip=[],only=[],root=None): pass # IfcOpenShell will yield an error if a given product has no shape, but we don't care if brep: - if DEBUG: print(" ",str(len(brep)/1000),"k ",) + if DEBUG: print(" ",str(len(brep)/1000),"k ",end="") shape = Part.Shape() shape.importBrepFromString(brep) @@ -551,20 +551,20 @@ def insert(filename,docname,skip=[],only=[],root=None): if DEBUG: print("skipping space ",pid) elif structobj: structshapes[pid] = shape - if DEBUG: print(shape.Solids," ",) + if DEBUG: print(shape.Solids," ",end="") baseobj = shape else: shapes[pid] = shape - if DEBUG: print(shape.Solids," ",) + if DEBUG: print(shape.Solids," ",end="") baseobj = shape else: if clone: - if DEBUG: print("clone ",) + if DEBUG: print("clone ",end="") else: if GET_EXTRUSIONS: ex = Arch.getExtrusionData(shape) if ex: - print("extrusion ",) + print("extrusion ",end="") baseface = FreeCAD.ActiveDocument.addObject("Part::Feature",name+"_footprint") # bug in ifcopenshell? Some faces of a shell may have non-null placement # workaround to remove the bad placement: exporting/reimporting as step @@ -587,13 +587,13 @@ def insert(filename,docname,skip=[],only=[],root=None): baseobj = FreeCAD.ActiveDocument.addObject("Part::Feature",name+"_body") baseobj.Shape = shape else: - if DEBUG: print("null shape ",) + if DEBUG: print("null shape ",end="") if not shape.isValid(): - if DEBUG: print("invalid shape ",) + if DEBUG: print("invalid shape ",end="") #continue else: - if DEBUG: print(" no brep ",) + if DEBUG: print(" no brep ",end="") if MERGE_MODE_ARCH == 0 and archobj: @@ -622,7 +622,7 @@ def insert(filename,docname,skip=[],only=[],root=None): obj.Placement.Rotation = r obj.Placement.move(v) else: - print "failed to compute placement ", + print ("failed to compute placement ",) else: obj = getattr(Arch,"make"+freecadtype)(baseobj=baseobj,name=name) if store: @@ -747,7 +747,7 @@ def insert(filename,docname,skip=[],only=[],root=None): if MERGE_MODE_STRUCT == 2: - if DEBUG: print("Joining Structural shapes...") + if DEBUG: print("Joining Structural shapes...",end="") for host,children in groups.items(): # Structural if ifcfile[host].is_a("IfcStructuralAnalysisModel"): @@ -770,7 +770,7 @@ def insert(filename,docname,skip=[],only=[],root=None): else: - if DEBUG: print("Processing Struct relationships...") + if DEBUG: print("Processing Struct relationships...",end="") # groups for host,children in groups.items(): @@ -792,7 +792,7 @@ def insert(filename,docname,skip=[],only=[],root=None): Arch.addComponents(cobs,objects[host]) if DEBUG: FreeCAD.ActiveDocument.recompute() - if DEBUG: print "done" + if DEBUG: print ("done") if MERGE_MODE_ARCH > 2: # if ArchObj is compound or ArchObj not imported FreeCAD.ActiveDocument.recompute() @@ -809,7 +809,7 @@ def insert(filename,docname,skip=[],only=[],root=None): if ifcfile[host].Name: grp_name = ifcfile[host].Name else: - if DEBUG: print "no group name specified for entity: #", ifcfile[host].id(), ", entity type is used!" + if DEBUG: print ("no group name specified for entity: #", ifcfile[host].id(), ", entity type is used!") grp_name = ifcfile[host].is_a() + "_" + str(ifcfile[host].id()) grp = FreeCAD.ActiveDocument.addObject("App::DocumentObjectGroup",grp_name.encode("utf8")) objects[host] = grp @@ -821,7 +821,7 @@ def insert(filename,docname,skip=[],only=[],root=None): if MERGE_MODE_ARCH == 3: - if DEBUG: print("Joining Arch shapes...") + if DEBUG: print("Joining Arch shapes...",end="") for host,children in additions.items(): # Arch if ifcfile[host].is_a("IfcBuildingStorey"): @@ -845,11 +845,11 @@ def insert(filename,docname,skip=[],only=[],root=None): obj = FreeCAD.ActiveDocument.addObject("Part::Feature","UnclaimedArch") obj.Shape = Part.makeCompound(shapes.values()) - if DEBUG: print "done" + if DEBUG: print ("done") else: - if DEBUG: print("Processing Arch relationships...") + if DEBUG: print("Processing Arch relationships...",end="") # subtractions if SEPARATE_OPENINGS: @@ -871,6 +871,8 @@ def insert(filename,docname,skip=[],only=[],root=None): if DEBUG: print("adding ",len(cobs), " object(s) to ", objects[host].Label) Arch.addComponents(cobs,objects[host]) if DEBUG: FreeCAD.ActiveDocument.recompute() + + if DEBUG: print("done.") FreeCAD.ActiveDocument.recompute() @@ -884,7 +886,7 @@ def insert(filename,docname,skip=[],only=[],root=None): # 2D elements - if DEBUG and annotations:print("Creating 2D geometry...") + if DEBUG and annotations:print("Creating 2D geometry...",end="") scaling = getScaling(ifcfile) #print "scaling factor =",scaling @@ -915,10 +917,12 @@ def insert(filename,docname,skip=[],only=[],root=None): count += 1 FreeCAD.ActiveDocument.recompute() + + if DEBUG and annotations: print("done.") # Materials - if DEBUG and materials: print("Creating materials...") + if DEBUG and materials: print("Creating materials...",end="") #print "mattable:",mattable #print "materials:",materials fcmats = {} @@ -947,7 +951,7 @@ def insert(filename,docname,skip=[],only=[],root=None): if hasattr(objects[o],"BaseMaterial"): objects[o].BaseMaterial = mat - if DEBUG and materials: print "done" + if DEBUG and materials: print ("done") FreeCAD.ActiveDocument.recompute() @@ -1356,7 +1360,7 @@ def export(exportList,filename): if EXPORT_2D: curvestyles = {} - if annotations and DEBUG: print "exporting 2D objects..." + if annotations and DEBUG: print ("exporting 2D objects...") for anno in annotations: xvc = ifcfile.createIfcDirection((1.0,0.0,0.0)) zvc = ifcfile.createIfcDirection((0.0,0.0,1.0)) @@ -1597,6 +1601,19 @@ def getRepresentation(ifcfile,context,obj,forcebrep=False,subtraction=False,tess shapes.append(shape) solidType = "SweptSolid" shapetype = "extrusion" + elif hasattr(obj.Proxy,"getRebarData"): + # export rebars as IfcSweptDiskSolid + rdata = obj.Proxy.getRebarData(obj) + if rdata: + # convert to meters + r = rdata[1] * 0.001 + for w in rdata[0]: + w.scale(0.001) + cur = createCurve(ifcfile,w) + shape = ifcfile.createIfcSweptDiskSolid(cur,r) + shapes.append(shape) + solidType = "SweptSolid" + shapetype = "extrusion" if not shapes: # brep representation diff --git a/src/Mod/Complete/App/AppComplete.cpp b/src/Mod/Complete/App/AppComplete.cpp index 5c202fc90f..4d5a45e6e3 100644 --- a/src/Mod/Complete/App/AppComplete.cpp +++ b/src/Mod/Complete/App/AppComplete.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include "CompleteConfiguration.h" @@ -57,7 +58,7 @@ PyObject* initModule() /* Python entry */ -PyMODINIT_FUNC initComplete() +PyMOD_INIT_FUNC(Complete) { // load dependent module try { @@ -86,8 +87,9 @@ PyMODINIT_FUNC initComplete() } catch(const Base::Exception& e) { PyErr_SetString(PyExc_ImportError, e.what()); - return; + PyMOD_Return(0); } - (void)Complete::initModule(); + PyObject* mod = Complete::initModule(); Base::Console().Log("Loading Complete module... done\n"); + PyMOD_Return(mod); } diff --git a/src/Mod/Complete/Gui/AppCompleteGui.cpp b/src/Mod/Complete/Gui/AppCompleteGui.cpp index 6709afeaa1..09505603f8 100644 --- a/src/Mod/Complete/Gui/AppCompleteGui.cpp +++ b/src/Mod/Complete/Gui/AppCompleteGui.cpp @@ -74,32 +74,32 @@ PyObject* initModule() /* Python entry */ -PyMODINIT_FUNC initCompleteGui() +PyMOD_INIT_FUNC(CompleteGui) { if (!Gui::Application::Instance) { PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application."); - return; + PyMOD_Return(0); } - // try to load dependent modules, currently not (AssemblyGui, CamGui) - char *modules[] = {"PartGui", "MeshGui", "MeshPartGui", "PointsGui", "DrawingGui", "RaytracingGui", "SketcherGui", "PartDesignGui", "ImageGui", "TestGui"}; - size_t nModules = sizeof(modules) / sizeof(char*); - for (size_t i = 0; i < nModules; i++) { - try { - Base::Interpreter().loadModule(modules[i]); - } - catch (const Base::Exception& e) { - Base::Console().Error("%s\n", e.what()); - // Prints message to console window if we are in interactive mode - PyErr_Print(); - continue; - } - mods.append(QSTRING(modules[i])); - } - -# ifdef COMPLETE_USE_DRAFTING - mods.append(QSTRING("DraftGui")); - try { + // try to load dependent modules, currently not (AssemblyGui, CamGui) + char *modules[] = {"PartGui", "MeshGui", "MeshPartGui", "PointsGui", "DrawingGui", "RaytracingGui", "SketcherGui", "PartDesignGui", "ImageGui", "TestGui"}; + size_t nModules = sizeof(modules) / sizeof(char*); + for (size_t i = 0; i < nModules; i++) { + try { + Base::Interpreter().loadModule(modules[i]); + } + catch (const Base::Exception& e) { + Base::Console().Error("%s\n", e.what()); + // Prints message to console window if we are in interactive mode + PyErr_Print(); + continue; + } + mods.append(QSTRING(modules[i])); + } + +# ifdef COMPLETE_USE_DRAFTING + mods.append(QSTRING("DraftGui")); + try { Py::Module module(PyImport_ImportModule("FreeCADGui"),true); Py::Callable method(module.getAttr(std::string("getWorkbench"))); @@ -128,15 +128,15 @@ PyMODINIT_FUNC initCompleteGui() // Get the CompleteWorkbench handler args.setItem(0,Py::String("CompleteWorkbench")); } - catch (const Base::Exception& e) { - Base::Console().Error("%s\n", e.what()); - mods.removeAt(mods.size()); - // Prints message to console window if we are in interactive mode - PyErr_Print(); - } -# endif + catch (const Base::Exception& e) { + Base::Console().Error("%s\n", e.what()); + mods.removeAt(mods.size()); + // Prints message to console window if we are in interactive mode + PyErr_Print(); + } +# endif - (void) CompleteGui::initModule(); + PyObject* mod = CompleteGui::initModule(); Base::Console().Log("Loading GUI of Complete module... done\n"); // instantiating the commands @@ -145,4 +145,6 @@ PyMODINIT_FUNC initCompleteGui() // add resources and reloads the translators loadCompleteResource(); + + PyMOD_Return(mod); } diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index ef7d8d958c..d3e58eb02c 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -217,6 +217,8 @@ def isClone(obj,objtype,recursive=False): """isClone(obj,objtype,[recursive]): returns True if the given object is a clone of an object of the given type. If recursive is True, also check if the clone is a clone of clone (of clone...) of the given type.""" + if isinstance(objtype,list): + return any([isClone(obj,t,recursive) for t in objtype]) if getType(obj) == "Clone": if len(obj.Objects) == 1: if getType(obj.Objects[0]) == objtype: @@ -331,14 +333,14 @@ def shapify(obj): def getGroupContents(objectslist,walls=False,addgroups=False): '''getGroupContents(objectlist,[walls,addgroups]): if any object of the given list is a group, its content is appened to the list, which is returned. If walls is True, - walls are also scanned for included windows. If addgroups is true, the group itself - is also included in the list.''' + walls and structures are also scanned for included windows or rebars. If addgroups + is true, the group itself is also included in the list.''' def getWindows(obj): l = [] if getType(obj) in ["Wall","Structure"]: for o in obj.OutList: l.extend(getWindows(o)) - elif (getType(obj) == "Window") or isClone(obj,"Window"): + elif (getType(obj) in ["Window","Rebar"]) or isClone(obj,["Window","Rebar"]): l.append(obj) return l diff --git a/src/Mod/Fem/App/AppFemPy.cpp b/src/Mod/Fem/App/AppFemPy.cpp index 6a6314e4b7..8c87238ded 100644 --- a/src/Mod/Fem/App/AppFemPy.cpp +++ b/src/Mod/Fem/App/AppFemPy.cpp @@ -281,16 +281,13 @@ private: std::string EncodedName = std::string(fileName); PyMem_Free(fileName); - if (!pcObj) + if (pcObj) { - App::DocumentObjectPy* objpy= static_cast(pcObj); - App::DocumentObject* obj = objpy->getDocumentObjectPtr(); - if (!obj) + if (PyObject_TypeCheck(pcObj, &(App::DocumentObjectPy::Type))) { - App::Document* pcDoc = App::GetApplication().getActiveDocument(); - obj = pcDoc->getActiveObject(); + App::DocumentObject* obj = static_cast(pcObj)->getDocumentObjectPtr(); + FemVTKTools::writeResult(EncodedName.c_str(), obj); } - FemVTKTools::readFluidicResult(EncodedName.c_str(), obj); } else FemVTKTools::writeResult(EncodedName.c_str()); diff --git a/src/Mod/Fem/App/CMakeLists.txt b/src/Mod/Fem/App/CMakeLists.txt index 4f22594a6a..f7fa2c5408 100755 --- a/src/Mod/Fem/App/CMakeLists.txt +++ b/src/Mod/Fem/App/CMakeLists.txt @@ -113,7 +113,9 @@ SET(FemScripts_SRCS ccxFrdReader.py convert2TetGen.py importInpMesh.py + importVTKResults.py importZ88Mesh.py + importZ88Results.py Init.py InitGui.py FemAnalysis.py @@ -139,7 +141,6 @@ SET(FemScripts_SRCS FemMaterial.py FemSelectionObserver.py TestFem.py - z88DispReader.py TaskPanelFemBeamSection.ui TaskPanelFemMeshGmsh.ui TaskPanelFemMeshGroup.ui diff --git a/src/Mod/Fem/CMakeLists.txt b/src/Mod/Fem/CMakeLists.txt index 3aa85c5053..7fe32b3cba 100755 --- a/src/Mod/Fem/CMakeLists.txt +++ b/src/Mod/Fem/CMakeLists.txt @@ -116,7 +116,7 @@ INSTALL( # solver Z88 importZ88Mesh.py - z88DispReader.py + importZ88Results.py FemInputWriterZ88.py FemToolsZ88.py FemSolverZ88.py @@ -124,6 +124,9 @@ INSTALL( _ViewProviderFemSolverZ88.py _CommandSolverZ88.py + # additional imports and exports + importVTKResults.py + DESTINATION Mod/Fem ) diff --git a/src/Mod/Fem/FemToolsZ88.py b/src/Mod/Fem/FemToolsZ88.py index 6f68220325..5599a07cbb 100644 --- a/src/Mod/Fem/FemToolsZ88.py +++ b/src/Mod/Fem/FemToolsZ88.py @@ -190,11 +190,11 @@ class FemToolsZ88(FemTools.FemTools): def load_results_o2(self): import os - import z88DispReader + import importZ88Results disp_result_file = self.working_dir + '/z88o2.txt' if os.path.isfile(disp_result_file): result_name_prefix = 'Z88_' + self.solver.AnalysisType + '_' - z88DispReader.import_z88_disp(disp_result_file, self.analysis, result_name_prefix) + importZ88Results.import_z88_disp(disp_result_file, self.analysis, result_name_prefix) for m in self.analysis.Member: if m.isDerivedFrom("Fem::FemResultObject"): self.results_present = True diff --git a/src/Mod/Fem/Init.py b/src/Mod/Fem/Init.py index 865ebb09c5..0d775cbd16 100644 --- a/src/Mod/Fem/Init.py +++ b/src/Mod/Fem/Init.py @@ -30,13 +30,14 @@ import FreeCAD FreeCAD.addExportType("TetGen file (*.poly)", "convert2TetGen") FreeCAD.addImportType("FEM formats (*.unv *.med *.dat *.bdf)", "Fem") if("BUILD_FEM_VTK" in FreeCAD.__cmake__): - FreeCAD.addImportType("FEM results (*.vtk *.vtp *.vts *.vtr *.vtu *.vti)", "Fem") FreeCAD.addImportType("FEM CFD Unstructure Mesh (*.vtk *.vtu)", "Fem") FreeCAD.addExportType("FEM CFD Unstructure Mesh (*.vtk *.vtu)", "Fem") + # FreeCAD.addImportType("FEM results (*.vtk *.vtp *.vts *.vtr *.vtu *.vti)", "importVTKResults") # not implemented yet + FreeCAD.addExportType("FEM CFD Result in VTK format (*.vtk *.vtu)", "importVTKResults") FreeCAD.addExportType("FEM formats (*.unv *.med *.dat *.inp)", "Fem") FreeCAD.addImportType("CalculiX result (*.frd)", "ccxFrdReader") FreeCAD.addImportType("Mesh from Calculix/Abaqus input file (*.inp)", "importInpMesh") FreeCAD.addImportType("Z88 mesh file (*.txt)", "importZ88Mesh") FreeCAD.addExportType("Z88 mesh file (*.txt)", "importZ88Mesh") -FreeCAD.addImportType("Z88 displacement result file (*.txt)", "z88DispReader") +FreeCAD.addImportType("Z88 result file (*.txt)", "importZ88Results") diff --git a/src/Mod/Fem/importVTKResults.py b/src/Mod/Fem/importVTKResults.py new file mode 100644 index 0000000000..8193e5d6fa --- /dev/null +++ b/src/Mod/Fem/importVTKResults.py @@ -0,0 +1,70 @@ +# *************************************************************************** +# * (c) Qingfeng Xia 2017 * +# * * +# * This file is part of the FreeCAD CAx development system. * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * FreeCAD 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 Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with FreeCAD; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# * Juergen Riegel 2002 * +# ***************************************************************************/ + +__title__ = "FreeCAD Result import and export VTK file library" +__author__ = "Qingfeng Xia" +__url__ = "http://www.freecadweb.org" + +## @package importVTKResults +# \ingroup FEM + +import os +import FreeCAD + + +if open.__module__ == '__builtin__': + pyopen = open # because we'll redefine open below + + +def insert(filename, docname): + "called when freecad wants to import a file" + try: + doc = FreeCAD.getDocument(docname) + except NameError: + doc = FreeCAD.newDocument(docname) + FreeCAD.ActiveDocument = doc + importFemResult(filename) + + +def open(filename): + "called when freecad opens a file" + docname = os.path.splitext(os.path.basename(filename))[0] + insert(filename, docname) + + +def importFemResult(filename): + FreeCAD.Console.PrintError("FemResult import is not implemented, actually not necessary\n") + + +def export(objectslist, filename): + "called when freecad exports a fem result object" + if len(objectslist) != 1: + FreeCAD.Console.PrintError("This exporter can only export one object at once\n") + return + obj = objectslist[0] + if not obj.isDerivedFrom("Fem::FemResultObject"): + FreeCAD.Console.PrintError("object selcted is not FemResultObject.\n") + return + import Fem + Fem.writeResult(filename, obj) diff --git a/src/Mod/Fem/z88DispReader.py b/src/Mod/Fem/importZ88Results.py similarity index 97% rename from src/Mod/Fem/z88DispReader.py rename to src/Mod/Fem/importZ88Results.py index 35e24a202d..592c20ab36 100644 --- a/src/Mod/Fem/z88DispReader.py +++ b/src/Mod/Fem/importZ88Results.py @@ -24,7 +24,7 @@ __title__ = "FreeCAD Z88 Disp Reader" __author__ = "Bernd Hahnebach " __url__ = "http://www.freecadweb.org" -## @package z88DispReader +## @package importZ88Results # \ingroup FEM import FreeCAD @@ -57,6 +57,8 @@ def insert(filename, docname): def import_z88_disp(filename, analysis=None, result_name_prefix=None): '''insert a FreeCAD FEM Result object in the ActiveDocument ''' + if result_name_prefix is None: + result_name_prefix = '' m = read_z88_disp(filename) if(len(m['Nodes']) > 0): if analysis is None: @@ -141,9 +143,9 @@ def read_z88_disp(z88_disp_input): pure usage: import FemToolsZ88 fea = FemToolsZ88.FemToolsZ88() - import z88dispReader + import importZ88Results disp_file = '/pathtofile/z88o2.txt' - z88DispReader.import_z88_disp(disp_file , fea.analysis) + importZ88Results.import_z88_disp(disp_file , fea.analysis) The FreeCAD file needs to have an Analysis and an appropiate FEM Mesh ''' diff --git a/src/Mod/Import/App/ImportOCAF.cpp b/src/Mod/Import/App/ImportOCAF.cpp index 8e1ffe54e0..f4f57fa50d 100644 --- a/src/Mod/Import/App/ImportOCAF.cpp +++ b/src/Mod/Import/App/ImportOCAF.cpp @@ -64,17 +64,27 @@ # endif #endif -#include "ImportOCAF.h" #include #include #include #include #include #include +#include "ImportOCAF.h" #include #include #include +#include +#include + +#ifdef HAVE_TBB +#include +#include +#include +#endif + + using namespace Import; @@ -94,20 +104,29 @@ ImportOCAF::~ImportOCAF() void ImportOCAF::loadShapes() { + std::vector lValue; myRefShapes.clear(); - loadShapes(pDoc->Main(), TopLoc_Location(), default_name, "", false); + loadShapes(pDoc->Main(), TopLoc_Location(), default_name, "", false, lValue); } void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc, - const std::string& defaultname, const std::string& /*assembly*/, bool isRef) + const std::string& defaultname, const std::string& /*assembly*/, bool isRef, + std::vector& lValue) { int hash = 0; +#ifdef HAVE_TBB + using namespace tbb; + task_group g; +#endif TopoDS_Shape aShape; + + std::vector localValue; + if (aShapeTool->GetShape(label,aShape)) { hash = aShape.HashCode(HashUpper); } - Handle(TDataStd_Name) name; + Handle_TDataStd_Name name; std::string part_name = defaultname; if (label.FindAttribute(TDataStd_Name::GetID(),name)) { TCollection_ExtendedString extstr = name->Get(); @@ -132,7 +151,7 @@ void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc, } TopLoc_Location part_loc = loc; - Handle(XCAFDoc_Location) hLoc; + Handle_XCAFDoc_Location hLoc; if (label.FindAttribute(XCAFDoc_Location::GetID(), hLoc)) { if (isRef) part_loc = part_loc * hLoc->Get(); @@ -167,7 +186,7 @@ void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc, TDF_Label ref; if (aShapeTool->IsReference(label) && aShapeTool->GetReferredShape(label, ref)) { - loadShapes(ref, part_loc, part_name, asm_name, true); + loadShapes(ref, part_loc, part_name, asm_name, true, lValue); } if (isRef || myRefShapes.find(hash) == myRefShapes.end()) { @@ -179,34 +198,57 @@ void ImportOCAF::loadShapes(const TDF_Label& label, const TopLoc_Location& loc, if (!asm_name.empty()) part_name = asm_name; if (isRef) - createShape(label, loc, part_name); + createShape(label, loc, part_name, lValue); else - createShape(label, part_loc, part_name); + createShape(label, part_loc, part_name, localValue); } else { + // This is probably an Assembly let's try to create a Compound with the name + Part::Compound *pcCompound = NULL; + if (aShapeTool->IsAssembly(label)) { + pcCompound = static_cast(doc->addObject + ("Part::Compound",asm_name.c_str())); + } + for (TDF_ChildIterator it(label); it.More(); it.Next()) { - loadShapes(it.Value(), part_loc, part_name, asm_name, isRef); + loadShapes(it.Value(), part_loc, part_name, asm_name, isRef, localValue); + } + + if (pcCompound) { + pcCompound->Links.setValues(localValue); + lValue.push_back(pcCompound); + Node_Shapes.push_back(pcCompound->getNameInDocument()); } } } } -void ImportOCAF::createShape(const TDF_Label& label, const TopLoc_Location& loc, const std::string& name) +void ImportOCAF::createShape(const TDF_Label& label, const TopLoc_Location& loc, const std::string& name, + std::vector& lValue) { const TopoDS_Shape& aShape = aShapeTool->GetShape(label); - std::vector lValue; +#ifdef HAVE_TBB + using namespace tbb; + task_group g; +#endif if (!aShape.IsNull() && aShape.ShapeType() == TopAbs_COMPOUND) { TopExp_Explorer xp; int ctSolids = 0, ctShells = 0; + std::vector localValue; Part::Compound *pcCompound = static_cast(doc->addObject ("Part::Compound",name.c_str() )); - for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) - createShape(xp.Current(), loc, name, lValue); - for (xp.Init(aShape, TopAbs_SHELL, TopAbs_SOLID); xp.More(); xp.Next(), ctShells++) - createShape(xp.Current(), loc, name, lValue); - pcCompound->Links.setValues(lValue); + for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) { + createShape(xp.Current(), loc, name, localValue); + } + for (xp.Init(aShape, TopAbs_SHELL, TopAbs_SOLID); xp.More(); xp.Next(), ctShells++) { + createShape(xp.Current(), loc, name, localValue); + } + + pcCompound->Links.setValues(localValue); + lValue.push_back(pcCompound); + Node_Shapes.push_back(pcCompound->getNameInDocument()); if (ctSolids > 0 || ctShells > 0) return; } @@ -223,6 +265,7 @@ void ImportOCAF::createShape(const TopoDS_Shape& aShape, const TopLoc_Location& else part->Shape.setValue(aShape); part->Label.setValue(name); + Leaf_Shapes.push_back(part->getNameInDocument()); lvalue.push_back(part); Quantity_Color aColor; diff --git a/src/Mod/Import/App/ImportOCAF.h b/src/Mod/Import/App/ImportOCAF.h index dbf077d90e..7d145882fe 100644 --- a/src/Mod/Import/App/ImportOCAF.h +++ b/src/Mod/Import/App/ImportOCAF.h @@ -35,6 +35,8 @@ #include #include #include +#include + class TDF_Label; class TopLoc_Location; @@ -55,10 +57,16 @@ public: ImportOCAF(Handle_TDocStd_Document h, App::Document* d, const std::string& name); virtual ~ImportOCAF(); void loadShapes(); + std::vector return_leaf() const { + return Leaf_Shapes; + } + std::vector return_node() const { + return Node_Shapes; + } private: - void loadShapes(const TDF_Label& label, const TopLoc_Location&, const std::string& partname, const std::string& assembly, bool isRef); - void createShape(const TDF_Label& label, const TopLoc_Location&, const std::string&); + void loadShapes(const TDF_Label& label, const TopLoc_Location&, const std::string& partname, const std::string& assembly, bool isRef, std::vector &); + void createShape(const TDF_Label& label, const TopLoc_Location&, const std::string&, std::vector &); void createShape(const TopoDS_Shape& label, const TopLoc_Location&, const std::string&, std::vector &); virtual void applyColors(Part::Feature*, const std::vector&){} @@ -70,6 +78,10 @@ private: std::string default_name; std::set myRefShapes; static const int HashUpper = INT_MAX; + // These variables are used to transfer Shape names to the UI backend and decide + // to activate / deactivate the right members for performance improvements + std::vector Leaf_Shapes; + std::vector Node_Shapes; }; class ImportExport ExportOCAF diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index 321f650eb8..cd05af12c9 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -112,6 +112,10 @@ #include #include +#include +#include +#include + class OCAFBrowser { public: @@ -403,6 +407,16 @@ private: ImportOCAFExt ocaf(hDoc, pcDoc, file.fileNamePure()); ocaf.loadShapes(); + + // Shape are loaded we must now sort the one we want to display and the one we do want to hide + Gui::Document *guiDoc = Gui::Application::Instance->activeDocument(); + std::vectorkeep_leaf= ocaf.return_leaf(); + for (std::vector::iterator it = keep_leaf.begin() ; it != keep_leaf.end(); ++it) + guiDoc->setShow((*it)); + std::vectorhide_node= ocaf.return_node(); + for (std::vector::iterator it = hide_node.begin() ; it != hide_node.end(); ++it) + guiDoc->setHide((*it)); + pcDoc->recompute(); } catch (Standard_Failure) { diff --git a/src/Mod/Path/App/AppPath.cpp b/src/Mod/Path/App/AppPath.cpp index 3a9e1cd0ea..eb7f6dbf9b 100644 --- a/src/Mod/Path/App/AppPath.cpp +++ b/src/Mod/Path/App/AppPath.cpp @@ -27,6 +27,7 @@ #endif #include +#include #include #include "Command.h" @@ -49,7 +50,7 @@ extern PyObject* initModule(); } /* Python entry */ -PyMODINIT_FUNC initPath() +PyMOD_INIT_FUNC(Path) { // load dependent module try { @@ -90,4 +91,6 @@ PyMODINIT_FUNC initPath() Path::FeatureAreaPython ::init(); Path::FeatureAreaView ::init(); Path::FeatureAreaViewPython ::init(); + + PyMOD_Return(pathModule); } diff --git a/src/Mod/Path/App/CommandPyImp.cpp b/src/Mod/Path/App/CommandPyImp.cpp index 9f01e703ea..2b19863647 100644 --- a/src/Mod/Path/App/CommandPyImp.cpp +++ b/src/Mod/Path/App/CommandPyImp.cpp @@ -74,15 +74,28 @@ int CommandPy::PyInit(PyObject* args, PyObject* kwd) PyObject *key, *value; Py_ssize_t pos = 0; while (parameters && PyDict_Next(parameters, &pos, &key, &value)) { +#if PY_MAJOR_VERSION >= 3 + if ( !PyObject_TypeCheck(key,&(PyBytes_Type)) || (!PyObject_TypeCheck(value,&(PyFloat_Type)) && !PyObject_TypeCheck(value,&(PyLong_Type))) ) { +#else if ( !PyObject_TypeCheck(key,&(PyString_Type)) || (!PyObject_TypeCheck(value,&(PyFloat_Type)) && !PyObject_TypeCheck(value,&(PyInt_Type))) ) { +#endif PyErr_SetString(PyExc_TypeError, "The dictionary can only contain string:number pairs"); return -1; } +#if PY_MAJOR_VERSION >= 3 + std::string ckey = PyBytes_AsString(key); +#else std::string ckey = PyString_AsString(key); +#endif boost::to_upper(ckey); double cvalue; +#if PY_MAJOR_VERSION >= 3 + if (PyObject_TypeCheck(value,&(PyLong_Type))) { + cvalue = (double)PyLong_AsLong(value); +#else if (PyObject_TypeCheck(value,&(PyInt_Type))) { cvalue = (double)PyInt_AsLong(value); +#endif } else { cvalue = PyFloat_AsDouble(value); } @@ -124,7 +137,11 @@ Py::Dict CommandPy::getParameters(void) const { PyObject *dict = PyDict_New(); for(std::map::iterator i = getCommandPtr()->Parameters.begin(); i != getCommandPtr()->Parameters.end(); ++i) { +#if PY_MAJOR_VERSION >= 3 + PyDict_SetItem(dict,PyBytes_FromString(i->first.c_str()),PyFloat_FromDouble(i->second)); +#else PyDict_SetItem(dict,PyString_FromString(i->first.c_str()),PyFloat_FromDouble(i->second)); +#endif } return Py::Dict(dict); } @@ -135,12 +152,22 @@ void CommandPy::setParameters(Py::Dict arg) PyObject *key, *value; Py_ssize_t pos = 0; while (PyDict_Next(dict_copy, &pos, &key, &value)) { +#if PY_MAJOR_VERSION >= 3 + if ( PyObject_TypeCheck(key,&(PyBytes_Type)) && (PyObject_TypeCheck(value,&(PyFloat_Type)) || PyObject_TypeCheck(value,&(PyLong_Type)) ) ) { + std::string ckey = PyBytes_AsString(key); +#else if ( PyObject_TypeCheck(key,&(PyString_Type)) && (PyObject_TypeCheck(value,&(PyFloat_Type)) || PyObject_TypeCheck(value,&(PyInt_Type)) ) ) { std::string ckey = PyString_AsString(key); +#endif boost::to_upper(ckey); double cvalue; +#if PY_MAJOR_VERSION >= 3 + if (PyObject_TypeCheck(value,&(PyLong_Type))) { + cvalue = (double)PyLong_AsLong(value); +#else if (PyObject_TypeCheck(value,&(PyInt_Type))) { cvalue = (double)PyInt_AsLong(value); +#endif } else { cvalue = PyFloat_AsDouble(value); } @@ -156,7 +183,11 @@ void CommandPy::setParameters(Py::Dict arg) PyObject* CommandPy::toGCode(PyObject *args) { if (PyArg_ParseTuple(args, "")) { +#if PY_MAJOR_VERSION >= 3 + return PyBytes_FromString(getCommandPtr()->toGCode().c_str()); +#else return PyString_FromString(getCommandPtr()->toGCode().c_str()); +#endif } throw Py::Exception("This method accepts no argument"); } @@ -226,8 +257,13 @@ int CommandPy::setCustomAttributes(const char* attr, PyObject* obj) if (isalpha(satt[0])) { boost::to_upper(satt); double cvalue; +#if PY_MAJOR_VERSION >= 3 + if (PyObject_TypeCheck(obj,&(PyLong_Type))) { + cvalue = (double)PyLong_AsLong(obj); +#else if (PyObject_TypeCheck(obj,&(PyInt_Type))) { cvalue = (double)PyInt_AsLong(obj); +#endif } else if (PyObject_TypeCheck(obj,&(PyFloat_Type))) { cvalue = PyFloat_AsDouble(obj); } else { diff --git a/src/Mod/Path/App/PathPy.xml b/src/Mod/Path/App/PathPy.xml index 3522ecec1e..6433f01171 100644 --- a/src/Mod/Path/App/PathPy.xml +++ b/src/Mod/Path/App/PathPy.xml @@ -26,7 +26,7 @@ commands (optional) is a list of Path commands the number of commands in this path - + diff --git a/src/Mod/Path/App/PathPyImp.cpp b/src/Mod/Path/App/PathPyImp.cpp index 46817bf33a..233a40ecf0 100644 --- a/src/Mod/Path/App/PathPyImp.cpp +++ b/src/Mod/Path/App/PathPyImp.cpp @@ -112,9 +112,9 @@ Py::Float PathPy::getLength(void) const return Py::Float(getToolpathPtr()->getLength()); } -Py::Int PathPy::getSize(void) const +Py::Long PathPy::getSize(void) const { - return Py::Int((int)getToolpathPtr()->getSize()); + return Py::Long((long)getToolpathPtr()->getSize()); } // specific methods @@ -178,7 +178,11 @@ PyObject* PathPy::toGCode(PyObject * args) { if (PyArg_ParseTuple(args, "")) { std::string result = getToolpathPtr()->toGCode(); +#if PY_MAJOR_VERSION >= 3 + return PyBytes_FromString(result.c_str()); +#else return PyString_FromString(result.c_str()); +#endif } throw Py::Exception("This method accepts no argument"); } diff --git a/src/Mod/Path/App/TooltablePyImp.cpp b/src/Mod/Path/App/TooltablePyImp.cpp index 0b2ad66070..abae1958e4 100644 --- a/src/Mod/Path/App/TooltablePyImp.cpp +++ b/src/Mod/Path/App/TooltablePyImp.cpp @@ -363,11 +363,19 @@ int TooltablePy::PyInit(PyObject* args, PyObject* /*kwd*/) PyObject *key, *value; Py_ssize_t pos = 0; while (PyDict_Next(pcObj, &pos, &key, &value)) { +#if PY_MAJOR_VERSION >= 3 + if ( !PyObject_TypeCheck(key,&(PyLong_Type)) || !PyObject_TypeCheck(value,&(Path::ToolPy::Type)) ) { +#else if ( !PyObject_TypeCheck(key,&(PyInt_Type)) || !PyObject_TypeCheck(value,&(Path::ToolPy::Type)) ) { +#endif PyErr_SetString(PyExc_TypeError, "The dictionary can only contain int:tool pairs"); return -1; } +#if PY_MAJOR_VERSION >= 3 + int ckey = (int)PyLong_AsLong(key); +#else int ckey = (int)PyInt_AsLong(key); +#endif Path::Tool &tool = *static_cast(value)->getToolPtr(); getTooltablePtr()->setTool(tool,ckey); } @@ -397,7 +405,11 @@ Py::Dict TooltablePy::getTools(void) const PyObject *dict = PyDict_New(); for(std::map::iterator i = getTooltablePtr()->Tools.begin(); i != getTooltablePtr()->Tools.end(); ++i) { PyObject *tool = new Path::ToolPy(i->second); +#if PY_MAJOR_VERSION >= 3 + PyDict_SetItem(dict,PyLong_FromLong(i->first),tool); +#else PyDict_SetItem(dict,PyInt_FromLong(i->first),tool); +#endif } return Py::Dict(dict); } @@ -409,8 +421,13 @@ void TooltablePy::setTools(Py::Dict arg) PyObject *key, *value; Py_ssize_t pos = 0; while (PyDict_Next(dict_copy, &pos, &key, &value)) { +#if PY_MAJOR_VERSION >= 3 + if ( PyObject_TypeCheck(key,&(PyLong_Type)) && (PyObject_TypeCheck(value,&(Path::ToolPy::Type))) ) { + int ckey = (int)PyLong_AsLong(key); +#else if ( PyObject_TypeCheck(key,&(PyInt_Type)) && (PyObject_TypeCheck(value,&(Path::ToolPy::Type))) ) { int ckey = (int)PyInt_AsLong(key); +#endif Path::Tool &tool = *static_cast(value)->getToolPtr(); getTooltablePtr()->setTool(tool,ckey); } else { diff --git a/src/Mod/Path/CMakeLists.txt b/src/Mod/Path/CMakeLists.txt index aecf79d898..42b9dd98fb 100644 --- a/src/Mod/Path/CMakeLists.txt +++ b/src/Mod/Path/CMakeLists.txt @@ -10,6 +10,7 @@ INSTALL( Init.py InitGui.py PathCommands.py + TestPathApp.py DESTINATION Mod/Path ) @@ -39,6 +40,7 @@ SET(PathScripts_SRCS PathScripts/PathJob.py PathScripts/PathKurveUtils.py PathScripts/PathLoadTool.py + PathScripts/PathLog.py PathScripts/PathMillFace.py PathScripts/PathPlane.py PathScripts/PathPocket.py @@ -75,14 +77,6 @@ SET(PathScripts_SRCS PathScripts/opensbp_pre.py PathScripts/rml_post.py PathScripts/slic3r_pre.py - PathTests/PathTestUtils.py - PathTests/TestPathDepthParams.py - PathTests/TestPathDressupHoldingTags.py - PathTests/TestPathGeom.py - PathTests/TestPathPost.py - PathTests/__init__.py - PathTests/test_linuxcnc_00.ngc - TestPathApp.py ) SET(PathScripts_NC_SRCS @@ -93,6 +87,18 @@ SET(PathScripts_NC_SRCS PathScripts/nc/iso_codes.py ) +SET(PathTests_SRCS + PathTests/PathTestUtils.py + PathTests/TestPathCore.py + PathTests/TestPathDepthParams.py + PathTests/TestPathDressupHoldingTags.py + PathTests/TestPathGeom.py + PathTests/TestPathLog.py + PathTests/TestPathPost.py + PathTests/__init__.py + PathTests/test_linuxcnc_00.ngc +) + SET(all_files ${PathScripts_SRCS} ${PathScripts_NC_SRCS} @@ -102,7 +108,17 @@ ADD_CUSTOM_TARGET(PathScripts ALL SOURCES ${all_files} ) +SET(test_files + TestPathApp.py + ${PathTests_SRCS} +) + +ADD_CUSTOM_TARGET(PathTests ALL + SOURCES ${test_files} +) + fc_copy_sources(PathScripts "${CMAKE_BINARY_DIR}/Mod/Path" ${all_files}) +fc_copy_sources(PathTests "${CMAKE_BINARY_DIR}/Mod/Path" ${test_files}) INSTALL( FILES @@ -118,3 +134,10 @@ INSTALL( Mod/Path/PathScripts/nc ) +INSTALL( + FILES + ${PathTests_SRCS} + DESTINATION + Mod/Path/PathTests +) + diff --git a/src/Mod/Path/Gui/AppPathGui.cpp b/src/Mod/Path/Gui/AppPathGui.cpp index 70a9186e12..c56481e056 100644 --- a/src/Mod/Path/Gui/AppPathGui.cpp +++ b/src/Mod/Path/Gui/AppPathGui.cpp @@ -52,11 +52,11 @@ extern PyObject* initModule(); } /* Python entry */ -PyMODINIT_FUNC initPathGui() +PyMOD_INIT_FUNC(PathGui) { if (!Gui::Application::Instance) { PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application."); - return; + PyMOD_Return(0); } try { Base::Interpreter().runString("import PartGui"); @@ -64,9 +64,9 @@ PyMODINIT_FUNC initPathGui() } catch(const Base::Exception& e) { PyErr_SetString(PyExc_ImportError, e.what()); - return; + PyMOD_Return(0); } - (void)PathGui::initModule(); + PyObject* mod = PathGui::initModule(); Base::Console().Log("Loading GUI of Path module... done\n"); // instantiating the commands @@ -88,4 +88,6 @@ PyMODINIT_FUNC initPathGui() // register preferences pages new Gui::PrefPageProducer ("Path"); + + PyMOD_Return(mod); } diff --git a/src/Mod/Path/PathScripts/PathCompoundExtended.py b/src/Mod/Path/PathScripts/PathCompoundExtended.py index 08e9b20808..7a2e547a92 100644 --- a/src/Mod/Path/PathScripts/PathCompoundExtended.py +++ b/src/Mod/Path/PathScripts/PathCompoundExtended.py @@ -20,6 +20,7 @@ # * USA * # * * # *************************************************************************** +from __future__ import print_function import FreeCAD import FreeCADGui @@ -57,7 +58,7 @@ class ObjectCompoundExtended: def onChanged(self, obj, prop): if prop == "Group": - print 'check order' + print('check order') for child in obj.Group: if child.isDerivedFrom("Path::Feature"): child.touch() diff --git a/src/Mod/Path/PathScripts/PathDressup.py b/src/Mod/Path/PathScripts/PathDressup.py index 3954747194..82cb1c3042 100644 --- a/src/Mod/Path/PathScripts/PathDressup.py +++ b/src/Mod/Path/PathScripts/PathDressup.py @@ -21,6 +21,7 @@ # * USA * # * * # *************************************************************************** +from __future__ import print_function import FreeCAD import FreeCADGui import Path @@ -90,7 +91,7 @@ class ViewProviderDressup: if g.Name == self.Object.Base.Name: group.remove(g) i.Group = group - print i.Group + print(i.Group) return [self.Object.Base] def __getstate__(self): diff --git a/src/Mod/Path/PathScripts/PathDressupDogbone.py b/src/Mod/Path/PathScripts/PathDressupDogbone.py index 9aa008b7b7..b165923f7a 100644 --- a/src/Mod/Path/PathScripts/PathDressupDogbone.py +++ b/src/Mod/Path/PathScripts/PathDressupDogbone.py @@ -21,31 +21,27 @@ # * USA * # * * # *************************************************************************** +from __future__ import print_function +import DraftGeomUtils import FreeCAD import FreeCADGui -import Path -from PathScripts import PathUtils -from PathScripts.PathGeom import * -from PySide import QtCore, QtGui import math import Part -import DraftGeomUtils +import Path +import PathScripts.PathLog as PathLog + +from PathScripts import PathUtils +from PathScripts.PathGeom import PathGeom +from PySide import QtCore, QtGui """Dogbone Dressup object and FreeCAD command""" -debugDressup = False +LOG_MODULE = 'PathDressupDogbone' +#PathLog.setLevel(PathLog.Level.INFO, LOG_MODULE) # Qt tanslation handling -try: - _encoding = QtGui.QApplication.UnicodeUTF8 - - def translate(context, text, disambig=None): - return QtGui.QApplication.translate(context, text, disambig, _encoding) - -except AttributeError: - - def translate(context, text, disambig=None): - return QtGui.QApplication.translate(context, text, disambig) +def translate(text, context = "PathDressup_Dogbone", disambig=None): + return QtCore.QCoreApplication.translate(context, text, disambig) movecommands = ['G0', 'G00', 'G1', 'G01', 'G2', 'G02', 'G3', 'G03'] movestraight = ['G1', 'G01'] @@ -53,12 +49,8 @@ movecw = ['G2', 'G02'] moveccw = ['G3', 'G03'] movearc = movecw + moveccw -def debugPrint(msg): - if debugDressup: - print(msg) - def debugMarker(vector, label, color = None, radius = 0.5): - if debugDressup: + if PathLog.getLevel(LOG_MODULE) == PathLog.Level.DEBUG: obj = FreeCAD.ActiveDocument.addObject("Part::Sphere", label) obj.Label = label obj.Radius = radius @@ -67,7 +59,7 @@ def debugMarker(vector, label, color = None, radius = 0.5): obj.ViewObject.ShapeColor = color def debugCircle(vector, r, label, color = None): - if debugDressup: + if PathLog.getLevel(LOG_MODULE) == PathLog.Level.DEBUG: obj = FreeCAD.ActiveDocument.addObject("Part::Cylinder", label) obj.Label = label obj.Radius = r @@ -285,6 +277,7 @@ class Bone: self.inChord = inChord self.outChord = outChord self.smooth = smooth + self.smooth = Smooth.Neither def angle(self): if not hasattr(self, 'cAngle'): @@ -318,9 +311,9 @@ class Bone: # for some reason pi/2 is not equal to pi/2 if math.fabs(angle - boneAngle) < 0.00001: # moving directly towards the corner - debugPrint("adaptive - on target: %.2f - %.2f" % (distance, toolRadius)) + PathLog.debug("adaptive - on target: %.2f - %.2f" % (distance, toolRadius)) return distance - toolRadius - debugPrint("adaptive - angles: corner=%.2f bone=%.2f diff=%.12f" % (angle/math.pi, boneAngle/math.pi, angle - boneAngle)) + PathLog.debug("adaptive - angles: corner=%.2f bone=%.2f diff=%.12f" % (angle/math.pi, boneAngle/math.pi, angle - boneAngle)) # The bones root and end point form a triangle with the intersection of the tool path # with the toolRadius circle around the bone end point. @@ -331,7 +324,7 @@ class Bone: beta = math.fabs(addAngle(boneAngle, -angle)) D = (distance / toolRadius) * math.sin(beta) if D > 1: # no intersection - debugPrint("adaptive - no intersection - no bone") + PathLog.debug("adaptive - no intersection - no bone") return 0 gamma = math.asin(D) alpha = math.pi - beta - gamma @@ -343,7 +336,7 @@ class Bone: length2 = toolRadius * math.sin(alpha2) / math.sin(beta2) length = min(length, length2) - debugPrint("adaptive corner=%.2f * %.2f˚ -> bone=%.2f * %.2f˚" % (distance, angle, length, boneAngle)) + PathLog.debug("adaptive corner=%.2f * %.2f˚ -> bone=%.2f * %.2f˚" % (distance, angle, length, boneAngle)) return length def edges(self): @@ -390,26 +383,26 @@ class ObjectDressup: return outChord.foldsBackOrTurns(inChord, self.theOtherSideOf(obj.Side)) def findPivotIntersection(self, pivot, pivotEdge, edge, refPt, d, color): - debugPrint("Intersection (%.2f, %.2f)^%.2f - [(%.2f, %.2f), (%.2f, %.2f)]" % (pivotEdge.Curve.Center.x, pivotEdge.Curve.Center.y, pivotEdge.Curve.Radius, edge.Vertexes[0].Point.x, edge.Vertexes[0].Point.y, edge.Vertexes[1].Point.x, edge.Vertexes[1].Point.y)) + PathLog.track("(%.2f, %.2f)^%.2f - [(%.2f, %.2f), (%.2f, %.2f)]" % (pivotEdge.Curve.Center.x, pivotEdge.Curve.Center.y, pivotEdge.Curve.Radius, edge.Vertexes[0].Point.x, edge.Vertexes[0].Point.y, edge.Vertexes[1].Point.x, edge.Vertexes[1].Point.y)) ppt = None pptDistance = 0 for pt in DraftGeomUtils.findIntersection(edge, pivotEdge, dts=False): #debugMarker(pt, "pti.%d-%s.in" % (self.boneId, d), color, 0.2) distance = (pt - refPt).Length - debugPrint(" --> (%.2f, %.2f): %.2f" % (pt.x, pt.y, distance)) + PathLog.debug(" --> (%.2f, %.2f): %.2f" % (pt.x, pt.y, distance)) if not ppt or pptDistance < distance: ppt = pt pptDistance = distance if not ppt: tangent = DraftGeomUtils.findDistance(pivot, edge) if tangent: - debugPrint("Taking tangent as intersect %s" % tangent) + PathLog.debug("Taking tangent as intersect %s" % tangent) ppt = pivot + tangent else: - debugPrint("Taking chord start as intersect %s" % inChordStart) + PathLog.debug("Taking chord start as intersect %s" % inChordStart) ppt = inChord.Start #debugMarker(ppt, "ptt.%d-%s.in" % (self.boneId, d), color, 0.2) - debugPrint(" --> (%.2f, %.2f)" % (ppt.x, ppt.y)) + PathLog.debug(" --> (%.2f, %.2f)" % (ppt.x, ppt.y)) return ppt def pointIsOnEdge(self, point, edge): @@ -418,7 +411,7 @@ class ObjectDressup: def smoothChordCommands(self, bone, inChord, outChord, edge, wire, corner, smooth, color = None): if smooth == 0: - debugPrint(" No smoothing requested") + PathLog.info(" No smoothing requested") return [ bone.lastCommand, outChord.g1Command() ] d = 'in' @@ -428,32 +421,32 @@ class ObjectDressup: refPoint = outChord.End if DraftGeomUtils.areColinear(inChord.asEdge(), outChord.asEdge()): - debugPrint(" straight edge %s" % d) + PathLog.info(" straight edge %s" % d) return [ outChord.g1Command() ] pivot = None pivotDistance = 0 - debugPrint("smooth: (%.2f, %.2f)-(%.2f, %.2f)" % (edge.Vertexes[0].Point.x, edge.Vertexes[0].Point.y, edge.Vertexes[1].Point.x, edge.Vertexes[1].Point.y)) + PathLog.info("smooth: (%.2f, %.2f)-(%.2f, %.2f)" % (edge.Vertexes[0].Point.x, edge.Vertexes[0].Point.y, edge.Vertexes[1].Point.x, edge.Vertexes[1].Point.y)) for e in wire.Edges: self.dbg.append(e) if type(e.Curve) == Part.LineSegment or type(e.Curve) == Part.Line: - debugPrint(" (%.2f, %.2f)-(%.2f, %.2f)" % (e.Vertexes[0].Point.x, e.Vertexes[0].Point.y, e.Vertexes[1].Point.x, e.Vertexes[1].Point.y)) + PathLog.debug(" (%.2f, %.2f)-(%.2f, %.2f)" % (e.Vertexes[0].Point.x, e.Vertexes[0].Point.y, e.Vertexes[1].Point.x, e.Vertexes[1].Point.y)) else: - debugPrint(" (%.2f, %.2f)^%.2f" % (e.Curve.Center.x, e.Curve.Center.y, e.Curve.Radius)) + PathLog.debug(" (%.2f, %.2f)^%.2f" % (e.Curve.Center.x, e.Curve.Center.y, e.Curve.Radius)) for pt in DraftGeomUtils.findIntersection(edge, e, True, findAll=True): if not PathGeom.pointsCoincide(pt, corner) and self.pointIsOnEdge(pt, e): - debugMarker(pt, "candidate-%d-%s" % (self.boneId, d), color, 0.05) - debugPrint(" -> candidate") + #debugMarker(pt, "candidate-%d-%s" % (self.boneId, d), color, 0.05) + PathLog.debug(" -> candidate") distance = (pt - refPoint).Length if not pivot or pivotDistance > distance: pivot = pt pivotDistance = distance else: - debugPrint(" -> corner intersect") + PathLog.debug(" -> corner intersect") if pivot: - debugCircle(pivot, self.toolRadius, "pivot.%d-%s" % (self.boneId, d), color) + #debugCircle(pivot, self.toolRadius, "pivot.%d-%s" % (self.boneId, d), color) pivotEdge = Part.Edge(Part.Circle(pivot, FreeCAD.Vector(0,0,1), self.toolRadius)) t1 = self.findPivotIntersection(pivot, pivotEdge, inChord.asEdge(), inChord.End, d, color) @@ -461,16 +454,16 @@ class ObjectDressup: commands = [] if not PathGeom.pointsCoincide(t1, inChord.Start): - debugPrint(" add lead in") + PathLog.debug(" add lead in") commands.append(Chord(inChord.Start, t1).g1Command()) if bone.obj.Side == Side.Left: - debugPrint(" add g3 command") + PathLog.debug(" add g3 command") commands.append(Chord(t1, t2).g3Command(pivot)) else: - debugPrint(" add g2 command center=(%.2f, %.2f) -> from (%2f, %.2f) to (%.2f, %.2f" % (pivot.x, pivot.y, t1.x, t1.y, t2.x, t2.y)) + PathLog.debug(" add g2 command center=(%.2f, %.2f) -> from (%2f, %.2f) to (%.2f, %.2f" % (pivot.x, pivot.y, t1.x, t1.y, t2.x, t2.y)) commands.append(Chord(t1, t2).g2Command(pivot)) if not PathGeom.pointsCoincide(t2, outChord.End): - debugPrint(" add lead out") + PathLog.debug(" add lead out") commands.append(Chord(t2, outChord.End).g1Command()) #debugMarker(pivot, "pivot.%d-%s" % (self.boneId, d), color, 0.2) @@ -479,7 +472,7 @@ class ObjectDressup: return commands - debugPrint(" no pivot found - straight command") + PathLog.info(" no pivot found - straight command") return [ inChord.g1Command(), outChord.g1Command() ] def inOutBoneCommands(self, bone, boneAngle, fixedLength): @@ -487,8 +480,8 @@ class ObjectDressup: bone.tip = bone.inChord.End # in case there is no bone - debugPrint("corner = (%.2f, %.2f)" % (corner.x, corner.y)) - debugMarker(corner, 'corner', (1., 0., 1.), self.toolRadius) + PathLog.debug("corner = (%.2f, %.2f)" % (corner.x, corner.y)) + #debugMarker(corner, 'corner', (1., 0., 1.), self.toolRadius) length = fixedLength if bone.obj.Incision == Incision.Custom: @@ -497,7 +490,7 @@ class ObjectDressup: length = bone.adaptiveLength(boneAngle, self.toolRadius) if length == 0: - # no bone after all .. + PathLog.info("no bone after all ..") return [ bone.lastCommand, bone.outChord.g1Command() ] boneInChord = bone.inChord.move(length, boneAngle) @@ -576,7 +569,7 @@ class ObjectDressup: onInString = 'out' if onIn: onInString = 'in' - debugPrint("tboneEdge boneAngle[%s]=%.2f (in=%.2f, out=%.2f)" % (onInString, boneAngle/math.pi, bone.inChord.getAngleXY()/math.pi, bone.outChord.getAngleXY()/math.pi)) + PathLog.debug("tboneEdge boneAngle[%s]=%.2f (in=%.2f, out=%.2f)" % (onInString, boneAngle/math.pi, bone.inChord.getAngleXY()/math.pi, bone.outChord.getAngleXY()/math.pi)) return self.inOutBoneCommands(bone, boneAngle, self.toolRadius) def tboneLongEdge(self, bone): @@ -619,21 +612,21 @@ class ObjectDressup: return [ bone.lastCommand, bone.outChord.g1Command() ] def insertBone(self, bone): - debugPrint(">----------------------------------- %d --------------------------------------" % bone.boneId) + PathLog.debug(">----------------------------------- %d --------------------------------------" % bone.boneId) self.boneShapes = [] blacklisted, inaccessible = self.boneIsBlacklisted(bone) enabled = not blacklisted self.bones.append((bone.boneId, bone.location(), enabled, inaccessible)) self.boneId = bone.boneId - if debugDressup and bone.boneId > 2: + if False and PathLog.getLevel(LOG_MODULE) == PathLog.Level.DEBUG and bone.boneId > 2: commands = self.boneCommands(bone, False) else: commands = self.boneCommands(bone, enabled) bone.commands = commands self.shapes[bone.boneId] = self.boneShapes - debugPrint("<----------------------------------- %d --------------------------------------" % bone.boneId) + PathLog.debug("<----------------------------------- %d --------------------------------------" % bone.boneId) return commands def removePathCrossing(self, commands, bone1, bone2): @@ -652,7 +645,7 @@ class ObjectDressup: #debugCircle(e2.Curve.Center, e2.Curve.Radius, "bone.%d-2" % (self.boneId), (0.,1.,0.)) if PathGeom.pointsCoincide(pt, e1.valueAt(e1.LastParameter)) or PathGeom.pointsCoincide(pt, e2.valueAt(e2.FirstParameter)): continue - debugMarker(pt, "it", (0.0, 1.0, 1.0)) + #debugMarker(pt, "it", (0.0, 1.0, 1.0)) # 1. remove all redundant commands commands = commands[:-(len(inEdges) - i)] # 2., correct where c1 ends @@ -702,40 +695,52 @@ class ObjectDressup: boneIserted = False for thisCommand in obj.Base.Path.Commands: + PathLog.info("Command: %s" % thisCommand) if thisCommand.Name in movecommands: thisChord = lastChord.moveToParameters(thisCommand.Parameters) thisIsACandidate = self.canAttachDogbone(thisCommand, thisChord) if thisIsACandidate and lastCommand and self.shouldInsertDogbone(obj, lastChord, thisChord): + PathLog.info(" Found bone corner") bone = Bone(boneId, obj, lastCommand, lastChord, thisChord, Smooth.InAndOut) bones = self.insertBone(bone) boneId += 1 if lastBone: + PathLog.info(" removing potential path crossing") #debugMarker(thisChord.Start, "it", (1.0, 0.0, 1.0)) commands, bones = self.removePathCrossing(commands, lastBone, bone) commands.extend(bones[:-1]) lastCommand = bones[-1] lastBone = bone elif lastCommand and thisChord.isAPlungeMove(): + PathLog.info(" Looking for connection in odds and ends") + haveNewLastCommand = False for chord in (chord for chord in oddsAndEnds if lastChord.connectsTo(chord)): if self.shouldInsertDogbone(obj, lastChord, chord): + PathLog.info(" and there is one") bone = Bone(boneId, obj, lastCommand, lastChord, chord, Smooth.In) bones = self.insertBone(bone) boneId += 1 if lastBone: + PathLog.info(" removing potential path crossing") #debugMarker(chord.Start, "it", (0.0, 1.0, 1.0)) commands, bones = self.removePathCrossing(commands, lastBone, bone) commands.extend(bones[:-1]) lastCommand = bones[-1] + haveNewLastCommand = True + if not haveNewLastCommand: + commands.append(lastCommand) lastCommand = None commands.append(thisCommand) lastBone = None elif thisIsACandidate: + PathLog.info(" is a candidate, keeping for later") if lastCommand: commands.append(lastCommand) lastCommand = thisCommand lastBone = None else: + PathLog.info(" nope") if lastCommand: commands.append(lastCommand) lastCommand = None @@ -743,21 +748,24 @@ class ObjectDressup: lastBone = None if lastChord.isAPlungeMove() and thisIsACandidate: + PathLog.info(" adding to odds and ends") oddsAndEnds.append(thisChord) lastChord = thisChord else: + PathLog.info(" Clean slate") if lastCommand: commands.append(lastCommand) lastCommand = None commands.append(thisCommand) + lastBone = None #for cmd in commands: - # debugPrint("cmd = '%s'" % cmd) + # PathLog.debug("cmd = '%s'" % cmd) path = Path.Path(commands) obj.Path = path def setup(self, obj): - debugPrint("Here we go ... ") + PathLog.info("Here we go ... ") if hasattr(obj.Base, "BoneBlacklist"): # dressing up a bone dressup obj.Side = obj.Base.Side @@ -861,18 +869,18 @@ class TaskPanel: self.form.customLabel.setEnabled(customSelected) self.updateBoneList() - if debugDressup: + if PathLog.getLevel(LOG_MODULE) == PathLog.Level.DEBUG: for obj in FreeCAD.ActiveDocument.Objects: if obj.Name.startswith('Shape'): FreeCAD.ActiveDocument.removeObject(obj.Name) print('object name %s' % self.obj.Name) if hasattr(self.obj.Proxy, "shapes"): - debugPrint("showing shapes attribute") + PathLog.info("showing shapes attribute") for shapes in self.obj.Proxy.shapes.itervalues(): for shape in shapes: Part.show(shape) else: - debugPrint("no shapes attribute found") + PathLog.info("no shapes attribute found") def updateModel(self): @@ -944,7 +952,7 @@ class ViewProviderDressup: if g.Name == self.Object.Base.Name: group.remove(g) i.Group = group - print i.Group + print(i.Group) #FreeCADGui.ActiveDocument.getObject(obj.Base.Name).Visibility = False return [self.Object.Base] diff --git a/src/Mod/Path/PathScripts/PathDressupDragknife.py b/src/Mod/Path/PathScripts/PathDressupDragknife.py index 47925491b2..34ccee8362 100644 --- a/src/Mod/Path/PathScripts/PathDressupDragknife.py +++ b/src/Mod/Path/PathScripts/PathDressupDragknife.py @@ -22,6 +22,7 @@ # * * # *************************************************************************** +from __future__ import print_function import FreeCAD import FreeCADGui import Path @@ -451,7 +452,7 @@ class ViewProviderDressup: if g.Name == self.Object.Base.Name: group.remove(g) i.Group = group - print i.Group + print(i.Group) #FreeCADGui.ActiveDocument.getObject(obj.Base.Name).Visibility = False return [self.Object.Base] diff --git a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py index 62666c591d..83f8b5fcf8 100644 --- a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py +++ b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py @@ -25,22 +25,17 @@ import FreeCAD import FreeCADGui import Draft import DraftGeomUtils -import DraftGui import Path +import PathScripts.PathLog as PathLog import PathScripts.PathPreferencesPathDressup as PathPreferencesPathDressup import Part import copy import math -import cProfile -import time - -from DraftGui import todo from PathScripts import PathUtils -from PathScripts.PathGeom import * -from PathScripts.PathPreferences import * -from PySide import QtCore, QtGui -from pivy import coin +from PathScripts.PathGeom import PathGeom +from PathScripts.PathPreferences import PathPreferences +from PySide import QtCore """Holding Tags Dressup object and FreeCAD command""" @@ -48,16 +43,18 @@ from pivy import coin def translate(text, context = "PathDressup_HoldingTags", disambig=None): return QtCore.QCoreApplication.translate(context, text, disambig) -debugDressup = False -def debugPrint(msg): - if debugDressup: - print(msg) +LOG_MODULE = 'PathDressupHoldingTags' +#PathLog.setLevel(PathLog.Level.DEBUG, LOG_MODULE) + +if FreeCAD.GuiUp: + from pivy import coin + from PySide import QtGui def debugEdge(edge, prefix, force = False): - pf = edge.valueAt(edge.FirstParameter) - pl = edge.valueAt(edge.LastParameter) - if force or debugDressup: + if force or PathLog.getLevel(LOG_MODULE) == PathLog.Level.DEBUG: + pf = edge.valueAt(edge.FirstParameter) + pl = edge.valueAt(edge.LastParameter) if type(edge.Curve) == Part.Line or type(edge.Curve) == Part.LineSegment: print("%s %s((%.2f, %.2f, %.2f) - (%.2f, %.2f, %.2f))" % (prefix, type(edge.Curve), pf.x, pf.y, pf.z, pl.x, pl.y, pl.z)) else: @@ -65,7 +62,7 @@ def debugEdge(edge, prefix, force = False): print("%s %s((%.2f, %.2f, %.2f) - (%.2f, %.2f, %.2f) - (%.2f, %.2f, %.2f))" % (prefix, type(edge.Curve), pf.x, pf.y, pf.z, pm.x, pm.y, pm.z, pl.x, pl.y, pl.z)) def debugMarker(vector, label, color = None, radius = 0.5): - if debugDressup: + if PathLog.getLevel(LOG_MODULE) == PathLog.Level.DEBUG: obj = FreeCAD.ActiveDocument.addObject("Part::Sphere", label) obj.Label = label obj.Radius = radius @@ -74,7 +71,7 @@ def debugMarker(vector, label, color = None, radius = 0.5): obj.ViewObject.ShapeColor = color def debugCylinder(vector, r, height, label, color = None): - if debugDressup: + if PathLog.getLevel(LOG_MODULE) == PathLog.Level.DEBUG: obj = FreeCAD.ActiveDocument.addObject("Part::Cylinder", label) obj.Label = label obj.Radius = r @@ -85,7 +82,7 @@ def debugCylinder(vector, r, height, label, color = None): obj.ViewObject.ShapeColor = color def debugCone(vector, r1, r2, height, label, color = None): - if debugDressup: + if PathLog.getLevel(LOG_MODULE) == PathLog.Level.DEBUG: obj = FreeCAD.ActiveDocument.addObject("Part::Cone", label) obj.Label = label obj.Radius1 = r1 @@ -135,7 +132,7 @@ class HoldingTagsPreferences: @classmethod def defaultRadius(cls, ifNotSet = 0.0): return PathPreferences.preferences().GetFloat(cls.DefaultHoldingTagRadius, ifNotSet) - + def __init__(self): self.form = FreeCADGui.PySideUic.loadUi(":/preferences/PathDressupHoldingTags.ui") @@ -162,7 +159,7 @@ class HoldingTagsPreferences: class Tag: def __init__(self, x, y, width, height, angle, radius, enabled=True): - debugPrint("Tag(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d)" % (x, y, width, height, angle, radius, enabled)) + PathLog.track("%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d" % (x, y, width, height, angle, radius, enabled)) self.x = x self.y = y self.width = math.fabs(width) @@ -198,7 +195,7 @@ class Tag: self.isSquare = True self.solid = Part.makeCylinder(r1, height) radius = min(min(self.radius, r1), self.height) - debugPrint("Part.makeCone(%f, %f)" % (r1, height)) + PathLog.debug("Part.makeCone(%f, %f)" % (r1, height)) elif self.angle > 0.0 and height > 0.0: # cone rad = math.radians(self.angle) @@ -215,29 +212,31 @@ class Tag: height = r1 * tangens * 1.01 self.actualHeight = height self.r2 = r2 - debugPrint("Part.makeCone(%f, %f, %f)" % (r1, r2, height)) + PathLog.debug("Part.makeCone(%f, %f, %f)" % (r1, r2, height)) self.solid = Part.makeCone(r1, r2, height) else: # degenerated case - no tag - debugPrint("Part.makeSphere(%f / 10000)" % (r1)) + PathLog.debug("Part.makeSphere(%f / 10000)" % (r1)) self.solid = Part.makeSphere(r1 / 10000) if not R == 0: # testing is easier if the solid is not rotated angle = -PathGeom.getAngle(self.originAt(0)) * 180 / math.pi - debugPrint("solid.rotate(%f)" % angle) + PathLog.debug("solid.rotate(%f)" % angle) self.solid.rotate(FreeCAD.Vector(0,0,0), FreeCAD.Vector(0,0,1), angle) - debugPrint("solid.translate(%s)" % self.originAt(z)) - self.solid.translate(self.originAt(z - 0.01 * self.actualHeight)) + orig = self.originAt(z - 0.01 * self.actualHeight) + PathLog.debug("solid.translate(%s)" % orig) + self.solid.translate(orig) + radius = min(self.radius, radius) self.realRadius = radius if radius != 0: - debugPrint("makeFillet(%.4f)" % radius) + PathLog.debug("makeFillet(%.4f)" % radius) self.solid = self.solid.makeFillet(radius, [self.solid.Edges[0]]) def filterIntersections(self, pts, face): if type(face.Surface) == Part.Cone or type(face.Surface) == Part.Cylinder or type(face.Surface) == Part.Toroid: - #print("it's a cone/cylinder, checking z") + PathLog.track("it's a cone/cylinder, checking z") return filter(lambda pt: pt.z >= self.bottom() and pt.z <= self.top(), pts) if type(face.Surface) == Part.Plane: - #print("it's a plane, checking R") + PathLog.track("it's a plane, checking R") c = face.Edges[0].Curve if (type(c) == Part.Circle): return filter(lambda pt: (pt - c.Center).Length <= c.Radius or PathGeom.isRoughly((pt - c.Center).Length, c.Radius), pts) @@ -312,9 +311,9 @@ class MapWireToTag: self.edges = [] self.entry = i if tail: - debugPrint("MapWireToTag(%s - %s)" % (i, tail.valueAt(tail.FirstParameter))) + PathLog.debug("MapWireToTag(%s - %s)" % (i, tail.valueAt(tail.FirstParameter))) else: - debugPrint("MapWireToTag(%s - )" % i) + PathLog.debug("MapWireToTag(%s - )" % i) self.complete = False self.haveProblem = False @@ -342,11 +341,11 @@ class MapWireToTag: def cleanupEdges(self, edges): # want to remove all edges from the wire itself, and all internal struts - #print("+cleanupEdges") - #print(" edges:") + PathLog.track("+cleanupEdges") + PathLog.debug(" edges:") for e in edges: debugEdge(e, ' ') - #print(":") + PathLog.debug(":") self.edgesCleanup = [copy.copy(edges)] # remove any edge that has a point inside the tag solid @@ -413,7 +412,7 @@ class MapWireToTag: return edges def orderAndFlipEdges(self, edges): - #print("entry(%.2f, %.2f, %.2f), exit(%.2f, %.2f, %.2f)" % (self.entry.x, self.entry.y, self.entry.z, self.exit.x, self.exit.y, self.exit.z)) + PathLog.track("entry(%.2f, %.2f, %.2f), exit(%.2f, %.2f, %.2f)" % (self.entry.x, self.entry.y, self.entry.z, self.exit.x, self.exit.y, self.exit.z)) self.edgesOrder = [] outputEdges = [] p0 = self.entry @@ -450,11 +449,11 @@ class MapWireToTag: debugEdge(e, ' ', False) raise ValueError("No connection to %s" % (p0)) elif lastP: - debugPrint("xxxxxx (%.2f, %.2f, %.2f) (%.2f, %.2f, %.2f)" % (p0.x, p0.y, p0.z, lastP.x, lastP.y, lastP.z)) + PathLog.debug("xxxxxx (%.2f, %.2f, %.2f) (%.2f, %.2f, %.2f)" % (p0.x, p0.y, p0.z, lastP.x, lastP.y, lastP.z)) else: - debugPrint("xxxxxx (%.2f, %.2f, %.2f) -" % (p0.x, p0.y, p0.z)) + PathLog.debug("xxxxxx (%.2f, %.2f, %.2f) -" % (p0.x, p0.y, p0.z)) lastP = p0 - #print("-cleanupEdges") + PathLog.track("-") return outputEdges def isStrut(self, edge): @@ -546,14 +545,9 @@ class _RapidEdges: return True return False - def debugPrint(self): - debugPrint('rapid:') - for r in self.rapid: - debugEdge(r, ' ') - class PathData: def __init__(self, obj): - debugPrint("PathData(%s)" % obj.Base.Name) + PathLog.track(obj.Base.Name) self.obj = obj self.wire, rapid = PathGeom.wireForPath(obj.Base.Path) self.rapid = _RapidEdges(rapid) @@ -593,7 +587,7 @@ class PathData: return (edges[0], edges[-1]) def generateTags(self, obj, count, width=None, height=None, angle=None, radius=None, spacing=None): - debugPrint("generateTags(%s, %s, %s, %s, %s)" % (count, width, height, angle, spacing)) + PathLog.track(count, width, height, angle, spacing) #for e in self.base.Edges: # debugMarker(e.Vertexes[0].Point, 'base', (0.0, 1.0, 1.0), 0.2) @@ -613,7 +607,7 @@ class PathData: startIndex = 0 for i in range(0, len(self.base.Edges)): edge = self.base.Edges[i] - debugPrint(' %d: %.2f' % (i, edge.Length)) + PathLog.debug(' %d: %.2f' % (i, edge.Length)) if edge.Length == longestEdge.Length: startIndex = i break @@ -628,10 +622,10 @@ class PathData: minLength = min(2. * W, longestEdge.Length) - debugPrint("length=%.2f shortestEdge=%.2f(%.2f) longestEdge=%.2f(%.2f) minLength=%.2f" % (self.base.Length, shortestEdge.Length, shortestEdge.Length/self.base.Length, longestEdge.Length, longestEdge.Length / self.base.Length, minLength)) - debugPrint(" start: index=%-2d count=%d (length=%.2f, distance=%.2f)" % (startIndex, startCount, startEdge.Length, tagDistance)) - debugPrint(" -> lastTagLength=%.2f)" % lastTagLength) - debugPrint(" -> currentLength=%.2f)" % currentLength) + PathLog.debug("length=%.2f shortestEdge=%.2f(%.2f) longestEdge=%.2f(%.2f) minLength=%.2f" % (self.base.Length, shortestEdge.Length, shortestEdge.Length/self.base.Length, longestEdge.Length, longestEdge.Length / self.base.Length, minLength)) + PathLog.debug(" start: index=%-2d count=%d (length=%.2f, distance=%.2f)" % (startIndex, startCount, startEdge.Length, tagDistance)) + PathLog.debug(" -> lastTagLength=%.2f)" % lastTagLength) + PathLog.debug(" -> currentLength=%.2f)" % currentLength) edgeDict = { startIndex: startCount } @@ -646,7 +640,7 @@ class PathData: for (i, count) in edgeDict.iteritems(): edge = self.base.Edges[i] - debugPrint(" %d: %d" % (i, count)) + PathLog.debug(" %d: %d" % (i, count)) #debugMarker(edge.Vertexes[0].Point, 'base', (1.0, 0.0, 0.0), 0.2) #debugMarker(edge.Vertexes[1].Point, 'base', (0.0, 1.0, 0.0), 0.2) if 0 != count: @@ -665,10 +659,10 @@ class PathData: tagCount += 1 lastTagLength += tagDistance if tagCount > 0: - debugPrint(" index=%d -> count=%d" % (index, tagCount)) + PathLog.debug(" index=%d -> count=%d" % (index, tagCount)) edgeDict[index] = tagCount else: - debugPrint(" skipping=%-2d (%.2f)" % (index, edge.Length)) + PathLog.debug(" skipping=%-2d (%.2f)" % (index, edge.Length)) return (currentLength, lastTagLength) @@ -701,7 +695,7 @@ class PathData: ordered.append(t) # disable all tags that are not on the base wire. for tag in tags: - FreeCAD.Console.PrintMessage("Tag #%d not on base wire - disabling\n" % len(ordered)) + PathLog.notice("Tag #%d not on base wire - disabling\n" % len(ordered)) tag.enabled = False ordered.append(tag) return ordered @@ -756,7 +750,7 @@ class ObjectDressup: return True def createPath(self, obj, pathData, tags): - #print("createPath") + PathLog.track() commands = [] lastEdge = 0 lastTag = 0 @@ -776,7 +770,7 @@ class ObjectDressup: mapper = None while edge or lastEdge < len(pathData.edges): - debugPrint("------- lastEdge = %d/%d.%d/%d" % (lastEdge, lastTag, t, len(tags))) + PathLog.debug("------- lastEdge = %d/%d.%d/%d" % (lastEdge, lastTag, t, len(tags))) if not edge: edge = pathData.edges[lastEdge] debugEdge(edge, "======= new edge: %d/%d" % (lastEdge, len(pathData.edges))) @@ -836,19 +830,19 @@ class ObjectDressup: if tag.enabled: if prev: if prev.solid.common(tag.solid).Faces: - FreeCAD.Console.PrintMessage("Tag #%d intersects with previous tag - disabling\n" % i) - debugPrint("this tag = %d [%s]" % (i, tag.solid.BoundBox)) + PathLog.notice("Tag #%d intersects with previous tag - disabling\n" % i) + PathLog.debug("this tag = %d [%s]" % (i, tag.solid.BoundBox)) tag.enabled = False elif self.pathData.edges: e = self.pathData.edges[0] p0 = e.valueAt(e.FirstParameter) p1 = e.valueAt(e.LastParameter) if tag.solid.isInside(p0, PathGeom.Tolerance, True) or tag.solid.isInside(p1, PathGeom.Tolerance, True): - FreeCAD.Console.PrintMessage("Tag #%d intersects with starting point - disabling\n" % i) + PathLog.notice("Tag #%d intersects with starting point - disabling\n" % i) tag.enabled = False if tag.enabled: prev = tag - debugPrint("previousTag = %d [%s]" % (i, prev)) + PathLog.debug("previousTag = %d [%s]" % (i, prev)) else: disabled.append(i) tags.append(tag) @@ -856,6 +850,7 @@ class ObjectDressup: return (tags, positions, disabled) def execute(self, obj): + #import cProfile #pr = cProfile.Profile() #pr.enable() self.doExecute(obj) @@ -881,7 +876,7 @@ class ObjectDressup: if hasattr(obj, "Positions"): self.tags, positions, disabled = self.createTagsPositionDisabled(obj, obj.Positions, obj.Disabled) if obj.Disabled != disabled: - debugPrint("Updating properties.... %s vs. %s" % (obj.Disabled, disabled)) + PathLog.debug("Updating properties.... %s vs. %s" % (obj.Disabled, disabled)) obj.Positions = positions obj.Disabled = disabled @@ -894,11 +889,11 @@ class ObjectDressup: def processTags(self, obj): tagID = 0 - if debugDressup: + if PathLog.getLevel(LOG_MODULE) == PathLog.Level.DEBUG: for tag in self.tags: tagID += 1 if tag.enabled: - debugPrint("x=%s, y=%s, z=%s" % (tag.x, tag.y, self.pathData.minZ)) + PathLog.debug("x=%s, y=%s, z=%s" % (tag.x, tag.y, self.pathData.minZ)) #debugMarker(FreeCAD.Vector(tag.x, tag.y, self.pathData.minZ), "tag-%02d" % tagID , (1.0, 0.0, 1.0), 0.5) #if tag.angle != 90: # debugCone(tag.originAt(self.pathData.minZ), tag.r1, tag.r2, tag.actualHeight, "tag-%02d" % tagID) @@ -906,15 +901,14 @@ class ObjectDressup: # debugCylinder(tag.originAt(self.pathData.minZ), tag.fullWidth()/2, tag.actualHeight, "tag-%02d" % tagID) obj.Path = self.createPath(obj, self.pathData, self.tags) - #print("execute - done") def setup(self, obj, generate=False): - debugPrint("setup") + PathLog.debug("setup") self.obj = obj try: pathData = PathData(obj) except ValueError: - FreeCAD.Console.PrintError(translate("Cannot insert holding tags for this path - please select a Profile path\n")) + PathLog.error(translate("Cannot insert holding tags for this path - please select a Profile path\n")) return None self.toolRadius = 5 @@ -938,7 +932,7 @@ class ObjectDressup: return self.pathData def setXyEnabled(self, triples): - debugPrint("setXyEnabled") + PathLog.track() if not hasattr(self, 'pathData'): self.setup(self.obj) positions = [] @@ -1038,7 +1032,7 @@ class TaskPanel: self.obj.Proxy.setXyEnabled(tags) def updateTagsView(self): - #print("updateTagsView") + PathLog.track() self.formTags.lwTags.blockSignals(True) self.formTags.lwTags.clear() for i, pos in enumerate(self.obj.Positions): @@ -1066,7 +1060,7 @@ class TaskPanel: self.obj.Proxy.execute(self.obj) self.updateTagsView() - #if debugDressup: + #if PathLog.getLevel(LOG_MODULE) == PathLog.Level.DEBUG: # # this causes a big of an echo and a double click on the spin buttons, don't know why though # FreeCAD.ActiveDocument.recompute() @@ -1359,7 +1353,7 @@ class ViewProviderDressup: self.tags = tags def selectTag(self, index): - #print("selectTag(%s)" % index) + PathLog.track(index) for i, tag in enumerate(self.tags): tag.setSelected(i == index) @@ -1401,14 +1395,14 @@ class CommandPathDressupHoldingTags: # check that the selection contains exactly what we want selection = FreeCADGui.Selection.getSelection() if len(selection) != 1: - FreeCAD.Console.PrintError(translate("Please select one path object\n")) + PathLog.error(translate("Please select one path object\n")) return baseObject = selection[0] if not baseObject.isDerivedFrom("Path::Feature"): - FreeCAD.Console.PrintError(translate("The selected object is not a path\n")) + PathLog.error(translate("The selected object is not a path\n")) return if baseObject.isDerivedFrom("Path::FeatureCompoundPython"): - FreeCAD.Console.PrintError(translate("Please select a Profile object")) + PathLog.error(translate("Please select a Profile object")) return # everything ok! @@ -1430,4 +1424,4 @@ if FreeCAD.GuiUp: # register the FreeCAD command FreeCADGui.addCommand('PathDressup_HoldingTags', CommandPathDressupHoldingTags()) -FreeCAD.Console.PrintLog("Loading PathDressupHoldingTags... done\n") +PathLog.notice("Loading PathDressupHoldingTags... done\n") diff --git a/src/Mod/Path/PathScripts/PathDrilling.py b/src/Mod/Path/PathScripts/PathDrilling.py index 345c9c4e12..14e452378d 100644 --- a/src/Mod/Path/PathScripts/PathDrilling.py +++ b/src/Mod/Path/PathScripts/PathDrilling.py @@ -22,6 +22,7 @@ # * * # *************************************************************************** +from __future__ import print_function import FreeCAD import Path import Part @@ -304,7 +305,7 @@ class ObjectDrilling: else: baselist.append(item) - print baselist + print(baselist) obj.Base = baselist self.execute(obj) diff --git a/src/Mod/Path/PathScripts/PathJob.py b/src/Mod/Path/PathScripts/PathJob.py index d9cb13aaa3..036e927e79 100644 --- a/src/Mod/Path/PathScripts/PathJob.py +++ b/src/Mod/Path/PathScripts/PathJob.py @@ -56,8 +56,13 @@ class ObjectPathJob: obj.addProperty("App::PropertyString", "Description", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property","An optional description for this job")) obj.addProperty("App::PropertyEnumeration", "PostProcessor", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property","Select the Post Processor")) - obj.PostProcessor = PathPreferences.allEnabledPostProcessors(['']) - obj.PostProcessor = PathPreferences.defaultPostProcessor() + obj.PostProcessor = postProcessors = PathPreferences.allEnabledPostProcessors() + defaultPostProcessor = PathPreferences.defaultPostProcessor() + # Check to see if default post processor hasn't been 'lost' (This can happen when Macro dir has changed) + if defaultPostProcessor in postProcessors: + obj.PostProcessor = defaultPostProcessor + else: + obj.PostProcessor = postProcessors[0] obj.addProperty("App::PropertyString", "PostProcessorArgs", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property", "Arguments for the Post Processor (specific to the script)")) obj.PostProcessorArgs = PathPreferences.defaultPostProcessorArgs() obj.addProperty("App::PropertyString", "MachineName", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property","Name of the Machine that will use the CNC program")) diff --git a/src/Mod/Path/PathScripts/PathKurveUtils.py b/src/Mod/Path/PathScripts/PathKurveUtils.py index 34899ddf1e..52fdbe217d 100644 --- a/src/Mod/Path/PathScripts/PathKurveUtils.py +++ b/src/Mod/Path/PathScripts/PathKurveUtils.py @@ -22,10 +22,12 @@ # * * # *************************************************************************** '''PathKurveUtils - functions needed for using libarea (created by Dan Heeks) for making simple CNC profile paths ''' +from __future__ import print_function import Part import math import area from PathScripts import PathUtils +from PathScripts.PathGeom import PathGeom from nc.nc import * import PathScripts.nc.iso from PathScripts.nc.nc import * @@ -71,7 +73,8 @@ def makeAreaCurve(edges, direction, startpt=None, endpt=None): # We first compare the last parameter of the first segment to see if it # matches either end of the second segment. If not, it must need # flipping. - if cleanededges[0].valueAt(cleanededges[0].LastParameter) in [cleanededges[1].valueAt(cleanededges[1].FirstParameter), cleanededges[1].valueAt(cleanededges[1].LastParameter)]: + p0L = cleanededges[0].valueAt(cleanededges[0].LastParameter) + if PathGeom.pointsCoincide(p0L, cleanededges[1].valueAt(cleanededges[1].FirstParameter)) or PathGeom.pointsCoincide(p0L, cleanededges[1].valueAt(cleanededges[1].LastParameter)): edge0 = cleanededges[0] else: edge0 = PathUtils.reverseEdge(cleanededges[0]) @@ -81,8 +84,7 @@ def makeAreaCurve(edges, direction, startpt=None, endpt=None): # Now iterate the rest of the edges matching the last parameter of the # previous segment. for edge in cleanededges[1:]: - - if edge.valueAt(edge.FirstParameter) == edgelist[-1].valueAt(edgelist[-1].LastParameter): + if PathGeom.pointsCoincide(edge.valueAt(edge.FirstParameter), edgelist[-1].valueAt(edgelist[-1].LastParameter)): nextedge = edge else: nextedge = PathUtils.reverseEdge(edge) @@ -141,7 +143,7 @@ def profile(curve, side_of_line, radius=1.0, vertfeed=0.0, horizfeed=0.0, offset output = "" output += "G0 Z" + str(clearance) + "\n" - print "in profile: 151" + print("in profile: 151") offset_curve = area.Curve(curve) if offset_curve.getNumVertices() <= 1: raise Exception, "Sketch has no elements!" @@ -337,10 +339,10 @@ def profile2(curve, direction="on", radius=1.0, vertfeed=0.0, using_area_for_offset = True a = area.Area() a.append(curve) - print "curve, offset: " , str(curve), str(offset) + print("curve, offset: " , str(curve), str(offset)) a.Offset(-offset) for curve in a.getCurves(): - print "result curve: ", curve + print("result curve: ", curve) curve_cw = curve.IsClockwise() if cw != curve_cw: curve.Reverse() diff --git a/src/Mod/Path/PathScripts/PathLog.py b/src/Mod/Path/PathScripts/PathLog.py new file mode 100644 index 0000000000..0ef3ced7ba --- /dev/null +++ b/src/Mod/Path/PathScripts/PathLog.py @@ -0,0 +1,164 @@ +# -*- coding: utf-8 -*- + +# *************************************************************************** +# * * +# * Copyright (c) 2016 sliptonic * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program 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 program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +import FreeCAD +import os +import traceback + +class Level: + """Enumeration of log levels, used for setLevel and getLevel.""" + RESET = -1 + ERROR = 0 + WARNING = 1 + NOTICE = 2 + INFO = 3 + DEBUG = 4 + + _names = { ERROR: 'ERROR', WARNING: 'WARNING', NOTICE: 'NOTICE', INFO: 'INFO', DEBUG: 'DEBUG' } + + @classmethod + def toString(cls, level): + return cls._names.get(level, 'UNKNOWN') + +_defaultLogLevel = Level.NOTICE +_moduleLogLevel = { } +_useConsole = True +_trackModule = { } +_trackAll = False + +def logToConsole(yes): + """(boolean) - if set to True (default behaviour) log messages are printed to the console. Otherwise they are printed to stdout.""" + global _useConsole + _useConsole = yes + +def setLevel(level, module = None): + """(level, module = None) + if no module is specified the default log level is set. + Otherwise the module specific log level is changed (use RESET to clear).""" + global _defaultLogLevel + global _moduleLogLevel + if module: + if level == Level.RESET: + if _moduleLogLevel.get(module, -1) != -1: + del _moduleLogLevel[module] + else: + _moduleLogLevel[module] = level + else: + if level == Level.RESET: + _defaultLogLevel = Level.NOTICE + _moduleLogLevel = { } + else: + _defaultLogLevel = level + +def getLevel(module = None): + """(module = None) - return the global (None) or module specific log level.""" + if module: + return _moduleLogLevel.get(module, _defaultLogLevel) + return _defaultLogLevel + +def _caller(): + """internal function to determine the calling module.""" + file, line, func, text = traceback.extract_stack(limit=3)[0] + return os.path.splitext(os.path.basename(file))[0], line, func + +def _log(level, module_line_func, msg): + """internal function to do the logging""" + module, line, func = module_line_func + if getLevel(module) >= level: + message = "%s.%s: %s" % (module, Level.toString(level), msg) + if _useConsole: + message += "\n" + if level == Level.NOTICE: + FreeCAD.Console.PrintLog(message) + elif level == Level.WARNING: + FreeCAD.Console.PrintWarning(message) + elif level == Level.ERROR: + FreeCAD.Console.PrintError(message) + else: + FreeCAD.Console.PrintMessage(message) + else: + print(message) + return message + return None + +def debug(msg): + """(message)""" + return _log(Level.DEBUG, _caller(), msg) +def info(msg): + """(message)""" + return _log(Level.INFO, _caller(), msg) +def notice(msg): + """(message)""" + return _log(Level.NOTICE, _caller(), msg) +def warning(msg): + """(message)""" + return _log(Level.WARNING, _caller(), msg) +def error(msg): + """(message)""" + return _log(Level.ERROR, _caller(), msg) + +def trackAllModules(boolean): + """(boolean) - if True all modules will be tracked, otherwise tracking is up to the module setting.""" + global _trackAll + _trackAll = boolean + +def untrackAllModules(): + """In addition to stop tracking all modules it also clears the tracking flag for all individual modules.""" + global _trackAll + global _trackModule + _trackAll = False + _trackModule = { } + +def trackModule(module = None): + """(module = None) - start tracking given module, current module if not set.""" + global _trackModule + if module: + _trackModule[module] = True + else: + mod, line, func = _caller() + _trackModule[mod] = True + +def untrackModule(module = None): + """(module = None) - stop tracking given module, current module if not set.""" + global _trackModule + if module and _trackModule.get(module, None): + del _trackModule[module] + elif not module: + mod, line, func = _caller() + if _trackModule.get(mod, None): + del _trackModule[mod] + +def track(*args): + """(....) - call with arguments of current function you want logged if tracking is enabled.""" + module, line, func = _caller() + if _trackAll or _trackModule.get(module, None): + message = "%s(%d).%s(%s)" % (module, line, func, ', '.join([str(arg) for arg in args])) + if _useConsole: + FreeCAD.Console.PrintMessage(message + "\n") + else: + print(message) + return message + return None + + diff --git a/src/Mod/Path/PathScripts/PathMillFace.py b/src/Mod/Path/PathScripts/PathMillFace.py index 13747fe432..c9c2c1e511 100644 --- a/src/Mod/Path/PathScripts/PathMillFace.py +++ b/src/Mod/Path/PathScripts/PathMillFace.py @@ -22,6 +22,7 @@ # * * # *************************************************************************** +from __future__ import print_function import FreeCAD import Path from PySide import QtCore, QtGui @@ -211,7 +212,7 @@ class ObjectFace: # To reload this from FreeCAD, use: import PathScripts.PathFace; reload(PathScripts.PathFace) def execute(self, obj): - print "in execute" + print("in execute") if not obj.Active: path = Path.Path("(inactive operation)") @@ -260,7 +261,7 @@ class ObjectFace: if isinstance (shape, Part.Face): faces.append(shape) else: - print ('falling out') + print('falling out') return planeshape = Part.makeCompound(faces) diff --git a/src/Mod/Path/PathScripts/PathPocket.py b/src/Mod/Path/PathScripts/PathPocket.py index 441a72790e..4d8c4fae8b 100644 --- a/src/Mod/Path/PathScripts/PathPocket.py +++ b/src/Mod/Path/PathScripts/PathPocket.py @@ -154,7 +154,7 @@ class ObjectPocket: else: baselist.append(item) obj.Base = baselist - print "this base is: " + str(baselist) + print("this base is: " + str(baselist)) self.execute(obj) def getStock(self, obj): @@ -316,7 +316,7 @@ class ObjectPocket: # Otherwise, straight plunge... Don't want to, but sometimes you might not have a choice. # FIXME: At least not with the lazy ramp programming above... else: - print "WARNING: Straight-plunging... probably not good, but we didn't find a place to helix or ramp" + print("WARNING: Straight-plunging... probably not good, but we didn't find a place to helix or ramp") startPoint = edge.Vertexes[0].Point output += "G0 Z" + fmt(obj.ClearanceHeight.Value) + "F " + PathUtils.fmt(self.vertRapid) + "\n" output += "G0 X" + fmt(startPoint.x) + " Y" + fmt(startPoint.y) +\ diff --git a/src/Mod/Path/PathScripts/PathPost.py b/src/Mod/Path/PathScripts/PathPost.py index 1be6689bcc..38b2c3f683 100644 --- a/src/Mod/Path/PathScripts/PathPost.py +++ b/src/Mod/Path/PathScripts/PathPost.py @@ -22,6 +22,7 @@ # * * # *************************************************************************** ''' Post Process command that will make use of the Output File and Post Processor entries in PathJob ''' +from __future__ import print_function import FreeCAD import FreeCADGui from PySide import QtCore, QtGui @@ -190,7 +191,7 @@ class CommandPathPost: FreeCADGui.addModule("PathScripts.PathPost") # select the Path Job that you want to post output from selected = FreeCADGui.Selection.getCompleteSelection() - print "in activated %s" %(selected) + print("in activated %s" %(selected)) # try to find the job, if it's not directly selected ... jobs = set() diff --git a/src/Mod/Path/PathScripts/PathPostProcessor.py b/src/Mod/Path/PathScripts/PathPostProcessor.py index 618123fd30..68675f54dc 100644 --- a/src/Mod/Path/PathScripts/PathPostProcessor.py +++ b/src/Mod/Path/PathScripts/PathPostProcessor.py @@ -35,12 +35,12 @@ class PostProcessor: def load(cls, processor): postname = processor + "_post" - exec "import %s as current_post" % postname + exec("import %s as current_post" % postname) # make sure the script is reloaded if it was previously loaded # should the script have been imported for the first time above # then the initialization code of the script gets executed twice # resulting in 2 load messages if the script outputs one of those. - exec "reload(%s)" % 'current_post' + exec("reload(%s)" % 'current_post') instance = PostProcessor(current_post) instance.units = None diff --git a/src/Mod/Path/PathScripts/PathProfileEdges.py b/src/Mod/Path/PathScripts/PathProfileEdges.py index 213bfaacdd..2abadf38ff 100644 --- a/src/Mod/Path/PathScripts/PathProfileEdges.py +++ b/src/Mod/Path/PathScripts/PathProfileEdges.py @@ -165,8 +165,8 @@ class ObjectProfile: curve = PathKurveUtils.makeAreaCurve(edgelist, obj.Direction, startpoint, endpoint) '''The following line uses a profile function written for use with FreeCAD. It's clean but incomplete. It doesn't handle -print "x = " + str(point.x) -print "y - " + str(point.y) +print("x = " + str(point.x)) +print("y - " + str(point.y)) holding tags start location CRC diff --git a/src/Mod/Path/PathScripts/PathSanity.py b/src/Mod/Path/PathScripts/PathSanity.py index da0027c37a..e6d3ac2bfc 100644 --- a/src/Mod/Path/PathScripts/PathSanity.py +++ b/src/Mod/Path/PathScripts/PathSanity.py @@ -25,6 +25,7 @@ Path projects. Ideally, the user could execute these utilities from an icon to make sure tools are selected and configured and defaults have been revised''' +from __future__ import print_function from PySide import QtCore, QtGui import FreeCAD import FreeCADGui @@ -50,7 +51,7 @@ def review(obj): FreeCAD.Console.PrintWarning(translate("Path_Sanity", "It appears the machine limits haven't been set. Not able to check path extents.\n")) for item in obj.Group: - print "Checking: " + item.Label + print("Checking: " + item.Label) if item.Name[:2] == "TC": toolcontrolcount += 1 if item.ToolNumber == 0: diff --git a/src/Mod/Path/PathScripts/PathSurface.py b/src/Mod/Path/PathScripts/PathSurface.py index 4dd334298c..d38fdc05b2 100644 --- a/src/Mod/Path/PathScripts/PathSurface.py +++ b/src/Mod/Path/PathScripts/PathSurface.py @@ -22,6 +22,7 @@ # * * # *************************************************************************** +from __future__ import print_function import FreeCAD import Path from PathScripts import PathUtils @@ -145,7 +146,7 @@ class ObjectSurface: str(fmt(p.x)) + " Y" + str(fmt(p.y)) + \ " Z" + str(fmt(zheight)) + "\n" loopstring += "(loop end)" + "\n" - print " loop ", nloop, " with ", len(loop), " points" + print(" loop ", nloop, " with ", len(loop), " points") nloop = nloop + 1 waterlinestring += loopstring waterlinestring += "(waterline end)" + "\n" @@ -174,7 +175,7 @@ class ObjectSurface: # (see c++ code) all_loops = [] for zh in zheights: - print "calculating Waterline at z= ", zh + print("calculating Waterline at z= ", zh) wl.reset() wl.setZ(zh) # height for this waterline wl.run() @@ -184,10 +185,10 @@ class ObjectSurface: n = 0 output = "" for loops in all_loops: # at each z-height, we may get many loops - print " %d/%d:" % (n, len(all_loops)) + print(" %d/%d:" % (n, len(all_loops))) output += drawLoops(loops) n = n + 1 - print "(" + str(calctime) + ")" + print("(" + str(calctime) + ")") return output def _dropcutter(self, obj, s, bb): @@ -231,11 +232,11 @@ class ObjectSurface: t_before = time.time() pdc.run() t_after = time.time() - print "calculation took ", t_after - t_before, " s" + print("calculation took ", t_after - t_before, " s") # retrieve the points clp = pdc.getCLPoints() - print "points received: " + str(len(clp)) + print("points received: " + str(len(clp))) # generate the path commands output = "" @@ -296,7 +297,7 @@ class ObjectSurface: mesh = parentJob.Base if mesh is None: return - print "base object: " + mesh.Name + print("base object: " + mesh.Name) @@ -499,13 +500,13 @@ class TaskPanel: # get type of object if sel.TypeId.startswith('Mesh'): # it is a mesh already - print 'was already mesh' + print('was already mesh') elif sel.TypeId.startswith('Part') and \ (sel.Shape.BoundBox.XLength > 0) and \ (sel.Shape.BoundBox.YLength > 0) and \ (sel.Shape.BoundBox.ZLength > 0): - print 'this is a solid Part object' + print('this is a solid Part object') else: FreeCAD.Console.PrintError( diff --git a/src/Mod/Path/PathScripts/PathToolLibraryManager.py b/src/Mod/Path/PathScripts/PathToolLibraryManager.py index a77820cf72..d84797137a 100644 --- a/src/Mod/Path/PathScripts/PathToolLibraryManager.py +++ b/src/Mod/Path/PathScripts/PathToolLibraryManager.py @@ -22,6 +22,7 @@ # * * # *************************************************************************** +from __future__ import print_function import FreeCAD import xml.sax import FreeCADGui @@ -254,8 +255,8 @@ class ToolLibraryManager(): if listname == "
": self.saveMainLibrary(tt) return True - except Exception, e: - print "could not parse file", e + except Exception as e: + print("could not parse file", e) def write(self, filename, listname): "exports the tooltable to a file" @@ -266,14 +267,14 @@ class ToolLibraryManager(): file.write('\n') file.write(tt.Content) file.close() - print "Written ", unicode(filename[0]) + print("Written ", unicode(filename[0])) - except Exception, e: - print "Could not write file:", e + except Exception as e: + print("Could not write file:", e) def addnew(self, listname, tool, position = None): "adds a new tool at the end of the table" - print listname, tool, position + print(listname, tool, position) tt = self._findList(listname) if position is None: tt.addTools(tool) @@ -413,7 +414,7 @@ class EditorPanel(): def addTool(self): t = Path.Tool() - print ("adding a new tool") + print("adding a new tool") editform = FreeCADGui.PySideUic.loadUi(":/panels/ToolEdit.ui") r = editform.exec_() diff --git a/src/Mod/Path/PathScripts/PathUtils.py b/src/Mod/Path/PathScripts/PathUtils.py index 4e75ef0898..d30b1f784a 100644 --- a/src/Mod/Path/PathScripts/PathUtils.py +++ b/src/Mod/Path/PathScripts/PathUtils.py @@ -620,7 +620,7 @@ def addToJob(obj, jobname = None): if r is False: return None else: - print form.cboProject.currentText() + print(form.cboProject.currentText()) job = [i for i in jobs if i.Name == form.cboProject.currentText()][0] g = job.Group @@ -690,7 +690,7 @@ def arc(cx, cy, sx, sy, ex, ey, horizFeed=0, ez=None, ccw=False): eps = 0.01 if (math.sqrt((cx - sx)**2 + (cy - sy)**2) - math.sqrt((cx - ex)**2 + (cy - ey)**2)) >= eps: - print "ERROR: Illegal arc: Start and end radii not equal" + print("ERROR: Illegal arc: Start and end radii not equal") return "" retstr = "" diff --git a/src/Mod/Path/PathScripts/TooltableEditor.py b/src/Mod/Path/PathScripts/TooltableEditor.py index 84930c3d16..f55d275ae6 100644 --- a/src/Mod/Path/PathScripts/TooltableEditor.py +++ b/src/Mod/Path/PathScripts/TooltableEditor.py @@ -70,8 +70,8 @@ class FreeCADTooltableHandler(xml.sax.ContentHandler): self.tool.Name = str(attributes["name"]) self.tool.ToolType = str(attributes["type"]) self.tool.Material = str(attributes["mat"]) - # for some reason without the following line I get an error - print attributes["diameter"] + # for some reason without the following line I get an error + print(attributes["diameter"]) self.tool.Diameter = float(attributes["diameter"]) self.tool.LengthOffset = float(attributes["length"]) self.tool.FlatRadius = float(attributes["flat"]) @@ -122,8 +122,8 @@ class HeeksTooltableHandler(xml.sax.ContentHandler): self.tool.Material = "HighSpeedSteel" elif m == "1": self.tool.Material = "Carbide" - # for some reason without the following line I get an error - print attributes["diameter"] + # for some reason without the following line I get an error + print(attributes["diameter"]) self.tool.Diameter = float(attributes["diameter"]) self.tool.LengthOffset = float(attributes["tool_length_offset"]) self.tool.FlatRadius = float(attributes["flat_radius"]) @@ -654,7 +654,7 @@ class Editor(QtGui.QDialog): def addnew(self): "adds a new tool at the end of the table" tool = Path.Tool() - print self.NameField + print(self.NameField) if self.NameField.text(): tool.Name = str(self.NameField.text()) tool.ToolType = self.getType(self.TypeField.currentIndex()) @@ -695,8 +695,8 @@ class Editor(QtGui.QDialog): fil.write('\n') fil.write(self.tooltable.Content) fil.close() - print "Written ", filename[0] - + print("Written ",filename[0]) + def moveup(self): "moves a tool to a lower number, if possible" if self.number: diff --git a/src/Mod/Path/PathScripts/centroid_post.py b/src/Mod/Path/PathScripts/centroid_post.py index dbae475d90..ce42dc60bb 100644 --- a/src/Mod/Path/PathScripts/centroid_post.py +++ b/src/Mod/Path/PathScripts/centroid_post.py @@ -21,6 +21,7 @@ #* USA * #* * #*************************************************************************** +from __future__ import print_function TOOLTIP=''' example post for Centroid CNC mill''' import FreeCAD @@ -73,7 +74,7 @@ def export(selection,filename,argstring): params = ['X','Y','Z','A','B','I','J','F','H','S','T','Q','R','L'] #Using XY plane most of the time so skipping K for obj in selection: if not hasattr(obj,"Path"): - print "the object " + obj.Name + " is not a path. Please select only path and Compounds." + print("the object " + obj.Name + " is not a path. Please select only path and Compounds.") return myMachine = None for pathobj in selection: @@ -85,7 +86,7 @@ def export(selection,filename,argstring): else: UNITS = "G20" if myMachine is None: - print "No machine found in this selection" + print("No machine found in this selection") gcode ='' gcode+= HEADER % (FreeCAD.ActiveDocument.FileName) diff --git a/src/Mod/Path/PathScripts/dumper_post.py b/src/Mod/Path/PathScripts/dumper_post.py index 6a661b1b7d..f5c7f3ef98 100644 --- a/src/Mod/Path/PathScripts/dumper_post.py +++ b/src/Mod/Path/PathScripts/dumper_post.py @@ -20,7 +20,7 @@ # * USA * # * * # ***************************************************************************/ - +from __future__ import print_function TOOLTIP=''' Dumper is an extremely simple postprocessor file for the Path workbench. It is used @@ -52,9 +52,9 @@ def export(objectslist, filename,argstring): for obj in objectslist: if not hasattr(obj, "Path"): - print "the object " + obj.Name + " is not a path. Please select only path and Compounds." + print("the object " + obj.Name + " is not a path. Please select only path and Compounds.") return - print "postprocessing..." + print("postprocessing...") output += parse(obj) if SHOW_EDITOR: @@ -68,7 +68,7 @@ def export(objectslist, filename,argstring): else: final = output - print "done postprocessing." + print("done postprocessing.") def parse(pathobj): @@ -90,4 +90,4 @@ def parse(pathobj): out += str(c) + "\n" return out -print __name__ + " gcode postprocessor loaded." +print(__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/dynapath_post.py b/src/Mod/Path/PathScripts/dynapath_post.py index 0571325cec..10f6ad29c1 100644 --- a/src/Mod/Path/PathScripts/dynapath_post.py +++ b/src/Mod/Path/PathScripts/dynapath_post.py @@ -24,7 +24,7 @@ #* (c) Linden (Linden@aktfast.net) 2016 * #* * #***************************************************************************/ - +from __future__ import print_function TOOLTIP=''' This is a postprocessor file for the Path workbench. It is used to @@ -114,10 +114,10 @@ def export(objectslist,filename,argstring): global UNITS for obj in objectslist: if not hasattr(obj,"Path"): - print "the object " + obj.Name + " is not a path. Please select only path and Compounds." + print("the object " + obj.Name + " is not a path. Please select only path and Compounds.") return - print "postprocessing..." + print("postprocessing...") gcode = "" #Find the machine. @@ -132,7 +132,7 @@ def export(objectslist,filename,argstring): else: UNITS = "G20" if myMachine is None: - print "No machine found in this selection" + print("No machine found in this selection") # write header if OUTPUT_HEADER: @@ -177,7 +177,7 @@ def export(objectslist,filename,argstring): else: final = gcode - print "done postprocessing." + print("done postprocessing.") gfile = pythonopen(filename,"wb") gfile.write(gcode) @@ -259,5 +259,5 @@ def parse(pathobj): return out -print __name__ + " gcode postprocessor loaded." +print(__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/example_post.py b/src/Mod/Path/PathScripts/example_post.py index fe1516decf..96f139ac45 100644 --- a/src/Mod/Path/PathScripts/example_post.py +++ b/src/Mod/Path/PathScripts/example_post.py @@ -20,7 +20,7 @@ # * USA * # * * # ***************************************************************************/ - +from __future__ import print_function TOOLTIP=''' This is an example postprocessor file for the Path workbench. It is used @@ -42,11 +42,11 @@ if open.__module__ == '__builtin__': def export(objectslist, filename,argstring): "called when freecad exports a list of objects" if len(objectslist) > 1: - print "This script is unable to write more than one Path object" + print("This script is unable to write more than one Path object") return obj = objectslist[0] if not hasattr(obj, "Path"): - print "the given object is not a path" + print("the given object is not a path") gcode = obj.Path.toGCode() gcode = parse(gcode) gfile = pythonopen(filename, "wb") @@ -56,7 +56,7 @@ def export(objectslist, filename,argstring): def parse(inputstring): "parse(inputstring): returns a parsed output string" - print "postprocessing..." + print("postprocessing...") output = "" @@ -95,7 +95,7 @@ def parse(inputstring): output += "N" + str(linenr + 30) + " G17 G80 G40 G90\n" output += "N" + str(linenr + 40) + " M99\n" - print "done postprocessing." + print("done postprocessing.") return output -print __name__ + " gcode postprocessor loaded." +print(__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/example_pre.py b/src/Mod/Path/PathScripts/example_pre.py index fbe43ec99a..0a90cf3af2 100644 --- a/src/Mod/Path/PathScripts/example_pre.py +++ b/src/Mod/Path/PathScripts/example_pre.py @@ -60,7 +60,7 @@ def insert(filename,docname): def parse(inputstring): "parse(inputstring): returns a parsed output string" - print "preprocessing..." + print("preprocessing...") # split the input by line lines = inputstring.split("\n") @@ -93,9 +93,9 @@ def parse(inputstring): # no G or M command: we repeat the last one output += lastcommand + " " + l + "\n" - print "done preprocessing." + print("done preprocessing.") return output -print __name__ + " gcode preprocessor loaded." +print(__name__ + " gcode preprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/generic_post.py b/src/Mod/Path/PathScripts/generic_post.py index a98c40a036..92786c491b 100644 --- a/src/Mod/Path/PathScripts/generic_post.py +++ b/src/Mod/Path/PathScripts/generic_post.py @@ -22,6 +22,7 @@ #* * #*************************************************************************** +from __future__ import print_function TOOLTIP='''Post processor for Maho M 600E mill Machines with Philips or Heidenhain control should be very easy to adapt. @@ -285,7 +286,7 @@ def export(selection,filename,argstring): modalParamsDict[mp] = None for obj in selection: if not hasattr(obj,"Path"): - print "the object " + obj.Name + " is not a path. Please select only path and Compounds." + print("the object " + obj.Name + " is not a path. Please select only path and Compounds.") return myMachine = None for pathobj in selection: @@ -297,7 +298,7 @@ def export(selection,filename,argstring): else: UNITS = "G20" if myMachine is None: - print "No machine found in this selection" + print("No machine found in this selection") gcode ='' gcode+= mkHeader(selection) diff --git a/src/Mod/Path/PathScripts/linuxcnc_post.py b/src/Mod/Path/PathScripts/linuxcnc_post.py index ecb32bee4f..b8b5f73a48 100644 --- a/src/Mod/Path/PathScripts/linuxcnc_post.py +++ b/src/Mod/Path/PathScripts/linuxcnc_post.py @@ -20,7 +20,7 @@ # * USA * # * * # ***************************************************************************/ - +from __future__ import print_function TOOLTIP=''' This is a postprocessor file for the Path workbench. It is used to @@ -118,10 +118,10 @@ def export(objectslist, filename, argstring): global UNITS for obj in objectslist: if not hasattr(obj, "Path"): - print "the object " + obj.Name + " is not a path. Please select only path and Compounds." + print("the object " + obj.Name + " is not a path. Please select only path and Compounds.") return - print "postprocessing..." + print("postprocessing...") gcode = "" # Find the machine. @@ -137,7 +137,7 @@ def export(objectslist, filename, argstring): else: UNITS = "G20" if myMachine is None: - print "No machine found in this selection" + print("No machine found in this selection") # write header if OUTPUT_HEADER: @@ -186,7 +186,7 @@ def export(objectslist, filename, argstring): else: final = gcode - print "done postprocessing." + print("done postprocessing.") if not filename == '-': gfile = pythonopen(filename, "wb") @@ -279,4 +279,4 @@ def parse(pathobj): return out -print __name__ + " gcode postprocessor loaded." +print(__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/opensbp_post.py b/src/Mod/Path/PathScripts/opensbp_post.py index 4a20a86550..fbef1fc0d4 100644 --- a/src/Mod/Path/PathScripts/opensbp_post.py +++ b/src/Mod/Path/PathScripts/opensbp_post.py @@ -1,3 +1,4 @@ +from __future__ import print_function import datetime from PathScripts import PostUtils @@ -81,14 +82,14 @@ def export(objectslist, filename, argstring): if not hasattr(obj, "Path"): s = "the object " + obj.Name s += " is not a path. Please select only path and Compounds." - print s + print(s) return CurrentState = { 'X': 0, 'Y': 0, 'Z': 0, 'F': 0, 'S': 0, 'JSXY': 0, 'JSZ': 0, 'MSXY': 0, 'MSZ': 0 } - print "postprocessing..." + print("postprocessing...") gcode = "" # write header @@ -136,7 +137,7 @@ def export(objectslist, filename, argstring): else: final = gcode - print "done postprocessing." + print("done postprocessing.") # Write the output gfile = pythonopen(filename, "wb") @@ -216,11 +217,11 @@ def move(command): txt += "," + format(command.Parameters["Z"], '.4f') txt += "\n" elif axis == "": - print "warning: skipping duplicate move." + print("warning: skipping duplicate move.") else: - print CurrentState - print command - print "I don't know how to handle '{}' for a move.".format(axis) + print(CurrentState) + print(command) + print("I don't know how to handle '{}' for a move.".format(axis)) return txt @@ -255,7 +256,7 @@ def tool_change(command): def comment(command): - print "a comment" + print("a comment") return @@ -314,8 +315,8 @@ def parse(pathobj): if c.Parameters: CurrentState.update(c.Parameters) else: - print "I don't know what the hell the command: ", - print command + " means. Maybe I should support it." + print("I don't know what the hell the command: ",end='') + print(command + " means. Maybe I should support it.") return output @@ -323,6 +324,6 @@ def linenumber(): return "" -print __name__ + " gcode postprocessor loaded." +print(__name__ + " gcode postprocessor loaded.") # eof diff --git a/src/Mod/Path/PathScripts/opensbp_pre.py b/src/Mod/Path/PathScripts/opensbp_pre.py index 714d5bc66a..00c3b17218 100644 --- a/src/Mod/Path/PathScripts/opensbp_pre.py +++ b/src/Mod/Path/PathScripts/opensbp_pre.py @@ -46,6 +46,7 @@ TODO Many other OpenSBP commands not handled ''' +from __future__ import print_function import FreeCAD import os, Path @@ -81,7 +82,7 @@ def insert(filename,docname): def parse(inputstring): "parse(inputstring): returns a list of parsed output string" - print "preprocessing..." + print("preprocessing...") # split the input by line lines = inputstring.split("\n") return_output = [] @@ -182,7 +183,7 @@ def parse(inputstring): if words[0] in ["CG"]: #Gcode circle/arc if words[1] != "": # diameter mode - print "diameter mode not supported" + print("diameter mode not supported") continue else: @@ -201,9 +202,9 @@ def parse(inputstring): #Make sure all appended paths have at least one move command. if any (x in output for x in movecommand): return_output.append(output) - print "done preprocessing." + print("done preprocessing.") return return_output -print __name__ + " gcode preprocessor loaded." +print(__name__ + " gcode preprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/rml_post.py b/src/Mod/Path/PathScripts/rml_post.py index 3460f9d4b5..edd9835d59 100644 --- a/src/Mod/Path/PathScripts/rml_post.py +++ b/src/Mod/Path/PathScripts/rml_post.py @@ -135,15 +135,15 @@ def xyarc(args, state): steps = 64 # TODO: specify max error instead points = arc.discretize(steps) # TODO: consider direction - #print 'p = Part.ArcOfCircle(Part.Circle(FreeCAD.Vector(%f, %f), FreeCAD.Vector(0, 0, 1), %f), %f, %f)' % (center.x, center.y, radius, p0, p1) + #print('p = Part.ArcOfCircle(Part.Circle(FreeCAD.Vector(%f, %f), FreeCAD.Vector(0, 0, 1), %f), %f, %f)' % (center.x, center.y, radius, p0, p1)) for p in points: - #print 'p', p.x, p.y + #print('p', p.x, p.y) c += feed(p.x, p.y, state['Z'], state) return c def speed(xy=None, z=None, state={}): c = [] - print xy, z, state + print(xy, z, state) if xy is not None: xy = float(xy) if xy > 0.0 and xy != state['XYspeed']: @@ -235,7 +235,7 @@ def parse(inputstring): continue parsed = PostUtils.stringsplit(line) command = parsed['command'] - print 'cmd', line + print('cmd', line) try: if command: code = convertgcode(command, parsed, state) @@ -243,8 +243,8 @@ def parse(inputstring): code = [ code ] if len(code) and code[0]: output += code - except NotImplementedError, e: - print e + except NotImplementedError as e: + print(e) # footer output += motoroff() @@ -253,5 +253,5 @@ def parse(inputstring): return '\n'.join(output) -print __name__ + " gcode postprocessor loaded." +print (__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/slic3r_pre.py b/src/Mod/Path/PathScripts/slic3r_pre.py index 2e25659fb1..004fb5aa41 100644 --- a/src/Mod/Path/PathScripts/slic3r_pre.py +++ b/src/Mod/Path/PathScripts/slic3r_pre.py @@ -55,7 +55,7 @@ def insert(filename,docname): def parse(inputstring): "parse(inputstring): returns a parsed output string" - print "preprocessing..." + print("preprocessing...") # split the input by line lines = inputstring.split("\n") @@ -89,9 +89,9 @@ def parse(inputstring): # no G or M command: we repeat the last one output += lastcommand + " " + l + "\n" - print "done preprocessing." + print("done preprocessing.") return output -print __name__ + " gcode preprocessor loaded." +print (__name__ + " gcode preprocessor loaded.") diff --git a/src/Mod/Path/PathTests/PathTestUtils.py b/src/Mod/Path/PathTests/PathTestUtils.py index 518eeb90cb..6cfb35f982 100644 --- a/src/Mod/Path/PathTests/PathTestUtils.py +++ b/src/Mod/Path/PathTests/PathTestUtils.py @@ -45,7 +45,8 @@ class PathTestBase(unittest.TestCase): def assertLine(self, edge, pt1, pt2): """Verify that edge is a line from pt1 to pt2.""" - self.assertIs(type(edge.Curve), Part.Line) + # Depending on the setting of LineOld .... + self.assertTrue(type(edge.Curve) is Part.Line or type(edge.Curve) is Part.LineSegment) self.assertCoincide(edge.valueAt(edge.FirstParameter), pt1) self.assertCoincide(edge.valueAt(edge.LastParameter), pt2) diff --git a/src/Mod/Path/PathTests/TestPathDressupHoldingTags.py b/src/Mod/Path/PathTests/TestPathDressupHoldingTags.py index 2d74688da6..f511124a4e 100644 --- a/src/Mod/Path/PathTests/TestPathDressupHoldingTags.py +++ b/src/Mod/Path/PathTests/TestPathDressupHoldingTags.py @@ -37,45 +37,41 @@ class TestHoldingTags(PathTestBase): """Unit tests for the HoldingTags dressup.""" def test00(self): - """Check Tag origin, serialization and de-serialization.""" + """Check Tag origin.""" tag = Tag(77, 13, 4, 5, 90, True) self.assertCoincide(tag.originAt(3), Vector(77, 13, 3)) - s = tag.toString() - tagCopy = Tag.FromString(s) - self.assertEqual(tag.x, tagCopy.x) - self.assertEqual(tag.y, tagCopy.y) - self.assertEqual(tag.height, tagCopy.height) - self.assertEqual(tag.width, tagCopy.width) - self.assertEqual(tag.enabled, tagCopy.enabled) def test01(self): """Verify solid for a 90 degree tag is a cylinder.""" - tag = Tag(100, 200, 4, 5, 90, True) + tag = Tag(100, 200, 4, 5, 90, 0, True) tag.createSolidsAt(17, 0) self.assertIsNotNone(tag.solid) - self.assertCylinderAt(tag.solid, Vector(100, 200, 17), 2, 5) + self.assertCylinderAt(tag.solid, Vector(100, 200, 17 - 5 * 0.01), 2, 5 * 1.01) def test02(self): """Verify trapezoidal tag has a cone shape with a lid.""" - tag = Tag(0, 0, 18, 5, 45, True) + tag = Tag(0, 0, 18, 5, 45, 0, True) tag.createSolidsAt(0, 0) self.assertIsNotNone(tag.solid) - self.assertConeAt(tag.solid, Vector(0,0,0), 9, 4, 5) + self.assertConeAt(tag.solid, Vector(0,0,-0.05), 9, 3.95, 5.05) def test03(self): """Verify pointy cone shape of tag with pointy end if width, angle and height match up.""" - tag = Tag(0, 0, 10, 5, 45, True) + tag = Tag(0, 0, 10, 5, 45, 0, True) tag.createSolidsAt(0, 0) self.assertIsNotNone(tag.solid) - self.assertConeAt(tag.solid, Vector(0,0,0), 5, 0, 5) + h = 5 * 1.01 + self.assertConeAt(tag.solid, Vector(0,0,-h * 0.01), 5, 0, h) def test04(self): """Verify height adjustment if tag isn't wide eough for angle.""" - tag = Tag(0, 0, 5, 17, 60, True) + tag = Tag(0, 0, 5, 17, 60, 0, True) tag.createSolidsAt(0, 0) self.assertIsNotNone(tag.solid) - self.assertConeAt(tag.solid, Vector(0,0,0), 2.5, 0, 2.5 * math.tan((60/180.0)*math.pi)) + h = 2.5 * math.tan((60/180.0)*math.pi) * 1.01 + print(h) + self.assertConeAt(tag.solid, Vector(0,0,-h * 0.01), 2.5, 0, h) diff --git a/src/Mod/Path/PathTests/TestPathLog.py b/src/Mod/Path/PathTests/TestPathLog.py new file mode 100644 index 0000000000..f9b1c81bb5 --- /dev/null +++ b/src/Mod/Path/PathTests/TestPathLog.py @@ -0,0 +1,195 @@ +# -*- coding: utf-8 -*- + +# *************************************************************************** +# * * +# * Copyright (c) 2016 sliptonic * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program 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 program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +import PathScripts.PathLog as PathLog +import unittest + +class TestPathLog(unittest.TestCase): + """Some basic tests for the logging framework.""" + + MODULE = 'TestPathLog' # file name without extension + + def setUp(self): + PathLog.setLevel(PathLog.Level.RESET) + PathLog.untrackAllModules() + + def callerFile(self): + return PathLog._caller()[0] + def callerLine(self): + return PathLog._caller()[1] + def callerFunc(self): + return PathLog._caller()[2] + + def test00(self): + """Check for proper module extraction.""" + self.assertEqual(self.callerFile(), self.MODULE) + + def test01(self): + """Check for proper function extraction.""" + self.assertEqual(self.callerFunc(), 'test01') + + def test10(self): + """Verify default log levels is NOTICE.""" + self.assertEqual(PathLog.getLevel(), PathLog.Level.NOTICE) + self.assertEqual(PathLog.getLevel(self.MODULE), PathLog.Level.NOTICE) + + def test11(self): + """Verify setting global log level.""" + PathLog.setLevel(PathLog.Level.DEBUG) + + self.assertEqual(PathLog.getLevel(), PathLog.Level.DEBUG) + self.assertEqual(PathLog.getLevel(self.MODULE), PathLog.Level.DEBUG) + + def test12(self): + """Verify setting module log level.""" + PathLog.setLevel(PathLog.Level.DEBUG, self.MODULE) + + self.assertEqual(PathLog.getLevel(), PathLog.Level.NOTICE) + self.assertEqual(PathLog.getLevel(self.MODULE), PathLog.Level.DEBUG) + + def test13(self): + """Verify setting other modul's log level doesn't change this one's.""" + # if this test fails then most likely the global RESET is broken + PathLog.setLevel(PathLog.Level.DEBUG, 'SomeOtherModule') + + self.assertEqual(PathLog.getLevel(), PathLog.Level.NOTICE) + self.assertEqual(PathLog.getLevel(self.MODULE), PathLog.Level.NOTICE) + + def test14(self): + """Verify resetting log level for module falls back to global level.""" + PathLog.setLevel(PathLog.Level.DEBUG, self.MODULE) + self.assertEqual(PathLog.getLevel(self.MODULE), PathLog.Level.DEBUG) + # changing global log level does not affect module + PathLog.setLevel(PathLog.Level.ERROR) + self.assertEqual(PathLog.getLevel(self.MODULE), PathLog.Level.DEBUG) + # resetting module log level restores global log level for module + PathLog.setLevel(PathLog.Level.RESET, self.MODULE) + self.assertEqual(PathLog.getLevel(self.MODULE), PathLog.Level.ERROR) + # changing the global log level will also change the module log level + PathLog.setLevel(PathLog.Level.DEBUG) + self.assertEqual(PathLog.getLevel(self.MODULE), PathLog.Level.DEBUG) + + def test20(self): + """Verify debug logs aren't logged by default.""" + self.assertIsNone(PathLog.debug("this")) + + def test21(self): + """Verify debug logs are logged if log level is set to DEBUG.""" + PathLog.setLevel(PathLog.Level.DEBUG) + self.assertIsNotNone(PathLog.debug("this")) + + def test30(self): + """Verify log level ERROR.""" + PathLog.setLevel(PathLog.Level.ERROR) + self.assertIsNone(PathLog.debug('something')) + self.assertIsNone(PathLog.info('something')) + self.assertIsNone(PathLog.notice('something')) + self.assertIsNone(PathLog.warning('something')) + self.assertIsNotNone(PathLog.error('something')) + + def test31(self): + """Verify log level WARNING.""" + PathLog.setLevel(PathLog.Level.WARNING) + self.assertIsNone(PathLog.debug('something')) + self.assertIsNone(PathLog.info('something')) + self.assertIsNone(PathLog.notice('something')) + self.assertIsNotNone(PathLog.warning('something')) + self.assertIsNotNone(PathLog.error('something')) + + def test32(self): + """Verify log level NOTICE.""" + PathLog.setLevel(PathLog.Level.NOTICE) + self.assertIsNone(PathLog.debug('something')) + self.assertIsNone(PathLog.info('something')) + self.assertIsNotNone(PathLog.notice('something')) + self.assertIsNotNone(PathLog.warning('something')) + self.assertIsNotNone(PathLog.error('something')) + + def test33(self): + """Verify log level INFO.""" + PathLog.setLevel(PathLog.Level.INFO) + self.assertIsNone(PathLog.debug('something')) + self.assertIsNotNone(PathLog.info('something')) + self.assertIsNotNone(PathLog.notice('something')) + self.assertIsNotNone(PathLog.warning('something')) + self.assertIsNotNone(PathLog.error('something')) + + def test34(self): + """Verify log level DEBUG.""" + PathLog.setLevel(PathLog.Level.DEBUG) + self.assertIsNotNone(PathLog.debug('something')) + self.assertIsNotNone(PathLog.info('something')) + self.assertIsNotNone(PathLog.notice('something')) + self.assertIsNotNone(PathLog.warning('something')) + self.assertIsNotNone(PathLog.error('something')) + + def test50(self): + """Verify no tracking by default.""" + self.assertIsNone(PathLog.track('this', 'and', 'that')) + + def test51(self): + """Verify enabling tracking for module results in tracking.""" + PathLog.trackModule() + # Don't want to rely on the line number matching - still want some + # indication that track does the right thing .... + msg = PathLog.track('this', 'and', 'that') + self.assertTrue(msg.startswith(self.MODULE)) + self.assertTrue(msg.endswith('test51(this, and, that)')) + + def test52(self): + """Verify untracking stops tracking.""" + PathLog.trackModule() + self.assertIsNotNone(PathLog.track('this', 'and', 'that')) + PathLog.untrackModule() + self.assertIsNone(PathLog.track('this', 'and', 'that')) + + def test53(self): + """Verify trackAllModules works correctly.""" + PathLog.trackAllModules(True) + self.assertIsNotNone(PathLog.track('this', 'and', 'that')) + PathLog.trackAllModules(False) + self.assertIsNone(PathLog.track('this', 'and', 'that')) + PathLog.trackAllModules(True) + PathLog.trackModule() + self.assertIsNotNone(PathLog.track('this', 'and', 'that')) + PathLog.trackAllModules(False) + self.assertIsNotNone(PathLog.track('this', 'and', 'that')) + + def test60(self): + """Verify track handles no argument.""" + PathLog.trackModule() + msg = PathLog.track() + self.assertTrue(msg.startswith(self.MODULE)) + self.assertTrue(msg.endswith('test60()')) + + def test61(self): + """Verify track handles arbitrary argument types correctly.""" + PathLog.trackModule() + msg = PathLog.track('this', None, 1, 18.25) + self.assertTrue(msg.startswith(self.MODULE)) + self.assertTrue(msg.endswith('test61(this, None, 1, 18.25)')) + + def testzz(self): + """Restoring environment after tests.""" + PathLog.setLevel(PathLog.Level.RESET) diff --git a/src/Mod/Path/PathTests/TestPathPost.py b/src/Mod/Path/PathTests/TestPathPost.py index 0ea6ba81d2..efcdc1a323 100644 --- a/src/Mod/Path/PathTests/TestPathPost.py +++ b/src/Mod/Path/PathTests/TestPathPost.py @@ -74,7 +74,6 @@ class PathPostTestCases(unittest.TestCase): contour.OffsetExtra = 0.0 contour.Direction = 'CW' contour.UseComp = True - contour.PlungeAngle = 90.0 PathScripts.PathUtils.addToJob(contour) PathScripts.PathContour.ObjectContour.setDepths(contour.Proxy, contour) self.doc.recompute() diff --git a/src/Mod/Path/TestPathApp.py b/src/Mod/Path/TestPathApp.py index 074643ad36..f2e9611a00 100644 --- a/src/Mod/Path/TestPathApp.py +++ b/src/Mod/Path/TestPathApp.py @@ -24,6 +24,7 @@ import TestApp +from PathTests.TestPathLog import TestPathLog from PathTests.TestPathCore import TestPathCore from PathTests.TestPathPost import PathPostTestCases diff --git a/src/Mod/Plot/resources/icons/Axes.svg b/src/Mod/Plot/resources/icons/Axes.svg index 63786323b2..25233a0a64 100644 --- a/src/Mod/Plot/resources/icons/Axes.svg +++ b/src/Mod/Plot/resources/icons/Axes.svg @@ -1,450 +1,174 @@ - - - - - + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Jose Luis Cercos Pita] + + + Axes + 2012-11-02 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Plot/resources/icons/Axes.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - + + + + + + + + + + + diff --git a/src/Mod/Plot/resources/icons/Grid.svg b/src/Mod/Plot/resources/icons/Grid.svg index 8e0847f9a1..c0e153a240 100755 --- a/src/Mod/Plot/resources/icons/Grid.svg +++ b/src/Mod/Plot/resources/icons/Grid.svg @@ -1,406 +1,152 @@ - - - - - - - + + + + + + - - - + + + - - - + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + - + image/svg+xml - - + + + + + [Jose Luis Cercos Pita] + + + Grid + 2012-11-02 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Plot/resources/icons/Grid.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Plot/resources/icons/Icon.svg b/src/Mod/Plot/resources/icons/Icon.svg index ff800bde33..f512f06683 100755 --- a/src/Mod/Plot/resources/icons/Icon.svg +++ b/src/Mod/Plot/resources/icons/Icon.svg @@ -1,403 +1,148 @@ - - - - - - + + + + + - - - + + + - - - - - - + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Jose Luis Cercos Pita] + + + Icon + 2012-11-02 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Plot/resources/icons/Icon.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Plot/resources/icons/Labels.svg b/src/Mod/Plot/resources/icons/Labels.svg index d448517e1e..ea9dbc6d7a 100644 --- a/src/Mod/Plot/resources/icons/Labels.svg +++ b/src/Mod/Plot/resources/icons/Labels.svg @@ -1,705 +1,163 @@ - - - - - - + + + + + - - - + + + - - - + + + - - - - + + + - - - + + + - - - + + + + + + - - - - - - + + + + + + + + + - - - - - - - - - - + + + - - - + + + - - - + + + - - - - + + + + + + + + - - - + + + + - - - + + + + - - - + + + + - - - - - - - - - - - - - - - - - + + + - - + + + + - + image/svg+xml - - + + + + + [Jose Luis Cercos Pita] + + + Labels + 2012-11-02 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Plot/resources/icons/Labels.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + diff --git a/src/Mod/Plot/resources/icons/Legend.svg b/src/Mod/Plot/resources/icons/Legend.svg index 8cf15e82d6..b741e32d6a 100644 --- a/src/Mod/Plot/resources/icons/Legend.svg +++ b/src/Mod/Plot/resources/icons/Legend.svg @@ -1,678 +1,183 @@ - - - - - - + + + + + - - - - + + + - - - + + + - - - + + + - - - - - - + + + - - - - - - - - - - + + + - - - + + + - - - + + + - - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + + + + - - - - + + + + + + + + - - - - + + + + - - + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Jose Luis Cercos Pita] + + + Legend + 2012-11-02 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Plot/resources/icons/Legend.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Plot/resources/icons/PlotWorkbench.svg b/src/Mod/Plot/resources/icons/PlotWorkbench.svg index ff800bde33..f6bf8716b0 100755 --- a/src/Mod/Plot/resources/icons/PlotWorkbench.svg +++ b/src/Mod/Plot/resources/icons/PlotWorkbench.svg @@ -1,403 +1,148 @@ - - - - - - + + + + + - - - + + + - - - - - - + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [triplus] + + + PlotWorkbench + 2016-02-26 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Plot/resources/icons/PlotWorkbench.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Plot/resources/icons/Positions.svg b/src/Mod/Plot/resources/icons/Positions.svg index 895eb42a31..56ebacffa9 100644 --- a/src/Mod/Plot/resources/icons/Positions.svg +++ b/src/Mod/Plot/resources/icons/Positions.svg @@ -1,702 +1,268 @@ - - - - - - - - - - - - - - - - - - + + + + + - - - + + + - - - + + + - - - - + + + - - - + + + - - - + + + - - - - - - + + + - - - - - - - - - - + + + - - - + + + - - - + + + - - - - + + + - - - + + + - - - + + + - - - + + + + + + - - - + + + + + + + + - - - - + + + + - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Jose Luis Cercos Pita] + + + Positions + 2012-11-02 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Plot/resources/icons/Positions.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Plot/resources/icons/Save.svg b/src/Mod/Plot/resources/icons/Save.svg index ebdf1f1e05..e06c4a9cc5 100755 --- a/src/Mod/Plot/resources/icons/Save.svg +++ b/src/Mod/Plot/resources/icons/Save.svg @@ -1,700 +1,149 @@ - - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + + + + - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Jose Luis Cercos Pita] + + + Save + 2012-11-02 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Plot/resources/icons/Save.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Plot/resources/icons/Series.svg b/src/Mod/Plot/resources/icons/Series.svg index 1664f1a41f..474c81d86c 100644 --- a/src/Mod/Plot/resources/icons/Series.svg +++ b/src/Mod/Plot/resources/icons/Series.svg @@ -1,457 +1,141 @@ - - - - - + + + + - - + + - - + + - - + + - - + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + - - + + + + - + image/svg+xml - - + + + + + [Jose Luis Cercos Pita] + + + Series + 2012-11-02 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Plot/resources/icons/Series.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - + + + + + + + + diff --git a/src/Mod/Ship/resources/icons/ShipWorkbench.svg b/src/Mod/Ship/resources/icons/ShipWorkbench.svg index 1a7e203d39..412d96de80 100644 --- a/src/Mod/Ship/resources/icons/ShipWorkbench.svg +++ b/src/Mod/Ship/resources/icons/ShipWorkbench.svg @@ -1,427 +1,157 @@ - - - - - + + + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [triplus] + + + ShipWorkbench + 2016-02-26 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Ship/resources/icons/ShipWorkbench.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - FreeCAD - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - Sh - p - - - - - - + + + + + + + diff --git a/src/Mod/Ship/resources/icons/Ship_AreaCurve.svg b/src/Mod/Ship/resources/icons/Ship_AreaCurve.svg index 879c8e8dfa..ebe85340b7 100644 --- a/src/Mod/Ship/resources/icons/Ship_AreaCurve.svg +++ b/src/Mod/Ship/resources/icons/Ship_AreaCurve.svg @@ -1,400 +1,141 @@ - - - - - - + + + + + - - + + + + + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + - + + - - + + + + - + image/svg+xml - - + + + + + [Cercos-Pita J.L] + + + Ship_AreaCurve + 2014-02-18 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Ship/resources/icons/Ship_AreaCurve.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + + + + + + + diff --git a/src/Mod/Ship/resources/icons/Ship_CapacityCurve.svg b/src/Mod/Ship/resources/icons/Ship_CapacityCurve.svg index e722a67c8d..c6c71610b1 100644 --- a/src/Mod/Ship/resources/icons/Ship_CapacityCurve.svg +++ b/src/Mod/Ship/resources/icons/Ship_CapacityCurve.svg @@ -1,757 +1,255 @@ - - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - - - + + + - - - + + + - - - + + + - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [J.L. Cercos-Pita] + + + Ship_CapacityCurve + 2014-12-12 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Ship/resources/icons/Ship_CapacityCurve.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + diff --git a/src/Mod/Ship/resources/icons/Ship_GZ.svg b/src/Mod/Ship/resources/icons/Ship_GZ.svg index b170c9c441..3db4bb5eb8 100644 --- a/src/Mod/Ship/resources/icons/Ship_GZ.svg +++ b/src/Mod/Ship/resources/icons/Ship_GZ.svg @@ -1,1041 +1,351 @@ - - - - - - + + + + + - - + + + + + + + + + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + - - - + + + - - - + + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [J.L. Cercos-Pita] + + + Ship_GZ + 2014-12-12 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Ship/resources/icons/Ship_GZ.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - diff --git a/src/Mod/Ship/resources/icons/Ship_Hydrostatics.svg b/src/Mod/Ship/resources/icons/Ship_Hydrostatics.svg index acaae4cc92..5cba0a0160 100644 --- a/src/Mod/Ship/resources/icons/Ship_Hydrostatics.svg +++ b/src/Mod/Ship/resources/icons/Ship_Hydrostatics.svg @@ -1,666 +1,244 @@ - - - - - + + + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Jose Luis Cercos-Pita] + + + Ship_Hydrostatics + 2014-05-02 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Ship/resources/icons/Ship_Hydrostatics.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - + + + + + + + + + + + + - - - + + + - - - + + + + + + + + + + + + + + + + diff --git a/src/Mod/Ship/resources/icons/Ship_Instance.svg b/src/Mod/Ship/resources/icons/Ship_Instance.svg index b4144fc253..4f1bcfac13 100644 --- a/src/Mod/Ship/resources/icons/Ship_Instance.svg +++ b/src/Mod/Ship/resources/icons/Ship_Instance.svg @@ -1,319 +1,134 @@ - - - - - - - - - - - - - - - - - - + + + + + - - - + + + - - - + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + - + image/svg+xml - - + + + + + [Cercos-Pita J.L] + + + Ship_Instance + 2014-02-18 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Ship/resources/icons/Ship_Instance.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Ship/resources/icons/Ship_Load.svg b/src/Mod/Ship/resources/icons/Ship_Load.svg index 240baff3df..cc165d2dc7 100644 --- a/src/Mod/Ship/resources/icons/Ship_Load.svg +++ b/src/Mod/Ship/resources/icons/Ship_Load.svg @@ -1,452 +1,218 @@ - - - - - - + + + + + - - - + + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Cercos-Pita J.L] + + + Ship_Load + 2014-02-18 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Ship/resources/icons/Ship_Load.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Ship/resources/icons/Ship_LoadCondition.svg b/src/Mod/Ship/resources/icons/Ship_LoadCondition.svg index b6f7df03d9..8dce3f43b8 100644 --- a/src/Mod/Ship/resources/icons/Ship_LoadCondition.svg +++ b/src/Mod/Ship/resources/icons/Ship_LoadCondition.svg @@ -1,660 +1,198 @@ - - - - - - + + + + + - - - + + + - - + + + + + + + + + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - - + + + + + + [Jose Luis Cercos Pita] + + + Ship_LoadCondition + 2015-10-16 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Ship/resources/icons/Ship_LoadCondition.svg + + + FreeCAD LGPL2+ + + + + + [agryson] Alexander Gryson + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - TF - F - T - S - W - WNA - + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Ship/resources/icons/Ship_Logo.svg b/src/Mod/Ship/resources/icons/Ship_Logo.svg index fde3fc2158..cee94a1902 100644 --- a/src/Mod/Ship/resources/icons/Ship_Logo.svg +++ b/src/Mod/Ship/resources/icons/Ship_Logo.svg @@ -1,524 +1,157 @@ - - - - - + + + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Cercos-Pita J.L] + + + Ship_Logo + 2014-02-18 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Ship/resources/icons/Ship_Logo.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - FreeCAD - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sh - p - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Ship/resources/icons/Ship_Module.svg b/src/Mod/Ship/resources/icons/Ship_Module.svg index 1a7e203d39..712ced8128 100644 --- a/src/Mod/Ship/resources/icons/Ship_Module.svg +++ b/src/Mod/Ship/resources/icons/Ship_Module.svg @@ -1,427 +1,157 @@ - - - - - + + + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Cercos-Pita J.L] + + + Ship_Module + 2014-02-18 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Ship/resources/icons/Ship_Module.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - FreeCAD - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - Sh - p - - - - - - + + + + + + + diff --git a/src/Mod/Ship/resources/icons/Ship_OutlineDraw.svg b/src/Mod/Ship/resources/icons/Ship_OutlineDraw.svg index 21f0dd7a4e..26d0e856a5 100644 --- a/src/Mod/Ship/resources/icons/Ship_OutlineDraw.svg +++ b/src/Mod/Ship/resources/icons/Ship_OutlineDraw.svg @@ -1,398 +1,144 @@ - - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + + + + + + + + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - - - - - + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Cercos-Pita J.L] + + + Ship_OutlineDraw + 2014-02-18 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Ship/resources/icons/Ship_OutlineDraw.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/src/Mod/Ship/resources/icons/Ship_Tank.svg b/src/Mod/Ship/resources/icons/Ship_Tank.svg index 9fc8c2f8b4..7e68eafa6d 100644 --- a/src/Mod/Ship/resources/icons/Ship_Tank.svg +++ b/src/Mod/Ship/resources/icons/Ship_Tank.svg @@ -1,713 +1,229 @@ - - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - - - + + + - - - + + + + + - - - + + + - - - + + + - - + + + + + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [J.L. Cercos-Pita] + + + Ship_Tank + 2014-12-12 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Ship/resources/icons/Ship_Tank.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Ship/resources/icons/Ship_Weight.svg b/src/Mod/Ship/resources/icons/Ship_Weight.svg index e4f6f3c416..377abbadcf 100644 --- a/src/Mod/Ship/resources/icons/Ship_Weight.svg +++ b/src/Mod/Ship/resources/icons/Ship_Weight.svg @@ -1,521 +1,167 @@ - - - - - - - - + + + + + - - - + + + - - - + + + + + - - - + + + - - + + + + + + + + + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [J.L. Cercos-Pita] + + + Ship_Weight + 2014-12-12 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Ship/resources/icons/Ship_Weight.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - kg. + + + + + + + + + + + diff --git a/src/Mod/Sketcher/App/ConstraintPyImp.cpp b/src/Mod/Sketcher/App/ConstraintPyImp.cpp index a7d9809566..fb944a1538 100644 --- a/src/Mod/Sketcher/App/ConstraintPyImp.cpp +++ b/src/Mod/Sketcher/App/ConstraintPyImp.cpp @@ -290,6 +290,28 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) this->getConstraintPtr()->ThirdPos = (Sketcher::PointPos) intArg4; return 0; } + else if (strstr(ConstraintType,"InternalAlignment") != NULL) { // InteralAlignment with InternalElementIndex argument + this->getConstraintPtr()->Type = InternalAlignment; + + valid = true; + + if(strstr(ConstraintType,"BSplineControlPoint") != NULL) { + this->getConstraintPtr()->AlignmentType=BSplineControlPoint; + } + else { + this->getConstraintPtr()->AlignmentType=Undef; + valid = false; + } + + if (valid) { + this->getConstraintPtr()->First = intArg1; + this->getConstraintPtr()->FirstPos = (Sketcher::PointPos) intArg2; + this->getConstraintPtr()->Second = intArg3; + this->getConstraintPtr()->InternalAlignmentIndex = intArg4; + return 0; + } + + } if (valid) { this->getConstraintPtr()->First = intArg1; this->getConstraintPtr()->FirstPos = (Sketcher::PointPos) intArg2; diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index f9a441449a..32b306c65d 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -671,6 +671,32 @@ int Sketch::addBSpline(const Part::GeomBSplineCurve &bspline, bool fixed) std::vector mult = bsp->getMultiplicities(); int degree = bsp->getDegree(); bool periodic = bsp->isPeriodic(); + + // OCC hack + // c means there is a constraint on that weight, nc no constraint + // OCC provides normalized weights when polynomic [1 1 1] [c c c] and unnormalized weights when rational [5 1 5] [c nc c] + // then when changing from polynomic to rational, after the first solve any not-constrained pole circle gets normalized to 1. + // This only happens when changing from polynomic to rational, any subsequent change remains unnormalized [5 1 5] [c nc nc] + // This creates a visual problem that one of the poles shrinks to 1 mm when deleting an equality constraint. + + int lastoneindex = -1; + int countones = 0; + double lastnotone = 1.0; + + for(size_t i = 0; i < weights.size(); i++) { + if(weights[i] != 1.0) { + lastnotone = weights[i]; + } + else { // is 1.0 + lastoneindex = i; + countones++; + } + } + + if (countones == 1) + weights[lastoneindex] = (lastnotone * 0.99); + + // end hack Base::Vector3d startPnt = bsp->getStartPoint(); Base::Vector3d endPnt = bsp->getEndPoint(); diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 1b5d93b15d..221a9059d7 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -644,13 +644,25 @@ int SketchObject::addGeometry(const Part::Geometry *geo, bool construction/*=fal return Geometry.getSize()-1; } -int SketchObject::delGeometry(int GeoId) +int SketchObject::delGeometry(int GeoId, bool deleteinternalgeo) { const std::vector< Part::Geometry * > &vals = getInternalGeometry(); if (GeoId < 0 || GeoId >= int(vals.size())) return -1; - this->DeleteUnusedInternalGeometry(GeoId); + const Part::Geometry *geo = getGeometry(GeoId); + // Only for supported types + if ((geo->getTypeId() == Part::GeomEllipse::getClassTypeId() || + geo->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId() || + geo->getTypeId() == Part::GeomArcOfHyperbola::getClassTypeId() || + geo->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() || + geo->getTypeId() == Part::GeomBSplineCurve::getClassTypeId())) { + + if(deleteinternalgeo) { + this->DeleteUnusedInternalGeometry(GeoId, true); + return 0; + } + } std::vector< Part::Geometry * > newVals(vals); newVals.erase(newVals.begin()+GeoId); @@ -3474,7 +3486,7 @@ int SketchObject::ExposeInternalGeometry(int GeoId) return -1; // not supported type } -int SketchObject::DeleteUnusedInternalGeometry(int GeoId) +int SketchObject::DeleteUnusedInternalGeometry(int GeoId, bool delgeoid) { if (GeoId < 0 || GeoId > getHighestCurveIndex()) return -1; @@ -3552,11 +3564,14 @@ int SketchObject::DeleteUnusedInternalGeometry(int GeoId) if (majorconstraints<2) delgeometries.push_back(majorelementindex); + if(delgeoid) + delgeometries.push_back(GeoId); + std::sort(delgeometries.begin(), delgeometries.end()); // indices over an erased element get automatically updated!! if (delgeometries.size()>0) { for (std::vector::reverse_iterator it=delgeometries.rbegin(); it!=delgeometries.rend(); ++it) { - delGeometry(*it); + delGeometry(*it,false); } } @@ -3637,11 +3652,14 @@ int SketchObject::DeleteUnusedInternalGeometry(int GeoId) if (majorelementindex == -1 && focus1elementindex !=-1 && focus1constraints<3) // focus has one coincident and one internal align delgeometries.push_back(focus1elementindex); + if(delgeoid) + delgeometries.push_back(GeoId); + std::sort(delgeometries.begin(), delgeometries.end()); // indices over an erased element get automatically updated!! if (delgeometries.size()>0) { for (std::vector::reverse_iterator it=delgeometries.rbegin(); it!=delgeometries.rend(); ++it) { - delGeometry(*it); + delGeometry(*it,false); } } @@ -3700,11 +3718,14 @@ int SketchObject::DeleteUnusedInternalGeometry(int GeoId) } } + if(delgeoid) + delgeometries.push_back(GeoId); + std::sort(delgeometries.begin(), delgeometries.end()); // indices over an erased element get automatically updated!! if (delgeometries.size()>0) { for (std::vector::reverse_iterator it=delgeometries.rbegin(); it!=delgeometries.rend(); ++it) { - delGeometry(*it); + delGeometry(*it,false); } } @@ -3727,7 +3748,7 @@ int SketchObject::DeleteUnusedInternalGeometry(int GeoId) if (delgeometries.size()>0) { for (std::vector::reverse_iterator it=delgeometries.rbegin(); it!=delgeometries.rend(); ++it) { - delGeometry(*it); + delGeometry(*it,false); } } diff --git a/src/Mod/Sketcher/App/SketchObject.h b/src/Mod/Sketcher/App/SketchObject.h index ccd9931fb2..224c4800de 100644 --- a/src/Mod/Sketcher/App/SketchObject.h +++ b/src/Mod/Sketcher/App/SketchObject.h @@ -90,8 +90,13 @@ public: int addGeometry(const Part::Geometry *geo, bool construction=false); /// add unspecified geometry int addGeometry(const std::vector &geoList, bool construction=false); - /// delete geometry - int delGeometry(int GeoId); + /*! + \brief Deletes indicated geometry (by geoid). + \param GeoId - the geometry to delete + \param deleteinternalgeo - if true deletes the associated and unconstraint internal geometry, otherwise deletes only the GeoId + \retval int - 0 if successful + */ + int delGeometry(int GeoId, bool deleteinternalgeo = true); /// add all constraints in the list int addConstraints(const std::vector &ConstraintList); /// add constraint @@ -184,11 +189,13 @@ public: * \return -1 on error */ int ExposeInternalGeometry(int GeoId); - /// Deletes all unused (not further constrained) internal geometry /*! - * \return -1 on error + \brief Deletes all unused (not further constrained) internal geometry + \param GeoId - the geometry having the internal geometry to delete + \param delgeoid - if true in addition to the unused internal geometry also deletes the GeoId geometry + \retval int - returns -1 on error */ - int DeleteUnusedInternalGeometry(int GeoId); + int DeleteUnusedInternalGeometry(int GeoId, bool delgeoid=false); /// retrieves for a Vertex number the corresponding GeoId and PosId void getGeoVertexIndex(int VertexId, int &GeoId, PointPos &PosId) const; diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index a2b1f701f6..4348050145 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -64,16 +64,16 @@ namespace SketcherGui }; } -ConstraintCreationMode constraintCreationMode=Driving; +ConstraintCreationMode constraintCreationMode = Driving; -void ActivateHandler(Gui::Document *doc,DrawSketchHandler *handler); +void ActivateHandler(Gui::Document *doc, DrawSketchHandler *handler); bool isCreateGeoActive(Gui::Document *doc); bool isCreateConstraintActive(Gui::Document *doc) { if (doc) { - // checks if a Sketch Viewprovider is in Edit and is in no special mode + // checks if a Sketch View provider is in Edit and is in no special mode if (doc->getInEdit() && doc->getInEdit()->isDerivedFrom(SketcherGui::ViewProviderSketch::getClassTypeId())) { if (static_cast(doc->getInEdit()) ->getSketchMode() == ViewProviderSketch::STATUS_NONE) { @@ -244,8 +244,8 @@ void finishDistanceConstraint(Gui::Command* cmd, Sketcher::SketchObject* sketch, void showNoConstraintBetweenExternal() { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), - QObject::tr("Cannot add a constraint between two external geometries!")); + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("Cannot add a constraint between two external geometries!")); } bool checkBothExternal(int GeoId1, int GeoId2) @@ -330,7 +330,7 @@ void SketcherGui::makeTangentToEllipseviaNewPoint(const Sketcher::SketchObject* const Part::Geometry *geom2, int geoId1, int geoId2 - ) +) { const Part::GeomEllipse *ellipse = static_cast(geom1); @@ -394,6 +394,7 @@ void SketcherGui::makeTangentToEllipseviaNewPoint(const Sketcher::SketchObject* if(autoRecompute) Gui::Command::updateActive(); } + /// Makes a simple tangency constraint using extra point + tangent via point /// geom1 => an arc of ellipse /// geom2 => any of an arc of ellipse, a circle, or an arc (of circle) @@ -405,7 +406,7 @@ void SketcherGui::makeTangentToArcOfEllipseviaNewPoint(const Sketcher::SketchObj const Part::Geometry *geom2, int geoId1, int geoId2 - ) +) { const Part::GeomArcOfEllipse *aoe = static_cast(geom1); @@ -735,16 +736,36 @@ int SketchSelection::setUp(void) } // namespace SketcherGui - - /* Constrain commands =======================================================*/ namespace SketcherGui { - class HoriVertConstraintSelection : public Gui::SelectionFilterGate + /** + * @brief The SelType enum + * Types of sketch elements that can be (pre)selected. The root/origin and the + * axes are put up separately so that they can be specifically disallowed, for + * example, when in lock, horizontal, or vertical constraint modes. + */ + enum SelType { + SelVertex = 1, + SelRoot = 2, + SelEdge = 4, + SelHAxis = 8, + SelVAxis = 16, + SelExternalEdge = 32 + }; + + /** + * @brief The GenericConstraintSelection class + * SelectionFilterGate with changeable filters. In a constraint creation mode + * like point on object, if the first selection object can be a point, the next + * has to be a curve for the constraint to make sense. Thus filters are + * changeable so taht same filter can be kept on while in one mode. + */ + class GenericConstraintSelection : public Gui::SelectionFilterGate { App::DocumentObject* object; public: - HoriVertConstraintSelection(App::DocumentObject* obj) + GenericConstraintSelection(App::DocumentObject* obj) : Gui::SelectionFilterGate((Gui::SelectionFilter*)0), object(obj) {} @@ -755,13 +776,220 @@ namespace SketcherGui { if (!sSubName || sSubName[0] == '\0') return false; std::string element(sSubName); - if (element.substr(0,4) == "Edge") + if ( (allowedSelTypes & SketcherGui::SelRoot && element.substr(0,9) == "RootPoint") || + (allowedSelTypes & SketcherGui::SelVertex && element.substr(0,6) == "Vertex") || + (allowedSelTypes & SketcherGui::SelEdge && element.substr(0,4) == "Edge") || + (allowedSelTypes & SketcherGui::SelHAxis && element.substr(0,6) == "H_Axis") || + (allowedSelTypes & SketcherGui::SelVAxis && element.substr(0,6) == "V_Axis") || + (allowedSelTypes & SketcherGui::SelExternalEdge && element.substr(0,12) == "ExternalEdge")) return true; + return false; } + + void setAllowedSelTypes(int types) { + if (0 <= types && types < 64) allowedSelTypes = types; + } + + protected: + int allowedSelTypes; }; } +/** + * @brief The CmdSketcherConstraint class + * Superclass for all sketcher constraints to ease generation of constraint + * creation modes. + */ +class CmdSketcherConstraint : public Gui::Command +{ + friend class DrawSketchHandlerGenConstraint; +public: + CmdSketcherConstraint(const char* name) + : Command(name) {} + + virtual ~CmdSketcherConstraint(){} + + virtual const char* className() const + { return "CmdSketcherConstraint"; } + +protected: + /** + * @brief allowedSelSequences + * Each element is a vector representing sequence of selections allowable. + * TODO: Introduce structs to allow keeping first selection + */ + std::vector > allowedSelSequences; + + const char** constraintCursor = 0; + + virtual void applyConstraint(std::vector &, int) {} + virtual void activated(int /*iMsg*/); + virtual bool isActive(void) + { return isCreateGeoActive(getActiveGuiDocument()); } +}; + +class DrawSketchHandlerGenConstraint: public DrawSketchHandler +{ +public: + DrawSketchHandlerGenConstraint(const char* cursor[], CmdSketcherConstraint *_cmd) + : constraintCursor(cursor), cmd(_cmd), selFilterGate(nullptr) {} + virtual ~DrawSketchHandlerGenConstraint() + { + Gui::Selection().rmvSelectionGate(); + } + + virtual void activated(ViewProviderSketch *) + { + selFilterGate = new GenericConstraintSelection(sketchgui->getObject()); + + resetOngoingSequences(); + + selSeq.clear(); + + Gui::Selection().rmvSelectionGate(); + Gui::Selection().addSelectionGate(selFilterGate); + + setCursor(QPixmap(constraintCursor), 7, 7); + } + + virtual void mouseMove(Base::Vector2d /*onSketchPos*/) {} + + virtual bool pressButton(Base::Vector2d /*onSketchPos*/) + { + return true; + } + + virtual bool releaseButton(Base::Vector2d onSketchPos) + { + SelIdPair selIdPair; + selIdPair.GeoId = Constraint::GeoUndef; + selIdPair.PosId = Sketcher::none; + std::stringstream ss; + SelType newSelType; + + //For each SelType allowed, check if button is released there and assign it to selIdPair + int VtId = sketchgui->getPreselectPoint(); + int CrvId = sketchgui->getPreselectCurve(); + int CrsId = sketchgui->getPreselectCross(); + if (allowedSelTypes & SketcherGui::SelRoot && CrsId == 0) { + selIdPair.GeoId = Sketcher::GeoEnum::RtPnt; + selIdPair.PosId = Sketcher::start; + newSelType = SelRoot; + ss << "RootPoint"; + } + else if (allowedSelTypes & SketcherGui::SelVertex && VtId != -1) { + sketchgui->getSketchObject()->getGeoVertexIndex(VtId, + selIdPair.GeoId, + selIdPair.PosId); + newSelType = SelVertex; + ss << "Vertex" << VtId + 1; + } + else if (allowedSelTypes & SketcherGui::SelEdge && CrvId != -1) { + selIdPair.GeoId = CrvId; + newSelType = SelEdge; + ss << "Edge" << CrvId + 1; + } + else if (allowedSelTypes & SketcherGui::SelHAxis && CrsId == 1) { + selIdPair.GeoId = Sketcher::GeoEnum::HAxis; + newSelType = SelHAxis; + ss << "H_Axis"; + } + else if (allowedSelTypes & SketcherGui::SelVAxis && CrsId == 2) { + selIdPair.GeoId = Sketcher::GeoEnum::VAxis; + newSelType = SelVAxis; + ss << "V_Axis"; + } + else if (allowedSelTypes & SketcherGui::SelExternalEdge) { + //TODO: Figure out how this works + newSelType = SelExternalEdge; + } + + if (selIdPair.GeoId == Constraint::GeoUndef) { + // If mouse is released on "blank" space, start over + selSeq.clear(); + resetOngoingSequences(); + Gui::Selection().clearSelection(); + } + else { + // TODO: If mouse is released on something allowed, select it and move forward + selSeq.push_back(selIdPair); + Gui::Selection().addSelection(sketchgui->getSketchObject()->getDocument()->getName(), + sketchgui->getSketchObject()->getNameInDocument(), + ss.str().c_str(), + onSketchPos.x, + onSketchPos.y, + 0.f); + _tempOnSequences.clear(); + allowedSelTypes = 0; + for (std::set::iterator token = ongoingSequences.begin(); + token != ongoingSequences.end(); ++token) { + if ((cmd->allowedSelSequences).at(*token).at(seqIndex) == newSelType) { + if (seqIndex == (cmd->allowedSelSequences).at(*token).size()-1) { + // TODO: One of the sequences is completed. Pass to cmd->applyConstraint + cmd->applyConstraint(selSeq, *token); // TODO: replace arg 2 by ongoingToken + + selSeq.clear(); + resetOngoingSequences(); + + return true; + } + _tempOnSequences.insert(*token); + allowedSelTypes = allowedSelTypes | (cmd->allowedSelSequences).at(*token).at(seqIndex+1); + } + } + + // TODO: Progress to next seqIndex + std::swap(_tempOnSequences, ongoingSequences); + seqIndex++; + selFilterGate->setAllowedSelTypes(allowedSelTypes); + } + + return true; + } + +protected: + GenericConstraintSelection* selFilterGate; + + const char** constraintCursor; + CmdSketcherConstraint* cmd; + + std::vector selSeq; + int allowedSelTypes = 0; + + /// indices of currently ongoing sequences in cmd->allowedSequences + std::set ongoingSequences, _tempOnSequences; + /// Index within the selection sequences active + unsigned int seqIndex; + + void resetOngoingSequences() { + ongoingSequences.clear(); + for (unsigned int i = 0; i < cmd->allowedSelSequences.size(); i++) { + ongoingSequences.insert(i); + } + seqIndex = 0; + + // Estimate allowed selections from the first types in allowedSelTypes + allowedSelTypes = 0; + for (std::vector< std::vector< SelType > >::const_iterator it = cmd->allowedSelSequences.begin(); + it != cmd->allowedSelSequences.end(); ++it) { + allowedSelTypes = allowedSelTypes | (*it).at(seqIndex); + } + selFilterGate->setAllowedSelTypes(allowedSelTypes); + + Gui::Selection().clearSelection(); + } +}; + +void CmdSketcherConstraint::activated(int /*iMsg*/) +{ + ActivateHandler(getActiveGuiDocument(), + new DrawSketchHandlerGenConstraint(constraintCursor, this)); + getSelection().clearSelection(); +} + +// ============================================================================ + /* XPM */ static const char *cursor_createhoriconstraint[]={ "32 32 3 1", @@ -801,83 +1029,21 @@ static const char *cursor_createhoriconstraint[]={ "................................", "................................"}; -class DrawSketchHandlerHoriConstraint: public DrawSketchHandler +class CmdSketcherConstrainHorizontal : public CmdSketcherConstraint { public: - DrawSketchHandlerHoriConstraint() {} - virtual ~DrawSketchHandlerHoriConstraint() - { - Gui::Selection().rmvSelectionGate(); - } + CmdSketcherConstrainHorizontal(); + virtual ~CmdSketcherConstrainHorizontal(){} + virtual const char* className() const + { return "CmdSketcherConstrainHorizontal"; } +protected: + virtual void activated(int iMsg); + virtual void applyConstraint(std::vector &selSeq, int seqIndex); - virtual void activated(ViewProviderSketch *) - { - Gui::Selection().rmvSelectionGate(); - Gui::Selection().addSelectionGate(new HoriVertConstraintSelection(sketchgui->getObject())); - setCursor(QPixmap(cursor_createhoriconstraint), 7, 7); - } - - virtual void mouseMove(Base::Vector2d onSketchPos) {Q_UNUSED(onSketchPos);} - - virtual bool pressButton(Base::Vector2d onSketchPos) - { - Q_UNUSED(onSketchPos); - return false; - } - - virtual bool releaseButton(Base::Vector2d onSketchPos) - { - Q_UNUSED(onSketchPos); - Sketcher::SketchObject* Obj = static_cast(sketchgui->getObject()); - - const std::vector< Sketcher::Constraint * > &vals = Obj->Constraints.getValues(); - - int CrvId = sketchgui->getPreselectCurve(); - if (CrvId != -1) { - const Part::Geometry *geo = Obj->getGeometry(CrvId); - if (geo->getTypeId() != Part::GeomLineSegment::getClassTypeId()) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), - QObject::tr("The selected edge is not a line segment")); - return false; - } - - // check if the edge has already a Horizontal or Vertical constraint - for (std::vector< Sketcher::Constraint * >::const_iterator it= vals.begin(); - it != vals.end(); ++it) { - if ((*it)->Type == Sketcher::Horizontal && (*it)->First == CrvId){ - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Double constraint"), - QObject::tr("The selected edge has already a horizontal constraint!")); - return false; - } - if ((*it)->Type == Sketcher::Vertical && (*it)->First == CrvId) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), - QObject::tr("The selected edge has already a vertical constraint!")); - return false; - } - } - - // undo command open - Gui::Command::openCommand("add horizontal constraint"); - // issue the actual commands to create the constraint - Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Horizontal',%d)) ", - sketchgui->getObject()->getNameInDocument(),CrvId); - // finish the transaction and update - Gui::Command::commitCommand(); - - ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); - bool autoRecompute = hGrp->GetBool("AutoRecompute",false); - - if(autoRecompute) - Gui::Command::updateActive(); - } - return false; - } }; -DEF_STD_CMD_A(CmdSketcherConstrainHorizontal); - CmdSketcherConstrainHorizontal::CmdSketcherConstrainHorizontal() - :Command("Sketcher_ConstrainHorizontal") + :CmdSketcherConstraint("Sketcher_ConstrainHorizontal") { sAppModule = "Sketcher"; sGroup = QT_TR_NOOP("Sketcher"); @@ -888,14 +1054,15 @@ CmdSketcherConstrainHorizontal::CmdSketcherConstrainHorizontal() sPixmap = "Constraint_Horizontal"; sAccel = "H"; eType = ForEdit; + + allowedSelSequences = {{SelEdge}}; + constraintCursor = cursor_createhoriconstraint; } void CmdSketcherConstrainHorizontal::activated(int iMsg) { Q_UNUSED(iMsg); - ActivateHandler(getActiveGuiDocument(), new DrawSketchHandlerHoriConstraint()); - // get the selection std::vector selection = getSelection().getSelectionEx(); @@ -903,6 +1070,10 @@ void CmdSketcherConstrainHorizontal::activated(int iMsg) if (selection.size() != 1) { // QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), // QObject::tr("Select an edge from the sketch.")); + ActivateHandler(getActiveGuiDocument(), + new DrawSketchHandlerGenConstraint(constraintCursor, this)); + getSelection().clearSelection(); + return; } @@ -958,7 +1129,7 @@ void CmdSketcherConstrainHorizontal::activated(int iMsg) } // finish the transaction and update commitCommand(); - + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); bool autoRecompute = hGrp->GetBool("AutoRecompute",false); @@ -969,12 +1140,60 @@ void CmdSketcherConstrainHorizontal::activated(int iMsg) getSelection().clearSelection(); } -bool CmdSketcherConstrainHorizontal::isActive(void) +void CmdSketcherConstrainHorizontal::applyConstraint(std::vector &selSeq, int seqIndex) { - return isCreateGeoActive( getActiveGuiDocument() ); + switch (seqIndex) { + case 0: // {Edge} + // TODO: create the constraint + SketcherGui::ViewProviderSketch* sketchgui = static_cast(getActiveGuiDocument()->getInEdit()); + Sketcher::SketchObject* Obj = sketchgui->getSketchObject(); + + const std::vector< Sketcher::Constraint * > &vals = Obj->Constraints.getValues(); + + int CrvId = selSeq.front().GeoId; + if (CrvId != -1) { + const Part::Geometry *geo = Obj->getGeometry(CrvId); + if (geo->getTypeId() != Part::GeomLineSegment::getClassTypeId()) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), + QObject::tr("The selected edge is not a line segment")); + return; + } + + // check if the edge has already a Horizontal or Vertical constraint + for (std::vector< Sketcher::Constraint * >::const_iterator it= vals.begin(); + it != vals.end(); ++it) { + if ((*it)->Type == Sketcher::Horizontal && (*it)->First == CrvId){ + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Double constraint"), + QObject::tr("The selected edge has already a horizontal constraint!")); + return; + } + if ((*it)->Type == Sketcher::Vertical && (*it)->First == CrvId) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), + QObject::tr("The selected edge has already a vertical constraint!")); + return; + } + } + + // undo command open + Gui::Command::openCommand("add horizontal constraint"); + // issue the actual commands to create the constraint + Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Horizontal',%d)) ", + sketchgui->getObject()->getNameInDocument(),CrvId); + // finish the transaction and update + Gui::Command::commitCommand(); + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + bool autoRecompute = hGrp->GetBool("AutoRecompute",false); + + if(autoRecompute) + Gui::Command::updateActive(); + } + + break; + } } -// ====================================================================================== +// ================================================================================ static const char *cursor_createvertconstraint[]={ "32 32 3 1", @@ -1014,83 +1233,21 @@ static const char *cursor_createvertconstraint[]={ "................................", "................................"}; -class DrawSketchHandlerVertConstraint: public DrawSketchHandler +class CmdSketcherConstrainVertical : public CmdSketcherConstraint { public: - DrawSketchHandlerVertConstraint() {} - virtual ~DrawSketchHandlerVertConstraint() - { - Gui::Selection().rmvSelectionGate(); - } + CmdSketcherConstrainVertical(); + virtual ~CmdSketcherConstrainVertical(){} + virtual const char* className() const + { return "CmdSketcherConstrainVertical"; } +protected: + virtual void activated(int iMsg); + virtual void applyConstraint(std::vector &selSeq, int seqIndex); - virtual void activated(ViewProviderSketch *) - { - Gui::Selection().rmvSelectionGate(); - Gui::Selection().addSelectionGate(new HoriVertConstraintSelection(sketchgui->getObject())); - setCursor(QPixmap(cursor_createvertconstraint), 7, 7); - } - - virtual void mouseMove(Base::Vector2d onSketchPos) {Q_UNUSED(onSketchPos);} - - virtual bool pressButton(Base::Vector2d onSketchPos) - { - Q_UNUSED(onSketchPos); - return false; - } - - virtual bool releaseButton(Base::Vector2d onSketchPos) - { - Q_UNUSED(onSketchPos); - Sketcher::SketchObject* Obj = static_cast(sketchgui->getObject()); - - const std::vector< Sketcher::Constraint * > &vals = Obj->Constraints.getValues(); - - int CrvId = sketchgui->getPreselectCurve(); - if (CrvId != -1) { - const Part::Geometry *geo = Obj->getGeometry(CrvId); - if (geo->getTypeId() != Part::GeomLineSegment::getClassTypeId()) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), - QObject::tr("The selected edge is not a line segment")); - return false; - } - - // check if the edge has already a Horizontal or Vertical constraint - for (std::vector< Sketcher::Constraint * >::const_iterator it= vals.begin(); - it != vals.end(); ++it) { - if ((*it)->Type == Sketcher::Horizontal && (*it)->First == CrvId){ - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Double constraint"), - QObject::tr("The selected edge has already a horizontal constraint!")); - return false; - } - if ((*it)->Type == Sketcher::Vertical && (*it)->First == CrvId) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), - QObject::tr("The selected edge has already a vertical constraint!")); - return false; - } - } - - // undo command open - Gui::Command::openCommand("add horizontal constraint"); - // issue the actual commands to create the constraint - Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Vertical',%d)) ", - sketchgui->getObject()->getNameInDocument(),CrvId); - // finish the transaction and update - Gui::Command::commitCommand(); - - ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); - bool autoRecompute = hGrp->GetBool("AutoRecompute",false); - - if(autoRecompute) - Gui::Command::updateActive(); - } - return false; - } }; -DEF_STD_CMD_A(CmdSketcherConstrainVertical); - CmdSketcherConstrainVertical::CmdSketcherConstrainVertical() - :Command("Sketcher_ConstrainVertical") + :CmdSketcherConstraint("Sketcher_ConstrainVertical") { sAppModule = "Sketcher"; sGroup = QT_TR_NOOP("Sketcher"); @@ -1101,14 +1258,15 @@ CmdSketcherConstrainVertical::CmdSketcherConstrainVertical() sPixmap = "Constraint_Vertical"; sAccel = "V"; eType = ForEdit; + + allowedSelSequences = {{SelEdge}}; + constraintCursor = cursor_createvertconstraint; } void CmdSketcherConstrainVertical::activated(int iMsg) { Q_UNUSED(iMsg); - ActivateHandler(getActiveGuiDocument(), new DrawSketchHandlerVertConstraint()); - // get the selection std::vector selection = getSelection().getSelectionEx(); @@ -1116,6 +1274,9 @@ void CmdSketcherConstrainVertical::activated(int iMsg) if (selection.size() != 1) { // QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), // QObject::tr("Select an edge from the sketch.")); + ActivateHandler(getActiveGuiDocument(), + new DrawSketchHandlerGenConstraint(constraintCursor, this)); + getSelection().clearSelection(); return; } @@ -1133,8 +1294,11 @@ void CmdSketcherConstrainVertical::activated(int iMsg) const Part::Geometry *geo = Obj->getGeometry(GeoId); if (geo->getTypeId() != Part::GeomLineSegment::getClassTypeId()) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), - QObject::tr("The selected edge is not a line segment")); +// QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), +// QObject::tr("The selected edge is not a line segment")); + ActivateHandler(getActiveGuiDocument(), + new DrawSketchHandlerGenConstraint(constraintCursor, this)); + getSelection().clearSelection(); return; } @@ -1171,7 +1335,7 @@ void CmdSketcherConstrainVertical::activated(int iMsg) } // finish the transaction and update commitCommand(); - + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); bool autoRecompute = hGrp->GetBool("AutoRecompute",false); @@ -1182,36 +1346,61 @@ void CmdSketcherConstrainVertical::activated(int iMsg) getSelection().clearSelection(); } -bool CmdSketcherConstrainVertical::isActive(void) +void CmdSketcherConstrainVertical::applyConstraint(std::vector &selSeq, int seqIndex) { - return isCreateGeoActive( getActiveGuiDocument() ); + switch (seqIndex) { + case 0: // {Edge} + // TODO: create the constraint + SketcherGui::ViewProviderSketch* sketchgui = static_cast(getActiveGuiDocument()->getInEdit()); + Sketcher::SketchObject* Obj = sketchgui->getSketchObject(); + + const std::vector< Sketcher::Constraint * > &vals = Obj->Constraints.getValues(); + + int CrvId = selSeq.front().GeoId; + if (CrvId != -1) { + const Part::Geometry *geo = Obj->getGeometry(CrvId); + if (geo->getTypeId() != Part::GeomLineSegment::getClassTypeId()) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), + QObject::tr("The selected edge is not a line segment")); + return; + } + + // check if the edge has already a Horizontal or Vertical constraint + for (std::vector< Sketcher::Constraint * >::const_iterator it= vals.begin(); + it != vals.end(); ++it) { + if ((*it)->Type == Sketcher::Horizontal && (*it)->First == CrvId){ + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), + QObject::tr("The selected edge has already a horizontal constraint!")); + return; + } + if ((*it)->Type == Sketcher::Vertical && (*it)->First == CrvId) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Double constraint"), + QObject::tr("The selected edge has already a vertical constraint!")); + return; + } + } + + // undo command open + Gui::Command::openCommand("add vertical constraint"); + // issue the actual commands to create the constraint + Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Vertical',%d)) ", + sketchgui->getObject()->getNameInDocument(),CrvId); + // finish the transaction and update + Gui::Command::commitCommand(); + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + bool autoRecompute = hGrp->GetBool("AutoRecompute",false); + + if(autoRecompute) + Gui::Command::updateActive(); + } + + break; + } } // ====================================================================================== -namespace SketcherGui { - class LockConstraintSelection : public Gui::SelectionFilterGate - { - App::DocumentObject* object; - public: - LockConstraintSelection(App::DocumentObject* obj) - : Gui::SelectionFilterGate((Gui::SelectionFilter*)0), object(obj) - {} - - bool allow(App::Document *, App::DocumentObject *pObj, const char *sSubName) - { - if (pObj != this->object) - return false; - if (!sSubName || sSubName[0] == '\0') - return false; - std::string element(sSubName); - if (element.substr(0,6) == "Vertex") - return true; - return false; - } - }; -} - /* XPM */ static const char *cursor_createlock[]={ "32 32 3 1", @@ -1251,113 +1440,21 @@ static const char *cursor_createlock[]={ "................................", "................................"}; -/** - * @brief The DrawSketchHandlerLock class - * - * Hacking along the lines of the functions in CommandCreateGeo.cpp to make lock - * constraints on the fly. - */ -class DrawSketchHandlerLock: public DrawSketchHandler +class CmdSketcherConstrainLock : public CmdSketcherConstraint { public: - DrawSketchHandlerLock() : selectionDone(false) {} - virtual ~DrawSketchHandlerLock() - { - Gui::Selection().rmvSelectionGate(); - } - - virtual void activated(ViewProviderSketch *) - { - Gui::Selection().rmvSelectionGate(); - Gui::Selection().addSelectionGate(new LockConstraintSelection(sketchgui->getObject())); - setCursor(QPixmap(cursor_createlock),7,7); - } - - virtual void mouseMove(Base::Vector2d /*onSketchPos*/) - { - // If preselection Point - //int preSelPnt = sketchgui->getPreselectPoint(); -// if (sketchgui->getPreselectPoint() != -1) { -// setPositionText(onSketchPos); -// return; -// } -// resetPositionText(); -// applyCursor(); - } - - virtual bool pressButton(Base::Vector2d onSketchPos) - { - Q_UNUSED(onSketchPos); - // Get Preselection Point - int preSelPnt = sketchgui->getPreselectPoint(); - if (preSelPnt != -1) { - pointGeoId = Constraint::GeoUndef; - pointPosId = Sketcher::none; - sketchgui->getSketchObject()->getGeoVertexIndex(preSelPnt, pointGeoId, pointPosId); - selectionDone = true; - return true; - } - return true; - } - - virtual bool releaseButton(Base::Vector2d onSketchPos) - { - Q_UNUSED(onSketchPos); - if (selectionDone) { - unsetCursor(); - resetPositionText(); - - Sketcher::SketchObject* Obj = static_cast(sketchgui->getObject()); - - Base::Vector3d pnt = Obj->getPoint(pointGeoId,pointPosId); - - // undo command open - Gui::Command::openCommand("add fixed constraint"); - Gui::Command::doCommand( - Gui::Command::Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('DistanceX',%d,%d,%f)) ", - sketchgui->getObject()->getNameInDocument(),pointGeoId,pointPosId,pnt.x); - Gui::Command::doCommand( - Gui::Command::Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('DistanceY',%d,%d,%f)) ", - sketchgui->getObject()->getNameInDocument(),pointGeoId,pointPosId,pnt.y); - - if (pointGeoId <= Sketcher::GeoEnum::RefExt || constraintCreationMode==Reference) { - // it is a constraint on a external line, make it non-driving - const std::vector &ConStr = Obj->Constraints.getValues(); - - Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.setDriving(%i,%s)", - sketchgui->getObject()->getNameInDocument(),ConStr.size()-2,"False"); - - Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.setDriving(%i,%s)", - sketchgui->getObject()->getNameInDocument(),ConStr.size()-1,"False"); - } - - // finish the transaction and update - Gui::Command::commitCommand(); - - ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); - bool autoRecompute = hGrp->GetBool("AutoRecompute",false); - - if(autoRecompute) - Gui::Command::updateActive(); - - // clear the selection (convenience) - Gui::Selection().clearSelection(); - - } - return true; - } - + CmdSketcherConstrainLock(); + virtual ~CmdSketcherConstrainLock(){} + virtual void updateAction(int mode); + virtual const char* className() const + { return "CmdSketcherConstrainLock"; } protected: - bool selectionDone; - int pointGeoId; - Sketcher::PointPos pointPosId; - std::vector sugConstr; + virtual void activated(int iMsg); + virtual void applyConstraint(std::vector &selSeq, int seqIndex); }; -DEF_STD_CMD_AU(CmdSketcherConstrainLock); - CmdSketcherConstrainLock::CmdSketcherConstrainLock() - :Command("Sketcher_ConstrainLock") + :CmdSketcherConstraint("Sketcher_ConstrainLock") { sAppModule = "Sketcher"; sGroup = QT_TR_NOOP("Sketcher"); @@ -1367,19 +1464,23 @@ CmdSketcherConstrainLock::CmdSketcherConstrainLock() sStatusTip = sToolTipText; sPixmap = "Sketcher_ConstrainLock"; eType = ForEdit; + + allowedSelSequences = {{SelVertex}}; + constraintCursor = cursor_createlock; } void CmdSketcherConstrainLock::activated(int iMsg) { Q_UNUSED(iMsg); - ActivateHandler(getActiveGuiDocument(), new DrawSketchHandlerLock()); + // get the selection std::vector selection = getSelection().getSelectionEx(); // only one sketch with its subelements are allowed to be selected if (selection.size() != 1) { -// QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), -// QObject::tr("Select entities from the sketch.")); + ActivateHandler(getActiveGuiDocument(), + new DrawSketchHandlerGenConstraint(constraintCursor, this)); + getSelection().clearSelection(); return; } @@ -1390,6 +1491,8 @@ void CmdSketcherConstrainLock::activated(int iMsg) if (SubNames.size() != 1) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), QObject::tr("Select exactly one entity from the sketch.")); + ActivateHandler(getActiveGuiDocument(), + new DrawSketchHandlerGenConstraint(constraintCursor, this)); // clear the selection (convenience) getSelection().clearSelection(); return; @@ -1421,17 +1524,17 @@ void CmdSketcherConstrainLock::activated(int iMsg) if (GeoId <= Sketcher::GeoEnum::RefExt || constraintCreationMode==Reference) { // it is a constraint on a external line, make it non-driving const std::vector &ConStr = Obj->Constraints.getValues(); - + Gui::Command::doCommand(Doc,"App.ActiveDocument.%s.setDriving(%i,%s)", selection[0].getFeatName(),ConStr.size()-2,"False"); - + Gui::Command::doCommand(Doc,"App.ActiveDocument.%s.setDriving(%i,%s)", selection[0].getFeatName(),ConStr.size()-1,"False"); } - + // finish the transaction and update commitCommand(); - + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); bool autoRecompute = hGrp->GetBool("AutoRecompute",false); @@ -1442,6 +1545,48 @@ void CmdSketcherConstrainLock::activated(int iMsg) getSelection().clearSelection(); } +void CmdSketcherConstrainLock::applyConstraint(std::vector &selSeq, int seqIndex) +{ + switch (seqIndex) { + case 0: // {Vertex} + // Create the constraints + SketcherGui::ViewProviderSketch* sketchgui = static_cast(getActiveGuiDocument()->getInEdit()); + Sketcher::SketchObject* Obj = sketchgui->getSketchObject(); + + Base::Vector3d pnt = Obj->getPoint(selSeq.front().GeoId, selSeq.front().PosId); + + // undo command open + Gui::Command::openCommand("add fixed constraint"); + Gui::Command::doCommand( + Gui::Command::Doc, "App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('DistanceX', %d, %d, %f)) ", + sketchgui->getObject()->getNameInDocument(), selSeq.front().GeoId, selSeq.front().PosId, pnt.x); + Gui::Command::doCommand( + Gui::Command::Doc, "App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('DistanceY', %d, %d, %f)) ", + sketchgui->getObject()->getNameInDocument(), selSeq.front().GeoId, selSeq.front().PosId, pnt.y); + + if (selSeq.front().GeoId <= Sketcher::GeoEnum::RefExt || constraintCreationMode==Reference) { + // it is a constraint on a external line, make it non-driving + const std::vector &ConStr = Obj->Constraints.getValues(); + + Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.%s.setDriving(%i, %s)", + sketchgui->getObject()->getNameInDocument(), ConStr.size()-2, "False"); + + Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.%s.setDriving(%i, %s)", + sketchgui->getObject()->getNameInDocument(), ConStr.size()-1, "False"); + } + + // finish the transaction and update + Gui::Command::commitCommand(); + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + bool autoRecompute = hGrp->GetBool("AutoRecompute", false); + + if(autoRecompute) + Gui::Command::updateActive(); + break; + } +} + void CmdSketcherConstrainLock::updateAction(int mode) { switch (mode) { @@ -1456,36 +1601,8 @@ void CmdSketcherConstrainLock::updateAction(int mode) } } -bool CmdSketcherConstrainLock::isActive(void) -{ - return isCreateGeoActive( getActiveGuiDocument() ); -} - // ====================================================================================== -namespace SketcherGui { - class CoincidentConstraintSelection : public Gui::SelectionFilterGate - { - App::DocumentObject* object; - public: - CoincidentConstraintSelection(App::DocumentObject* obj) - : Gui::SelectionFilterGate((Gui::SelectionFilter*)0), object(obj) - {} - - bool allow(App::Document *, App::DocumentObject *pObj, const char *sSubName) - { - if (pObj != this->object) - return false; - if (!sSubName || sSubName[0] == '\0') - return false; - std::string element(sSubName); - if (element.substr(0,6) == "Vertex" || element.substr(0,9) == "RootPoint") - return true; - return false; - } - }; -} - /* XPM */ static const char *cursor_createcoincident[]={ "32 32 3 1", @@ -1541,7 +1658,9 @@ public: virtual void activated(ViewProviderSketch *) { Gui::Selection().rmvSelectionGate(); - Gui::Selection().addSelectionGate(new CoincidentConstraintSelection(sketchgui->getObject())); + GenericConstraintSelection* selFilterGate = new GenericConstraintSelection(sketchgui->getObject()); + selFilterGate->setAllowedSelTypes(SelVertex|SelRoot); + Gui::Selection().addSelectionGate(selFilterGate); setCursor(QPixmap(cursor_createcoincident), 7, 7); } @@ -1555,47 +1674,63 @@ public: virtual bool releaseButton(Base::Vector2d onSketchPos) { - Q_UNUSED(onSketchPos); int VtId = sketchgui->getPreselectPoint(); + int CrsId = sketchgui->getPreselectCross(); + std::stringstream ss; + int GeoId_temp; + Sketcher::PointPos PosId_temp; + if (VtId != -1) { - if (GeoId1 == Constraint::GeoUndef) { - sketchgui->getSketchObject()->getGeoVertexIndex(VtId,GeoId1,PosId1); - std::stringstream ss; - ss << "Vertex" << VtId + 1; - Gui::Selection().addSelection(sketchgui->getSketchObject()->getDocument()->getName(), - sketchgui->getSketchObject()->getNameInDocument(), - ss.str().c_str(), - onSketchPos.x, - onSketchPos.y, - 0.f); - } - else { - sketchgui->getSketchObject()->getGeoVertexIndex(VtId,GeoId2,PosId2); - - // Apply the constraint - Sketcher::SketchObject* Obj = static_cast(sketchgui->getObject()); - - // undo command open - Gui::Command::openCommand("add coincident constraint"); - - // check if this coincidence is already enforced (even indirectly) - bool constraintExists = Obj->arePointsCoincident(GeoId1,PosId1,GeoId2,PosId2); - if (!constraintExists && (GeoId1 != GeoId2)) { - Gui::Command::doCommand( - Gui::Command::Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Coincident',%d,%d,%d,%d)) ", - sketchgui->getObject()->getNameInDocument(),GeoId1,PosId1,GeoId2,PosId2); - Gui::Command::commitCommand(); - } - else { - Gui::Command::abortCommand(); - } - } + sketchgui->getSketchObject()->getGeoVertexIndex(VtId,GeoId_temp,PosId_temp); + ss << "Vertex" << VtId + 1; + } + else if (CrsId == 0){ + GeoId_temp = Sketcher::GeoEnum::RtPnt; + PosId_temp = Sketcher::start; + ss << "RootPoint"; } else { GeoId1 = GeoId2 = Constraint::GeoUndef; PosId1 = PosId2 = Sketcher::none; Gui::Selection().clearSelection(); + + return true; } + + + if (GeoId1 == Constraint::GeoUndef) { + GeoId1 = GeoId_temp; + PosId1 = PosId_temp; + Gui::Selection().addSelection(sketchgui->getSketchObject()->getDocument()->getName(), + sketchgui->getSketchObject()->getNameInDocument(), + ss.str().c_str(), + onSketchPos.x, + onSketchPos.y, + 0.f); + } + else { + GeoId2 = GeoId_temp; + PosId2 = PosId_temp; + + // Apply the constraint + Sketcher::SketchObject* Obj = static_cast(sketchgui->getObject()); + + // undo command open + Gui::Command::openCommand("add coincident constraint"); + + // check if this coincidence is already enforced (even indirectly) + bool constraintExists = Obj->arePointsCoincident(GeoId1,PosId1,GeoId2,PosId2); + if (!constraintExists && (GeoId1 != GeoId2)) { + Gui::Command::doCommand( + Gui::Command::Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Coincident',%d,%d,%d,%d)) ", + sketchgui->getObject()->getNameInDocument(),GeoId1,PosId1,GeoId2,PosId2); + Gui::Command::commitCommand(); + } + else { + Gui::Command::abortCommand(); + } + } + return true; } protected: @@ -1603,10 +1738,20 @@ protected: Sketcher::PointPos PosId1, PosId2; }; -DEF_STD_CMD_A(CmdSketcherConstrainCoincident); +class CmdSketcherConstrainCoincident : public CmdSketcherConstraint +{ +public: + CmdSketcherConstrainCoincident(); + virtual ~CmdSketcherConstrainCoincident(){} + virtual const char* className() const + { return "CmdSketcherConstrainCoincident"; } +protected: + virtual void activated(int iMsg); + virtual void applyConstraint(std::vector &selSeq, int seqIndex); +}; CmdSketcherConstrainCoincident::CmdSketcherConstrainCoincident() - :Command("Sketcher_ConstrainCoincident") + :CmdSketcherConstraint("Sketcher_ConstrainCoincident") { sAppModule = "Sketcher"; sGroup = QT_TR_NOOP("Sketcher"); @@ -1617,20 +1762,24 @@ CmdSketcherConstrainCoincident::CmdSketcherConstrainCoincident() sPixmap = "Constraint_PointOnPoint"; sAccel = "C"; eType = ForEdit; + + allowedSelSequences = {{SelVertex, SelVertex}, {SelVertex, SelRoot}, + {SelRoot, SelVertex}}; + constraintCursor = cursor_createcoincident; } void CmdSketcherConstrainCoincident::activated(int iMsg) { Q_UNUSED(iMsg); - ActivateHandler(getActiveGuiDocument(), new DrawSketchHandlerCoincident()); // get the selection std::vector selection = getSelection().getSelectionEx(); // only one sketch with its subelements are allowed to be selected if (selection.size() != 1) { -// QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), -// QObject::tr("Select vertexes from the sketch.")); + ActivateHandler(getActiveGuiDocument(), + new DrawSketchHandlerGenConstraint(constraintCursor, this)); + getSelection().clearSelection(); return; } @@ -1692,12 +1841,39 @@ void CmdSketcherConstrainCoincident::activated(int iMsg) getSelection().clearSelection(); } -bool CmdSketcherConstrainCoincident::isActive(void) +void CmdSketcherConstrainCoincident::applyConstraint(std::vector &selSeq, int seqIndex) { - // return isCreateConstraintActive( getActiveGuiDocument() ); - return isCreateGeoActive( getActiveGuiDocument() ); + switch (seqIndex) { + case 0: // {SelVertex, SelVertex} + case 1: // {SelVertex, SelRoot} + case 2: // {SelRoot, SelVertex} + // TODO: create the constraint + SketcherGui::ViewProviderSketch* sketchgui = static_cast(getActiveGuiDocument()->getInEdit()); + Sketcher::SketchObject* Obj = sketchgui->getSketchObject(); + + int GeoId1 = selSeq.at(0).GeoId, GeoId2 = selSeq.at(1).GeoId; + Sketcher::PointPos PosId1 = selSeq.at(0).PosId, PosId2 = selSeq.at(1).PosId; + + // undo command open + Gui::Command::openCommand("add coincident constraint"); + + // check if this coincidence is already enforced (even indirectly) + bool constraintExists = Obj->arePointsCoincident(GeoId1, PosId1, GeoId2, PosId2); + if (!constraintExists && (GeoId1 != GeoId2)) { + Gui::Command::doCommand( + Gui::Command::Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Coincident', %d, %d, %d, %d)) ", + sketchgui->getObject()->getNameInDocument(), GeoId1, PosId1, GeoId2, PosId2); + Gui::Command::commitCommand(); + } + else { + Gui::Command::abortCommand(); + } + + break; + } } +// ====================================================================================== DEF_STD_CMD_AU(CmdSketcherConstrainDistance); @@ -1880,11 +2056,63 @@ bool CmdSketcherConstrainDistance::isActive(void) return isCreateConstraintActive( getActiveGuiDocument() ); } +// ====================================================================================== -DEF_STD_CMD_A(CmdSketcherConstrainPointOnObject); +/* XPM */ +static const char * cursor_createpointonobj[] = { +"32 32 3 1", +" c None", +". c #FFFFFF", +"+ c #FF0000", +" . ", +" . ++++", +" . ++++++", +" . +++++++ ", +" . ++++++ ", +" ++++++ ", +"..... ..... +++++ ", +" +++++ ", +" . +++ ++++ ", +" . +++++++++ ", +" . ++++++++ ", +" . +++++++++ ", +" . +++++++++ ", +" +++++++++ ", +" +++++++ ", +" ++++++++ ", +" +++++++ ", +" +++ ", +" +++ ", +" +++ ", +" +++ ", +" +++ ", +" +++ ", +" +++ ", +" +++ ", +" ++ ", +" +++ ", +" ++ ", +" +++ ", +" +++ ", +" ++ ", +" ++ "}; + +class CmdSketcherConstrainPointOnObject : public CmdSketcherConstraint +{ +public: + CmdSketcherConstrainPointOnObject(); + virtual ~CmdSketcherConstrainPointOnObject(){} + virtual const char* className() const + { return "CmdSketcherConstrainPointOnObject"; } +protected: + virtual void activated(int iMsg); + virtual void applyConstraint(std::vector &selSeq, int seqIndex); +}; + +//DEF_STD_CMD_A(CmdSketcherConstrainPointOnObject); CmdSketcherConstrainPointOnObject::CmdSketcherConstrainPointOnObject() - :Command("Sketcher_ConstrainPointOnObject") + :CmdSketcherConstraint("Sketcher_ConstrainPointOnObject") { sAppModule = "Sketcher"; sGroup = QT_TR_NOOP("Sketcher"); @@ -1895,6 +2123,13 @@ CmdSketcherConstrainPointOnObject::CmdSketcherConstrainPointOnObject() sPixmap = "Constraint_PointOnObject"; sAccel = "SHIFT+O"; eType = ForEdit; + + allowedSelSequences = {{SelVertex, SelEdge}, {SelEdge, SelVertex}, + {SelRoot, SelEdge}, {SelEdge, SelRoot}, + {SelVertex, SelHAxis}, {SelHAxis, SelVertex}, + {SelVertex, SelVAxis}, {SelVAxis, SelVertex}}; + constraintCursor = cursor_createpointonobj; + } void CmdSketcherConstrainPointOnObject::activated(int iMsg) @@ -1905,8 +2140,11 @@ void CmdSketcherConstrainPointOnObject::activated(int iMsg) // only one sketch with its subelements are allowed to be selected if (selection.size() != 1) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), - QObject::tr("Select vertexes from the sketch.")); +// QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), +// QObject::tr("Select vertexes from the sketch.")); + + ActivateHandler(getActiveGuiDocument(), + new DrawSketchHandlerGenConstraint(constraintCursor, this)); return; } @@ -1973,11 +2211,77 @@ void CmdSketcherConstrainPointOnObject::activated(int iMsg) return; } -bool CmdSketcherConstrainPointOnObject::isActive(void) +void CmdSketcherConstrainPointOnObject::applyConstraint(std::vector &selSeq, int seqIndex) { - return isCreateConstraintActive( getActiveGuiDocument() ); + int GeoIdVt, GeoIdCrv; + Sketcher::PointPos PosIdVt; + + switch (seqIndex) { + case 0: // {SelVertex, SelEdge} + case 2: // {SelRoot, SelEdge} + case 4: // {SelVertex, SelHAxis} + case 6: // {SelVertex, SelVAxis} + GeoIdVt = selSeq.at(0).GeoId; GeoIdCrv = selSeq.at(1).GeoId; + PosIdVt = selSeq.at(0).PosId; + + break; + case 1: // {SelEdge, SelVertex} + case 3: // {SelEdge, SelRoot} + case 5: // {SelHAxis, SelVertex} + case 7: // {SelVAxis, SelVertex} + GeoIdVt = selSeq.at(1).GeoId; GeoIdCrv = selSeq.at(0).GeoId; + PosIdVt = selSeq.at(1).PosId; + + break; + default: + return; + } + + SketcherGui::ViewProviderSketch* sketchgui = static_cast(getActiveGuiDocument()->getInEdit()); + Sketcher::SketchObject* Obj = sketchgui->getSketchObject(); + + openCommand("add point on object constraint"); + bool allOK = true; + if (checkBothExternal(GeoIdVt, GeoIdCrv)){ + showNoConstraintBetweenExternal(); + allOK = false; + } + if (GeoIdVt == GeoIdCrv) + allOK = false; //constraining a point of an element onto the element is a bad idea... + + const Part::Geometry *geom = Obj->getGeometry(GeoIdCrv); + + if( geom && geom->getTypeId() == Part::GeomBSplineCurve::getClassTypeId() ){ + // unsupported until normal to BSpline at any point implemented. + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("Point on BSpline edge currently unsupported.")); + allOK = false; + } + + + if (allOK) { + Gui::Command::doCommand( + Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('PointOnObject',%d,%d,%d)) ", + sketchgui->getObject()->getNameInDocument(), GeoIdVt, PosIdVt, GeoIdCrv); + + commitCommand(); + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + bool autoRecompute = hGrp->GetBool("AutoRecompute",false); + + if(autoRecompute) + Gui::Command::updateActive(); + } else { + abortCommand(); + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("None of the selected points were constrained onto the respective curves, either " + "because they are parts of the same element, or because they are both external geometry.")); + } + return; } +// ====================================================================================== + DEF_STD_CMD_AU(CmdSketcherConstrainDistanceX); CmdSketcherConstrainDistanceX::CmdSketcherConstrainDistanceX() @@ -2136,6 +2440,7 @@ bool CmdSketcherConstrainDistanceX::isActive(void) return isCreateConstraintActive( getActiveGuiDocument() ); } +// ====================================================================================== DEF_STD_CMD_AU(CmdSketcherConstrainDistanceY); @@ -2294,11 +2599,63 @@ bool CmdSketcherConstrainDistanceY::isActive(void) return isCreateConstraintActive( getActiveGuiDocument() ); } +//================================================================================= -DEF_STD_CMD_A(CmdSketcherConstrainParallel); +/* XPM */ +static const char *cursor_createparallel[]={ +"32 32 3 1", +" c None", +". c #FFFFFF", +"+ c #FF0000", +" . ", +" . ", +" . ", +" . ", +" . ", +" ", +"..... ..... ", +" ", +" . ", +" . ", +" . + + ", +" . ++ ++ ", +" . + + ", +" ++ ++ ", +" + + ", +" ++ ++ ", +" + + ", +" ++ ++ ", +" + + ", +" ++ ++ ", +" + + ", +" ++ ++ ", +" + + ", +" ++ ++ ", +" + + ", +" ++ ++ ", +" + + ", +" ++ ++ ", +" + + ", +" ", +" ", +" "}; + +//DEF_STD_CMD_A(CmdSketcherConstrainParallel); + +class CmdSketcherConstrainParallel : public CmdSketcherConstraint +{ +public: + CmdSketcherConstrainParallel(); + virtual ~CmdSketcherConstrainParallel(){} + virtual const char* className() const + { return "CmdSketcherConstrainParallel"; } +protected: + virtual void activated(int iMsg); + virtual void applyConstraint(std::vector &selSeq, int seqIndex); +}; CmdSketcherConstrainParallel::CmdSketcherConstrainParallel() - :Command("Sketcher_ConstrainParallel") + :CmdSketcherConstraint("Sketcher_ConstrainParallel") { sAppModule = "Sketcher"; sGroup = QT_TR_NOOP("Sketcher"); @@ -2309,6 +2666,12 @@ CmdSketcherConstrainParallel::CmdSketcherConstrainParallel() sPixmap = "Constraint_Parallel"; sAccel = "SHIFT+P"; eType = ForEdit; + + // TODO: Also needed: ExternalEdges + allowedSelSequences = {{SelEdge, SelEdge}, + {SelEdge, SelHAxis}, {SelEdge, SelVAxis}, + {SelHAxis, SelEdge}, {SelVAxis, SelEdge}}; + constraintCursor = cursor_createparallel; } void CmdSketcherConstrainParallel::activated(int iMsg) @@ -2319,8 +2682,11 @@ void CmdSketcherConstrainParallel::activated(int iMsg) // only one sketch with its subelements are allowed to be selected if (selection.size() != 1) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), - QObject::tr("Select two or more lines from the sketch.")); +// QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), +// QObject::tr("Select two or more lines from the sketch.")); + ActivateHandler(getActiveGuiDocument(), + new DrawSketchHandlerGenConstraint(constraintCursor, this)); + getSelection().clearSelection(); return; } @@ -2389,16 +2755,100 @@ void CmdSketcherConstrainParallel::activated(int iMsg) getSelection().clearSelection(); } -bool CmdSketcherConstrainParallel::isActive(void) +void CmdSketcherConstrainParallel::applyConstraint(std::vector &selSeq, int seqIndex) { - return isCreateConstraintActive( getActiveGuiDocument() ); + switch (seqIndex) { + case 0: // {SelEdge, SelEdge} + case 1: // {SelEdge, SelHAxis} + case 2: // {SelEdge, SelVAxis} + case 3: // {SelHAxis, SelEdge} + case 4: // {SelVAxis, SelEdge} + // TODO: create the constraint + SketcherGui::ViewProviderSketch* sketchgui = static_cast(getActiveGuiDocument()->getInEdit()); + Sketcher::SketchObject* Obj = sketchgui->getSketchObject(); + + int GeoId1 = selSeq.at(0).GeoId, GeoId2 = selSeq.at(1).GeoId; + + // Check that the curves are line segments + if ( Obj->getGeometry(GeoId1)->getTypeId() != Part::GeomLineSegment::getClassTypeId() || + Obj->getGeometry(GeoId2)->getTypeId() != Part::GeomLineSegment::getClassTypeId()) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("The selected edge is not a valid line")); + return; + } + + // undo command open + openCommand("add parallel constraint"); + Gui::Command::doCommand( + Doc, "App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Parallel',%d,%d)) ", + sketchgui->getObject()->getNameInDocument(), GeoId1, GeoId2); + // finish the transaction and update + commitCommand(); + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + bool autoRecompute = hGrp->GetBool("AutoRecompute",false); + + if(autoRecompute) + Gui::Command::updateActive(); + } } +// ====================================================================================== -DEF_STD_CMD_A(CmdSketcherConstrainPerpendicular); +/* XPM */ +static const char *cursor_createperpconstraint[] = { +"32 32 3 1", +" c None", +". c #FFFFFF", +"+ c #FF0000", +" . ", +" . ", +" . ", +" . ", +" . ", +" ", +"..... ..... ", +" ", +" . ", +" . ", +" . ", +" . ++ ", +" . ++ ", +" ++ ", +" ++ ", +" ++ ", +" ++ ", +" ++ ", +" ++ ", +" ++ ", +" ++ ", +" ++ ", +" ++ ", +" ++ ", +" ++ ", +" ++ ", +" ++ ", +" ++ ", +" ++++++++++++++++++++ ", +" ++++++++++++++++++++ ", +" ", +" "}; + +//DEF_STD_CMD_A(CmdSketcherConstrainPerpendicular); +class CmdSketcherConstrainPerpendicular : public CmdSketcherConstraint +{ +public: + CmdSketcherConstrainPerpendicular(); + virtual ~CmdSketcherConstrainPerpendicular(){} + virtual const char* className() const + { return "CmdSketcherConstrainPerpendicular"; } +protected: + virtual void activated(int iMsg); + virtual void applyConstraint(std::vector &selSeq, int seqIndex); +}; CmdSketcherConstrainPerpendicular::CmdSketcherConstrainPerpendicular() - :Command("Sketcher_ConstrainPerpendicular") + :CmdSketcherConstraint("Sketcher_ConstrainPerpendicular") { sAppModule = "Sketcher"; sGroup = QT_TR_NOOP("Sketcher"); @@ -2409,6 +2859,24 @@ CmdSketcherConstrainPerpendicular::CmdSketcherConstrainPerpendicular() sPixmap = "Constraint_Perpendicular"; sAccel = "N"; eType = ForEdit; + + // TODO: there are two more combos: endpoint then curve and endpoint then endpoint + allowedSelSequences = {{SelEdge, SelEdge}, {SelEdge, SelHAxis}, {SelEdge, SelVAxis}, + {SelHAxis, SelEdge}, {SelVAxis, SelEdge}, + {SelVertex, SelEdge, SelEdge}, {SelVertex, SelEdge, SelHAxis}, + {SelVertex, SelEdge, SelVAxis}, {SelVertex, SelHAxis, SelEdge}, + {SelVertex, SelVAxis, SelEdge}, + {SelRoot, SelEdge, SelEdge}, {SelRoot, SelEdge, SelHAxis}, + {SelRoot, SelEdge, SelVAxis}, {SelRoot, SelHAxis, SelEdge}, + {SelRoot, SelVAxis, SelEdge}, + {SelEdge, SelVertex, SelEdge}, {SelEdge, SelVertex, SelHAxis}, + {SelEdge, SelVertex, SelVAxis}, {SelHAxis, SelVertex, SelEdge}, + {SelVAxis, SelVertex, SelEdge}, + {SelEdge, SelRoot, SelEdge}, {SelEdge, SelRoot, SelHAxis}, + {SelEdge, SelRoot, SelVAxis}, {SelHAxis, SelRoot, SelEdge}, + {SelVAxis, SelRoot, SelEdge}}; +; + constraintCursor = cursor_createperpconstraint; } void CmdSketcherConstrainPerpendicular::activated(int iMsg) @@ -2426,10 +2894,14 @@ void CmdSketcherConstrainPerpendicular::activated(int iMsg) // only one sketch with its subelements are allowed to be selected if (selection.size() != 1) { - strError = QObject::tr("Select some geometry from the sketch.", "perpendicular constraint"); - if (!strError.isEmpty()) strError.append(QString::fromLatin1("\n\n")); - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), - strError+strBasicHelp); +// strError = QObject::tr("Select some geometry from the sketch.", "perpendicular constraint"); +// if (!strError.isEmpty()) strError.append(QString::fromLatin1("\n\n")); +// QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), +// strError+strBasicHelp); + + ActivateHandler(getActiveGuiDocument(), + new DrawSketchHandlerGenConstraint(constraintCursor, this)); + getSelection().clearSelection(); return; } @@ -2450,7 +2922,7 @@ void CmdSketcherConstrainPerpendicular::activated(int iMsg) getIdsFromName(SubNames[0], Obj, GeoId1, PosId1); getIdsFromName(SubNames[1], Obj, GeoId2, PosId2); - if (checkBothExternal(GeoId1, GeoId2)){ //checkBothExternal displays error message + if (checkBothExternal(GeoId1, GeoId2)) { //checkBothExternal displays error message showNoConstraintBetweenExternal(); return; } @@ -2773,11 +3245,274 @@ void CmdSketcherConstrainPerpendicular::activated(int iMsg) return; } -bool CmdSketcherConstrainPerpendicular::isActive(void) +void CmdSketcherConstrainPerpendicular::applyConstraint(std::vector &selSeq, int seqIndex) { - return isCreateConstraintActive( getActiveGuiDocument() ); + SketcherGui::ViewProviderSketch* sketchgui = static_cast(getActiveGuiDocument()->getInEdit()); + Sketcher::SketchObject* Obj = sketchgui->getSketchObject(); + QString strError; + + int GeoId1 = Constraint::GeoUndef, GeoId2 = Constraint::GeoUndef, GeoId3 = Constraint::GeoUndef; + Sketcher::PointPos PosId1 = Sketcher::none, PosId2 = Sketcher::none, PosId3 = Sketcher::none; + + switch (seqIndex) { + case 0: // {SelEdge, SelEdge} + case 1: // {SelEdge, SelHAxis} + case 2: // {SelEdge, SelVAxis} + case 3: // {SelHAxis, SelEdge} + case 4: // {SelVAxis, SelEdge} + { + GeoId1 = selSeq.at(0).GeoId; GeoId2 = selSeq.at(1).GeoId; + + const Part::Geometry *geo1 = Obj->getGeometry(GeoId1); + const Part::Geometry *geo2 = Obj->getGeometry(GeoId2); + + if (geo1->getTypeId() != Part::GeomLineSegment::getClassTypeId() && + geo2->getTypeId() != Part::GeomLineSegment::getClassTypeId()) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("One of the selected edges should be a line.")); + return; + } + + if( geo1 && geo2 && + ( geo1->getTypeId() == Part::GeomBSplineCurve::getClassTypeId() || + geo2->getTypeId() == Part::GeomBSplineCurve::getClassTypeId() )){ + + // unsupported until tangent to BSpline at any point implemented. + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("Perpendicular to BSpline edge currently unsupported.")); + return; + } + + if (geo1->getTypeId() == Part::GeomLineSegment::getClassTypeId()) + std::swap(GeoId1,GeoId2); + + // GeoId2 is the line + geo1 = Obj->getGeometry(GeoId1); + geo2 = Obj->getGeometry(GeoId2); + + if( geo1->getTypeId() == Part::GeomEllipse::getClassTypeId() || + geo1->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId() || + geo1->getTypeId() == Part::GeomArcOfHyperbola::getClassTypeId() || + geo1->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() ) { + + Base::Vector3d center; + Base::Vector3d majdir; + Base::Vector3d focus; + double majord = 0; + double minord = 0; + double phi = 0; + + if( geo1->getTypeId() == Part::GeomEllipse::getClassTypeId() ){ + const Part::GeomEllipse *ellipse = static_cast(geo1); + + center=ellipse->getCenter(); + majord=ellipse->getMajorRadius(); + minord=ellipse->getMinorRadius(); + majdir=ellipse->getMajorAxisDir(); + phi=atan2(majdir.y, majdir.x); + } + else if( geo1->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId() ){ + const Part::GeomArcOfEllipse *aoe = static_cast(geo1); + + center=aoe->getCenter(); + majord=aoe->getMajorRadius(); + minord=aoe->getMinorRadius(); + majdir=aoe->getMajorAxisDir(); + phi=atan2(majdir.y, majdir.x); + } + else if( geo1->getTypeId() == Part::GeomArcOfHyperbola::getClassTypeId() ){ + const Part::GeomArcOfHyperbola *aoh = static_cast(geo1); + + center=aoh->getCenter(); + majord=aoh->getMajorRadius(); + minord=aoh->getMinorRadius(); + majdir=aoh->getMajorAxisDir(); + phi=atan2(majdir.y, majdir.x); + } + else if( geo1->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() ){ + const Part::GeomArcOfParabola *aop = static_cast(geo1); + + center=aop->getCenter(); + focus=aop->getFocus(); + } + + const Part::GeomLineSegment *line = static_cast(geo2); + + Base::Vector3d point1=line->getStartPoint(); + Base::Vector3d PoO; + + if( geo1->getTypeId() == Part::GeomArcOfHyperbola::getClassTypeId() ) { + double df=sqrt(majord*majord+minord*minord); + Base::Vector3d direction=point1-(center+majdir*df); // towards the focus + double tapprox=atan2(direction.y,direction.x)-phi; + + PoO = Base::Vector3d(center.x+majord*cosh(tapprox)*cos(phi)-minord*sinh(tapprox)*sin(phi), + center.y+majord*cosh(tapprox)*sin(phi)+minord*sinh(tapprox)*cos(phi), 0); + } + else if( geo1->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() ) { + Base::Vector3d direction=point1-focus; // towards the focus + + PoO = point1 + direction / 2; + } + else { + Base::Vector3d direction=point1-center; + double tapprox=atan2(direction.y,direction.x)-phi; // we approximate the eccentric anomally by the polar + + PoO = Base::Vector3d(center.x+majord*cos(tapprox)*cos(phi)-minord*sin(tapprox)*sin(phi), + center.y+majord*cos(tapprox)*sin(phi)+minord*sin(tapprox)*cos(phi), 0); + } + openCommand("add perpendicular constraint"); + + try { + // Add a point + Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.addGeometry(Part.Point(App.Vector(%f,%f,0)))", + Obj->getNameInDocument(), PoO.x,PoO.y); + int GeoIdPoint = Obj->getHighestCurveIndex(); + + // Point on first object (ellipse, arc of ellipse) + Gui::Command::doCommand(Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('PointOnObject',%d,%d,%d)) ", + Obj->getNameInDocument(),GeoIdPoint,Sketcher::start,GeoId1); + // Point on second object + Gui::Command::doCommand(Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('PointOnObject',%d,%d,%d)) ", + Obj->getNameInDocument(),GeoIdPoint,Sketcher::start,GeoId2); + + // add constraint: Perpendicular-via-point + Gui::Command::doCommand( + Gui::Command::Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('PerpendicularViaPoint',%d,%d,%d,%d))", + Obj->getNameInDocument(), GeoId1, GeoId2 ,GeoIdPoint, Sketcher::start); + + commitCommand(); + } + catch (const Base::Exception& e) { + Base::Console().Error("%s\n", e.what()); + Gui::Command::abortCommand(); + } + + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + bool autoRecompute = hGrp->GetBool("AutoRecompute",false); + + if(autoRecompute) + Gui::Command::updateActive(); + + getSelection().clearSelection(); + return; + + } + + openCommand("add perpendicular constraint"); + Gui::Command::doCommand( + Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Perpendicular',%d,%d)) ", + Obj->getNameInDocument(),GeoId1,GeoId2); + commitCommand(); + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + bool autoRecompute = hGrp->GetBool("AutoRecompute",false); + + if(autoRecompute) + Gui::Command::updateActive(); + + return; + } + case 5: // {SelVertex, SelEdge, SelEdge} + case 6: // {SelVertex, SelEdge, SelHAxis} + case 7: // {SelVertex, SelEdge, SelVAxis} + case 8: // {SelVertex, SelHAxis, SelEdge} + case 9: // {SelVertex, SelVAxis, SelEdge} + case 10: // {SelRoot, SelEdge, SelEdge} + case 11: // {SelRoot, SelEdge, SelHAxis} + case 12: // {SelRoot, SelEdge, SelVAxis} + case 13: // {SelRoot, SelHAxis, SelEdge} + case 14: // {SelRoot, SelVAxis, SelEdge} + { + //let's sink the point to be GeoId3. + GeoId1 = selSeq.at(1).GeoId; GeoId2 = selSeq.at(2).GeoId; GeoId3 = selSeq.at(0).GeoId; + PosId3 = selSeq.at(0).PosId; + + break; + } + case 15: // {SelEdge, SelVertex, SelEdge} + case 16: // {SelEdge, SelVertex, SelHAxis} + case 17: // {SelEdge, SelVertex, SelVAxis} + case 18: // {SelHAxis, SelVertex, SelEdge} + case 19: // {SelVAxis, SelVertex, SelEdge} + case 20: // {SelEdge, SelRoot, SelEdge} + case 21: // {SelEdge, SelRoot, SelHAxis} + case 22: // {SelEdge, SelRoot, SelVAxis} + case 23: // {SelHAxis, SelRoot, SelEdge} + case 24: // {SelVAxis, SelRoot, SelEdge} + { + //let's sink the point to be GeoId3. + GeoId1 = selSeq.at(0).GeoId; GeoId2 = selSeq.at(2).GeoId; GeoId3 = selSeq.at(1).GeoId; + PosId3 = selSeq.at(1).PosId; + + break; + } + default: + return; + } + + if (isEdge(GeoId1, PosId1) && isEdge(GeoId2, PosId2) && isVertex(GeoId3, PosId3)) { + + openCommand("add perpendicular constraint"); + + try{ + //add missing point-on-object constraints + if(! IsPointAlreadyOnCurve(GeoId1, GeoId3, PosId3, Obj)){ + Gui::Command::doCommand( + Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('PointOnObject',%d,%d,%d)) ", + Obj->getNameInDocument(),GeoId3,PosId3,GeoId1); + }; + + if(! IsPointAlreadyOnCurve(GeoId2, GeoId3, PosId3, Obj)){ + Gui::Command::doCommand( + Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('PointOnObject',%d,%d,%d)) ", + Obj->getNameInDocument(),GeoId3,PosId3,GeoId2); + }; + + if(! IsPointAlreadyOnCurve(GeoId1, GeoId3, PosId3, Obj)){//FIXME: it's a good idea to add a check if the sketch is solved + Gui::Command::doCommand( + Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('PointOnObject',%d,%d,%d)) ", + Obj->getNameInDocument(),GeoId3,PosId3,GeoId1); + }; + + Gui::Command::doCommand( + Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('PerpendicularViaPoint',%d,%d,%d,%d)) ", + Obj->getNameInDocument(),GeoId1,GeoId2,GeoId3,PosId3); + } catch (const Base::Exception& e) { + Base::Console().Error("%s\n", e.what()); + QMessageBox::warning(Gui::getMainWindow(), + QObject::tr("Error"), + QString::fromLatin1(e.what())); + Gui::Command::abortCommand(); + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + bool autoRecompute = hGrp->GetBool("AutoRecompute",false); + + if(autoRecompute) // toggling does not modify the DoF of the solver, however it may affect features depending on the sketch + Gui::Command::updateActive(); + + return; + } + + commitCommand(); + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + bool autoRecompute = hGrp->GetBool("AutoRecompute",false); + + if(autoRecompute) + Gui::Command::updateActive(); + + getSelection().clearSelection(); + + return; + + }; + strError = QObject::tr("With 3 objects, there must be 2 curves and 1 point.", "tangent constraint"); + } +// ====================================================================================== DEF_STD_CMD_A(CmdSketcherConstrainTangent); @@ -3121,6 +3856,7 @@ bool CmdSketcherConstrainTangent::isActive(void) return isCreateConstraintActive( getActiveGuiDocument() ); } +// ====================================================================================== DEF_STD_CMD_AU(CmdSketcherConstrainRadius); @@ -3445,6 +4181,8 @@ bool CmdSketcherConstrainRadius::isActive(void) return isCreateConstraintActive( getActiveGuiDocument() ); } +// ====================================================================================== + DEF_STD_CMD_AU(CmdSketcherConstrainAngle); CmdSketcherConstrainAngle::CmdSketcherConstrainAngle() @@ -3741,6 +4479,8 @@ bool CmdSketcherConstrainAngle::isActive(void) return isCreateConstraintActive( getActiveGuiDocument() ); } +// ====================================================================================== + DEF_STD_CMD_A(CmdSketcherConstrainEqual); CmdSketcherConstrainEqual::CmdSketcherConstrainEqual() @@ -3868,6 +4608,7 @@ bool CmdSketcherConstrainEqual::isActive(void) return isCreateConstraintActive( getActiveGuiDocument() ); } +// ====================================================================================== DEF_STD_CMD_A(CmdSketcherConstrainSymmetric); @@ -4040,6 +4781,8 @@ bool CmdSketcherConstrainSymmetric::isActive(void) return isCreateConstraintActive( getActiveGuiDocument() ); } +// ====================================================================================== + DEF_STD_CMD_A(CmdSketcherConstrainSnellsLaw); CmdSketcherConstrainSnellsLaw::CmdSketcherConstrainSnellsLaw() @@ -4197,6 +4940,7 @@ bool CmdSketcherConstrainSnellsLaw::isActive(void) return isCreateConstraintActive( getActiveGuiDocument() ); } +// ====================================================================================== DEF_STD_CMD_A(CmdSketcherConstrainInternalAlignment); @@ -4621,6 +5365,7 @@ bool CmdSketcherConstrainInternalAlignment::isActive(void) return isCreateConstraintActive( getActiveGuiDocument() ); } +// ====================================================================================== /*** Creation Mode / Toggle to or from Reference ***/ DEF_STD_CMD_A(CmdSketcherToggleDrivingConstraint); @@ -4743,7 +5488,7 @@ void CmdSketcherToggleDrivingConstraint::activated(int iMsg) bool CmdSketcherToggleDrivingConstraint::isActive(void) { - return isCreateConstraintActive( getActiveGuiDocument() ); + return isCreateGeoActive( getActiveGuiDocument() ); } void CreateSketcherCommandsConstraints(void) diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp index 1a24e40911..6dafdcbb99 100644 --- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp @@ -4326,6 +4326,8 @@ public: , EditCurve(2) , CurrentConstraint(0) , ConstrMethod(constructionMethod) + , IsClosed(false) + , FirstPoleGeoId(-2000) { std::vector sugConstr1; sugConstr.push_back(sugConstr1); @@ -4382,20 +4384,109 @@ public: EditCurve[0] = onSketchPos; Mode = STATUS_SEEK_ADDITIONAL_CONTROLPOINTS; + + // insert circle point for pole, defer internal alignment constraining. + try { + Gui::Command::openCommand("Add Pole circle"); + + //Add pole + Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.addGeometry(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),10),True)", + sketchgui->getObject()->getNameInDocument(), + EditCurve[0].x,EditCurve[0].y); + + } + catch (const Base::Exception& e) { + Base::Console().Error("%s\n", e.what()); + Gui::Command::abortCommand(); + + static_cast(sketchgui->getObject())->solve(); + + return false; + } + + //Gui::Command::commitCommand(); + + //static_cast(sketchgui->getObject())->solve(); + + FirstPoleGeoId = getHighestCurveIndex(); + + // add auto constraints on pole + if (sugConstr[CurrentConstraint].size() > 0) { + createAutoConstraints(sugConstr[CurrentConstraint], FirstPoleGeoId, Sketcher::mid, false); + } + + static_cast(sketchgui->getObject())->solve(); + std::vector sugConstrN; sugConstr.push_back(sugConstrN); CurrentConstraint++; + } else if (Mode == STATUS_SEEK_ADDITIONAL_CONTROLPOINTS) { EditCurve[EditCurve.size()-1] = onSketchPos; - // finish adding controlpoints on double click - if (EditCurve[EditCurve.size()-2] == EditCurve[EditCurve.size()-1]) { - EditCurve.pop_back(); - Mode = STATUS_CLOSE; + // check if coincident with first pole + for(std::vector::const_iterator it = sugConstr[CurrentConstraint].begin(); it != sugConstr[CurrentConstraint].end(); it++) { + if( (*it).Type == Sketcher::Coincident && (*it).GeoId == FirstPoleGeoId && (*it).PosId == Sketcher::mid ) { + + IsClosed = true; + } } - else { + + if (IsClosed) { + Mode = STATUS_CLOSE; + + if (ConstrMethod == 1) { // if periodic we do not need the last pole + EditCurve.pop_back(); + sugConstr.pop_back(); + + return true; + } + + + } + + // insert circle point for pole, defer internal alignment constraining. + try { + + //Gui::Command::openCommand("Add Pole circle"); + + //Add pole + Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.addGeometry(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),10),True)", + sketchgui->getObject()->getNameInDocument(), + EditCurve[EditCurve.size()-1].x,EditCurve[EditCurve.size()-1].y); + + if(EditCurve.size() == 2) { + Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Radius',%d,%f)) ", + sketchgui->getObject()->getNameInDocument(), FirstPoleGeoId, round( (EditCurve[1]-EditCurve[0]).Length()/6 )); + } + + Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Equal',%d,%d)) ", + sketchgui->getObject()->getNameInDocument(), FirstPoleGeoId, FirstPoleGeoId+ EditCurve.size()-1); + + } + catch (const Base::Exception& e) { + Base::Console().Error("%s\n", e.what()); + Gui::Command::abortCommand(); + + static_cast(sketchgui->getObject())->solve(); + + return false; + } + + //Gui::Command::commitCommand(); + + //static_cast(sketchgui->getObject())->solve(); + + // add auto constraints on pole + if (sugConstr[CurrentConstraint].size() > 0) { + createAutoConstraints(sugConstr[CurrentConstraint], FirstPoleGeoId + EditCurve.size()-1, Sketcher::mid, false); + } + + //static_cast(sketchgui->getObject())->solve(); + + if (!IsClosed) { EditCurve.resize(EditCurve.size() + 1); // add one place for a pole std::vector sugConstrN; sugConstr.push_back(sugConstrN); @@ -4432,25 +4523,34 @@ public: try { - Gui::Command::openCommand("Add B-spline curve"); + //Gui::Command::openCommand("Add B-spline curve"); - //Add arc of parabola - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.addGeometry(Part.BSplineCurve" - "(%s,%s)," - "%s)", - sketchgui->getObject()->getNameInDocument(), - controlpoints.c_str(), - ConstrMethod == 0 ?"False":"True", - geometryCreationMode==Construction?"True":"False"); + //Add arc of parabola + Gui::Command::doCommand(Gui::Command::Doc, + "App.ActiveDocument.%s.addGeometry(Part.BSplineCurve" + "(%s,%s)," + "%s)", + sketchgui->getObject()->getNameInDocument(), + controlpoints.c_str(), + ConstrMethod == 0 ?"False":"True", + geometryCreationMode==Construction?"True":"False"); - currentgeoid++; - - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.ExposeInternalGeometry(%d)", - sketchgui->getObject()->getNameInDocument(), - currentgeoid); + currentgeoid++; + // Constraint pole circles to bspline. + std::stringstream cstream; + + cstream << "conList = []\n"; + + for (size_t i = 0; i < EditCurve.size(); i++) { + cstream << "conList.append(Sketcher.Constraint('InternalAlignment:Sketcher::BSplineControlPoint'," << FirstPoleGeoId+i + << "," << Sketcher::mid << "," << currentgeoid << "," << i << "))\n"; + } + + cstream << "App.ActiveDocument."<< sketchgui->getObject()->getNameInDocument() << ".addConstraint(conList)\n"; + + Gui::Command::doCommand(Gui::Command::Doc, cstream.str().c_str()); + } catch (const Base::Exception& e) { Base::Console().Error("%s\n", e.what()); @@ -4469,15 +4569,6 @@ public: Gui::Command::commitCommand(); - int poleindex=0; - for(std::vector>::iterator it=sugConstr.begin(); it != sugConstr.end(); it++, poleindex++) { - // add auto constraints - if ((*it).size() > 0) { - createAutoConstraints((*it), currentgeoid+1+poleindex, Sketcher::mid); - (*it).clear(); - } - } - ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); bool autoRecompute = hGrp->GetBool("AutoRecompute",false); @@ -4495,6 +4586,15 @@ public: sketchgui->drawEdit(EditCurve); EditCurve.resize(2); applyCursor(); + + sugConstr.clear(); + + std::vector sugConstr1; + sugConstr.push_back(sugConstr1); + + CurrentConstraint=0; + IsClosed=false; + /* It is ok not to call to purgeHandler * in continuous creation mode because the * handler is destroyed by the quit() method on pressing the @@ -4506,6 +4606,60 @@ public: } return true; } + + virtual void quit(void) { + // We must see if we need to create a BSpline before cancelling everything + // and now just like any other Handler, + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + + bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true); + + if (CurrentConstraint > 1) { + // create bspline from existing poles + Mode=STATUS_CLOSE; + EditCurve.pop_back(); + this->releaseButton(Base::Vector2d(0.f,0.f)); + } + else if(CurrentConstraint == 1) { + // if we just have one point and we can not close anything, then cancel this creation but continue according to continuous mode + //sketchgui->getDocument()->undo(1); + + Gui::Command::abortCommand(); + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + bool autoRecompute = hGrp->GetBool("AutoRecompute",false); + + if(autoRecompute) + Gui::Command::updateActive(); + else + static_cast(sketchgui->getObject())->solve(); + + if(!continuousMode){ + DrawSketchHandler::quit(); + } + else { + // This code disregards existing data and enables the continuous creation mode. + Mode = STATUS_SEEK_FIRST_CONTROLPOINT; + EditCurve.clear(); + sketchgui->drawEdit(EditCurve); + EditCurve.resize(2); + applyCursor(); + + sugConstr.clear(); + + std::vector sugConstr1; + sugConstr.push_back(sugConstr1); + + CurrentConstraint=0; + IsClosed=false; + } + } + else { // we have no data (CurrentConstraint == 0) so user when right-clicking really wants to exit + DrawSketchHandler::quit(); + } + } + protected: SELECT_MODE Mode; @@ -4515,6 +4669,8 @@ protected: int CurrentConstraint; int ConstrMethod; + bool IsClosed; + int FirstPoleGeoId; }; DEF_STD_CMD_A(CmdSketcherCreateBSpline) diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp index fb4554e7ae..cc8a783ec8 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp +++ b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp @@ -383,15 +383,18 @@ int DrawSketchHandler::seekAutoConstraint(std::vector &suggested } void DrawSketchHandler::createAutoConstraints(const std::vector &autoConstrs, - int geoId1, Sketcher::PointPos posId1) + int geoId1, Sketcher::PointPos posId1, bool createowncommand /*= true*/) { if (!sketchgui->Autoconstraints.getValue()) return; // If Autoconstraints property is not set quit if (autoConstrs.size() > 0) { - // Open the Command - Gui::Command::openCommand("Add auto constraints"); - + + if(createowncommand) { + // Open the Command + Gui::Command::openCommand("Add auto constraints"); + } + // Iterate through constraints std::vector::const_iterator it = autoConstrs.begin(); for (; it != autoConstrs.end(); ++it) { @@ -512,7 +515,9 @@ void DrawSketchHandler::createAutoConstraints(const std::vector break; } - Gui::Command::commitCommand(); + if(createowncommand) { + Gui::Command::commitCommand(); + } //Gui::Command::updateActive(); // There is already an recompute in each command creation, this is redundant. } } diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandler.h b/src/Mod/Sketcher/Gui/DrawSketchHandler.h index b713374056..cbdd47a147 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandler.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandler.h @@ -82,8 +82,10 @@ public: int seekAutoConstraint(std::vector &suggestedConstraints, const Base::Vector2d &Pos, const Base::Vector2d &Dir, AutoConstraint::TargetType type = AutoConstraint::VERTEX); + // createowncommand indicates whether a separate command shall be create and committed (for example for undo purposes) or not + // is not it is the responsibility of the developer to create and commit the command appropriately. void createAutoConstraints(const std::vector &autoConstrs, - int geoId, Sketcher::PointPos pointPos=Sketcher::none); + int geoId, Sketcher::PointPos pointPos=Sketcher::none, bool createowncommand = true); void setPositionText(const Base::Vector2d &Pos, const SbString &text); void setPositionText(const Base::Vector2d &Pos); diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Concentric.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Concentric.svg index 3b08248dc5..1dea829611 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Concentric.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Concentric.svg @@ -1,518 +1,135 @@ - - - - - - + + + + + - - - - - - + + + - - - - - + + + + + + - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_Concentric + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Concentric.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Axis_Angle.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Axis_Angle.svg index 4a6bbb9dfd..5b39030a4a 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Axis_Angle.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Axis_Angle.svg @@ -1,305 +1,98 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_Ellipse_Axis_Angle + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Axis_Angle.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Major_Radius.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Major_Radius.svg index ebc40747d6..a77b30b1ea 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Major_Radius.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Major_Radius.svg @@ -1,302 +1,93 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_Ellipse_Major_Radius + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Major_Radius.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Minor_Radius.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Minor_Radius.svg index a5947cb53b..de8774bb82 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Minor_Radius.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Minor_Radius.svg @@ -1,303 +1,93 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_Ellipse_Minor_Radius + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Minor_Radius.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Radii.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Radii.svg index 9a94b57436..1df060ede4 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Radii.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Radii.svg @@ -1,312 +1,96 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_Ellipse_Radii + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Ellipse_Radii.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_EqualLength.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_EqualLength.svg index 37711708ef..2be8fae4b7 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_EqualLength.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_EqualLength.svg @@ -1,390 +1,99 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_EqualLength + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_EqualLength.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_ExternalAngle.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_ExternalAngle.svg index ae49a4df9b..99070bb3a7 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_ExternalAngle.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_ExternalAngle.svg @@ -1,304 +1,93 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_ExternalAngle + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_ExternalAngle.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Horizontal.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Horizontal.svg index 5fed847668..1f72a138cb 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Horizontal.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Horizontal.svg @@ -1,253 +1,78 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_Horizontal + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Horizontal.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_HorizontalDistance.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_HorizontalDistance.svg index 09d7c022ff..d39d8770cf 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_HorizontalDistance.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_HorizontalDistance.svg @@ -1,252 +1,82 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_HorizontalDistance + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_HorizontalDistance.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_HorizontalDistance_Driven.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_HorizontalDistance_Driven.svg index 43478c2273..2185a683b3 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_HorizontalDistance_Driven.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_HorizontalDistance_Driven.svg @@ -1,244 +1,82 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_HorizontalDistance_Driven + 2015-05-18 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_HorizontalDistance_Driven.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment.svg index 2293626453..0cda31b148 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment.svg @@ -1,323 +1,101 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_InternalAlignment + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_Focus1.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_Focus1.svg index dfe5601fa8..287bbaceb2 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_Focus1.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_Focus1.svg @@ -1,303 +1,91 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_InternalAlignment_Ellipse_Focus1 + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_ + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_Focus2.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_Focus2.svg index 244afae160..aaa5f5e3f9 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_Focus2.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_Focus2.svg @@ -1,303 +1,91 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_InternalAlignment_Ellipse_Focus2 + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_ + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_MajorAxis.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_MajorAxis.svg index 372541c399..18d63dee19 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_MajorAxis.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_MajorAxis.svg @@ -1,303 +1,90 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_InternalAlignment_Ellipse_MajorAxis + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_MajorAxis.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_MinorAxis.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_MinorAxis.svg index af6b9c8fa1..972460f88c 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_MinorAxis.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_MinorAxis.svg @@ -1,303 +1,90 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_InternalAlignment_Ellipse_MinorAxis + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAlignment_Ellipse_MinorAxis.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAngle.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAngle.svg index 7d78cca957..a3de0c2633 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAngle.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAngle.svg @@ -1,276 +1,90 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_InternalAngle + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAngle.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAngle_Driven.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAngle_Driven.svg index 821578a688..0a8d438d13 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAngle_Driven.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAngle_Driven.svg @@ -1,274 +1,90 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_InternalAngle_Driven + 2015-05-18 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_InternalAngle_Driven.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Length.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Length.svg index d4d00bb346..4a539f480d 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Length.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Length.svg @@ -1,369 +1,99 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_Length + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Length.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Length_Driven.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Length_Driven.svg index 19a124c692..c13bcb663a 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Length_Driven.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Length_Driven.svg @@ -1,367 +1,102 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_Length_Driven + 2015-05-18 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Length_Driven.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Parallel.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Parallel.svg index 37d12ebc41..66ba5d5a88 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Parallel.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Parallel.svg @@ -1,541 +1,134 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_Parallel + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Parallel.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Perpendicular.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Perpendicular.svg index df64b8ecb1..e07aca5d21 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Perpendicular.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Perpendicular.svg @@ -1,539 +1,130 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_Perpendicular + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Perpendicular.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnEnd.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnEnd.svg index fb4a8af29e..13d48606bc 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnEnd.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnEnd.svg @@ -1,429 +1,119 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - + + + + + - - + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_PointOnEnd + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnEnd.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnMidPoint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnMidPoint.svg index bd900563cb..adfd474adf 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnMidPoint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnMidPoint.svg @@ -1,275 +1,93 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + - - + + - + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_PointOnMidPoint + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnMidPoint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnObject.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnObject.svg index a0910aaebe..0342a70174 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnObject.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnObject.svg @@ -1,483 +1,125 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - - + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_PointOnObject + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnObject.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnPoint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnPoint.svg index 0a1a154979..f4f3c49321 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnPoint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnPoint.svg @@ -1,305 +1,92 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + + - - - - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_PointOnPoint + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnPoint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnStart.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnStart.svg index ba758ac3cd..55b680a364 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnStart.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnStart.svg @@ -1,414 +1,115 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - + + + + + - - + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_PointOnStart + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointOnStart.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointToObject.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointToObject.svg index f5b69e51ab..c00fcd401a 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointToObject.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointToObject.svg @@ -1,337 +1,103 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + + - - - + + + - + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_PointToObject + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_PointToObject.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Radius.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Radius.svg index 523ef35839..6aa6d1dfe7 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Radius.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Radius.svg @@ -1,301 +1,93 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_Radius + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Radius.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Radius_Driven.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Radius_Driven.svg index c1a91ce241..dabfb16302 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Radius_Driven.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Radius_Driven.svg @@ -1,299 +1,93 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_Radius_Driven + 2015-05-18 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Radius_Driven.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_SnellsLaw.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_SnellsLaw.svg index e2e5c58deb..32e4682156 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_SnellsLaw.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_SnellsLaw.svg @@ -1,661 +1,154 @@ - - - - - + + + + - - + + - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + - - + + - - + + + + - + image/svg+xml - - + + + + + [DeepSOIC] + + + Constraint_SnellsLaw + 2014-12-13 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_SnellsLaw.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_SnellsLaw_Driven.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_SnellsLaw_Driven.svg index 077cb56ce5..748397298e 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_SnellsLaw_Driven.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_SnellsLaw_Driven.svg @@ -1,661 +1,154 @@ - - - - - + + + + - - + + - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + - - + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_SnellsLaw_Driven + 2015-05-18 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_SnellsLaw_Driven.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Symmetric.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Symmetric.svg index 67ff354376..a0f22c6176 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Symmetric.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Symmetric.svg @@ -1,413 +1,121 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_Symmetric + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Symmetric.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Tangent.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Tangent.svg index 226bf57d78..6ad4e9c119 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Tangent.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Tangent.svg @@ -1,309 +1,97 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_Tangent + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Tangent.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_TangentToEnd.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_TangentToEnd.svg index f54e128a55..792b9ff1f9 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_TangentToEnd.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_TangentToEnd.svg @@ -1,331 +1,100 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_TangentToEnd + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_TangentToEnd.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_TangentToStart.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_TangentToStart.svg index 48a28b7e52..af535fd3ac 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_TangentToStart.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_TangentToStart.svg @@ -1,324 +1,99 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_TangentToStart + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_TangentToStart.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Vertical.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Vertical.svg index 8496434a4b..9df4293d58 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Vertical.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Vertical.svg @@ -1,244 +1,80 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_Vertical + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_Vertical.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_VerticalDistance.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_VerticalDistance.svg index edfb020ec1..df7e02e2f8 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_VerticalDistance.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_VerticalDistance.svg @@ -1,253 +1,79 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Constraint_VerticalDistance + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_VerticalDistance.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_VerticalDistance_Driven.svg b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_VerticalDistance_Driven.svg index 182e418350..ac0e447607 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Constraint_VerticalDistance_Driven.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Constraint_VerticalDistance_Driven.svg @@ -1,245 +1,82 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Constraint_VerticalDistance_Driven + 2015-05-18 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Constraint_VerticalDistance_Driven.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/SketcherWorkbench.svg b/src/Mod/Sketcher/Gui/Resources/icons/SketcherWorkbench.svg index 7fab95aaca..248712849b 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/SketcherWorkbench.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/SketcherWorkbench.svg @@ -1,190 +1,75 @@ - - - - - - + + + + + - - - + + + - - - + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [triplus] + + + SketcherWorkbench + 2016-02-26 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/SketcherWorkbench.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_AlterConstruction.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_AlterConstruction.svg index efc3c81b08..f636bb4133 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_AlterConstruction.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_AlterConstruction.svg @@ -1,1132 +1,225 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_AlterConstruction + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_AlterConstruction.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + - - - + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_AlterFillet.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_AlterFillet.svg index 2ebd380c5c..d8a77d3195 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_AlterFillet.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_AlterFillet.svg @@ -1,473 +1,156 @@ - - - - - + + + + - - - + + + + + - - - - + + + - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_AlterFillet + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Alter + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + - - - - - - - - + + + + - - - + + + + + - - - + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Clone.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Clone.svg index a8aeaf98cd..eea0f978af 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Clone.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Clone.svg @@ -1,335 +1,131 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Clone + 2015-08-15 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Clone.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CloseShape.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CloseShape.svg index d229e53620..5e464591f3 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CloseShape.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CloseShape.svg @@ -1,309 +1,126 @@ - - - - - - + + + + + - - - - - - - - - + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_CloseShape + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CloseShape.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + - - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics.svg index 7fbd83ee9d..9860a5f71e 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics.svg @@ -1,338 +1,124 @@ - - - - - - + + + + + - - - + + + - - + + + - - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - - + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Conics + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Constr.svg index e203455481..b14b092280 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Constr.svg @@ -1,324 +1,124 @@ - - - - - - + + + + + - - - + + + - - + + + - - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - - + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Conics_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Ellipse_3points.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Ellipse_3points.svg index a02cd33179..de9e54956e 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Ellipse_3points.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Ellipse_3points.svg @@ -1,410 +1,174 @@ - - - - - - + + + + + - - - + + + - - + + + - - - + + + - - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - - + + + - - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Conics_Ellipse_3points + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Ellipse_3points.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Ellipse_Center.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Ellipse_Center.svg index 2a15f272a5..38ea01cb66 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Ellipse_Center.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Ellipse_Center.svg @@ -1,411 +1,191 @@ - - - - - - + + + + + - - - + + + - - + + + - - - + + + - - - + + + - - - + + + - - - + + - - - + + + - - - + + + - - - - - - - + + + - - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Conics_Ellipse_Center + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Conics_Ellipse_Center.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConnectLines.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConnectLines.svg index 3975a8a831..6a5b9287b8 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConnectLines.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConnectLines.svg @@ -1,303 +1,114 @@ - - - - - - + + + + + - - - - - - - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_ConnectLines + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConnectLines.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + - + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainCoincident.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainCoincident.svg index 5ddf32a45a..6178a89d3c 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainCoincident.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainCoincident.svg @@ -1,205 +1,82 @@ - - - - - + + + + + - - - - - - + + + - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + - + image/svg+xml - + + + + [wmayer] + + + Sketcher_ConstrainCoincident + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainCoincident.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainDistance.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainDistance.svg index 18e29c1e2f..4619685371 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainDistance.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainDistance.svg @@ -1,86 +1,62 @@ - - - - + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_ConstrainDistance + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainDistance.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - 12.1 + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainHorizontal.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainHorizontal.svg index a91c4674db..a896a9aefa 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainHorizontal.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainHorizontal.svg @@ -1,141 +1,65 @@ - - - - - - - - + + + + + - - - - + + + + + + - + + + + + + + - - + + + + - + image/svg+xml - + + + + [wmayer] + + + Sketcher_ConstrainHorizontal + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainHorizontal.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - H - H + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainLock.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainLock.svg index b97df38c1d..0a66995b74 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainLock.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainLock.svg @@ -1,442 +1,139 @@ - - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_ConstrainLock + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainLock.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainLock_Driven.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainLock_Driven.svg index 6c94875fb0..eeb4789838 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainLock_Driven.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainLock_Driven.svg @@ -1,434 +1,140 @@ - - - - - - + + + + + - - - - - - + + + - - - - - + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_ConstrainLock_Driven + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainLock_Driven.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainParallel.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainParallel.svg index 3ca4915bc0..35310e4af5 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainParallel.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainParallel.svg @@ -1,74 +1,57 @@ - - - - + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_ConstrainParallel + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainParallel.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - P + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainVertical.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainVertical.svg index 32185e1865..bcf6f1fe57 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainVertical.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainVertical.svg @@ -1,131 +1,68 @@ - - - - - - - + + + + + - - - - + + + + + - + + + + + + + - - + + + + - + image/svg+xml - + + + + [wmayer] + + + Sketcher_ConstrainVertical + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainVertical.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - V - V + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Copy.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Copy.svg index b7452765c5..ef16d96910 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Copy.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Copy.svg @@ -1,308 +1,129 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Copy + 2015-08-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Copy.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointArc.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointArc.svg index c454a530e3..b5be853e3f 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointArc.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointArc.svg @@ -1,280 +1,100 @@ - - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Create3PointArc + 2014-03-15 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointArc.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointArc_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointArc_Constr.svg index b6e88b1094..aed5521a06 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointArc_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointArc_Constr.svg @@ -1,280 +1,100 @@ - - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Create3PointArc_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointArc_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointCircle.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointCircle.svg index e07fdab345..5d17724733 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointCircle.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointCircle.svg @@ -1,304 +1,132 @@ - - - - - - + + + + + + - - - - + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Create3PointCircle + 2014-03-29 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointCircle.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - + + + - - - - - - - - - - + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointCircle_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointCircle_Constr.svg index 09ed2f8d77..5013ede70a 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointCircle_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointCircle_Constr.svg @@ -1,292 +1,132 @@ - - - - - - + + + + + + - - - - + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Create3PointCircle_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create3PointCircle_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - + + + + + + + + - - - - - - - - - - - + + + - - - - - - - - - - + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateArc.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateArc.svg index ff947c8be6..a93bfa1dbb 100755 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateArc.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateArc.svg @@ -1,207 +1,99 @@ - - - - - - - - + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - + + + + [wmayer] + + + Sketcher_CreateArc + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateArc.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateArc_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateArc_Constr.svg index ac52eeed83..a53e19a086 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateArc_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateArc_Constr.svg @@ -1,185 +1,96 @@ - - - - - - - - + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateArc_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateArc_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + + - - - + + + + + - - - + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateBSpline.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateBSpline.svg index 515b50e49b..7f5707c2a2 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateBSpline.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateBSpline.svg @@ -1,537 +1,108 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateBSpline + 2017-01-07 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateBSpline.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateBSpline_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateBSpline_Constr.svg index 04c6f5b338..42445f2e6c 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateBSpline_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateBSpline_Constr.svg @@ -1,537 +1,108 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateBSpline_Constr + 2017-01-07 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateBSpline_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateCircle.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateCircle.svg index 025f9ff12c..1786327406 100755 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateCircle.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateCircle.svg @@ -1,170 +1,96 @@ - - - - - - - + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - + + + + [wmayer] + + + Sketcher_CreateCircle + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateCircle.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateCircle_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateCircle_Constr.svg index 59ffde7743..3810439c8d 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateCircle_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateCircle_Constr.svg @@ -1,171 +1,97 @@ - - - - - - - + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateCircle_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateCircle_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse.svg index 1b22b95bf6..bccb53f1c9 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse.svg @@ -1,334 +1,107 @@ - - - - - - + + + + + - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateEllipse + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - - - - - - + + + - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_3points.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_3points.svg index c81765c1a8..cc91e2b22a 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_3points.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_3points.svg @@ -1,334 +1,107 @@ - - - - - - + + + + + - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateEllipse_3points + 2014-10-28 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_3points.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - - - - - - + + + - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_3points_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_3points_Constr.svg index 9ce25a74cd..64e48baf7a 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_3points_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_3points_Constr.svg @@ -1,327 +1,102 @@ - - - - - - + + + + + - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateEllipse_3points_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_3points_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - - - - - - + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_Constr.svg index fc5517e185..51f6a74798 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_Constr.svg @@ -1,327 +1,102 @@ - - - - - - + + + + + - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateEllipse_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateEllipse_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - - - - - - + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateFillet.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateFillet.svg index 67cb87ccd1..38bb5b96c3 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateFillet.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateFillet.svg @@ -1,331 +1,111 @@ - - - - - - - - + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_CreateFillet + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHeptagon.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHeptagon.svg index 73b66fae72..c54ccdb0d6 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHeptagon.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHeptagon.svg @@ -1,291 +1,102 @@ - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + - + image/svg+xml - - + + + + + [Johan K] + + + Sketcher_CreateHeptagon + 2014-07-27 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHeptagon.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + - - - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHeptagon_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHeptagon_Constr.svg index 5719a9d2b2..0204ec5c4e 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHeptagon_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHeptagon_Constr.svg @@ -1,317 +1,102 @@ - - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateHeptagon_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHeptagon_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + - - - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHexagon.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHexagon.svg index d923d79ec6..7e50628815 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHexagon.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHexagon.svg @@ -1,252 +1,102 @@ - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + - + image/svg+xml - - + + + + + [Johan K] + + + Sketcher_CreateHexagon + 2014-07-27 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHexagon.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + - - - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHexagon_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHexagon_Constr.svg index 7609b97411..f367753451 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHexagon_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHexagon_Constr.svg @@ -1,278 +1,102 @@ - - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateHexagon_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateHexagon_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + - - - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateLine.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateLine.svg index a09621215a..b07bbabb61 100755 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateLine.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateLine.svg @@ -1,173 +1,84 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - + image/svg+xml - + + + + [wmayer] + + + Sketcher_CreateLine + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateLine.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateLine_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateLine_Constr.svg index 7d71e1cf74..52139855dc 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateLine_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateLine_Constr.svg @@ -1,174 +1,85 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateLine_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateLine_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateOctagon.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateOctagon.svg index 14a4266af5..a312eb43e8 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateOctagon.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateOctagon.svg @@ -1,291 +1,102 @@ - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + - + image/svg+xml - - + + + + + [Johan K] + + + Sketcher_CreateOctagon + 2014-07-27 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateOctagon.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + - - - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateOctagon_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateOctagon_Constr.svg index d253f61301..495f261c65 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateOctagon_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateOctagon_Constr.svg @@ -1,317 +1,102 @@ - - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateOctagon_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateOctagon_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + - - - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePentagon.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePentagon.svg index 7e93cc4243..7507669063 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePentagon.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePentagon.svg @@ -1,271 +1,95 @@ - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + - + image/svg+xml - - + + + + + [Johan K] + + + Sketcher_CreatePentagon + 2014-07-27 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePentagon.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + + + + - - - + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePentagon_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePentagon_Constr.svg index fb80092740..dae239a31d 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePentagon_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePentagon_Constr.svg @@ -1,297 +1,95 @@ - - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreatePentagon_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePentagon_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + - - - + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePoint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePoint.svg index b69c7cc25f..1f1ba157d2 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePoint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePoint.svg @@ -1,172 +1,73 @@ - - - - - - + + + + + - - - - - - + + + + + + + + + + + + + - - - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_CreatePoint + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePoint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePolyline.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePolyline.svg index 4f6f943691..56f2485c0e 100755 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePolyline.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePolyline.svg @@ -1,292 +1,107 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + - + image/svg+xml - + + + + [wmayer] + + + Sketcher_CreatePolyline + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePolyline.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - + + + + + + + + + + + + - - - + + + + + - - - + + + + + - - - + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePolyline_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePolyline_Constr.svg index dcebc8ac81..1951cb4c71 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePolyline_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePolyline_Constr.svg @@ -1,270 +1,109 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreatePolyline_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePolyline_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - + + + + + + + + + + + + + - - - + + + + + - - - + + + + + - - - + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateRectangle.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateRectangle.svg index 9a25a5e56c..a2b679eb83 100755 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateRectangle.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateRectangle.svg @@ -1,166 +1,79 @@ - - - - - - - + + + + + + + + + + + + + + + + + + - - - - + + + + - + image/svg+xml - + + + + [wmayer] + + + Sketcher_CreateRectangle + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateRectangle.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - + + + + + + - - - + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateRectangle_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateRectangle_Constr.svg index 2943dcb369..68c4941b2d 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateRectangle_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateRectangle_Constr.svg @@ -1,167 +1,80 @@ - - - - - - - + + + + + + + + + + + + + + + + + + - - - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateRectangle_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateRectangle_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - + + + + + + - - - + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot.svg index 6a0c985b3d..a3f35350b0 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot.svg @@ -1,246 +1,92 @@ - - - - - - - + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [jriegel] + + + Sketcher_CreateSlot + 2014-04-15 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot_Constr.svg index 89ea523fbc..3ff6cda88b 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot_Constr.svg @@ -1,221 +1,93 @@ - - - - - - - + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateSlot_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSlot_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSquare.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSquare.svg index f306183f7e..2fc6f89b34 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSquare.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSquare.svg @@ -1,331 +1,102 @@ - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + - + image/svg+xml - - + + + + + [Johan K] + + + Sketcher_CreateSquare + 2014-07-27 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSquare.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + + + + + - - - + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSquare_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSquare_Constr.svg index f211a5a64b..f2747643af 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSquare_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSquare_Constr.svg @@ -1,357 +1,102 @@ - - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateSquare_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateSquare_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + - - - + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateText.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateText.svg index 4b7627e60e..013150533e 100755 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateText.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateText.svg @@ -1,80 +1,60 @@ - - - - + + + + + + + + + + + + + - - + + + + - + image/svg+xml - + + + + [wmayer] + + + Sketcher_CreateText + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateText.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateTriangle.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateTriangle.svg index 50447ee59f..bf86420194 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateTriangle.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateTriangle.svg @@ -1,354 +1,95 @@ - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + - + image/svg+xml - - + + + + + [Johan K] + + + Sketcher_CreateTriangle + 2014-07-27 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateTriangle.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateTriangle_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateTriangle_Constr.svg index 234b9296a4..4388fcd245 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateTriangle_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateTriangle_Constr.svg @@ -1,380 +1,95 @@ - - - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_CreateTriangle_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateTriangle_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + - - - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create_Periodic_BSpline.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create_Periodic_BSpline.svg index be7873673b..fc2c0de01b 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create_Periodic_BSpline.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create_Periodic_BSpline.svg @@ -1,488 +1,123 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Create_Periodic_BSpline + 2017-01-13 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create_Periodic_BSpline.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create_Periodic_BSpline_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create_Periodic_BSpline_Constr.svg index 851eed083a..a0dffd2be5 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create_Periodic_BSpline_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create_Periodic_BSpline_Constr.svg @@ -1,484 +1,123 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Create_Periodic_BSpline_Constr + 2017-01-13 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Create_Periodic_BSpline_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_DraftLine.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_DraftLine.svg index 6e417fc5e3..b4945da1ad 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_DraftLine.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_DraftLine.svg @@ -1,126 +1,61 @@ - - - + + + - - + + + + - + image/svg+xml - + + + + [wmayer] + + + Sketcher_DraftLine + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_DraftLine.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_EditSketch.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_EditSketch.svg index 2e92cb42eb..04b706c728 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_EditSketch.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_EditSketch.svg @@ -1,278 +1,93 @@ - - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - - - + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_EditSketch + 2014-07-13 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_EditSketch.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + + + + + + - - - - - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_Edge.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_Edge.svg index c652db87c4..f696c30d58 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_Edge.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_Edge.svg @@ -1,275 +1,100 @@ - - - - - - - - + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Element_Arc_Edge + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_Edge.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + - - - - - - - + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_EndPoint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_EndPoint.svg index 2bbf29df73..173e35a9c1 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_EndPoint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_EndPoint.svg @@ -1,220 +1,100 @@ - - - - - - + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Element_Arc_EndPoint + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_EndPoint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + - - - - + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_MidPoint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_MidPoint.svg index f6f6f0790b..3fe1ed3ed4 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_MidPoint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_MidPoint.svg @@ -1,214 +1,104 @@ - - - - - - + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Element_Arc_MidPoint + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_MidPoint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_StartingPoint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_StartingPoint.svg index 0ddefbee82..4f681e01c8 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_StartingPoint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_StartingPoint.svg @@ -1,270 +1,104 @@ - - - - - - - - + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Element_Arc_StartingPoint + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_StartingPoint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + - - - - - + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_Edge.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_Edge.svg index a8f5f66908..af5c8a0fb7 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_Edge.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_Edge.svg @@ -1,394 +1,108 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_BSpline_Edge + 2017-01-07 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_Edge.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_EndPoint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_EndPoint.svg index 14d2cf0833..da33b7af4a 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_EndPoint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_EndPoint.svg @@ -1,383 +1,108 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_BSpline_EndPoint + 2017-01-07 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_EndPoint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_StartPoint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_StartPoint.svg index 2ba3d8b419..245bb89e6f 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_StartPoint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_StartPoint.svg @@ -1,394 +1,112 @@ - - - - - - + + + + + - - - - + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_BSpline_StartPoint + 2017-01-07 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_BSpline_StartPoint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_Edge.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_Edge.svg index a637d699a2..e2e38400c2 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_Edge.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_Edge.svg @@ -1,123 +1,90 @@ - - - - - - + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Element_Circle_Edge + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_Edge.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_MidPoint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_MidPoint.svg index e0a5f5a2f5..f6b4ad19a6 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_MidPoint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_MidPoint.svg @@ -1,145 +1,95 @@ - - - - - - - + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Element_Circle_MidPoint + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_MidPoint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_All.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_All.svg index 50c5a7f4a2..188f5b4af5 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_All.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_All.svg @@ -1,273 +1,121 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Ellipse_All + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_All.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + - - - - - + + + + + - - - - + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_CentrePoint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_CentrePoint.svg index 971336a684..f56915c78d 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_CentrePoint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_CentrePoint.svg @@ -1,253 +1,97 @@ - - - - - - + + + + + - - - - + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Ellipse_CentrePoint + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_CentrePoint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - + + + + + + - - - - - - - + + + - - - - - - - - - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Edge_1.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Edge_1.svg index 6d85f808e3..15e92be527 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Edge_1.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Edge_1.svg @@ -1,314 +1,102 @@ - - - - - - + + + + + - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Ellipse_Edge_1 + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Edge_1.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - - - - - - + + + - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Edge_2.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Edge_2.svg index bfefdc193c..1de2d3d47c 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Edge_2.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Edge_2.svg @@ -1,274 +1,94 @@ - - - - - - + + + + + - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Ellipse_Edge_2 + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Edge_2.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Focus1.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Focus1.svg index 5d76fbcfdb..c6cf29d51c 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Focus1.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Focus1.svg @@ -1,243 +1,115 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Ellipse_Focus1 + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_ + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + - - - - - + + + + + - + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Focus2.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Focus2.svg index 75d702ccd7..1b2a7e190b 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Focus2.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_Focus2.svg @@ -1,243 +1,115 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Ellipse_Focus2 + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_ + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + - - - - - + + + + + - + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_MajorAxis.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_MajorAxis.svg index 5481d6a7e1..b13701fbeb 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_MajorAxis.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_MajorAxis.svg @@ -1,220 +1,112 @@ - - - - - - + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Ellipse_MajorAxis + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_MajorAxis.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + - - - - - + + + + + - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_MinorAxis.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_MinorAxis.svg index 461005ba7a..abf52f0c04 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_MinorAxis.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_MinorAxis.svg @@ -1,220 +1,112 @@ - - - - - - + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Ellipse_MinorAxis + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Ellipse_MinorAxis.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + - - - - - + + + + + - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Centre_Point.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Centre_Point.svg index 0bcbb32f64..39952c52d8 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Centre_Point.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Centre_Point.svg @@ -1,377 +1,104 @@ - - - - - - + + + + + - - - - + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Elliptical_Arc_Centre_Point + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Centre_Point.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + + + + - - - - - - - - - - - - + + + - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Edge.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Edge.svg index a455e5078d..f8d233e193 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Edge.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Edge.svg @@ -1,377 +1,110 @@ - - - - - - + + + + + - - - - + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Elliptical_Arc_Edge + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Edge.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + + + + - - - - - - - - - - - - + + + - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_End_Point.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_End_Point.svg index c4710f95ab..ec7e001925 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_End_Point.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_End_Point.svg @@ -1,377 +1,110 @@ - - - - - - + + + + + - - - - + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Elliptical_Arc_End_Point + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_End_Point.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + + + + - - - - - - - - - - - - + + + - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Start_Point.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Start_Point.svg index 0db1cbf12b..b85271db21 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Start_Point.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Start_Point.svg @@ -1,377 +1,116 @@ - - - - - - + + + + + - - - - + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Elliptical_Arc_Start_Point + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Elliptical_Arc_Start_Point.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + + + + - - - - - - - - - - - - + + + - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Centre_Point.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Centre_Point.svg index 7b9824cffb..dbe5af4893 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Centre_Point.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Centre_Point.svg @@ -1,345 +1,109 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Hyperbolic_Arc_Centre_Point + 2016-09-03 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Centre_Point.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + - - - - - - - - - + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Edge.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Edge.svg index 0598f5cf36..b1604aa525 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Edge.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Edge.svg @@ -1,366 +1,115 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Hyperbolic_Arc_Edge + 2016-09-03 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Edge.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_End_Point.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_End_Point.svg index e492e08402..6f28d7300e 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_End_Point.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_End_Point.svg @@ -1,300 +1,112 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Hyperbolic_Arc_End_Point + 2016-09-03 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_End_Point.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Start_Point.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Start_Point.svg index fb76ab1a74..56f44514c2 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Start_Point.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Start_Point.svg @@ -1,300 +1,112 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Hyperbolic_Arc_Start_Point + 2016-09-03 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Hyperbolic_Arc_Start_Point.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_Edge.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_Edge.svg index 798c4cb2b6..7d97f8be07 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_Edge.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_Edge.svg @@ -1,231 +1,84 @@ - - - - - - - - + + + + + + - - - + + + + + + - - - - + + + + + + + + + - - - - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Element_Line_Edge + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_Edge.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - + + + + + + + + + + + - - - - - + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_EndPoint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_EndPoint.svg index d46754821b..a290529ccc 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_EndPoint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_EndPoint.svg @@ -1,251 +1,84 @@ - - - - - - - - + + + + + + - - - + + + + + + - - - + + + + - - - - + + + + - - - - - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Element_Line_EndPoint + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_EndPoint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - + + + + + + + + + + + - - - - - + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_StartingPoint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_StartingPoint.svg index 1fcbb03629..a1d7fe11e3 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_StartingPoint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_StartingPoint.svg @@ -1,276 +1,84 @@ - - - - - - - - + + + + + + - - - + + + + + + - - - - + + + + - - - - - + + + + - - - - - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Element_Line_StartingPoint + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_StartingPoint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - + + + + + + + + + + + - - - - - + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Centre_Point.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Centre_Point.svg index cf22b46bdd..045ee5aac1 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Centre_Point.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Centre_Point.svg @@ -1,410 +1,109 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Parabolic_Arc_Centre_Point + 2016-12-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Centre_Point.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Edge.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Edge.svg index 562ab6f702..d7cd820909 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Edge.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Edge.svg @@ -1,410 +1,121 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Parabolic_Arc_Edge + 2016-12-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Edge.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_End_Point.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_End_Point.svg index 014e9ce614..34fe837386 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_End_Point.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_End_Point.svg @@ -1,410 +1,115 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Parabolic_Arc_End_Point + 2016-12-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_End_Point.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Start_Point.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Start_Point.svg index f92298d82d..71bba1f519 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Start_Point.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Start_Point.svg @@ -1,410 +1,115 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Element_Parabolic_Arc_Start_Point + 2016-12-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Parabolic_Arc_Start_Point.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Point_StartingPoint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Point_StartingPoint.svg index fdde9d9ef4..cb309eaa98 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Point_StartingPoint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Point_StartingPoint.svg @@ -1,162 +1,73 @@ - - - - - - + + + + + - - - - - - + + + + + + + + + + + + + - - - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Element_Point_StartingPoint + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Point_StartingPoint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_SelectionTypeInvalid.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_SelectionTypeInvalid.svg index 81ab1ee18a..f39a7c0f01 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_SelectionTypeInvalid.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_SelectionTypeInvalid.svg @@ -1,530 +1,132 @@ - - - - - - + + + + + - - - - - - + + + - - - - - + + + + + + - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Element_SelectionTypeInvalid + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_SelectionTypeInvalid.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Elliptical_Arc.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Elliptical_Arc.svg index a45455787e..33b988ec09 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Elliptical_Arc.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Elliptical_Arc.svg @@ -1,407 +1,122 @@ - - - - - - + + + + + - - - - + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Elliptical_Arc + 2014-11-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Elliptical_Arc.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - + + + + + + + + - - - - - - - - - - - - - + + + - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Elliptical_Arc_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Elliptical_Arc_Constr.svg index 2015688cec..03c6b09a9c 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Elliptical_Arc_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Elliptical_Arc_Constr.svg @@ -1,403 +1,122 @@ - - - - - - + + + + + - - - - + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Elliptical_Arc_Constr + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Elliptical_Arc_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - + + + - - - - - - - - - - - - - + + + - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_External.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_External.svg index 16fff219f9..e63967c847 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_External.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_External.svg @@ -1,341 +1,122 @@ - - - - - - + + + + + - - - + + + - - - - - - - - - + + + - - - - - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [logari81] + + + Sketcher_External + 2012-01-01 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_External.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + - - - + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Hyperbolic_Arc.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Hyperbolic_Arc.svg index 3719a9718a..cb89e04f92 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Hyperbolic_Arc.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Hyperbolic_Arc.svg @@ -1,333 +1,131 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Hyperbolic_Arc + 2016-09-03 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Hyperbolic_Arc.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Hyperbolic_Arc_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Hyperbolic_Arc_Constr.svg index 02b846e2e5..c35115cf2e 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Hyperbolic_Arc_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Hyperbolic_Arc_Constr.svg @@ -1,333 +1,131 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Hyperbolic_Arc_Constr + 2016-09-03 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Hyperbolic_Arc_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_LeaveSketch.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_LeaveSketch.svg index f69f47e7ca..3f021dac61 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_LeaveSketch.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_LeaveSketch.svg @@ -1,272 +1,93 @@ - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - - - + + + + + + + + + + + + + - - + + + + - + image/svg+xml - + + + + + [wmayer] + + + Sketcher_LeaveSketch + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_LeaveSketch.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - + + + + + + + + + + - - - - - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MapSketch.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MapSketch.svg index 12164dcd45..77b87a5085 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MapSketch.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MapSketch.svg @@ -1,306 +1,129 @@ - - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - - - - + + + - - - - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_MapSketch + 2012-12-03 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MapSketch.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MergeSketch.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MergeSketch.svg index 357d9cc6e1..58aedb9372 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MergeSketch.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MergeSketch.svg @@ -1,351 +1,128 @@ - - - - - - + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + - - - - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_MergeSketch + 2014-11-26 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MergeSketch.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - + + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MirrorSketch.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MirrorSketch.svg index 50715e12cf..b39d946aa6 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MirrorSketch.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MirrorSketch.svg @@ -1,268 +1,101 @@ - - - - - - + + + + + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_MirrorSketch + 2015-08-19 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_MirrorSketch.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_NewSketch.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_NewSketch.svg index cb1c06c523..2406b6fe79 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_NewSketch.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_NewSketch.svg @@ -1,205 +1,89 @@ - - - - - - + + + + + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_NewSketch + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_NewSketch.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Parabolic_Arc.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Parabolic_Arc.svg index 70fedb6a83..de1fe116dc 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Parabolic_Arc.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Parabolic_Arc.svg @@ -1,474 +1,131 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Parabolic_Arc + 2016-12-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Parabolic_Arc.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - - - - - + + + - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Parabolic_Arc_Constr.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Parabolic_Arc_Constr.svg index 7f99dbd3da..662121e3b2 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Parabolic_Arc_Constr.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Parabolic_Arc_Constr.svg @@ -1,474 +1,131 @@ - - - - - - + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Parabolic_Arc_Constr + 2016-12-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Parabolic_Arc_Constr.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - - - - - + + + - - - - - - - - - - - - - + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ProfilesHexagon1.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ProfilesHexagon1.svg index f30265d763..52c5b34ec5 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ProfilesHexagon1.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ProfilesHexagon1.svg @@ -1,162 +1,102 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_ProfilesHexagon1 + 2014-06-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ProfilesHexagon1.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + - - - + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_RectangularArray.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_RectangularArray.svg index 79c43ea6e8..c70bf1f946 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_RectangularArray.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_RectangularArray.svg @@ -1,490 +1,200 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_RectangularArray + 2015-08-13 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_RectangularArray.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - + + + + + - - - - - + + + + - - - - - - + + + + - - - - - + + + + - - - - - - + + + - - - - - + + + - - - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConflictingConstraints.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConflictingConstraints.svg index 050d095ff6..cef8438db5 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConflictingConstraints.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConflictingConstraints.svg @@ -1,235 +1,93 @@ - - - - - - + + + + + - - - - - - - - - + + + + + + + + + - - - + + + - - + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_SelectConflictingConstraints + 2014-09-15 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConflictingConstraints.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConstraints.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConstraints.svg index 1633383a00..9770cf2286 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConstraints.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConstraints.svg @@ -14,8 +14,8 @@ height="64px" id="svg2869" sodipodi:version="0.32" - inkscape:version="0.48.4 r9939" - sodipodi:docname="Sketcher_SelectConstraints_1.svg" + inkscape:version="0.48.5 r10040" + sodipodi:docname="Sketcher_SelectConstraints.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape" version="1.1" inkscape:export-filename="/home/user/Downloads/cad/mystuff/icons/sketcher/other_Abdullah/Sketcher_ConnectLines_2._16px.png" @@ -165,6 +165,48 @@ fx="225.26402" fy="672.79736" r="34.345188" /> + + + + + + + + + + + inkscape:window-width="1600" + inkscape:window-height="837" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1"> + + @@ -193,7 +243,32 @@ image/svg+xml - + + + + [wmayer] + + + Sketcher_SelectConstraints + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConstraints.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + @@ -202,122 +277,165 @@ inkscape:label="Layer 1" inkscape:groupmode="layer"> - + id="g3114" + transform="matrix(0.62846906,0,0,0.63449019,18.864964,33.515677)"> - - - - + transform="matrix(-0.73872768,0,0,1.3536788,69.994068,-11.747782)" + id="g3852-7" + style="font-size:54.21519089px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;color:#000000;fill:#ff2600;fill-opacity:1;fill-rule:nonzero;stroke:#a40000;stroke-width:3.47018266;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Arial;-inkscape-font-specification:Arial"> + + + - - - - + transform="matrix(0.73872768,0,0,1.3536788,64.093791,-11.747785)" + id="g3852-7-4" + style="font-size:54.21519089px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;color:#000000;fill:#ff2600;fill-opacity:1;fill-rule:nonzero;stroke:#731200;stroke-width:3.47018266;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Arial;-inkscape-font-specification:Arial"> + + + - - - - - - - + id="g3055" + transform="matrix(0.58631468,0,0,0.58631468,-49.778993,5.5671259)"> + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectElementsAssociatedWithConstraints.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectElementsAssociatedWithConstraints.svg index 4df9509661..d4f5acd55e 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectElementsAssociatedWithConstraints.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectElementsAssociatedWithConstraints.svg @@ -1,430 +1,139 @@ - - - - - - + + + + + - - - - - - - - - + + + + + + + + + - - - + + + - - - - - - - - + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_SelectElementsAssociatedWithConstraints + 2014-09-15 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectElementsAssociatedWithConstraints.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectHorizontalAxis.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectHorizontalAxis.svg index 13583a66d1..6acdc286d1 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectHorizontalAxis.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectHorizontalAxis.svg @@ -1,241 +1,101 @@ - - - - - - + + + + + - - - - - - + + + - - - - - + + + - - - - - - + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_SelectHorizontalAxis + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectHorizontalAxis.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectOrigin.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectOrigin.svg index 17c6106030..b84be50098 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectOrigin.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectOrigin.svg @@ -1,257 +1,100 @@ - - - - - - + + + + + - - - - - - + + + - - - - - + + + - - - - - - + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_SelectOrigin + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectOrigin.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectRedundantConstraints.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectRedundantConstraints.svg index 10a0efeb44..4794f4e9f7 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectRedundantConstraints.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectRedundantConstraints.svg @@ -1,235 +1,93 @@ - - - - - - + + + + + - - - - - - - - - + + + + + + + + + - - - + + + - - + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_SelectRedundantConstraints + 2014-09-15 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectRedundantConstraints.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectVerticalAxis.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectVerticalAxis.svg index 4414c7fc16..210f30d998 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectVerticalAxis.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectVerticalAxis.svg @@ -1,241 +1,101 @@ - - - - - - + + + + + - - - - - - + + + - - - - - + + + - - - - - - + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_SelectVerticalAxis + 2014-08-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectVerticalAxis.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Sketch.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Sketch.svg index 7fab95aaca..7e14b9f1ef 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Sketch.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Sketch.svg @@ -1,190 +1,75 @@ - - - - - - + + + + + - - - + + + - - - + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Sketch + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Sketch.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Symmetry.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Symmetry.svg index 0dd0e1e6eb..8908bb5618 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Symmetry.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Symmetry.svg @@ -1,371 +1,149 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Symmetry + 2015-08-11 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Symmetry.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleConstraint.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleConstraint.svg index d49da4c0fe..6bd1b418a4 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleConstraint.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleConstraint.svg @@ -1,819 +1,187 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_ToggleConstraint + 2015-05-26 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleConstraint.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - + + + + + - - - - - + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleConstruction.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleConstruction.svg index ffae3ced5c..c94a38b596 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleConstruction.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleConstruction.svg @@ -1,244 +1,87 @@ - - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_ToggleConstruction + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleConstruction.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleNormal.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleNormal.svg index 841e926eea..48f3b664d5 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleNormal.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleNormal.svg @@ -1,244 +1,88 @@ - - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_ToggleNormal + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ToggleNormal.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Toggle_Constraint_Driven.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Toggle_Constraint_Driven.svg index ce5e112dbc..9c00775a14 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Toggle_Constraint_Driven.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Toggle_Constraint_Driven.svg @@ -1,289 +1,91 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + - - + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Toggle_Constraint_Driven + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Toggle_Constraint_Driven.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Toggle_Constraint_Driving.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Toggle_Constraint_Driving.svg index 77c91d7c06..72003f8fdf 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Toggle_Constraint_Driving.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Toggle_Constraint_Driving.svg @@ -1,289 +1,88 @@ - - - - - - + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - - - - + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [Abdullah Tahiri] + + + Sketcher_Toggle_Constraint_Driving + 2015-05-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Toggle_Constraint_Driving.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Trimming.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Trimming.svg index 78f55c32ad..f3f6e79fa0 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Trimming.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Trimming.svg @@ -1,319 +1,95 @@ - - - - - - - - + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_Trimming + 2011-10-10 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Trimming.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - + + + + + + + + + + + + + + + - - diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ViewSketch.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ViewSketch.svg index f43d286913..26e6318703 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ViewSketch.svg +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ViewSketch.svg @@ -1,279 +1,98 @@ - - - - - - + + + + + - - - + + + - - - - - - - + + + - - - - + + + - + + + + + + + + + + + + + + + + + + + + + - - + + + + - + image/svg+xml - - + + + + + [wmayer] + + + Sketcher_ViewSketch + 2012-12-03 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ViewSketch.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Concentric_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Concentric_sm.xpm index 8fdb7620ab..7577d4e32f 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Concentric_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Concentric_sm.xpm @@ -1,21 +1,64 @@ /* XPM */ static char * Constraint_Concentric_sm_xpm[] = { -"16 16 2 1", +"16 16 45 1", " c None", -". c #EA1B00", -" ... ", -" ....... ", -" .......... ", -" ... ... ", -" ... .... ... ", -" .. ...... .. ", -"... ... .. ... ", -"... .. .. ... ", -"... .. .. ... ", -" .. ....... .. ", -" ... ..... ... ", -" ... .... ", -" ........... ", -" ........ ", -" ... ", +". c #B41414", +"+ c #CF1515", +"@ c #DB1515", +"# c #CE1515", +"$ c #B31313", +"% c #920E0E", +"& c #D71414", +"* c #8D0303", +"= c #540000", +"- c #550000", +"; c #8E0303", +"> c #CC0E0E", +", c #4D0000", +"' c #4F0000", +") c #910E0E", +"! c #660707", +"~ c #A41111", +"{ c #640707", +"] c #D71515", +"^ c #B41313", +"/ c #9A0E0E", +"( c #D31212", +"_ c #940404", +": c #990E0E", +"< c #8F0303", +"[ c #B21313", +"} c #450000", +"| c #460000", +"1 c #D91414", +"2 c #A51212", +"3 c #930404", +"4 c #DA1515", +"5 c #950404", +"6 c #A31111", +"7 c #D91515", +"8 c #D01515", +"9 c #650707", +"0 c #560000", +"a c #980E0E", +"b c #D61414", +"c c #500000", +"d c #CD0F0F", +"e c #4E0000", +"f c #570000", +" ", +" .+@@#$ ", +" %&*= -;&% ", +" %>, '>) ", +" &, !~~{ '] ", +" ^* /(__(: <[ ", +" += !(} |({ -+ ", +" 1 23 _~ 4 ", +" 4 ~_ 56 7 ", +" 8- !(| }(9 0+ ", +" $; :(55(a ;[ ", +" b' {669 c] ", +" %de 'd) ", +" %] c #CB1717", +", c #640808", +"' c #6F0909", +") c #D81616", +"! c #790101", +"~ c #770101", +"{ c #D81515", +"] c #700808", +"^ c #8F0C0C", +"/ c #D61717", +"( c #640000", +"_ c #4A0000", +": c #A01010", +"< c #8E0404", +"[ c #AA1212", +"} c #9E0404", +"| c #830C0C", +"1 c #D31717", +"2 c #B00808", +"3 c #4D0000", +"4 c #CD1515", +"5 c #5B0000", +"6 c #6A0808", +"7 c #C51616", +"8 c #C90E0E", +"9 c #D91515", +"0 c #B21313", +"a c #780101", +"b c #D91414", +"c c #8A0202", +"d c #D41111", +"e c #B91515", +"f c #CE1515", +"g c #580000", +"h c #860202", +"i c #D41212", +"j c #BB1515", +"k c #590606", +"l c #AD1212", +"m c #990404", +"n c #D61212", +"o c #BF1616", +"p c #D61616", +"q c #5D0000", +"r c #520000", +"s c #740707", +"t c #8C0303", +"u c #C70E0E", +"v c #790A0A", +"w c #D61414", +"x c #6F0000", +"y c #6B0000", +"z c #D51414", +"A c #7D0B0B", +"B c #CF1717", +"C c #900303", +"D c #740000", +"E c #6C0909", +"F c #740A0A", +"G c #A71212", +"H c #BB1616", +"I c #A81212", +"J c #770A0A", " ", +" .+@#$ ", +" %&*=-=;>, ", +" ')! ~{] ^ ", +" /( _:)< ", +" [} |123 ", +" 45 678( ", +" 9 0{a ", +" b cde ", +" fg hijk ", +" lm hno ", +" pq rstu ", +" vwx yzA ", +" 6B8CDC8BE ", +" FGHIJ ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_HorizontalDistance_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_HorizontalDistance_sm.xpm index a403a83ad4..a557323341 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_HorizontalDistance_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_HorizontalDistance_sm.xpm @@ -1,20 +1,26 @@ /* XPM */ static char * Constraint_HorizontalDistance_sm_xpm[] = { -"16 16 2 1", +"16 16 8 1", " c None", -". c #CD1D00", +". c #B01616", +"+ c #710B0B", +"@ c #DE1515", +"# c #B31616", +"$ c #DE1F1F", +"% c #B41616", +"& c #E61F1F", " ", " ", " ", " ", -" .. .. ", -" .. .. ", -" .. .. ", -" .............. ", -" .............. ", -" .. .. ", -" .. .. ", -" .. .. ", +" .+ +. ", +" @# #@ ", +" @# #@ ", +" @$..........$@ ", +" @@@@@@@@@@@@@@ ", +" @% %@ ", +" @# #@ ", +" &# #& ", " ", " ", " ", diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Horizontal_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Horizontal_sm.xpm index 462112335e..40b315dce2 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Horizontal_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Horizontal_sm.xpm @@ -1,18 +1,19 @@ /* XPM */ static char * Constraint_Horizontal_sm_xpm[] = { -"16 16 2 1", +"16 16 3 1", " c None", -". c #F42102", +". c #E72020", +"+ c #DE1616", " ", " ", " ", " ", " ", " ", -" .............. ", -" .............. ", -" .............. ", -" .............. ", +" ", +" .++++++++++++. ", +" .++++++++++++. ", +" ", " ", " ", " ", diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_InternalAngle_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_InternalAngle_sm.xpm index 51d4b124c5..e6eb2b11f8 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_InternalAngle_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_InternalAngle_sm.xpm @@ -1,21 +1,75 @@ /* XPM */ static char * Constraint_InternalAngle_sm_xpm[] = { -"16 16 2 1", +"16 16 56 1", " c None", -". c #EF2000", -" ", -" ... ", -" ..... ", -" ....... ", -" ...... ", -" ........ ", -" .......... ", -" ..... .. ", -" ......... ", -" ....... ", -" ...... ", -" ...... ", -" .... ", -" .. ", +". c #5C0606", +"+ c #920C0C", +"@ c #760909", +"# c #C21515", +"$ c #D61313", +"% c #880303", +"& c #900C0C", +"* c #CB1616", +"= c #CB0F0F", +"- c #790101", +"; c #A51010", +"> c #D51616", +", c #DD1A1A", +"' c #920000", +") c #B31212", +"! c #D81616", +"~ c #A30606", +"{ c #550000", +"] c #8F0E0E", +"^ c #AF0909", +"/ c #C31616", +"( c #D71414", +"_ c #8E0303", +": c #CF1010", +"< c #C81414", +"[ c #DF1A1A", +"} c #6F0101", +"| c #D91414", +"1 c #5C0000", +"2 c #B90A0A", +"3 c #D21616", +"4 c #9C1010", +"5 c #D31212", +"6 c #AB0808", +"7 c #D41616", +"8 c #A91212", +"9 c #7E0909", +"0 c #BE0D0D", +"a c #4E0000", +"b c #A50707", +"c c #D71515", +"d c #A91111", +"e c #B81414", +"f c #820202", +"g c #9E0505", +"h c #DF1919", +"i c #B81313", +"j c #430000", +"k c #960505", +"l c #D81414", +"m c #B71313", +"n c #460000", +"o c #930404", +"p c #A90F0F", +"q c #6A0000", " ", +" .+ ", +" @#$% ", +" &*=- ", +" ;>,' ", +" .)!~{]^ ", +" @/(_ : ", +" <[} | ", +" 1234 5 ", +" {678 90 ", +" abcdef ", +" aghi ", +" jklm ", +" no(p ", +" q ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Length_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Length_sm.xpm index d2f0074c35..95b4ebb87c 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Length_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Length_sm.xpm @@ -1,21 +1,48 @@ /* XPM */ static char * Constraint_Length_sm_xpm[] = { -"16 16 2 1", +"16 16 29 1", " c None", -". c #F41F00", +". c #660606", +"+ c #9B1010", +"@ c #BA1616", +"# c #C91818", +"$ c #490202", +"% c #DB1E1E", +"& c #DA1111", +"* c #D20707", +"= c #CD0000", +"- c #BB1616", +"; c #7E0B0B", +"> c #DC1212", +", c #CC0000", +"' c #D51818", +") c #CF0303", +"! c #6A0606", +"~ c #D61818", +"{ c #CF0404", +"] c #DC1E1E", +"^ c #7D0B0B", +"/ c #6B0505", +"( c #DC1313", +"_ c #9A1010", +": c #BC1616", +"< c #480202", +"[ c #C81818", +"} c #9C1010", +"| c #6C0505", " ", -" .. ", -" ...... ", -" ....... ", -" ..... ", -" ...... ", -" ....... ", -" ..... . ", -" . ..... ", -" ....... ", -" ...... ", -" ..... ", -" ....... ", -" ..... ", -" . ", +" .+@# ", +" $%&*=- ", +" ;>,*+ ", +" ')>&! ", +" ~)~;% ", +" ~)~ $ ", +" ~{~ ", +" ~{~ ", +" $ ~)~ ", +" ]^~)~ ", +" /&()~ ", +" _*,(^ ", +" :=*&]< ", +" [-}| ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Lock_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Lock_sm.xpm index 477b4a07d0..e58888d1f0 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Lock_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Lock_sm.xpm @@ -1,21 +1,96 @@ /* XPM */ static char * Constraint_Lock_sm_xpm[] = { -"16 16 2 1", +"16 16 77 1", " c None", -". c #E21D00", +". c #8B1515", +"+ c #BD1E1E", +"@ c #BB1F1F", +"# c #E82727", +"$ c #A51919", +"% c #A41919", +"& c #E62626", +"* c #B91E1E", +"= c #7B1111", +"- c #E12626", +"; c #530808", +"> c #540808", +", c #DE2424", +"' c #781010", +") c #8E1414", +"! c #8F1313", +"~ c #A21616", +"{ c #A61919", +"] c #750D0D", +"^ c #720B0B", +"/ c #A41717", +"( c #A51818", +"_ c #700A0A", +": c #A21717", +"< c #721010", +"[ c #AE1B1B", +"} c #B11C1C", +"| c #B01C1C", +"1 c #B01B1B", +"2 c #AC1A1A", +"3 c #AB1A1A", +"4 c #700F0F", +"5 c #B81D1D", +"6 c #CE1717", +"7 c #B80B0B", +"8 c #B70B0B", +"9 c #B70A0A", +"0 c #B60A0A", +"a c #B50A0A", +"b c #C61212", +"c c #B51C1C", +"d c #B61D1D", +"e c #C91414", +"f c #B50909", +"g c #B40909", +"h c #B30808", +"i c #C11010", +"j c #B31B1B", +"k c #C41111", +"l c #B30909", +"m c #B20808", +"n c #B10707", +"o c #B00707", +"p c #BC0D0D", +"q c #B11A1A", +"r c #B41B1B", +"s c #BF0F0F", +"t c #AF0606", +"u c #AE0606", +"v c #B01818", +"w c #BA0C0C", +"x c #AD0505", +"y c #AC0505", +"z c #AC0404", +"A c #AE1818", +"B c #B01A1A", +"C c #AB0404", +"D c #AA0404", +"E c #AA0303", +"F c #A90303", +"G c #AD1717", +"H c #760D0D", +"I c #B51A1A", +"J c #B41919", +"K c #B31919", +"L c #730D0D", " ", -" .... ", -" ........ ", -" ......... ", -" .... ... ", -" ... ... ", -" ... ... ", -" ............ ", -" ............ ", -" ............ ", -" ............ ", -" ............ ", -" ............ ", -" ............ ", -" ............ ", +" .++. ", +" @#$%&* ", +" =-; >,' ", +" $) !~ ", +" {] ^/ ", +" (^ _: ", +" <[[}|11234 ", +" 5677890abc ", +" de0afgghij ", +" cklhmmnopq ", +" rsnoottu9v ", +" qwuuxxyzmA ", +" B0yCCDEFxG ", +" HIIIJJJKKL ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Parallel_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Parallel_sm.xpm index 15070cc8f2..e42715b1de 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Parallel_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Parallel_sm.xpm @@ -1,21 +1,44 @@ /* XPM */ static char * Constraint_Parallel_sm_xpm[] = { -"16 16 2 1", +"16 16 25 1", " c None", -". c #D31900", +". c #760A0A", +"+ c #C01717", +"@ c #790A0A", +"# c #D81515", +"$ c #D60C0C", +"% c #A01212", +"& c #D91515", +"* c #D20606", +"= c #C61818", +"- c #C81818", +"; c #9E1111", +"> c #C31717", +", c #D70D0D", +"' c #C41717", +") c #D10707", +"! c #D71313", +"~ c #7B0B0B", +"{ c #D71414", +"] c #C71818", +"^ c #C51717", +"/ c #9F1212", +"( c #9F1111", +"_ c #D81414", +": c #7A0A0A", " ", -" .. ", -" .... ", -" .... ", -" .... . ", -" .... ... ", -" .... .... ", -" .... .... ", -" .... .... ", -" .... .... ", -" ... .... ", -" . .... ", -" ..... ", -" ..... ", -" ... ", +" .+ ", +" @#$% ", +" .&*= ", +" .&*- ; ", +" .&*= >,+ ", +" .&*= ')!~ ", +" .&*= ')!~ ", +" .{*] ')!~ ", +" .{*] ^)!~ ", +" +,' ^)!~ ", +" / ^)!~ ", +" ^)&~ ", +" (,_: ", +" +@ ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Perpendicular_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Perpendicular_sm.xpm index fee811df8a..880d750cf3 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Perpendicular_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Perpendicular_sm.xpm @@ -1,21 +1,26 @@ /* XPM */ static char * Constraint_Perpendicular_sm_xpm[] = { -"16 16 2 1", +"16 16 7 1", " c None", -". c #FF1D00", +". c #BB1616", +"+ c #DE1515", +"@ c #BE1616", +"# c #CC0000", +"$ c #C01616", +"% c #E61F1F", +" ", +" ", +" .++. ", +" @##@ ", +" @##@ ", +" @##@ ", +" @##@ ", +" @##@ ", +" @##@ ", +" @##@ ", +" $##$ ", +" %+++++##+++++% ", +" +############+ ", +" %++++++++++++% ", " ", -" .... ", -" .... ", -" .... ", -" .... ", -" .... ", -" .... ", -" .... ", -" .... ", -" .... ", -" .... ", -" ............. ", -" .............. ", -" .............. ", -" ............. ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnEnd_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnEnd_sm.xpm index e6fa11d7d5..05f6689134 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnEnd_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnEnd_sm.xpm @@ -1,21 +1,65 @@ /* XPM */ static char * Constraint_PointOnEnd_sm_xpm[] = { -"16 16 2 1", +"16 16 46 1", " c None", -". c #ED2C00", +". c #740909", +"+ c #AA1414", +"@ c #9A1010", +"# c #6A0707", +"$ c #900F0F", +"% c #D81111", +"& c #CE0202", +"* c #D20707", +"= c #CF1717", +"- c #E52222", +"; c #400000", +"> c #D21616", +", c #CC0000", +"' c #D20808", +") c #960F0F", +"! c #CF1919", +"~ c #D80E0E", +"{ c #DC1515", +"] c #D21515", +"^ c #B91515", +"/ c #670606", +"( c #D81414", +"_ c #CE0303", +": c #A51313", +"< c #D60C0C", +"[ c #DE1515", +"} c #D70D0D", +"| c #D81515", +"1 c #800C0C", +"2 c #C11616", +"3 c #720808", +"4 c #430000", +"5 c #810B0B", +"6 c #CF0404", +"7 c #D71515", +"8 c #D91515", +"9 c #8F0E0E", +"0 c #690707", +"a c #D21717", +"b c #B21515", +"c c #900E0E", +"d c #D40909", +"e c #CD1515", +"f c #E41C1C", +"g c #E21E1E", " ", " ", -" ... . ", -" ....... ", -" ........ ", -" .......... ", -" .......... ", -" .. .... ", -" .... ", -" ... ", -" ... ", -" ... ", -" ... ", +" ", +" ", +" .+@ # ", +" $%&*= -; ", +" >,,,')!~{]^/ ", +" (,,,_:!<[}_|1 ", +" 2_,,%3 -45!67 ", +" 28>9 0 a_b ", +" cde ", +" fg ", +" ", " ", " ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnMidPoint_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnMidPoint_sm.xpm index 4826db7f4a..3dcbff1f24 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnMidPoint_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnMidPoint_sm.xpm @@ -1,21 +1,60 @@ /* XPM */ static char * Constraint_PointOnMidPoint_sm_xpm[] = { -"16 16 2 1", +"16 16 41 1", " c None", -". c #F82F00", +". c #660606", +"+ c #9B1010", +"@ c #BA1616", +"# c #C91818", +"$ c #490202", +"% c #DB1E1E", +"& c #DA1111", +"* c #D20707", +"= c #CD0000", +"- c #BB1616", +"; c #7E0B0B", +"> c #DC1212", +", c #CC0000", +"' c #D51818", +") c #CF0303", +"! c #6A0606", +"~ c #850C0C", +"{ c #C11616", +"] c #BE1515", +"^ c #910E0E", +"/ c #B60303", +"( c #D61818", +"_ c #D91010", +": c #D91111", +"< c #900E0E", +"[ c #BD1515", +"} c #BF1616", +"| c #840C0C", +"1 c #DC1E1E", +"2 c #7D0B0B", +"3 c #C01616", +"4 c #830C0C", +"5 c #6B0505", +"6 c #DC1313", +"7 c #9A1010", +"8 c #BC1616", +"9 c #480202", +"0 c #C81818", +"a c #9C1010", +"b c #6C0505", " ", -" .... ", -" ..... ", -" ..... ", -" ..... ", -" ........ ", -" ...... . ", -" ...... ", -" ...... ", -" . ...... ", -" ....... ", -" ..... ", -" .... ", -" ..... ", -".... ", +" .+@# ", +" $%&*=- ", +" ;>,*+ ", +" ')>&! ", +" ~{]^/(;% ", +" ~_,,:< $ ", +" {,,,,] ", +" [,,,,} ", +" $ ^:,,:| ", +" 12(/<]34 ", +" 5&6)( ", +" 7*,62 ", +" 8=*&19 ", +" 0-ab ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnObject_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnObject_sm.xpm index 9ea7be07f3..3f47eae239 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnObject_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnObject_sm.xpm @@ -1,21 +1,59 @@ /* XPM */ static char * Constraint_PointOnObject_sm_xpm[] = { -"16 16 2 1", +"16 16 40 1", " c None", -". c #F42D00", +". c #760A0A", +"+ c #A01111", +"@ c #AF1313", +"# c #9C1010", +"$ c #690808", +"% c #C21616", +"& c #D91515", +"* c #D21616", +"= c #8B0E0E", +"- c #991010", +"; c #D51616", +"> c #C80E0E", +", c #9C0505", +"' c #810101", +") c #9E0606", +"! c #AE0909", +"~ c #CE0202", +"{ c #CC0000", +"] c #D81111", +"^ c #7F0808", +"/ c #520000", +"( c #CE0303", +"_ c #A51313", +": c #D30808", +"< c #9B1010", +"[ c #CF1717", +"} c #850D0D", +"| c #840909", +"1 c #A41313", +"2 c #C81616", +"3 c #680000", +"4 c #D91414", +"5 c #6E0909", +"6 c #820C0C", +"7 c #BA0B0B", +"8 c #7B0A0A", +"9 c #BE0C0C", +"0 c #D61212", +"a c #730404", " ", -" ...... ", -" ........... ", -" ............ ", -" ...... ", -" ...... ", -" ..... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", +" .+@@#$ ", +" %&*=-;>,'')! ", +" %~{{]^/ ", +" &{{{(_ ", +" *{{{:< ", +" =](:[ ", +" }|1- ", +" 23 ", +" 4 ", +" 5> ", +" 67 ", +" 89 ", +" 0 ", +" a ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnPoint_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnPoint_sm.xpm index d75b8fad18..fa6eceff91 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnPoint_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnPoint_sm.xpm @@ -1,19 +1,24 @@ /* XPM */ static char * Constraint_PointOnPoint_sm_xpm[] = { -"16 16 2 1", +"16 16 7 1", " c None", -". c #F93E00", +". c #991515", +"+ c #E11D1D", +"@ c #9A1414", +"# c #E21D1D", +"$ c #CC0000", +"% c #9B1414", " ", " ", " ", " ", -" .. ", -" .... ", -" ...... ", -" ...... ", -" ...... ", -" ..... ", -" .. ", +" ", +" ", +" .++@ ", +" #$$# ", +" #$$# ", +" @++% ", +" ", " ", " ", " ", diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnStart_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnStart_sm.xpm index 0e749b3505..2b13d25dc0 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnStart_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointOnStart_sm.xpm @@ -1,21 +1,63 @@ /* XPM */ static char * Constraint_PointOnStart_sm_xpm[] = { -"16 16 2 1", +"16 16 44 1", " c None", -". c #F72E00", -" ", -" .. ", -" ..... ", -" ........ ", -" .......... ", -" ... ..... ", -" ... ", -" .... ", -" ... ", -" .... ", -" ..... ", -" ..... ", -" ..... ", -" ... ", +". c #3B0000", +"+ c #820C0C", +"@ c #830B0B", +"# c #6D0808", +"$ c #E21E1E", +"% c #C91A1A", +"& c #A71313", +"* c #760909", +"= c #D11A1A", +"- c #CD0101", +"; c #CF0404", +"> c #D90F0F", +", c #C81818", +"' c #CC1A1A", +") c #C11616", +"! c #D71212", +"~ c #CE0303", +"{ c #D51818", +"] c #6A0808", +"^ c #D51616", +"/ c #CF0303", +"( c #B81515", +"_ c #8B0D0D", +": c #D60C0C", +"< c #D71515", +"[ c #D81515", +"} c #D80D0D", +"| c #780909", +"1 c #9B1010", +"2 c #AB1414", +"3 c #710808", +"4 c #CF1717", +"5 c #D20707", +"6 c #CE0202", +"7 c #D81111", +"8 c #8F0F0F", +"9 c #9A1010", +"0 c #CC0000", +"a c #D21616", +"b c #AA1414", +"c c #D91515", +"d c #740909", +"e c #900F0F", " ", +" . ", +" +@ ", +" #$%&* ", +" =--;>, ", +" #$')!~{ ", +" +@ ]^/( ", +" . _:< ", +" [}| ", +" 123 ", +" 45678 ", +" 95000a ", +" b~000c ", +" d700~) ", +" eac) ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointToObject_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointToObject_sm.xpm index 3a6d2d317a..c80a59ab23 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointToObject_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_PointToObject_sm.xpm @@ -1,21 +1,55 @@ /* XPM */ static char * Constraint_PointToObject_sm_xpm[] = { -"16 16 2 1", +"16 16 36 1", " c None", -". c #D82800", -" . ", -" ..... ", -" ..... ", -" ..... ", -" ..... . ", -" .... ... ", -" .. .... ", -" .. ..... ", -" ...... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ... ", +". c #C21616", +"+ c #D91515", +"@ c #D21616", +"# c #900F0F", +"$ c #CE0202", +"% c #CC0000", +"& c #D81111", +"* c #740909", +"= c #CE0303", +"- c #AA1414", +"; c #D30808", +"> c #9B1010", +", c #9E1111", +"' c #CF1717", +") c #480404", +"! c #C31717", +"~ c #D70D0D", +"{ c #C01717", +"] c #A91414", +"^ c #991010", +"/ c #480303", +"( c #9C1818", +"_ c #C41717", +": c #D10707", +"< c #D71313", +"[ c #7B0B0B", +"} c #9D1818", +"| c #7C0E0E", +"1 c #C01616", +"2 c #C11616", +"3 c #C51717", +"4 c #9F1111", +"5 c #D81414", +"6 c #7A0A0A", +"7 c #790A0A", +" ", +" .+@# ", +" .$%%&* ", +" +%%%=- ", +" @%%%;> , ", +" #&=;') !~{ ", +" *]^/( _:<[ ", +" } _:<[ ", +" |1:<[ ", +" 2:<[ ", +" 3:<[ ", +" 3:<[ ", +" 3:+[ ", +" 4~56 ", +" {7 ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Radius_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Radius_sm.xpm index 9dfb696e99..6f8057d248 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Radius_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Radius_sm.xpm @@ -1,21 +1,62 @@ /* XPM */ static char * Constraint_Radius_sm_xpm[] = { -"16 16 2 1", +"16 16 43 1", " c None", -". c #C21B00", -" .... ", -" ........ ", -" .......... ", -" ..... .... ", -" .... ...... ", -" ... ....... ", -"... ..... .. ", -"... .... ...", -"... .. ...", -"... ... ", -" ... ... ", -" .... .... ", -" .... ..... ", -" ........... ", -" ........ ", -" ... "}; +". c #B41414", +"+ c #CF1515", +"@ c #DB1515", +"# c #CE1515", +"$ c #B31313", +"% c #920E0E", +"& c #D71414", +"* c #8D0303", +"= c #540000", +"- c #550000", +"; c #8E0303", +"> c #900D0D", +", c #CC0E0E", +"' c #4D0000", +") c #8C0A0A", +"! c #E01919", +"~ c #8E0D0D", +"{ c #7D0B0B", +"] c #D41212", +"^ c #6D0000", +"/ c #D71515", +"( c #B41313", +"_ c #7E0B0B", +": c #580000", +"< c #8F0303", +"[ c #B21313", +"} c #D91414", +"| c #770909", +"1 c #D51313", +"2 c #570000", +"3 c #DA1515", +"4 c #510101", +"5 c #520000", +"6 c #D91515", +"7 c #D01515", +"8 c #560000", +"9 c #D61414", +"0 c #4F0000", +"a c #500000", +"b c #CD0F0F", +"c c #4E0000", +"d c #910E0E", +" ", +" .+@@#$ ", +" %&*= -;&> ", +" %,' )!~ ", +" &' {]^/ ", +" (* _]: <[ ", +" += _]: -+ ", +" } |12 3 ", +" 3 45 6 ", +" 7- 8+ ", +" $; ;[ ", +" 90 a/ ", +" %bc 0bd ", +" %/<2 - c #CE0505", +", c #CC1717", +"' c #5A0000", +") c #A20303", +"! c #A31212", +"~ c #B20D0D", +"{ c #C61313", +"] c #540000", +"^ c #5D0000", +"/ c #5C0000", +"( c #700404", +"_ c #730101", +": c #5A0101", +"< c #510000", +"[ c #900E0E", +"} c #D40909", +"| c #590000", +"1 c #DB1313", +"2 c #7D0000", +"3 c #CC1515", +"4 c #A90000", +"5 c #B41414", +"6 c #CB0101", +"7 c #860D0D", +"8 c #D50A0A", +"9 c #640000", +"0 c #C80D0D", +"a c #670000", +" ", +" .+ ", +" @#$ ", +" %&* ", +" %=- ", +" ;>, ", +" ')! ", +" ~{{{{{{{{{{{{~ ", +" ]^^^^/(_:^^^^< ", +" [}| ", +" 12 ", +" 34 ", +" 56 ", +" 789 ", +" 0a ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Symmetric_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Symmetric_sm.xpm index 2d0249184c..ea168a9e7c 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Symmetric_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Symmetric_sm.xpm @@ -1,23 +1,71 @@ /* XPM */ -static char * Constraint_Symmetric_small_1_16px_xpm[] = { -"16 16 4 1", +static char * Constraint_Symmetric_sm_xpm[] = { +"16 16 52 1", " c None", -". c #FF2500", -"+ c #FF2600", -"@ c #FF2700", +". c #951212", +"+ c #7C0A0A", +"@ c #790B0B", +"# c #941212", +"$ c #CB1E1E", +"% c #E62121", +"& c #B51818", +"* c #B21818", +"= c #CA1D1D", +"- c #CD0000", +"; c #E01717", +"> c #DE2222", +", c #D92121", +"' c #E11919", +") c #6C0808", +"! c #D01818", +"~ c #D10606", +"{ c #D50A0A", +"] c #E62323", +"^ c #870F0F", +"/ c #AD1414", +"( c #D61010", +"_ c #CE0101", +": c #D71010", +"< c #B01414", +"[ c #5A0606", +"} c #D61B1B", +"| c #CF0404", +"1 c #D51B1B", +"2 c #580606", +"3 c #920F0F", +"4 c #D51515", +"5 c #CD0202", +"6 c #DE1414", +"7 c #BD1A1A", +"8 c #BC1A1A", +"9 c #AC1515", +"0 c #D60C0C", +"a c #CE0303", +"b c #E52020", +"c c #BE1B1B", +"d c #D60B0B", +"e c #E52323", +"f c #890F0F", +"g c #820D0D", +"h c #E42323", +"i c #D80D0D", +"j c #D62020", +"k c #D42020", +"l c #C91D1D", +"m c #410202", " ", " ", " ", -" . + ", -" +. ++ ", -" +++ +++ ", -" ++++ +++++ ", -" +++ +++ ", -" ++ ++ ", -" +++ ++++ ", -" ++++ ++++ ", -" +++ +++ ", -" +@ + ", -" ", +" .+ @# ", +" $%& *%$ ", +" =-;> ,'-= ", +" )!~{]^ ^]{~!) ", +" /(_$ $_:< ", +" [}|= =|12 ", +" 34567 86543 ", +" 90abc cba09 ", +" =def ghi= ", +" =j kl ", +" m m ", " ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToEnd_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToEnd_sm.xpm index 9ebb27f424..5f3a119a9b 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToEnd_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToEnd_sm.xpm @@ -1,21 +1,65 @@ /* XPM */ static char * Constraint_TangentToEnd_sm_xpm[] = { -"16 16 2 1", +"16 16 46 1", " c None", -". c #F32000", +". c #720909", +"+ c #880E0E", +"@ c #B01414", +"# c #D71111", +"$ c #B41616", +"% c #740A0A", +"& c #D31717", +"* c #D10606", +"= c #CC0000", +"- c #DE1616", +"; c #E72020", +"> c #700909", +", c #D21717", +"' c #DD1313", +") c #E51E1E", +"! c #A51717", +"~ c #920C0C", +"{ c #B21515", +"] c #B11515", +"^ c #420000", +"/ c #5F0B0B", +"( c #991616", +"_ c #A01313", +": c #880C0C", +"< c #8D0E0E", +"[ c #C01919", +"} c #4E0808", +"| c #620A0A", +"1 c #D61717", +"2 c #D91616", +"3 c #600C0C", +"4 c #4A0707", +"5 c #CE1919", +"6 c #D81616", +"7 c #4D0808", +"8 c #D61616", +"9 c #BF1919", +"0 c #7E1212", +"a c #DC1313", +"b c #660D0D", +"c c #A31717", +"d c #B41717", +"e c #CF1717", +"f c #971616", +"g c #DA1515", " ", -" ... ", -" ............. ", -"............... ", -" .............. ", -" ....... ", -" ........ ", -" ..... ", -" .... ", -" ... ", -" .... ", -" ... ", -" ... ", -" ... ", -" .. ", +" .+ ", +" @#$ ", +" %&*=---------; ", +" >,*=''''''''') ", +" !~{#]^ ", +" /(_:<[} ", +" |123 ", +" 4567 ", +" 489 ", +" 0ab ", +" 2c ", +" de ", +" fg ", +" /! ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToStart_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToStart_sm.xpm index 7309710a8c..5193a1bc8b 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToStart_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_TangentToStart_sm.xpm @@ -1,21 +1,72 @@ /* XPM */ static char * Constraint_TangentToStart_sm_xpm[] = { -"16 16 2 1", +"16 16 53 1", " c None", -". c #E61F00", -" . ", -" .. ", -" ... ", -" ..... ", -" . ..... ", -"....... .......", -"........ ... ", -" ........ ... ", -" ..... ... ", -" ....... ", -" ...... ", -" ...... ", -" ..... ", -" ..... ", -" ..... ", +". c #920E0E", +"+ c #690707", +"@ c #DB1616", +"# c #BC1616", +"$ c #CC1717", +"% c #CD0101", +"& c #D70E0E", +"* c #880D0D", +"= c #A31212", +"- c #D40909", +"; c #CC0000", +"> c #D51717", +", c #A61717", +"' c #CE1717", +") c #A41717", +"! c #660D0D", +"~ c #AE1515", +"{ c #D01C1C", +"] c #D50A0A", +"^ c #DC1A1A", +"/ c #B91818", +"( c #690A0A", +"_ c #5F0B0B", +": c #991616", +"< c #B21616", +"[ c #D91616", +"} c #DC1212", +"| c #C01919", +"1 c #4E0808", +"2 c #8B0C0C", +"3 c #C91515", +"4 c #7D1111", +"5 c #D61717", +"6 c #600C0C", +"7 c #4A0707", +"8 c #CE1919", +"9 c #D81616", +"0 c #4D0808", +"a c #D61616", +"b c #BF1919", +"c c #840B0B", +"d c #7E1212", +"e c #DC1313", +"f c #850B0B", +"g c #8F0E0E", +"h c #B41717", +"i c #970E0E", +"j c #971616", +"k c #9A0E0E", +"l c #900E0E", +"m c #E11919", +"n c #D21919", +" ", +" . ", +" +@# ", +" $%&* ", +" =-;;> ", +" ,@')! ~{]^/( ", +" _:<[}|1 2]3 ", +" 45[6 2]3 ", +" 78902]3 ", +" 7abc]3 ", +" def]3 ", +" [g]3 ", +" hi]3 ", +" jk]3 ", +" _lmn ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Tangent_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Tangent_sm.xpm index f6886619a7..88aef3fc92 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Tangent_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Tangent_sm.xpm @@ -1,21 +1,64 @@ /* XPM */ static char * Constraint_Tangent_sm_xpm[] = { -"16 16 2 1", +"16 16 45 1", " c None", -". c #EE2100", +". c #C11818", +"+ c #7C0B0B", +"@ c #9E1111", +"# c #D70D0D", +"$ c #D81414", +"% c #7B0B0B", +"& c #C31717", +"* c #D20707", +"= c #D71313", +"- c #A61717", +"; c #DB1616", +"> c #CE1717", +", c #A41717", +"' c #660D0D", +") c #7D0B0B", +"! c #5F0B0B", +"~ c #991616", +"{ c #B21616", +"] c #D91616", +"^ c #DC1212", +"/ c #C01919", +"( c #4C0404", +"_ c #7D1111", +": c #D61717", +"< c #560707", +"[ c #4A0707", +"} c #CE1919", +"| c #D81616", +"1 c #4B0404", +"2 c #C11717", +"3 c #D61616", +"4 c #BF1919", +"5 c #BE1616", +"6 c #7E1212", +"7 c #DC1313", +"8 c #C21717", +"9 c #C01717", +"0 c #A31717", +"a c #9B1111", +"b c #B41717", +"c c #CF1717", +"d c #971616", +"e c #DA1515", +"f c #A51717", " ", -" ... ", -" .... ", -" .... ", -" . .... ", -"........... ", -"............ ", -" ............ ", -" ........ ", -" ........ ", -" ... ... ", -" ... .. ", -" ... ", -" ... ", -" .. ", +" .+ ", +" @#$% ", +" &*=+ ", +" &*=+ ", +" -;>,' &*=) ", +" !~{]^/(&*=) ", +" _:]<&*=) ", +" [}|12*=) ", +" [34 5*=) ", +" 67' 8#9 ", +" ]0 a ", +" bc ", +" de ", +" !f ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_VerticalDistance_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_VerticalDistance_sm.xpm index 8542e7a0b2..581f2bed3f 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_VerticalDistance_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_VerticalDistance_sm.xpm @@ -1,21 +1,29 @@ /* XPM */ static char * Constraint_VerticalDistance_sm_xpm[] = { -"16 16 2 1", +"16 16 10 1", " c None", -". c #CE1A00", +". c #E61F1F", +"+ c #DE1515", +"@ c #B31616", +"# c #B61717", +"$ c #B71616", +"% c #DE1F1F", +"& c #750B0B", +"* c #B01616", +"= c #710B0B", " ", -" ........ ", -" ........ ", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -" .. ", -" ........ ", -" ........ ", +" .++++++@ ", +" ##$+%##& ", +" +@ ", +" +@ ", +" +@ ", +" +@ ", +" +@ ", +" +@ ", +" +@ ", +" +@ ", +" +@ ", +" +@ ", +" **@+%**= ", +" .++++++@ ", " "}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Vertical_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Vertical_sm.xpm index 1b7187a1d0..3e801d76af 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Vertical_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Vertical_sm.xpm @@ -1,21 +1,24 @@ /* XPM */ static char * Constraint_Vertical_sm_xpm[] = { -"16 16 2 1", +"16 16 5 1", " c None", -". c #E81C00", +". c #E61F1F", +"+ c #E72020", +"@ c #DD1515", +"# c #DE1515", " ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", +" .+ ", +" @@ ", +" @@ ", +" @@ ", +" @@ ", +" @@ ", +" @@ ", +" @@ ", +" @@ ", +" #@ ", +" #@ ", +" #@ ", +" #@ ", +" +. ", " "}; diff --git a/src/Mod/Start/CMakeLists.txt b/src/Mod/Start/CMakeLists.txt index 2cf11990b2..60af59dad4 100644 --- a/src/Mod/Start/CMakeLists.txt +++ b/src/Mod/Start/CMakeLists.txt @@ -16,6 +16,7 @@ if(BUILD_GUI) LoadMRU0.py LoadMRU1.py LoadMRU2.py + LoadMRU3.py LoadArchExample.py LoadFemExample2D.py LoadFemExample3D.py diff --git a/src/Mod/Start/StartPage/LoadMRU3.py b/src/Mod/Start/StartPage/LoadMRU3.py new file mode 100644 index 0000000000..5664ad0335 --- /dev/null +++ b/src/Mod/Start/StartPage/LoadMRU3.py @@ -0,0 +1,27 @@ +#*************************************************************************** +#* * +#* Copyright (c) 2012 * +#* Yorik van Havre * +#* * +#* This program is free software; you can redistribute it and/or modify * +#* it under the terms of the GNU Lesser General Public License (LGPL) * +#* as published by the Free Software Foundation; either version 2 of * +#* the License, or (at your option) any later version. * +#* for detail see the LICENCE text file. * +#* * +#* This program 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 program; if not, write to the Free Software * +#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +#* USA * +#* * +#*************************************************************************** + +import FreeCAD,FreeCADGui,sys +rf=FreeCAD.ParamGet("User parameter:BaseApp/Preferences/RecentFiles") +FreeCAD.loadFile(rf.GetString("MRU3")) + diff --git a/src/Mod/Start/StartPage/StartPage.py b/src/Mod/Start/StartPage/StartPage.py index b6d858ea42..3591cf84f1 100644 --- a/src/Mod/Start/StartPage/StartPage.py +++ b/src/Mod/Start/StartPage/StartPage.py @@ -131,6 +131,10 @@ text61 = translate("StartPage","Obtain a development version") text62 = translate("StartPage","Development versions are made available by community members from time to time and usually contain the latest changes, but are more likely to contain bugs.") text63 = translate("StartPage","See all commits") text64 = translate("StartPage","Load an FEM 2D example analysis") +text65 = translate("StartPage","FreeCAD Standard File") +text66 = translate("StartPage","Author") +text67 = translate("StartPage","Company") +text68 = translate("StartPage","License") # get FreeCAD version @@ -372,6 +376,14 @@ page = """ max-width: 300px; clear: both; } + + #description p span { + text-align: left; + } + + .disabled { + opacity: 0.5; + } pre { width: 300px !important; @@ -559,8 +571,19 @@ def getInfo(filename): files=zfile.namelist() # check for meta-file if it's really a FreeCAD document if files[0] == "Document.xml": - html += "

FreeCAD Standard File

" + html += "

" + text65 + "

" image="thumbnails/Thumbnail.png" + doc = zfile.read(files[0]) + doc = doc.replace("\n"," ") + author = re.findall("Property name=\"CreatedBy.*?String value=\"(.*?)\"\/>",doc) + if author: + html += "

" + text66 + ": " + author[0] + "

" + company = re.findall("Property name=\"Company.*?String value=\"(.*?)\"\/>",doc) + if company: + html += "

" + text67 + ": " + company[0] + "

" + lic = re.findall("Property name=\"License.*?String value=\"(.*?)\"\/>",doc) + if lic: + html += "

" + text68 + ": " + lic[0] + "

" if image in files: image=zfile.read(image) thumbfile = tempfile.mkstemp(suffix='.png')[1] @@ -568,8 +591,9 @@ def getInfo(filename): thumb.write(image) thumb.close() html += '
' + else: + print ("not a freecad file: "+os.path.splitext(filename)[1].upper()) else: html += "

" + text41 + "

" @@ -580,7 +604,7 @@ def getRecentFiles(): rf = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/RecentFiles") ct = rf.GetInt("RecentFiles") html = '
    ' - for i in range(3): + for i in range(4): if i < ct: mr = rf.GetString("MRU%d" % (i)) if os.path.exists(mr): @@ -591,11 +615,22 @@ def getRecentFiles(): else: html += ' ' html += '' html += fn html += '' + else: + fn = os.path.basename(mr) + html += '
  • ' + if mr[-5:].upper() == "FCSTD": + html += ' ' + else: + html += ' ' + html += '' + html += fn + html += '
  • ' + html += '
' return html diff --git a/src/Mod/TechDraw/App/AppTechDraw.cpp b/src/Mod/TechDraw/App/AppTechDraw.cpp index 2b981a5ba6..9f046d2ccc 100644 --- a/src/Mod/TechDraw/App/AppTechDraw.cpp +++ b/src/Mod/TechDraw/App/AppTechDraw.cpp @@ -31,6 +31,7 @@ #include "DrawViewSymbol.h" #include "DrawViewClip.h" #include "DrawHatch.h" +#include "DrawGeomHatch.h" #include "DrawViewDraft.h" #include "DrawViewArch.h" #include "DrawViewSpreadsheet.h" @@ -84,6 +85,7 @@ PyMODINIT_FUNC initTechDraw() TechDraw::DrawViewClip ::init(); TechDraw::DrawHatch ::init(); + TechDraw::DrawGeomHatch ::init(); TechDraw::DrawViewDraft ::init(); TechDraw::DrawViewArch ::init(); TechDraw::DrawViewImage ::init(); diff --git a/src/Mod/TechDraw/App/CMakeLists.txt b/src/Mod/TechDraw/App/CMakeLists.txt index 608de84dc6..77b9757ae4 100644 --- a/src/Mod/TechDraw/App/CMakeLists.txt +++ b/src/Mod/TechDraw/App/CMakeLists.txt @@ -37,6 +37,7 @@ generate_from_xml(DrawViewSymbolPy) generate_from_xml(DrawViewClipPy) generate_from_xml(DrawViewDimensionPy) generate_from_xml(DrawHatchPy) +generate_from_xml(DrawGeomHatchPy) generate_from_xml(DrawViewCollectionPy) generate_from_xml(DrawProjGroupPy) generate_from_xml(DrawProjGroupItemPy) @@ -74,6 +75,8 @@ SET(Draw_SRCS DrawViewSection.h DrawHatch.cpp DrawHatch.h + DrawGeomHatch.cpp + DrawGeomHatch.h DrawViewDraft.cpp DrawViewDraft.h DrawViewArch.cpp @@ -92,6 +95,8 @@ SET(TechDraw_SRCS DrawUtil.h Cube.cpp Cube.h + HatchLine.cpp + HatchLine.h PreCompiled.cpp PreCompiled.h EdgeWalker.cpp @@ -128,6 +133,8 @@ SET(Python_SRCS DrawViewDimensionPyImp.cpp DrawHatchPy.xml DrawHatchPyImp.cpp + DrawGeomHatchPy.xml + DrawGeomHatchPyImp.cpp DrawViewCollectionPy.xml DrawViewCollectionPyImp.cpp DrawProjGroupPy.xml @@ -150,6 +157,10 @@ SET(TechDraw_Templates Templates/A4_Portrait_ISO7200TD.svg ) +SET(TechDraw_PATFile + PAT/FCPAT.pat +) + if(MSVC) #add_definitions(-D_PreComp_) #GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" TechDrawCPP_SRCS ${TechDraw_SRCS} ${Draw_SRCS} ) @@ -175,6 +186,11 @@ fc_target_copy_resource(TechDraw ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/TechDraw ${TechDraw_Templates}) +fc_target_copy_resource(TechDraw + ${CMAKE_SOURCE_DIR}/src/Mod/TechDraw + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/TechDraw + ${TechDraw_PATFile}) + SET_BIN_DIR(TechDraw TechDraw /Mod/TechDraw) SET_PYTHON_PREFIX_SUFFIX(TechDraw) diff --git a/src/Mod/TechDraw/App/DrawGeomHatch.cpp b/src/Mod/TechDraw/App/DrawGeomHatch.cpp new file mode 100644 index 0000000000..a642155fd6 --- /dev/null +++ b/src/Mod/TechDraw/App/DrawGeomHatch.cpp @@ -0,0 +1,435 @@ +/*************************************************************************** + * Copyright (c) 2015 WandererFan * + * * + * 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" + +#ifndef _PreComp_ +# include +#include +#include + +# include +# include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#include +#include +#include +#include +#include + +#include "HatchLine.h" +#include "DrawUtil.h" +#include "Geometry.h" +#include "DrawViewPart.h" +#include "DrawViewSection.h" +#include "DrawGeomHatch.h" + +#include // generated from DrawGeomHatchPy.xml + +using namespace TechDraw; +using namespace TechDrawGeometry; +using namespace std; + +PROPERTY_SOURCE(TechDraw::DrawGeomHatch, App::DocumentObject) + + +DrawGeomHatch::DrawGeomHatch(void) +{ + static const char *vgroup = "GeomHatch"; + + ADD_PROPERTY_TYPE(Source,(0),vgroup,(App::PropertyType)(App::Prop_None),"The View + Face to be crosshatched"); + ADD_PROPERTY_TYPE(FilePattern ,(""),vgroup,App::Prop_None,"The crosshatch pattern file for this area"); + ADD_PROPERTY_TYPE(NamePattern,(""),vgroup,App::Prop_None,"The name of the pattern"); + ADD_PROPERTY_TYPE(ScalePattern,(1.0),vgroup,App::Prop_None,"GeomHatch pattern size adjustment"); + + getParameters(); + +} + +DrawGeomHatch::~DrawGeomHatch() +{ +} + +void DrawGeomHatch::onChanged(const App::Property* prop) +{ + if (prop == &Source ) { + if (!isRestoring()) { + DrawGeomHatch::execute(); + } + } + + if (prop == &FilePattern || + prop == &NamePattern ) { + if ((!FilePattern.isEmpty()) && + (!NamePattern.isEmpty())) { + std::vector specs = getDecodedSpecsFromFile(); + m_lineSets.clear(); + for (auto& hl: specs) { + //hl.dump("hl from file"); + LineSet ls; + ls.setHatchLine(hl); + m_lineSets.push_back(ls); + } + + } + } + + App::DocumentObject::onChanged(prop); +} + +short DrawGeomHatch::mustExecute() const +{ + short result = 0; + if (!isRestoring()) { + result = (Source.isTouched() || + FilePattern.isTouched() || + NamePattern.isTouched() ); + } + + if (result) { + return result; + } + return App::DocumentObject::mustExecute(); +} + + +App::DocumentObjectExecReturn *DrawGeomHatch::execute(void) +{ + + return App::DocumentObject::StdReturn; +} + +DrawViewPart* DrawGeomHatch::getSourceView(void) const +{ + App::DocumentObject* obj = Source.getValue(); + DrawViewPart* result = dynamic_cast(obj); + return result; +} + +std::vector DrawGeomHatch::getDecodedSpecsFromFile() +{ + std::string fileSpec = FilePattern.getValue(); + std::string myPattern = NamePattern.getValue(); + return getDecodedSpecsFromFile(fileSpec,myPattern); +} + + +//!get all the specification lines and decode them into HatchLine structures +/*static*/ +std::vector DrawGeomHatch::getDecodedSpecsFromFile(std::string fileSpec, std::string myPattern) +{ + std::vector result; + Base::FileInfo fi(fileSpec); + if (!fi.isReadable()) { + Base::Console().Error("DrawGeomHatch::getDecodedSpecsFromFile not able to open %s!\n",fileSpec.c_str()); + return result; + } + result = HatchLine::getSpecsForPattern(fileSpec,myPattern); + + return result; +} + +std::vector DrawGeomHatch::getDrawableLines(int i) //get the drawable lines for face i +{ + std::vector result; + DrawViewPart* source = getSourceView(); + if (!source || + !source->hasGeometry()) { + Base::Console().Message("TRACE - DC::getDrawableLines - no source geometry\n"); + return result; + } + return getDrawableLines(source, m_lineSets,i, ScalePattern.getValue()); +} + +/* static */ +std::vector DrawGeomHatch::getDrawableLines(DrawViewPart* source, std::vector lineSets, int iface, double scale ) +{ + std::vector result; + + //is source is a section? + DrawViewSection* section = dynamic_cast(source); + bool usingSection = false; + if (section != nullptr) { + usingSection = true; + } + + if (lineSets.empty()) { + Base::Console().Log("INFO - DC::getDrawableLines - no LineSets!\n"); + return result; + } + + std::vector faceWires; + if (usingSection) { + faceWires = section->getWireForFace(iface); + } else { + faceWires = source->getWireForFace(iface); + } + + //build face(s) from geometry + gp_Pnt gOrg(0.0,0.0,0.0); + gp_Dir gDir(0.0,0.0,1.0); + gp_Pln plane(gOrg,gDir); + + BRepBuilderAPI_MakeFace mkFace(plane, faceWires.front(), true); + std::vector::iterator itWire = ++faceWires.begin(); //starting with second wire + for (; itWire != faceWires.end(); itWire++) { + mkFace.Add(*itWire); + } + if (!mkFace.IsDone()) { + Base::Console().Log("INFO - DC::getDrawableLines - face creation failed\n"); + return result; + } + TopoDS_Face face = mkFace.Face(); + + Bnd_Box bBox; + BRepBndLib::Add(face, bBox); + bBox.SetGap(0.0); + + for (auto& ls: lineSets) { + HatchLine hl = ls.getHatchLine(); + std::vector candidates = DrawGeomHatch::makeEdgeOverlay(hl, bBox, scale); + + //make Compound for this linespec + BRep_Builder builder; + TopoDS_Compound Comp; + builder.MakeCompound(Comp); + for (auto& c: candidates) { + builder.Add(Comp, c); + } + + //Common Compound with Face + BRepAlgoAPI_Common mkCommon(face, Comp); + if ((!mkCommon.IsDone()) || + (mkCommon.Shape().IsNull()) ) { + Base::Console().Log("INFO - DC::getDrawableLines - Common creation failed\n"); + return result; + } + TopoDS_Shape common = mkCommon.Shape(); + + //Save edges from Common + std::vector resultEdges; + std::vector resultGeoms; + TopTools_IndexedMapOfShape mapOfEdges; + TopExp::MapShapes(common, TopAbs_EDGE, mapOfEdges); + for ( int i = 1 ; i <= mapOfEdges.Extent() ; i++ ) { + const TopoDS_Edge& edge = TopoDS::Edge(mapOfEdges(i)); + if (edge.IsNull()) { + Base::Console().Log("INFO - DC::getDrawableLines - edge: %d is NULL\n",i); + continue; + } + TechDrawGeometry::BaseGeom* base = BaseGeom::baseFactory(edge); + if (base == nullptr) { + Base::Console().Log("FAIL - DC::getDrawableLines - baseFactory failed for edge: %d\n",i); + throw Base::Exception("GeometryObject::addGeomFromCompound - baseFactory failed"); + } + resultGeoms.push_back(base); + resultEdges.push_back(edge); + } + ls.setEdges(resultEdges); + ls.setGeoms(resultGeoms); + result.push_back(ls); + } + return result; +} +/* static */ +std::vector DrawGeomHatch::makeEdgeOverlay(HatchLine hl, Bnd_Box b, double scale) +{ + std::vector result; + + double minX,maxX,minY,maxY,minZ,maxZ; + b.Get(minX,minY,minZ,maxX,maxY,maxZ); + + Base::Vector3d start; + Base::Vector3d end; + Base::Vector3d origin = hl.getOrigin(); +// double interval = hl.getInterval() * ScalePattern.getValue(); + double interval = hl.getInterval() * scale; + double angle = hl.getAngle(); + + //only dealing with angles -180:180 for now + if (angle > 90.0) { + angle = -(180.0 - angle); + } else if (angle < -90.0) { + angle = (180 + angle); + } + angle = -angle; //not sure why this is required? inverted Y? + double slope = tan(angle * M_PI/180.0); + + if (angle == 0.0) { //odd case 1: horizontal lines + double y = origin.y; + double x1 = minX; + double x2 = maxX; + start = Base::Vector3d(x1,y,0); + end = Base::Vector3d(x2,y,0); + int repeatUp = (int) ceil(((maxY - y)/interval) + 1); + int repeatDown = (int) ceil(((y - minY)/interval) + 1); + // make up repeats + int i; + for (i = 1; i < repeatUp; i++) { + Base::Vector3d newStart(minX,y + float(i)*interval,0); + Base::Vector3d newEnd(maxX,y + float(i)*interval,0); + TopoDS_Edge newLine = makeLine(newStart,newEnd); + result.push_back(newLine); + } + // make down repeats + for (i = 1; i < repeatDown; i++) { + Base::Vector3d newStart(minX, y - float(i)*interval,0); + Base::Vector3d newEnd(maxX, y - float(i)*interval,0); + TopoDS_Edge newLine = makeLine(newStart,newEnd); + result.push_back(newLine); + } + } else if (angle > 0) { //bottomleft - topright + double xRightAtom = origin.x + ((maxY - origin.y)/slope); + double xLeftAtom = origin.x + ((minY - origin.y)/slope); + start = Base::Vector3d(xLeftAtom,minY,0); + end = Base::Vector3d(xRightAtom,maxY,0); + int repeatRight = (int) ceil(((maxX - xLeftAtom)/interval) + 1); + int repeatLeft = (int) ceil(((xRightAtom - minX)/interval) + 1); + + // make right repeats + int i; + for (i = 1; i < repeatRight; i++) { + Base::Vector3d newStart(start.x + float(i)*interval,minY,0); + Base::Vector3d newEnd(end.x + float(i)*interval,maxY,0); + TopoDS_Edge newLine = makeLine(newStart,newEnd); + result.push_back(newLine); + } + // make left repeats + for (i = 1; i < repeatLeft; i++) { + Base::Vector3d newStart(start.x - float(i)*interval,minY,0); + Base::Vector3d newEnd(end.x - float(i)*interval,maxY,0); + TopoDS_Edge newLine = makeLine(newStart,newEnd); + result.push_back(newLine); + } + } else { //topleft - bottomright + double x2 = origin.x + (maxY - origin.y)/slope; + double x1 = origin.x + (minY - origin.y)/slope; + start = Base::Vector3d(x2,maxY,0); + end = Base::Vector3d(x1,minY,0); + int repeatRight = (int) ceil(((maxX - start.x)/interval) + 1); + int repeatLeft = (int) ceil(((end.x - minX)/interval) + 1); + + // make right repeats + int i; + for (i = 1; i < repeatRight; i++) { + Base::Vector3d newStart(start.x + float(i)*interval,maxY,0); + Base::Vector3d newEnd(end.x + float(i)*interval,minY,0); + TopoDS_Edge newLine = makeLine(newStart,newEnd); + result.push_back(newLine); + } + // make left repeats + for (i = 1; i < repeatLeft; i++) { + Base::Vector3d newStart(start.x - float(i)*interval,maxY,0); + Base::Vector3d newEnd(end.x - float(i)*interval,minY,0); + TopoDS_Edge newLine = makeLine(newStart,newEnd); + result.push_back(newLine); + } + } + //atom is centre line in a set of pattern lines. + TopoDS_Edge atom = makeLine(start,end); + result.push_back(atom); + return result; +} + +TopoDS_Edge DrawGeomHatch::makeLine(Base::Vector3d s, Base::Vector3d e) +{ + TopoDS_Edge result; + gp_Pnt start(s.x,s.y,0.0); + gp_Pnt end(e.x,e.y,0.0); + TopoDS_Vertex v1 = BRepBuilderAPI_MakeVertex(start); + TopoDS_Vertex v2 = BRepBuilderAPI_MakeVertex(end); + BRepBuilderAPI_MakeEdge makeEdge1(v1,v2); + result = makeEdge1.Edge(); + return result; +} + +void DrawGeomHatch::getParameters(void) +{ +//this is probably "/build/data/Mod/TechDraw/PAT" + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/PAT"); + + std::string defaultDir = App::Application::getResourceDir() + "Mod/TechDraw/PAT/"; + std::string defaultFileName = defaultDir + "FCPAT.pat"; + QString patternFileName = QString::fromStdString(hGrp->GetASCII("FilePattern",defaultFileName.c_str())); + if (patternFileName.isEmpty()) { + patternFileName = QString::fromStdString(defaultFileName); + } + QFileInfo tfi(patternFileName); + if (tfi.isReadable()) { + FilePattern.setValue(patternFileName.toUtf8().constData()); + } else { + Base::Console().Error("DrawGeomHatch: PAT file: %s Not Found\n",patternFileName.toUtf8().constData()); + } + hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/PAT"); + std::string defaultNamePattern = "Diamond"; + NamePattern.setValue(hGrp->GetASCII("NamePattern",defaultNamePattern.c_str())); + +} + + +PyObject *DrawGeomHatch::getPyObject(void) +{ + if (PythonObject.is(Py::_None())) { + PythonObject = Py::Object(new DrawGeomHatchPy(this),true); + } + return Py::new_reference_to(PythonObject); +} + +// Python Drawing feature --------------------------------------------------------- + +namespace App { +/// @cond DOXERR +PROPERTY_SOURCE_TEMPLATE(TechDraw::DrawGeomHatchPython, TechDraw::DrawGeomHatch) +template<> const char* TechDraw::DrawGeomHatchPython::getViewProviderName(void) const { + return "TechDrawGui::ViewProviderGeomHatch"; +} +/// @endcond + +// explicit template instantiation +template class TechDrawExport FeaturePythonT; +} diff --git a/src/Mod/TechDraw/App/DrawGeomHatch.h b/src/Mod/TechDraw/App/DrawGeomHatch.h new file mode 100644 index 0000000000..767fb62910 --- /dev/null +++ b/src/Mod/TechDraw/App/DrawGeomHatch.h @@ -0,0 +1,89 @@ +/*************************************************************************** + * Copyright (c) 2017 WandererFan * + * * + * 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 * + * * + ***************************************************************************/ + +#ifndef _TechDraw_DrawGeomHatch_h_ +#define _TechDraw_DrawGeomHatch_h_ + +# include +# include +# include +#include + +class TopoDS_Edge; +class Bnd_Box; + +namespace TechDrawGeometry +{ +class BaseGeom; +} + +namespace TechDraw +{ +class DrawViewPart; +class HatchLine; +class LineSet; +class DashSet; + +class TechDrawExport DrawGeomHatch : public App::DocumentObject +{ + PROPERTY_HEADER(TechDraw::DrawGeomHatch); + +public: + DrawGeomHatch(); + virtual ~DrawGeomHatch(); + + App::PropertyLinkSub Source; //the dvX & face(s) this crosshatch belongs to + App::PropertyFile FilePattern; + App::PropertyString NamePattern; + App::PropertyFloat ScalePattern; + + virtual short mustExecute() const; + virtual App::DocumentObjectExecReturn *execute(void); + virtual void onChanged(const App::Property* prop); + virtual const char* getViewProviderName(void) const { + return "TechDrawGui::ViewProviderGeomHatch"; + } + virtual PyObject *getPyObject(void); + + DrawViewPart* getSourceView(void) const; + + std::vector getDrawableLines(int i = 0); + static std::vector getDrawableLines(DrawViewPart* dvp, std::vector lineSets, int iface, double scale); + + static std::vector makeEdgeOverlay(HatchLine hl, Bnd_Box bBox, double scale); + static TopoDS_Edge makeLine(Base::Vector3d s, Base::Vector3d e); + static std::vector getDecodedSpecsFromFile(std::string fileSpec, std::string myPattern); + +protected: + void getParameters(void); + std::vector getDecodedSpecsFromFile(); + std::vector m_lineSets; + +private: +}; + +typedef App::FeaturePythonT DrawGeomHatchPython; + + + +} //namespace TechDraw +#endif diff --git a/src/Mod/TechDraw/App/DrawGeomHatchPy.xml b/src/Mod/TechDraw/App/DrawGeomHatchPy.xml new file mode 100644 index 0000000000..8cedf84241 --- /dev/null +++ b/src/Mod/TechDraw/App/DrawGeomHatchPy.xml @@ -0,0 +1,18 @@ + + + + + + Feature for creating and manipulating Technical Drawing GeomHatch areas + + + + diff --git a/src/Mod/TechDraw/App/DrawGeomHatchPyImp.cpp b/src/Mod/TechDraw/App/DrawGeomHatchPyImp.cpp new file mode 100644 index 0000000000..327ae70524 --- /dev/null +++ b/src/Mod/TechDraw/App/DrawGeomHatchPyImp.cpp @@ -0,0 +1,32 @@ + +#include "PreCompiled.h" + +#include "DrawGeomHatch.h" + +// inclusion of the generated files (generated out of DrawGeomHatchPy.xml) +#include +#include + +using namespace TechDraw; + +// returns a string which represents the object e.g. when printed in python +std::string DrawGeomHatchPy::representation(void) const +{ + return std::string(""); +} + + + + + + + +PyObject *DrawGeomHatchPy::getCustomAttributes(const char* /*attr*/) const +{ + return 0; +} + +int DrawGeomHatchPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) +{ + return 0; +} diff --git a/src/Mod/TechDraw/App/DrawHatch.cpp b/src/Mod/TechDraw/App/DrawHatch.cpp index 44587f4203..81e8437a95 100644 --- a/src/Mod/TechDraw/App/DrawHatch.cpp +++ b/src/Mod/TechDraw/App/DrawHatch.cpp @@ -61,13 +61,15 @@ DrawHatch::DrawHatch(void) ADD_PROPERTY_TYPE(Source,(0),vgroup,(App::PropertyType)(App::Prop_None),"The View + Face to be hatched"); ADD_PROPERTY_TYPE(HatchPattern ,(""),vgroup,App::Prop_None,"The hatch pattern file for this area"); ADD_PROPERTY_TYPE(HatchColor,(fcColor),vgroup,App::Prop_None,"The color of the hatch pattern"); + ADD_PROPERTY_TYPE(HatchScale,(1.0),vgroup,App::Prop_None,"Hatch pattern size adjustment"); + DirProjection.setStatus(App::Property::ReadOnly,true); hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Files"); std::string defaultDir = App::Application::getResourceDir() + "Mod/Drawing/patterns/"; std::string defaultFileName = defaultDir + "simple.svg"; - QString patternFileName = QString::fromStdString(hGrp->GetASCII("PatternFile",defaultFileName.c_str())); + QString patternFileName = QString::fromStdString(hGrp->GetASCII("FileHatch",defaultFileName.c_str())); if (patternFileName.isEmpty()) { patternFileName = QString::fromStdString(defaultFileName); } @@ -84,7 +86,8 @@ DrawHatch::~DrawHatch() void DrawHatch::onChanged(const App::Property* prop) { if (prop == &Source || - prop == &HatchPattern || + prop == &HatchPattern || //sb VP property? + prop == &HatchScale || prop == &HatchColor) { if (!isRestoring()) { DrawHatch::execute(); diff --git a/src/Mod/TechDraw/App/DrawHatch.h b/src/Mod/TechDraw/App/DrawHatch.h index 5219bb1e5b..496cc15a4d 100644 --- a/src/Mod/TechDraw/App/DrawHatch.h +++ b/src/Mod/TechDraw/App/DrawHatch.h @@ -44,6 +44,7 @@ public: App::PropertyLinkSub Source; //the dvp & face this hatch belongs to App::PropertyFile HatchPattern; App::PropertyColor HatchColor; + App::PropertyFloat HatchScale; //short mustExecute() const; diff --git a/src/Mod/TechDraw/App/DrawPage.cpp b/src/Mod/TechDraw/App/DrawPage.cpp index 86a8ff2c3c..b03b03cf40 100644 --- a/src/Mod/TechDraw/App/DrawPage.cpp +++ b/src/Mod/TechDraw/App/DrawPage.cpp @@ -66,6 +66,7 @@ const char* DrawPage::ProjectionTypeEnums[] = { "First Angle", DrawPage::DrawPage(void) { static const char *group = "Page"; + nowDeleting = false; ADD_PROPERTY_TYPE(Template, (0), group, (App::PropertyType)(App::Prop_None), "Attached Template"); ADD_PROPERTY_TYPE(Views, (0), group, (App::PropertyType)(App::Prop_None), "Attached Views"); @@ -101,11 +102,13 @@ void DrawPage::onBeforeChange(const App::Property* prop) void DrawPage::onChanged(const App::Property* prop) { if (prop == &Template) { - if (!isRestoring()) { + if (!isRestoring() && + !isDeleting()) { //TODO: reload if Template prop changes (ie different Template) } } else if (prop == &Views) { - if (!isRestoring()) { + if (!isRestoring() && + !isDeleting() ) { //TODO: reload if Views prop changes (ie adds/deletes) } } else if(prop == &Scale) { @@ -130,7 +133,7 @@ void DrawPage::onChanged(const App::Property* prop) // TODO: Also update Template graphic. } - App::DocumentObject::onChanged(prop); + App::DocumentObject::onChanged(prop); //<<<< } App::DocumentObjectExecReturn *DrawPage::execute(void) @@ -289,6 +292,10 @@ void DrawPage::onDocumentRestored() if (part != nullptr && !part->hasGeometry()) { part->execute(); +// std::vector parent = part->getInList(); +// for (auto& p: parent) { +// p->touch(); +// } } } //second, make sure all the Dimensions have been executed so Measurements have References @@ -302,3 +309,28 @@ void DrawPage::onDocumentRestored() recompute(); App::DocumentObject::onDocumentRestored(); } + +void DrawPage::unsetupObject() +{ + nowDeleting = true; + + // Remove the Page's views & template from document + App::Document* doc = getDocument(); + std::string docName = doc->getName(); + + const std::vector currViews = Views.getValues(); + std::vector emptyViews; + std::vector::const_iterator it = currViews.begin(); + for (; it != currViews.end(); it++) { + std::string viewName = (*it)->getNameInDocument(); + Base::Interpreter().runStringArg("App.getDocument(\"%s\").removeObject(\"%s\")", + docName.c_str(), viewName.c_str()); + } + Views.setValues(emptyViews); + + std::string templateName = Template.getValue()->getNameInDocument(); + Base::Interpreter().runStringArg("App.getDocument(\"%s\").removeObject(\"%s\")", + docName.c_str(), templateName.c_str()); + Template.setValue(nullptr); +} + diff --git a/src/Mod/TechDraw/App/DrawPage.h b/src/Mod/TechDraw/App/DrawPage.h index 8f9865a33f..cc6b1ff922 100644 --- a/src/Mod/TechDraw/App/DrawPage.h +++ b/src/Mod/TechDraw/App/DrawPage.h @@ -81,14 +81,20 @@ public: */ double getPageHeight() const; const char* getPageOrientation() const; + bool isDeleting(void) { return nowDeleting; } + protected: void onBeforeChange(const App::Property* prop); void onChanged(const App::Property* prop); virtual void onDocumentRestored(); + virtual void unsetupObject(); + private: static const char* ProjectionTypeEnums[]; + bool nowDeleting; + }; } //namespace TechDraw diff --git a/src/Mod/TechDraw/App/DrawProjGroup.cpp b/src/Mod/TechDraw/App/DrawProjGroup.cpp index a3da8149f2..d17a8c0193 100644 --- a/src/Mod/TechDraw/App/DrawProjGroup.cpp +++ b/src/Mod/TechDraw/App/DrawProjGroup.cpp @@ -176,7 +176,9 @@ void DrawProjGroup::onChanged(const App::Property* prop) TechDraw::DrawPage *page = getPage(); if (!isRestoring() && page) { if ( prop == &Views ) { - recompute(); + if (!isDeleting()) { + recompute(); + } } else if (prop == &Scale) { updateChildren(Scale.getValue()); //resetPositions(); @@ -185,7 +187,8 @@ void DrawProjGroup::onChanged(const App::Property* prop) App::DocumentObject* sourceObj = Source.getValue(); if (sourceObj != nullptr) { if (!hasAnchor()) { - addProjection("Front"); + // if we have a Source, but no Anchor, make an anchor + Anchor.setValue(addProjection("Front")); } } else { //Source has been changed to null! Why? What to do? @@ -214,9 +217,9 @@ App::DocumentObjectExecReturn *DrawProjGroup::execute(void) return DrawViewCollection::execute(); } - docObj = Anchor.getValue(); //must have an anchor, so create one as soon as we have a Page and Source + docObj = Anchor.getValue(); if (docObj == nullptr) { - docObj = addProjection("Front"); + return DrawViewCollection::execute(); } double newScale = Scale.getValue(); @@ -441,8 +444,6 @@ bool DrawProjGroup::hasProjection(const char *viewProjType) const App::DocumentObject * DrawProjGroup::addProjection(const char *viewProjType) { - //if this is the first Projection added, it should automatically be the Anchor/front view - // or if viewProjType == "Front" Anchor.setValue(view) DrawProjGroupItem *view( nullptr ); if ( checkViewProjType(viewProjType) && !hasProjection(viewProjType) ) { @@ -460,21 +461,8 @@ App::DocumentObject * DrawProjGroup::addProjection(const char *viewProjType) view->Type.setValue( viewProjType ); view->Label.setValue( viewProjType ); view->Source.setValue( Source.getValue() ); - if( strcmp(viewProjType,"Front") == 0 ) { - - Anchor.setValue(docObj); - view->Direction.setValue(m_frameToStdDir.at("Front")); //just (Base::Vector3d(0.0,-1.0,0.0)) - view->RotationVector.setValue(m_frameToStdRot.at("Front")); - } else { - //TODO: really need to check with Cube to get current dir & rot this uses initial values from table - //if (DPGI(front) and DPGI(right) exist) config = front.face + right.face - // - //else - // use start up values (m_frameToStdDir/m_frameToStdRot) - view->Direction.setValue(m_frameToStdDir.at(viewProjType)); - view->RotationVector.setValue(m_frameToStdRot.at(viewProjType)); - } - + view->Direction.setValue(m_frameToStdDir.at(viewProjType)); + view->RotationVector.setValue(m_frameToStdRot.at(viewProjType)); addView(view); //from DrawViewCollection - add to ProjGroup Views moveToCentre(); view->recomputeFeature(); @@ -483,6 +471,7 @@ App::DocumentObject * DrawProjGroup::addProjection(const char *viewProjType) return view; } +//NOTE: projections can be deleted without using removeProjection - ie regular DocObject deletion process. int DrawProjGroup::removeProjection(const char *viewProjType) { // TODO: shouldn't be able to delete "Front" unless deleting whole group @@ -508,6 +497,7 @@ int DrawProjGroup::removeProjection(const char *viewProjType) return -1; } +//removes all DPGI - used when deleting DPG int DrawProjGroup::purgeProjections() { while (!Views.getValues().empty()) { @@ -803,7 +793,9 @@ TechDraw::DrawProjGroupItem* DrawProjGroup::getAnchor(void) App::DocumentObject* docObj = Anchor.getValue(); if (docObj == nullptr) { //explode! DPG w/o anchor - Base::Console().Error("Error - DPG::getAnchor - DPG has no Anchor!!!\n"); + if (!isDeleting()) { + Base::Console().Error("Error - DPG::getAnchor - DPG has no Anchor!!!\n"); + } } else { result = static_cast(docObj); } @@ -1033,6 +1025,7 @@ void DrawProjGroup::onDocumentRestored() } std::string viewRot = Cube::dirToView(rotFront); std::string config = viewDir + viewRot; + //find(config) or try/catch try { config = m_dirRotToConfig.at(config); setConfig(config); diff --git a/src/Mod/TechDraw/App/DrawProjGroupItem.cpp b/src/Mod/TechDraw/App/DrawProjGroupItem.cpp index e53f0069ce..5f2e107ab8 100644 --- a/src/Mod/TechDraw/App/DrawProjGroupItem.cpp +++ b/src/Mod/TechDraw/App/DrawProjGroupItem.cpp @@ -140,7 +140,7 @@ double DrawProjGroupItem::getRotateAngle() gp_Ax2 viewAxis; Base::Vector3d x = RotationVector.getValue(); //current rotation Base::Vector3d nx = x; - x.Normalize(); + nx.Normalize(); Base::Vector3d na = Direction.getValue(); na.Normalize(); Base::Vector3d org(0.0,0.0,0.0); @@ -160,6 +160,21 @@ double DrawProjGroupItem::getRotateAngle() return angle; } +void DrawProjGroupItem::unsetupObject() +{ + if (getGroup() != nullptr) { + if (getGroup()->hasProjection(Type.getValueAsString()) ) { + if ((getGroup()->getAnchor() == this) && + !getGroup()->isDeleting() ) { + Base::Console().Warning("Warning - DPG (%s/%s) may be corrupt - Anchor deleted\n", + getGroup()->getNameInDocument(),getGroup()->Label.getValue()); + getGroup()->Anchor.setValue(nullptr); //this catches situation where DPGI is deleted w/o DPG::removeProjection + } + } + } + DrawViewPart::unsetupObject(); +} + PyObject *DrawProjGroupItem::getPyObject(void) { if (PythonObject.is(Py::_None())) { diff --git a/src/Mod/TechDraw/App/DrawProjGroupItem.h b/src/Mod/TechDraw/App/DrawProjGroupItem.h index ac831f82a3..8916594dd2 100644 --- a/src/Mod/TechDraw/App/DrawProjGroupItem.h +++ b/src/Mod/TechDraw/App/DrawProjGroupItem.h @@ -59,12 +59,8 @@ public: App::PropertyVector RotationVector; short mustExecute() const; - /** @name methods overide Feature */ - //@{ - /// recalculate the Feature virtual void onDocumentRestored(); -// virtual App::DocumentObjectExecReturn *execute(void); // TODO: Delete me too if we take out the implementation - //@} + virtual void unsetupObject(); DrawProjGroup* getGroup(void) const; double getRotateAngle(); diff --git a/src/Mod/TechDraw/App/DrawProjectSplit.cpp b/src/Mod/TechDraw/App/DrawProjectSplit.cpp index 32eb721310..15741db62e 100644 --- a/src/Mod/TechDraw/App/DrawProjectSplit.cpp +++ b/src/Mod/TechDraw/App/DrawProjectSplit.cpp @@ -127,7 +127,7 @@ std::vector DrawProjectSplit::getEdgesForWalker(TopoDS_Shape shape, TechDrawGeometry::GeometryObject* DrawProjectSplit::buildGeometryObject(TopoDS_Shape shape, const gp_Ax2& viewAxis) { - TechDrawGeometry::GeometryObject* geometryObject = new TechDrawGeometry::GeometryObject("DrawProjectSplit"); + TechDrawGeometry::GeometryObject* geometryObject = new TechDrawGeometry::GeometryObject("DrawProjectSplit",nullptr); geometryObject->projectShape(shape, viewAxis); diff --git a/src/Mod/TechDraw/App/DrawUtil.cpp b/src/Mod/TechDraw/App/DrawUtil.cpp index 685824bbae..f4cd1d0c6e 100644 --- a/src/Mod/TechDraw/App/DrawUtil.cpp +++ b/src/Mod/TechDraw/App/DrawUtil.cpp @@ -277,6 +277,16 @@ std::string DrawUtil::formatVector(const Base::Vector3d& v) return result; } +std::string DrawUtil::formatVector(const Base::Vector2d& v) +{ + std::string result; + std::stringstream builder; + builder << std::fixed << std::setprecision(3) ; + builder << " (" << v.x << "," << v.y << ") "; + result = builder.str(); + return result; +} + //! compare 2 vectors for sorting - true if v1 < v2 bool DrawUtil::vectorLess(const Base::Vector3d& v1, const Base::Vector3d& v2) { @@ -293,7 +303,6 @@ bool DrawUtil::vectorLess(const Base::Vector3d& v1, const Base::Vector3d& v2) return result; } - //!convert fromPoint in coordinate system fromSystem to reference coordinate system Base::Vector3d DrawUtil::toR3(const gp_Ax2 fromSystem, const Base::Vector3d fromPoint) { diff --git a/src/Mod/TechDraw/App/DrawUtil.h b/src/Mod/TechDraw/App/DrawUtil.h index 41059cfdb6..06ea4078ab 100644 --- a/src/Mod/TechDraw/App/DrawUtil.h +++ b/src/Mod/TechDraw/App/DrawUtil.h @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -59,6 +60,7 @@ class TechDrawExport DrawUtil { static bool fpCompare(const double& d1, const double& d2); static Base::Vector3d vertex2Vector(const TopoDS_Vertex& v); static std::string formatVector(const Base::Vector3d& v); + static std::string formatVector(const Base::Vector2d& v); static bool vectorLess(const Base::Vector3d& v1, const Base::Vector3d& v2); static Base::Vector3d toR3(const gp_Ax2 fromSystem, const Base::Vector3d fromPoint); static bool checkParallel(const Base::Vector3d v1, const Base::Vector3d v2); diff --git a/src/Mod/TechDraw/App/DrawViewCollection.cpp b/src/Mod/TechDraw/App/DrawViewCollection.cpp index 47e6b79227..a0f158d2d5 100644 --- a/src/Mod/TechDraw/App/DrawViewCollection.cpp +++ b/src/Mod/TechDraw/App/DrawViewCollection.cpp @@ -26,6 +26,8 @@ # include #endif +#include + #include #include @@ -42,6 +44,7 @@ PROPERTY_SOURCE(TechDraw::DrawViewCollection, TechDraw::DrawView) DrawViewCollection::DrawViewCollection() { + nowDeleting = false; static const char *group = "Drawing view"; ADD_PROPERTY_TYPE(Source ,(0), group, App::Prop_None,"Shape to view"); ADD_PROPERTY_TYPE(Views ,(0), group, App::Prop_None,"Attached Views"); @@ -165,6 +168,26 @@ void DrawViewCollection::onChanged(const App::Property* prop) TechDraw::DrawView::onChanged(prop); } +void DrawViewCollection::unsetupObject() +{ + nowDeleting = true; + + // Remove the collection's views from document + App::Document* doc = getDocument(); + std::string docName = doc->getName(); + + const std::vector currViews = Views.getValues(); + std::vector emptyViews; + std::vector::const_iterator it = currViews.begin(); + for (; it != currViews.end(); it++) { + std::string viewName = (*it)->getNameInDocument(); + Base::Interpreter().runStringArg("App.getDocument(\"%s\").removeObject(\"%s\")", + docName.c_str(), viewName.c_str()); + } + Views.setValues(emptyViews); +} + + App::DocumentObjectExecReturn *DrawViewCollection::execute(void) { if (ScaleType.isValue("Page")) { diff --git a/src/Mod/TechDraw/App/DrawViewCollection.h b/src/Mod/TechDraw/App/DrawViewCollection.h index 4b1c85d546..d0e0ea029c 100644 --- a/src/Mod/TechDraw/App/DrawViewCollection.h +++ b/src/Mod/TechDraw/App/DrawViewCollection.h @@ -50,14 +50,13 @@ public: int addView(DrawView *view); int removeView(DrawView *view); void rebuildViewList(void); + bool isDeleting(void) { return nowDeleting; } int countChildren(); - /** @name methods overide Feature */ - //@{ - /// recalculate the Feature + virtual void onDocumentRestored(); virtual App::DocumentObjectExecReturn *execute(void); - //@} + virtual void unsetupObject(); /// returns the type name of the ViewProvider virtual const char* getViewProviderName(void) const { @@ -67,6 +66,7 @@ public: protected: void onChanged(const App::Property* prop); + bool nowDeleting; }; } //namespace TechDraw diff --git a/src/Mod/TechDraw/App/DrawViewDetail.cpp b/src/Mod/TechDraw/App/DrawViewDetail.cpp index 1a108813ad..ffd126f84e 100644 --- a/src/Mod/TechDraw/App/DrawViewDetail.cpp +++ b/src/Mod/TechDraw/App/DrawViewDetail.cpp @@ -103,6 +103,7 @@ DrawViewDetail::DrawViewDetail() ADD_PROPERTY_TYPE(Reference ,("1"),dgroup,App::Prop_None,"An identifier for this detail"); getParameters(); + m_fudge = 1.1; } DrawViewDetail::~DrawViewDetail() @@ -165,8 +166,7 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void) Base::Vector3d anchor = AnchorPoint.getValue(); //this is a 2D point anchor = Base::Vector3d(anchor.x,anchor.y, 0.0); - double radiusFudge = 1.1; - double radius = Radius.getValue() * radiusFudge; + double radius = getFudgeRadius(); Base::Vector3d dirDetail = dvp->Direction.getValue(); double scale = Scale.getValue(); gp_Ax2 viewAxis = getViewAxis(Base::Vector3d(0.0,0.0,0.0), dirDetail, false); @@ -204,11 +204,11 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void) BRepAlgoAPI_Common mkCommon(myShape,tool); if (!mkCommon.IsDone()) { - Base::Console().Message("TRACE - DVD::execute - mkCommon not done\n"); + Base::Console().Log("DVD::execute - mkCommon not done\n"); return new App::DocumentObjectExecReturn("DVD::execute - mkCommon not done"); } if (mkCommon.Shape().IsNull()) { - Base::Console().Message("TRACE - DVD::execute - mkCommon.Shape is Null\n"); + Base::Console().Log("DVD::execute - mkCommon.Shape is Null\n"); return new App::DocumentObjectExecReturn("DVD::execute - mkCommon.Shape is Null"); } @@ -216,7 +216,7 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void) TopExp_Explorer xp; xp.Init(mkCommon.Shape(),TopAbs_SOLID); if (!(xp.More() == Standard_True)) { - Base::Console().Message("TRACE - DVD::execute - mkCommon.Shape is not a solid!\n"); + Base::Console().Log("DVD::execute - mkCommon.Shape is not a solid!\n"); } TopoDS_Shape detail = mkCommon.Shape(); Bnd_Box testBox; @@ -267,6 +267,11 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void) return App::DocumentObject::StdReturn; } +double DrawViewDetail::getFudgeRadius() +{ + return Radius.getValue() * m_fudge; +} + void DrawViewDetail::getParameters() { // what parameters are useful? diff --git a/src/Mod/TechDraw/App/DrawViewDetail.h b/src/Mod/TechDraw/App/DrawViewDetail.h index e8a8561811..6e30179866 100644 --- a/src/Mod/TechDraw/App/DrawViewDetail.h +++ b/src/Mod/TechDraw/App/DrawViewDetail.h @@ -69,12 +69,12 @@ public: } public: - //int getMattingStyle() const {return m_mattingStyle;} + double getFudgeRadius(void); protected: Base::Vector3d toR3(const gp_Ax2 fromSystem, const Base::Vector3d fromPoint); void getParameters(void); - //int m_mattingStyle; + double m_fudge; }; diff --git a/src/Mod/TechDraw/App/DrawViewDimension.cpp b/src/Mod/TechDraw/App/DrawViewDimension.cpp index 9e24f121ce..ad442ce87e 100644 --- a/src/Mod/TechDraw/App/DrawViewDimension.cpp +++ b/src/Mod/TechDraw/App/DrawViewDimension.cpp @@ -119,6 +119,7 @@ DrawViewDimension::DrawViewDimension(void) Rotation.setStatus(App::Property::Hidden,true); measurement = new Measure::Measurement(); + //TODO: should have better initial datumLabel position than (0,0) in the DVP?? something closer to the object being measured? } DrawViewDimension::~DrawViewDimension() @@ -131,16 +132,12 @@ void DrawViewDimension::onChanged(const App::Property* prop) { if (!isRestoring()) { if (prop == &MeasureType) { -// Base::Console().Message("TRACE -DVD::onChanged(MeasureType) - MeasureType: %d Measurehas3D: %d thisHas3D: %d\n", -// MeasureType.getValue(),measurement->has3DReferences(),has3DReferences()); if (MeasureType.isValue("True") && !measurement->has3DReferences()) { Base::Console().Warning("Dimension %s missing Reference to 3D model. Must be Projected.\n", getNameInDocument()); MeasureType.setValue("Projected"); } } if (prop == &References3D) { //have to rebuild the Measurement object -// Base::Console().Message("TRACE -DVD::onChanged(References3D) - MeasureType: %d has3D: %d thisHas3D: %d\n", -// MeasureType.getValue(),measurement->has3DReferences(),has3DReferences()); clear3DMeasurements(); //Measurement object if (!(References3D.getValues()).empty()) { setAll3DMeasurement(); @@ -189,7 +186,7 @@ App::DocumentObjectExecReturn *DrawViewDimension::execute(void) return App::DocumentObject::execute();; } -std::string DrawViewDimension::getFormatedValue() const +std::string DrawViewDimension::getFormatedValue() { QString str = QString::fromUtf8(FormatSpec.getStrValue().data(),FormatSpec.getStrValue().size()); double val = std::abs(getDimValue()); @@ -230,16 +227,16 @@ std::string DrawViewDimension::getFormatedValue() const } -double DrawViewDimension::getDimValue() const +double DrawViewDimension::getDimValue() { double result = 0.0; if (!has2DReferences()) { //happens during Dimension creation - Base::Console().Message("INFO - DVD::getDimValue - Dimension has no References\n"); + Base::Console().Log("INFO - DVD::getDimValue - Dimension has no References\n"); return result; } if (!getViewPart()->hasGeometry()) { //happens when loading saved document - Base::Console().Message("INFO - DVD::getDimValue ViewPart has no Geometry yet\n"); + Base::Console().Log("INFO - DVD::getDimValue ViewPart has no Geometry yet\n"); return result; } @@ -273,6 +270,12 @@ double DrawViewDimension::getDimValue() const // Projected Values const std::vector &objects = References2D.getValues(); const std::vector &subElements = References2D.getSubValues(); + + if (!checkReferences2D()) { + Base::Console().Log("Error: DVD - %s - 2D references are corrupt\n",getNameInDocument()); + References2D.setValue(nullptr,""); + return result; + } if ( Type.isValue("Distance") || Type.isValue("DistanceX") || Type.isValue("DistanceY") ) { @@ -280,7 +283,14 @@ double DrawViewDimension::getDimValue() const //TODO: Check for straight line Edge? int idx = DrawUtil::getIndexFromName(subElements[0]); TechDrawGeometry::BaseGeom* geom = getViewPart()->getProjEdgeByIndex(idx); - TechDrawGeometry::Generic* gen = static_cast(geom); + TechDrawGeometry::Generic* gen; + if (geom && geom->geomType == TechDrawGeometry::GeomType::GENERIC) { + gen = static_cast(geom); + } else { + Base::Console().Log("Error: DVD - %s - 2D references are corrupt\n",getNameInDocument()); + References2D.setValue(nullptr,""); + return result; + } Base::Vector2d start = gen->points[0]; Base::Vector2d end = gen->points[1]; Base::Vector2d line = end - start; @@ -296,9 +306,23 @@ double DrawViewDimension::getDimValue() const int idx0 = DrawUtil::getIndexFromName(subElements[0]); int idx1 = DrawUtil::getIndexFromName(subElements[1]); TechDrawGeometry::BaseGeom* geom0 = getViewPart()->getProjEdgeByIndex(idx0); + TechDrawGeometry::Generic* gen0; + if (geom0 && geom0->geomType == TechDrawGeometry::GeomType::GENERIC) { + gen0 = static_cast(geom0); + } else { + Base::Console().Log("Error: DVD - %s - 2D references are corrupt\n",getNameInDocument()); + References2D.setValue(nullptr,""); + return result; + } TechDrawGeometry::BaseGeom* geom1 = getViewPart()->getProjEdgeByIndex(idx1); - TechDrawGeometry::Generic* gen0 = static_cast(geom0); - TechDrawGeometry::Generic* gen1 = static_cast(geom1); + TechDrawGeometry::Generic* gen1; + if (geom1 && geom1->geomType == TechDrawGeometry::GeomType::GENERIC) { + gen1 = static_cast(geom1); + } else { + Base::Console().Log("Error: DVD - %s - 2D references are corrupt\n",getNameInDocument()); + References2D.setValue(nullptr,""); + return result; + } Base::Vector2d s0 = gen0->points[0]; Base::Vector2d e0 = gen0->points[1]; Base::Vector2d s1 = gen1->points[0]; @@ -319,7 +343,13 @@ double DrawViewDimension::getDimValue() const int idx1 = DrawUtil::getIndexFromName(subElements[1]); TechDrawGeometry::Vertex* v0 = getViewPart()->getProjVertexByIndex(idx0); TechDrawGeometry::Vertex* v1 = getViewPart()->getProjVertexByIndex(idx1); - Base::Vector2d start = v0->pnt; + if ((v0 == nullptr) || + (v1 == nullptr) ) { + Base::Console().Error("Error: DVD - %s - 2D references are corrupt\n",getNameInDocument()); + References2D.setValue(nullptr,""); + return result; + } + Base::Vector2d start = v0->pnt; //v0 != nullptr, but v0->pnt is invalid Base::Vector2d end = v1->pnt; Base::Vector2d line = end - start; if (Type.isValue("Distance")) { @@ -341,6 +371,12 @@ double DrawViewDimension::getDimValue() const e = getViewPart()->getProjEdgeByIndex(idx1); v = getViewPart()->getProjVertexByIndex(idx0); } + if ((v == nullptr) || + (e == nullptr) ) { + Base::Console().Log("Error: DVD - %s - 2D references are corrupt\n",getNameInDocument()); + References2D.setValue(nullptr,""); + return result; + } Base::Vector2d nearPoint = e->nearPoint(v->pnt); Base::Vector2d line = nearPoint - v->pnt; if (Type.isValue("Distance")) { @@ -355,76 +391,99 @@ double DrawViewDimension::getDimValue() const //only 1 reference for a Radius int idx = DrawUtil::getIndexFromName(subElements[0]); TechDrawGeometry::BaseGeom* base = getViewPart()->getProjEdgeByIndex(idx); - TechDrawGeometry::Circle* circle = static_cast (base); + TechDrawGeometry::Circle* circle; + if( (base && base->geomType == TechDrawGeometry::GeomType::CIRCLE) || + (base && base->geomType == TechDrawGeometry::GeomType::ARCOFCIRCLE)) { + circle = static_cast (base); + } else { + Base::Console().Log("Error: DVD - %s - 2D references are corrupt\n",getNameInDocument()); + References2D.setValue(nullptr,""); + return result; + } result = circle->radius / getViewPart()->Scale.getValue(); //Projected BaseGeom is scaled for drawing + } else if(Type.isValue("Diameter")){ //only 1 reference for a Diameter int idx = DrawUtil::getIndexFromName(subElements[0]); TechDrawGeometry::BaseGeom* base = getViewPart()->getProjEdgeByIndex(idx); - TechDrawGeometry::Circle* circle = static_cast (base); + TechDrawGeometry::Circle* circle; + if ((base && base->geomType == TechDrawGeometry::GeomType::CIRCLE) || + (base && base->geomType == TechDrawGeometry::GeomType::ARCOFCIRCLE)) { + circle = static_cast (base); + } else { + return result; + } result = (circle->radius * 2.0) / getViewPart()->Scale.getValue(); //Projected BaseGeom is scaled for drawing } else if(Type.isValue("Angle")){ // Must project lines to 2D so cannot use measurement framework this time //Relcalculate the measurement based on references stored. //WF: why not use projected geom in GeomObject and Vector2d.GetAngle? intersection pt & direction issues? //TODO: do we need to distinguish inner vs outer angle? -wf -// if(subElements.size() != 2) { -// throw Base::Exception("FVD - Two references required for angle measurement"); -// } if (getRefType() != twoEdge) { - throw Base::Exception("FVD - Two edge references required for angle measurement"); + Base::Console().Log("Error: DVD - %s - 2D references are corrupt\n",getNameInDocument()); + References2D.setValue(nullptr,""); + return result; } int idx0 = DrawUtil::getIndexFromName(subElements[0]); int idx1 = DrawUtil::getIndexFromName(subElements[1]); auto viewPart( dynamic_cast(objects[0]) ); if( viewPart == nullptr ) { - Base::Console().Message("INFO - DVD::getDimValue - References2D not DrawViewPart\n"); - return 0.0; + Base::Console().Log("INFO - DVD::getDimValue - References2D not DrawViewPart\n"); + return result; } TechDrawGeometry::BaseGeom* edge0 = viewPart->getProjEdgeByIndex(idx0); TechDrawGeometry::BaseGeom* edge1 = viewPart->getProjEdgeByIndex(idx1); - - // Only can find angles with straight line edges - if(edge0->geomType == TechDrawGeometry::GENERIC && - edge1->geomType == TechDrawGeometry::GENERIC) { - TechDrawGeometry::Generic *gen1 = static_cast(edge0); - TechDrawGeometry::Generic *gen2 = static_cast(edge1); - - Base::Vector3d p1S(gen1->points.at(0).x, gen1->points.at(0).y, 0.); - Base::Vector3d p1E(gen1->points.at(1).x, gen1->points.at(1).y, 0.); - - Base::Vector3d p2S(gen2->points.at(0).x, gen2->points.at(0).y, 0.); - Base::Vector3d p2E(gen2->points.at(1).x, gen2->points.at(1).y, 0.); - - Base::Vector3d dir1 = p1E - p1S; - Base::Vector3d dir2 = p2E - p2S; - - // Line Intersetion (taken from ViewProviderSketch.cpp) - double det = dir1.x*dir2.y - dir1.y*dir2.x; - if ((det > 0 ? det : -det) < 1e-10) - throw Base::Exception("Invalid selection - Det = 0"); - - double c1 = dir1.y*gen1->points.at(0).x - dir1.x*gen1->points.at(0).y; - double c2 = dir2.y*gen2->points.at(1).x - dir2.x*gen2->points.at(1).y; - double x = (dir1.x*c2 - dir2.x*c1)/det; - double y = (dir1.y*c2 - dir2.y*c1)/det; - - // Intersection point - Base::Vector3d p0 = Base::Vector3d(x,y,0); - - Base::Vector3d lPos((double) X.getValue(), (double) Y.getValue(), 0.); - //Base::Vector3d delta = lPos - p0; - - // Create vectors point towards intersection always - Base::Vector3d a = -p0, b = -p0; - a += ((p1S - p0).Length() < FLT_EPSILON) ? p1E : p1S; - b += ((p2S - p0).Length() < FLT_EPSILON) ? p2E : p2S; - - double angle2 = atan2( a.x*b.y - a.y*b.x, a.x*b.x + a.y*b.y ); - result = angle2 * 180. / M_PI; + TechDrawGeometry::Generic *gen1; + TechDrawGeometry::Generic *gen2; + if (edge0 && edge0->geomType == TechDrawGeometry::GeomType::GENERIC) { + gen1 = static_cast(edge0); } else { - throw Base::Exception("getDimValue() - Unknown Dimension Type (2)"); + Base::Console().Log("Error: DVD - %s - 2D references are corrupt\n",getNameInDocument()); + References2D.setValue(nullptr,""); + return result; } + if (edge1 && edge1->geomType == TechDrawGeometry::GeomType::GENERIC) { + gen2 = static_cast(edge1); + } else { + Base::Console().Log("Error: DVD - %s - 2D references are corrupt\n",getNameInDocument()); + References2D.setValue(nullptr,""); + return result; + } + + Base::Vector3d p1S(gen1->points.at(0).x, gen1->points.at(0).y, 0.); + Base::Vector3d p1E(gen1->points.at(1).x, gen1->points.at(1).y, 0.); + + Base::Vector3d p2S(gen2->points.at(0).x, gen2->points.at(0).y, 0.); + Base::Vector3d p2E(gen2->points.at(1).x, gen2->points.at(1).y, 0.); + + Base::Vector3d dir1 = p1E - p1S; + Base::Vector3d dir2 = p2E - p2S; + + // Line Intersetion (taken from ViewProviderSketch.cpp) + double det = dir1.x*dir2.y - dir1.y*dir2.x; + if ((det > 0 ? det : -det) < 1e-10) + throw Base::Exception("Invalid selection - Det = 0"); + + double c1 = dir1.y*gen1->points.at(0).x - dir1.x*gen1->points.at(0).y; + double c2 = dir2.y*gen2->points.at(1).x - dir2.x*gen2->points.at(1).y; + double x = (dir1.x*c2 - dir2.x*c1)/det; + double y = (dir1.y*c2 - dir2.y*c1)/det; + + // Intersection point + Base::Vector3d p0 = Base::Vector3d(x,y,0); + + Base::Vector3d lPos((double) X.getValue(), (double) Y.getValue(), 0.); + //Base::Vector3d delta = lPos - p0; + + // Create vectors point towards intersection always + Base::Vector3d a = -p0, b = -p0; + a += ((p1S - p0).Length() < FLT_EPSILON) ? p1E : p1S; + b += ((p2S - p0).Length() < FLT_EPSILON) ? p2E : p2S; + + double angle2 = atan2( a.x*b.y - a.y*b.x, a.x*b.x + a.y*b.y ); + result = angle2 * 180. / M_PI; + } else { + throw Base::Exception("getDimValue() - Unknown Dimension Type (2)"); } //endif Angle } //endif Projected return result; @@ -481,6 +540,33 @@ int DrawViewDimension::getRefType2(const std::string g1, const std::string g2) return refType; } +//! validate 2D references - only checks if they exist, not if they are the right type +bool DrawViewDimension::checkReferences2D() const +{ + bool result = true; + //const std::vector &objects = References2D.getValues(); + const std::vector &subElements = References2D.getSubValues(); + + for (auto& s: subElements) { + int idx = DrawUtil::getIndexFromName(s); + if (DrawUtil::getGeomTypeFromName(s) == "Edge") { + TechDrawGeometry::BaseGeom* geom = getViewPart()->getProjEdgeByIndex(idx); + if (geom == nullptr) { + result = false; + break; + } + } else if (DrawUtil::getGeomTypeFromName(s) == "Vertex") { + TechDrawGeometry::Vertex* v = getViewPart()->getProjVertexByIndex(idx); + if (v == nullptr) { + result = false; + break; + } + } + } + return result; +} + + //!add Dimension 3D references to measurement void DrawViewDimension::setAll3DMeasurement() { @@ -535,7 +621,7 @@ double DrawViewDimension::dist2Segs(Base::Vector2d s1, BRepExtrema_DistShapeShape extss(edge1, edge2); if (!extss.IsDone()) { - throw Base::Exception("FVD - BRepExtrema_DistShapeShape failed"); + throw Base::Exception("DVD - BRepExtrema_DistShapeShape failed"); } int count = extss.NbSolution(); double minDist = 0.0; @@ -548,7 +634,18 @@ double DrawViewDimension::dist2Segs(Base::Vector2d s1, bool DrawViewDimension::has2DReferences(void) const { - return (References2D.getSize() > 0); + bool result = false; + const std::vector &objects = References2D.getValues(); + const std::vector &SubNames = References2D.getSubValues(); + if (!objects.empty()) { + App::DocumentObject* testRef = objects.at(0); + if (testRef != nullptr) { + if (!SubNames.empty()) { + result = true; + } + } + } + return result; } bool DrawViewDimension::has3DReferences(void) const diff --git a/src/Mod/TechDraw/App/DrawViewDimension.h b/src/Mod/TechDraw/App/DrawViewDimension.h index 78420fa4ce..8330c09d9c 100644 --- a/src/Mod/TechDraw/App/DrawViewDimension.h +++ b/src/Mod/TechDraw/App/DrawViewDimension.h @@ -65,9 +65,6 @@ public: App::PropertyFloat LineWidth; //App::PropertyBool CentreLines; - //TODO: do we need a property for the actual dimension value? how else to access from Py? - //wf: expose getValue & getFormatedValue - short mustExecute() const; bool has2DReferences(void) const; bool has3DReferences(void) const; @@ -85,8 +82,8 @@ public: //return PyObject as DrawViewDimensionPy virtual PyObject *getPyObject(void); - virtual std::string getFormatedValue() const; - virtual double getDimValue() const; + virtual std::string getFormatedValue(); + virtual double getDimValue(); DrawViewPart* getViewPart() const; virtual QRectF getRect() const { return QRectF(0,0,1,1);} //pretend dimensions always fit! static int getRefType1(const std::string s); @@ -94,11 +91,11 @@ public: int getRefType() const; //Vertex-Vertex, Edge, Edge-Edge void setAll3DMeasurement(); void clear3DMeasurements(void); + bool checkReferences2D(void) const; protected: void onChanged(const App::Property* prop); virtual void onDocumentRestored(); - int getIndexFromName(std::string geomName) const; bool showUnits() const; protected: diff --git a/src/Mod/TechDraw/App/DrawViewPart.cpp b/src/Mod/TechDraw/App/DrawViewPart.cpp index ca58c4855a..a280f33d22 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.cpp +++ b/src/Mod/TechDraw/App/DrawViewPart.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -57,18 +58,23 @@ #include #include #include +#include +#include +#include + #include #include #include +#include #endif #include #include #include -#include #include +#include #include #include #include @@ -78,10 +84,12 @@ #include "DrawUtil.h" #include "DrawViewSection.h" +#include "DrawProjectSplit.h" #include "Geometry.h" #include "GeometryObject.h" #include "DrawViewPart.h" #include "DrawHatch.h" +#include "DrawGeomHatch.h" #include "EdgeWalker.h" @@ -103,6 +111,7 @@ DrawViewPart::DrawViewPart(void) : geometryObject(0) static const char *group = "Projection"; static const char *fgroup = "Format"; static const char *sgroup = "Show"; + nowDeleting = false; //properties that affect Geometry ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"3D Shape to view"); @@ -145,19 +154,17 @@ App::DocumentObjectExecReturn *DrawViewPart::execute(void) { App::DocumentObject *link = Source.getValue(); if (!link) { - return new App::DocumentObjectExecReturn("FVP - No Source object linked"); + return new App::DocumentObjectExecReturn("DVP - No Source object linked"); } if (!link->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) { - return new App::DocumentObjectExecReturn("FVP - Linked object is not a Part object"); + return new App::DocumentObjectExecReturn("DVP - Linked object is not a Part object"); } TopoDS_Shape shape = static_cast(link)->Shape.getShape().getShape(); if (shape.IsNull()) { - return new App::DocumentObjectExecReturn("FVP - Linked shape object is empty"); + return new App::DocumentObjectExecReturn("DVP - Linked shape object is empty"); } - //Base::Console().Message("TRACE - DVP::execute() - %s - %s - dir: %s\n",getNameInDocument(), Label.getValue(),DrawUtil::formatVector(Direction.getValue()).c_str()); - (void) DrawView::execute(); //make sure Scale is up to date @@ -223,7 +230,7 @@ void DrawViewPart::onChanged(const App::Property* prop) //note: slightly different than routine with same name in DrawProjectSplit TechDrawGeometry::GeometryObject* DrawViewPart::buildGeometryObject(TopoDS_Shape shape, gp_Ax2 viewAxis) { - TechDrawGeometry::GeometryObject* go = new TechDrawGeometry::GeometryObject(getNameInDocument()); + TechDrawGeometry::GeometryObject* go = new TechDrawGeometry::GeometryObject(getNameInDocument(), this); go->setIsoCount(IsoCount.getValue()); Base::Vector3d baseProjDir = Direction.getValue(); @@ -389,7 +396,6 @@ void DrawViewPart::extractFaces() } } - std::vector DrawViewPart::getHatches() const { std::vector result; @@ -403,6 +409,19 @@ std::vector DrawViewPart::getHatches() const return result; } +std::vector DrawViewPart::getGeomHatches() const +{ + std::vector result; + std::vector children = getInList(); + for (std::vector::iterator it = children.begin(); it != children.end(); ++it) { + if ((*it)->getTypeId().isDerivedFrom(DrawGeomHatch::getClassTypeId())) { + TechDraw::DrawGeomHatch* geom = dynamic_cast(*it); + result.push_back(geom); + } + } + return result; +} + const std::vector & DrawViewPart::getVertexGeometry() const { return geometryObject->getVertexGeometry(); @@ -426,7 +445,11 @@ TechDrawGeometry::BaseGeom* DrawViewPart::getProjEdgeByIndex(int idx) const Base::Console().Log("INFO - getProjEdgeByIndex(%d) - no Edge Geometry. Probably restoring?\n",idx); return NULL; } - return geoms[idx]; + if ((unsigned)idx >= geoms.size()) { + Base::Console().Log("INFO - getProjEdgeByIndex(%d) - invalid index\n",idx); + return NULL; + } + return geoms.at(idx); } //! returns existing geometry of 2D Vertex(idx) @@ -437,13 +460,20 @@ TechDrawGeometry::Vertex* DrawViewPart::getProjVertexByIndex(int idx) const Base::Console().Log("INFO - getProjVertexByIndex(%d) - no Vertex Geometry. Probably restoring?\n",idx); return NULL; } - return geoms[idx]; + if ((unsigned)idx >= geoms.size()) { + Base::Console().Log("INFO - getProjVertexByIndex(%d) - invalid index\n",idx); + return NULL; + } + return geoms.at(idx); } + +//this is never used!! //! returns existing geometry of 2D Face(idx) //version 1 Face has 1 wire -std::vector DrawViewPart::getProjFaceByIndex(int /*idx*/) const +std::vector DrawViewPart::getProjFaceByIndex(int idx) const { + (void) idx; std::vector result; const std::vector& faces = getFaceGeometry(); for (auto& f:faces) { @@ -456,6 +486,29 @@ std::vector DrawViewPart::getProjFaceByIndex(int /* return result; } +std::vector DrawViewPart::getWireForFace(int idx) const +{ +// Base::Console().Message("TRACE - DVP::getWireForFace(%d)\n",idx); + std::vector result; + std::vector edges; + const std::vector& faces = getFaceGeometry(); + TechDrawGeometry::Face * ourFace = faces.at(idx); + for (auto& w:ourFace->wires) { + edges.clear(); + int i = 0; + for (auto& g:w->geoms) { + edges.push_back(g->occEdge); +// DrawUtil::dumpEdge("DVP Face edge",i,g->occEdge); + i++; + } + TopoDS_Wire occwire = EdgeWalker::makeCleanWire(edges); +// BRepLib::BuildCurves3d(occwire); //probably don't need this + result.push_back(occwire); + } + +// Base::Console().Message("TRACE - DVP::getWireForFace(%d) returns %d wires\n",idx,result.size()); + return result; +} Base::BoundBox3d DrawViewPart::getBoundingBox() const { @@ -559,12 +612,24 @@ const std::vector DrawViewPart::getVisibleFaceEdg return geometryObject->getVisibleFaceEdges(SmoothVisible.getValue(),SeamVisible.getValue()); } +//is this really the projection plane?? +gp_Pln DrawViewPart::getProjPlane() const +{ + Base::Vector3d plnPnt(0.0,0.0,0.0); + Base::Vector3d plnNorm = Direction.getValue(); + gp_Ax2 viewAxis = getViewAxis(plnPnt,plnNorm,false); + gp_Ax3 viewAxis3(viewAxis); + + return gp_Pln(viewAxis3); +} + void DrawViewPart::getRunControl() { Base::Reference hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General"); - m_sectionEdges = hGrp->GetBool("ShowSectionEdges", 1l); + m_sectionEdges = hGrp->GetBool("ShowSectionEdges", 0l); m_handleFaces = hGrp->GetBool("HandleFaces", 1l); + //Base::Console().Message("TRACE - DVP::getRunControl - handleFaces: %d\n",m_handleFaces); } bool DrawViewPart::handleFaces(void) @@ -577,6 +642,25 @@ bool DrawViewPart::showSectionEdges(void) return m_sectionEdges; } +void DrawViewPart::unsetupObject() +{ + nowDeleting = true; + + // Remove the View's Hatches from document + App::Document* doc = getDocument(); + std::string docName = doc->getName(); + + std::vector hatches = getHatches(); + + std::vector::iterator it = hatches.begin(); + for (; it != hatches.end(); it++) { + std::string viewName = (*it)->getNameInDocument(); + Base::Interpreter().runStringArg("App.getDocument(\"%s\").removeObject(\"%s\")", + docName.c_str(), viewName.c_str()); + } +} + + PyObject *DrawViewPart::getPyObject(void) { if (PythonObject.is(Py::_None())) { diff --git a/src/Mod/TechDraw/App/DrawViewPart.h b/src/Mod/TechDraw/App/DrawViewPart.h index 9abc812479..12fef1c539 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.h +++ b/src/Mod/TechDraw/App/DrawViewPart.h @@ -37,9 +37,14 @@ #include #include "DrawView.h" -#include "DrawProjectSplit.h" class gp_Pnt; +class gp_Pln; +class gp_Ax2; +//class TopoDS_Edge; +//class TopoDS_Vertex; +//class TopoDS_Wire; +//class TopoDS_Shape; namespace TechDrawGeometry { @@ -51,6 +56,9 @@ class Face; namespace TechDraw { class DrawHatch; +class DrawGeomHatch; +class DrawProjectSplit; +class DrawViewSection; } namespace TechDraw @@ -91,6 +99,7 @@ public: std::vector getHatches(void) const; + std::vector getGeomHatches(void) const; //TODO: are there use-cases for Python access to TechDrawGeometry??? @@ -135,12 +144,19 @@ public: } //return PyObject as DrawViewPartPy virtual PyObject *getPyObject(void); + bool isDeleting(void) { return nowDeleting; } + + gp_Pln getProjPlane(void) const; + virtual std::vector getWireForFace(int idx) const; + protected: TechDrawGeometry::GeometryObject *geometryObject; Base::BoundBox3d bbox; void onChanged(const App::Property* prop); + virtual void unsetupObject(); + virtual TechDrawGeometry::GeometryObject* buildGeometryObject(TopoDS_Shape shape, gp_Ax2 viewAxis); void extractFaces(); @@ -156,6 +172,7 @@ protected: bool m_handleFaces; private: + bool nowDeleting; }; diff --git a/src/Mod/TechDraw/App/DrawViewSection.cpp b/src/Mod/TechDraw/App/DrawViewSection.cpp index 55dbd10ce0..d22753b1f4 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.cpp +++ b/src/Mod/TechDraw/App/DrawViewSection.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -63,20 +64,24 @@ # include #include +#include #include #include #include #include +#include #include #include #include "Geometry.h" #include "GeometryObject.h" +#include "HatchLine.h" #include "EdgeWalker.h" #include "DrawUtil.h" #include "DrawProjGroupItem.h" #include "DrawProjectSplit.h" +#include "DrawGeomHatch.h" #include "DrawViewSection.h" using namespace TechDraw; @@ -110,11 +115,17 @@ DrawViewSection::DrawViewSection() SectionDirection.setEnums(SectionDirEnums); ADD_PROPERTY_TYPE(SectionDirection,((long)0),sgroup, App::Prop_None, "Direction in Base View for this Section"); - ADD_PROPERTY_TYPE(ShowCutSurface ,(true),fgroup,App::Prop_None,"Shade the cut surface"); - ADD_PROPERTY_TYPE(CutSurfaceColor,(0.0,0.0,0.0),fgroup,App::Prop_None,"The color to shade the cut surface"); - ADD_PROPERTY_TYPE(HatchCutSurface ,(false),fgroup,App::Prop_None,"Hatch the cut surface"); - ADD_PROPERTY_TYPE(HatchPattern ,(""),fgroup,App::Prop_None,"The hatch pattern file for the cut surface"); - ADD_PROPERTY_TYPE(HatchColor,(0.0,0.0,0.0),fgroup,App::Prop_None,"The color of the hatch pattern"); + ADD_PROPERTY_TYPE(FileHatchPattern ,(""),fgroup,App::Prop_None,"The hatch pattern file for the cut surface"); + ADD_PROPERTY_TYPE(NameGeomPattern ,(""),fgroup,App::Prop_None,"The pattern name for geometric hatching"); + ADD_PROPERTY_TYPE(HatchScale,(1.0),fgroup,App::Prop_None,"Hatch pattern size adjustment"); + +// ADD_PROPERTY_TYPE(ShowCutSurface ,(true),fgroup,App::Prop_None,"Show/hide the cut surface"); +// ADD_PROPERTY_TYPE(CutSurfaceColor,(0.0,0.0,0.0),fgroup,App::Prop_None,"The color to shade the cut surface"); +// ADD_PROPERTY_TYPE(HatchCutSurface ,(false),fgroup,App::Prop_None,"Hatch the cut surface"); +// ADD_PROPERTY_TYPE(FileHatchPattern ,(""),fgroup,App::Prop_None,"The hatch pattern file for the cut surface"); +// ADD_PROPERTY_TYPE(NameGeomPattern ,(""),fgroup,App::Prop_None,"The pattern name for geometric hatching"); +// ADD_PROPERTY_TYPE(HatchColor,(0.0,0.0,0.0),fgroup,App::Prop_None,"The color of the hatch pattern"); + getParameters(); @@ -158,6 +169,23 @@ void DrawViewSection::onChanged(const App::Property* prop) } } } + if (prop == &FileHatchPattern || + prop == &NameGeomPattern ) { + if ((!FileHatchPattern.isEmpty()) && + (!NameGeomPattern.isEmpty())) { + std::vector specs = + DrawGeomHatch::getDecodedSpecsFromFile(FileHatchPattern.getValue(),NameGeomPattern.getValue()); + m_lineSets.clear(); + for (auto& hl: specs) { + //hl.dump("hl from section"); + LineSet ls; + ls.setHatchLine(hl); + m_lineSets.push_back(ls); + } + + } + } + DrawView::onChanged(prop); } @@ -248,10 +276,12 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void) inputCenter, Scale.getValue()); + sectionFaceWires.clear(); TopoDS_Compound newFaces; BRep_Builder builder; builder.MakeCompound(newFaces); TopExp_Explorer expl(mirroredSection, TopAbs_FACE); + int idb = 0; for (; expl.More(); expl.Next()) { const TopoDS_Face& face = TopoDS::Face(expl.Current()); TopoDS_Face pFace = projectFace(face, @@ -259,8 +289,9 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void) Direction.getValue()); if (!pFace.IsNull()) { builder.Add(newFaces,pFace); + sectionFaceWires.push_back(ShapeAnalysis::OuterWire(pFace)); } - + idb++; } sectionFaces = newFaces; } @@ -505,6 +536,25 @@ Base::Vector3d DrawViewSection::getSectionVector (const std::string sectionName) return adjResult; } +std::vector DrawViewSection::getDrawableLines(int i) +{ + std::vector result; + result = DrawGeomHatch::getDrawableLines(this,m_lineSets,i,HatchScale.getValue()); + return result; +} + +std::vector DrawViewSection::getWireForFace(int idx) const +{ + std::vector result; + result.push_back(sectionFaceWires.at(idx)); + return result; +} + +void DrawViewSection::unsetupObject() +{ + getBaseDVP()->touch(); +} + TechDraw::DrawViewPart* DrawViewSection::getBaseDVP() { TechDraw::DrawViewPart* baseDVP = nullptr; @@ -528,26 +578,20 @@ TechDraw::DrawProjGroupItem* DrawViewSection::getBaseDPGI() void DrawViewSection::getParameters() { Base::Reference hGrp = App::GetApplication().GetUserParameter() - .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors"); - App::Color cutColor = App::Color((uint32_t) hGrp->GetUnsigned("CutSurfaceColor", 0xC8C8C800)); - CutSurfaceColor.setValue(cutColor); - App::Color hatchColor = App::Color((uint32_t) hGrp->GetUnsigned("SectionHatchColor", 0x00000000)); - HatchColor.setValue(hatchColor); - - hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw"); std::string defaultDir = App::Application::getResourceDir() + "Mod/Drawing/patterns/"; std::string defaultFileName = defaultDir + "simple.svg"; - QString patternFileName = QString::fromStdString(hGrp->GetASCII("PatternFile",defaultFileName.c_str())); + QString patternFileName = QString::fromStdString(hGrp->GetASCII("FileHatch",defaultFileName.c_str())); if (patternFileName.isEmpty()) { patternFileName = QString::fromStdString(defaultFileName); } QFileInfo tfi(patternFileName); if (tfi.isReadable()) { - HatchPattern.setValue(patternFileName.toUtf8().constData()); + FileHatchPattern.setValue(patternFileName.toUtf8().constData()); } - + std::string patternName = hGrp->GetASCII("PatternName","Diamond"); + NameGeomPattern.setValue(patternName); } // Python Drawing feature --------------------------------------------------------- diff --git a/src/Mod/TechDraw/App/DrawViewSection.h b/src/Mod/TechDraw/App/DrawViewSection.h index 5096ef1d08..bbabec8297 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.h +++ b/src/Mod/TechDraw/App/DrawViewSection.h @@ -45,16 +45,16 @@ class Face; namespace TechDraw { class DrawProjGroupItem; +class DrawGeomHatch; +class HatchLine; +class LineSet; +class DashSet; - -/** Base class of all View Features in the drawing module - */ class TechDrawExport DrawViewSection : public DrawViewPart { PROPERTY_HEADER(Part::DrawViewSection); public: - /// Constructor DrawViewSection(void); virtual ~DrawViewSection(); @@ -62,23 +62,16 @@ public: App::PropertyVector SectionNormal; App::PropertyVector SectionOrigin; App::PropertyEnumeration SectionDirection; - App::PropertyBool ShowCutSurface; - App::PropertyColor CutSurfaceColor; - App::PropertyBool HatchCutSurface; - App::PropertyFile HatchPattern; - App::PropertyColor HatchColor; + App::PropertyFile FileHatchPattern; + App::PropertyString NameGeomPattern; + App::PropertyFloat HatchScale; App::PropertyString SectionSymbol; virtual short mustExecute() const; bool isReallyInBox (const Base::Vector3d v, const Base::BoundBox3d bb) const; - /** @name methods overide Feature */ - //@{ - /// recalculate the Feature + virtual App::DocumentObjectExecReturn *execute(void); virtual void onChanged(const App::Property* prop); - //@} - - /// returns the type name of the ViewProvider virtual const char* getViewProviderName(void) const { return "TechDrawGui::ViewProviderViewSection"; } @@ -88,11 +81,22 @@ public: Base::Vector3d getSectionVector (const std::string sectionName); TechDraw::DrawViewPart* getBaseDVP(); TechDraw::DrawProjGroupItem* getBaseDPGI(); + virtual void unsetupObject(); + + virtual std::vector getWireForFace(int idx) const; + TopoDS_Compound getSectionFaces() { return sectionFaces;}; + std::vector getSectionFaceWires(void) { return sectionFaceWires; } + + std::vector getDrawableLines(int i = 0); + std::vector getDecodedSpecsFromFile(std::string fileSpec, std::string myPattern); static const char* SectionDirEnums[]; protected: TopoDS_Compound sectionFaces; + std::vector sectionFaceWires; + std::vector m_lineSets; + gp_Pln getSectionPlane() const; TopoDS_Compound findSectionPlaneIntersections(const TopoDS_Shape& shape); diff --git a/src/Mod/TechDraw/App/DrawViewSymbol.cpp b/src/Mod/TechDraw/App/DrawViewSymbol.cpp index afec6bc3fc..2a63f39bd8 100644 --- a/src/Mod/TechDraw/App/DrawViewSymbol.cpp +++ b/src/Mod/TechDraw/App/DrawViewSymbol.cpp @@ -35,6 +35,7 @@ #include #include +#include "DrawPage.h" #include "DrawViewSymbol.h" using namespace TechDraw; @@ -117,29 +118,43 @@ App::DocumentObjectExecReturn *DrawViewSymbol::execute(void) QRectF DrawViewSymbol::getRect() const { - std::string svg = Symbol.getValue(); double w = 64.0; //must default to something double h = 64.0; - string::const_iterator begin, end; - begin = svg.begin(); - end = svg.end(); - boost::match_results what; + return (QRectF(0,0,w,h)); +// std::string svg = Symbol.getValue(); +// string::const_iterator begin, end; +// begin = svg.begin(); +// end = svg.end(); +// boost::match_results what; - boost::regex e1 ("width=\"([0-9.]*?)[a-zA-Z]*?\""); - if (boost::regex_search(begin, end, what, e1)) { - //std::string wText = what[0].str(); //this is the whole match 'width="100"' - std::string wNum = what[1].str(); //this is just the number 100 - w = std::stod(wNum); - } - boost::regex e2 ("Height=\"([0-9.]*?)[a-zA-Z]*?\""); - if (boost::regex_search(begin, end, what, e1)) { - //std::string hText = what[0].str(); - std::string hNum = what[1].str(); - h = std::stod(hNum); - } - return (QRectF(0,0,Scale.getValue() * w,Scale.getValue() * h)); +// boost::regex e1 ("width=\"([0-9.]*?)[a-zA-Z]*?\""); +// if (boost::regex_search(begin, end, what, e1)) { +// //std::string wText = what[0].str(); //this is the whole match 'width="100"' +// std::string wNum = what[1].str(); //this is just the number 100 +// w = std::stod(wNum); +// } +// +// boost::regex e2 ("height=\"([0-9.]*?)[a-zA-Z]*?\""); +// if (boost::regex_search(begin, end, what, e2)) { +// //std::string hText = what[0].str(); +// std::string hNum = what[1].str(); +// h = std::stod(hNum); +// } +// return (QRectF(0,0,Scale.getValue() * w,Scale.getValue() * h)); +//we now have a w x h, but we don't really know what it means - px,mm,in,... + } +//!Assume all svg files fit the page and/or the user will scale manually +//see getRect() above +bool DrawViewSymbol::checkFit(TechDraw::DrawPage* p) const +{ + (void)p; + bool result = true; + return result; +} + + // Python Drawing feature --------------------------------------------------------- diff --git a/src/Mod/TechDraw/App/DrawViewSymbol.h b/src/Mod/TechDraw/App/DrawViewSymbol.h index 665b42fcb3..da7e049c23 100644 --- a/src/Mod/TechDraw/App/DrawViewSymbol.h +++ b/src/Mod/TechDraw/App/DrawViewSymbol.h @@ -32,6 +32,7 @@ namespace TechDraw { +class DrawPage; class TechDrawExport DrawViewSymbol : public TechDraw::DrawView @@ -57,6 +58,8 @@ public: return "TechDrawGui::ViewProviderSymbol"; } virtual QRectF getRect() const; + virtual bool checkFit(TechDraw::DrawPage* p) const override; + protected: virtual void onChanged(const App::Property* prop); diff --git a/src/Mod/TechDraw/App/EdgeWalker.cpp b/src/Mod/TechDraw/App/EdgeWalker.cpp index 1507f419c8..bd6c3b6e98 100644 --- a/src/Mod/TechDraw/App/EdgeWalker.cpp +++ b/src/Mod/TechDraw/App/EdgeWalker.cpp @@ -265,7 +265,7 @@ std::vector EdgeWalker::getResultNoDups() return fw; } - +//* static *// //! make a clean wire with sorted, oriented, connected, etc edges TopoDS_Wire EdgeWalker::makeCleanWire(std::vector edges, double tol) { diff --git a/src/Mod/TechDraw/App/EdgeWalker.h b/src/Mod/TechDraw/App/EdgeWalker.h index 2eeb493336..6556e3d78d 100644 --- a/src/Mod/TechDraw/App/EdgeWalker.h +++ b/src/Mod/TechDraw/App/EdgeWalker.h @@ -175,7 +175,7 @@ public: int findUniqueVert(TopoDS_Vertex vx, std::vector &uniqueVert); std::vector sortStrip(std::vector fw, bool includeBiggest); std::vector sortWiresBySize(std::vector& w, bool reverse = false); - TopoDS_Wire makeCleanWire(std::vector edges, double tol = 0.10); + static TopoDS_Wire makeCleanWire(std::vector edges, double tol = 0.10); std::vector getEmbeddingRowIx(int v); std::vector getEmbeddingRow(int v); diff --git a/src/Mod/TechDraw/App/GeometryObject.cpp b/src/Mod/TechDraw/App/GeometryObject.cpp index e630d805df..42ee5619ed 100644 --- a/src/Mod/TechDraw/App/GeometryObject.cpp +++ b/src/Mod/TechDraw/App/GeometryObject.cpp @@ -67,6 +67,7 @@ #include "DrawUtil.h" #include "GeometryObject.h" #include "DrawViewPart.h" +#include "DrawViewDetail.h" using namespace TechDrawGeometry; using namespace TechDraw; @@ -77,9 +78,9 @@ struct EdgePoints { TopoDS_Edge edge; }; -GeometryObject::GeometryObject(const string& parent) : - Scale(1.f), +GeometryObject::GeometryObject(const string& parent, TechDraw::DrawView* parentObj) : m_parentName(parent), + m_parent(parentObj), m_isoCount(0) { } @@ -89,12 +90,6 @@ GeometryObject::~GeometryObject() clear(); } -void GeometryObject::setScale(double value) -{ - Scale = value; -} - - const std::vector GeometryObject::getVisibleFaceEdges(const bool smooth, const bool seam) const { std::vector result; @@ -157,17 +152,6 @@ void GeometryObject::projectShape(const TopoDS_Shape& input, // Clear previous Geometry clear(); -//******* - gp_Dir x = viewAxis.XDirection(); - gp_Dir y = viewAxis.YDirection(); - gp_Dir z = viewAxis.Direction(); - Base::Vector3d vx(x.X(),x.Y(),x.Z()); - Base::Vector3d vy(y.X(),y.Y(),y.Z()); - Base::Vector3d vz(z.X(),z.Y(),z.Z()); -// Base::Console().Message("TRACE - GO::projectShape - %s viewAxis x: %s y: %s Z: %s\n",m_parentName.c_str(), -// DrawUtil::formatVector(vx).c_str(), DrawUtil::formatVector(vy).c_str(), DrawUtil::formatVector(vz).c_str()); -//******* - auto start = chrono::high_resolution_clock::now(); Handle_HLRBRep_Algo brep_hlr = NULL; @@ -177,7 +161,8 @@ void GeometryObject::projectShape(const TopoDS_Shape& input, HLRAlgo_Projector projector( viewAxis ); brep_hlr->Projector(projector); brep_hlr->Update(); - brep_hlr->Hide(); + brep_hlr->Hide(); //XXXX: what happens if we don't call Hide()?? and only look at VCompound? + // WF: you get back all the edges in the shape, but very fast!! } catch (...) { Standard_Failure::Raise("GeometryObject::projectShape - error occurred while projecting shape"); @@ -301,6 +286,7 @@ void GeometryObject::addGeomFromCompound(TopoDS_Shape edgeCompound, edgeClass ca edgeGeom.push_back(base); //add vertices of new edge if not already in list + bool skipDetail = false; if (visible) { BaseGeom* lastAdded = edgeGeom.back(); bool v1Add = true, v2Add = true; @@ -310,9 +296,23 @@ void GeometryObject::addGeomFromCompound(TopoDS_Shape edgeCompound, edgeClass ca TechDrawGeometry::Circle* circle = dynamic_cast(lastAdded); TechDrawGeometry::Vertex* c1 = nullptr; if (circle) { - c1 = new TechDrawGeometry::Vertex(circle->center); - c1->isCenter = true; - c1->visible = true; + // if this is the center of a detail view, skip it + TechDraw::DrawViewDetail* detail = isParentDetail(); + if (detail != nullptr) { + double scale = m_parent->Scale.getValue(); + if ( ((circle->center - Base::Vector2d(0.0,0.0)).Length() < Precision::Confusion()) && + (DrawUtil::fpCompare(circle->radius, scale * detail->getFudgeRadius())) ) { + skipDetail = true; + } else { + c1 = new TechDrawGeometry::Vertex(circle->center); + c1->isCenter = true; + c1->visible = true; + } + } else { + c1 = new TechDrawGeometry::Vertex(circle->center); + c1->isCenter = true; + c1->visible = true; + } } std::vector::iterator itVertex = vertexGeom.begin(); @@ -323,7 +323,7 @@ void GeometryObject::addGeomFromCompound(TopoDS_Shape edgeCompound, edgeClass ca if ((*itVertex)->isEqual(v2,Precision::Confusion())) { v2Add = false; } - if (circle) { + if (circle && !skipDetail) { if ((*itVertex)->isEqual(c1,Precision::Confusion())) { c1Add = false; } @@ -343,7 +343,7 @@ void GeometryObject::addGeomFromCompound(TopoDS_Shape edgeCompound, edgeClass ca delete v2; } - if (circle) { + if (circle && !skipDetail) { if (c1Add) { vertexGeom.push_back(c1); c1->visible = true; @@ -367,6 +367,18 @@ void GeometryObject::addFaceGeom(Face* f) faceGeom.push_back(f); } +TechDraw::DrawViewDetail* GeometryObject::isParentDetail() +{ + TechDraw::DrawViewDetail* result = nullptr; + if (m_parent != nullptr) { + TechDraw::DrawViewDetail* detail = dynamic_cast(m_parent); + if (detail != nullptr) { + result = detail; + } + } + return result; +} + bool GeometryObject::isWithinArc(double theta, double first, double last, bool cw) const @@ -439,16 +451,6 @@ bool GeometryObject::findVertex(Base::Vector2d v) return found; } - -//"Top" X should == "Front" X for front = [front,rear] -//"Top" X should == "Front" X for front = [right] -//"Top" X should == "Front" -X for front = [left] -//"Top" X should == "Front" X for front = [top,bottom] -//view XAxis == anchor XAxis except -// anchor.ProjDir = (-1,0,0) then -// view XAxis == -Anchor XAxis - - /// utility non-class member functions //! gets a coordinate system that matches view system used in 3D with +Z up (or +Y up if neccessary) //! used for individual views, but not secondary views in projection groups @@ -464,9 +466,9 @@ gp_Ax2 TechDrawGeometry::getViewAxis(const Base::Vector3d origin, } Base::Vector3d cross = flipDirection; //special cases - if (flipDirection == stdZ) { + if ((flipDirection - stdZ).Length() < Precision::Confusion()) { cross = Base::Vector3d(1.0,0.0,0.0); - } else if (flipDirection == (stdZ * -1.0)) { + } else if ((flipDirection - (stdZ * -1.0)).Length() < Precision::Confusion()) { cross = Base::Vector3d(1.0,0.0,0.0); } else { cross.Normalize(); diff --git a/src/Mod/TechDraw/App/GeometryObject.h b/src/Mod/TechDraw/App/GeometryObject.h index 36d58c1475..5461a4de16 100644 --- a/src/Mod/TechDraw/App/GeometryObject.h +++ b/src/Mod/TechDraw/App/GeometryObject.h @@ -34,14 +34,20 @@ #include "Geometry.h" + namespace TechDraw { class DrawViewPart; +class DrawViewDetail; class DrawView; } namespace TechDrawGeometry { +class BaseGeom; +class Vector; +class Face; +class Vertex; //! scales & mirrors a shape about a center TopoDS_Shape TechDrawExport mirrorShape(const TopoDS_Shape &input, @@ -66,13 +72,11 @@ class TechDrawExport GeometryObject { public: /// Constructor - GeometryObject(const std::string& parent); + GeometryObject(const std::string& parent, TechDraw::DrawView* parentObj); virtual ~GeometryObject(); void clear(); - void setScale(double value); - //! Returns 2D bounding box Base::BoundBox3d calcBoundingBox() const; @@ -104,7 +108,7 @@ protected: TopoDS_Shape hidIso; void addGeomFromCompound(TopoDS_Shape edgeCompound, edgeClass category, bool visible); - + TechDraw::DrawViewDetail* isParentDetail(void); //similar function in Geometry? /*! @@ -120,9 +124,8 @@ protected: bool findVertex(Base::Vector2d v); - double Scale; - std::string m_parentName; + TechDraw::DrawView* m_parent; int m_isoCount; }; diff --git a/src/Mod/TechDraw/App/HatchLine.cpp b/src/Mod/TechDraw/App/HatchLine.cpp new file mode 100644 index 0000000000..3f36c9b2ae --- /dev/null +++ b/src/Mod/TechDraw/App/HatchLine.cpp @@ -0,0 +1,242 @@ +/*************************************************************************** + * Copyright (c) 2017 Wandererfan * + * * + * 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" + +#ifndef _PreComp_ +#include +#include +#include +#include +#include +#endif + +#include + +#include +#include + +#include "Geometry.h" + +#include "DrawUtil.h" +#include "HatchLine.h" + +using namespace TechDraw; + +HatchLine::HatchLine() +{ + init(); +} + +HatchLine::HatchLine(std::string& lineSpec) +{ + init(); + load(lineSpec); +} + + +HatchLine::~HatchLine() +{ +} + +void HatchLine::init(void) +{ + m_angle = 0.0; + m_origin = Base::Vector3d(0.0,0.0,0.0); + m_interval = 1.0; + m_offset = 0.0; +} + +void HatchLine::load(std::string& lineSpec) +{ + std::vector values = split(lineSpec); + if (values.size() < 5) { + Base::Console().Message( "HatchLine::load(%s) invalid entry in pattern\n",lineSpec.c_str() ); + return; + } + m_angle = values[0]; + m_origin = Base::Vector3d(values[1],values[2],0.0); + m_offset = values[3]; + m_interval = values[4]; + if (values.size() > 5) { + m_dashParms.insert(std::end(m_dashParms), std::begin(values) + 5, std::end(values)); + } +} + +std::vector HatchLine::split(std::string line) +{ + std::vector result; + std::stringstream lineStream(line); + std::string cell; + + while(std::getline(lineStream,cell, ',')) + { + try { + result.push_back(std::stod(cell)); + } + catch (const std::invalid_argument& ia) { + Base::Console().Warning("Invalid number in cell: %s (%s) \n",cell.c_str(),ia.what()); + result.push_back(0.0); + } + } + return result; +} + +void HatchLine::dump(char* title) +{ + Base::Console().Message( "DUMP: %s\n",title); + Base::Console().Message( "Angle: %.3f\n", m_angle); + Base::Console().Message( "Origin: %s\n",DrawUtil::formatVector(m_origin).c_str()); + Base::Console().Message( "Offset: %.3f\n",m_offset); + Base::Console().Message( "Interval: %.3f\n",m_interval); + std::stringstream ss; + for (auto& d: m_dashParms) { + ss << d << ", "; + } + ss << "end"; + Base::Console().Message( "DashSpec: %s\n",ss.str().c_str()); +} + +//static class methods +std::vector HatchLine::getSpecsForPattern(std::string& parmFile, std::string& parmName) +{ + std::vector result; + std::vector lineSpecs; + std::ifstream inFile; + inFile.open (parmFile, std::ifstream::in); + if(!inFile.is_open()) { + Base::Console().Message( "Cannot open input file.\n"); + return result; + } + + //get all the definition lines for this pattern + bool status = findPatternStart(inFile, parmName); + if (status) { + lineSpecs = loadPatternDef(inFile); + } else { + Base::Console().Message( "Could not find pattern: %s\n",parmName.c_str() ); + return result; + } + + //decode definition lines into HatchLine objects + for (auto& l: lineSpecs) { + HatchLine hl(l); + result.push_back(hl); + } + return result; +} + +bool HatchLine::findPatternStart(std::ifstream& inFile, std::string& parmName) +{ + bool result = false; + while ( inFile.good() ){ + std::string line; + std::getline(inFile,line); + std::string nameTag = line.substr(0,1); + std::string patternName; + unsigned long int commaPos; + if ((nameTag == ";") || + (nameTag == " ") || + (line.empty()) ) { //is cr/lf empty? + continue; + } else if (nameTag == "*") { + commaPos = line.find(",",1); + if (commaPos != std::string::npos) { + patternName = line.substr(1,commaPos-1); + } else { + patternName = line.substr(1); + } + if (patternName == parmName) { + //this is our pattern + result = true; + break; + } + } + } //endwhile + return result; +} + +//get the definition lines for this pattern +std::vector HatchLine::loadPatternDef(std::ifstream& inFile) +{ + std::vector result; + while ( inFile.good() ){ + std::string line; + std::getline(inFile,line); + std::string nameTag = line.substr(0,1); + if ((nameTag == ";") || + (nameTag == " ") || + (line.empty()) ) { //is cr/lf empty? + continue; + } else if (nameTag == "*") { + break; + } else { //dataline + result.push_back(line); + } + } + return result; +} + +std::vector HatchLine::getPatternList(std::string& parmFile) +{ + std::vector result; + std::ifstream inFile; + inFile.open (parmFile, std::ifstream::in); + if(!inFile.is_open()) { + Base::Console().Message( "Cannot open input file.\n"); + return result; + } + + while ( inFile.good() ){ + std::string line; + std::getline(inFile,line); + std::string nameTag = line.substr(0,1); //dupl code here + unsigned long int commaPos; + if (nameTag == "*") { //found a pattern + commaPos = line.find(",",1); + std::string patternName; + if (commaPos != std::string::npos) { + patternName = line.substr(1,commaPos-1); + } else { + patternName = line.substr(1); + } + result.push_back(patternName); + } + } + return result; +} + +//******************************************************** +void DashSpec::dump(char* title) +{ + std::stringstream ss; + ss << title << ": " ; + for (auto& p: m_parms) { + ss << p << ", "; + } + Base::Console().Message("DUMP - DashSpec - %s\n",ss.str().c_str()); +} + + + + + diff --git a/src/Mod/TechDraw/App/HatchLine.h b/src/Mod/TechDraw/App/HatchLine.h new file mode 100644 index 0000000000..3860353467 --- /dev/null +++ b/src/Mod/TechDraw/App/HatchLine.h @@ -0,0 +1,124 @@ +/*************************************************************************** + * Copyright (c) 2017 Wandererfan * + * * + * 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 * + * * + ***************************************************************************/ + +#ifndef _TechDraw_HATCHLINE_H_ +#define _TechDraw_HATCHLINE_H_ + +#include +#include +#include +#include +#include + +#include + +class TopoDS_Edge; + +namespace TechDrawGeometry +{ +class BaseGeom; +} + +namespace TechDraw +{ +class DrawViewPart; +class DrawUtil; + + +// HatchLine is the result of parsing a line from PAT file into accessible parameters +// e /HatchLine/PATSpecLine/ +class TechDrawExport HatchLine +{ +public: + HatchLine(); + HatchLine(std::string& lineSpec); + ~HatchLine(); + + void load(std::string& lineSpec); + + double getAngle(void) {return m_angle;} + Base::Vector3d getOrigin(void) {return m_origin;} + double getInterval(void) {return m_interval;} + double getOffset(void) {return m_offset;} + std::vector getDashParms(void) {return m_dashParms;} + + static std::vector getSpecsForPattern(std::string& parmFile, std::string& parmName); + static bool findPatternStart(std::ifstream& inFile, std::string& parmName); + static std::vector loadPatternDef(std::ifstream& inFile); + static std::vector getPatternList(std::string& parmFile); + + void dump(char* title); + +private: + void init(void); + std::vector split(std::string line); + //PAT line extracted tokens + double m_angle; + Base::Vector3d m_origin; + double m_interval; + double m_offset; + std::vector m_dashParms; //why isn't this a DashSpec object? +}; + +// a LineSet is all the generated edges for 1 HatchLine for 1 Face +class TechDrawExport LineSet +{ +public: + LineSet() {} + ~LineSet() {} + + void setHatchLine(HatchLine s) { m_hatchLine = s; } + void setEdges(std::vector e) {m_edges = e;} + void setGeoms(std::vector g) {m_geoms = g;} + + HatchLine getHatchLine(void) { return m_hatchLine; } + std::vector getDashSpec(void) { return m_hatchLine.getDashParms();} + std::vector getEdges(void) { return m_edges; } + std::vector getGeoms(void) { return m_geoms; } + //void clearGeom(void); + +private: + std::vector m_edges; + std::vector m_geoms; + HatchLine m_hatchLine; +}; + +class TechDrawExport DashSpec +{ +public: + DashSpec() {} + DashSpec(std::vector p) { m_parms = p; } + ~DashSpec() {} + + double get(int i) {return m_parms.at(i); } + std::vector get(void) {return m_parms;} + bool empty(void) {return m_parms.empty();} + int size(void) {return m_parms.size();} + void dump(char* title); + +private: + std::vector m_parms; +}; + +} //end namespace + +#endif diff --git a/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp b/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp index 8030942013..1388e4fe72 100644 --- a/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp +++ b/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp @@ -48,6 +48,7 @@ #include "ViewProviderSymbol.h" #include "ViewProviderViewClip.h" #include "ViewProviderHatch.h" +#include "ViewProviderGeomHatch.h" #include "ViewProviderSpreadsheet.h" #include "ViewProviderImage.h" @@ -102,6 +103,7 @@ void TechDrawGuiExport initTechDrawGui() TechDrawGui::ViewProviderDraft::init(); TechDrawGui::ViewProviderArch::init(); TechDrawGui::ViewProviderHatch::init(); + TechDrawGui::ViewProviderGeomHatch::init(); TechDrawGui::ViewProviderSpreadsheet::init(); TechDrawGui::ViewProviderImage::init(); diff --git a/src/Mod/TechDraw/Gui/CMakeLists.txt b/src/Mod/TechDraw/Gui/CMakeLists.txt index a0221bc8b5..7ce4ee9cf8 100644 --- a/src/Mod/TechDraw/Gui/CMakeLists.txt +++ b/src/Mod/TechDraw/Gui/CMakeLists.txt @@ -36,6 +36,7 @@ set(TechDrawGui_MOC_HDRS TaskLinkDim.h DlgTemplateField.h TaskSectionView.h + TaskGeomHatch.h ) fc_wrap_cpp(TechDrawGui_MOC_SRCS ${TechDrawGui_MOC_HDRS}) @@ -54,6 +55,7 @@ set(TechDrawGui_UIC_SRCS TaskLinkDim.ui DlgTemplateField.ui TaskSectionView.ui + TaskGeomHatch.ui ) if(BUILD_QT5) @@ -92,8 +94,13 @@ SET(TechDrawGui_SRCS TaskSectionView.ui TaskSectionView.cpp TaskSectionView.h + TaskGeomHatch.ui + TaskGeomHatch.cpp + TaskGeomHatch.h DrawGuiUtil.cpp DrawGuiUtil.h + Rez.cpp + Rez.h ) SET(TechDrawGuiView_SRCS MDIViewPage.cpp @@ -197,6 +204,8 @@ SET(TechDrawGuiViewProvider_SRCS ViewProviderViewClip.h ViewProviderHatch.cpp ViewProviderHatch.h + ViewProviderGeomHatch.cpp + ViewProviderGeomHatch.h ViewProviderImage.cpp ViewProviderImage.h ) @@ -209,6 +218,7 @@ SET(TechDrawGuiTaskDlgs_SRCS TaskProjGroup.ui TaskLinkDim.ui TaskSectionView.ui + TaskGeomHatch.ui ) SOURCE_GROUP("TaskDialogs" FILES ${TechDrawGuiTaskDlgs_SRCS}) diff --git a/src/Mod/TechDraw/Gui/Command.cpp b/src/Mod/TechDraw/Gui/Command.cpp index e970bcd9da..8b6df3dffe 100644 --- a/src/Mod/TechDraw/Gui/Command.cpp +++ b/src/Mod/TechDraw/Gui/Command.cpp @@ -350,9 +350,12 @@ void CmdTechDrawNewViewSection::activated(int iMsg) std::string FeatName = getUniqueObjectName("Section"); std::string SourceName = dvp->Source.getValue()->getNameInDocument(); + std::string BaseName = (dObj)->getNameInDocument(); doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawViewSection','%s')",FeatName.c_str()); doCommand(Doc,"App.activeDocument().%s.Source = App.activeDocument().%s",FeatName.c_str(),SourceName.c_str()); - doCommand(Doc,"App.activeDocument().%s.BaseView = App.activeDocument().%s",FeatName.c_str(),(dObj)->getNameInDocument()); + doCommand(Doc,"App.activeDocument().%s.BaseView = App.activeDocument().%s",FeatName.c_str(),BaseName.c_str()); + doCommand(Doc,"App.activeDocument().%s.Scale = App.activeDocument().%s.Scale",FeatName.c_str(),BaseName.c_str()); + doCommand(Doc,"App.activeDocument().%s.ScaleType = App.activeDocument().%s.ScaleType",FeatName.c_str(),BaseName.c_str()); doCommand(Doc,"App.activeDocument().%s.addView(App.activeDocument().%s)",PageName.c_str(),FeatName.c_str()); App::DocumentObject *docObj = getDocument()->getObject(FeatName.c_str()); TechDraw::DrawViewSection* dsv = dynamic_cast(docObj); @@ -453,7 +456,7 @@ CmdTechDrawProjGroup::CmdTechDrawProjGroup() sAppModule = "TechDraw"; sGroup = QT_TR_NOOP("TechDraw"); sMenuText = QT_TR_NOOP("Insert Projection Group"); - sToolTipText = QT_TR_NOOP("Insert 2D Projections of a 3D part into the active drawing"); + sToolTipText = QT_TR_NOOP("Insert multiple views of a single part into the active drawing"); sWhatsThis = "TechDraw_ProjGroup"; sStatusTip = sToolTipText; sPixmap = "actions/techdraw-projgroup"; @@ -478,7 +481,7 @@ void CmdTechDrawProjGroup::activated(int iMsg) Gui::WaitCursor wc; openCommand("Create Projection Group"); - std::string multiViewName = getUniqueObjectName("cView"); + std::string multiViewName = getUniqueObjectName("ProjGroup"); std::string SourceName = (*shapes.begin())->getNameInDocument(); doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawProjGroup','%s')",multiViewName.c_str()); doCommand(Doc,"App.activeDocument().%s.addView(App.activeDocument().%s)",PageName.c_str(),multiViewName.c_str()); diff --git a/src/Mod/TechDraw/Gui/CommandDecorate.cpp b/src/Mod/TechDraw/Gui/CommandDecorate.cpp index 322499d156..2b38bdc87e 100644 --- a/src/Mod/TechDraw/Gui/CommandDecorate.cpp +++ b/src/Mod/TechDraw/Gui/CommandDecorate.cpp @@ -49,12 +49,15 @@ #include #include #include +#include #include #include #include #include "DrawGuiUtil.h" #include "MDIViewPage.h" +#include "TaskGeomHatch.h" +#include "ViewProviderGeomHatch.h" #include "ViewProviderPage.h" using namespace TechDrawGui; @@ -75,8 +78,8 @@ CmdTechDrawNewHatch::CmdTechDrawNewHatch() { sAppModule = "TechDraw"; sGroup = QT_TR_NOOP("TechDraw"); - sMenuText = QT_TR_NOOP("Insert a hatched area into a view"); - sToolTipText = QT_TR_NOOP("Insert a hatched area into a view"); + sMenuText = QT_TR_NOOP("Hatch a Face using image file"); + sToolTipText = QT_TR_NOOP("Hatch a Face using image file"); sWhatsThis = "TechDraw_NewHatch"; sStatusTip = sToolTipText; sPixmap = "actions/techdraw-hatch"; @@ -126,6 +129,73 @@ bool CmdTechDrawNewHatch::isActive(void) return (havePage && haveView); } +//=========================================================================== +// TechDraw_NewGeomHatch +//=========================================================================== + +DEF_STD_CMD_A(CmdTechDrawNewGeomHatch); + +CmdTechDrawNewGeomHatch::CmdTechDrawNewGeomHatch() + : Command("TechDraw_NewGeomHatch") +{ + sAppModule = "TechDraw"; + sGroup = QT_TR_NOOP("TechDraw"); + sMenuText = QT_TR_NOOP("Apply geometric hatch to a Face"); + sToolTipText = QT_TR_NOOP("Apply geometric hatch to a Face"); + sWhatsThis = "TechDraw_NewGeomHatch"; + sStatusTip = sToolTipText; + sPixmap = "actions/techdraw-geomhatch"; +} + +void CmdTechDrawNewGeomHatch::activated(int iMsg) +{ + Q_UNUSED(iMsg); + if (!_checkSelectionHatch(this)) { //same requirements as hatch - page, DrawViewXXX, face + return; + } + + std::vector selection = getSelection().getSelectionEx(); + auto objFeat( dynamic_cast(selection[0].getObject()) ); + if( objFeat == nullptr ) { + return; + } + const std::vector &subNames = selection[0].getSubNames(); + TechDraw::DrawPage* page = objFeat->findParentPage(); + std::string PageName = page->getNameInDocument(); + + std::string FeatName = getUniqueObjectName("GeomHatch"); + std::stringstream featLabel; + featLabel << FeatName << "FX" << TechDraw::DrawUtil::getIndexFromName(subNames.at(0)); + + openCommand("Create GeomHatch"); + doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawGeomHatch','%s')",FeatName.c_str()); + doCommand(Doc,"App.activeDocument().%s.Label = '%s'",FeatName.c_str(),featLabel.str().c_str()); + + auto geomhatch( static_cast(getDocument()->getObject(FeatName.c_str())) ); + geomhatch->Source.setValue(objFeat, subNames); + Gui::ViewProvider* vp = Gui::Application::Instance->getDocument(getDocument())->getViewProvider(geomhatch); + TechDrawGui::ViewProviderGeomHatch* hvp = dynamic_cast(vp); +// if (!hvp) { + + // dialog to fill in hatch values + Gui::Control().showDialog(new TaskDlgGeomHatch(geomhatch,hvp)); + + + commitCommand(); + + //Horrible hack to force Tree update ??still required?? + double x = objFeat->X.getValue(); + objFeat->X.setValue(x); + getDocument()->recompute(); +} + +bool CmdTechDrawNewGeomHatch::isActive(void) +{ + bool havePage = DrawGuiUtil::needPage(this); + bool haveView = DrawGuiUtil::needView(this); + return (havePage && haveView); +} + //=========================================================================== // TechDraw_Image //=========================================================================== @@ -230,6 +300,7 @@ void CreateTechDrawCommandsDecorate(void) Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager(); rcCmdMgr.addCommand(new CmdTechDrawNewHatch()); + rcCmdMgr.addCommand(new CmdTechDrawNewGeomHatch()); rcCmdMgr.addCommand(new CmdTechDrawImage()); rcCmdMgr.addCommand(new CmdTechDrawToggleFrame()); } diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw.ui index d026baeb1a..f270f9b239 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw.ui @@ -7,525 +7,640 @@ 0 0 558 - 610 + 648 TechDraw 1 - - - - 10 - 450 - 531 - 151 - - - - Files - - - - - 20 - 30 - 491 - 118 - - - - - - - Template Directory - - - - - - - Default Template - - - - - - - Gui::FileChooser::Directory - - - TemplateDir - - - /Mod/TechDraw/Files - - - - - - - Default Pattern File - - - - - - - TemplateFile - - - /Mod/TechDraw/Files - - - - - - - PatternFile - - - /Mod/TechDraw/Files - - - - - - - - - - 10 - 330 - 541 - 121 - - - - - 0 - 0 - - - - Labels - - - - - 20 - 30 - 491 - 71 - - - - - - - 0.100000000000000 - - - LabelSize - - - /Mod/TechDraw/Labels - - - - - - - Label Font - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - osifont - - - LabelFont - - - Mod/TechDraw/Labels - - - - - - - Label Size - - - - - - - - - - 10 - 10 - 521 - 141 - - - - General - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Projection Angle + + + + + General + + + + + + QFormLayout::AllNonFixedFieldsGrow - + + + + Projection Angle + + + + + + + ProjectionAngle + + + /Mod/TechDraw/General + + + + First + + + + + Third + + + + + + + + Hidden Line + + + + + + + 1 + + + HiddenLine + + + Mod/TechDraw/General + + + + NeverShow + + + + + Solid + + + + + Dash + + + + + Dot + + + + + DashDot + + + + + DashDotDot + + + + + + + + Detect Faces + + + true + + + HandleFaces + + + /Mod/TechDraw/General + + + + + + + Show Section Edges + + + ShowSectionEdges + + + /Mod/TechDraw/General + + + + - - - - ProjectionAngle + + + + Qt::Vertical - - /Mod/TechDraw/General + + + 20 + 40 + - - - First - - - - - Third - - - - - - - - Hidden Line - - - - - - - 1 - - - HiddenLine - - - Mod/TechDraw/General - - - - NeverShow - - - - - Solid - - - - - Dash - - - - - Dot - - - - - DashDot - - - - - DashDotDot - - - - - - - - Detect Faces - - - true - - - HandleFaces - - - /Mod/TechDraw/General - - - - - - - Show Section Edges - - - ShowSectionEdges - - - /Mod/TechDraw/General - - + - - - - - - - 10 - 160 - 521 - 164 - - - - Colors - - - - - - - - Section Hatch - - + + + + + + Colors + + + + + + + + Section Hatch + + + + + + + Section Face + + + + + + + + 80 + 80 + 80 + + + + Background + + + /Mod/TechDraw/Colors + + + + + + + + 255 + 255 + 20 + + + + PreSelectColor + + + Mod/TechDraw/Colors + + + + + + + Normal + + + + + + + HiddenColor + + + Mod/TechDraw/Colors + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 28 + 173 + 28 + + + + SelectColor + + + Mod/TechDraw/Colors + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + 0 + + + + NormalColor + + + Mod/TechDraw/Colors + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + PreSelected + + + + + + + Hidden Line + + + + + + + + 225 + 225 + 225 + + + + CutSurfaceColor + + + Mod/TechDraw/Colors + + + + + + + Selected + + + + + + + + 0 + 0 + 0 + + + + Hatch + + + /Mod/TechDraw/Colors + + + + + + + Background + + + + + + + Geom Hatch + + + + + + + + 0 + 0 + 0 + + + + GeomHatch + + + /Mod/TechDraw/Colors + + + + - - - - Section Face - - - - - - - - 80 - 80 - 80 - - - - Background - - - /Mod/TechDraw/Colors - - - - - - - - 255 - 255 - 20 - - - - PreSelectColor - - - Mod/TechDraw/Colors - - - - - - - Normal - - - - - - - HiddenColor - - - Mod/TechDraw/Colors - - - - - + + - Qt::Horizontal + Qt::Vertical - 40 - 20 + 20 + 40 - - - - - 28 - 173 - 28 - - - - SelectColor - - - Mod/TechDraw/Colors - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - 0 - - - - NormalColor - - - Mod/TechDraw/Colors - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PreSelected - - - - - - - Hidden Line - - - - - - - - 225 - 225 - 225 - - - - CutSurfaceColor - - - Mod/TechDraw/Colors - - - - - - - Selected - - - - - - - - 0 - 0 - 0 - - - - Hatch - - - /Mod/TechDraw/Colors - - - - - - - Background - - - - - - + + + + + + Files + + + + + + + + Template Directory + + + + + + + Default Template + + + + + + + Gui::FileChooser::Directory + + + TemplateDir + + + /Mod/TechDraw/Files + + + + + + + Hatch Image + + + + + + + TemplateFile + + + /Mod/TechDraw/Files + + + + + + + Location of default svg/png fill file + + + FileHatch + + + /Mod/TechDraw/Files + + + + + + + PAT File + + + + + + + Default location for PAT file + + + FilePattern + + + /Mod/TechDraw/PAT + + + + + + + + + + + Default PAT pattern + + + NamePattern + + + /Mod/TechDraw/PAT + + + + + + + Pattern Name + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + 0 + 0 + + + + Labels + + + + + + + + 0.100000000000000 + + + LabelSize + + + /Mod/TechDraw/Labels + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + Label Font + + + + + + + osifont + + + LabelFont + + + Mod/TechDraw/Labels + + + + + + + Label Size + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2.ui index 973785771f..0e56034a06 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2.ui @@ -7,351 +7,473 @@ 0 0 521 - 420 + 463 TechDraw 2 - - - - 10 - 20 - 501 - 161 - - - - Dimensions - - - - - 20 - 30 - 471 - 125 - - - - - - - Show Units - - - ShowUnits - - - /Mod/TechDraw/Dimensions - - - - - - - Color - - - - - - - Font Size - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 1 - - - 4.000000000000000 - - - FontSize - - - /Mod/TechDraw/Dimensions - - - - - - - - 0 - 0 - 0 - - - - Color - - - /Mod/TechDraw/Dimensions - - - - - - - Diameter Symbol - - - - - - - - 12 - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - DiameterSymbol - - - /Mod/TechDraw/Dimensions - - - - - - - - - - 10 - 190 - 501 - 201 - - - - Decorations - - - - - 20 - 30 - 471 - 161 - - - - - - - MattingStyle - - - /Mod/TechDraw/Decorations - - - - Round + + + + + Dimensions + + + + + + + + Show Units + + + ShowUnits + + + /Mod/TechDraw/Dimensions + + + + + + + Color + + + + + + + Font Size + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 1 + + + 4.000000000000000 + + + FontSize + + + /Mod/TechDraw/Dimensions + + + + + + + + 0 + 0 + 0 + + + + Color + + + /Mod/TechDraw/Dimensions + + + + + + + Diameter Symbol + + + + + + + + 12 + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + DiameterSymbol + + + /Mod/TechDraw/Dimensions + + + + + + + + + Qt::Vertical - - - - Square + + + 20 + 40 + - - - - - - - Section Line Style - - - - - - - Center Line Style - - - - - - - Matting Style - - - - - - - - 175 - 175 - 175 - - - - CenterColor - - - /Mod/TechDraw/Decorations - - - - - - - 2 - - - CenterLine - - - /Mod/TechDraw/Decorations - - - - NeverShow + + + + + + + + + Decorations + + + + + + + + MattingStyle + + + /Mod/TechDraw/Decorations + + + + Round + + + + + Square + + + + + + + + Section Line Style + + + + + + + Center Line Style + + + + + + + Matting Style + + + + + + + + 175 + 175 + 175 + + + + CenterColor + + + /Mod/TechDraw/Decorations + + + + + + + 2 + + + CenterLine + + + /Mod/TechDraw/Decorations + + + + NeverShow + + + + + Sollid + + + + + Dash + + + + + Dot + + + + + DashDot + + + + + DashDotDot + + + + + + + + 2 + + + SectionLine + + + /Mod/TechDraw/Decorations + + + + NeverShow + + + + + Solid + + + + + Dash + + + + + Dot + + + + + DashDot + + + + + DashDotDot + + + + + + + + Center Line Color + + + + + + + Section Line Color + + + + + + + + 175 + 175 + 175 + + + + SectionColor + + + /Mod/TechDraw/Decorations + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Arrow Style + + + + + + + Preferred arrowhead style + + + 0 + + + 5 + + + ArrowStyle + + + Mod/TechDraw/Decorations + + + + 0 - Filled Triangle + + + + :/icons/arrowfilled.svg + + + + + + 1 - Open Arrowhead + + + + :/icons/arrowopen.svg + + + + + + 2 - Tick + + + + :/icons/arrowtick.svg + + + + + + 3 - Dot + + + + :/icons/arrowdot.svg + + + + + + 4 - Open Circle + + + + :/icons/arrowopendot.svg + + + + + + + + + Default weight for GeomHatch lines + + + Hatch Weight + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 1.000000000000000 + + + GeomWeight + + + Mod/TechDraw/PAT + + + + + + + + + Qt::Vertical - - - - Sollid + + + 20 + 40 + - - - - Dash - - - - - Dot - - - - - DashDot - - - - - DashDotDot - - - - - - - - 2 - - - SectionLine - - - /Mod/TechDraw/Decorations - - - - NeverShow - - - - - Solid - - - - - Dash - - - - - Dot - - - - - DashDot - - - - - DashDotDot - - - - - - - - Center Line Color - - - - - - - Section Line Color - - - - - - - - 175 - 175 - 175 - - - - SectionColor - - - /Mod/TechDraw/Decorations - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + @@ -385,6 +507,8 @@
Gui/PrefWidgets.h
- + + + diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.cpp index f94478eb8c..b34d35526c 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.cpp @@ -52,6 +52,7 @@ void DlgPrefsTechDraw2Imp::saveSettings() colCenterLine->onSave(); pcbSectionStyle->onSave(); colSectionLine->onSave(); + pcbArrow->onSave(); } void DlgPrefsTechDraw2Imp::loadSettings() @@ -65,6 +66,7 @@ void DlgPrefsTechDraw2Imp::loadSettings() colCenterLine->onRestore(); pcbSectionStyle->onRestore(); colSectionLine->onRestore(); + pcbArrow->onRestore(); } /** diff --git a/src/Mod/TechDraw/Gui/MDIViewPage.cpp b/src/Mod/TechDraw/Gui/MDIViewPage.cpp index 741989f814..ad07b724cf 100644 --- a/src/Mod/TechDraw/Gui/MDIViewPage.cpp +++ b/src/Mod/TechDraw/Gui/MDIViewPage.cpp @@ -38,6 +38,9 @@ #include #include #include + #include + #include + #endif // #ifndef _PreComp_ #include @@ -77,6 +80,7 @@ #include #include +#include "Rez.h" #include "QGIDrawingTemplate.h" #include "QGIView.h" #include "QGIViewPart.h" @@ -145,6 +149,12 @@ MDIViewPage::MDIViewPage(ViewProviderPage *pageVp, Gui::Document* doc, QWidget* m_view->scene(), SIGNAL(selectionChanged()), this , SLOT (selectionChanged()) ); + + //get informed by App side about deleted DocumentObjects + App::Document* appDoc = m_vpPage->getDocument()->getDocument(); + auto bnd = boost::bind(&MDIViewPage::onDeleteObject, this, _1); + connectDeletedObject = appDoc->signalDeletedObject.connect(bnd); + // A fresh page is added and we iterate through its collected children and add these to Canvas View -MLP // if docobj is a featureviewcollection (ex orthogroup), add its child views. if there are ever children that have children, @@ -169,8 +179,8 @@ MDIViewPage::MDIViewPage(ViewProviderPage *pageVp, Gui::Document* doc, QWidget* auto pageTemplate( dynamic_cast(obj) ); if( pageTemplate ) { //make sceneRect 1 pagesize bigger in every direction - double width = pageTemplate->Width.getValue(); - double height = pageTemplate->Height.getValue(); + double width = Rez::guiX(pageTemplate->Width.getValue()); + double height = Rez::guiX(pageTemplate->Height.getValue()); m_view->scene()->setSceneRect(QRectF(-width,-2.0 * height,3.0*width,3.0*height)); attachTemplate(pageTemplate); viewAll(); @@ -180,6 +190,7 @@ MDIViewPage::MDIViewPage(ViewProviderPage *pageVp, Gui::Document* doc, QWidget* MDIViewPage::~MDIViewPage() { + connectDeletedObject.disconnect(); } @@ -254,8 +265,8 @@ void MDIViewPage::attachTemplate(TechDraw::DrawTemplate *obj) QPointF MDIViewPage::getTemplateCenter(TechDraw::DrawTemplate *obj) { - double cx = obj->Width.getValue()/2.0; - double cy = -obj->Height.getValue()/2.0; + double cx = Rez::guiX(obj->Width.getValue())/2.0; + double cy = -Rez::guiX(obj->Height.getValue())/2.0; QPointF result(cx,cy); return result; } @@ -317,7 +328,23 @@ bool MDIViewPage::attachView(App::DocumentObject *obj) return (qview != nullptr); } +void MDIViewPage::removeView(QGIView *view) +{ + (void) m_view->removeView(view); +} +void MDIViewPage::onDeleteObject(const App::DocumentObject& obj) +{ + if (obj.isDerivedFrom(TechDraw::DrawView::getClassTypeId())) { + const App::DocumentObject* objPtr = &obj; + const TechDraw::DrawView* dv = static_cast(objPtr); + TechDraw::DrawPage* dvPg = dv->findParentPage(); + if (dvPg == m_vpPage->getDrawPage()) { + //this is a DV that is on our page + (void) m_view->removeView(dv); + } + } +} void MDIViewPage::updateTemplate(bool forceUpdate) { @@ -347,10 +374,19 @@ void MDIViewPage::updateTemplate(bool forceUpdate) void MDIViewPage::updateDrawing(bool forceUpdate) { - // We cannot guarantee if the number of graphical representations (QGIVxxxx) have changed so check the number (MLP) + // We cannot guarantee if the number of graphical representations (QGIVxxxx) have changed so check the number (MLP) + // WF: this should be fixed now with onDeletedObject signal from App side? + // WF: the QGVP views list may still not be 100% reliable + // TODO: build list of QGIV's from scene everytime? + //logging counters +// int qgvpIn = 0; +// int qgvpValid = 0; +// int qgvpClean = 0; +// int dpIn = 0; const std::vector &graphicsList = m_view->getViews(); +// qgvpIn = graphicsList.size(); const std::vector &pageChildren = m_vpPage->getDrawPage()->Views.getValues(); - + // Count total # DocumentObjects in Page unsigned int docObjCount = 0; for(std::vector::const_iterator it = pageChildren.begin(); it != pageChildren.end(); ++it) { @@ -361,7 +397,12 @@ void MDIViewPage::updateDrawing(bool forceUpdate) } docObjCount += 1; } - +// dpIn = docObjCount; + + + //TODO: should prune QGVP.views first always, then check if view in Page missing QGIVP + // this makes assumption that = numbers mean everythign is OK, but could be double failure - 1 extra QGIV, 1 DV missing graphics! + if(graphicsList.size() < docObjCount) { // there are more DocumentObjects than graphical representations (QGIVxxxx's) // Find which DocumentObjects have no graphical representation (QGIVxxxx) @@ -373,31 +414,50 @@ void MDIViewPage::updateDrawing(bool forceUpdate) attachView(*it); } } else if(graphicsList.size() > docObjCount) { - // There are more graphical representations (QGIVxxxx) than DocumentObjects - // Remove the orphans - std::vector::const_iterator itGraphics = graphicsList.begin(); + // prune any invalid entries in QGVP.views + // TODO: revisit this mess. is it still required with onDeletedItem signal implementation? std::vector newGraphicsList; - bool fnd = false; - while(itGraphics != graphicsList.end()) { - fnd = orphanExists((*itGraphics)->getViewName(), pageChildren); - if(fnd) { - newGraphicsList.push_back(*itGraphics); - } else { - if (m_view->scene() == (*itGraphics)->scene()) { - (*itGraphics)->hide(); - m_view->scene()->removeItem(*itGraphics); - } else { // this "shouldn't" happen, but it does - Base::Console().Log("ERROR - MDIViewPage::updateDrawing - %s already removed from QGraphicsScene\n", - (*itGraphics)->getViewName()); + QList items = m_view->scene()->items(); + for (auto& v: graphicsList) { //check that everything in QGVP views is valid + for (auto& i:items) { + if (v == i) { //this one is OK + newGraphicsList.push_back(v); + break; } } - itGraphics++; } - - // Update the QGVPage (QGraphicsView) list of QGIVxxxx - m_view->setViews(newGraphicsList); +// qgvpValid = newGraphicsList.size(); + //newGraphicsList now only contains valid QGIV's + //now prune the ones without docObjs + std::vector cleanItems; + for (auto& i: newGraphicsList) { + std::string viewName = (i->data(1).toString()).toStdString(); + App::DocumentObject* dObj = getAppDocument()->getObject(viewName.c_str()); + if (dObj == nullptr) { + //need to remove from group/scene + QGraphicsItemGroup* grp = i->group(); + if (grp) { + grp->removeFromGroup(i); + } + if (i->parentItem()) { //not top level + i->setParentItem(0); + } + if (i->scene()) { + i->scene()->removeItem(i); + } + //should delete i too to prevent leak? might be garbage pointer, though. + //add to delete list and delete outside of loop + } else { + QGIView* v = static_cast(i); + cleanItems.push_back(v); + } + } +// qgvpClean = cleanItems.size(); + m_view->setViews(cleanItems); +// Base::Console().Message("Log - MDIVP::updateDrawing pruning: docObjs: %d views in: %d valid views: %d views out: %d\n", +// dpIn,qgvpIn,qgvpValid, qgvpClean); } - + // Update all the QGIVxxxx const std::vector &upviews = m_view->getViews(); for(std::vector::const_iterator it = upviews.begin(); it != upviews.end(); ++it) { @@ -421,7 +481,7 @@ void MDIViewPage::redraw1View(TechDraw::DrawView* dv) std::string dvName = dv->getNameInDocument(); const std::vector &upviews = m_view->getViews(); for(std::vector::const_iterator it = upviews.begin(); it != upviews.end(); ++it) { - std::string qgivName = (*it)->getViewObject()->getNameInDocument(); + std::string qgivName = (*it)->getViewName(); if(dvName == qgivName) { (*it)->updateView(true); } @@ -457,7 +517,7 @@ bool MDIViewPage::hasQView(App::DocumentObject *obj) while(qview != views.end()) { // Unsure if we can compare pointers so rely on name - if(strcmp((*qview)->getViewObject()->getNameInDocument(), obj->getNameInDocument()) == 0) { + if(strcmp((*qview)->getViewName(), obj->getNameInDocument()) == 0) { return true; } qview++; @@ -731,8 +791,8 @@ void MDIViewPage::print(QPrinter* printer) double width = 0.0; double height = 0.0; if( pageTemplate ) { - width = pageTemplate->Width.getValue(); - height = pageTemplate->Height.getValue(); + width = Rez::guiX(pageTemplate->Width.getValue()); + height = Rez::guiX(pageTemplate->Height.getValue()); } QRectF sourceRect(0.0,-height,width,height); diff --git a/src/Mod/TechDraw/Gui/MDIViewPage.h b/src/Mod/TechDraw/Gui/MDIViewPage.h index 29ff8ac2d3..13fab0db8d 100644 --- a/src/Mod/TechDraw/Gui/MDIViewPage.h +++ b/src/Mod/TechDraw/Gui/MDIViewPage.h @@ -65,7 +65,8 @@ public: void attachTemplate(TechDraw::DrawTemplate *obj); void updateTemplate(bool force = false); void updateDrawing(bool force = false); - + void removeView(QGIView *view); + bool onMsg(const char* pMsg,const char** ppReturn); bool onHasMsg(const char* pMsg) const; void onRelabel(Gui::Document *pDoc); @@ -110,6 +111,11 @@ protected: QPrinter::PaperSize getPaperSize(int w, int h) const; void setDimensionGroups(void); void showStatusMsg(const char* s1, const char* s2, const char* s3) const; + + void onDeleteObject(const App::DocumentObject& obj); + + typedef boost::BOOST_SIGNALS_NAMESPACE::connection Connection; + Connection connectDeletedObject; private: QAction *m_nativeAction; diff --git a/src/Mod/TechDraw/Gui/QGCustomLabel.cpp b/src/Mod/TechDraw/Gui/QGCustomLabel.cpp index ef72c42341..c2b5db434b 100644 --- a/src/Mod/TechDraw/Gui/QGCustomLabel.cpp +++ b/src/Mod/TechDraw/Gui/QGCustomLabel.cpp @@ -40,6 +40,7 @@ #include #include +#include "Rez.h" #include "QGCustomLabel.h" using namespace TechDrawGui; @@ -75,5 +76,24 @@ void QGCustomLabel::centerAt(double cX, double cY) void QGCustomLabel::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) { QStyleOptionGraphicsItem myOption(*option); myOption.state &= ~QStyle::State_Selected; + + //see QGCustomText for explanation of this code + double dppt = 3.53; + double svgMagicX = Rez::guiX(8.0); + double svgMagicY = Rez::guiX(12.0); + double svgMagicYoffset = Rez::guiX(3.0); + double fontSize = Rez::appX(font().pointSizeF()); + double ty = svgMagicY + (svgMagicYoffset*fontSize)/dppt; + QPointF svgMove(-svgMagicX/dppt,ty); + + QPaintDevice* hw = painter->device(); + QSvgGenerator* svg = dynamic_cast(hw); + if (svg) { + painter->scale(Rez::appX(dppt),Rez::appX(dppt)); + painter->translate(svgMove); + } else { + painter->scale(1.0,1.0); + } + QGraphicsTextItem::paint (painter, &myOption, widget); } diff --git a/src/Mod/TechDraw/Gui/QGCustomLabel.h b/src/Mod/TechDraw/Gui/QGCustomLabel.h index e34d4b2887..75f13e9e6f 100644 --- a/src/Mod/TechDraw/Gui/QGCustomLabel.h +++ b/src/Mod/TechDraw/Gui/QGCustomLabel.h @@ -54,6 +54,6 @@ private: }; -} // namespace MDIViewPageGui +} #endif // DRAWINGGUI_QGCUSTOMLABEL_H diff --git a/src/Mod/TechDraw/Gui/QGCustomText.cpp b/src/Mod/TechDraw/Gui/QGCustomText.cpp index 5bed7c15db..c52aecf3f7 100644 --- a/src/Mod/TechDraw/Gui/QGCustomText.cpp +++ b/src/Mod/TechDraw/Gui/QGCustomText.cpp @@ -40,6 +40,7 @@ #include #include +#include "Rez.h" #include "QGIView.h" #include "QGCustomText.h" @@ -124,28 +125,27 @@ void QGCustomText::paint ( QPainter * painter, const QStyleOptionGraphicsItem * QStyleOptionGraphicsItem myOption(*option); myOption.state &= ~QStyle::State_Selected; - //svg text is much larger than screen text. scene units(mm) vs points. + //svg text is much larger than screen text. scene units(mm or 0.1mm in hirez) vs points. //need to scale text if going to svg. - //TODO: magic translation happens? approx: right ~8mm down: 12mm + (3mm per mm of text height) + //TODO: magic translation happens. why? approx: right ~8mm down: 12mm + (3mm per mm of text height) //SVG transform matrix translation values are different for same font size + different fonts (Sans vs Ubuntu vs Arial)??? // scale values are same for same font size + different fonts. - //double svgScale = 2.835; //72dpi/(25.4mm/in) - //double svgScale = 3.84; //96dpi/(25mm/in) - //double svgScale = 3.6; //90dpi/(25mm/in) more/less CSS standard? - double svgScale = 2.88; //72dpi/(25mm/in) Qt logicalDpiY() is int - double svgMagicX = 8.0; - //double svgMagicY = 7.5; //idk - double fontSize = font().pointSizeF(); - //double ty = (12.0/svgScale + 3.0*fontSize/svgScale) + (svgMagicY/svgScale); - double ty = (12.0/svgScale + 3.0*fontSize/svgScale); - QPointF svgMove(-svgMagicX/svgScale,-ty); + //calculate dots/mm + //in hirez - say factor = 10, we have 10 dpmm in scene space. + // so 254dpi / 72pts/in => 3.53 dppt + double dpmm = 3.53; //dots/pt + double svgMagicX = Rez::guiX(8.0); //8mm -> 80 gui dots + double svgMagicY = Rez::guiX(12.0); + double svgMagicYoffset = Rez::guiX(3.0); // 3mm per mm of font size => 30gunits / mm of font size + double fontSize = Rez::appX(font().pointSizeF()); //gui pts 4mm text * 10 scunits/mm = size 40 text but still only 4mm + double ty = svgMagicY + (svgMagicYoffset*fontSize)/dpmm; + // 12mm (in gunits) + [3mm (in gunits) * (# of mm)]/ [dots per mm] works out to dots? + QPointF svgMove(-svgMagicX/dpmm,ty); QPaintDevice* hw = painter->device(); - //QPaintDeviceMetrics hwm(hw); - //QPrinter* pr = dynamic_cast(hw); //printer does not rescale vs screen? QSvgGenerator* svg = dynamic_cast(hw); if (svg) { - painter->scale(svgScale,svgScale); + painter->scale(Rez::appX(dpmm),Rez::appX(dpmm)); painter->translate(svgMove); } else { painter->scale(1.0,1.0); diff --git a/src/Mod/TechDraw/Gui/QGIArrow.cpp b/src/Mod/TechDraw/Gui/QGIArrow.cpp index ab06a0ecfd..1d5037f120 100644 --- a/src/Mod/TechDraw/Gui/QGIArrow.cpp +++ b/src/Mod/TechDraw/Gui/QGIArrow.cpp @@ -32,6 +32,11 @@ #include #endif +#include +#include +#include + +#include "Rez.h" #include "QGIArrow.h" using namespace TechDrawGui; @@ -56,39 +61,102 @@ void QGIArrow::flip(bool state) { } void QGIArrow::draw() { - // the center is the end point on a dimension QPainterPath path; - //QPen pen(Qt::black); - //pen.setWidth(1); - - //QBrush brush(Qt::black); - //setPen(pen); - //setBrush(brush); - - float length = -m_size; //TODO: Arrow heads sb preference? size & type? - - if(isFlipped) - length *= -1; - path.moveTo(QPointF(0.,0.)); - path.lineTo(QPointF(length,-0.6)); - path.lineTo(QPointF(length, 0.6)); - - path.closeSubpath(); -// path.moveTo(QPointF(-1,1)); -// path.lineTo(QPointF(1,-1)); + if (m_style == 0) { + path = makeFilledTriangle(m_size,m_size/6.0,isFlipped); //"arrow l/w sb 3/1" ?? + } else if (m_style == 1) { + path = makeOpenArrow(m_size,m_size/3.0,isFlipped); //broad arrow? + } else if (m_style == 2) { + path = makeHashMark(m_size/2.0,m_size/2.0,isFlipped); //big enough? + } else if (m_style == 3) { + path = makeDot(m_size/2.0,m_size/2.0,isFlipped); + } else if (m_style == 4) { + path = makeOpenDot(m_size/2.0,m_size/2.0,isFlipped); + } else { + path = makeFilledTriangle(m_size,m_size/6.0,isFlipped); //sb a question mark or ??? + } setPath(path); } void QGIArrow::setSize(double s) { m_size = s; - //??? } -void QGIArrow::setStyle(int s) + +QPainterPath QGIArrow::makeFilledTriangle(double length, double width, bool flipped) { - m_style = s; - //??? +//(0,0) is tip of arrow + if (!flipped) { + length *= -1; + } + + QPainterPath path; + path.moveTo(QPointF(0.,0.)); + path.lineTo(QPointF(Rez::guiX(length),Rez::guiX(-width))); + path.lineTo(QPointF(Rez::guiX(length),Rez::guiX(width))); + path.closeSubpath(); + m_fill = Qt::SolidPattern; + return path; +} + +QPainterPath QGIArrow::makeOpenArrow(double length, double width, bool flipped) +{ +//(0,0) is tip of arrow + if (!flipped) { + length *= -1; + } + + QPainterPath path; + path.moveTo(QPointF(Rez::guiX(length),Rez::guiX(-width))); + path.lineTo(QPointF(0.,0.)); + path.lineTo(QPointF(Rez::guiX(length),Rez::guiX(width))); + m_fill = Qt::NoBrush; + return path; +} + +QPainterPath QGIArrow::makeHashMark(double length, double width, bool flipped) //Arch tick +{ + double adjWidth = 1.0; +//(0,0) is tip of arrow + if (!flipped) { + length *= -1; + adjWidth *= -1; + } + QPainterPath path; + path.moveTo(QPointF(Rez::guiX(length),Rez::guiX(adjWidth * (-width)))); + path.lineTo(QPointF(Rez::guiX(-length),Rez::guiX(adjWidth * width))); + m_fill = Qt::NoBrush; + return path; +} + +QPainterPath QGIArrow::makeDot(double length, double width, bool flipped) //closed dot +{ + Q_UNUSED(flipped); + QPainterPath path; + path.moveTo(0.0,0.0); ////(0,0) is Center of dot + path.addEllipse(Rez::guiX(-length/2.0), Rez::guiX(-width/2.0), Rez::guiX(length), Rez::guiX(width)); + m_fill = Qt::SolidPattern; + return path; +} + +QPainterPath QGIArrow::makeOpenDot(double length, double width, bool flipped) +{ + Q_UNUSED(flipped); + QPainterPath path; + path.moveTo(0.0,0.0); ////(0,0) is Center of dot + path.addEllipse(Rez::guiX(-length/2.0), Rez::guiX(-width/2.0), Rez::guiX(length), Rez::guiX(width)); + m_fill = Qt::NoBrush; + return path; +} + + +int QGIArrow::getPrefArrowStyle() +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter(). + GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations"); + int style = hGrp->GetInt("ArrowStyle", 0); + return style; } void QGIArrow::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) @@ -96,6 +164,7 @@ void QGIArrow::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QStyleOptionGraphicsItem myOption(*option); myOption.state &= ~QStyle::State_Selected; + setPen(m_pen); m_brush.setColor(m_colCurrent); m_brush.setStyle(m_fill); setBrush(m_brush); diff --git a/src/Mod/TechDraw/Gui/QGIArrow.h b/src/Mod/TechDraw/Gui/QGIArrow.h index 2fef9a3173..f3f6764067 100644 --- a/src/Mod/TechDraw/Gui/QGIArrow.h +++ b/src/Mod/TechDraw/Gui/QGIArrow.h @@ -44,18 +44,22 @@ public: public: void draw(); - //void setHighlighted(bool state); void flip(bool state); double getSize() { return m_size; } void setSize(double s); int getStyle() { return m_style; } - void setStyle(int s); - //QPainterPath shape() const; + void setStyle(int s) { m_style = s; } + static int getPrefArrowStyle(); + virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ); protected: - //QVariant itemChange(GraphicsItemChange change, const QVariant &value); - + QPainterPath makeFilledTriangle(double length, double width, bool flipped); + QPainterPath makeOpenArrow(double length, double width, bool flipped); + QPainterPath makeHashMark(double length, double width, bool flipped); + QPainterPath makeDot(double length, double width, bool flipped); + QPainterPath makeOpenDot(double length, double width, bool flipped); + private: QBrush m_brush; Qt::BrushStyle m_fill; @@ -64,6 +68,6 @@ private: bool isFlipped; }; -} // namespace MDIViewPageGui +} #endif // DRAWINGGUI_QGRAPHICSITEMARROW_H diff --git a/src/Mod/TechDraw/Gui/QGIFace.cpp b/src/Mod/TechDraw/Gui/QGIFace.cpp index 551b7e7065..137e0d0c0f 100644 --- a/src/Mod/TechDraw/Gui/QGIFace.cpp +++ b/src/Mod/TechDraw/Gui/QGIFace.cpp @@ -31,6 +31,9 @@ #include #include #include +#include +#include +#include #endif #include @@ -45,11 +48,15 @@ #include #include +#include + +#include "Rez.h" #include "QGCustomSvg.h" #include "QGCustomRect.h" #include "QGIFace.h" using namespace TechDrawGui; +using namespace TechDraw; QGIFace::QGIFace(int index) : projIndex(index), @@ -57,15 +64,21 @@ QGIFace::QGIFace(int index) : m_styleDef(Qt::SolidPattern), m_styleSelect(Qt::SolidPattern) { + setFillMode(NoFill); + isHatched(false); setFlag(QGraphicsItem::ItemClipsChildrenToShape,true); - //setFiltersChildEvents(true); - //setStyle(Qt::NoPen); //don't draw face lines, just fill + //setStyle(Qt::NoPen); //don't draw face lines, just fill for debugging setStyle(Qt::DashLine); m_styleNormal = m_styleDef; + m_fillStyle = m_styleDef; m_colNormalFill = m_colDefFill; + m_geomColor = QColor(Qt::black); + setLineWeight(0.5); //0 = cosmetic + setPrettyNormal(); + m_texture = QPixmap(); //empty texture m_svg = new QGCustomSvg(); @@ -73,6 +86,7 @@ QGIFace::QGIFace(int index) : m_rect->setParentItem(this); m_svgCol = SVGCOLDEFAULT; + m_fillScale = 1.0; } QGIFace::~QGIFace() @@ -80,34 +94,83 @@ QGIFace::~QGIFace() //nothing to do. every item is a child of QGIFace & will get removed/deleted when QGIF is deleted } +void QGIFace::draw() +{ + setPath(m_outline); //Face boundary + + if (isHatched()) { + if (m_mode == GeomHatchFill) { //crosshatch + if (!m_geomHatchPaths.empty()) { //surrogate for LineSets.empty + m_brush.setTexture(QPixmap()); + m_fillStyle = m_styleDef; + m_styleNormal = m_fillStyle; + int pathNo = 0; + for (auto& pp: m_geomHatchPaths) { + QGraphicsPathItem* fillItem = m_fillItems.at(pathNo); + fillItem->setPath(pp); + QPen geomPen = setGeomPen(pathNo); + fillItem->setPen(geomPen); + pathNo++; + } + } + } else if ((m_mode == FromFile) || + (m_mode == SvgFill) || + (m_mode == BitmapFill)) { + QFileInfo hfi(QString::fromUtf8(m_fileSpec.data(),m_fileSpec.size())); + if (hfi.isReadable()) { + QString ext = hfi.suffix(); + if (ext.toUpper() == QString::fromUtf8("SVG")) { + setFillMode(SvgFill); + m_brush.setTexture(QPixmap()); + m_fillStyle = m_styleDef; + m_styleNormal = m_fillStyle; + loadSvgHatch(m_fileSpec); + buildSvgHatch(); + toggleSvg(true); + } else if ((ext.toUpper() == QString::fromUtf8("JPG")) || + (ext.toUpper() == QString::fromUtf8("PNG")) || + (ext.toUpper() == QString::fromUtf8("JPEG")) || + (ext.toUpper() == QString::fromUtf8("BMP")) ) { + setFillMode(BitmapFill); + toggleSvg(false); + m_fillStyle = Qt::TexturePattern; + m_texture = textureFromBitmap(m_fileSpec); + m_brush.setTexture(m_texture); + } + } + } + } + show(); +} + void QGIFace::setPrettyNormal() { - m_fillStyle = m_styleNormal; - m_fillColor = m_colNormalFill; + if (isHatched() && + (m_mode == BitmapFill) ) { //hatch with bitmap fill + m_fillStyle = Qt::TexturePattern; + m_brush.setTexture(m_texture); + } else { + m_fillStyle = m_styleNormal; + m_brush.setTexture(QPixmap()); + m_brush.setStyle(m_fillStyle); + m_fillColor = m_colNormalFill; + } QGIPrimPath::setPrettyNormal(); } void QGIFace::setPrettyPre() { + m_brush.setTexture(QPixmap()); m_fillStyle = m_styleSelect; m_fillColor = getPreColor(); QGIPrimPath::setPrettyPre(); } void QGIFace::setPrettySel() { + m_brush.setTexture(QPixmap()); m_fillStyle = m_styleSelect; m_fillColor = getSelectColor(); QGIPrimPath::setPrettySel(); } -void QGIFace::setFill(QColor c, Qt::BrushStyle s) { - m_colNormalFill = c; - m_styleNormal = s; -} - -void QGIFace::setFill(QBrush b) { - m_colNormalFill = b.color(); - m_styleNormal = b.style(); -} - void QGIFace::setDrawEdges(bool b) { if (b) { setStyle(Qt::DashLine); @@ -116,14 +179,14 @@ void QGIFace::setDrawEdges(bool b) { } } -void QGIFace::resetFill() { - m_colNormalFill = m_colDefFill; - m_styleNormal = m_styleDef; -} - -void QGIFace::setHatch(std::string fileSpec) +void QGIFace::setHatchFile(std::string fileSpec) { - QString qfs(QString::fromStdString(fileSpec)); + m_fileSpec = fileSpec; +} + +void QGIFace::loadSvgHatch(std::string fileSpec) +{ + QString qfs(QString::fromUtf8(fileSpec.data(),fileSpec.size())); QFile f(qfs); if (!f.open(QFile::ReadOnly | QFile::Text)) { Base::Console().Error("QGIFace could not read %s\n",fileSpec.c_str()); @@ -134,29 +197,112 @@ void QGIFace::setHatch(std::string fileSpec) Base::Console().Error("Error - Could not load hatch into SVG renderer for %s\n", fileSpec.c_str()); return; } - - buildHatch(); } -void QGIFace::setPath(const QPainterPath & path) +void QGIFace::setFillMode(QGIFace::fillMode m) { - QGraphicsPathItem::setPath(path); - if (!m_svgXML.isEmpty()) { - buildHatch(); + m_mode = m; + if ((m_mode == NoFill) || + (m_mode == PlainFill)) { + isHatched(false); + } else { + isHatched(true); } } -void QGIFace::buildHatch() +void QGIFace::setOutline(const QPainterPath & path) { - m_styleNormal = Qt::NoBrush; - double w = boundingRect().width(); - double h = boundingRect().height(); - QRectF r = boundingRect(); + m_outline = path; +} + +void QGIFace::clearLineSets(void) +{ + m_geomHatchPaths.clear(); + m_dashSpecs.clear(); + clearFillItems(); +} + +//each line set needs a painterpath, a dashspec and a QGPItem to show them +void QGIFace::addLineSet(QPainterPath pp, std::vector dp) +{ + m_geomHatchPaths.push_back(pp); + m_dashSpecs.push_back(DashSpec(dp)); + addFillItem(); +} + +QGraphicsPathItem* QGIFace::addFillItem() +{ + QGraphicsPathItem* fillItem = new QGraphicsPathItem(); + fillItem->setParentItem(this); + m_fillItems.push_back(fillItem); + return fillItem; +} + +void QGIFace::clearFillItems(void) +{ + for (auto& f: m_fillItems) { + f->setParentItem(nullptr); + this->scene()->removeItem(f); + delete f; + } +} + +//convert from PAT style "-1,0,-1,+1" to Qt style "mark,space,mark,space" +QVector QGIFace::decodeDashSpec(DashSpec patDash) +{ + //Rez::guiX(something)? + double dotLength = 3.0; + double unitLength = 6.0; +// double penWidth = m_geomWeight; //mark, space and dot lengths are to be in terms of penWidth(Qt) or mm(PAT)?? +// //if we want it in terms of mm, we need to divide by penWidth? +// double minPen = 0.01; //avoid trouble with cosmetic pen (zero width) + std::vector result; + std::string prim; + for (auto& d: patDash.get()) { + double strokeLength; + if (DrawUtil::fpCompare(d,0.0)) { //pat dot + strokeLength = dotLength; + } else if (Rez::guiX(d) < 0) { //pat space + strokeLength = fabs(Rez::guiX(d)) * unitLength; + } else { //pat dash + strokeLength = Rez::guiX(d) * unitLength; + } + result.push_back(strokeLength); + } + return QVector::fromStdVector( result ); +} + + +QPen QGIFace::setGeomPen(int i) +{ + //m_dashSpecs[i].dump("spec test"); + DashSpec ourSpec = m_dashSpecs.at(i); + //ourSpec.dump("our spec"); + + QPen result; + result.setWidthF(Rez::guiX(m_geomWeight)); //Rez::guiX() ?? line weights are in mm? + result.setColor(m_geomColor); + if (ourSpec.empty()) { + result.setStyle(Qt::SolidLine); + } else { + result.setStyle(Qt::CustomDashLine); + result.setDashPattern(decodeDashSpec(ourSpec)); + } + return result; +} + +void QGIFace::buildSvgHatch() +{ + double wTile = SVGSIZEW * m_fillScale; + double hTile = SVGSIZEH * m_fillScale; + double w = m_outline.boundingRect().width(); + double h = m_outline.boundingRect().height(); + QRectF r = m_outline.boundingRect(); QPointF fCenter = r.center(); - double nw = ceil(w / SVGSIZEW); - double nh = ceil(h / SVGSIZEH); - w = nw * SVGSIZEW; - h = nh * SVGSIZEW; + double nw = ceil(w / wTile); + double nh = ceil(h / hTile); + w = nw * wTile; + h = nh * hTile; m_rect->setRect(0.,0.,w,-h); m_rect->centerAt(fCenter); r = m_rect->rect(); @@ -167,20 +313,46 @@ void QGIFace::buildHatch() for (int iw = 0; iw < int(nw); iw++) { for (int ih = 0; ih < int(nh); ih++) { QGCustomSvg* tile = new QGCustomSvg(); + tile->setScale(m_fillScale); if (tile->load(&colorXML)) { tile->setParentItem(m_rect); - tile->setPos(iw*SVGSIZEW,-h + ih*SVGSIZEH); + tile->setPos(iw*wTile,-h + ih*hTile); } } } - } -//c is a CSS color ie "#000000" -//set hatch color before building hatch -void QGIFace::setHatchColor(std::string c) +void QGIFace::clearSvg() { - m_svgCol = c; + toggleSvg(false); +} + +//this isn't used currently +QPixmap QGIFace::textureFromSvg(std::string fileSpec) +{ + QPixmap result; + QString qs(QString::fromStdString(fileSpec)); + QFileInfo ffi(qs); + if (ffi.isReadable()) { + QSvgRenderer renderer(qs); + QPixmap pixMap(renderer.defaultSize()); + pixMap.fill(Qt::white); //try Qt::transparent? + QPainter painter(&pixMap); + renderer.render(&painter); //svg texture -> bitmap + result = pixMap.scaled(m_fillScale,m_fillScale); + } //else return empty pixmap + return result; +} + +void QGIFace::setHatchColor(App::Color c) +{ + m_svgCol = c.asCSSString(); + m_geomColor = c.asValue(); +} + +void QGIFace::setHatchScale(double s) +{ + m_fillScale = s; } //QtSvg does not handle clipping, so we must be able to turn the hatching on/off @@ -194,6 +366,39 @@ void QGIFace::toggleSvg(bool b) update(); } +QPixmap QGIFace::textureFromBitmap(std::string fileSpec) +{ + QPixmap pix; + QString qs = QString::fromUtf8(fileSpec.data(),fileSpec.size()); + QFileInfo ffi(qs); + if (ffi.isReadable()) { + QImage img = QImage(qs); + img = img.scaled(Rez::guiX(m_fillScale),Rez::guiX(m_fillScale)); + pix = QPixmap::fromImage(img); + } + return pix; +} + +void QGIFace::setFill(QColor c, Qt::BrushStyle s) { + m_colNormalFill = c; + m_styleNormal = s; +} + +void QGIFace::setFill(QBrush b) { + m_colNormalFill = b.color(); + m_styleNormal = b.style(); +} + +void QGIFace::resetFill() { + m_colNormalFill = m_colDefFill; + m_styleNormal = m_styleDef; +} + +void QGIFace::setLineWeight(double w) { + m_geomWeight = w; +} + + QRectF QGIFace::boundingRect() const { return shape().controlPointRect(); @@ -213,3 +418,4 @@ void QGIFace::paint ( QPainter * painter, const QStyleOptionGraphicsItem * optio setBrush(m_brush); QGIPrimPath::paint (painter, &myOption, widget); } + diff --git a/src/Mod/TechDraw/Gui/QGIFace.h b/src/Mod/TechDraw/Gui/QGIFace.h index 99f21c652f..3fd980bfc5 100644 --- a/src/Mod/TechDraw/Gui/QGIFace.h +++ b/src/Mod/TechDraw/Gui/QGIFace.h @@ -27,9 +27,15 @@ #include #include #include +#include +#include + +#include #include "QGIPrimPath.h" +using namespace TechDraw; + namespace TechDrawGui { class QGCustomSvg; @@ -53,30 +59,77 @@ public: virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ); public: + enum fillMode { + NoFill, + FromFile, + SvgFill, + BitmapFill, + GeomHatchFill, + PlainFill + }; + + int getProjIndex() const { return projIndex; } + void draw(); void setPrettyNormal(); void setPrettyPre(); void setPrettySel(); + void setDrawEdges(bool b); + virtual void setOutline(const QPainterPath& path); + + //shared fill parms + void isHatched(bool s) {m_isHatched = s; } + bool isHatched(void) {return m_isHatched;} + void setFillMode(fillMode m); + + //plain color fill parms void setFill(QColor c, Qt::BrushStyle s); void setFill(QBrush b); - void setHatch(std::string fileSpec); - void resetFill(void); - void setPath(const QPainterPath & path); - void buildHatch(void); - void setHatchColor(std::string c); - void setDrawEdges(bool b); - void toggleSvg(bool b); + void resetFill(); -protected: - bool load(QByteArray *svgBytes); + //general hatch parms & methods + void setHatchColor(App::Color c); + void setHatchScale(double s); + + //svg fill parms & methods + void setHatchFile(std::string fileSpec); + void loadSvgHatch(std::string fileSpec); + void buildSvgHatch(void); + void toggleSvg(bool b); + void clearSvg(void); + + //PAT fill parms & methods + void setGeomHatchWeight(double w) { m_geomWeight = w; } + void clearLineSets(void); + void addLineSet(QPainterPath pp, std::vector dp); + QGraphicsPathItem* addFillItem(); + void clearFillItems(void); + void setLineWeight(double w); + + //bitmap texture fill parms method + QPixmap textureFromBitmap(std::string fileSpec); + QPixmap textureFromSvg(std::string fillSpec); protected: int projIndex; //index of face in Projection. -1 for SectionFace. QGCustomRect *m_rect; + QGCustomSvg *m_svg; QByteArray m_svgXML; std::string m_svgCol; + std::string m_fileSpec; //for svg & bitmaps + + double m_fillScale; + bool m_isHatched; + QGIFace::fillMode m_mode; + + QPen setGeomPen(int i); + QVector decodeDashSpec(DashSpec d); + std::vector m_fillItems; + std::vector m_geomHatchPaths; // 0/1 dashspec per hatchpath + std::vector m_dashSpecs; + private: QBrush m_brush; @@ -88,6 +141,15 @@ private: Qt::BrushStyle m_styleDef; //default Normal fill style Qt::BrushStyle m_styleNormal; //current Normal fill style Qt::BrushStyle m_styleSelect; //Select/preSelect fill style + + QPixmap m_texture; // + + QPainterPath m_outline; // + + QPainterPath m_geomhatch; //crosshatch fill lines + + QColor m_geomColor; //color for crosshatch lines + double m_geomWeight; //lineweight for crosshatch lines }; } diff --git a/src/Mod/TechDraw/Gui/QGIProjGroup.cpp b/src/Mod/TechDraw/Gui/QGIProjGroup.cpp index 3a4a72026a..b4f22b0695 100644 --- a/src/Mod/TechDraw/Gui/QGIProjGroup.cpp +++ b/src/Mod/TechDraw/Gui/QGIProjGroup.cpp @@ -41,6 +41,7 @@ #include #include +#include "Rez.h" #include "QGIProjGroup.h" using namespace TechDrawGui; @@ -180,9 +181,9 @@ void QGIProjGroup::mouseReleaseEvent(QGraphicsSceneMouseEvent * event) Gui::Command::openCommand("Drag Projection Group"); //TODO: See if these commands actually handle the horizontal/vertical constraints properly... Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.X = %f", - getViewObject()->getNameInDocument(), x()); + getViewName(), Rez::appX(x())); Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Y = %f", - getViewObject()->getNameInDocument(), getY());// inverts Y + getViewName(), Rez::appX(getY()));// inverts Y Gui::Command::commitCommand(); //Gui::Command::updateActive(); } diff --git a/src/Mod/TechDraw/Gui/QGISVGTemplate.cpp b/src/Mod/TechDraw/Gui/QGISVGTemplate.cpp index 6317c86a73..7ee5b0f3c1 100644 --- a/src/Mod/TechDraw/Gui/QGISVGTemplate.cpp +++ b/src/Mod/TechDraw/Gui/QGISVGTemplate.cpp @@ -40,6 +40,7 @@ #include #include +#include "Rez.h" #include "ZVALUE.h" #include "TemplateTextField.h" #include "QGISVGTemplate.h" @@ -100,15 +101,15 @@ void QGISVGTemplate::load(const QString &fileName) firstTime = false; } - //This is probably first time only logic too. + //convert from pixels or mm or inches in svg file to mm page size TechDraw::DrawSVGTemplate *tmplte = getSVGTemplate(); double xaspect, yaspect; xaspect = tmplte->getWidth() / (double) size.width(); yaspect = tmplte->getHeight() / (double) size.height(); QTransform qtrans; - qtrans.translate(0.f, -tmplte->getHeight()); - qtrans.scale(xaspect , yaspect); + qtrans.translate(0.f, Rez::guiX(-tmplte->getHeight())); + qtrans.scale(Rez::guiX(xaspect) , Rez::guiX(yaspect)); m_svgItem->setTransform(qtrans); } @@ -190,11 +191,11 @@ void QGISVGTemplate::createClickHandles(void) QString yStr = QString::fromStdString(yMatch[1].str()); QString editableName = QString::fromStdString(nameMatch[1].str()); - double x = xStr.toDouble(); - double y = yStr.toDouble(); + double x = Rez::guiX(xStr.toDouble()); + double y = Rez::guiX(yStr.toDouble()); //TODO: this should probably be configurable without a code change - double editClickBoxSize = 1.5; + double editClickBoxSize = Rez::guiX(1.5); QColor editClickBoxColor = Qt::green; double width = editClickBoxSize; @@ -202,7 +203,7 @@ void QGISVGTemplate::createClickHandles(void) TemplateTextField *item = new TemplateTextField(this, tmplte, nameMatch[1].str(), qgview); float pad = 1; - item->setRect(x - pad, -tmplte->getHeight() + y - height - pad, + item->setRect(x - pad, Rez::guiX(-tmplte->getHeight()) + y - height - pad, width + 2 * pad, height + 2 * pad); QPen myPen; diff --git a/src/Mod/TechDraw/Gui/QGISectionLine.cpp b/src/Mod/TechDraw/Gui/QGISectionLine.cpp index b3022f0c1d..8350ccc3b8 100644 --- a/src/Mod/TechDraw/Gui/QGISectionLine.cpp +++ b/src/Mod/TechDraw/Gui/QGISectionLine.cpp @@ -33,6 +33,7 @@ #include #include +#include "Rez.h" #include "QGIView.h" #include "QGISectionLine.h" @@ -40,7 +41,7 @@ using namespace TechDrawGui; QGISectionLine::QGISectionLine() { - m_extLen = 8.0; + m_extLen = Rez::guiX(8.0); m_arrowSize = 0.0; m_line = new QGraphicsPathItem(); @@ -54,7 +55,7 @@ QGISectionLine::QGISectionLine() m_symbol2 = new QGCustomText(); addToGroup(m_symbol2); - setWidth(0.75); + setWidth(Rez::guiX(0.75)); setStyle(getSectionStyle()); setColor(getSectionColor()); @@ -74,7 +75,7 @@ void QGISectionLine::makeLine() QPainterPath pp; QPointF extLineStart,extLineEnd; QPointF offset(m_arrowDir.x,-m_arrowDir.y); - offset = 0.80 * m_extLen * offset; //0.80 is hack to hide line end behind arrowhead + offset = 0.75 * m_extLen * offset; //0.75 is hack to hide line end behind arrowhead extLineStart = m_start + offset; extLineEnd = m_end + offset; pp.moveTo(extLineStart); @@ -100,6 +101,8 @@ void QGISectionLine::makeArrows() extLineStart = m_start + offset; extLineEnd = m_end + offset; + m_arrow1->setStyle(0); + m_arrow2->setStyle(0); m_arrow1->setPos(extLineStart); //m_arrow1->flip(true); m_arrow1->draw(); @@ -121,9 +124,15 @@ void QGISectionLine::makeSymbols() m_symFont.setPointSize(m_symSize); m_symbol1->setFont(m_symFont); m_symbol1->setPlainText(QString::fromUtf8(m_symbol)); + if (m_arrowDir.y < 0.0) { //pointing down + extLineStart -= QPointF (0.0,m_symSize); //move text up a bit + } m_symbol1->centerAt(extLineStart); m_symbol2->setFont(m_symFont); m_symbol2->setPlainText(QString::fromUtf8(m_symbol)); + if (m_arrowDir.y < 0.0) { //pointing down + extLineEnd -= QPointF (0.0,m_symSize); + } m_symbol2->centerAt(extLineEnd); } diff --git a/src/Mod/TechDraw/Gui/QGIView.cpp b/src/Mod/TechDraw/Gui/QGIView.cpp index e06122a7e5..f22708c400 100644 --- a/src/Mod/TechDraw/Gui/QGIView.cpp +++ b/src/Mod/TechDraw/Gui/QGIView.cpp @@ -44,7 +44,12 @@ #include #include #include +#include +#include +#include + +#include "Rez.h" #include "QGCustomBorder.h" #include "QGCustomLabel.h" #include "QGIView.h" @@ -188,13 +193,9 @@ void QGIView::mouseReleaseEvent(QGraphicsSceneMouseEvent * event) if (!isInnerView()) { double tempX = x(), tempY = getY(); -// getViewObject()->X.setValue(tempX); -// getViewObject()->Y.setValue(tempY); - getViewObject()->setPosition(tempX,tempY); + getViewObject()->setPosition(Rez::appX(tempX),Rez::appX(tempY)); } else { -// getViewObject()->X.setValue(x()); -// getViewObject()->Y.setValue(getYInClip(y())); - getViewObject()->setPosition(x(),getYInClip(y())); + getViewObject()->setPosition(Rez::appX(x()),Rez::appX(getYInClip(y()))); } getViewObject()->setMouseMove(false); } @@ -244,7 +245,7 @@ double QGIView::getYInClip(double y) if (parentView) { auto parentFeat( dynamic_cast(parentView->getViewObject()) ); if (parentFeat) { - return parentFeat->Height.getValue() - y; + return Rez::guiX(parentFeat->Height.getValue()) - y; } } } @@ -259,8 +260,8 @@ void QGIView::updateView(bool update) if (update || getViewObject()->X.isTouched() || getViewObject()->Y.isTouched()) { - double featX = getViewObject()->X.getValue(); - double featY = getViewObject()->Y.getValue(); + double featX = Rez::guiX(getViewObject()->X.getValue()); + double featY = Rez::guiX(getViewObject()->Y.getValue()); setPosition(featX,featY); } @@ -269,6 +270,7 @@ void QGIView::updateView(bool update) //NOTE: QPainterPaths have to be rotated individually. This transform handles Rotation for everything else. //Scale is handled in GeometryObject for DVP & descendents //Objects not descended from DVP must setScale for themselves + //note that setTransform(,,rotation,,) is not the same as setRotation!!! double rot = getViewObject()->Rotation.getValue(); QPointF centre = boundingRect().center(); setTransform(QTransform().translate(centre.x(), centre.y()).rotate(-rot).translate(-centre.x(), -centre.y())); @@ -295,11 +297,10 @@ void QGIView::setViewFeature(TechDraw::DrawView *obj) viewObj = obj; viewName = obj->getNameInDocument(); - - // Set the QGIGroup initial position based on the DrawView ( wrong. new views are always at Page center) -// float x = obj->X.getValue(); -// float y = obj->Y.getValue(); -// setPosition(x, y); + + //mark the actual QGraphicsItem so we can check what's in the scene later + setData(0,QString::fromUtf8("QGIV")); + setData(1,QString::fromUtf8(obj->getNameInDocument())); } void QGIView::toggleCache(bool state) @@ -408,7 +409,7 @@ void QGIView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q QStyleOptionGraphicsItem myOption(*option); myOption.state &= ~QStyle::State_Selected; - //painter->drawRect(boundingRect()); + //painter->drawRect(boundingRect()); //good for debugging QGraphicsItemGroup::paint(painter, &myOption, widget); } @@ -454,6 +455,15 @@ QGIView* QGIView::getQGIVByName(std::string name) return 0; } +/* static */ +Gui::ViewProvider* QGIView::getViewProvider(App::DocumentObject* obj) +{ + Gui::Document* guiDoc = Gui::Application::Instance->getDocument(obj->getDocument()); + Gui::ViewProvider* result = guiDoc->getViewProvider(obj); + return result; +} + + QColor QGIView::getNormalColor() { Base::Reference hGrp = getParmGroupCol(); @@ -501,7 +511,7 @@ double QGIView::getPrefFontSize() Base::Reference hGrp = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Labels"); double fontSize = hGrp->GetFloat("LabelSize", 5.0); - return fontSize; + return Rez::guiX(fontSize); } void QGIView::dumpRect(char* text, QRectF r) { diff --git a/src/Mod/TechDraw/Gui/QGIView.h b/src/Mod/TechDraw/Gui/QGIView.h index 008dd5c4c8..eb217b32f5 100644 --- a/src/Mod/TechDraw/Gui/QGIView.h +++ b/src/Mod/TechDraw/Gui/QGIView.h @@ -27,8 +27,10 @@ #include #include +#include #include #include +#include #include @@ -87,6 +89,8 @@ public: virtual QColor getNormalColor(void); virtual QColor getPreColor(void); virtual QColor getSelectColor(void); + + static Gui::ViewProvider* getViewProvider(App::DocumentObject* obj); protected: QGIView* getQGIVByName(std::string name); diff --git a/src/Mod/TechDraw/Gui/QGIViewAnnotation.cpp b/src/Mod/TechDraw/Gui/QGIViewAnnotation.cpp index b21cd5ebb5..e1b0801230 100644 --- a/src/Mod/TechDraw/Gui/QGIViewAnnotation.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewAnnotation.cpp @@ -50,6 +50,7 @@ #include #include +#include "Rez.h" #include "QGIViewAnnotation.h" #include "QGCustomText.h" @@ -115,6 +116,8 @@ void QGIViewAnnotation::draw() } } +//TODO: text is position slightly high (and left??) on page save to SVG file + void QGIViewAnnotation::drawAnnotation() { auto viewAnno( dynamic_cast(getViewObject()) ); @@ -129,7 +132,7 @@ void QGIViewAnnotation::drawAnnotation() ss << "\n\n