From 1011dd4175bf907c916e8c45601ba59c16f139c2 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 4 Aug 2014 17:36:22 +0200 Subject: [PATCH] Squashed commit of the following: commit 695becbbfff961b13e3edb5a4e1e4487bc53b4bb Author: Abdullah Tahiri Date: Mon Aug 4 15:24:33 2014 +0200 - Making combo disable state. - Updating Art (Thanks Jim!) commit d5391d40ace450fa2e65fe2b4ab8029ad37cacf8 Author: Abdullah Tahiri Date: Fri Aug 1 00:40:15 2014 +0200 - Adaptation of code to Workbench's new Template structure. - Minor adaptation of new ViewProvideSketch code to new constraint code (only in code extensions needed for element Widget) commit ecdec20afa33c9a950e6054e80e4aa9c72aad8b6 Author: Abdullah Tahiri Date: Thu Jul 31 15:31:38 2014 +0200 Fix so that when applying a coincident constraint to a plurality of points, if one constraint on a couple of points exists, no new coincident constraint is added to this couple. Fixes: http://forum.freecadweb.org/viewtopic.php?f=3&t=6890 commit 32ef59d76e6c63356f5d36598ca11eb47c2e52af Author: Abdullah Tahiri Date: Thu Jul 31 14:13:58 2014 +0200 Add some placeholder art for icons to avoid having a cross icon and annoying icon not found messages. commit ccb60a3a7e71a0eb8ad5d896542314a98ef314a8 Author: Abdullah Tahiri Date: Mon Jul 28 20:15:29 2014 +0200 - Fixed Length Constraint accelerator (D) to SHIFT+D to avoid colision with other higher level FreeCAD accelerator assignment. - Selection Accelerators now toggle on shortcut execution, and act when no other element is selected (fixed bug) TODO: Art+Toolbar commit 791358d046e8eeb03fa00272f5627c75254c48eb Author: Abdullah Tahiri Date: Mon Jul 28 15:12:07 2014 +0200 Fixing shortcut system: - Take shortcuts automatically from CommandManager. - Fixed two shortcuts in CommandConstraints (Point on Object - O and Parallel Constraint - P to SHIFT+O and SHIFT+P to avoid collision with other constraints) - Fixed shortcuts in CommandConstraintAccel to non-already-existing combinations - Fixed Sketcher Menu to show accelerators commit 12d366406a45038ce1a4f725a98e4f570475084b Author: Abdullah Tahiri Date: Mon Jul 28 11:53:37 2014 +0200 Implemented SHIFT multiple selection functionality in listwidget. commit 0606ea7dfe38fdf8924f65f14382f1b327145c80 Author: Abdullah Tahiri Date: Mon Jul 28 11:02:02 2014 +0200 Added Sketcher Accelerators for: - Selection of H Axis - V Axis - Origin Main TODO: Shortcuts and Shift in list widget implementation commit 297464807fc56fbcf31efadff9625fc05bb20c41 Author: Abdullah Tahiri Date: Wed Jul 23 11:37:21 2014 +0200 Implementation of: - Switch on 'Z' instead of 'Shift' - Checkbox to select whether element internal name (e.g. Edge10) should be presented on list or not (Sponssi requested) - Checkbox to force going back to "Edge" type on change from one element to the next (Sponssi requested) commit c8764b116acdcfdc7ef7658dc6009fb8db807906 Author: Abdullah Tahiri Date: Wed Jul 23 07:57:11 2014 +0200 TaskSketcher Elements: - Store Vertex within elements for optimization (reduce loops searching for vertex in every function call) - Added the accelerators described below + Toggle Construction as context menu commands - Fixed bug (Thanks sponssi!): After some element has been preselected from the list and the cursor moved to the drawing area, the preselection doesn't seem to be resetted in the widget or whereever it is handled. Tapping shift still swaps the preselection between the points of the previously selected element. The left mouse button has to be clicked in the draw area to get rid of this. http://forum.freecadweb.org/viewtopic.php?f=10&t=6861&sid=7eea4adc7ecf4cebd561b357601866a2&start=20 - Extended naming of elements, to facilitate writing python code (as requested by sponssi). - Minor modifications (creation of utility fuctions, code readibility, ...) Sketcher Workbench: - First effort to add a toolbar with the accelerators. Sketcher Accelerators: (Perform actions on existing elements, as opposed to Geometry Creation, not restricted to applying constraints) - Close Shape : of selected edges (i.e. lines and arcs) - Connect : selected edges (connect endpoint edge with starting point of next edge according to selection order) - Select Constraints : associated with currently selected edges commit 1dc18204a4e2e38f71d729a7692383f50a7d4654 Author: Abdullah Tahiri Date: Sat Jul 12 16:06:48 2014 +0200 New alternative implementation of the Sketch Element List. This version comprises: - Identification via icon of type of geometric element (Point, Arc, Line, Circle) and Type of selection (Edge, Starting Point, End Point, Center Point) - Corrected a bug where upon selection from the combobox, the icons were not updated (Thanks Jim!) - Implementation of jump to next valid type of last preselected element (aka fast-forward) for all the types. commit 4d472ef796362405c3982355f86489fa92cbfe6d Author: Abdullah Tahiri Date: Thu Jun 26 17:15:51 2014 +0200 Feature request by jmaustpc - When an object does not have an element, lets put a different icon. - Currently the constraint lock icon is used until availability of a new one. commit 6d15478f6533ff3805520a8ca36d1c41908cb0af Author: Abdullah Tahiri Date: Thu Jun 26 14:54:23 2014 +0200 Bug fix (preselection not disappearing on changing element without the element Type). commit e33043e17781fcf6399257696f115f68ab4580ec Author: Abdullah Tahiri Date: Thu Jun 26 14:39:20 2014 +0200 New nicer icons by jmaustpc. They look much nicer :-) commit 2ce2d6ff1ad2d81b0b1e30ffcbe9f2cc445f2e5b Author: Abdullah Tahiri Date: Thu Jun 26 14:37:21 2014 +0200 Fast-Forward functionality: - If an element not having "midpoint" is preselected, then on pressing SHIFT the Type will jump from EndPoint to Line skipping midpoint. - This is intended as a productivity feature, as most sketch elements usually are lines commit 1865d06d06582a49da10ddc123133807a4593060 Author: Abdullah Tahiri Date: Wed Jun 25 15:47:22 2014 +0200 Bug fix (thanks jmaustpc) - Preselection is maintained even though the geometric element does not have the "Type". - Fix involves calling for remove preselection in TaskSketcherElement - Implementing the response to the message RmvPreselection in ViewProviderSketch commit 14e21da4b4ed0e9a2b3e846a4e51f6745d5e0ab7 Author: Abdullah Tahiri Date: Mon Jun 23 14:25:35 2014 +0200 Fix Bug with null pointer (thanks jmaustpc!) Clean up code commit 0d99eb633f1bca45d4e7bb22c57bd4892767a390 Author: Abdullah Tahiri Date: Wed Jun 11 16:32:48 2014 +0200 New widget for the Taskbar of the Sketcher WB. The objectives of this widget are: 1. Allow editing of sketches when they have (partially) overlapping lines of any type (construction/external/normal). 2. Allow the construction of sketches using the keyboard (less mouse intensive) The widget works as follows: 1. A QListWidget presents a list of elements, element is here a geometric element formed Types edges, starting points, end points and midpoints (e.g. circles, arcs) 2. On hovering/Entering one item in the list, it is preselected for easy identification. 3. The selection can be switched from one type to another using the SHIFT key (press and release) in a round-robin fashion (or you can select it using the droplist) 4. Selection of different types is possible (e.g. two points and a line). 5. The contextual menu accessible by right click allow to apply a constraint to the selection. 6. The constraints in the contextual menu have shortcuts, so you can actually use the shortcut directly from the QListWidget. Additional features introduced to other parts during development... - New color introduced for Types that are selected and preselected at the same time - Edges is a SoLineSet. You can not apply many So modifiers (width,offset) to parts of a SoLineSet. An edge part of a SoLineSet that is drawn after another one, covers it unless it is closer to the camera. The system of manual offsets already in place for points has been extended to properly handle (i.e. show) overlapping lines part of a SoLineSet. --- src/Mod/Sketcher/App/SketchObject.cpp | 10 + src/Mod/Sketcher/App/SketchObject.h | 3 + src/Mod/Sketcher/Gui/AppSketcherGui.cpp | 2 + src/Mod/Sketcher/Gui/CMakeLists.txt | 6 + src/Mod/Sketcher/Gui/CommandConstraints.cpp | 32 +- src/Mod/Sketcher/Gui/CommandSketcherAccel.cpp | 448 ++++ src/Mod/Sketcher/Gui/Makefile.am | 5 + src/Mod/Sketcher/Gui/Resources/Makefile.am | 8 + src/Mod/Sketcher/Gui/Resources/Sketcher.qrc | 246 +- .../Resources/icons/Sketcher_CloseShape.svg | 1070 +++++++++ .../Resources/icons/Sketcher_ConnectLines.svg | 822 +++++++ .../icons/Sketcher_Element_Arc_Edge.svg | 275 +++ .../icons/Sketcher_Element_Arc_EndPoint.svg | 220 ++ .../icons/Sketcher_Element_Arc_MidPoint.svg | 214 ++ .../Sketcher_Element_Arc_StartingPoint.svg | 270 +++ .../icons/Sketcher_Element_Circle_Edge.svg | 123 + .../Sketcher_Element_Circle_MidPoint.svg | 145 ++ .../icons/Sketcher_Element_Line_Edge.svg | 234 ++ .../icons/Sketcher_Element_Line_EndPoint.svg | 254 ++ .../Sketcher_Element_Line_StartingPoint.svg | 279 +++ .../Sketcher_Element_Point_StartingPoint.svg | 162 ++ .../Sketcher_Element_SelectionTypeInvalid.svg | 530 +++++ .../icons/Sketcher_SelectConstraints.svg | 1684 ++++++++++++++ .../icons/Sketcher_SelectHorizontalAxis.svg | 1911 +++++++++++++++ .../Resources/icons/Sketcher_SelectOrigin.svg | 1755 ++++++++++++++ .../icons/Sketcher_SelectVerticalAxis.svg | 2066 +++++++++++++++++ .../icons/small/Sketcher_CloseShape.xpm | 207 ++ .../icons/small/Sketcher_ConnectLines.xpm | 161 ++ .../small/Sketcher_Element_Arc_Edge_sm.xpm | 105 + .../Sketcher_Element_Arc_EndPoint_sm.xpm | 95 + .../Sketcher_Element_Arc_MidPoint_sm.xpm | 91 + .../Sketcher_Element_Arc_StartingPoint_sm.xpm | 93 + .../small/Sketcher_Element_Circle_Edge_sm.xpm | 108 + .../Sketcher_Element_Circle_MidPoint_sm.xpm | 60 + .../small/Sketcher_Element_Line_Edge_sm.xpm | 97 + .../Sketcher_Element_Line_EndPoint_sm.xpm | 89 + ...Sketcher_Element_Line_StartingPoint_sm.xpm | 97 + ...ketcher_Element_Point_StartingPoint_sm.xpm | 49 + ...etcher_Element_SelectionTypeInvalid_sm.xpm | 93 + .../small/Sketcher_SelectConstraints.xpm | 101 + .../small/Sketcher_SelectHorizontalAxis.xpm | 49 + .../icons/small/Sketcher_SelectOrigin.xpm | 65 + .../small/Sketcher_SelectVerticalAxis.xpm | 51 + src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp | 2 + src/Mod/Sketcher/Gui/TaskDlgEditSketch.h | 2 + src/Mod/Sketcher/Gui/TaskSketcherElements.cpp | 809 +++++++ src/Mod/Sketcher/Gui/TaskSketcherElements.h | 134 ++ src/Mod/Sketcher/Gui/TaskSketcherElements.ui | 109 + src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 135 +- src/Mod/Sketcher/Gui/ViewProviderSketch.h | 5 + src/Mod/Sketcher/Gui/Workbench.cpp | 36 +- src/Mod/Sketcher/Gui/Workbench.h | 2 + 52 files changed, 15489 insertions(+), 130 deletions(-) create mode 100644 src/Mod/Sketcher/Gui/CommandSketcherAccel.cpp create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CloseShape.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConnectLines.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_Edge.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_EndPoint.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_MidPoint.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_StartingPoint.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_Edge.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_MidPoint.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_Edge.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_EndPoint.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_StartingPoint.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Point_StartingPoint.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_SelectionTypeInvalid.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConstraints.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectHorizontalAxis.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectOrigin.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectVerticalAxis.svg create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_CloseShape.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_ConnectLines.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_Edge_sm.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_EndPoint_sm.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_MidPoint_sm.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_StartingPoint_sm.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Circle_Edge_sm.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Circle_MidPoint_sm.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Line_Edge_sm.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Line_EndPoint_sm.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Line_StartingPoint_sm.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Point_StartingPoint_sm.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_SelectionTypeInvalid_sm.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_SelectConstraints.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_SelectHorizontalAxis.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_SelectOrigin.xpm create mode 100644 src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_SelectVerticalAxis.xpm create mode 100644 src/Mod/Sketcher/Gui/TaskSketcherElements.cpp create mode 100644 src/Mod/Sketcher/Gui/TaskSketcherElements.h create mode 100644 src/Mod/Sketcher/Gui/TaskSketcherElements.ui diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 7c0f8509c..4976a9d18 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -1631,6 +1631,16 @@ void SketchObject::getGeoVertexIndex(int VertexId, int &GeoId, PointPos &PosId) PosId = VertexId2PosId[VertexId]; } +int SketchObject::getVertexIndexGeoPos(int GeoId, PointPos PosId) const +{ + + for(int i=0;i &GeoIdList, diff --git a/src/Mod/Sketcher/Gui/AppSketcherGui.cpp b/src/Mod/Sketcher/Gui/AppSketcherGui.cpp index a739717c8..2a2a26e25 100644 --- a/src/Mod/Sketcher/Gui/AppSketcherGui.cpp +++ b/src/Mod/Sketcher/Gui/AppSketcherGui.cpp @@ -42,6 +42,7 @@ void CreateSketcherCommands(void); void CreateSketcherCommandsCreateGeo(void); void CreateSketcherCommandsConstraints(void); +void CreateSketcherCommandsConstraintAccel(void); void CreateSketcherCommandsAlterGeo(void); void loadSketcherResource() @@ -80,6 +81,7 @@ void SketcherGuiExport initSketcherGui() CreateSketcherCommandsCreateGeo(); CreateSketcherCommandsConstraints(); CreateSketcherCommandsAlterGeo(); + CreateSketcherCommandsConstraintAccel(); SketcherGui::Workbench::init(); diff --git a/src/Mod/Sketcher/Gui/CMakeLists.txt b/src/Mod/Sketcher/Gui/CMakeLists.txt index 9a7155650..cfbcb4e0f 100644 --- a/src/Mod/Sketcher/Gui/CMakeLists.txt +++ b/src/Mod/Sketcher/Gui/CMakeLists.txt @@ -29,6 +29,7 @@ set(SketcherGui_LIBS set(SketcherGui_MOC_HDRS TaskSketcherConstrains.h + TaskSketcherElements.h TaskSketcherCreateCommands.h TaskSketcherGeneral.h TaskSketcherMessages.h @@ -44,6 +45,7 @@ qt4_add_resources(SketcherGui_SRCS Resources/Sketcher.qrc) set(SketcherGui_UIC_SRCS TaskSketcherConstrains.ui + TaskSketcherElements.ui TaskSketcherGeneral.ui TaskSketcherMessages.ui TaskSketcherValidation.ui @@ -61,6 +63,7 @@ SET(SketcherGui_SRCS Command.cpp CommandCreateGeo.cpp CommandConstraints.cpp + CommandSketcherAccel.cpp CommandAlterGeometry.cpp Resources/Sketcher.qrc PreCompiled.cpp @@ -72,6 +75,9 @@ SET(SketcherGui_SRCS TaskSketcherConstrains.ui TaskSketcherConstrains.cpp TaskSketcherConstrains.h + TaskSketcherElements.ui + TaskSketcherElements.cpp + TaskSketcherElements.h TaskSketcherCreateCommands.cpp TaskSketcherCreateCommands.h TaskSketcherGeneral.ui diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 65f55f297..4e209ed53 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -528,7 +528,8 @@ void CmdSketcherConstrainCoincident::activated(int iMsg) // get the needed lists and objects const std::vector &SubNames = selection[0].getSubNames(); Sketcher::SketchObject* Obj = dynamic_cast(selection[0].getObject()); - + const std::vector< Sketcher::Constraint * > &vals = Obj->Constraints.getValues(); + if (SubNames.size() < 2) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), QObject::tr("Select two or more vertexes from the sketch.")); @@ -554,9 +555,26 @@ void CmdSketcherConstrainCoincident::activated(int iMsg) openCommand("add coincident constraint"); for (std::size_t i=1; i::const_iterator it= vals.begin(); + it != vals.end(); ++it) { + if ( (*it)->Type == Sketcher::Coincident && + ( (*it)->First == GeoId1 && (*it)->FirstPos == PosId1 && + (*it)->Second == GeoId2 && (*it)->SecondPos == PosId2 ) || + ( (*it)->First == GeoId2 && (*it)->FirstPos == PosId2 && + (*it)->Second == GeoId1 && (*it)->SecondPos == PosId1 ) ) { + constraintExists=true; + break; + } + } + + if (!constraintExists) + Gui::Command::doCommand( + Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Coincident',%d,%d,%d,%d)) ", + selection[0].getFeatName(),GeoId1,PosId1,GeoId2,PosId2); } // finish the transaction and update @@ -585,7 +603,7 @@ CmdSketcherConstrainDistance::CmdSketcherConstrainDistance() sWhatsThis = sToolTipText; sStatusTip = sToolTipText; sPixmap = "Constraint_Length"; - sAccel = "D"; + sAccel = "SHIFT+D"; eType = ForEdit; } @@ -732,7 +750,7 @@ CmdSketcherConstrainPointOnObject::CmdSketcherConstrainPointOnObject() sWhatsThis = sToolTipText; sStatusTip = sToolTipText; sPixmap = "Constraint_PointOnObject"; - sAccel = "O"; + sAccel = "SHIFT+O"; eType = ForEdit; } @@ -1080,7 +1098,7 @@ CmdSketcherConstrainParallel::CmdSketcherConstrainParallel() sWhatsThis = sToolTipText; sStatusTip = sToolTipText; sPixmap = "Constraint_Parallel"; - sAccel = "P"; + sAccel = "SHIFT+P"; eType = ForEdit; } diff --git a/src/Mod/Sketcher/Gui/CommandSketcherAccel.cpp b/src/Mod/Sketcher/Gui/CommandSketcherAccel.cpp new file mode 100644 index 000000000..a85a028ea --- /dev/null +++ b/src/Mod/Sketcher/Gui/CommandSketcherAccel.cpp @@ -0,0 +1,448 @@ +/*************************************************************************** + * Copyright (c) 2014 Abdullah Tahiri +# include +# include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "ViewProviderSketch.h" + +using namespace std; +using namespace SketcherGui; +using namespace Sketcher; + +bool isSketcherAcceleratorActive(Gui::Document *doc, bool actsOnSelection ) +{ + if (doc) + // checks if a Sketch Viewprovider is in Edit and is in no special mode + if (doc->getInEdit() && doc->getInEdit()->isDerivedFrom(SketcherGui::ViewProviderSketch::getClassTypeId())) + if (dynamic_cast(doc->getInEdit()) + ->getSketchMode() == ViewProviderSketch::STATUS_NONE) + if (!actsOnSelection) + return true; + else{ + if(Gui::Selection().countObjectsOfType(Sketcher::SketchObject::getClassTypeId()) > 0) + return true; + } + + return false; +} + +// Close Shape Command +DEF_STD_CMD_A(CmdSketcherCloseShape); + +CmdSketcherCloseShape::CmdSketcherCloseShape() + :Command("Sketcher_CloseShape") +{ + sAppModule = "Sketcher"; + sGroup = QT_TR_NOOP("Sketcher"); + sMenuText = QT_TR_NOOP("Close Shape"); + sToolTipText = QT_TR_NOOP("Produce closed shape by Link end point of element with next elements' starting point"); + sWhatsThis = sToolTipText; + sStatusTip = sToolTipText; + sPixmap = "Sketcher_CloseShape"; + sAccel = "CTRL+SHIFT+S"; + eType = ForEdit; +} + +void CmdSketcherCloseShape::activated(int iMsg) +{ + // 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 an edge from the sketch.")); + return; + } + + // get the needed lists and objects + const std::vector &SubNames = selection[0].getSubNames(); + Sketcher::SketchObject* Obj = dynamic_cast(selection[0].getObject()); + + int GeoIdFirst=-1; + int GeoIdLast=-1; + + // go through the selected subelements + for (unsigned int i=0; i<(SubNames.size()-1); i++ ) { + // only handle edges + if (SubNames[i].size() > 4 && SubNames[i].substr(0,4) == "Edge" && + SubNames[i+1].size() > 4 && SubNames[i+1].substr(0,4) == "Edge" ) { + + int GeoId1 = std::atoi(SubNames[i].substr(4,4000).c_str()) - 1; + int GeoId2 = std::atoi(SubNames[i+1].substr(4,4000).c_str()) - 1; + + if(GeoIdFirst==-1) + GeoIdFirst=GeoId1; + + GeoIdLast=GeoId2; + + const Part::Geometry *geo1 = Obj->getGeometry(GeoId1); + const Part::Geometry *geo2 = Obj->getGeometry(GeoId2); + if ( (geo1->getTypeId() != Part::GeomLineSegment::getClassTypeId() && + geo1->getTypeId() != Part::GeomArcOfCircle::getClassTypeId() ) || + (geo2->getTypeId() != Part::GeomLineSegment::getClassTypeId() && + geo2->getTypeId() != Part::GeomArcOfCircle::getClassTypeId()) ) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), + QObject::tr("One selected edge is not connectable")); + return; + } + + // undo command open + openCommand("add coincident constraint"); + Gui::Command::doCommand( + Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Coincident',%d,%d,%d,%d)) ", + selection[0].getFeatName(),GeoId1,Sketcher::end,GeoId2,Sketcher::start); + + // finish the transaction and update + commitCommand(); + + + } + } + + // Close Last Edge with First Edge + // undo command open + openCommand("add coincident constraint"); + Gui::Command::doCommand( + Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Coincident',%d,%d,%d,%d)) ", + selection[0].getFeatName(),GeoIdLast,Sketcher::end,GeoIdFirst,Sketcher::start); + + // finish the transaction and update + commitCommand(); + + updateActive(); + + // clear the selection (convenience) + getSelection().clearSelection(); +} + +bool CmdSketcherCloseShape::isActive(void) +{ + return isSketcherAcceleratorActive( getActiveGuiDocument(), true ); +} + + +// Connect Edges Command +DEF_STD_CMD_A(CmdSketcherConnect); + +CmdSketcherConnect::CmdSketcherConnect() + :Command("Sketcher_ConnectLines") +{ + sAppModule = "Sketcher"; + sGroup = QT_TR_NOOP("Sketcher"); + sMenuText = QT_TR_NOOP("Connect Edges"); + sToolTipText = QT_TR_NOOP("Link end point of element with next elements' starting point"); + sWhatsThis = sToolTipText; + sStatusTip = sToolTipText; + sPixmap = "Sketcher_ConnectLines"; + sAccel = "CTRL+SHIFT+K"; + eType = ForEdit; +} + +void CmdSketcherConnect::activated(int iMsg) +{ + // 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 an edge from the sketch.")); + return; + } + + // get the needed lists and objects + const std::vector &SubNames = selection[0].getSubNames(); + Sketcher::SketchObject* Obj = dynamic_cast(selection[0].getObject()); + + // go through the selected subelements + for (unsigned int i=0; i<(SubNames.size()-1); i++ ) { + // only handle edges + if (SubNames[i].size() > 4 && SubNames[i].substr(0,4) == "Edge" && + SubNames[i+1].size() > 4 && SubNames[i+1].substr(0,4) == "Edge" ) { + + int GeoId1 = std::atoi(SubNames[i].substr(4,4000).c_str()) - 1; + int GeoId2 = std::atoi(SubNames[i+1].substr(4,4000).c_str()) - 1; + + const Part::Geometry *geo1 = Obj->getGeometry(GeoId1); + const Part::Geometry *geo2 = Obj->getGeometry(GeoId2); + if ( (geo1->getTypeId() != Part::GeomLineSegment::getClassTypeId() && + geo1->getTypeId() != Part::GeomArcOfCircle::getClassTypeId() ) || + (geo2->getTypeId() != Part::GeomLineSegment::getClassTypeId() && + geo2->getTypeId() != Part::GeomArcOfCircle::getClassTypeId()) ) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), + QObject::tr("One selected edge is not connectable")); + return; + } + + // undo command open + openCommand("add coincident constraint"); + Gui::Command::doCommand( + Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Coincident',%d,%d,%d,%d)) ", + selection[0].getFeatName(),GeoId1,Sketcher::end,GeoId2,Sketcher::start); + + // finish the transaction and update + commitCommand(); + + + } + } + + updateActive(); + + // clear the selection (convenience) + getSelection().clearSelection(); +} + +bool CmdSketcherConnect::isActive(void) +{ + return isSketcherAcceleratorActive( getActiveGuiDocument(), true ); +} + +// Select Constraints of selected elements +DEF_STD_CMD_A(CmdSketcherSelectConstraints); + +CmdSketcherSelectConstraints::CmdSketcherSelectConstraints() + :Command("Sketcher_SelectConstraints") +{ + sAppModule = "Sketcher"; + sGroup = QT_TR_NOOP("Sketcher"); + sMenuText = QT_TR_NOOP("Select Constraints"); + sToolTipText = QT_TR_NOOP("Select the constraints associated to the selected elements"); + sWhatsThis = sToolTipText; + sStatusTip = sToolTipText; + sPixmap = "Sketcher_SelectConstraints"; + sAccel = "CTRL+SHIFT+C"; + eType = ForEdit; +} + +void CmdSketcherSelectConstraints::activated(int iMsg) +{ + // get the selection + std::vector selection = getSelection().getSelectionEx(); + Sketcher::SketchObject* Obj = dynamic_cast(selection[0].getObject()); + + // 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 elements from a single sketch.")); + return; + } + + // get the needed lists and objects + const std::vector &SubNames = selection[0].getSubNames(); + const std::vector< Sketcher::Constraint * > &vals = Obj->Constraints.getValues(); + + std::string doc_name = Obj->getDocument()->getName(); + std::string obj_name = Obj->getNameInDocument(); + std::stringstream ss; + + getSelection().clearSelection(); + + // go through the selected subelements + for (std::vector::const_iterator it=SubNames.begin(); it != SubNames.end(); ++it) { + // only handle edges + if (it->size() > 4 && it->substr(0,4) == "Edge") { + int GeoId = std::atoi(it->substr(4,4000).c_str()) - 1; + + // push all the constraints + int i=1; + for (std::vector< Sketcher::Constraint * >::const_iterator it= vals.begin(); + it != vals.end(); ++it,++i) { + if ( (*it)->First == GeoId || (*it)->Second == GeoId || (*it)->Third == GeoId){ + ss.str(std::string()); + ss << "Constraint" << i; + Gui::Selection().addSelection(doc_name.c_str(), obj_name.c_str(), ss.str().c_str()); + } + } + } + } + +} + +bool CmdSketcherSelectConstraints::isActive(void) +{ + return isSketcherAcceleratorActive( getActiveGuiDocument(), true ); +} + +// Select Origin +DEF_STD_CMD_A(CmdSketcherSelectOrigin); + +CmdSketcherSelectOrigin::CmdSketcherSelectOrigin() + :Command("Sketcher_SelectOrigin") +{ + sAppModule = "Sketcher"; + sGroup = QT_TR_NOOP("Sketcher"); + sMenuText = QT_TR_NOOP("Select Origin"); + sToolTipText = QT_TR_NOOP("Select the origin point"); + sWhatsThis = sToolTipText; + sStatusTip = sToolTipText; + sPixmap = "Sketcher_SelectOrigin"; + sAccel = "CTRL+SHIFT+O"; + eType = ForEdit; +} + +void CmdSketcherSelectOrigin::activated(int iMsg) +{ + Gui::Document * doc= getActiveGuiDocument(); + + SketcherGui::ViewProviderSketch* vp = dynamic_cast(doc->getInEdit()); + + Sketcher::SketchObject* Obj= vp->getSketchObject(); + +// ViewProviderSketch * vp = static_cast(Gui::Application::Instance->getViewProvider(docobj)); + +// Sketcher::SketchObject* Obj = vp->getSketchObject(); + + std::string doc_name = Obj->getDocument()->getName(); + std::string obj_name = Obj->getNameInDocument(); + std::stringstream ss; + + ss << "RootPoint"; + + if(Gui::Selection().isSelected(doc_name.c_str(), obj_name.c_str(), ss.str().c_str())) + Gui::Selection().rmvSelection(doc_name.c_str(), obj_name.c_str(), ss.str().c_str()); + else + Gui::Selection().addSelection(doc_name.c_str(), obj_name.c_str(), ss.str().c_str()); + +} + +bool CmdSketcherSelectOrigin::isActive(void) +{ + return isSketcherAcceleratorActive( getActiveGuiDocument(), false ); +} + +// Select Vertical Axis +DEF_STD_CMD_A(CmdSketcherSelectVerticalAxis); + +CmdSketcherSelectVerticalAxis::CmdSketcherSelectVerticalAxis() + :Command("Sketcher_SelectVerticalAxis") +{ + sAppModule = "Sketcher"; + sGroup = QT_TR_NOOP("Sketcher"); + sMenuText = QT_TR_NOOP("Select Vertical Axis"); + sToolTipText = QT_TR_NOOP("Select the vertical axis"); + sWhatsThis = sToolTipText; + sStatusTip = sToolTipText; + sPixmap = "Sketcher_SelectVerticalAxis"; + sAccel = "CTRL+SHIFT+V"; + eType = ForEdit; +} + +void CmdSketcherSelectVerticalAxis::activated(int iMsg) +{ + Gui::Document * doc= getActiveGuiDocument(); + + SketcherGui::ViewProviderSketch* vp = dynamic_cast(doc->getInEdit()); + + Sketcher::SketchObject* Obj= vp->getSketchObject(); + + std::string doc_name = Obj->getDocument()->getName(); + std::string obj_name = Obj->getNameInDocument(); + std::stringstream ss; + + ss << "V_Axis"; + + if(Gui::Selection().isSelected(doc_name.c_str(), obj_name.c_str(), ss.str().c_str())) + Gui::Selection().rmvSelection(doc_name.c_str(), obj_name.c_str(), ss.str().c_str()); + else + Gui::Selection().addSelection(doc_name.c_str(), obj_name.c_str(), ss.str().c_str()); + +} + +bool CmdSketcherSelectVerticalAxis::isActive(void) +{ + return isSketcherAcceleratorActive( getActiveGuiDocument(), false ); +} + +// Select Horizontal Axis +DEF_STD_CMD_A(CmdSketcherSelectHorizontalAxis); + +CmdSketcherSelectHorizontalAxis::CmdSketcherSelectHorizontalAxis() + :Command("Sketcher_SelectHorizontalAxis") +{ + sAppModule = "Sketcher"; + sGroup = QT_TR_NOOP("Sketcher"); + sMenuText = QT_TR_NOOP("Select Horizontal Axis"); + sToolTipText = QT_TR_NOOP("Select the horizontal axis"); + sWhatsThis = sToolTipText; + sStatusTip = sToolTipText; + sPixmap = "Sketcher_SelectHorizontalAxis"; + sAccel = "CTRL+SHIFT+H"; + eType = ForEdit; +} + +void CmdSketcherSelectHorizontalAxis::activated(int iMsg) +{ + Gui::Document * doc= getActiveGuiDocument(); + + SketcherGui::ViewProviderSketch* vp = dynamic_cast(doc->getInEdit()); + + Sketcher::SketchObject* Obj= vp->getSketchObject(); + + std::string doc_name = Obj->getDocument()->getName(); + std::string obj_name = Obj->getNameInDocument(); + std::stringstream ss; + + ss << "H_Axis"; + + if(Gui::Selection().isSelected(doc_name.c_str(), obj_name.c_str(), ss.str().c_str())) + Gui::Selection().rmvSelection(doc_name.c_str(), obj_name.c_str(), ss.str().c_str()); + else + Gui::Selection().addSelection(doc_name.c_str(), obj_name.c_str(), ss.str().c_str()); + +} + +bool CmdSketcherSelectHorizontalAxis::isActive(void) +{ + return isSketcherAcceleratorActive( getActiveGuiDocument(), false ); +} + +// Add Accelerator Commands +void CreateSketcherCommandsConstraintAccel(void) +{ + Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager(); + + rcCmdMgr.addCommand(new CmdSketcherCloseShape()); + rcCmdMgr.addCommand(new CmdSketcherConnect()); + rcCmdMgr.addCommand(new CmdSketcherSelectConstraints()); + rcCmdMgr.addCommand(new CmdSketcherSelectOrigin()); + rcCmdMgr.addCommand(new CmdSketcherSelectVerticalAxis()); + rcCmdMgr.addCommand(new CmdSketcherSelectHorizontalAxis()); +} diff --git a/src/Mod/Sketcher/Gui/Makefile.am b/src/Mod/Sketcher/Gui/Makefile.am index b18b16032..2eebddb69 100644 --- a/src/Mod/Sketcher/Gui/Makefile.am +++ b/src/Mod/Sketcher/Gui/Makefile.am @@ -5,6 +5,7 @@ lib_LTLIBRARIES=libSketcherGui.la SketcherGui.la BUILT_SOURCES=\ moc_SketchOrientationDialog.cpp \ moc_TaskSketcherConstrains.cpp \ + moc_TaskSketcherElements.cpp \ moc_TaskSketcherCreateCommands.cpp \ moc_TaskSketcherGeneral.cpp \ moc_TaskSketcherMessages.cpp \ @@ -12,6 +13,7 @@ BUILT_SOURCES=\ ui_InsertDatum.h \ ui_SketchOrientationDialog.h \ ui_TaskSketcherConstrains.h \ + ui_TaskSketcherElements.h \ ui_TaskSketcherGeneral.h \ ui_TaskSketcherMessages.h @@ -19,6 +21,7 @@ libSketcherGui_la_UI=\ InsertDatum.ui \ SketchOrientationDialog.ui \ TaskSketcherConstrains.ui \ + TaskSketcherElements.ui \ TaskSketcherGeneral.ui \ TaskSketcherMessages.ui @@ -36,6 +39,8 @@ libSketcherGui_la_SOURCES=\ SoZoomTranslation.h \ TaskSketcherConstrains.cpp \ TaskSketcherConstrains.h \ + TaskSketcherElements.cpp \ + TaskSketcherElements.h \ TaskSketcherCreateCommands.cpp \ TaskSketcherCreateCommands.h \ TaskSketcherGeneral.cpp \ diff --git a/src/Mod/Sketcher/Gui/Resources/Makefile.am b/src/Mod/Sketcher/Gui/Resources/Makefile.am index b5db31a24..dad78c9b4 100644 --- a/src/Mod/Sketcher/Gui/Resources/Makefile.am +++ b/src/Mod/Sketcher/Gui/Resources/Makefile.am @@ -78,6 +78,14 @@ icons/Constraint_PointOnObject.svg \ icons/Sketcher_NewSketch.svg \ icons/Sketcher_ViewSketch.svg \ icons/Sketcher_Sketch.svg \ + icons/Sketcher_Element_EndPoint.svg \ + icons/Sketcher_Element_Line.svg \ + icons/Sketcher_Element_MidPoint.svg \ + icons/Sketcher_Element_StartingPoint.svg \ + icons/small/Sketcher_Element_EndPoint_sm.xpm \ + icons/small/Sketcher_Element_Line_sm.xpm \ + icons/small/Sketcher_Element_MidPoint_sm.xpm \ + icons/small/Sketcher_Element_StartingPoint_sm.xpm \ translations/Sketcher_af.qm \ translations/Sketcher_af.ts \ translations/Sketcher_de.qm \ diff --git a/src/Mod/Sketcher/Gui/Resources/Sketcher.qrc b/src/Mod/Sketcher/Gui/Resources/Sketcher.qrc index 13a030d32..156222705 100644 --- a/src/Mod/Sketcher/Gui/Resources/Sketcher.qrc +++ b/src/Mod/Sketcher/Gui/Resources/Sketcher.qrc @@ -1,105 +1,141 @@ - - - icons/small/Constraint_Concentric_sm.xpm - icons/small/Constraint_EqualLength_sm.xpm - icons/small/Constraint_ExternalAngle_sm.xpm - icons/small/Constraint_Horizontal_sm.xpm - icons/small/Constraint_InternalAngle_sm.xpm - icons/small/Constraint_Length_sm.xpm - icons/small/Constraint_Parallel_sm.xpm - icons/small/Constraint_Perpendicular_sm.xpm - icons/small/Constraint_PointOnEnd_sm.xpm - icons/small/Constraint_PointOnMidPoint_sm.xpm - icons/small/Constraint_PointOnObject_sm.xpm - icons/small/Constraint_PointOnPoint_sm.xpm - icons/small/Constraint_PointOnStart_sm.xpm - icons/small/Constraint_PointToObject_sm.xpm - icons/small/Constraint_Radius_sm.xpm - icons/small/Constraint_Tangent_sm.xpm - icons/small/Constraint_TangentToEnd_sm.xpm - icons/small/Constraint_TangentToStart_sm.xpm - icons/small/Constraint_Vertical_sm.xpm - icons/small/Constraint_HorizontalDistance_sm.xpm - icons/small/Constraint_VerticalDistance_sm.xpm - icons/small/Constraint_Symmetric_sm.xpm - icons/Constraint_Concentric.svg - icons/Constraint_EqualLength.svg - icons/Constraint_ExternalAngle.svg - icons/Constraint_Horizontal.svg - icons/Constraint_InternalAngle.svg - icons/Constraint_Length.svg - icons/Constraint_Parallel.svg - icons/Constraint_Perpendicular.svg - icons/Constraint_PointOnEnd.svg - icons/Constraint_PointOnMidPoint.svg - icons/Constraint_PointOnObject.svg - icons/Constraint_PointOnPoint.svg - icons/Constraint_PointOnStart.svg - icons/Constraint_PointToObject.svg - icons/Constraint_Radius.svg - icons/Constraint_Tangent.svg - icons/Constraint_TangentToEnd.svg - icons/Constraint_TangentToStart.svg - icons/Constraint_Vertical.svg - icons/Constraint_HorizontalDistance.svg - icons/Constraint_VerticalDistance.svg - icons/Constraint_Symmetric.svg - icons/Sketcher_ConstrainCoincident.svg - icons/Sketcher_ConstrainDistance.svg - icons/Sketcher_ConstrainHorizontal.svg - icons/Sketcher_ConstrainLock.svg - icons/Sketcher_ConstrainParallel.svg - icons/Sketcher_ConstrainVertical.svg - icons/Sketcher_CreateArc.svg - icons/Sketcher_Create3PointArc.svg - icons/Sketcher_CreateCircle.svg - icons/Sketcher_Create3PointCircle.svg - icons/Sketcher_CreateLine.svg - icons/Sketcher_CreatePoint.svg - icons/Sketcher_CreatePolyline.svg - icons/Sketcher_CreateRectangle.svg - icons/Sketcher_CreateSlot.svg - icons/Sketcher_CreateFillet.svg - icons/Sketcher_CreateTriangle.svg - icons/Sketcher_CreateSquare.svg - icons/Sketcher_CreatePentagon.svg - icons/Sketcher_CreateHexagon.svg - icons/Sketcher_CreateHeptagon.svg - icons/Sketcher_CreateOctagon.svg - icons/Sketcher_CreateText.svg - icons/Sketcher_DraftLine.svg - icons/Sketcher_Trimming.svg - icons/Sketcher_External.svg - icons/Sketcher_EditSketch.svg - icons/Sketcher_LeaveSketch.svg - icons/Sketcher_MapSketch.svg - icons/Sketcher_NewSketch.svg - icons/Sketcher_Sketch.svg - icons/Sketcher_ViewSketch.svg - icons/Sketcher_AlterConstruction.svg - icons/Sketcher_ProfilesHexagon1.svg - translations/Sketcher_af.qm - translations/Sketcher_de.qm - translations/Sketcher_fi.qm - translations/Sketcher_fr.qm - translations/Sketcher_hr.qm - translations/Sketcher_it.qm - translations/Sketcher_nl.qm - translations/Sketcher_no.qm - translations/Sketcher_pl.qm - translations/Sketcher_ru.qm - translations/Sketcher_uk.qm - translations/Sketcher_tr.qm - translations/Sketcher_sv-SE.qm - translations/Sketcher_zh-TW.qm - translations/Sketcher_pt-BR.qm - translations/Sketcher_cs.qm - translations/Sketcher_sk.qm - translations/Sketcher_es-ES.qm - translations/Sketcher_zh-CN.qm - translations/Sketcher_ja.qm - translations/Sketcher_ro.qm - translations/Sketcher_hu.qm - translations/Sketcher_pt-PT.qm - - + + + icons/Constraint_TangentToStart.svg + icons/Sketcher_CreateFillet.svg + icons/Sketcher_CreateLine.svg + icons/Sketcher_SelectConstraints.svg + icons/Sketcher_CreateArc.svg + icons/Sketcher_CreateCircle.svg + icons/Sketcher_CreateSlot.svg + icons/Sketcher_CloseShape.svg + icons/Constraint_PointOnPoint.svg + icons/Sketcher_Sketch.svg + icons/Sketcher_Element_Circle_Edge.svg + icons/Sketcher_Element_Line_EndPoint.svg + icons/Sketcher_DraftLine.svg + icons/Sketcher_External.svg + icons/Sketcher_Element_Line_StartingPoint.svg + icons/Sketcher_ConstrainDistance.svg + icons/Sketcher_LeaveSketch.svg + icons/Sketcher_AlterFillet.svg + icons/Sketcher_CreateHexagon.svg + icons/Sketcher_Create3PointArc.svg + icons/Sketcher_SelectHorizontalAxis.svg + icons/Sketcher_ConstrainParallel.svg + icons/Sketcher_ConnectLines.svg + icons/Sketcher_SelectVerticalAxis.svg + icons/Sketcher_Element_Arc_MidPoint.svg + icons/Constraint_Parallel.svg + icons/Constraint_Concentric.svg + icons/Sketcher_ProfilesHexagon1.svg + icons/Sketcher_ConstrainHorizontal.svg + icons/Constraint_InternalAngle.svg + icons/Constraint_PointOnStart.svg + icons/Sketcher_ConstrainCoincident.svg + icons/Constraint_PointOnEnd.svg + icons/Sketcher_CreateText.svg + icons/Sketcher_Element_Circle_MidPoint.svg + icons/Sketcher_MapSketch.svg + icons/Constraint_PointOnObject.svg + icons/Constraint_PointOnMidPoint.svg + icons/Sketcher_NewSketch.svg + icons/Sketcher_ConstrainLock.svg + icons/Constraint_Perpendicular.svg + icons/Constraint_Symmetric.svg + icons/Constraint_PointToObject.svg + icons/Sketcher_CreateHeptagon.svg + icons/Sketcher_Trimming.svg + icons/Sketcher_Element_Arc_Edge.svg + icons/Sketcher_CreateTriangle.svg + icons/Sketcher_Element_Arc_StartingPoint.svg + icons/Sketcher_Element_Line_Edge.svg + icons/Constraint_EqualLength.svg + icons/Sketcher_CreateRectangle.svg + icons/Constraint_ExternalAngle.svg + icons/Constraint_Length.svg + icons/Sketcher_EditSketch.svg + icons/Constraint_Vertical.svg + icons/Constraint_TangentToEnd.svg + icons/Constraint_VerticalDistance.svg + icons/Sketcher_CreateOctagon.svg + icons/Sketcher_CreatePoint.svg + icons/Constraint_Horizontal.svg + icons/Sketcher_CreatePentagon.svg + icons/Sketcher_ConstrainVertical.svg + icons/Sketcher_Element_Arc_EndPoint.svg + icons/Sketcher_AlterConstruction.svg + icons/Constraint_HorizontalDistance.svg + icons/Sketcher_CreateSquare.svg + icons/Constraint_Radius.svg + icons/Sketcher_ViewSketch.svg + icons/Sketcher_Element_Point_StartingPoint.svg + icons/Sketcher_Create3PointCircle.svg + icons/Sketcher_SelectOrigin.svg + icons/Sketcher_Element_SelectionTypeInvalid.svg + icons/Constraint_Tangent.svg + icons/Sketcher_CreatePolyline.svg + icons/small/Constraint_Radius_sm.xpm + icons/small/Constraint_HorizontalDistance_sm.xpm + icons/small/Constraint_PointOnEnd_sm.xpm + icons/small/Sketcher_Element_Line_EndPoint_sm.xpm + icons/small/Sketcher_ConnectLines.xpm + icons/small/Constraint_PointToObject_sm.xpm + icons/small/Sketcher_Element_Arc_Edge_sm.xpm + icons/small/Sketcher_SelectHorizontalAxis.xpm + icons/small/Sketcher_Element_Line_Edge_sm.xpm + icons/small/Constraint_Parallel_sm.xpm + icons/small/Constraint_InternalAngle_sm.xpm + icons/small/Sketcher_Element_Arc_EndPoint_sm.xpm + icons/small/Constraint_PointOnPoint_sm.xpm + icons/small/Sketcher_SelectVerticalAxis.xpm + icons/small/Constraint_VerticalDistance_sm.xpm + icons/small/Constraint_Length_sm.xpm + icons/small/Constraint_PointOnStart_sm.xpm + icons/small/Constraint_PointOnObject_sm.xpm + icons/small/Sketcher_Element_SelectionTypeInvalid_sm.xpm + icons/small/Constraint_Concentric_sm.xpm + icons/small/Constraint_Perpendicular_sm.xpm + icons/small/Constraint_PointOnMidPoint_sm.xpm + icons/small/Constraint_Lock_sm.xpm + icons/small/Constraint_ExternalAngle_sm.xpm + icons/small/Sketcher_CloseShape.xpm + icons/small/Sketcher_Element_Point_StartingPoint_sm.xpm + icons/small/Constraint_Horizontal_sm.xpm + icons/small/Sketcher_Element_Circle_MidPoint_sm.xpm + icons/small/Constraint_TangentToStart_sm.xpm + icons/small/Sketcher_Element_Arc_StartingPoint_sm.xpm + icons/small/Constraint_EqualLength_sm.xpm + icons/small/Sketcher_SelectOrigin.xpm + icons/small/Sketcher_Element_Circle_Edge_sm.xpm + icons/small/Constraint_TangentToEnd_sm.xpm + icons/small/Constraint_Symmetric_sm.xpm + icons/small/Sketcher_Element_Arc_MidPoint_sm.xpm + icons/small/Sketcher_SelectConstraints.xpm + icons/small/Sketcher_Element_Line_StartingPoint_sm.xpm + icons/small/Constraint_Vertical_sm.xpm + icons/small/Constraint_Tangent_sm.xpm + translations/Sketcher_es-ES.qm + translations/Sketcher_nl.qm + translations/Sketcher_uk.qm + translations/Sketcher_sv-SE.qm + translations/Sketcher_de.qm + translations/Sketcher_it.qm + translations/Sketcher_pl.qm + translations/Sketcher_fi.qm + translations/Sketcher_tr.qm + translations/Sketcher_ru.qm + translations/Sketcher_fr.qm + translations/Sketcher_hr.qm + translations/Sketcher_af.qm + translations/Sketcher_no.qm + translations/Sketcher_zh-TW.qm + translations/Sketcher_zh-CN.qm + translations/Sketcher_ro.qm + translations/Sketcher_ja.qm + translations/Sketcher_pt-BR.qm + translations/Sketcher_sk.qm + translations/Sketcher_hu.qm + translations/Sketcher_cs.qm + translations/Sketcher_pt-PT.qm + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CloseShape.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CloseShape.svg new file mode 100644 index 000000000..4b171fc15 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CloseShape.svg @@ -0,0 +1,1070 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConnectLines.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConnectLines.svg new file mode 100644 index 000000000..6f58d253f --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConnectLines.svg @@ -0,0 +1,822 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..c652db87c --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_Edge.svg @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..2bbf29df7 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_EndPoint.svg @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..f6f6f0790 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_MidPoint.svg @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..0ddefbee8 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Arc_StartingPoint.svg @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..a637d699a --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_Edge.svg @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..e0a5f5a2f --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Circle_MidPoint.svg @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..798c4cb2b --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_Edge.svg @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..d46754821 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_EndPoint.svg @@ -0,0 +1,254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..1fcbb0362 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Line_StartingPoint.svg @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..fdde9d9ef --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_Point_StartingPoint.svg @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_SelectionTypeInvalid.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_SelectionTypeInvalid.svg new file mode 100644 index 000000000..81ab1ee18 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_Element_SelectionTypeInvalid.svg @@ -0,0 +1,530 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConstraints.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConstraints.svg new file mode 100644 index 000000000..a29bf7534 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectConstraints.svg @@ -0,0 +1,1684 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectHorizontalAxis.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectHorizontalAxis.svg new file mode 100644 index 000000000..33b48d9c8 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectHorizontalAxis.svg @@ -0,0 +1,1911 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectOrigin.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectOrigin.svg new file mode 100644 index 000000000..312155aa1 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectOrigin.svg @@ -0,0 +1,1755 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectVerticalAxis.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectVerticalAxis.svg new file mode 100644 index 000000000..ca1e43951 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_SelectVerticalAxis.svg @@ -0,0 +1,2066 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_CloseShape.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_CloseShape.xpm new file mode 100644 index 000000000..4a1441d83 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_CloseShape.xpm @@ -0,0 +1,207 @@ +/* XPM */ +static char *Sketcher_CloseShape[] = { +/* columns rows colors chars-per-pixel */ +"16 16 185 2 ", +" c #2BD54F357C4F", +". c #3365510D740E", +"X c #5BBB48985292", +"o c #48015BDE729D", +"O c #44CD5DEE7E02", +"+ c #4DBF60BF768B", +"@ c #5A5262FB75BC", +"# c #F4841E0C0117", +"$ c #D8BB278D0FB2", +"% c #D1DB31B21AA7", +"& c #E93D20600538", +"* c #FB9D2250037A", +"= c #F35A250B093E", +"- c #E1DF2DB714DA", +"; c #FFFF38F61C23", +": c #D8F1381E20E9", +"> c #F0103B2020F6", +", c #8D5E42773CCF", +"< c #C37343DC318D", +"1 c #D0EE4BF5398A", +"2 c #FEF03FDD2526", +"3 c #BFC85256438A", +"4 c #9DA36FBD6BD7", +"5 c #9DB9789E79A6", +"6 c #9EAF79DF7B17", +"7 c #B39C758B6C9A", +"8 c #B29B77737773", +"9 c #B1BA78C770A1", +"0 c #B56B7F447F44", +"q c #BCE17B7D7B7D", +"w c #D9995906466C", +"e c #ED5A583D4298", +"r c #C526621353E9", +"t c #C91764345512", +"y c #C35769D25CF1", +"u c #DB5561ED5081", +"i c #EB9867AC5444", +"p c #EAEC687655BE", +"a c #FFFF73A65EF2", +"s c #CF4A6D406D40", +"d c #D2826E905FF1", +"f c #CE6E77D76B52", +"g c #CA17752E752E", +"h c #C93877BB77BB", +"j c #C9BF78E278E2", +"k c #C8BF7B447B44", +"l c #CEC579A279A2", +"z c #CA727CD67CD5", +"x c #D1B075107510", +"c c #DC4478D778D7", +"v c #DB367D4C7D4C", +"b c #F2DC7AB87AA8", +"n c #F72E7D527D52", +"m c #D1D78AB47F8D", +"M c #FFFF81266EBA", +"N c #FFFF854B72F1", +"B c #286150ED8477", +"V c #40235D9E81BB", +"C c #41435FD3841C", +"Z c #4F31670881A3", +"A c #3FF36138894C", +"S c #4B2C67A78BB1", +"D c #4D1B6A8D8D01", +"F c #512368BB8683", +"G c #568F6E638CE3", +"H c #6EDE73AF81F9", +"J c #72D37CF28A13", +"K c #7B0F878E9732", +"L c #7F038FC2A521", +"P c #86028D8197FE", +"I c #89368BB09263", +"U c #9AC797249AE4", +"Y c #A98086DA86DA", +"T c #A92B87D988AE", +"R c #B97081328132", +"E c #B4058A378A37", +"W c #B16A8E368E36", +"Q c #B935925B8E14", +"! c #AC7199FF99FF", +"~ c #B76B977E92F0", +"^ c #B9A39ABD9659", +"/ c #B6A99C079839", +"( c #824B9155A4B4", +") c #89139757A9AB", +"_ c #9666A222B110", +"` c #9926A516B470", +"' c #AB54A585A697", +"] c #AB13A7C4A8E5", +"[ c #AE78B3FAB9DA", +"{ c #AE1FB5BCBFB2", +"} c #B85EB08AB0C8", +"| c #BD06B4C0B3B4", +" . c #BBF6B99BBAD5", +".. c #BA4FBCC6BFA6", +"X. c #C98A86FE86FE", +"o. c #C7228B4E8B4E", +"O. c #CF5A88678880", +"+. c #CE9D8FBC8FCE", +"@. c #D2EE85D5853F", +"#. c #D08C87AF87AF", +"$. c #D1AA8ADF8AD0", +"%. c #D7768DDA8DDA", +"&. c #D9758971895E", +"*. c #DD458C918C91", +"=. c #D02395518CB4", +"-. c #C3AA90709067", +";. c #C5EA91659152", +":. c #C6CF91FC9212", +">. c #C55A970C9703", +",. c #C2F69CB39CE9", +"<. c #CE41991D991D", +"1. c #CF359EA39EB1", +"2. c #D20C91D39188", +"3. c #D16497C490BA", +"4. c #D11495C295EE", +"5. c #D88D937D937D", +"6. c #DE7F97BF97BF", +"7. c #E0E085968596", +"8. c #FEED82538253", +"9. c #F3868B108AFD", +"0. c #F72D8A2A8A2A", +"q. c #FFFF89C289C2", +"w. c #FA11929D929D", +"e. c #FF0590589058", +"r. c #FF62926C926C", +"t. c #FFFF965A965A", +"y. c #FDC39C0D9C0D", +"u. c #C481A806A3DB", +"i. c #CD91A3F4A3F3", +"p. c #C538AEFAAE20", +"a. c #CD28ADB8ADB8", +"s. c #CCD0AE2FAE2F", +"d. c #D5ABADF3A840", +"f. c #CCCBB7DDB652", +"g. c #C830BBE0BBE0", +"h. c #D157B961B961", +"j. c #D0BCBECABD41", +"k. c #D49EBF02BEB3", +"l. c #F649AE08ADF5", +"z. c #FFFFAF25AF25", +"x. c #FFFFB98FB98F", +"c. c #FDB0BBA0BBA0", +"v. c #FFFFBE92BE94", +"b. c #B5F2BF2DC6DA", +"n. c #C52AC5C7C6CC", +"m. c #CB3AC835C871", +"M. c #C8B4C91DC929", +"N. c #CA30CC3BCC88", +"B. c #CDB9CFABCFF1", +"V. c #CF23CF96CFA5", +"C. c #D548C338C338", +"Z. c #D7F3C77FC7C4", +"A. c #DC03C994C6EC", +"S. c #D950C943C943", +"D. c #DD47CE1BCE1B", +"F. c #C789CC3FD23F", +"G. c #CC17CEA4D0E6", +"H. c #CC3ACF10D23B", +"J. c #CF25D0FFD143", +"K. c #D025D369D7A1", +"L. c #D512D5F5D611", +"P. c #D5C3D895DC3A", +"I. c #DC08D95BD8D6", +"U. c #DD94DC4ADC33", +"Y. c #E20BD7A1D7A1", +"T. c #E456DA8EDA8E", +"R. c #E64EDE98DE98", +"E. c #E7ABE025E024", +"W. c #DD32DEF0E13E", +"Q. c #DEB8DF9CE08A", +"!. c #E2BAE2C2E2E7", +"~. c #E0F1E2B7E50E", +"^. c #E307E4EEE516", +"/. c #EC10E8A7E8A7", +"(. c #EA53EB06EB11", +"). c #ECA9EC73EC73", +"_. c #ED44EDFFEE04", +"`. c #F0E9F2B4F30B", +"'. c #F534F4F4F4FA", +"]. c #F63DF76FF79B", +"[. c #F837F9DDFA00", +"{. c #FA1AFA7FFA7F", +"}. c #FB22FB9BFB9B", +"|. c #FC76FCECFCEC", +" X c #FFFCFFFEFFFD", +/* pixels */ +" X|.h.o.>. .H.~.b.' -.X.s.{. X X", +" XR.5.v.9.5 o V + 6 l.z.v T. X X", +" XY.7.t.N ,.U X } i.0.q.c T. X X", +" X).E x O.f.d p w s.+.l Y g.T.{.", +"S.<.R ! `.d.e a = 3.[.U.W 6.*.a.", +"X.c.y.O.].A.% # $ u. X/.%.c.e.k ", +"z e.8.@.`.L./ h ~ M.^.'.+.n b ;.", +"k.@.@.Z.^.N.J.[./.N.n.A.j.,.T ' ", +"[ P M.=.r 9 U. X XL.7 u w ^ Z K ", +"( A Q p M - ^ J.B.| 1 N 2 3 D L ", +"` C 4 > ; & E J.B.g.< * # , . ) ", +"{ @ t : y I.).).^.f.f m H B _ ", +"Q.D F B.p.;.1.E.D.<.4.C.b.S D K.", +" XF.O I 2.v.w.0 R c.y.m J G P. X", +" X X.. .&.e.8.8 q e.8.$.n.Q. X X", +" X X{.'.a.s g S.C.k h Z. X X X X" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_ConnectLines.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_ConnectLines.xpm new file mode 100644 index 000000000..09fec5ebe --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_ConnectLines.xpm @@ -0,0 +1,161 @@ +/* XPM */ +static char *Sketcher_ConnectLines[] = { +/* columns rows colors chars-per-pixel */ +"16 16 139 2 ", +" c #5A5C6A3A7DB6", +". c #7A44754E7FC3", +"X c #F5231F7D02B5", +"o c #D23B2EF1177C", +"O c #DC0F2C9E12EE", +"+ c #DA0A34131BB3", +"@ c #D859345F1CCC", +"# c #E32D23950808", +"$ c #FFFF2C370E6A", +"% c #FFFF2FAD120F", +"& c #E47638481F95", +"* c #D60F3C2927D6", +"= c #BD104E5D3E69", +"- c #D1E3493A358D", +"; c #E94244672D5F", +": c #FF524C723264", +"> c #FFFF51243785", +", c #F8F452C03AEB", +"< c #F9CC55313D93", +"1 c #BA9C70BE662E", +"2 c #BA7179C37078", +"3 c #B1707E107E10", +"4 c #C77550D33FDB", +"5 c #D29255814398", +"6 c #D03F63215364", +"7 c #D9AE62B851AC", +"8 c #C72171E1658D", +"9 c #C85D702F637A", +"0 c #CE60743F6758", +"q c #DB0675EA75EA", +"w c #E06079DF79DF", +"e c #EE9878517851", +"r c #F46D78E978E9", +"t c #F8337BD77BD7", +"y c #B57285317E3D", +"u c #FCB681086F52", +"i c #F8C682997180", +"p c #3B065DF68AF0", +"a c #379E613096A5", +"s c #32EF60559A9C", +"d c #422A5DC18020", +"f c #485E633F8499", +"g c #4DE468408924", +"h c #43FF668292E8", +"j c #81537F788A93", +"k c #726C859F9E1C", +"l c #A5D48A958BE6", +"z c #A55A8B208B20", +"x c #B196839F839F", +"c c #A0D6905E9293", +"v c #AF299BC398DF", +"b c #BB29956F956F", +"n c #AA1CAD42B1AF", +"m c #A621AF46BB0F", +"M c #BB57B2E9B1B9", +"N c #C6BF832D832D", +"B c #CDB28EFA85E9", +"V c #C70D88668866", +"C c #C6DD8C688C68", +"Z c #CF3F8A8F8A71", +"A c #CDA18DF78DEC", +"S c #D35382058205", +"D c #D4BB806C806C", +"F c #D282845C845C", +"G c #D157891F891F", +"H c #D5148F108F10", +"J c #DE778CCA8CCA", +"K c #CFAC919189A5", +"L c #C74991389138", +"P c #CDB692259225", +"I c #CD449BC694AD", +"U c #CDDF98FE98FE", +"Y c #C8909DCB9DCB", +"T c #CD5F9CFF9CFF", +"R c #D22890B890B8", +"E c #DE7E906D906D", +"W c #FCFD81468146", +"Q c #FDF286258625", +"! c #FBD78B9F8B9F", +"~ c #E0B099A399A3", +"^ c #FFFF91139113", +"/ c #FE1493A293A3", +"( c #FA7C95769576", +") c #FFFF99C399C3", +"_ c #D322A20A9B03", +"` c #C933A3C6A3C6", +"' c #CCF2A563A563", +"] c #CF16AB35AB35", +"[ c #CF8FAD7EAD7E", +"{ c #D604A989A324", +"} c #D710AFC0AA1A", +"| c #D0C0AD01AD01", +" . c #D458B0A4AB8E", +".. c #DA72BB56B75D", +"X. c #D35BBEA1BB9A", +"o. c #EEB2A7F0A7F0", +"O. c #FD95AA58AA58", +"+. c #FFFFB545B546", +"@. c #FFFFBC36BC36", +"#. c #FFFFBF50BF50", +"$. c #C26AC666CA89", +"%. c #D72DC487C487", +"&. c #D25BCB17CB17", +"*. c #D108CE4DCE16", +"=. c #D9C9C8A0C8A0", +"-. c #DA58CACBCACB", +";. c #D5E3D146D141", +":. c #D7A0D493D423", +">. c #DF28D40BD3F7", +",. c #E208D1E8CF92", +"<. c #E249D295D05A", +"1. c #E4F3D47CD220", +"2. c #E28AD7DED7DE", +"3. c #E3CBDADDDADD", +"4. c #E868DEBADD4A", +"5. c #DD12DEDFE116", +"6. c #E03EE0B9E17F", +"7. c #E1DCE1FDE20E", +"8. c #E938E3DAE3DA", +"9. c #EA81E4C0E4C0", +"0. c #ED24E5D8E4C6", +"q. c #E972E947E911", +"w. c #EB41EB68EB61", +"e. c #EEE8EC06EC06", +"r. c #F182EFABEF6B", +"t. c #F057F0B5F0C7", +"y. c #EF7FF41BF4C3", +"u. c #F23DF17AF164", +"i. c #F320F3B5F3B9", +"p. c #F64AF5B6F5B6", +"a. c #F6E3F5DBF5B7", +"s. c #F5FDF77EF7B5", +"d. c #F6B6F6B2F6AF", +"f. c #F7D2F930F929", +"g. c #F9E7FAFDFAFD", +"h. c #FB11FC3CFC3C", +"j. c #FD6BFE0DFE0D", +"k. c #FE28FFE9FFFF", +"l. c #FFFDFFFEFFFE", +/* pixels */ +"l.l.l.<.8 9 ,.l.g. .9 I d.l.l.l.", +"l.l.d.0 i , 6 f.,.7 u & } l.l.l.", +"l.l.r.5 : $ - i...; > X K l.l.l.", +"l.l.l._ @ o y y.:.= # - 1.l.l.l.", +"l.l.l.g.4.$.M 2 1 v X.9.l.l.l.l.", +"l.l.l.l.l.d.1 i < 4 i.l.l.l.l.l.", +"l.l.l.l.l.i.6 : % * 0.l.d.2.8.l.", +"l.l.g.l.l.l.{ + O B l.d.' ~ G %.", +"e.[ Y &.l.l.y.j . w.l.3.J @.! V ", +"` o.O.w 8.l.9.g f 7.l.w.F W e Y ", +"L ( / w 2.l.m a s k 6.>.z 3 ] e.", +"-.F q x ;.*. p h d z ~ J b g.l.", +"l.e.&.z R A c $.5.n C +.) w w.l.", +"l.l.e.H @./ A f.l.f.T r r P s.l.", +"l.l.e.Z Q t U g.l.l.w.[ [ 8.l.l.", +"l.l.l.=.N C 4.l.l.l.l.l.l.l.l.l." +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_Edge_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_Edge_sm.xpm new file mode 100644 index 000000000..3027d0e8e --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_Edge_sm.xpm @@ -0,0 +1,105 @@ +/* XPM */ +static char *Sketcher_Element_Arc_Edge_sm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 83 1 ", +" c #105479361054", +". c #15D17B9315D1", +"X c #1A777D8B1A77", +"o c #1F4C78681F32", +"O c #24E066DB145D", +"+ c #20437FA72043", +"@ c #99EF2D0E050B", +"# c #ED991E68018A", +"$ c #F5EE1C2D0000", +"% c #D9C634E71D39", +"& c #E79B24BE090E", +"* c #EDFB2533087E", +"= c #FFFF2E5A121B", +"- c #D7E03B1526E4", +"; c #D69E3BD7288A", +": c #DD684F45391D", +"> c #FFFF432A2849", +", c #F6794F18375B", +"< c #FFFF4EEA3595", +"1 c #E7B24FE73A2D", +"2 c #FFFF501A3681", +"3 c #C76958F74178", +"4 c #CEF45EAD4EB7", +"5 c #D27C5B904A80", +"6 c #C436620051CA", +"7 c #CF61691F5B82", +"8 c #E2E569AA5838", +"9 c #FF4071755CDD", +"0 c #CE6B6DB460A9", +"q c #CDB2725C6535", +"w c #CDAD79F76DEF", +"e c #CDB17BA96FDC", +"r c #FE687A52677B", +"t c #F6017D5B6BF3", +"y c #276481EB2764", +"u c #3645895F3645", +"i c #400B8D0B400D", +"p c #4E5D93464E5D", +"a c #50B0950C50D3", +"s c #599397D15993", +"d c #6EE0A2746EE0", +"f c #7A8CA8D57A85", +"g c #CFE488297DF5", +"h c #CEDA88A47E80", +"j c #B8FB9076825A", +"k c #875EB1CF8968", +"l c #A4B1A1C18E01", +"z c #A3B7BE63A3B7", +"x c #CFD48D6883D7", +"c c #D03F8FB2866F", +"v c #D2F89D25956F", +"b c #D48EA42D9D3E", +"n c #D667A9F1A399", +"m c #D1F5AC68A65D", +"M c #D81CB233ACB8", +"N c #D9A2BB53B6EF", +"B c #A65AC05CA65A", +"V c #AD02C39EAD02", +"C c #DCC3C1EFBE1D", +"Z c #C19CD06CC19C", +"A c #C724D460C7DE", +"S c #D184DAEAD184", +"D c #D7ACDF54D7AC", +"F c #E7CBDDB7DC40", +"G c #E8E8DD10DB54", +"H c #E9D6DEADDD0F", +"J c #DB46E2D8DBD9", +"K c #DBF1E189DD9D", +"L c #E396E77FE396", +"P c #E943E3C7E31E", +"I c #ED10E8FAE88F", +"U c #EB32ECE9EB32", +"Y c #F1A5ED57ECAF", +"T c #EF63F0B4EF63", +"R c #F389F0CFF05B", +"E c #F2E8F23AF21D", +"W c #F5E9F791F7D2", +"Q c #F857F91DF938", +"! c #FAA1F8D4F9AB", +"~ c #F91EFB36FB87", +"^ c #FDF6FCB3FDF6", +"/ c #FD43FF19FF51", +"( c gray100", +/* pixels */ +"((((((((((((((((", +"(HxxH(((((((((((", +"Wwt,6K~(((((((((", +"E5<=@oaBT(((((((", +"(b%%jki uZ((((((", +"(~FF/(EVuXz(((((", +"((((((((Ls.V((((", +"(((((((((TpyD(((", +"((((((((((S+d^((", +"(((((((((((f+J((", +"(WCNY((((((AOl!(", +"(v81e~(((((m3:g~", +"W79>-I((((~0r<-P", +"(x&#q~(((((g*$4Y", +"(EMnI((((((YvcH(", +"((((((((((((((((" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_EndPoint_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_EndPoint_sm.xpm new file mode 100644 index 000000000..abf7b47f1 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_EndPoint_sm.xpm @@ -0,0 +1,95 @@ +/* XPM */ +static char *Sketcher_Element_Arc_EndPoint_sm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 73 1 ", +" c #EB1C1F2B0367", +". c #E1CD29400EB9", +"X c #F7722163033F", +"o c #FB6F24850728", +"O c #FC7531A615DE", +"+ c #D6123E58288F", +"@ c #EADE3D7E24AF", +"# c #DD8A4A913595", +"$ c #D8574D79398A", +"% c #FFFF56403D4F", +"& c #BAE6606F54C7", +"* c #D01958DA47B6", +"= c #DB2B59514718", +"- c #CE7B6A385D1B", +"; c #D1E469825A98", +": c #E32864845262", +"> c #CE187B816FB2", +", c #F94C7FEA6E99", +"< c #0059809C0059", +"1 c #05F7878305F7", +"2 c #1E65974C1E65", +"3 c #3AF88E683AF8", +"4 c #48AB958548AB", +"5 c #4FBB94084FBB", +"6 c #4D9797EB4D97", +"7 c #5136942B5136", +"8 c #75F6A55B75F6", +"9 c #7D8CAA197D8C", +"0 c #72B4C0B672B4", +"q c #FFFF815A6E92", +"w c #8923AB9B8923", +"e c #8B39B0F48B39", +"r c #AA83B47EAA83", +"t c #CDC489E48037", +"y c #C8798D01847A", +"u c #CF128D758412", +"i c #D0CB8DD38430", +"p c #D13E93428A58", +"a c #D2D0A29F9BBD", +"s c #D492A2D69BB5", +"d c #C5F4AA96A6B0", +"f c #DA89B7E7B2F4", +"g c #AACBC356AACB", +"h c #C6DCCDEDC6DC", +"j c #CFBCCFBDCFBD", +"k c #E011C9C0C68D", +"l c #CD69D0B3D117", +"z c #D0E0D0C3D0E0", +"x c #D51CD51CD51C", +"c c #D62ED62ED62E", +"v c #D70EDF8BD70E", +"b c #DEBDDEBDDEBD", +"n c #E30ED025CD74", +"m c #E1F6D398D194", +"M c #E677D707D4D2", +"N c #E6B6D9BFD7DB", +"B c #E9DDE032DEC2", +"V c #E122E122E122", +"C c #E508E508E508", +"Z c #EC2DE593E4A0", +"A c #E66BE9C1E66B", +"S c #EB42EB42EB42", +"D c #EF30EC3DEBD4", +"F c #EF0EF1B0F20F", +"G c #F41DF112F0A5", +"H c #F356F3D5F356", +"J c #F614F42BF3DB", +"K c #F57FF561F57F", +"L c #F8CBF8CBF8CB", +"P c #FB37F95AFB37", +"I c #FC1BFC1CFC1C", +"U c #FAF2FE0CFE6B", +"Y c #FFFEFFFDFFFE", +/* pixels */ +"YYYYYYYYYYYYYYYY", +"YnuaGYYYYYYYYYYY", +"Z;,@yFIYYYYYYYYY", +"m#%o&ljVIYYYYYYY", +"K>.+dljzjCYYYYYY", +"YKnBYYSzjjVYYYYY", +"YYYYYYYIbzjCYYYY", +"YYYYYYYYYVjlGYYY", +"YYYYYYYYYYcccYYY", +"YYYYYYYYYYGjlKYY", +"YJkNUYYYYYYjrhYY", +"Kt:$fYYYYYYw63gY", +"N=qO-UYYYYV4027I", +"D*X pYYYYYH51<8Y", +"YMisGYYYYYYv9eAY", +"YYYYYYYYYYYYYYYY" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_MidPoint_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_MidPoint_sm.xpm new file mode 100644 index 000000000..cbb835cc8 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_MidPoint_sm.xpm @@ -0,0 +1,91 @@ +/* XPM */ +static char *Sketcher_Element_Arc_MidPoint_sm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 69 1 ", +" c #F9CA1D0D0000", +". c #DF0B2B4C117F", +"X c #F268285A0B64", +"o c #FFFF32431551", +"O c #D7003CCA283E", +"+ c #C66F402C2F18", +"@ c #D7EC523C3F1F", +"# c #F1E44E4336CE", +"$ c #FFFF531D3A5A", +"% c #CFF2560244FD", +"& c #CBE55DC24DF8", +"* c #D2885BDD4AC2", +"= c #FFFF5BA04391", +"- c #C8B26DAD60A2", +"; c #CE38707762FF", +": c #CED57BF67018", +"> c #F1E077E3665C", +", c #FDE67F016C6A", +"< c #000082000000", +"1 c #08D8894A08D8", +"2 c #25B69AE725B6", +"3 c #4054910D4054", +"4 c #47F9905F47F9", +"5 c #4E9A96B84E9A", +"6 c #561F9706561F", +"7 c #544C9C25544C", +"8 c #65E39DAC65E3", +"9 c #73A7A4DF73A7", +"0 c #7B5AA8957B5A", +"q c #7465C0BC7465", +"w c #CE1D8122762B", +"e c #9E02BA8B9E02", +"r c #C0D68914811D", +"t c #D0148A6A8077", +"y c #D099945A8BB8", +"u c #D25799FC91EF", +"i c #D2289D3B95AF", +"p c #C173B8D6B79A", +"a c #C8D2BD6ABBC4", +"s c #D475B524B0A3", +"d c #A6D0C073A6D0", +"f c #C65FC613C603", +"g c #CFB9CFB9CFB9", +"h c #CEBAD09AD0E1", +"j c #D3BBD3BBD3BB", +"k c #D709DFA9D709", +"l c #D8BCD8BCD8BC", +"z c #DADEDADEDADE", +"x c #DE21DF0DDF30", +"c c #E17FCF6DCCCC", +"v c #E464D2F2D071", +"b c #DB5BE247DB5B", +"n c #DF22E4A2DF22", +"m c #E04DE667E04D", +"M c #E36EE36EE36E", +"N c #E5C7E5C7E5C7", +"B c #E9CEE4C5E406", +"V c #EE1FE640E51F", +"C c #E8C0E8C0E8C0", +"Z c #E8E3EB74E8E3", +"A c #EA24EA70EA7B", +"S c #EF2DEF2DEF2D", +"D c #F446F45AF446", +"F c #F5E0F5E0F5E0", +"G c #F8CEF9D8F9FF", +"H c #FBD3FBD1FBD7", +"J c #FD0FFBAAFD0F", +"K c #FC60FF02FF51", +"L c #FFFEFFFEFFFE", +/* pixels */ +"LLLLLLLLLLLLLLLL", +"LViiVLLLLLLLLLLL", +"Gw>#-AGLLLLLLLLL", +"S*=o+fjzFLLLLLLL", +"Lu..rhhjgMLLLLLL", +"LGccGLSjggzGLLLL", +"LLLLLLLLNgjzLLLL", +"LLLLLLLLLAggALLL", +"LLLLLLLLLLxjgGLL", +"LLLLLLLLLLGgjALL", +"LGbmLLLLLLLxpaGL", +"Je73dLLLLLLs&@yH", +"A5q24FLLLLG;,$OB", +"D61<8JLLLLKwX %S", +"Lk90mLLLLLLVt:vL", +"LLLLLLLLLLLLLKLL" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_StartingPoint_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_StartingPoint_sm.xpm new file mode 100644 index 000000000..23a902a52 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Arc_StartingPoint_sm.xpm @@ -0,0 +1,93 @@ +/* XPM */ +static char *Sketcher_Element_Arc_StartingPoint_sm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 71 1 ", +" c #20A87CF220A8", +". c #F3321C1D0000", +"X c #FB811E150000", +"o c #DBF535441F86", +"O c #EE7929D00D99", +"+ c #F9612661087A", +"@ c #FE513BAC2084", +"# c #D270495B3665", +"$ c #CE905E4B4F8E", +"% c #D582538040BE", +"& c #D96454284108", +"* c #D65A5CAB4B3D", +"= c #C97E5F1E4FED", +"- c #FFFF5D7B460B", +"; c #DB0D64CD53F5", +": c #CEC778166B93", +"> c #CE6A7BC76FDD", +", c #CF2F7CD17109", +"< c #FB1A78D365DF", +"1 c #0E8E80130E8E", +"2 c #1617807F1617", +"3 c #1BE2982F1BE2", +"4 c #3EEDA0763EED", +"5 c #507E9221507E", +"6 c #5950985D5950", +"7 c #4116A81E4116", +"8 c #72E59D3372E5", +"9 c #625BADA3625B", +"0 c #CE6986EA7CB3", +"q c #CFB989157EE9", +"w c #FFFF872F7562", +"e c #83BEAC1A83BE", +"r c #911CB3A5911C", +"t c #9A4AB8819A4A", +"y c #A0DEBD22A0DE", +"u c #D08590E487DF", +"i c #D1CE9F759839", +"p c #D8A8B3D3AE8F", +"a c #C484B803B63D", +"s c #C2B6BB80BA7E", +"d c #BDF3C049BDF3", +"f c #D9E2C1A6BE2A", +"g c #CF09CE3ECF09", +"h c #C926D56EC926", +"j c #D0FDD0F0D0FD", +"k c #D1BFD1BDD1BD", +"l c #D52AD52AD52A", +"z c #D0ACDAA5D0AC", +"x c #D91CD91CD91C", +"c c #E0E9CA22C6E1", +"v c #E561D4E0D277", +"b c #E3B7D85CD6E4", +"n c #E78FDBCADA20", +"m c #DED0E527DED0", +"M c #E410E410E410", +"N c #E3DEE4D8E4FC", +"B c #E714E71FE714", +"V c #EA24E1FBE0C9", +"C c #EABFE4E1E410", +"Z c #ED80E544E40F", +"A c #EBEAE6BEE5F9", +"S c #E98BE98BE98B", +"D c #EB82EE92EB82", +"F c #EEC4EEC4EEC4", +"G c #F17FED11EC74", +"H c #F3B8F3B8F3B8", +"J c #F905F7ACF905", +"K c #F8DFF8EAF8ED", +"L c #FAD7FAE8FAF6", +"P c #FBE7FE7CFEDC", +"I c #FFFDFFFEFFFE", +/* pixels */ +"IIIIIIIIIIIIIIII", +"IDtrmIIIIIIIIIII", +"Ie945BLIIIIIIIII", +"J673 dkxHIIIIIII", +"Iy218gkkgMIIIIII", +"ILzhJIFlgkkLIIII", +"IIIIIIIISgklIIII", +"IIIIIIIIIFgkMIII", +"IIIIIIIIIIMkgLII", +"IIIIIIIIIIIkkBII", +"ILnVPIIIIIINsaJI", +"Pi;%pIIIIIIf=&0J", +"C*w@$KIIIIP><-ob", +"G$+.>PIIIIIuOX#A", +"Iv,qCIIIIIIGu:cI", +"IIPIIIIIIIIIPPII" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Circle_Edge_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Circle_Edge_sm.xpm new file mode 100644 index 000000000..e8b405014 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Circle_Edge_sm.xpm @@ -0,0 +1,108 @@ +/* XPM */ +static char *Sketcher_Element_Circle_Edge_sm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 86 1 ", +" c #08737A9D0873", +". c #0B897A200B89", +"X c #0B687B7E0B68", +"o c #0D7F7A860D7F", +"O c #12A07B5A12A0", +"+ c #0F927C990F92", +"@ c #11FA7D8511FA", +"# c #15DD7EB215DD", +"$ c #17867F4D1786", +"% c #1DD27FBE1DD2", +"& c #DA1534CC1D0D", +"* c #E1A229760F04", +"= c #FE04280A0AA2", +"- c #D7D350A63E00", +"; c #ED1C40342769", +": c #FFFF5D22452F", +"> c #CE7D62075453", +", c #CE7772A16582", +"< c #F5D77B6869D1", +"1 c #1E4A80FF1E4A", +"2 c #201882A62018", +"3 c #26B283B526B2", +"4 c #29A984FF29A9", +"5 c #2CDA85F62CDA", +"6 c #319F8969319F", +"7 c #33F188B533F1", +"8 c #365C891F365C", +"9 c #38608A8C3860", +"0 c #3B5C8D8D3B5C", +"q c #47CD92FC47CD", +"w c #4DE092B34DE0", +"e c #4D92951F4D92", +"r c #5307966C5307", +"t c #56C597E656C5", +"y c #61289DFC6128", +"u c #64999D7F6499", +"i c #68759F566875", +"p c #6BA4A0F76BA4", +"a c #7C4FA8F87C4F", +"s c #7F95AC5D7F95", +"d c #CF1D864D7BE1", +"f c #CF9488B57E7F", +"g c #8122AB148122", +"h c #8A25AFF78A25", +"j c #875AB0FC875A", +"k c #893AB085893A", +"l c #8965B22B8965", +"z c #8CC1B1AF8CC1", +"x c #940CB638940C", +"c c #99C6B93A99C6", +"v c #9EDFBBDC9EDF", +"b c #9FB7BD099FB7", +"n c #CF97948A8C1E", +"m c #D2ACA1A39AA4", +"M c #D859B121AB86", +"N c #A9A3C3E5A9A3", +"B c #ADDDC54CADDD", +"V c #B05DC5C2B05D", +"C c #B52DC8F8B52D", +"Z c #B850CB80B850", +"A c #C128D0A0C128", +"S c #C7F2D4D6C7F2", +"D c #CC2FD74FCC2F", +"F c #CFDCD96DCFDC", +"G c #D29BDAFBD29B", +"H c #D5EDDE6FD5ED", +"J c #E1E0CE9CCBD6", +"K c #E67BD8C8D6CC", +"L c #E83CDBE7DA21", +"P c #DC6FE2ADDC6F", +"I c #E343E79FE343", +"U c #EBD2E5E5E530", +"Y c #E7BDEAAEE7BD", +"T c #E93AEBF1E93A", +"R c #EC66EDF7EC66", +"E c #F246EE62EDD4", +"W c #EFD6F111EFD6", +"Q c #F255F248F255", +"! c #F1DDF2B4F1DD", +"~ c #F634F5C5F634", +"^ c #F78EF6C7F78E", +"/ c #F919F817F919", +"( c #FA18F91CFA18", +") c #FC7AFCEFFD00", +"_ c #FEF3FD0EFEF3", +"` c #FFFEFFFCFFFF", +/* pixels */ +"````````````````", +"`````IBljNP`````", +"```!z3.##.1aY```", +"``Wu.rBHHBt.wI``", +"``goh~````~z.i(`", +"`H%u/``````(p+A`", +"`xOS``LnmE``D@a`", +"`p5R`!,<;f``R6e(", +"`y8!`U-:=>(`!0q/", +"`a%P`(d*&M``I2y`", +"`Zoc``~JK```v.v`", +"`!q4F``````G37Y`", +"``S35B!``!V7#C``", +"```Z8o8yy9.4V```", +"````Yxe54qlP````", +"``````/TT~``````" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Circle_MidPoint_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Circle_MidPoint_sm.xpm new file mode 100644 index 000000000..3ecc3492a --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Circle_MidPoint_sm.xpm @@ -0,0 +1,60 @@ +/* XPM */ +static char *Sketcher_Element_Circle_MidPoint_sm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 38 1 ", +" c #01DE866701DE", +". c #1E118F661E11", +"X c #238B847B238B", +"o c #2A909EFC2A90", +"O c #34AC8E0734AC", +"+ c #41018DDD4101", +"@ c #550899525508", +"# c #69239FC76923", +"$ c #6F30A2586F30", +"% c #7E2DA99A7E2D", +"& c #7694BFD87694", +"* c #80C7AB4680C7", +"= c #8AAFB09E8AAF", +"- c #BB1FCCDCBB1F", +"; c #CFBDCFBDCFBD", +": c #CE50D9B2CE50", +"> c #D1EED1EED1EE", +", c #D3A3D3A3D3A3", +"< c #D4DAD4DAD4DA", +"1 c #D82ED82ED82E", +"2 c #DBBBDBBBDBBB", +"3 c #DDA5DDA5DDA5", +"4 c #DC62E28DDC62", +"5 c #E2DEE2DEE2DE", +"6 c #E3A5E829E3A5", +"7 c #E4EFE4EFE4EF", +"8 c #E7EDE7EDE7ED", +"9 c #E71BEB43E71B", +"0 c #E929E929E929", +"q c #E99AE99AE99A", +"w c #ED02ED02ED02", +"e c #F055F174F055", +"r c #F354F354F354", +"t c #F502F502F502", +"y c #F96AF96AF96A", +"u c #FBFCFB86FBFC", +"i c #FE0FFD59FE0F", +"p c #FFFDFFFCFFFD", +/* pixels */ +"pppppppuuppppppp", +"ppppt3>>1>3tpppp", +"ppp8;111121;qppp", +"pp8;1>5wq5;3;qpp", +"pt;11uppppu>3;tp", +"p21>pppuuppu;23p", +"p>>qpp-#%9pp32>p", +"t>>tp6@&.*ppw1>u", +"t>>tp4Oo $ppq1;u", +"p>1qpu=X+:pp52;p", +"p2>>ppu9eppu;22p", +"pr;12pppppu12;tp", +"pp5>1;8tr8;2>6pp", +"ppp5;1>>>12;8ppp", +"ppppr2>;>>2rpppp", +"pppppppurppppppp" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Line_Edge_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Line_Edge_sm.xpm new file mode 100644 index 000000000..1608c6b7c --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Line_Edge_sm.xpm @@ -0,0 +1,97 @@ +/* XPM */ +static char *Sketcher_Element_Line_Edge_sm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 75 1 ", +" c #6C3739E6049A", +". c #10C06E4908DB", +"X c #01D57D8D0253", +"o c #0E0879CB0E01", +"O c #102B71370D75", +"+ c #15F377C315EF", +"@ c #184B7963184B", +"# c #225E7939225E", +"$ c #25287ADC2528", +"% c #31377BC33137", +"& c #35A37F3535A3", +"* c #56F4414A0192", +"= c #EFB51DFD0000", +"- c #F9651A8B0000", +"; c #FE281F600087", +": c #C5C633F11F8D", +"> c #D4D936131F2B", +", c #E7D8225007C1", +"< c #FFFF38E21C2B", +"1 c #CFDB3CF12861", +"2 c #CF6E417F2D15", +"3 c #CBD046D634E6", +"4 c #E1F8404526F7", +"5 c #E9014FCD3A83", +"6 c #FFFF4EB8350A", +"7 c #968E67455350", +"8 c #94B779A36878", +"9 c #C80463945584", +"0 c #CB3C60D45198", +"q c #CA4566E5589B", +"w c #F86463484DF5", +"e c #FFFF73245E8F", +"r c #C6C177D36C8A", +"t c #CA4B7B877037", +"y c #EF8B71E15FE2", +"u c #F32F741B621C", +"i c #0000817D0000", +"p c #440A81EE440A", +"a c #481385144813", +"s c #594E8B06594E", +"d c #5B608D5D5D48", +"f c #6DB894116F04", +"g c #CD4E82AA78BF", +"h c #FFFF833970EB", +"j c #8747A58F87D3", +"k c #9904AEAA994C", +"l c #9E03B24A9E03", +"z c #AFB1BD01AFB1", +"x c #CA3789538005", +"c c #CC1497388FAC", +"v c #CF37998D92A8", +"b c #CC7BA665A18B", +"n c #CD3AAA2BA60F", +"m c #D5F6B64EB1BA", +"M c #B40AC0E6B40A", +"N c #C390CB86C390", +"B c #C81ECF82C81E", +"V c #DA3CC8A6C61A", +"C c #DDDDCB2BC877", +"Z c #E038D3C3D1F5", +"A c #D4A0D85CD4A0", +"S c #D7F3DB86D7F3", +"D c #E3A1D714D546", +"F c #E379D8C4D735", +"G c #E6C1DC7BDB04", +"H c #E072DDAFDD73", +"J c #E496DFB4DFD5", +"K c #E34AE464E34A", +"L c #EC3DE5F4E515", +"P c #EE83EE4AEE97", +"I c #F3A2F64EF679", +"U c #F79DF834F84B", +"Y c #F9E8FA29FAA7", +"T c #FE14FF39FF64", +"R c #FFFFFFFEFFFF", +/* pixels */ +"RRRRRRRRRRRRRRRR", +"RRRRRRRRRRRLcxCR", +"RRRRRRRRRRUryw2Z", +"RRRRRRRRRRJ3e6,n", +"RRRRRRRRRPf =-1Z", +"RRRRRRRRKsX.7gVR", +"RRRRRRRApXojIRRR", +"RRRRRRN%i@lYRRRR", +"RRRRRz$i$MRRRRRR", +"RRRUk+i&BRRRRRRR", +"RDv8OXaARRRRRRRR", +"F0u4*dKRRRRRRRRR", +"b5h<:HRRRRRRRRRR", +"V>;-9URRRRRRRRRR", +"TmqtGRRRRRRRRRRR", +"RRURRRRRRRRRRRRR" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Line_EndPoint_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Line_EndPoint_sm.xpm new file mode 100644 index 000000000..8d4d7e6e5 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Line_EndPoint_sm.xpm @@ -0,0 +1,89 @@ +/* XPM */ +static char *Sketcher_Element_Line_EndPoint_sm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 67 1 ", +" c #215F7B57215F", +". c #F4E21A3A0000", +"X c #F6B01C950000", +"o c #D6052A7E13E0", +"O c #FFFF3E242214", +"+ c #BEFC4E923E8A", +"@ c #C9E04E883CCB", +"# c #DEDC46903137", +"$ c #F4DB513D39F4", +"% c #AC8D71DC6982", +"& c #C8AC56E246C2", +"* c #C9486406558A", +"= c #FFFF7789638E", +"- c #F5CE7C7B6B19", +"; c #000085F70000", +": c #152F8227152F", +"> c #0FA092860FA0", +", c #22F99A4422F9", +"< c #368686AC3686", +"1 c #339D8BB2339D", +"2 c #419F8B2C419F", +"3 c #47248CBE4724", +"4 c #413A9B3F413A", +"5 c #4C719DFD4C71", +"6 c #68D0900C68D0", +"7 c #62D3991462D3", +"8 c #CABD86A97CDC", +"9 c #86FA971B86FA", +"0 c #9A33B66A9A33", +"q c #B0F9AF9CAF6F", +"w c #A8AFBDE7A8AF", +"e c #B91DB91CB91B", +"r c #BA80BA80BA80", +"t c #BD96BD96BD96", +"y c #CB998AAD8156", +"u c #CB228D7A84B8", +"i c #C5BBBBC1BA58", +"p c #875CC9F6875C", +"a c #BF20CDE9BF20", +"s c #D78AC117BE5D", +"d c #C35DC35DC35D", +"f c #C549C549C549", +"g c #C7D9C7D9C7D9", +"h c #C11DCF01C11D", +"j c #CC02CC02CC02", +"k c #CDD7CDD7CDD7", +"l c #DB53D0B7CF76", +"z c #D264D264D264", +"x c #D60ED605D604", +"c c #D127DA10D127", +"v c #DBD2DBD2DBD2", +"b c #E311D5BDD3D8", +"n c #E60ADB56D9CC", +"m c #E0A4E0A4E0A4", +"M c #E300E352E300", +"N c #E548E548E548", +"B c #E9E4E4CBE411", +"V c #E83BEB5AE83B", +"C c #EBE6EAE5EBE6", +"Z c #ECA8EECCECA8", +"A c #F0CFF0CFF0CF", +"S c #F2A9F25AF2A9", +"D c #F46AF735F768", +"F c #F55BF55BF55B", +"G c #FBF2FBD6FBF2", +"H c #FDDFFFF1FFFF", +"J c #FFFEFFFEFFFF", +/* pixels */ +"JJJJJJJJJJJJJJJJ", +"JJJJJJJJJJJZacGJ", +"JJJJJJJJJJV7510J", +"JJJJJJJJJJw4p,;3S", +"JJJJJJJJMeM6 2hJ", +"JJJJJJJxtSkdNSJJ", +"JJJJJJjdFfjGJJJJ", +"JJJJGdkFtzJJJJJJ", +"JJJDtxSevJJJJJJJ", +"Jbu%iCeNJJJJJJJJ", +"B*-$+qZJJJJJJJJJ", +"s#=OolJJJJJJJJJJ", +"B@X.&ZJJJJJJJJJJ", +"Jb8ynJJJJJJJJJJJ", +"JJJJJJJJJJJJJJJJ" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Line_StartingPoint_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Line_StartingPoint_sm.xpm new file mode 100644 index 000000000..5a4a49986 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Line_StartingPoint_sm.xpm @@ -0,0 +1,97 @@ +/* XPM */ +static char *Sketcher_Element_Line_StartingPoint_sm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 75 1 ", +" c #1BC77AE71BC7", +". c #FABA1A740000", +"X c #F9D91F9D00F7", +"o c #DF6B27810F35", +"O c #BFCD47FD36C6", +"+ c #CD5744A43190", +"@ c #D4F346FE33A4", +"# c #FFFF4A8C3034", +"$ c #F1C454923E10", +"% c #AFFF5DBF5200", +"& c #C8D8574246F9", +"* c #EF1D704A5E2F", +"= c #C6A070006383", +"- c #CAA6736D66E6", +"; c #FFFF7FCB6CE5", +": c #0000819C0000", +"> c #000086930000", +", c #1F4A99D01F4A", +"< c #287382622873", +"1 c #2FA295042FA2", +"2 c #359D945D359D", +"3 c #4D688EF24D68", +"4 c #56558CBC5655", +"5 c #53AF935953AF", +"6 c #64BA9B5864BA", +"7 c #7749931A7749", +"8 c #64D2B1AC64D2", +"9 c #6D97BDB56D97", +"0 c #741FA240741F", +"q c #8E2AAFA48E2A", +"w c #AD03AB17AACE", +"e c #B568B4D1B568", +"r c #B55CB55AB55A", +"t c #B878B878B878", +"y c #B952B952B952", +"u c #BDFCBDFCBDFC", +"i c #CCC999EA929D", +"p c #CDB59D50966A", +"a c #C291B351B133", +"s c #AE59C049AE59", +"d c #BEFFCD77BEFF", +"f c #D6A3C050BDBF", +"g c #BF6EC065C088", +"h c #C3AEC3AEC3AE", +"j c #C36FC619C36F", +"k c #C5D7C5D7C5D7", +"l c #CC0FCC0FCC0F", +"z c #CE36CE36CE36", +"x c #CFD2CFD3CFD2", +"c c #DDCAC9D9C6F7", +"v c #DC0DD17ED033", +"b c #D589D57FD57D", +"n c #D2ECDA2AD2EC", +"m c #D5FEDD97D5FE", +"M c #DA02DA02DA02", +"N c #DA03DC69DA03", +"B c #E812DF36DDE9", +"V c #DCCCE1E0DCCC", +"C c #E327E327E327", +"Z c #EB4EE488E389", +"A c #EC51E8B2E82B", +"S c #E9DBE9D0E9DB", +"D c #E96AEA4FEA6F", +"F c #EC89ECBFECC6", +"G c #EF2EEEEDEF2E", +"H c #F0B2F0B2F0B2", +"J c #F3C7F2B8F28C", +"K c #F275F595F608", +"L c #F508F508F508", +"P c #F92BF899F92B", +"I c #FA34FA34FA34", +"U c #FB90FB90FB90", +"Y c #FC2AFE9CFEED", +"T c #FE41FCA7FE41", +"R c #FFFEFFFEFFFF", +/* pixels */ +"RRRRRRRRRRRRRRRR", +"RRRRRRRRRRRZpiBR", +"RRRRRRRRRRJ=*$&A", +"RRRRRRRRRRv@;#of", +"RRRRRRRRRFwOX.+B", +"RRRRRRRRCrDa%-cR", +"RRRRRRRMtJbgKYRR", +"RRRRRRzuKlkIRRRR", +"RRRRIkkKhzRRRRRR", +"RRRPhxJtbRRRRRRR", +"Rmq7hHtCRRRRRRRR", +"V5814rSRRRRRRRRR", +"s29, MRRRRRRRRRR", +"n<>:3JRRRRRRRRRR", +"Td60mRRRRRRRRRRR", +"RRRRRRRRRRRRRRRR" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Point_StartingPoint_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Point_StartingPoint_sm.xpm new file mode 100644 index 000000000..9c5719364 --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_Point_StartingPoint_sm.xpm @@ -0,0 +1,49 @@ +/* XPM */ +static char *Sketcher_Element_Point_StartingPoint_sm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 27 1 ", +" c #01687FD00168", +". c #1C7487E41C74", +"X c #0F9091C60F90", +"o c #3C2588993C25", +"O c #343A91AB343A", +"+ c #3A65931C3A65", +"@ c #315CA1DC315C", +"# c #403B953F403B", +"$ c #507A90A1507A", +"% c #5DA196F15DA1", +"& c #55E2B2CC55E2", +"* c #7801A3607801", +"= c #977BB58E977B", +"- c #9EF2B9A49EF2", +"; c #A89BBFBAA89B", +": c #97FBD19F97FB", +"> c #BD3DCC3ABD3D", +", c #C17CCF28C17C", +"< c #C3DDD0CDC3DD", +"1 c #C5A5D203C5A5", +"2 c #DEE5E3D9DEE5", +"3 c #E0E6E56EE0E6", +"4 c #E805EAF6E805", +"5 c #ECF8EEE6ECF8", +"6 c #F13BF225F13B", +"7 c #F63EF680F63E", +"8 c gray100", +/* pixels */ +"8888888888888888", +"8888888888888888", +"8888888888888888", +"8888888888888888", +"8888888888888888", +"88888871,6888888", +"888887*#O%588888", +"88888<+:& ;88888", +"88888>.@X -88888", +"888885$ o388888", +"8888884-=2888888", +"8888888888888888", +"8888888888888888", +"8888888888888888", +"8888888888888888", +"8888888888888888" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_SelectionTypeInvalid_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_SelectionTypeInvalid_sm.xpm new file mode 100644 index 000000000..b20babb5f --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_Element_SelectionTypeInvalid_sm.xpm @@ -0,0 +1,93 @@ +/* XPM */ +static char *Sketcher_Element_SelectionTypeInvalid_sm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 71 1 ", +" c #BBF032AE1CE0", +". c #D39F1E2D0543", +"X c #DD78191F0000", +"o c #E1EB199E0000", +"O c #E8351D1F00EB", +"+ c #E8C31BE20000", +"@ c #EC441C600000", +"# c #EEFB1C680000", +"$ c #F3DB1C5E0000", +"% c #F7161D1C0000", +"& c #FC2C1E110000", +"* c #FF051F2A0000", +"= c #CF8020EA07D8", +"- c #D3C423760A70", +"; c #D74023FB0A44", +": c #D39726580DAB", +"> c #CFF12B241322", +", c #C6CA33661C97", +"< c #C65234731DEC", +"1 c #CB64316F1ABD", +"2 c #FFFF201A0000", +"3 c #C7583FA02B35", +"4 c #C599427C2EA7", +"5 c #C31945AB325D", +"6 c #C391494C367C", +"7 c #C3044AFE386D", +"8 c #C2544C7D3A57", +"9 c #C34C4E083BF7", +"0 c #C23550C93F27", +"q c #BD0B60AC5192", +"w c #BE3365EE574A", +"e c #BF1F73AC66EF", +"r c #C02C7E4F72FD", +"t c #C2BE57194643", +"y c #C3365F774FAF", +"u c #C35C6548563F", +"i c #C37A674F585B", +"p c #C3A868E95A4A", +"a c #C0BE7D4071B6", +"s c #C1537EEF7467", +"d c #C18B832F7934", +"f c #C9E2857B7A20", +"g c #CA0287FC7CF0", +"h c #CCF1960C8CA4", +"j c #C9AB98A7900E", +"k c #CFF89E3E959B", +"l c #D08CA0EE9896", +"z c #D0B9A2499A4B", +"x c #D20DAC09A534", +"c c #D502ABFBA4D8", +"v c #DAEABC37B6BF", +"b c #E01AC879C425", +"n c #E2E4CAA5C650", +"m c #E43FCE92CA9A", +"M c #E48CD13ACDA5", +"N c #E563D2DECF66", +"B c #E721D66AD33B", +"V c #E8ABD791D467", +"C c #E927DA07D72B", +"Z c #E998DAACD7E5", +"A c #EB22DB8AD8AC", +"S c #EC71DE8CDBEF", +"D c #EBCADF13DCAB", +"F c #EF43E3D0E1B2", +"G c #F021E79DE5F1", +"H c #F1CDEA64E8EA", +"J c #F3D1EDF9ECC7", +"K c #F6DAF16BF060", +"L c #F94AF5CEF51B", +"P c #FD09FC8EFC67", +"I c #FFFDFFFEFFFD", +/* pixels */ +"IIIPIIIIIIIIIIII", +"IInaFIIIIIIArVII", +"In3oyGIIIIZ0o0SI", +"Iso2OuHIIZ0#*XdI", +"IFt#*OpJZ9#*@tZI", +"IIZ7$2Oq8$2@yDII", +"IIIM4%2@$2OiGIII", +"IIIIb<**2OwJIIII", +"IIIIv,&*2#tSIIII", +"IIIx1&*@%2#0ZIII", +"IPk>&*;e5$2#7MII", +"Ij-*&:hPM5$2$5mI", +"Iz;&>lPIIM6$*.jI", +"ILf cPIIIIB7=gLI", +"IIKBIIIIIIIVxLII", +"IIIIIIIIIIIIIIII" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_SelectConstraints.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_SelectConstraints.xpm new file mode 100644 index 000000000..d7a2cee6f --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_SelectConstraints.xpm @@ -0,0 +1,101 @@ +/* XPM */ +static char *Sketcher_SelectConstraints[] = { +/* columns rows colors chars-per-pixel */ +"16 16 79 1 ", +" c #6474B7D9140D", +". c #6A8EC63D1166", +"X c #6B8AC4831522", +"o c #6C97C1C51A09", +"O c #6FBAC7CF19FB", +"+ c #6EFFC3451D24", +"@ c #70ECC94E1AC7", +"# c #72EBCA791D8E", +"$ c #74D6CE931D6B", +"% c #714FC22F22DD", +"& c #73DAC3B22685", +"* c #73E7C3BA26AD", +"= c #7507C6C82568", +"- c #7670CCBB22A9", +"; c #7906CE162672", +": c #774DC4192D12", +"> c #7952C98A2B55", +", c #7BEBC95730FD", +"< c #7D71CCE53029", +"1 c #7B25C0533882", +"2 c #80F8C6723D9F", +"3 c #860ECB7842CF", +"4 c #87D7CC73454C", +"5 c #8971CD5F4776", +"6 c #898AC7764DFE", +"7 c #8C34C7075377", +"8 c #8B72C9944FF4", +"9 c #8FCCCFC251FA", +"0 c #927BCC2B5AD1", +"q c #92D5D060574E", +"w c #9674CE2960FA", +"e c #9A2DD27C63CC", +"r c #9BE9D33A6670", +"t c #A1C8D61E6F3C", +"y c #A51DD83F73D1", +"u c #A50ED79C7430", +"i c #A678D3EF7ACB", +"p c #A76CD752792D", +"a c #A830D3A47EA4", +"s c #AAF1DA337D5B", +"d c #ACCCD8B882A5", +"f c #AE40D99D8454", +"g c #B20FDABD8AAB", +"h c #B330DE918941", +"j c #B55DDE3B8DED", +"k c #B64CD9F893F2", +"l c #B7EADD9793C1", +"z c #B914DC2897A8", +"x c #B964DCBD9790", +"c c #C3D0E1B5A6E5", +"v c #C6CCE24FACB6", +"b c #C84FE30CAED2", +"n c #C890E497ADA9", +"m c #C9ADE366B101", +"M c #CBB9E69EB210", +"N c #CEE5E5CBB8D8", +"B c #D03EE590BBF6", +"V c #D07AE74EBAE3", +"C c #D0E9E578BD57", +"Z c #D7F3EA7BC64B", +"A c #DA42EC2BC92C", +"S c #DD3DEDB1CD8D", +"D c #E029EF5ED19B", +"F c #E22FF047D4D3", +"G c #E27AF129D4AC", +"H c #E3A4F0EBD6F3", +"J c #E491F136D898", +"K c #E4D4F17FD8B3", +"L c #E92DF375DF70", +"P c #EB53F41EE2FD", +"I c #EC11F4AFE3F0", +"U c #ED2CF5F2E4D6", +"Y c #F03DF734E9B8", +"T c #F085F73FEA3F", +"R c #F5F0FA35F1D7", +"E c #F967FBB2F748", +"W c #FB00FD0AF92A", +"Q c #FCE6FE0EFBD6", +"! c #FFFDFFFDFFFD", +/* pixels */ +"!!!!!!HkR!!!!!!!", +"!!!!!!m%dE!!!!!!", +"!!!!Ffg7ogW!!!!!", +"!!!!v:=+ okQ!!!!", +"!!!!RIFpo +zQ!!!", +"!!!!!!!Er&73I!!!", +"!!!!!!!!novF!!!!", +"!!!!!!!!KiH!!!!!", +"!!UtlW!!!!!!!!!!", +"!!H-3Y!QbI!!!RvI", +"!!H;4Y!Qq4A!Le&Z", +"!!F;4Y!!x+,V9X8K", +"!!H;4Y!!P6.a<%m!", +"Mhy$>sjKu.2Nio5I", +"tO@##@+zw0S!Rk1Z", +"HvcccccFNL!!!!CK" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_SelectHorizontalAxis.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_SelectHorizontalAxis.xpm new file mode 100644 index 000000000..ce3ce397a --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_SelectHorizontalAxis.xpm @@ -0,0 +1,49 @@ +/* XPM */ +static char *Sketcher_SelectHorizontalAxis[] = { +/* columns rows colors chars-per-pixel */ +"16 16 27 1 ", +" c #6492BD930E21", +". c #65BDBB6612A9", +"X c #70BFBD3A2722", +"o c #71AFBB822ABA", +"O c #6A6FC5D7117B", +"+ c #6B6AC6181327", +"@ c #6BBCC6B1132F", +"# c #6DF1CC90119B", +"$ c #6E13983245BC", +"% c #6FF39B964614", +"& c #72539E56481A", +"* c #AE70BE399F68", +"= c #9FD3C0A0806F", +"- c #A43AC8CC8144", +"; c #B116D0D492AB", +": c #BC8DDB359F90", +"> c #BD25DB88A069", +", c #C69BE011AE8B", +"< c #E4C9EFE9DA3A", +"1 c #E5C2F08FDB84", +"2 c #E7E4F276DDD7", +"3 c #EDD7ED10EE94", +"4 c #F468F99DEF67", +"5 c #F5DCF57DF635", +"6 c #F7BBFB42F45E", +"7 c #FC35FBFCFC6A", +"8 c gray100", +/* pixels */ +"8888888888888888", +"8888888888888888", +"8888888888888888", +"8888888888888888", +"8888888888888888", +"8888888888888888", +"6,:>>>>>>>>>>>>2", +"1oOOOO@@OO@@@O.;", +" c #702CCF43134D", +", c #7315D2C3156A", +"< c #742FD3F01668", +"1 c #6E8F82815B9C", +"2 c #8397BC174DCF", +"3 c #8A35BFB6574C", +"4 c #8BE7C05259F7", +"5 c #9354C3F36534", +"6 c #9672C57C69B2", +"7 c #BE8CBE7FBE96", +"8 c #ABAECA0E8ED2", +"9 c #ADD0D1768BF9", +"0 c #B155D33B912D", +"q c #C6B4DEFEAFB5", +"w c #CA52E12CB4B8", +"e c #D211E592BFAA", +"r c #D33BD563D12C", +"t c #D482D402D4FF", +"y c #DF49E55CD988", +"u c #E4D5E41BE584", +"i c #E567E49CE629", +"p c #EF19F633E864", +"a c #F3BAF8FBEEC9", +"s c #F45EF931EFCE", +"d c #F6DEFAA7F346", +"f c #FE01FDEDFE14", +"g c #FFFFFFFFFFFE", +/* pixels */ +"gggggggggggggggg", +"gggggggggggggggg", +"gggggggggggggggg", +"gggggggggggggggg", +"gggggp936egggggg", +"ggggs4o;=*qggggg", +"ggggq+,<<;2dgggg", +"gggg0O<,,>&ygggg", +"ggggw@,,<:#rgggg", +"ggggd5X;=.1ugggg", +"ggggga8%$ 7ggggg", +"ggggggfutigggggg", +"gggggggggggggggg", +"gggggggggggggggg", +"gggggggggggggggg", +"gggggggggggggggg" +}; diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_SelectVerticalAxis.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_SelectVerticalAxis.xpm new file mode 100644 index 000000000..002f8533c --- /dev/null +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Sketcher_SelectVerticalAxis.xpm @@ -0,0 +1,51 @@ +/* XPM */ +static char *Sketcher_SelectVerticalAxis[] = { +/* columns rows colors chars-per-pixel */ +"16 16 29 1 ", +" c #6C4FBACC20CB", +". c #7155BEED2684", +"X c #790BBC6B387C", +"o c #6ECCD0490F65", +"O c #6877C356103D", +"+ c #6FA4D040110C", +"@ c #6F4EC1CD1F84", +"# c #6FADD064110E", +"$ c #7010D115111E", +"% c #6F69C1961FD2", +"& c #85A6C40E4995", +"* c #86C6C4A44B67", +"= c #871AC4B34BC8", +"- c #877DC2624F08", +"; c #92DCC64661A1", +": c #B535D6FE9531", +"> c #BD3EDAECA136", +", c #CD7DE3AEB87C", +"< c #DB00EAC5CC03", +"1 c #DB3EEAF8CC73", +"2 c #E1D3EEC1D597", +"3 c #E4C5EFD3DA4C", +"4 c #E877F231DF3D", +"5 c #EE5CF5BAE750", +"6 c #F33BF8B9EE0B", +"7 c #F97FFBBAF770", +"8 c #F9BAFBE5F7C2", +"9 c #FC12FDC1FA77", +"0 c gray100", +/* pixels */ +"000000,:>6000000", +"000007-O 1000000", +"000007=$@<000000", +"000007=+@<000000", +"000007=+@<000000", +"000007=#@<000000", +"000007=+@<000000", +"000007=#%<000000", +"000007&+%1000000", +"000007&+%1000000", +"000007=+%1000000", +"000007=+%1000000", +"000007=+%1000000", +"000007=o@1000000", +"000007;.X2000000", +"0000005349000000" +}; diff --git a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp index 0253bb4c3..cd0a003b7 100644 --- a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp +++ b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp @@ -43,12 +43,14 @@ TaskDlgEditSketch::TaskDlgEditSketch(ViewProviderSketch *sketchView) { assert(sketchView); Constraints = new TaskSketcherConstrains(sketchView); + Elements = new TaskSketcherElements(sketchView); General = new TaskSketcherGeneral(sketchView); Messages = new TaskSketcherMessages(sketchView); Content.push_back(Messages); Content.push_back(General); Content.push_back(Constraints); + Content.push_back(Elements); } TaskDlgEditSketch::~TaskDlgEditSketch() diff --git a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h index 79e2f77e1..b1ec85303 100644 --- a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h +++ b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h @@ -28,6 +28,7 @@ #include "ViewProviderSketch.h" #include "TaskSketcherConstrains.h" +#include "TaskSketcherElements.h" #include "TaskSketcherGeneral.h" #include "TaskSketcherMessages.h" @@ -66,6 +67,7 @@ public: protected: ViewProviderSketch *sketchView; TaskSketcherConstrains *Constraints; + TaskSketcherElements *Elements; TaskSketcherGeneral *General; TaskSketcherMessages *Messages; }; diff --git a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp new file mode 100644 index 000000000..f699af27d --- /dev/null +++ b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp @@ -0,0 +1,809 @@ +/*************************************************************************** + * Copyright (c) 2014 Abdullah Tahiri +# include +#endif + +#include "TaskSketcherElements.h" +#include "ui_TaskSketcherElements.h" +#include "EditDatumDialog.h" +#include "ViewProviderSketch.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace SketcherGui; +using namespace Gui::TaskView; + +/// Inserts a QAction into an existing menu +/// ICONSTR is the string of the icon in the resource file +/// NAMESTR is the text appearing in the contextual menuAction +/// CMDSTR is the string registered in the commandManager +/// FUNC is the name of the member function to be executed on selection of the menu item +#define CONTEXT_ITEM(ICONSTR,NAMESTR,CMDSTR,FUNC) \ +QIcon icon_ ## FUNC( Gui::BitmapFactory().pixmap(ICONSTR) ); \ + QAction* constr_ ## FUNC = menu.addAction(icon_ ## FUNC,tr(NAMESTR), this, SLOT(FUNC()), \ + QKeySequence(QString::fromUtf8(Gui::Application::Instance->commandManager().getCommandByName(CMDSTR)->getAccel()))); \ + constr_ ## FUNC->setEnabled(!items.isEmpty()); + +/// Defines the member function corresponding to the CONTEXT_ITEM macro +#define CONTEXT_MEMBER_DEF(CMDSTR,FUNC) \ +void ElementView::FUNC(){ \ + Gui::Application::Instance->commandManager().runCommandByName(CMDSTR);} + +// helper class to store additional information about the listWidget entry. +class ElementItem : public QListWidgetItem +{ +public: + ElementItem( const QIcon & icon, const QString & text, int elementnr, + int startingVertex, int midVertex, int endVertex, + Base::Type geometryType) + : QListWidgetItem(icon,text),ElementNbr(elementnr), + StartingVertex(startingVertex), MidVertex(midVertex), EndVertex(endVertex), + GeometryType(geometryType),isLineSelected(false), + isStartingPointSelected(false),isEndPointSelected(false),isMidPointSelected(false) + { + + } + ElementItem( const QString & text,int elementnr, + int startingVertex, int midVertex, int endVertex, + Base::Type geometryType) + : QListWidgetItem(text),ElementNbr(elementnr), + StartingVertex(startingVertex), MidVertex(midVertex), EndVertex(endVertex), + GeometryType(geometryType),isLineSelected(false), + isStartingPointSelected(false),isEndPointSelected(false),isMidPointSelected(false) + { + + } + ~ElementItem() + { + } + + int ElementNbr; + int StartingVertex; + int MidVertex; + int EndVertex; + bool isLineSelected; + bool isStartingPointSelected; + bool isEndPointSelected; + bool isMidPointSelected; + Base::Type GeometryType; +}; + +ElementView::ElementView(QWidget *parent) + : QListWidget(parent) +{ +} + +ElementView::~ElementView() +{ +} + +void ElementView::contextMenuEvent (QContextMenuEvent* event) +{ + QMenu menu; + QListWidgetItem* item = currentItem(); + QList items = selectedItems(); + + // CONTEXT_ITEM(ICONSTR,NAMESTR,FUNC,KEY) + CONTEXT_ITEM("Constraint_PointOnPoint","Point Coincidence","Sketcher_ConstrainCoincident",doPointCoincidence) + CONTEXT_ITEM("Constraint_PointOnObject","Point on Object","Sketcher_ConstrainPointOnObject",doPointOnObjectConstraint) + CONTEXT_ITEM("Constraint_Vertical","Vertical Constraint","Sketcher_ConstrainVertical", doVerticalConstraint) + CONTEXT_ITEM("Constraint_Horizontal","Horizontal Constraint","Sketcher_ConstrainHorizontal",doHorizontalConstraint) + CONTEXT_ITEM("Constraint_Parallel","Parallel Constraint","Sketcher_ConstrainParallel",doParallelConstraint) + CONTEXT_ITEM("Constraint_Perpendicular","Perpendicular Constraint","Sketcher_ConstrainPerpendicular",doPerpendicularConstraint) + CONTEXT_ITEM("Constraint_Tangent","Tangent Constraint","Sketcher_ConstrainTangent",doTangentConstraint) + CONTEXT_ITEM("Constraint_EqualLength","Equal Length","Sketcher_ConstrainEqual",doEqualConstraint) + CONTEXT_ITEM("Constraint_Symmetric","Symetric","Sketcher_ConstrainSymmetric",doSymetricConstraint) + CONTEXT_ITEM("Sketcher_ConstrainLock","Lock Constraint","Sketcher_ConstrainLock",doLockConstraint) + CONTEXT_ITEM("Constraint_HorizontalDistance","Horizontal Distance","Sketcher_ConstrainDistanceX",doHorizontalDistance) + CONTEXT_ITEM("Constraint_VerticalDistance","Vertical Distance","Sketcher_ConstrainDistanceY",doVerticalDistance) + CONTEXT_ITEM("Constraint_Length","Length Constraint","Sketcher_ConstrainDistance",doLengthConstraint) + CONTEXT_ITEM("Constraint_Radius","Radius Constraint","Sketcher_ConstrainRadius",doRadiusConstraint) + CONTEXT_ITEM("Constraint_InternalAngle","Angle Constraint","Sketcher_ConstrainAngle",doAngleConstraint) + + QAction* sep = menu.addSeparator(); + + CONTEXT_ITEM("Sketcher_AlterConstruction","Toggle construction line","Sketcher_ToggleConstruction",doToggleConstruction) + + QAction* sep1 = menu.addSeparator(); + + CONTEXT_ITEM("Sketcher_CloseShape","Close Shape","Sketcher_CloseShape",doCloseShape) + CONTEXT_ITEM("Sketcher_ConnectLines","Connect","Sketcher_ConnectLines",doConnect) + CONTEXT_ITEM("Sketcher_SelectConstraints","Select Constraints","Sketcher_SelectConstraints",doSelectConstraints) + CONTEXT_ITEM("Sketcher_SelectOrigin","Select Origin","Sketcher_SelectOrigin",doSelectOrigin) + CONTEXT_ITEM("Sketcher_SelectHorizontalAxis","Select Horizontal Axis","Sketcher_SelectHorizontalAxis",doSelectHAxis) + CONTEXT_ITEM("Sketcher_SelectVerticalAxis","Select Vertical Axis","Sketcher_SelectVerticalAxis",doSelectVAxis) + + QAction* sep2 = menu.addSeparator(); + + QAction* remove = menu.addAction(tr("Delete"), this, SLOT(deleteSelectedItems()), + QKeySequence(QKeySequence::Delete)); + remove->setEnabled(!items.isEmpty()); + + menu.menuAction()->setIconVisibleInMenu(true); + + menu.exec(event->globalPos()); +} + +CONTEXT_MEMBER_DEF("Sketcher_ConstrainDistanceX",doHorizontalDistance) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainDistanceY",doVerticalDistance) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainHorizontal",doHorizontalConstraint) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainVertical",doVerticalConstraint) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainLock",doLockConstraint) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainCoincident",doPointCoincidence) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainParallel",doParallelConstraint) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainPerpendicular",doPerpendicularConstraint) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainDistance",doLengthConstraint) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainRadius",doRadiusConstraint) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainAngle",doAngleConstraint) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainEqual",doEqualConstraint) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainPointOnObject",doPointOnObjectConstraint) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainSymmetric",doSymetricConstraint) +CONTEXT_MEMBER_DEF("Sketcher_ConstrainTangent",doTangentConstraint) +CONTEXT_MEMBER_DEF("Sketcher_CloseShape",doCloseShape) +CONTEXT_MEMBER_DEF("Sketcher_ConnectLines",doConnect) +CONTEXT_MEMBER_DEF("Sketcher_ToggleConstruction",doToggleConstruction) +CONTEXT_MEMBER_DEF("Sketcher_SelectConstraints",doSelectConstraints) +CONTEXT_MEMBER_DEF("Sketcher_SelectOrigin",doSelectOrigin) +CONTEXT_MEMBER_DEF("Sketcher_SelectHorizontalAxis",doSelectHAxis) +CONTEXT_MEMBER_DEF("Sketcher_SelectVerticalAxis",doSelectVAxis) + +void ElementView::deleteSelectedItems() +{ + App::Document* doc = App::GetApplication().getActiveDocument(); + if (!doc) return; + + doc->openTransaction("Delete"); + std::vector sel = Gui::Selection().getSelectionEx(doc->getName()); + for (std::vector::iterator ft = sel.begin(); ft != sel.end(); ++ft) { + Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(ft->getObject()); + if (vp) { + vp->onDelete(ft->getSubNames()); + } + } + doc->commitTransaction(); +} + + +void ElementView::keyPressEvent(QKeyEvent * event) +{ + switch (event->key()) + { + case Qt::Key_Z: + // signal + onFilterShortcutPressed(); + break; + default: + QListWidget::keyPressEvent( event ); + break; + } +} +// ---------------------------------------------------------------------------- + +TaskSketcherElements::TaskSketcherElements(ViewProviderSketch *sketchView) + : TaskBox(Gui::BitmapFactory().pixmap("document-new"),tr("Elements"),true, 0), + sketchView(sketchView), inhibitSelectionUpdate(false), focusItemIndex(-1), + isNamingBoxChecked(false), isautoSwitchBoxChecked(false), previouslySelectedItemIndex(-1) +{ + // we need a separate container widget to add all controls to + proxy = new QWidget(this); + ui = new Ui_TaskSketcherElements(); + ui->setupUi(proxy); + ui->listWidgetElements->setSelectionMode(QAbstractItemView::ExtendedSelection); + ui->listWidgetElements->setEditTriggers(QListWidget::NoEditTriggers); + ui->listWidgetElements->setMouseTracking(true); + + // connecting the needed signals + QObject::connect( + ui->listWidgetElements, SIGNAL(itemSelectionChanged()), + this , SLOT (on_listWidgetElements_itemSelectionChanged()) + ); + QObject::connect( + ui->listWidgetElements, SIGNAL(itemEntered(QListWidgetItem *)), + this , SLOT (on_listWidgetElements_itemEntered(QListWidgetItem *)) + ); + QObject::connect( + ui->listWidgetElements, SIGNAL(onFilterShortcutPressed()), + this , SLOT (on_listWidgetElements_filterShortcutPressed()) + ); + QObject::connect( + ui->comboBoxElementFilter, SIGNAL(currentIndexChanged(int)), + this , SLOT (on_listWidgetElements_currentFilterChanged(int)) + ); + QObject::connect( + ui->namingBox, SIGNAL(stateChanged(int)), + this , SLOT (on_namingBox_stateChanged(int)) + ); + QObject::connect( + ui->autoSwitchBox, SIGNAL(stateChanged(int)), + this , SLOT (on_autoSwitchBox_stateChanged(int)) + ); + + + connectionElementsChanged = sketchView->signalElementsChanged.connect( + boost::bind(&SketcherGui::TaskSketcherElements::slotElementsChanged, this)); + + this->groupLayout()->addWidget(proxy); + + ui->comboBoxElementFilter->setCurrentIndex(0); + + ui->namingBox->setCheckState(Qt::Unchecked); + ui->autoSwitchBox->setCheckState(Qt::Checked); + + slotElementsChanged(); +} + +TaskSketcherElements::~TaskSketcherElements() +{ + connectionElementsChanged.disconnect(); + delete ui; +} + +void TaskSketcherElements::onSelectionChanged(const Gui::SelectionChanges& msg) +{ + std::string temp; + if (msg.Type == Gui::SelectionChanges::ClrSelection) { + clearWidget(); + } + else if (msg.Type == Gui::SelectionChanges::AddSelection || + msg.Type == Gui::SelectionChanges::RmvSelection) { + bool select = (msg.Type == Gui::SelectionChanges::AddSelection); + // is it this object?? + if (strcmp(msg.pDocName,sketchView->getSketchObject()->getDocument()->getName())==0 && + strcmp(msg.pObjectName,sketchView->getSketchObject()->getNameInDocument())== 0) { + if (msg.pSubName) { + QString expr = QString::fromAscii(msg.pSubName); + std::string shapetype(msg.pSubName); + // if-else edge vertex + if (shapetype.size() > 4 && shapetype.substr(0,4) == "Edge") + { + QRegExp rx(QString::fromAscii("^Edge(\\d+)$")); + int pos = expr.indexOf(rx); + if (pos > -1) { + bool ok; + int ElementId = rx.cap(1).toInt(&ok) - 1; + if (ok) { + int countItems = ui->listWidgetElements->count(); + for (int i=0; i < countItems; i++) { + ElementItem* item = static_cast + (ui->listWidgetElements->item(i)); + if (item->ElementNbr == ElementId) { + item->isLineSelected=select; + break; + } + } + } + } + } + else if (shapetype.size() > 6 && shapetype.substr(0,6) == "Vertex"){ + QRegExp rx(QString::fromAscii("^Vertex(\\d+)$")); + int pos = expr.indexOf(rx); + if (pos > -1) { + bool ok; + int ElementId = rx.cap(1).toInt(&ok) - 1; + if (ok) { + // Get the GeoID&Pos + int GeoId; + Sketcher::PointPos PosId; + sketchView->getSketchObject()->getGeoVertexIndex(ElementId,GeoId, PosId); + + int countItems = ui->listWidgetElements->count(); + for (int i=0; i < countItems; i++) { + ElementItem* item = static_cast + (ui->listWidgetElements->item(i)); + if (item->ElementNbr == GeoId) { + switch(PosId) + { + case Sketcher::start: + item->isStartingPointSelected=select; + break; + case Sketcher::end: + item->isEndPointSelected=select; + break; + case Sketcher::mid: + item->isMidPointSelected=select; + break; + } + break; + } + } + } + } + } + // update the listwidget + int element=ui->comboBoxElementFilter->currentIndex(); + + ui->listWidgetElements->blockSignals(true); + + + for (int i=0;ilistWidgetElements->count(); i++) { + ElementItem * ite=static_cast(ui->listWidgetElements->item(i)); + + switch(element){ + case 0: + ite->setSelected(ite->isLineSelected); + break; + case 1: + ite->setSelected(ite->isStartingPointSelected); + break; + case 2: + ite->setSelected(ite->isEndPointSelected); + break; + case 3: + ite->setSelected(ite->isMidPointSelected); + break; + } + } + + ui->listWidgetElements->blockSignals(false); + + } + } + } + else if (msg.Type == Gui::SelectionChanges::SetSelection) { + // do nothing here + } +} + + +void TaskSketcherElements::on_listWidgetElements_itemSelectionChanged(void) +{ + ui->listWidgetElements->blockSignals(true); + + + // selection changed because we acted on the current entered item + // we can not do this with ItemPressed because that signal is triggered after this one + int element=ui->comboBoxElementFilter->currentIndex(); + + ElementItem * itf; + + if(focusItemIndex>-1 && focusItemIndexlistWidgetElements->count()) + itf=static_cast(ui->listWidgetElements->item(focusItemIndex)); + else + itf=NULL; + + bool multipleselection=true; // ctrl type of selection in listWidget + bool multipleconsecutiveselection=false; // shift type of selection in listWidget + + if(!inhibitSelectionUpdate){ + if(itf!=NULL) { + switch(element){ + case 0: + itf->isLineSelected=!itf->isLineSelected; + break; + case 1: + itf->isStartingPointSelected=!itf->isStartingPointSelected; + break; + case 2: + itf->isEndPointSelected=!itf->isEndPointSelected; + break; + case 3: + itf->isMidPointSelected=!itf->isMidPointSelected; + break; + } + } + + if(QApplication::keyboardModifiers()==Qt::ControlModifier)// multiple ctrl selection? + multipleselection=true; + else + multipleselection=false; + + if(QApplication::keyboardModifiers()==Qt::ShiftModifier)// multiple shift selection? + multipleconsecutiveselection=true; + else + multipleconsecutiveselection=false; + + if(multipleselection && multipleconsecutiveselection){ // ctrl takes priority over shift functionality + multipleselection=true; + multipleconsecutiveselection=false; + } + } + + std::string doc_name = sketchView->getSketchObject()->getDocument()->getName(); + std::string obj_name = sketchView->getSketchObject()->getNameInDocument(); + + bool block = this->blockConnection(true); // avoid to be notified by itself + Gui::Selection().clearSelection(); + + for (int i=0;ilistWidgetElements->count(); i++) { + ElementItem * ite=static_cast(ui->listWidgetElements->item(i)); + + if(multipleselection==false && multipleconsecutiveselection==false && ite!=itf) + { + ite->isLineSelected=false; + ite->isStartingPointSelected=false; + ite->isEndPointSelected=false; + ite->isMidPointSelected=false; + } + + if(multipleconsecutiveselection==true) + { + if( (( i>focusItemIndex && ipreviouslySelectedItemIndex )) && + previouslySelectedItemIndex>=0){ + // select the element of the Item + switch(element){ + case 0: + ite->isLineSelected=true; + break; + case 1: + ite->isStartingPointSelected=true; + break; + case 2: + ite->isEndPointSelected=true; + break; + case 3: + ite->isMidPointSelected=true; + break; + } + } + } + + // first update the listwidget + switch(element){ + case 0: + ite->setSelected(ite->isLineSelected); + break; + case 1: + ite->setSelected(ite->isStartingPointSelected); + break; + case 2: + ite->setSelected(ite->isEndPointSelected); + break; + case 3: + ite->setSelected(ite->isMidPointSelected); + break; + } + + // now the scene + std::stringstream ss; + int vertex; + + if(ite->isLineSelected){ + ss << "Edge" << ite->ElementNbr + 1; + Gui::Selection().addSelection(doc_name.c_str(), obj_name.c_str(), ss.str().c_str()); + } + + if(ite->isStartingPointSelected){ + ss.str(std::string()); + vertex= ite->StartingVertex; + if(vertex!=-1){ + ss << "Vertex" << vertex + 1; + Gui::Selection().addSelection(doc_name.c_str(), obj_name.c_str(), ss.str().c_str()); + } + } + + if(ite->isEndPointSelected){ + ss.str(std::string()); + vertex= ite->EndVertex; + if(vertex!=-1){ + ss << "Vertex" << vertex + 1; + Gui::Selection().addSelection(doc_name.c_str(), obj_name.c_str(), ss.str().c_str()); + } + } + + if(ite->isMidPointSelected){ + ss.str(std::string()); + vertex= ite->MidVertex; + if(vertex!=-1){ + ss << "Vertex" << vertex + 1; + Gui::Selection().addSelection(doc_name.c_str(), obj_name.c_str(), ss.str().c_str()); + } + } + } + this->blockConnection(block); + ui->listWidgetElements->blockSignals(false); + + if(focusItemIndex>-1 && focusItemIndexlistWidgetElements->count()) + previouslySelectedItemIndex=focusItemIndex; +} + +void TaskSketcherElements::on_listWidgetElements_itemEntered(QListWidgetItem *item) +{ + ElementItem *it = dynamic_cast(item); + if (!item) return; + + Gui::Selection().rmvPreselect(); + + ui->listWidgetElements->setFocus(); + + int tempitemindex=ui->listWidgetElements->row(item); + + std::string doc_name = sketchView->getSketchObject()->getDocument()->getName(); + std::string obj_name = sketchView->getSketchObject()->getNameInDocument(); + + /* 0 - Lines + * 1 - Starting Points + * 2 - End Points + * 3 - Middle Points + */ + std::stringstream ss; + + + // Edge Auto-Switch functionality + if(isautoSwitchBoxChecked && tempitemindex!=focusItemIndex){ + ui->listWidgetElements->blockSignals(true); + ui->comboBoxElementFilter->setCurrentIndex(0); + ui->listWidgetElements->blockSignals(false); + } + + int element=ui->comboBoxElementFilter->currentIndex(); + + focusItemIndex=tempitemindex; + + int vertex; + + switch(element) + { + case 0: + ss << "Edge" << it->ElementNbr + 1; + Gui::Selection().setPreselect(doc_name.c_str(), obj_name.c_str(), ss.str().c_str()); + break; + case 1: + case 2: + case 3: + vertex= sketchView->getSketchObject()->getVertexIndexGeoPos(it->ElementNbr,static_cast(element)); + if(vertex!=-1){ + ss << "Vertex" << vertex + 1; + Gui::Selection().setPreselect(doc_name.c_str(), obj_name.c_str(), ss.str().c_str()); + } + break; + } + +} + +void TaskSketcherElements::leaveEvent ( QEvent * event ) +{ + Gui::Selection().rmvPreselect(); + ui->listWidgetElements->clearFocus(); + //Base::leaveEvent(event); +} + +void TaskSketcherElements::slotElementsChanged(void) +{ + QIcon Sketcher_Element_Arc_Edge( Gui::BitmapFactory().pixmap("Sketcher_Element_Arc_Edge") ); + QIcon Sketcher_Element_Arc_EndPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Arc_EndPoint") ); + QIcon Sketcher_Element_Arc_MidPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Arc_MidPoint") ); + QIcon Sketcher_Element_Arc_StartingPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Arc_StartingPoint") ); + QIcon Sketcher_Element_Circle_Edge( Gui::BitmapFactory().pixmap("Sketcher_Element_Circle_Edge") ); + QIcon Sketcher_Element_Circle_MidPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Circle_MidPoint") ); + QIcon Sketcher_Element_Line_Edge( Gui::BitmapFactory().pixmap("Sketcher_Element_Line_Edge") ); + QIcon Sketcher_Element_Line_EndPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Line_EndPoint") ); + QIcon Sketcher_Element_Line_StartingPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Line_StartingPoint") ); + QIcon Sketcher_Element_Point_StartingPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Point_StartingPoint") ); + + QIcon none( Gui::BitmapFactory().pixmap("Sketcher_Element_SelectionTypeInvalid") ); + + assert(sketchView); + // Build up ListView with the elements + const std::vector< Part::Geometry * > &vals = sketchView->getSketchObject()->Geometry.getValues(); + + ui->listWidgetElements->clear(); + + int element = ui->comboBoxElementFilter->currentIndex(); + + int i=1; + for(std::vector< Part::Geometry * >::const_iterator it= vals.begin();it!=vals.end();++it,++i){ + Base::Type type = (*it)->getTypeId(); + + ui->listWidgetElements->addItem(new ElementItem( + (type == Part::GeomPoint::getClassTypeId() && element==1) ? Sketcher_Element_Point_StartingPoint : + (type == Part::GeomLineSegment::getClassTypeId() && element==0) ? Sketcher_Element_Line_Edge : + (type == Part::GeomLineSegment::getClassTypeId() && element==1) ? Sketcher_Element_Line_StartingPoint : + (type == Part::GeomLineSegment::getClassTypeId() && element==2) ? Sketcher_Element_Line_EndPoint : + (type == Part::GeomArcOfCircle::getClassTypeId() && element==0) ? Sketcher_Element_Arc_Edge : + (type == Part::GeomArcOfCircle::getClassTypeId() && element==1) ? Sketcher_Element_Arc_StartingPoint : + (type == Part::GeomArcOfCircle::getClassTypeId() && element==2) ? Sketcher_Element_Arc_EndPoint : + (type == Part::GeomArcOfCircle::getClassTypeId() && element==3) ? Sketcher_Element_Arc_MidPoint : + (type == Part::GeomCircle::getClassTypeId() && element==0) ? Sketcher_Element_Circle_Edge : + (type == Part::GeomCircle::getClassTypeId() && element==3) ? Sketcher_Element_Circle_MidPoint : + none, + type == Part::GeomPoint::getClassTypeId() ? ( isNamingBoxChecked ? + (tr("Point") + QString::fromLatin1("(Edge%1)").arg(i)): + (QString::fromLatin1("%1-").arg(i)+tr("Point"))) : + type == Part::GeomLineSegment::getClassTypeId() ? ( isNamingBoxChecked ? + (tr("Line") + QString::fromLatin1("(Edge%1)").arg(i)): + (QString::fromLatin1("%1-").arg(i)+tr("Line"))) : + type == Part::GeomArcOfCircle::getClassTypeId() ? ( isNamingBoxChecked ? + (tr("Arc") + QString::fromLatin1("(Edge%1)").arg(i)): + (QString::fromLatin1("%1-").arg(i)+tr("Arc"))) : + type == Part::GeomCircle::getClassTypeId() ? ( isNamingBoxChecked ? + (tr("Circle") + QString::fromLatin1("(Edge%1)").arg(i)): + (QString::fromLatin1("%1-").arg(i)+tr("Circle"))) : + ( isNamingBoxChecked ? + (tr("Other") + QString::fromLatin1("(Edge%1)").arg(i)): + (QString::fromLatin1("%1-").arg(i)+tr("Other"))), + i-1, + sketchView->getSketchObject()->getVertexIndexGeoPos(i-1,Sketcher::start), + sketchView->getSketchObject()->getVertexIndexGeoPos(i-1,Sketcher::mid), + sketchView->getSketchObject()->getVertexIndexGeoPos(i-1,Sketcher::end), + type)); + } +} + + +void TaskSketcherElements::on_listWidgetElements_filterShortcutPressed() +{ + int element; + + previouslySelectedItemIndex=-1; // Shift selection on list widget implementation + + // calculate next element type on shift press according to entered/preselected element + // This is the aka fast-forward functionality + if(focusItemIndex>-1 && focusItemIndexlistWidgetElements->count()){ + + ElementItem * itf=static_cast(ui->listWidgetElements->item(focusItemIndex)); + + Base::Type type = itf->GeometryType; + + element = ui->comboBoxElementFilter->currentIndex(); // currently selected type index + + switch(element) + { + case 0: // Edge + element = ( type == Part::GeomCircle::getClassTypeId() ) ? 3 : 1; + break; + case 1: // StartingPoint + element = ( type == Part::GeomCircle::getClassTypeId() ) ? 3 : + ( type == Part::GeomPoint::getClassTypeId() ) ? 1 : 2; + break; + case 2: // EndPoint + element = ( type == Part::GeomLineSegment::getClassTypeId() ) ? 0 : + ( type == Part::GeomPoint::getClassTypeId() ) ? 1 : 3; + break; + case 3: // MidPoint + element = ( type == Part::GeomPoint::getClassTypeId() ) ? 1 : 0; + break; + default: + element = 0; + } + + ui->comboBoxElementFilter->setCurrentIndex(element); + + Gui::Selection().rmvPreselect(); + + on_listWidgetElements_itemEntered(itf); + } + else{ + element = (ui->comboBoxElementFilter->currentIndex()+1) % + ui->comboBoxElementFilter->count(); + + ui->comboBoxElementFilter->setCurrentIndex(element); + + Gui::Selection().rmvPreselect(); + } + + //update the icon + updateIcons(element); + + updatePreselection(); +} + + +void TaskSketcherElements::on_namingBox_stateChanged(int state) +{ + isNamingBoxChecked=(state==Qt::Checked); + slotElementsChanged(); +} + +void TaskSketcherElements::on_autoSwitchBox_stateChanged(int state) +{ + isautoSwitchBoxChecked=(state==Qt::Checked); + ui->comboBoxElementFilter->setCurrentIndex(0); +} + +void TaskSketcherElements::on_listWidgetElements_currentFilterChanged ( int index ) +{ + previouslySelectedItemIndex=-1; // Shift selection on list widget implementation + + Gui::Selection().rmvPreselect(); + + updateIcons(index); + + updatePreselection(); + +} + +void TaskSketcherElements::updatePreselection() +{ + inhibitSelectionUpdate=true; + on_listWidgetElements_itemSelectionChanged(); + inhibitSelectionUpdate=false; +} + +void TaskSketcherElements::clearWidget() +{ + ui->listWidgetElements->blockSignals(true); + ui->listWidgetElements->clearSelection (); + ui->listWidgetElements->blockSignals(false); + + // update widget + int countItems = ui->listWidgetElements->count(); + for (int i=0; i < countItems; i++) { + ElementItem* item = static_cast (ui->listWidgetElements->item(i)); + item->isLineSelected=false; + item->isStartingPointSelected=false; + item->isEndPointSelected=false; + item->isMidPointSelected=false; + } +} + +void TaskSketcherElements::updateIcons(int element) +{ + QIcon Sketcher_Element_Arc_Edge( Gui::BitmapFactory().pixmap("Sketcher_Element_Arc_Edge") ); + QIcon Sketcher_Element_Arc_EndPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Arc_EndPoint") ); + QIcon Sketcher_Element_Arc_MidPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Arc_MidPoint") ); + QIcon Sketcher_Element_Arc_StartingPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Arc_StartingPoint") ); + QIcon Sketcher_Element_Circle_Edge( Gui::BitmapFactory().pixmap("Sketcher_Element_Circle_Edge") ); + QIcon Sketcher_Element_Circle_MidPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Circle_MidPoint") ); + QIcon Sketcher_Element_Line_Edge( Gui::BitmapFactory().pixmap("Sketcher_Element_Line_Edge") ); + QIcon Sketcher_Element_Line_EndPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Line_EndPoint") ); + QIcon Sketcher_Element_Line_StartingPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Line_StartingPoint") ); + QIcon Sketcher_Element_Point_StartingPoint( Gui::BitmapFactory().pixmap("Sketcher_Element_Point_StartingPoint") ); + QIcon none( Gui::BitmapFactory().pixmap("Sketcher_Element_SelectionTypeInvalid") ); + + for (int i=0;ilistWidgetElements->count(); i++) { + Base::Type type = static_cast(ui->listWidgetElements->item(i))->GeometryType; + + ui->listWidgetElements->item(i)->setIcon( + (type == Part::GeomPoint::getClassTypeId() && element==1) ? Sketcher_Element_Point_StartingPoint : + (type == Part::GeomLineSegment::getClassTypeId() && element==0) ? Sketcher_Element_Line_Edge : + (type == Part::GeomLineSegment::getClassTypeId() && element==1) ? Sketcher_Element_Line_StartingPoint : + (type == Part::GeomLineSegment::getClassTypeId() && element==2) ? Sketcher_Element_Line_EndPoint : + (type == Part::GeomArcOfCircle::getClassTypeId() && element==0) ? Sketcher_Element_Arc_Edge : + (type == Part::GeomArcOfCircle::getClassTypeId() && element==1) ? Sketcher_Element_Arc_StartingPoint : + (type == Part::GeomArcOfCircle::getClassTypeId() && element==2) ? Sketcher_Element_Arc_EndPoint : + (type == Part::GeomArcOfCircle::getClassTypeId() && element==3) ? Sketcher_Element_Arc_MidPoint : + (type == Part::GeomCircle::getClassTypeId() && element==0) ? Sketcher_Element_Circle_Edge : + (type == Part::GeomCircle::getClassTypeId() && element==3) ? Sketcher_Element_Circle_MidPoint : + none); + } +} + +void TaskSketcherElements::changeEvent(QEvent *e) +{ + TaskBox::changeEvent(e); + if (e->type() == QEvent::LanguageChange) { + ui->retranslateUi(proxy); + } +} + + + +#include "moc_TaskSketcherElements.cpp" diff --git a/src/Mod/Sketcher/Gui/TaskSketcherElements.h b/src/Mod/Sketcher/Gui/TaskSketcherElements.h new file mode 100644 index 000000000..caf7d1bd6 --- /dev/null +++ b/src/Mod/Sketcher/Gui/TaskSketcherElements.h @@ -0,0 +1,134 @@ +/*************************************************************************** + * Copyright (c) 2014 Abdullah Tahiri +#include +#include + +namespace App { +class Property; +} + +namespace SketcherGui { + +class ViewProviderSketch; +class Ui_TaskSketcherElements; + +class ElementView : public QListWidget +{ + Q_OBJECT + +public: + explicit ElementView(QWidget *parent = 0); + ~ElementView(); + + +Q_SIGNALS: + void onFilterShortcutPressed(); + void signalCloseShape(); + +protected: + void contextMenuEvent (QContextMenuEvent* event); + void keyPressEvent(QKeyEvent * event); + +protected Q_SLOTS: + void deleteSelectedItems(); + // Constraints + void doHorizontalDistance(); + void doVerticalDistance(); + void doHorizontalConstraint(); + void doVerticalConstraint(); + void doLockConstraint(); + void doPointCoincidence(); + void doParallelConstraint(); + void doPerpendicularConstraint(); + void doLengthConstraint(); + void doRadiusConstraint(); + void doAngleConstraint(); + void doEqualConstraint(); + void doPointOnObjectConstraint(); + void doSymetricConstraint(); + void doTangentConstraint(); + // Other Commands + void doToggleConstruction(); + // Acelerators + void doCloseShape(); + void doConnect(); + void doSelectOrigin(); + void doSelectHAxis(); + void doSelectVAxis(); + + void doSelectConstraints(); + +}; + +class TaskSketcherElements : public Gui::TaskView::TaskBox, public Gui::SelectionObserver +{ + Q_OBJECT + +public: + TaskSketcherElements(ViewProviderSketch *sketchView); + ~TaskSketcherElements(); + + /// Observer message from the Selection + void onSelectionChanged(const Gui::SelectionChanges& msg); + +private: + void slotElementsChanged(void); + void updateIcons(int element); + void updatePreselection(); + void clearWidget(); + +public Q_SLOTS: + void on_listWidgetElements_itemSelectionChanged(void); + void on_listWidgetElements_itemEntered(QListWidgetItem *item); + void on_listWidgetElements_filterShortcutPressed(); + void on_listWidgetElements_currentFilterChanged ( int index ); + void on_namingBox_stateChanged(int state); + void on_autoSwitchBox_stateChanged(int state); + +protected: + void changeEvent(QEvent *e); + void leaveEvent ( QEvent * event ); + ViewProviderSketch *sketchView; + typedef boost::BOOST_SIGNALS_NAMESPACE::connection Connection; + Connection connectionElementsChanged; + +private: + QWidget* proxy; + Ui_TaskSketcherElements* ui; + int focusItemIndex; + int previouslySelectedItemIndex; + + bool isNamingBoxChecked; + bool isautoSwitchBoxChecked; + + bool inhibitSelectionUpdate; +}; + +} //namespace SketcherGui + +#endif // GUI_TASKVIEW_TASKAPPERANCE_H diff --git a/src/Mod/Sketcher/Gui/TaskSketcherElements.ui b/src/Mod/Sketcher/Gui/TaskSketcherElements.ui new file mode 100644 index 000000000..394068927 --- /dev/null +++ b/src/Mod/Sketcher/Gui/TaskSketcherElements.ui @@ -0,0 +1,109 @@ + + + SketcherGui::TaskSketcherElements + + + + 0 + 0 + 214 + 401 + + + + Form + + + + + + + + Type: + + + + + + + false + + + + + + false + + + 0 + + + + Edge + + + + + Starting Point + + + + + End Point + + + + + Center Point + + + + + + + + + + 0 + + + + + + + Extended Naming + + + false + + + + + + + Auto-switch to Edge + + + false + + + + + + + <html><head/><body><p>&quot;Ctrl&quot;: multiple selection</p><p>&quot;Z&quot;: switch to next valid type</p></body></html> + + + + + + + + ElementView + QListWidget +
QListWidget
+
+
+ + +
diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 3f5b49e16..4d8887e58 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -127,7 +127,7 @@ SbColor ViewProviderSketch::ConstrDimColor (1.0f,0.149f,0.0f); // #FF26 SbColor ViewProviderSketch::ConstrIcoColor (1.0f,0.149f,0.0f); // #FF2600 -> (255, 38, 0) SbColor ViewProviderSketch::PreselectColor (0.88f,0.88f,0.0f); // #E1E100 -> (225,225, 0) SbColor ViewProviderSketch::SelectColor (0.11f,0.68f,0.11f); // #1CAD1C -> ( 28,173, 28) - +SbColor ViewProviderSketch::PreselectSelectedColor(0.36f,0.48f,0.11f); // #5D7B1C -> ( 93,123, 28) // Variables for holding previous click SbTime ViewProviderSketch::prvClickTime; SbVec3f ViewProviderSketch::prvClickPoint; @@ -212,7 +212,7 @@ struct EditData { SoCoordinate3 *CurvesCoordinate; SoCoordinate3 *RootCrossCoordinate; SoCoordinate3 *EditCurvesCoordinate; - SoLineSet *CurveSet; + SoLineSet *CurveSet; SoLineSet *RootCrossSet; SoLineSet *EditCurveSet; SoMarkerSet *PointSet; @@ -255,11 +255,12 @@ ViewProviderSketch::ViewProviderSketch() PointSize.setValue(4); zCross=0.001f; - zConstr=0.002f; - zLines=0.003f; - zPoints=0.004f; - zHighlight=0.005f; - zText=0.006f; + zConstr=0.003f; // constraint not construction + zLines=0.005f; + zHighLine=0.006f; + zPoints=0.007f; + zHighlight=0.009f; + zText=0.011f; zEdit=0.001f; xInit=0; @@ -1396,6 +1397,45 @@ void ViewProviderSketch::onSelectionChanged(const Gui::SelectionChanges& msg) // new QListWidgetItem(QString::fromAscii(temp.c_str()), selectionView); //} } + else if (msg.Type == Gui::SelectionChanges::SetPreselect) { + if (strcmp(msg.pDocName,getSketchObject()->getDocument()->getName())==0 + && strcmp(msg.pObjectName,getSketchObject()->getNameInDocument())== 0) { + if (msg.pSubName) { + std::string shapetype(msg.pSubName); + if (shapetype.size() > 4 && shapetype.substr(0,4) == "Edge") { + int GeoId = std::atoi(&shapetype[4]) - 1; + resetPreselectPoint(); + edit->PreselectCurve = GeoId; + edit->PreselectCross = -1; + edit->PreselectConstraintSet.clear(); + if (edit->sketchHandler) + edit->sketchHandler->applyCursor(); + this->updateColor(); + + } + else if (shapetype.size() > 6 && shapetype.substr(0,6) == "Vertex"){ + int PtIndex = std::atoi(&shapetype[6]) - 1; + setPreselectPoint(PtIndex); + edit->PreselectCurve = -1; + edit->PreselectCross = -1; + edit->PreselectConstraintSet.clear(); + if (edit->sketchHandler) + edit->sketchHandler->applyCursor(); + this->updateColor(); + } + } + } + } + else if (msg.Type == Gui::SelectionChanges::RmvPreselect) { + resetPreselectPoint(); + edit->PreselectCurve = -1; + edit->PreselectCross = -1; + edit->PreselectConstraintSet.clear(); + if (edit->sketchHandler) + edit->sketchHandler->applyCursor(); + this->updateColor(); + + } } } @@ -1867,7 +1907,10 @@ void ViewProviderSketch::updateColor(void) int CurvNum = edit->CurvesMaterials->diffuseColor.getNum(); SbColor *color = edit->CurvesMaterials->diffuseColor.startEditing(); SbColor *crosscolor = edit->RootCrossMaterials->diffuseColor.startEditing(); - + + SbVec3f *verts = edit->CurvesCoordinate->point.startEditing(); + int32_t *index = edit->CurveSet->numVertices.startEditing(); + // colors of the point set if (edit->FullyConstrained) for (int i=0; i < PtNum; i++) @@ -1883,25 +1926,78 @@ void ViewProviderSketch::updateColor(void) for (std::set::iterator it=edit->SelPointSet.begin(); it != edit->SelPointSet.end(); it++) - pcolor[*it] = SelectColor; + pcolor[*it] = (*it==(edit->PreselectPoint + 1) && (edit->PreselectPoint != -1))? + PreselectSelectedColor:SelectColor; // colors of the curves int intGeoCount = getSketchObject()->getHighestCurveIndex() + 1; int extGeoCount = getSketchObject()->getExternalGeometryCount(); + + float x,y,z; + + int j=0; // vertexindex + for (int i=0; i < CurvNum; i++) { int GeoId = edit->CurvIdToGeoId[i]; - if (edit->SelCurvSet.find(GeoId) != edit->SelCurvSet.end()) + // CurvId has several vertex a ssociated to 1 material + //edit->CurveSet->numVertices => [i] indicates number of vertex for line i. + int indexes=(edit->CurveSet->numVertices[i]); + + bool selected=(edit->SelCurvSet.find(GeoId) != edit->SelCurvSet.end()); + bool preselected=(edit->PreselectCurve == GeoId); + + if (selected && preselected){ + color[i] = PreselectSelectedColor; + for(int k=j; jPreselectCurve == GeoId) + for(int k=j; jgetGeometry(GeoId)->Construction) + { color[i] = CurveDraftColor; + for(int k=j; jFullyConstrained) + { color[i] = FullyConstrainedColor; + for(int k=j; jCurvesMaterials->diffuseColor.finishEditing(); edit->PointsMaterials->diffuseColor.finishEditing(); edit->RootCrossMaterials->diffuseColor.finishEditing(); + edit->CurvesCoordinate->point.finishEditing(); + edit->CurveSet->numVertices.finishEditing(); } bool ViewProviderSketch::isPointOnSketch(const SoPickedPoint *pp) const @@ -2616,15 +2714,15 @@ void ViewProviderSketch::draw(bool temp) edit->CurvesMaterials->diffuseColor.setNum(Index.size()); edit->PointsCoordinate->point.setNum(Points.size()); edit->PointsMaterials->diffuseColor.setNum(Points.size()); - + SbVec3f *verts = edit->CurvesCoordinate->point.startEditing(); int32_t *index = edit->CurveSet->numVertices.startEditing(); SbVec3f *pverts = edit->PointsCoordinate->point.startEditing(); int i=0; // setting up the line set for (std::vector::const_iterator it = Coords.begin(); it != Coords.end(); ++it,i++) - verts[i].setValue(it->x,it->y,zLines); - + verts[i].setValue(it->x,it->y,zLines); + i=0; // setting up the indexes of the line set for (std::vector::const_iterator it = Index.begin(); it != Index.end(); ++it,i++) index[i] = *it; @@ -3435,6 +3533,10 @@ void ViewProviderSketch::updateData(const App::Property *prop) // send the signal for the TaskDlg. signalConstraintsChanged(); } + if (edit && &(getSketchObject()->Geometry)) { + // send the signal for the TaskDlg. + signalElementsChanged(); + } } void ViewProviderSketch::onChanged(const App::Property *prop) @@ -3691,7 +3793,7 @@ void ViewProviderSketch::createEditInventorNodes(void) edit->CurveSet = new SoLineSet; edit->CurveSet->setName("CurvesLineSet"); curvesRoot->addChild(edit->CurveSet); - + // stuff for the RootCross lines +++++++++++++++++++++++++++++++++++++++ SoGroup* crossRoot = new Gui::SoSkipBoundingGroup; edit->pickStyleAxes = new SoPickStyle(); @@ -3839,6 +3941,7 @@ void ViewProviderSketch::setEditViewer(Gui::View3DInventorViewer* viewer, int Mo antiAliasing = (int)viewer->getAntiAliasingMode(); if (antiAliasing != Gui::View3DInventorViewer::None) viewer->setAntiAliasingMode(Gui::View3DInventorViewer::None); + } void ViewProviderSketch::unsetEditViewer(Gui::View3DInventorViewer* viewer) diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.h b/src/Mod/Sketcher/Gui/ViewProviderSketch.h index b9b8cdbc3..b7aa811e5 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.h +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.h @@ -217,6 +217,9 @@ public: boost::signal signalSetUp; /// signals if the sketch has been solved boost::signal signalSolved; + /// signals if the elements list has changed + boost::signal signalElementsChanged; + protected: virtual bool setEdit(int ModNum); @@ -341,6 +344,7 @@ protected: static SbColor ConstrIcoColor; static SbColor PreselectColor; static SbColor SelectColor; + static SbColor PreselectSelectedColor; static SbTime prvClickTime; static SbVec3f prvClickPoint; @@ -354,6 +358,7 @@ protected: float zHighlight; float zText; float zEdit; + float zHighLine; // reference coordinates for relative operations double xInit,yInit; diff --git a/src/Mod/Sketcher/Gui/Workbench.cpp b/src/Mod/Sketcher/Gui/Workbench.cpp index 49cb1e505..ab4ddc7a2 100644 --- a/src/Mod/Sketcher/Gui/Workbench.cpp +++ b/src/Mod/Sketcher/Gui/Workbench.cpp @@ -37,6 +37,7 @@ using namespace SketcherGui; qApp->translate("Workbench", "Sketcher"); qApp->translate("Workbench", "Sketcher geometries"); qApp->translate("Workbench", "Sketcher constraints"); + qApp->translate("Workbench", "Sketcher accelerators"); #endif /// @namespace SketcherGui @class Workbench @@ -75,10 +76,14 @@ Gui::MenuItem* Workbench::setupMenuBar() const cons->setCommand("Sketcher constraints"); addSketcherWorkbenchConstraints(*cons); + Gui::MenuItem* consaccel = new Gui::MenuItem(); + consaccel->setCommand("Sketcher accelerators"); + addSketcherWorkbenchAccelerators(*consaccel); addSketcherWorkbenchSketchActions( *sketch ); *sketch << geom - << cons; + << cons + << consaccel; return root; } @@ -99,7 +104,10 @@ Gui::ToolBarItem* Workbench::setupToolBars() const cons->setCommand("Sketcher constraints"); addSketcherWorkbenchConstraints( *cons ); - return root; + Gui::ToolBarItem* consaccel = new Gui::ToolBarItem(root); + consaccel->setCommand("Sketcher accelerators"); + addSketcherWorkbenchAccelerators( *consaccel ); + return root; } Gui::ToolBarItem* Workbench::setupCommandBars() const @@ -191,6 +199,23 @@ inline void SketcherAddWorkbenchConstraints(T& cons){ } +template +inline void SketcherAddWorkbenchAccelerators(T& consaccel); + +template <> +inline void SketcherAddWorkbenchAccelerators(Gui::MenuItem& consaccel){ + consaccel << "Sketcher_CloseShape" + << "Sketcher_ConnectLines" + << "Sketcher_SelectConstraints" + << "Sketcher_SelectOrigin" + << "Sketcher_SelectVerticalAxis" + << "Sketcher_SelectHorizontalAxis"; +} +template <> +inline void SketcherAddWorkbenchAccelerators(Gui::ToolBarItem& consaccel){ + consaccel << "Sketcher_CloseShape"; +} + template inline void SketcherAddWorkspaceSketchExtra(T& sketch){ } @@ -216,6 +241,9 @@ inline void Sketcher_addWorkbenchSketchActions(T& sketch){ void addSketcherWorkbenchConstraints( Gui::MenuItem& cons ){ SketcherAddWorkbenchConstraints( cons ); } +void addSketcherWorkbenchAccelerators( Gui::MenuItem& consaccel ){ + SketcherAddWorkbenchAccelerators( consaccel ); +} void addSketcherWorkbenchSketchActions( Gui::MenuItem& sketch ){ Sketcher_addWorkbenchSketchActions( sketch ); } @@ -226,6 +254,10 @@ void addSketcherWorkbenchGeometries( Gui::MenuItem& geom ){ void addSketcherWorkbenchConstraints( Gui::ToolBarItem& cons ){ SketcherAddWorkbenchConstraints( cons ); } +void addSketcherWorkbenchAccelerators( Gui::ToolBarItem& consaccel ) +{ + SketcherAddWorkbenchAccelerators( consaccel ); +} void addSketcherWorkbenchSketchActions( Gui::ToolBarItem& sketch ){ Sketcher_addWorkbenchSketchActions( sketch ); } diff --git a/src/Mod/Sketcher/Gui/Workbench.h b/src/Mod/Sketcher/Gui/Workbench.h index 829b5de41..9c8a2ba4e 100644 --- a/src/Mod/Sketcher/Gui/Workbench.h +++ b/src/Mod/Sketcher/Gui/Workbench.h @@ -51,10 +51,12 @@ protected: SketcherGuiExport void addSketcherWorkbenchConstraints( Gui::MenuItem& cons ); +SketcherGuiExport void addSketcherWorkbenchAccelerators( Gui::MenuItem& consaccel ); SketcherGuiExport void addSketcherWorkbenchSketchActions( Gui::MenuItem& sketch ); SketcherGuiExport void addSketcherWorkbenchGeometries( Gui::MenuItem& geom ); SketcherGuiExport void addSketcherWorkbenchConstraints( Gui::ToolBarItem& cons ); +SketcherGuiExport void addSketcherWorkbenchAccelerators( Gui::ToolBarItem& consaccel ); SketcherGuiExport void addSketcherWorkbenchSketchActions( Gui::ToolBarItem& sketch ); SketcherGuiExport void addSketcherWorkbenchGeometries( Gui::ToolBarItem& geom );