Sketcher: Grid rework. Include:

- Adding 'auto spacing' option.
    - Drawing grid dynamically on viewer area only.
    - Moving code to coinManager.
    - Adding a 'grid tool' to sketcher-edit-mode toolbar.
This commit is contained in:
Paddle
2022-11-21 09:34:32 +01:00
committed by abdullahtahiriyo
parent a1d0d1dd76
commit 40271a29ea
23 changed files with 3205 additions and 125 deletions

View File

@@ -127,6 +127,7 @@ PyMOD_INIT_FUNC(SketcherGui)
SketcherGui::ViewProviderSketchGeometryExtension ::init();
(void)new Gui::PrefPageProducer<SketcherGui::SketcherSettings> ( QT_TRANSLATE_NOOP("QObject","Sketcher") );
(void)new Gui::PrefPageProducer<SketcherGui::SketcherSettingsGrid> ( QT_TRANSLATE_NOOP("QObject","Sketcher") );
(void)new Gui::PrefPageProducer<SketcherGui::SketcherSettingsDisplay> ( QT_TRANSLATE_NOOP("QObject","Sketcher") );
(void)new Gui::PrefPageProducer<SketcherGui::SketcherSettingsColors> ( QT_TRANSLATE_NOOP("QObject","Sketcher") );

View File

@@ -38,6 +38,7 @@ set(SketcherGui_UIC_SRCS
SketchOrientationDialog.ui
SketchMirrorDialog.ui
SketcherSettings.ui
SketcherSettingsGrid.ui
SketcherSettingsColors.ui
SketcherSettingsDisplay.ui
SketchRectangularArrayDialog.ui
@@ -119,6 +120,8 @@ SET(SketcherGui_SRCS
EditModeCoinManagerParameters.cpp
EditModeCoinManager.cpp
EditModeCoinManager.h
EditModeGridCoinManager.cpp
EditModeGridCoinManager.h
EditModeGeometryCoinManager.cpp
EditModeGeometryCoinManager.h
EditModeConstraintCoinManager.cpp

View File

@@ -25,14 +25,20 @@
# include <QApplication>
# include <QInputDialog>
# include <QMessageBox>
# include <QHBoxLayout>
# include <QWidgetAction>
#endif
#include <App/DocumentObjectGroup.h>
#include <Gui/Application.h>
#include <App/OriginFeature.h>
#include <Gui/Action.h>
#include <Gui/BitmapFactory.h>
#include <Gui/CommandT.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
#include <Gui/PrefWidgets.h>
#include <Gui/SelectionFilter.h>
#include <Gui/SelectionObject.h>
#include <Mod/Sketcher/App/Constraint.h>
@@ -124,6 +130,14 @@ namespace SketcherGui {
}
} //namespace SketcherGui
bool isSketchInEdit(Gui::Document* doc) {
if (doc) {
// checks if a Sketch Viewprovider is in Edit and is in no special mode
auto* vp = dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit());
return (vp != nullptr);
}
return false;
}
/* Sketch commands =======================================================*/
DEF_STD_CMD_A(CmdSketcherNewSketch)
@@ -314,14 +328,7 @@ void CmdSketcherLeaveSketch::activated(int iMsg)
bool CmdSketcherLeaveSketch::isActive()
{
Gui::Document *doc = getActiveGuiDocument();
if (doc) {
// checks if a Sketch Viewprovider is in Edit and is in no special mode
SketcherGui::ViewProviderSketch* vp = dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit());
if (vp /*&& vp->getSketchMode() == ViewProviderSketch::STATUS_NONE*/)
return true;
}
return false;
return isSketchInEdit(getActiveGuiDocument());
}
DEF_STD_CMD_A(CmdSketcherStopOperation)
@@ -697,14 +704,7 @@ void CmdSketcherViewSketch::activated(int iMsg)
bool CmdSketcherViewSketch::isActive()
{
Gui::Document *doc = getActiveGuiDocument();
if (doc) {
// checks if a Sketch Viewprovider is in Edit and is in no special mode
SketcherGui::ViewProviderSketch* vp = dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit());
if (vp /*&& vp->getSketchMode() == ViewProviderSketch::STATUS_NONE*/)
return true;
}
return false;
return isSketchInEdit(getActiveGuiDocument());
}
DEF_STD_CMD_A(CmdSketcherValidateSketch)
@@ -971,16 +971,211 @@ void CmdSketcherViewSection::activated(int iMsg)
bool CmdSketcherViewSection::isActive()
{
Gui::Document *doc = getActiveGuiDocument();
if (doc) {
// checks if a Sketch Viewprovider is in Edit and is in no special mode
SketcherGui::ViewProviderSketch* vp = dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit());
if (vp /*&& vp->getSketchMode() == ViewProviderSketch::STATUS_NONE*/)
return true;
}
return false;
return isSketchInEdit(getActiveGuiDocument());
}
/* Grid tool */
class GridSpaceAction : public QWidgetAction
{
public:
GridSpaceAction(QObject* parent) : QWidgetAction(parent) {
}
protected:
QWidget* createWidget(QWidget* parent) override
{
auto* sizeLabel = new QLabel(QApplication::translate("Sketcher_GridSize", "Spacing"));
auto* gridSizeBox = new Gui::QuantitySpinBox();
gridSizeBox->setProperty("unit", QVariant(QStringLiteral("mm")));
gridSizeBox->setObjectName(QStringLiteral("gridSize"));
gridSizeBox->setToolTip(QApplication::translate("Sketcher_GridSize", "Distance between two subsequent grid lines"));
//Is General/GridSize correct? From taskSketcherGeneral it seems yes.
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/General/GridSize");
gridSizeBox->setValue(hGrp->GetFloat("GridSize", 10.0));
gridSizeBox->setMaximum(99999999.0);
gridSizeBox->setMinimum(0.001);
QObject::connect(gridSizeBox, qOverload<double>(&Gui::QuantitySpinBox::valueChanged),
[=](double val) {
Gui::Document* doc = Gui::Application::Instance->activeDocument();
assert(doc);
auto* sketchView = dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit());
assert(sketchView);
sketchView->GridSize.setValue(val);
});
QWidget* gridSizeW = new QWidget(parent);
QHBoxLayout* layout = new QHBoxLayout(gridSizeW);
layout->addWidget(sizeLabel);
layout->addWidget(gridSizeBox);
gridSizeW->installEventFilter(this);
return gridSizeW;
}
bool eventFilter(QObject* obj, QEvent* event) override
{
if (event->type() == QEvent::Show) {
Gui::Document* doc = Gui::Application::Instance->activeDocument();
if (doc) {
auto* sketchView = dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit());
if (sketchView && sketchView->GridSize.getValue() > 0) {
double gridSize = sketchView->GridSize.getValue();
QList<QWidget*> widgets = createdWidgets();
for (auto it : widgets) {
if (auto* gridSizeBox = it->findChild<Gui::QuantitySpinBox*>(QStringLiteral("gridSize"))) {
QSignalBlocker sigblk(gridSizeBox);
gridSizeBox->setValue(gridSize);
}
}
}
}
}
return QWidgetAction::eventFilter(obj, event);
}
};
DEF_STD_CMD_ACL(CmdSketcherCompGrid)
CmdSketcherCompGrid::CmdSketcherCompGrid()
: Command("Sketcher_CompGrid")
{
sAppModule = "Sketcher";
sGroup = "Sketcher";
sMenuText = QT_TR_NOOP("Activate Grid");
sToolTipText = QT_TR_NOOP("Activate grid and further settings");
sWhatsThis = "Sketcher_CompGrid";
sStatusTip = sToolTipText;
eType = 0;
}
void CmdSketcherCompGrid::activated(int iMsg)
{
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(getAction());
assert(pcAction);
QList<QAction*> a = pcAction->actions();
Gui::Document* doc = getActiveGuiDocument();
assert(doc);
auto* sketchView = dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit());
assert(sketchView);
if (iMsg == 0) {
bool newState = !a[0]->isChecked();
a[0]->setChecked(newState);
sketchView->ShowGrid.setValue(newState);
//activate/deactivate others
a[1]->setEnabled(newState);
a[2]->setEnabled(newState);
}
else if (iMsg == 1) {
bool newState = !a[1]->isChecked();
a[0]->setChecked(newState);
sketchView->GridSnap.setValue(newState);
pcAction->setProperty("defaultAction", QVariant(0));
}
else if (iMsg == 2){
bool newState = !a[2]->isChecked();
a[2]->setChecked(newState);
sketchView->GridAuto.setValue(newState);
a[3]->setEnabled(!newState);
if (!newState)
sketchView->GridSize.setValue(sketchView->GridSize.getValue()); //redraw grid.
pcAction->setProperty("defaultAction", QVariant(0));
}
else if (iMsg == 3) {
//nothing but don't return either.
}
else
return;
pcAction->setIcon(Gui::BitmapFactory().iconFromTheme(a[0]->isChecked() ? "Sketcher_GridToggle" : "Sketcher_GridToggle_Deactivated"));
}
Gui::Action* CmdSketcherCompGrid::createAction()
{
Gui::ActionGroup* pcAction = new Gui::ActionGroup(this, Gui::getMainWindow());
pcAction->setDropDownMenu(true);
pcAction->setExclusive(false);
applyCommandData(this->className(), pcAction);
QAction* a0 = pcAction->addAction(QString());
QAction* a1 = pcAction->addAction(QString());
QAction* a2 = pcAction->addAction(QString());
GridSpaceAction* a3 = new GridSpaceAction(pcAction);
pcAction->addAction(a3);
a0->setCheckable(true);
a1->setCheckable(true);
a2->setCheckable(true);
_pcAction = pcAction;
languageChange();
return pcAction;
}
void CmdSketcherCompGrid::languageChange()
{
Command::languageChange();
if (!_pcAction)
return;
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(_pcAction);
QList<QAction*> a = pcAction->actions();
QAction* a0 = a[0];
a0->setText(QApplication::translate("CmdSketcherCompGrid", "Activate Grid"));
a0->setToolTip(QApplication::translate("CmdSketcherCompGrid", "Activate Grid"));
a0->setStatusTip(a0->toolTip());
QAction* a1 = a[1];
a1->setText(QApplication::translate("CmdSketcherCompGrid", "Grid Snap"));
a1->setToolTip(QApplication::translate("CmdSketcherCompGrid", "New points will snap to the nearest grid line.\nPoints must be set closer than a fifth of the grid spacing to a grid line to snap."));
a1->setStatusTip(a1->toolTip());
QAction* a2 = a[2];
a2->setText(QApplication::translate("CmdSketcherCompGrid", "Grid Auto Spacing"));
a2->setToolTip(QApplication::translate("CmdSketcherCompGrid", "Resize grid automatically depending on zoom."));
a2->setStatusTip(a2->toolTip());
}
bool CmdSketcherCompGrid::isActive()
{
//Initialisation of the commands to the sketch specific settings
Gui::Document* doc = getActiveGuiDocument();
if (doc && isSketchInEdit(doc)) {
auto* sketchView = dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit());
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(getAction());
if (sketchView && pcAction) {
QList<QAction*> a = pcAction->actions();
bool showGrid = sketchView->ShowGrid.getValue();
bool gridSnap = sketchView->GridSnap.getValue();
bool gridAuto = sketchView->GridAuto.getValue();
a[0]->setChecked(showGrid);
a[1]->setChecked(gridSnap);
a[2]->setChecked(gridAuto);
//activate/deactivate others
a[1]->setEnabled(showGrid);
a[2]->setEnabled(showGrid);
a[3]->setEnabled(showGrid && !gridAuto);
pcAction->setIcon(Gui::BitmapFactory().iconFromTheme(showGrid ? "Sketcher_GridToggle" : "Sketcher_GridToggle_Deactivated"));
}
}
return isSketchInEdit(getActiveGuiDocument());
}
void CreateSketcherCommands()
{
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
@@ -996,4 +1191,5 @@ void CreateSketcherCommands()
rcCmdMgr.addCommand(new CmdSketcherMirrorSketch());
rcCmdMgr.addCommand(new CmdSketcherMergeSketches());
rcCmdMgr.addCommand(new CmdSketcherViewSection());
rcCmdMgr.addCommand(new CmdSketcherCompGrid());
}

View File

@@ -57,6 +57,14 @@
#include "ViewProviderSketch.h"
#include "ViewProviderSketchCoinAttorney.h"
#include "EditModeGridCoinManager.h"
#include "EditModeGeometryCoinManager.h"
#include "EditModeConstraintCoinManager.h"
#include "EditModeCoinManager.h"
#include "Utils.h"
using namespace SketcherGui;
using namespace Sketcher;
@@ -342,6 +350,9 @@ EditModeCoinManager::EditModeCoinManager(ViewProviderSketch &vp):viewProvider(vp
analysisResults,
editModeScenegraphNodes,
coinMapping);
pEditModeGridCoinManager = std::make_unique<EditModeGridCoinManager>( viewProvider,
editModeScenegraphNodes);
// Create Edit Mode Scenograph
createEditModeInventorNodes();
@@ -573,8 +584,6 @@ void EditModeCoinManager::processGeometryConstraintsInformationOverlay(const Geo
updateAxesLength();
updateGridExtent();
pEditModeConstraintCoinManager->processConstraints(geolistfacade);
}
@@ -613,13 +622,6 @@ void EditModeCoinManager::updateAxesLength()
editModeScenegraphNodes.RootCrossCoordinate->point.set1Value(3,SbVec3f(0.0f, analysisResults.boundingBoxMagnitudeOrder, zCrossH));
}
void EditModeCoinManager::updateGridExtent()
{
float dMagF = analysisResults.boundingBoxMagnitudeOrder;
ViewProviderSketchCoinAttorney::updateGridExtent(viewProvider,-dMagF, dMagF, -dMagF, dMagF);
}
void EditModeCoinManager::updateColor()
{
auto geolistfacade = ViewProviderSketchCoinAttorney::getGeoListFacade(viewProvider);
@@ -657,6 +659,14 @@ void EditModeCoinManager::createEditModeInventorNodes()
ViewProviderSketchCoinAttorney::addNodeToRoot(viewProvider, editModeScenegraphNodes.EditRoot);
editModeScenegraphNodes.EditRoot->renderCaching = SoSeparator::OFF ;
// Create Grid Coin nodes ++++++++++++++++++++++++++++++++++++++++++
editModeScenegraphNodes.GridRoot = new SoSeparator();
editModeScenegraphNodes.GridRoot->ref();
editModeScenegraphNodes.GridRoot->setName("GridRoot");
editModeScenegraphNodes.EditRoot->addChild(editModeScenegraphNodes.GridRoot);
if (viewProvider.ShowGrid.getValue())
pEditModeGridCoinManager->createGrid();
// Create Geometry Coin nodes ++++++++++++++++++++++++++++++++++++++
pEditModeGeometryCoinManager->createEditModeInventorNodes();
@@ -804,6 +814,13 @@ void EditModeCoinManager::updateVirtualSpace()
pEditModeConstraintCoinManager->updateVirtualSpace();
}
void EditModeCoinManager::drawGrid(bool cameraUpdate) {
if (viewProvider.ShowGrid.getValue())
pEditModeGridCoinManager->createGrid(cameraUpdate);
else
Gui::coinRemoveAllChildren(editModeScenegraphNodes.GridRoot);
}
/************************ Resizing of coin nodes ************************/
int EditModeCoinManager::defaultApplicationFontSizePixels() const {

View File

@@ -60,6 +60,7 @@ namespace SketcherGui {
class ViewProviderSketch;
class EditModeConstraintCoinManager;
class EditModeGeometryCoinManager;
class EditModeGridCoinManager;
using GeoList = Sketcher::GeoList;
using GeoListFacade = Sketcher::GeoListFacade;
@@ -216,6 +217,9 @@ public:
void drawConstraintIcons(const GeoListFacade & geolistfacade);
//@}
//Draw the grid
void drawGrid(bool cameraUpdate = false);
/** @name coin node access*/
SoSeparator* getRootEditNode();
//@}
@@ -226,12 +230,6 @@ public:
void updateColor(const GeoListFacade & geolistfacade); // overload to be used with temporal geometry.
//@}
/** @name change coin visualisation and behaviour*/
//@{
void updateGridExtent();
//@}
/** @name change constraints selectability*/
//@{
void setConstraintSelectability(bool enabled = true);
@@ -289,6 +287,7 @@ private:
// Coin Helpers
std::unique_ptr<EditModeConstraintCoinManager> pEditModeConstraintCoinManager;
std::unique_ptr<EditModeGeometryCoinManager> pEditModeGeometryCoinManager;
std::unique_ptr<EditModeGridCoinManager> pEditModeGridCoinManager;
};

View File

@@ -281,6 +281,11 @@ struct ConstraintParameters {
/** @brief Helper struct adapted to store the pointer to edit mode scenegraph objects.
*/
struct EditModeScenegraphNodes {
/** @name Grid nodes*/
//@{
SoSeparator * GridRoot;
//@}
/** @name Point nodes*/
//@{
SoSeparator * EditRoot;

View File

@@ -0,0 +1,237 @@
/***************************************************************************
* Copyright (c) 2021 Abdullah Tahiri <abdullah.tahiri.yo@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Inventor/nodes/SoDepthBuffer.h>
# include <Inventor/nodes/SoDrawStyle.h>
# include <Inventor/nodes/SoLineSet.h>
# include <Inventor/nodes/SoMaterial.h>
# include <Inventor/nodes/SoPickStyle.h>
# include <Inventor/nodes/SoVertexProperty.h>
#endif // #ifndef _PreComp_
#include <Gui/Application.h>
#include <Gui/View3DInventor.h>
#include <Gui/SoFCBoundingBox.h>
#include "EditModeCoinManager.h"
#include "EditModeGridCoinManager.h"
using namespace SketcherGui;
//**************************** EditModeGridCoinManager class ******************************
EditModeGridCoinManager::EditModeGridCoinManager( ViewProviderSketch &vp,
EditModeScenegraphNodes & editModeScenegraph):
camCenterOnSketch(SbVec3f(0., 0., 0.)),
camMaxDimension(200.),
viewProvider(vp),
editModeScenegraphNodes(editModeScenegraph)
{
}
EditModeGridCoinManager::~EditModeGridCoinManager()
{}
double EditModeGridCoinManager::getGridSize(const Gui::View3DInventorViewer* viewer)
{
short pixelWidth = -1;
short pixelHeight = -1;
viewer->getViewportRegion().getViewportSizePixels().getValue(pixelWidth, pixelHeight);
if (pixelWidth < 0 || pixelHeight < 0)
return viewProvider.GridSize.getValue();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/General");
int numberOfLines = std::max(pixelWidth, pixelHeight) / hGrp->GetInt("GridSizePixelThreshold", 15);
ParameterGrp::handle hGrp2 = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Units");
int units = hGrp2->GetInt("UserSchema", 0); //2 3 5 7 are imperial schemas. 2 3 inches, 5 7 feet
double unitMultiplier = (units == 2 || units == 3) ? 25.4 : (units == 5 || units == 7) ? 304.8 : 1;
int subdivisions = hGrp->GetInt("GridNumberSubdivision", 10);
double newGridSize = unitMultiplier * pow(subdivisions, 1 + floor(log(camMaxDimension / unitMultiplier / numberOfLines) / log(subdivisions)));
//cap the grid size
newGridSize = std::max(newGridSize, 0.000001);
newGridSize = std::min(newGridSize, 10000000.0);
if (newGridSize != viewProvider.GridSize.getValue()) // protect from recursive calls
viewProvider.GridSize.setValue(newGridSize); //grid size must be set for grid snap. But we need to block it from calling createGrid.
return newGridSize;
}
SoSeparator* EditModeGridCoinManager::createGrid(bool cameraUpdate)
{
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/General");
Gui::MDIView* mdi = Gui::Application::Instance->editDocument()->getActiveView();
Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(mdi)->getViewer();
//First check if the user zoomed in or out by getting the camera dimension.
float newCamMaxDimension = viewer->getMaxDimension();
bool cameraDimensionsChanged = false;
if (fabs(newCamMaxDimension - camMaxDimension) > 0) { //ie if user zoomed.
camMaxDimension = newCamMaxDimension;
cameraDimensionsChanged = true;
}
//Then we check if user moved by more than 10% of camera dimension (must be after updating camera dimension).
SbVec3f newCamCenterOnSketch = viewer->getCenterPointOnFocalPlane();
bool cameraCenterMoved = false;
if ((camCenterOnSketch - newCamCenterOnSketch).length() > 0.1 * camMaxDimension) {
camCenterOnSketch = newCamCenterOnSketch;
cameraCenterMoved = true;
}
bool gridNeedUpdating = cameraDimensionsChanged || cameraCenterMoved;
if (!gridNeedUpdating && cameraUpdate)
return editModeScenegraphNodes.GridRoot;
Gui::coinRemoveAllChildren(editModeScenegraphNodes.GridRoot);
double step;
if (viewProvider.GridAuto.getValue())
step = getGridSize(viewer);
else
step = viewProvider.GridSize.getValue();
int numberSubdivision = hGrp->GetInt("GridNumberSubdivision", 10);
auto getColor = [](auto prefName) {
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/General");
SoBaseColor* lineColor = new SoBaseColor;
float transparency;
SbColor lineCol(0.7f, 0.7f, 0.7f);
unsigned long lineColorL = hGrp->GetUnsigned(prefName, (unsigned long)(lineCol.getPackedValue()));
lineCol.setPackedValue((uint32_t)lineColorL, transparency);
lineColor->rgb.setValue(lineCol);
return lineColor;
};
//First we create the subdivision lines
createGridPart(step, numberSubdivision, true, (numberSubdivision == 1) ? true : false,
hGrp->GetInt("GridLinePattern", 0x0f0f), getColor("GridLineColor"), hGrp->GetInt("GridLineWidth", 1));
//Second we create the wider lines marking every nth lines
if (numberSubdivision > 1) {
createGridPart(step, numberSubdivision, false, true,
hGrp->GetInt("GridDivLinePattern", 0xffff), getColor("GridDivLineColor"), hGrp->GetInt("GridDivLineWidth", 2));
}
return editModeScenegraphNodes.GridRoot;
}
SoSeparator* EditModeGridCoinManager::createGridPart(double Step, int numberSubdiv, bool subDivLines, bool divLines, int pattern, SoBaseColor* color, int lineWidth)
{
SoGroup* parent = new Gui::SoSkipBoundingGroup();
editModeScenegraphNodes.GridRoot->addChild(parent);
SoVertexProperty* vts;
parent->addChild(color);
if (viewProvider.GridStyle.getValue() == 0) {
SoDrawStyle* DefaultStyle = new SoDrawStyle;
DefaultStyle->lineWidth = lineWidth;
DefaultStyle->linePattern = pattern;
parent->addChild(DefaultStyle);
}
else {
SoMaterial* LightStyle = new SoMaterial;
LightStyle->transparency = 0.7f;
parent->addChild(LightStyle);
}
SoPickStyle* PickStyle = new SoPickStyle;
PickStyle->style = SoPickStyle::UNPICKABLE;
parent->addChild(PickStyle);
SoLineSet* grid = new SoLineSet;
vts = new SoVertexProperty;
grid->vertexProperty = vts;
float gridDimension = 1.5 * camMaxDimension;
int vlines = static_cast<int>(gridDimension / Step);
int nlines = 2 * vlines;
if (nlines > 2000) {
Gui::coinRemoveAllChildren(editModeScenegraphNodes.GridRoot);
return editModeScenegraphNodes.GridRoot;
}
// set the grid indices
grid->numVertices.setNum(nlines);
int32_t* vertices = grid->numVertices.startEditing();
for (int i = 0; i < nlines; i++)
vertices[i] = 2;
grid->numVertices.finishEditing();
// set the grid coordinates
vts->vertex.setNum(2 * nlines);
SbVec3f* vertex_coords = vts->vertex.startEditing();
float minX, minY, maxX, maxY, z;
camCenterOnSketch.getValue(minX, minY, z);
minX -= (gridDimension / 2);
minY -= (gridDimension / 2);
maxX = minX + gridDimension;
maxY = minY + gridDimension;
// vertical lines
int i_offset_x = static_cast<int>(minX / Step);
for (int i = 0; i < vlines; i++) {
int iStep = (i + i_offset_x);
if (((iStep % numberSubdiv == 0) && divLines) || ((iStep % numberSubdiv != 0) && subDivLines)) {
vertex_coords[2 * i].setValue(iStep * Step, minY, 0);
vertex_coords[2 * i + 1].setValue(iStep * Step, maxY, 0);
}
else {
/*the number of vertices is defined before. To know the number of vertices ahead it would require
to run the loop once before, which would double computation time.
If vertices are not filled then there're visual bugs so there are here filled with dummy values.*/
vertex_coords[2 * i].setValue(0, 0, 0);
vertex_coords[2 * i + 1].setValue(0, 0, 0);
}
}
// horizontal lines
int i_offset_y = static_cast<int>(minY / Step) - vlines;
for (int i = vlines; i < nlines; i++) {
int iStep = (i + i_offset_y);
if (((iStep % numberSubdiv == 0) && divLines) || ((iStep % numberSubdiv != 0) && subDivLines)) {
vertex_coords[2 * i].setValue(minX, iStep * Step, 0);
vertex_coords[2 * i + 1].setValue(maxX, iStep * Step, 0);
}
else {
vertex_coords[2 * i].setValue(0, 0, 0);
vertex_coords[2 * i + 1].setValue(0, 0, 0);
}
}
vts->vertex.finishEditing();
parent->addChild(vts);
parent->addChild(grid);
return editModeScenegraphNodes.GridRoot;
}

View File

@@ -0,0 +1,76 @@
/***************************************************************************
* Copyright (c) 2021 Abdullah Tahiri <abdullah.tahiri.yo@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef SKETCHERGUI_EditModeGridCoinManager_H
#define SKETCHERGUI_EditModeGridCoinManager_H
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoBaseColor.h>
#include <Inventor/SbVec3f.h>
#include <Base/Parameter.h>
#include <App/Application.h>
#include <Gui/View3DInventorViewer.h>
#include "ViewProviderSketch.h"
#include "EditModeCoinManagerParameters.h"
namespace SketcherGui {
class ViewProviderSketch;
/** @brief Class for managing the Edit mode coin nodes of ViewProviderSketch relating to grid.
* @details
*
* EditModeGridCoinManager is a helper of EditModeCoinManager specialised in grid management.
*
* 1. Creation of Edit mode coin nodes to handle grid representation.
*
*/
class SketcherGuiExport EditModeGridCoinManager
{
public:
explicit EditModeGridCoinManager( ViewProviderSketch &vp,
EditModeScenegraphNodes & editModeScenegraph);
~EditModeGridCoinManager();
double getGridSize(const Gui::View3DInventorViewer* viewer);
SoSeparator* createGrid(bool cameraUpdate = false);
SoSeparator* createGridPart(double Step, int numberSubdiv, bool divLines, bool subDivLines, int pattern, SoBaseColor* color, int lineWidth = 1);
SbVec3f camCenterOnSketch;
float camMaxDimension;
private:
ViewProviderSketch & viewProvider;
EditModeScenegraphNodes & editModeScenegraphNodes;
};
} // namespace SketcherGui
#endif // SKETCHERGUI_EditModeGridCoinManager_H

View File

@@ -104,6 +104,12 @@
<file>icons/general/Sketcher_ValidateSketch.svg</file>
<file>icons/general/Sketcher_ViewSection.svg</file>
<file>icons/general/Sketcher_ViewSketch.svg</file>
<file>icons/general/Sketcher_GridToggle.svg</file>
<file>icons/general/Sketcher_GridToggle_Deactivated.svg</file>
<file>icons/general/Sketcher_GridSnap.svg</file>
<file>icons/general/Sketcher_GridSnap_Deactivated.svg</file>
<file>icons/general/Sketcher_GridAuto.svg</file>
<file>icons/general/Sketcher_GridAuto_Deactivated.svg</file>
</qresource>
<qresource>
<file>icons/geometry/Sketcher_AlterFillet.svg</file>

View File

@@ -0,0 +1,355 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64px"
height="64px"
id="svg3364"
version="1.1"
sodipodi:docname="Sketcher_GridAuto.svg"
inkscape:version="1.1-beta1 (77e7b44db3, 2021-03-28)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview55"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
objecttolerance="10.0"
gridtolerance="10.0"
guidetolerance="10.0"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="5.8828125"
inkscape:cx="21.24834"
inkscape:cy="32.89243"
inkscape:window-width="1725"
inkscape:window-height="1073"
inkscape:window-x="622"
inkscape:window-y="282"
inkscape:window-maximized="0"
inkscape:current-layer="svg3364" />
<defs
id="defs3366">
<marker
style="overflow:visible;"
id="Arrow2Mend"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow2Mend"
inkscape:isstock="true">
<path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;fill:context-stroke;stroke-width:0.62500000;stroke-linejoin:round;"
id="path1197" />
</marker>
<marker
style="overflow:visible"
id="Arrow2Mstart"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow2Mstart"
inkscape:isstock="true">
<path
transform="scale(0.6) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;fill:context-stroke;stroke-width:0.62500000;stroke-linejoin:round"
id="path1194" />
</marker>
<marker
style="overflow:visible;"
id="Arrow1Lend"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow1Lend"
inkscape:isstock="true">
<path
transform="scale(0.8) rotate(180) translate(12.5,0)"
style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt;"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
id="path1173" />
</marker>
<marker
style="overflow:visible"
id="Arrow1Lstart"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow1Lstart"
inkscape:isstock="true">
<path
transform="scale(0.8) translate(12.5,0)"
style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
id="path1170" />
</marker>
<linearGradient
id="linearGradient3864">
<stop
id="stop3866"
offset="0"
style="stop-color:#71b2f8;stop-opacity:1" />
<stop
id="stop3868"
offset="1"
style="stop-color:#002795;stop-opacity:1" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient2571"
gradientUnits="userSpaceOnUse"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-215.02413,-170.90186)" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3352"
gradientUnits="userSpaceOnUse"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<linearGradient
id="linearGradient3593">
<stop
style="stop-color:#c8e0f9;stop-opacity:1"
offset="0"
id="stop3595" />
<stop
style="stop-color:#637dca;stop-opacity:1"
offset="1"
id="stop3597" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3354"
gradientUnits="userSpaceOnUse"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient3369"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-461.81066,-173.06271)"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3372"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-327.50313,-4.3316646)"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3375"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-287.81791,-28.143054)"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient3380"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9829174,1.3240854,-1.2330051,0.8105158,-131.04134,-483.74563)"
cx="320.44025"
cy="113.23357"
fx="320.44025"
fy="113.23357"
r="19.571428" />
<linearGradient
xlink:href="#linearGradient3864"
id="linearGradient3914"
x1="6.94525"
y1="36.838673"
x2="48.691113"
y2="36.838673"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-4.8699606,-2.3863162)" />
<radialGradient
xlink:href="#linearGradient3794"
id="radialGradient3800"
cx="1"
cy="45"
fx="1"
fy="45"
r="41"
gradientTransform="matrix(0.93348213,-2.2905276e-8,0,0.28687573,0.06651751,32.090592)"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3794">
<stop
style="stop-color:#000000;stop-opacity:1"
offset="0"
id="stop3796" />
<stop
style="stop-color:#000000;stop-opacity:0"
offset="1"
id="stop3798" />
</linearGradient>
<linearGradient
gradientTransform="translate(0,-9)"
xlink:href="#linearGradient3777"
id="linearGradient3783"
x1="53.896763"
y1="51.179787"
x2="48"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3777">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3779" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop3781" />
</linearGradient>
<linearGradient
gradientTransform="translate(22,-17)"
xlink:href="#linearGradient3767"
id="linearGradient3773"
x1="22.116516"
y1="55.717518"
x2="19"
y2="33"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3767">
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="0"
id="stop3769" />
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="1"
id="stop3771" />
</linearGradient>
<linearGradient
gradientTransform="translate(-2,-11)"
xlink:href="#linearGradient3777-6"
id="linearGradient3783-3"
x1="53.896763"
y1="51.179787"
x2="48"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3777-6">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3779-7" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop3781-5" />
</linearGradient>
<linearGradient
y2="32"
x2="48"
y1="51.179787"
x1="53.896763"
gradientTransform="translate(-24,-13)"
gradientUnits="userSpaceOnUse"
id="linearGradient3066"
xlink:href="#linearGradient3777-6" />
</defs>
<metadata
id="metadata3369">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:creator>
<cc:Agent>
<dc:title>[wmayer]</dc:title>
</cc:Agent>
</dc:creator>
<dc:date>2011-10-10</dc:date>
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
<dc:publisher>
<cc:Agent>
<dc:title>FreeCAD</dc:title>
</cc:Agent>
</dc:publisher>
<dc:identifier>FreeCAD/src/Mod/Part/Gui/Resources/icons/Part_Section.svg</dc:identifier>
<dc:rights>
<cc:Agent>
<dc:title>FreeCAD LGPL2+</dc:title>
</cc:Agent>
</dc:rights>
<cc:license>https://www.gnu.org/copyleft/lesser.html</cc:license>
<dc:contributor>
<cc:Agent>
<dc:title>[agryson] Alexander Gryson</dc:title>
</cc:Agent>
</dc:contributor>
</cc:Work>
</rdf:RDF>
</metadata>
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.2324859,11.308385 H 61.472857"
id="path985" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.2324867,53.127858 H 61.472858"
id="path985-6" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 10.221742,61.620185 V 2.3798148"
id="path985-92" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 52.041216,61.620185 V 2.3798148"
id="path985-6-2" />
<path
style="fill:none;stroke:#fc1300;stroke-width:1.29799;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3.8;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#Arrow2Mstart);marker-end:url(#Arrow2Mend)"
d="M 12.117356,42.083364 H 50.224071"
id="path1168" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35.0911px;line-height:1.25;font-family:Arial;-inkscape-font-specification:Arial;stroke-width:0.548299;stroke:#fc1300;stroke-opacity:1;fill:#fc1300;fill-opacity:1"
x="16.429575"
y="41.894508"
id="text6417"
transform="scale(1.1151924,0.89670625)"><tspan
sodipodi:role="line"
id="tspan6415"
x="16.429575"
y="41.894508"
style="stroke-width:0.548299;stroke:#fc1300;stroke-opacity:1;fill:#fc1300;fill-opacity:1">A</tspan></text>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,343 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64px"
height="64px"
id="svg3364"
version="1.1"
sodipodi:docname="Sketcher_GridAuto_deactivated.svg"
inkscape:version="1.1-beta1 (77e7b44db3, 2021-03-28)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview55"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
objecttolerance="10.0"
gridtolerance="10.0"
guidetolerance="10.0"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="5.8828125"
inkscape:cx="21.418327"
inkscape:cy="32.89243"
inkscape:window-width="1725"
inkscape:window-height="1073"
inkscape:window-x="622"
inkscape:window-y="282"
inkscape:window-maximized="0"
inkscape:current-layer="svg3364" />
<defs
id="defs3366">
<marker
style="overflow:visible;"
id="Arrow2Mend"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow2Mend"
inkscape:isstock="true">
<path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;fill:context-stroke;stroke-width:0.62500000;stroke-linejoin:round;"
id="path1197" />
</marker>
<marker
style="overflow:visible"
id="Arrow2Mstart"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow2Mstart"
inkscape:isstock="true">
<path
transform="scale(0.6) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;fill:context-stroke;stroke-width:0.62500000;stroke-linejoin:round"
id="path1194" />
</marker>
<marker
style="overflow:visible;"
id="Arrow1Lend"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow1Lend"
inkscape:isstock="true">
<path
transform="scale(0.8) rotate(180) translate(12.5,0)"
style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt;"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
id="path1173" />
</marker>
<marker
style="overflow:visible"
id="Arrow1Lstart"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow1Lstart"
inkscape:isstock="true">
<path
transform="scale(0.8) translate(12.5,0)"
style="fill-rule:evenodd;fill:context-stroke;stroke:context-stroke;stroke-width:1.0pt"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
id="path1170" />
</marker>
<linearGradient
id="linearGradient3864">
<stop
id="stop3866"
offset="0"
style="stop-color:#71b2f8;stop-opacity:1" />
<stop
id="stop3868"
offset="1"
style="stop-color:#002795;stop-opacity:1" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient2571"
gradientUnits="userSpaceOnUse"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-215.02413,-170.90186)" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3352"
gradientUnits="userSpaceOnUse"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<linearGradient
id="linearGradient3593">
<stop
style="stop-color:#c8e0f9;stop-opacity:1"
offset="0"
id="stop3595" />
<stop
style="stop-color:#637dca;stop-opacity:1"
offset="1"
id="stop3597" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3354"
gradientUnits="userSpaceOnUse"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient3369"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-461.81066,-173.06271)"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3372"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-327.50313,-4.3316646)"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3375"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-287.81791,-28.143054)"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient3380"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9829174,1.3240854,-1.2330051,0.8105158,-131.04134,-483.74563)"
cx="320.44025"
cy="113.23357"
fx="320.44025"
fy="113.23357"
r="19.571428" />
<linearGradient
xlink:href="#linearGradient3864"
id="linearGradient3914"
x1="6.94525"
y1="36.838673"
x2="48.691113"
y2="36.838673"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-4.8699606,-2.3863162)" />
<radialGradient
xlink:href="#linearGradient3794"
id="radialGradient3800"
cx="1"
cy="45"
fx="1"
fy="45"
r="41"
gradientTransform="matrix(0.93348213,-2.2905276e-8,0,0.28687573,0.06651751,32.090592)"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3794">
<stop
style="stop-color:#000000;stop-opacity:1"
offset="0"
id="stop3796" />
<stop
style="stop-color:#000000;stop-opacity:0"
offset="1"
id="stop3798" />
</linearGradient>
<linearGradient
gradientTransform="translate(0,-9)"
xlink:href="#linearGradient3777"
id="linearGradient3783"
x1="53.896763"
y1="51.179787"
x2="48"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3777">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3779" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop3781" />
</linearGradient>
<linearGradient
gradientTransform="translate(22,-17)"
xlink:href="#linearGradient3767"
id="linearGradient3773"
x1="22.116516"
y1="55.717518"
x2="19"
y2="33"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3767">
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="0"
id="stop3769" />
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="1"
id="stop3771" />
</linearGradient>
<linearGradient
gradientTransform="translate(-2,-11)"
xlink:href="#linearGradient3777-6"
id="linearGradient3783-3"
x1="53.896763"
y1="51.179787"
x2="48"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3777-6">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3779-7" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop3781-5" />
</linearGradient>
<linearGradient
y2="32"
x2="48"
y1="51.179787"
x1="53.896763"
gradientTransform="translate(-24,-13)"
gradientUnits="userSpaceOnUse"
id="linearGradient3066"
xlink:href="#linearGradient3777-6" />
</defs>
<metadata
id="metadata3369">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:creator>
<cc:Agent>
<dc:title>[wmayer]</dc:title>
</cc:Agent>
</dc:creator>
<dc:date>2011-10-10</dc:date>
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
<dc:publisher>
<cc:Agent>
<dc:title>FreeCAD</dc:title>
</cc:Agent>
</dc:publisher>
<dc:identifier>FreeCAD/src/Mod/Part/Gui/Resources/icons/Part_Section.svg</dc:identifier>
<dc:rights>
<cc:Agent>
<dc:title>FreeCAD LGPL2+</dc:title>
</cc:Agent>
</dc:rights>
<cc:license>https://www.gnu.org/copyleft/lesser.html</cc:license>
<dc:contributor>
<cc:Agent>
<dc:title>[agryson] Alexander Gryson</dc:title>
</cc:Agent>
</dc:contributor>
</cc:Work>
</rdf:RDF>
</metadata>
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.2324859,11.308385 H 61.472857"
id="path985" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.2324867,53.127858 H 61.472858"
id="path985-6" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 10.221742,61.620185 V 2.3798148"
id="path985-92" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 52.041216,61.620185 V 2.3798148"
id="path985-6-2" />
<path
style="fill:none;stroke:#fc1300;stroke-width:1.29799;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3.8;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#Arrow2Mstart);marker-end:url(#Arrow2Mend)"
d="M 12.117356,42.083364 H 50.224071"
id="path1168" />
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,305 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64px"
height="64px"
id="svg3364"
version="1.1"
sodipodi:docname="Sketcher_GridSnap.svg"
inkscape:version="1.1-beta1 (77e7b44db3, 2021-03-28)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview55"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
objecttolerance="10.0"
gridtolerance="10.0"
guidetolerance="10.0"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="5.8828125"
inkscape:cx="11.38911"
inkscape:cy="25.583001"
inkscape:window-width="1725"
inkscape:window-height="1013"
inkscape:window-x="743"
inkscape:window-y="433"
inkscape:window-maximized="0"
inkscape:current-layer="svg3364" />
<defs
id="defs3366">
<linearGradient
id="linearGradient3864">
<stop
id="stop3866"
offset="0"
style="stop-color:#71b2f8;stop-opacity:1" />
<stop
id="stop3868"
offset="1"
style="stop-color:#002795;stop-opacity:1" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient2571"
gradientUnits="userSpaceOnUse"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-215.02413,-170.90186)" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3352"
gradientUnits="userSpaceOnUse"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<linearGradient
id="linearGradient3593">
<stop
style="stop-color:#c8e0f9;stop-opacity:1"
offset="0"
id="stop3595" />
<stop
style="stop-color:#637dca;stop-opacity:1"
offset="1"
id="stop3597" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3354"
gradientUnits="userSpaceOnUse"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient3369"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-461.81066,-173.06271)"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3372"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-327.50313,-4.3316646)"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3375"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-287.81791,-28.143054)"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient3380"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9829174,1.3240854,-1.2330051,0.8105158,-131.04134,-483.74563)"
cx="320.44025"
cy="113.23357"
fx="320.44025"
fy="113.23357"
r="19.571428" />
<linearGradient
xlink:href="#linearGradient3864"
id="linearGradient3914"
x1="6.94525"
y1="36.838673"
x2="48.691113"
y2="36.838673"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-4.8699606,-2.3863162)" />
<radialGradient
xlink:href="#linearGradient3794"
id="radialGradient3800"
cx="1"
cy="45"
fx="1"
fy="45"
r="41"
gradientTransform="matrix(0.93348213,-2.2905276e-8,0,0.28687573,0.06651751,32.090592)"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3794">
<stop
style="stop-color:#000000;stop-opacity:1"
offset="0"
id="stop3796" />
<stop
style="stop-color:#000000;stop-opacity:0"
offset="1"
id="stop3798" />
</linearGradient>
<linearGradient
gradientTransform="translate(0,-9)"
xlink:href="#linearGradient3777"
id="linearGradient3783"
x1="53.896763"
y1="51.179787"
x2="48"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3777">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3779" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop3781" />
</linearGradient>
<linearGradient
gradientTransform="translate(22,-17)"
xlink:href="#linearGradient3767"
id="linearGradient3773"
x1="22.116516"
y1="55.717518"
x2="19"
y2="33"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3767">
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="0"
id="stop3769" />
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="1"
id="stop3771" />
</linearGradient>
<linearGradient
gradientTransform="translate(-2,-11)"
xlink:href="#linearGradient3777-6"
id="linearGradient3783-3"
x1="53.896763"
y1="51.179787"
x2="48"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3777-6">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3779-7" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop3781-5" />
</linearGradient>
<linearGradient
y2="32"
x2="48"
y1="51.179787"
x1="53.896763"
gradientTransform="translate(-24,-13)"
gradientUnits="userSpaceOnUse"
id="linearGradient3066"
xlink:href="#linearGradient3777-6" />
</defs>
<metadata
id="metadata3369">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:creator>
<cc:Agent>
<dc:title>[wmayer]</dc:title>
</cc:Agent>
</dc:creator>
<dc:date>2011-10-10</dc:date>
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
<dc:publisher>
<cc:Agent>
<dc:title>FreeCAD</dc:title>
</cc:Agent>
</dc:publisher>
<dc:identifier>FreeCAD/src/Mod/Part/Gui/Resources/icons/Part_Section.svg</dc:identifier>
<dc:rights>
<cc:Agent>
<dc:title>FreeCAD LGPL2+</dc:title>
</cc:Agent>
</dc:rights>
<cc:license>https://www.gnu.org/copyleft/lesser.html</cc:license>
<dc:contributor>
<cc:Agent>
<dc:title>[agryson] Alexander Gryson</dc:title>
</cc:Agent>
</dc:contributor>
</cc:Work>
</rdf:RDF>
</metadata>
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.3798139,32.218121 H 61.620186"
id="path985-9" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.2324867,51.127858 H 61.472858"
id="path985-6" />
<path
style="fill:none;stroke:#4ce642;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 12.221742,61.620185 V 2.3798148"
id="path985-92" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 31.131479,61.620186 V 2.3798143"
id="path985-9-8" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 50.041216,61.620185 V 2.3798148"
id="path985-6-2" />
<path
style="fill:none;stroke:#4ce642;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.2324859,13.308385 H 61.472857"
id="path985" />
<g
id="g4273"
transform="translate(-96.557648,-6.7287656)">
<path
style="fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 108.96148,19.97344 c 4.28933,11.161025 8.9416,20.384136 14.87384,32.552457 l 5.94954,-11.134131 12.749,12.154051 c 3.39402,0.638464 5.31688,-1.489816 4.75963,-4.504649 l -13.00398,-11.814076 8.49933,-6.629483 z"
id="path1052"
sodipodi:nodetypes="cccccccc" />
<path
style="fill:#d3d7cf;fill-opacity:1;stroke:#ffffff;stroke-width:1.285;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 112.59215,23.233162 c 3.72959,10.062766 6.25342,13.924184 11.41153,24.895126 l 5.26419,-9.586262 13.8638,13.109482 c 1.42608,0.530564 2.84842,-0.286358 2.07091,-2.088013 l -13.80942,-12.277572 7.29489,-5.92068 z"
id="path1052-8"
sodipodi:nodetypes="cccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,305 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64px"
height="64px"
id="svg3364"
version="1.1"
sodipodi:docname="Sketcher_GridSnap_deactivated.svg"
inkscape:version="1.1-beta1 (77e7b44db3, 2021-03-28)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview55"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
objecttolerance="10.0"
gridtolerance="10.0"
guidetolerance="10.0"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="5.8828125"
inkscape:cx="11.474104"
inkscape:cy="25.498008"
inkscape:window-width="1720"
inkscape:window-height="1112"
inkscape:window-x="743"
inkscape:window-y="334"
inkscape:window-maximized="0"
inkscape:current-layer="svg3364" />
<defs
id="defs3366">
<linearGradient
id="linearGradient3864">
<stop
id="stop3866"
offset="0"
style="stop-color:#71b2f8;stop-opacity:1" />
<stop
id="stop3868"
offset="1"
style="stop-color:#002795;stop-opacity:1" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient2571"
gradientUnits="userSpaceOnUse"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-215.02413,-170.90186)" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3352"
gradientUnits="userSpaceOnUse"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<linearGradient
id="linearGradient3593">
<stop
style="stop-color:#c8e0f9;stop-opacity:1"
offset="0"
id="stop3595" />
<stop
style="stop-color:#637dca;stop-opacity:1"
offset="1"
id="stop3597" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3354"
gradientUnits="userSpaceOnUse"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient3369"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-461.81066,-173.06271)"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3372"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-327.50313,-4.3316646)"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3375"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-287.81791,-28.143054)"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient3380"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9829174,1.3240854,-1.2330051,0.8105158,-131.04134,-483.74563)"
cx="320.44025"
cy="113.23357"
fx="320.44025"
fy="113.23357"
r="19.571428" />
<linearGradient
xlink:href="#linearGradient3864"
id="linearGradient3914"
x1="6.94525"
y1="36.838673"
x2="48.691113"
y2="36.838673"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-4.8699606,-2.3863162)" />
<radialGradient
xlink:href="#linearGradient3794"
id="radialGradient3800"
cx="1"
cy="45"
fx="1"
fy="45"
r="41"
gradientTransform="matrix(0.93348213,-2.2905276e-8,0,0.28687573,0.06651751,32.090592)"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3794">
<stop
style="stop-color:#000000;stop-opacity:1"
offset="0"
id="stop3796" />
<stop
style="stop-color:#000000;stop-opacity:0"
offset="1"
id="stop3798" />
</linearGradient>
<linearGradient
gradientTransform="translate(0,-9)"
xlink:href="#linearGradient3777"
id="linearGradient3783"
x1="53.896763"
y1="51.179787"
x2="48"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3777">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3779" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop3781" />
</linearGradient>
<linearGradient
gradientTransform="translate(22,-17)"
xlink:href="#linearGradient3767"
id="linearGradient3773"
x1="22.116516"
y1="55.717518"
x2="19"
y2="33"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3767">
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="0"
id="stop3769" />
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="1"
id="stop3771" />
</linearGradient>
<linearGradient
gradientTransform="translate(-2,-11)"
xlink:href="#linearGradient3777-6"
id="linearGradient3783-3"
x1="53.896763"
y1="51.179787"
x2="48"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3777-6">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3779-7" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop3781-5" />
</linearGradient>
<linearGradient
y2="32"
x2="48"
y1="51.179787"
x1="53.896763"
gradientTransform="translate(-24,-13)"
gradientUnits="userSpaceOnUse"
id="linearGradient3066"
xlink:href="#linearGradient3777-6" />
</defs>
<metadata
id="metadata3369">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:creator>
<cc:Agent>
<dc:title>[wmayer]</dc:title>
</cc:Agent>
</dc:creator>
<dc:date>2011-10-10</dc:date>
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
<dc:publisher>
<cc:Agent>
<dc:title>FreeCAD</dc:title>
</cc:Agent>
</dc:publisher>
<dc:identifier>FreeCAD/src/Mod/Part/Gui/Resources/icons/Part_Section.svg</dc:identifier>
<dc:rights>
<cc:Agent>
<dc:title>FreeCAD LGPL2+</dc:title>
</cc:Agent>
</dc:rights>
<cc:license>https://www.gnu.org/copyleft/lesser.html</cc:license>
<dc:contributor>
<cc:Agent>
<dc:title>[agryson] Alexander Gryson</dc:title>
</cc:Agent>
</dc:contributor>
</cc:Work>
</rdf:RDF>
</metadata>
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.3798139,32.218121 H 61.620186"
id="path985-9" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.2324867,51.127858 H 61.472858"
id="path985-6" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 12.221742,61.620185 V 2.3798148"
id="path985-92" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 31.131479,61.620186 V 2.3798143"
id="path985-9-8" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 50.041216,61.620185 V 2.3798148"
id="path985-6-2" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.2324859,13.308385 H 61.472857"
id="path985" />
<g
id="g4273"
transform="translate(-89.078232,1.7705704)">
<path
style="fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 108.96148,19.97344 c 4.28933,11.161025 8.9416,20.384136 14.87384,32.552457 l 5.94954,-11.134131 12.749,12.154051 c 3.39402,0.638464 5.31688,-1.489816 4.75963,-4.504649 l -13.00398,-11.814076 8.49933,-6.629483 z"
id="path1052"
sodipodi:nodetypes="cccccccc" />
<path
style="fill:#d3d7cf;fill-opacity:1;stroke:#ffffff;stroke-width:1.285;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 112.59215,23.233162 c 3.72959,10.062766 6.25342,13.924184 11.41153,24.895126 l 5.26419,-9.586262 13.8638,13.109482 c 1.42608,0.530564 2.84842,-0.286358 2.07091,-2.088013 l -13.80942,-12.277572 7.29489,-5.92068 z"
id="path1052-8"
sodipodi:nodetypes="cccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,322 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64px"
height="64px"
id="svg3364"
version="1.1"
sodipodi:docname="Sketcher_GridToggle.svg"
inkscape:version="1.1-beta1 (77e7b44db3, 2021-03-28)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview55"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
objecttolerance="10.0"
gridtolerance="10.0"
guidetolerance="10.0"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="8.3195532"
inkscape:cx="26.684125"
inkscape:cy="42.009468"
inkscape:window-width="1725"
inkscape:window-height="1097"
inkscape:window-x="622"
inkscape:window-y="258"
inkscape:window-maximized="0"
inkscape:current-layer="svg3364" />
<defs
id="defs3366">
<linearGradient
id="linearGradient3864">
<stop
id="stop3866"
offset="0"
style="stop-color:#71b2f8;stop-opacity:1" />
<stop
id="stop3868"
offset="1"
style="stop-color:#002795;stop-opacity:1" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient2571"
gradientUnits="userSpaceOnUse"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-215.02413,-170.90186)" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3352"
gradientUnits="userSpaceOnUse"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<linearGradient
id="linearGradient3593">
<stop
style="stop-color:#c8e0f9;stop-opacity:1"
offset="0"
id="stop3595" />
<stop
style="stop-color:#637dca;stop-opacity:1"
offset="1"
id="stop3597" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3354"
gradientUnits="userSpaceOnUse"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient3369"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-461.81066,-173.06271)"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3372"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-327.50313,-4.3316646)"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3375"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-287.81791,-28.143054)"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient3380"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9829174,1.3240854,-1.2330051,0.8105158,-131.04134,-483.74563)"
cx="320.44025"
cy="113.23357"
fx="320.44025"
fy="113.23357"
r="19.571428" />
<linearGradient
xlink:href="#linearGradient3864"
id="linearGradient3914"
x1="6.94525"
y1="36.838673"
x2="48.691113"
y2="36.838673"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-4.8699606,-2.3863162)" />
<radialGradient
xlink:href="#linearGradient3794"
id="radialGradient3800"
cx="1"
cy="45"
fx="1"
fy="45"
r="41"
gradientTransform="matrix(0.93348213,-2.2905276e-8,0,0.28687573,0.06651751,32.090592)"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3794">
<stop
style="stop-color:#000000;stop-opacity:1"
offset="0"
id="stop3796" />
<stop
style="stop-color:#000000;stop-opacity:0"
offset="1"
id="stop3798" />
</linearGradient>
<linearGradient
gradientTransform="translate(0,-9)"
xlink:href="#linearGradient3777"
id="linearGradient3783"
x1="53.896763"
y1="51.179787"
x2="48"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3777">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3779" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop3781" />
</linearGradient>
<linearGradient
gradientTransform="translate(22,-17)"
xlink:href="#linearGradient3767"
id="linearGradient3773"
x1="22.116516"
y1="55.717518"
x2="19"
y2="33"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3767">
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="0"
id="stop3769" />
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="1"
id="stop3771" />
</linearGradient>
<linearGradient
gradientTransform="translate(-2,-11)"
xlink:href="#linearGradient3777-6"
id="linearGradient3783-3"
x1="53.896763"
y1="51.179787"
x2="48"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3777-6">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3779-7" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop3781-5" />
</linearGradient>
<linearGradient
y2="32"
x2="48"
y1="51.179787"
x1="53.896763"
gradientTransform="translate(-24,-13)"
gradientUnits="userSpaceOnUse"
id="linearGradient3066"
xlink:href="#linearGradient3777-6" />
</defs>
<metadata
id="metadata3369">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:creator>
<cc:Agent>
<dc:title>[wmayer]</dc:title>
</cc:Agent>
</dc:creator>
<dc:date>2011-10-10</dc:date>
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
<dc:publisher>
<cc:Agent>
<dc:title>FreeCAD</dc:title>
</cc:Agent>
</dc:publisher>
<dc:identifier>FreeCAD/src/Mod/Part/Gui/Resources/icons/Part_Section.svg</dc:identifier>
<dc:rights>
<cc:Agent>
<dc:title>FreeCAD LGPL2+</dc:title>
</cc:Agent>
</dc:rights>
<cc:license>https://www.gnu.org/copyleft/lesser.html</cc:license>
<dc:contributor>
<cc:Agent>
<dc:title>[agryson] Alexander Gryson</dc:title>
</cc:Agent>
</dc:contributor>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="g2063">
<path
style="fill:none;stroke:#abf3a6;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 3.342788,14.6657 H 62.583159"
id="path985-65" />
<path
style="fill:none;stroke:#abf3a6;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 3.490116,33.575436 H 62.730488"
id="path985-9-6" />
<path
style="fill:none;stroke:#abf3a6;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 3.342789,52.485173 H 62.58316"
id="path985-6-6" />
<path
style="fill:none;stroke:#abf3a6;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 13.332044,62.9775 V 3.7371305"
id="path985-92-2" />
<path
style="fill:none;stroke:#abf3a6;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 32.241781,62.977501 V 3.7371295"
id="path985-9-8-7" />
<path
style="fill:none;stroke:#abf3a6;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 51.151518,62.9775 V 3.7371305"
id="path985-6-2-2" />
</g>
<g
id="g871"
style="stroke:#0e9905;stroke-opacity:1">
<path
style="fill:none;stroke:#0e9905;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.2324859,13.308385 H 61.472857"
id="path985" />
<path
style="fill:none;stroke:#0e9905;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.3798139,32.218121 H 61.620186"
id="path985-9" />
<path
style="fill:none;stroke:#0e9905;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.2324867,51.127858 H 61.472858"
id="path985-6" />
<path
style="fill:none;stroke:#0e9905;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 12.221742,61.620185 V 2.3798148"
id="path985-92" />
<path
style="fill:none;stroke:#0e9905;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 31.131479,61.620186 V 2.3798143"
id="path985-9-8" />
<path
style="fill:none;stroke:#0e9905;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 50.041216,61.620185 V 2.3798148"
id="path985-6-2" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,318 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64px"
height="64px"
id="svg3364"
version="1.1"
sodipodi:docname="Sketcher_GridActivate_Deactivated.svg"
inkscape:version="1.1-beta1 (77e7b44db3, 2021-03-28)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview55"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
objecttolerance="10.0"
gridtolerance="10.0"
guidetolerance="10.0"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="5.6568543"
inkscape:cx="41.896077"
inkscape:cy="46.934212"
inkscape:window-width="1725"
inkscape:window-height="1057"
inkscape:window-x="622"
inkscape:window-y="298"
inkscape:window-maximized="0"
inkscape:current-layer="svg3364" />
<defs
id="defs3366">
<linearGradient
id="linearGradient3864">
<stop
id="stop3866"
offset="0"
style="stop-color:#71b2f8;stop-opacity:1" />
<stop
id="stop3868"
offset="1"
style="stop-color:#002795;stop-opacity:1" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient2571"
gradientUnits="userSpaceOnUse"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-215.02413,-170.90186)" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3352"
gradientUnits="userSpaceOnUse"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<linearGradient
id="linearGradient3593">
<stop
style="stop-color:#c8e0f9;stop-opacity:1"
offset="0"
id="stop3595" />
<stop
style="stop-color:#637dca;stop-opacity:1"
offset="1"
id="stop3597" />
</linearGradient>
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3354"
gradientUnits="userSpaceOnUse"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient3369"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-461.81066,-173.06271)"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3372"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-327.50313,-4.3316646)"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3593"
id="radialGradient3375"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-287.81791,-28.143054)"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428" />
<radialGradient
xlink:href="#linearGradient3864"
id="radialGradient3380"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9829174,1.3240854,-1.2330051,0.8105158,-131.04134,-483.74563)"
cx="320.44025"
cy="113.23357"
fx="320.44025"
fy="113.23357"
r="19.571428" />
<linearGradient
xlink:href="#linearGradient3864"
id="linearGradient3914"
x1="6.94525"
y1="36.838673"
x2="48.691113"
y2="36.838673"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-4.8699606,-2.3863162)" />
<radialGradient
xlink:href="#linearGradient3794"
id="radialGradient3800"
cx="1"
cy="45"
fx="1"
fy="45"
r="41"
gradientTransform="matrix(0.93348213,-2.2905276e-8,0,0.28687573,0.06651751,32.090592)"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3794">
<stop
style="stop-color:#000000;stop-opacity:1"
offset="0"
id="stop3796" />
<stop
style="stop-color:#000000;stop-opacity:0"
offset="1"
id="stop3798" />
</linearGradient>
<linearGradient
gradientTransform="translate(0,-9)"
xlink:href="#linearGradient3777"
id="linearGradient3783"
x1="53.896763"
y1="51.179787"
x2="48"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3777">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3779" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop3781" />
</linearGradient>
<linearGradient
gradientTransform="translate(22,-17)"
xlink:href="#linearGradient3767"
id="linearGradient3773"
x1="22.116516"
y1="55.717518"
x2="19"
y2="33"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3767">
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="0"
id="stop3769" />
<stop
style="stop-color:#729fcf;stop-opacity:1"
offset="1"
id="stop3771" />
</linearGradient>
<linearGradient
gradientTransform="translate(-2,-11)"
xlink:href="#linearGradient3777-6"
id="linearGradient3783-3"
x1="53.896763"
y1="51.179787"
x2="48"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3777-6">
<stop
style="stop-color:#204a87;stop-opacity:1"
offset="0"
id="stop3779-7" />
<stop
style="stop-color:#3465a4;stop-opacity:1"
offset="1"
id="stop3781-5" />
</linearGradient>
<linearGradient
y2="32"
x2="48"
y1="51.179787"
x1="53.896763"
gradientTransform="translate(-24,-13)"
gradientUnits="userSpaceOnUse"
id="linearGradient3066"
xlink:href="#linearGradient3777-6" />
</defs>
<metadata
id="metadata3369">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:creator>
<cc:Agent>
<dc:title>[wmayer]</dc:title>
</cc:Agent>
</dc:creator>
<dc:date>2011-10-10</dc:date>
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
<dc:publisher>
<cc:Agent>
<dc:title>FreeCAD</dc:title>
</cc:Agent>
</dc:publisher>
<dc:identifier>FreeCAD/src/Mod/Part/Gui/Resources/icons/Part_Section.svg</dc:identifier>
<dc:rights>
<cc:Agent>
<dc:title>FreeCAD LGPL2+</dc:title>
</cc:Agent>
</dc:rights>
<cc:license>https://www.gnu.org/copyleft/lesser.html</cc:license>
<dc:contributor>
<cc:Agent>
<dc:title>[agryson] Alexander Gryson</dc:title>
</cc:Agent>
</dc:contributor>
</cc:Work>
</rdf:RDF>
</metadata>
<path
style="fill:none;stroke:#a0a0a0;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 3.0721753,14.324851 H 62.312546"
id="path985-4" />
<path
style="fill:none;stroke:#a0a0a0;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 3.2195033,33.234587 H 62.459875"
id="path985-9-0" />
<path
style="fill:none;stroke:#a0a0a0;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 3.0721763,52.144324 H 62.312547"
id="path985-6-4" />
<path
style="fill:none;stroke:#a0a0a0;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 13.061431,62.636651 V 3.3962819"
id="path985-92-6" />
<path
style="fill:none;stroke:#a0a0a0;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 31.971168,62.636652 V 3.3962814"
id="path985-9-8-6" />
<path
style="fill:none;stroke:#a0a0a0;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6, 3;stroke-dashoffset:0;stroke-opacity:1"
d="M 50.880905,62.636651 V 3.3962819"
id="path985-6-2-4" />
<g
id="g864">
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6,3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.2324859,13.308385 H 61.472857"
id="path985" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6,3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.3798139,32.218121 H 61.620186"
id="path985-9" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6,3;stroke-dashoffset:0;stroke-opacity:1"
d="M 2.2324867,51.127858 H 61.472858"
id="path985-6" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6,3;stroke-dashoffset:0;stroke-opacity:1"
d="M 12.221742,61.620185 V 2.3798148"
id="path985-92" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6,3;stroke-dashoffset:0;stroke-opacity:1"
d="M 31.131479,61.620186 V 2.3798143"
id="path985-9-8" />
<path
style="fill:none;stroke:#363636;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:6,3;stroke-dashoffset:0;stroke-opacity:1"
d="M 50.041216,61.620185 V 2.3798148"
id="path985-6-2" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -34,6 +34,8 @@
#include "SketcherSettings.h"
#include "ui_SketcherSettings.h"
#include "ui_SketcherSettingsGrid.h"
#include "ui_SketcherSettingsDisplay.h"
#include "ui_SketcherSettingsColors.h"
#include "ui_SketcherSettingsDisplay.h"
#include "TaskSketcherGeneral.h"
@@ -99,23 +101,23 @@ void SketcherSettings::changeEvent(QEvent *e)
}
}
/* TRANSLATOR SketcherGui::SketcherSettingsGrid */
/* TRANSLATOR SketcherGui::SketcherSettingsDisplay */
SketcherSettingsDisplay::SketcherSettingsDisplay(QWidget* parent)
: PreferencePage(parent), ui(new Ui_SketcherSettingsDisplay)
SketcherSettingsGrid::SketcherSettingsGrid(QWidget* parent)
: PreferencePage(parent), ui(new Ui_SketcherSettingsGrid)
{
ui->setupUi(this);
QList < QPair<Qt::PenStyle, int> > styles;
styles << qMakePair(Qt::SolidLine, 0xffff)
<< qMakePair(Qt::DashLine, 0x0f0f)
<< qMakePair(Qt::DotLine, 0xaaaa);
// << qMakePair(Qt::DashDotLine, 0x????)
// << qMakePair(Qt::DashDotDotLine, 0x????);
ui->comboBox->setIconSize (QSize(80, 12));
<< qMakePair(Qt::DashLine, 0x0f0f)
<< qMakePair(Qt::DotLine, 0xaaaa);
// << qMakePair(Qt::DashDotLine, 0x????)
// << qMakePair(Qt::DashDotDotLine, 0x????);
ui->gridLinePattern->setIconSize(QSize(80, 12));
ui->gridDivLinePattern->setIconSize(QSize(80, 12));
for (QList < QPair<Qt::PenStyle, int> >::iterator it = styles.begin(); it != styles.end(); ++it) {
QPixmap px(ui->comboBox->iconSize());
QPixmap px(ui->gridLinePattern->iconSize());
px.fill(Qt::transparent);
QBrush brush(Qt::black);
QPen pen(it->first);
@@ -124,12 +126,86 @@ SketcherSettingsDisplay::SketcherSettingsDisplay(QWidget* parent)
QPainter painter(&px);
painter.setPen(pen);
double mid = ui->comboBox->iconSize().height() / 2.0;
painter.drawLine(0, mid, ui->comboBox->iconSize().width(), mid);
double mid = ui->gridLinePattern->iconSize().height() / 2.0;
painter.drawLine(0, mid, ui->gridLinePattern->iconSize().width(), mid);
painter.end();
ui->comboBox->addItem(QIcon(px), QString(), QVariant(it->second));
ui->gridLinePattern->addItem(QIcon(px), QString(), QVariant(it->second));
ui->gridDivLinePattern->addItem(QIcon(px), QString(), QVariant(it->second));
}
}
SketcherSettingsGrid::~SketcherSettingsGrid()
{
// no need to delete child widgets, Qt does it all for us
}
void SketcherSettingsGrid::saveSettings()
{
ui->checkBoxShowGrid->onSave();
ui->gridSize->onSave();
ui->checkBoxGridSnap->onSave();
ui->checkBoxGridAuto->onSave();
ui->gridSizePixelThreshold->onSave();
ui->gridLineColor->onSave();
ui->gridDivLineColor->onSave();
ui->gridLineWidth->onSave();
ui->gridDivLineWidth->onSave();
ui->gridNumberSubdivision->onSave();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/General");
QVariant data = ui->gridLinePattern->itemData(ui->gridLinePattern->currentIndex());
int pattern = data.toInt();
hGrp->SetInt("GridLinePattern", pattern);
data = ui->gridDivLinePattern->itemData(ui->gridDivLinePattern->currentIndex());
pattern = data.toInt();
hGrp->SetInt("GridDivLinePattern", pattern);
}
void SketcherSettingsGrid::loadSettings()
{
ui->checkBoxShowGrid->onRestore();
ui->gridSize->onRestore();
ui->checkBoxGridSnap->onRestore();
ui->checkBoxGridAuto->onRestore();
ui->gridSizePixelThreshold->onRestore();
ui->gridLineColor->onRestore();
ui->gridDivLineColor->onRestore();
ui->gridLineWidth->onRestore();
ui->gridDivLineWidth->onRestore();
ui->gridNumberSubdivision->onRestore();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/General");
int pattern = hGrp->GetInt("GridLinePattern", 0x0f0f);
int index = ui->gridLinePattern->findData(QVariant(pattern));
if (index < 0) index = 1;
ui->gridLinePattern->setCurrentIndex(index);
pattern = hGrp->GetInt("GridDivLinePattern", 0xffff);
index = ui->gridDivLinePattern->findData(QVariant(pattern));
if (index < 0) index = 0;
ui->gridDivLinePattern->setCurrentIndex(index);
}
/**
* Sets the strings of the subwidgets using the current language.
*/
void SketcherSettingsGrid::changeEvent(QEvent* e)
{
if (e->type() == QEvent::LanguageChange) {
ui->retranslateUi(this);
}
else {
QWidget::changeEvent(e);
}
}
/* TRANSLATOR SketcherGui::SketcherSettingsDisplay */
SketcherSettingsDisplay::SketcherSettingsDisplay(QWidget* parent)
: PreferencePage(parent), ui(new Ui_SketcherSettingsDisplay)
{
ui->setupUi(this);
connect(ui->btnTVApply, &QPushButton::clicked, this, &SketcherSettingsDisplay::onBtnTVApplyClicked);
}
@@ -161,11 +237,6 @@ void SketcherSettingsDisplay::saveSettings()
ui->checkBoxTVRestoreCamera->onSave();
ui->checkBoxTVForceOrtho->onSave();
ui->checkBoxTVSectionView->onSave();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part");
QVariant data = ui->comboBox->itemData(ui->comboBox->currentIndex());
int pattern = data.toInt();
hGrp->SetInt("GridLinePattern", pattern);
}
void SketcherSettingsDisplay::loadSettings()
@@ -188,12 +259,6 @@ void SketcherSettingsDisplay::loadSettings()
ui->checkBoxTVForceOrtho->onRestore();
this->ui->checkBoxTVForceOrtho->setEnabled(this->ui->checkBoxTVRestoreCamera->isChecked());
ui->checkBoxTVSectionView->onRestore();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part");
int pattern = hGrp->GetInt("GridLinePattern", 0x0f0f);
int index = ui->comboBox->findData(QVariant(pattern));
if (index <0) index = 1;
ui->comboBox->setCurrentIndex(index);
}
/**

View File

@@ -29,6 +29,7 @@
namespace SketcherGui {
class Ui_SketcherSettings;
class Ui_SketcherSettingsGrid;
class Ui_SketcherSettingsDisplay;
class Ui_SketcherSettingsColors;
class SketcherGeneralWidget;
@@ -55,6 +56,27 @@ private:
SketcherGeneralWidget* form;
};
/**
* The SketcherSettings class implements a preference page to change sketcher grid settings.
*/
class SketcherSettingsGrid : public Gui::Dialog::PreferencePage
{
Q_OBJECT
public:
explicit SketcherSettingsGrid(QWidget* parent = nullptr);
~SketcherSettingsGrid() override;
void saveSettings() override;
void loadSettings() override;
protected:
void changeEvent(QEvent *e) override;
private:
std::unique_ptr<Ui_SketcherSettingsGrid> ui;
};
/**
* The SketcherSettings class implements a preference page to change sketcher display settings.
* @author Werner Mayer

View File

@@ -67,7 +67,7 @@
</property>
</widget>
</item>
<item row="3" column="1">
<item row="2" column="1">
<widget class="Gui::PrefSpinBox" name="SegmentsPerGeometry">
<property name="toolTip">
<string>The number of polygons used for geometry approximation.</string>
@@ -86,7 +86,7 @@
</property>
</widget>
</item>
<item row="10" column="0">
<item row="9" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxShowDimensionalName">
<property name="toolTip">
<string>If checked, displays the name on dimensional constraints (if exists).</string>
@@ -102,7 +102,7 @@
</property>
</widget>
</item>
<item row="10" column="1">
<item row="9" column="1">
<widget class="Gui::PrefLineEdit" name="prefDimensionalStringFormat">
<property name="toolTip">
<string>The format of the dimensional constraint string presentation.
@@ -125,7 +125,7 @@ Defaults to: %N = %V
</property>
</widget>
</item>
<item row="3" column="0">
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Segments per geometry</string>
@@ -135,7 +135,7 @@ Defaults to: %N = %V
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<item row="4" column="0" colspan="2">
<widget class="Gui::PrefCheckBox" name="continueMode">
<property name="toolTip">
<string>The current sketcher creation tool will remain active after creation.</string>
@@ -179,7 +179,7 @@ Defaults to: %N = %V
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<item row="6" column="0" colspan="2">
<widget class="Gui::PrefCheckBox" name="checkBoxHideUnits">
<property name="toolTip">
<string>Base length units will not be displayed in constraints or cursor coordinates.
@@ -212,27 +212,7 @@ Supports all unit systems except 'US customary' and 'Building US/Euro'.</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Grid line pattern</string>
</property>
<property name="buddy">
<cstring>comboBox</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox">
<property name="toolTip">
<string>Line pattern used for grid lines.</string>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<item row="5" column="0" colspan="2">
<widget class="Gui::PrefCheckBox" name="constraintMode">
<property name="toolTip">
<string>The current constraint creation tool will remain active after creation.</string>
@@ -251,7 +231,7 @@ Supports all unit systems except 'US customary' and 'Building US/Euro'.</string>
</property>
</widget>
</item>
<item row="8" column="0">
<item row="7" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxShowCursorCoords">
<property name="toolTip">
<string>Cursor position coordinates will be displayed beside cursor while editing sketch.</string>
@@ -270,7 +250,7 @@ Supports all unit systems except 'US customary' and 'Building US/Euro'.</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<item row="3" column="0" colspan="2">
<widget class="Gui::PrefCheckBox" name="dialogOnDistanceConstraint">
<property name="toolTip">
<string>A dialog will pop up to input a value for new dimensional constraints.</string>
@@ -289,7 +269,7 @@ Supports all unit systems except 'US customary' and 'Building US/Euro'.</string>
</property>
</widget>
</item>
<item row="9" column="0">
<item row="8" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxUseSystemDecimals">
<property name="toolTip">
<string>Cursor coordinates will use the system decimals setting instead of the short form.</string>

View File

@@ -0,0 +1,471 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SketcherGui::SketcherSettingsGrid</class>
<widget class="QWidget" name="SketcherGui::SketcherSettingsGrid">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>664</height>
</rect>
</property>
<property name="windowTitle">
<string>Grid</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox_1">
<property name="title">
<string>Grid settings</string>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout" name="QGridLayout_1">
<item row="0" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxShowGrid">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>A grid will be shown</string>
</property>
<property name="text">
<string>Grid</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowGrid</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/General</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxGridSnap">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>New points will snap to the nearest grid line.
Points must be set closer than a fifth of the grid spacing to a grid line to snap.</string>
</property>
<property name="text">
<string>Grid snap</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>GridSnap</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/General</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxGridAuto">
<property name="checked">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Automatically adapt grid spacing based on the viewer dimensions.</string>
</property>
<property name="text">
<string>Grid Auto Spacing</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>GridAuto</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/General</cstring>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_gridSize">
<property name="text">
<string>Grid spacing (if auto disabled)</string>
</property>
<property name="buddy">
<cstring>gridSize</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::PrefQuantitySpinBox" name="gridSize">
<property name="toolTip">
<string>Distance between two subsequent grid lines</string>
</property>
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="minimum">
<double>0.001000000000000</double>
</property>
<property name="maximum">
<double>99999999.000000000000000</double>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
<property name="value">
<double>10.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>GridSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/General/GridSize</cstring>
</property>
<property name="decimals" stdset="0">
<number>3</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_gridSizePixelThreshold">
<property name="text">
<string>Pixel size threshold</string>
</property>
<property name="buddy">
<cstring>gridNumberSubdivision</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="Gui::PrefSpinBox" name="gridSizePixelThreshold">
<property name="toolTip">
<string>While using 'Grid Auto Spacing' this sets a threshold in pixel to the grid spacing. The grid spacing change if it becomes smaller than this number of pixel.</string>
</property>
<property name="minimum">
<number>3</number>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="value">
<number>15</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>GridSizePixelThreshold</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/General</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Grid display</string>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="vLayout">
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Subdivision lines</string>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout" name="QGridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Line pattern</string>
</property>
<property name="buddy">
<cstring>gridLinePattern</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="gridLinePattern">
<property name="toolTip">
<string>Line pattern used for grid lines.</string>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_gridLineWidth">
<property name="text">
<string>Line width</string>
</property>
<property name="buddy">
<cstring>gridLineWidth</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefSpinBox" name="gridLineWidth">
<property name="toolTip">
<string>Distance between two subsequent grid lines</string>
</property>
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>99</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>GridLineWidth</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/General</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_gridLineColor">
<property name="text">
<string>Line color</string>
</property>
<property name="buddy">
<cstring>gridLineColor</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::PrefColorButton" name="gridLineColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="color">
<color>
<red>178</red>
<green>178</green>
<blue>178</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>GridLineColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/General</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Division lines</string>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout" name="QGridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_gridNumberSubdivision">
<property name="text">
<string>Number of subdivisions per division</string>
</property>
<property name="buddy">
<cstring>gridNumberSubdivision</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::PrefSpinBox" name="gridNumberSubdivision">
<property name="toolTip">
<string>Number of subdivisions of each grid division. Set to 1 to disable divisions.</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="value">
<number>10</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>GridNumberSubdivision</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/General</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Line pattern</string>
</property>
<property name="buddy">
<cstring>gridDivLinePattern</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="gridDivLinePattern">
<property name="toolTip">
<string>Line pattern used for grid division.</string>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_gridDivLineWidth">
<property name="text">
<string>Line width</string>
</property>
<property name="buddy">
<cstring>gridDivLineWidth</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::PrefSpinBox" name="gridDivLineWidth">
<property name="toolTip">
<string>Distance between two subsequent division lines</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>99</number>
</property>
<property name="value">
<number>2</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>GridDivLineWidth</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/General</cstring>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_gridDivLineColor">
<property name="text">
<string>Line color</string>
</property>
<property name="buddy">
<cstring>gridDivLineColor</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::PrefColorButton" name="gridDivLineColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="color">
<color>
<red>178</red>
<green>178</green>
<blue>178</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>GridDivLineColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/General</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::PrefSpinBox</class>
<extends>QSpinBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefCheckBox</class>
<extends>QCheckBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefQuantitySpinBox</class>
<extends>Gui::QuantitySpinBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::QuantitySpinBox</class>
<extends>QAbstractSpinBox</extends>
<header>Gui/QuantitySpinBox.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefColorButton</class>
<extends>Gui::ColorButton</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::ColorButton</class>
<extends>QPushButton</extends>
<header>Gui/Widgets.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -201,14 +201,16 @@ void ViewProviderSketch::ParameterObserver::initParameters()
{[this](const std::string & string, App::Property * property){ updateBoolProperty(string, property, false);}, &Client.ForceOrtho }},
{"SectionView",
{[this](const std::string & string, App::Property * property){ updateBoolProperty(string, property, false);}, &Client.SectionView }},
{"ShowGrid",
{[this](const std::string & string, App::Property * property){ updateBoolProperty(string, property, false);}, &Client.ShowGrid }},
{"GridSnap",
{[this](const std::string & string, App::Property * property){ updateBoolProperty(string, property, false);}, &Client.GridSnap }},
{"AutoConstraints",
{[this](const std::string & string, App::Property * property){ updateBoolProperty(string, property, true);}, &Client.Autoconstraints }},
{"AvoidRedundantAutoconstraints",
{[this](const std::string & string, App::Property * property){ updateBoolProperty(string, property, true);}, &Client.AvoidRedundant }},
{"ShowGrid",
{[this](const std::string & string, App::Property * property){ updateBoolProperty(string, property, false);}, &Client.ShowGrid }},
{"GridSnap",
{[this](const std::string & string, App::Property * property){ updateBoolProperty(string, property, false);}, &Client.GridSnap }},
{"GridAuto",
{[this](const std::string & string, App::Property * property){ updateBoolProperty(string, property, true); }, &Client.GridAuto }},
{"GridSize",
{[this](const std::string & string, App::Property * property){ updateGridSize(string, property);}, &Client.GridSize }},
{"SketchEdgeColor",
@@ -260,8 +262,10 @@ SbVec2s ViewProviderSketch::DoubleClick::newCursorPos;
// Construction/Destruction
/* TRANSLATOR SketcherGui::ViewProviderSketch */
const char* ViewProviderSketch::GridStyleEnums[] = { "Dashed","Light",nullptr };
App::PropertyQuantityConstraint::Constraints ViewProviderSketch::GridSizeRange = { 0.001,DBL_MAX,1.0 };
PROPERTY_SOURCE_WITH_EXTENSIONS(SketcherGui::ViewProviderSketch, PartGui::ViewProvider2DObjectGrid)
PROPERTY_SOURCE_WITH_EXTENSIONS(SketcherGui::ViewProviderSketch, PartGui::ViewProvider2DObject)
ViewProviderSketch::ViewProviderSketch()
@@ -285,6 +289,11 @@ ViewProviderSketch::ViewProviderSketch()
ADD_PROPERTY_TYPE(ForceOrtho,(false),"Visibility automation",(App::PropertyType)(App::Prop_ReadOnly),"If true, camera type will be forced to orthographic view when entering editing mode.");
ADD_PROPERTY_TYPE(SectionView,(false),"Visibility automation",(App::PropertyType)(App::Prop_ReadOnly),"If true, only objects (or part of) located behind the sketch plane are visible.");
ADD_PROPERTY_TYPE(EditingWorkbench,("SketcherWorkbench"),"Visibility automation",(App::PropertyType)(App::Prop_ReadOnly),"Name of the workbench to activate when editing this sketch.");
ADD_PROPERTY_TYPE(ShowGrid, (false), "Grid", (App::PropertyType)(App::Prop_None), "Switch the grid on/off");
ADD_PROPERTY_TYPE(GridSize, (10.0), "Grid", (App::PropertyType)(App::Prop_None), "Gap size of the grid");
ADD_PROPERTY_TYPE(GridStyle, (0L), "Grid", (App::PropertyType)(App::Prop_None), "Appearance style of the grid");
ADD_PROPERTY_TYPE(GridSnap, (false), "Grid", (App::PropertyType)(App::Prop_None), "Switch the grid snap on/off");
ADD_PROPERTY_TYPE(GridAuto, (true), "Grid", (App::PropertyType)(App::Prop_None), "Change size of grid based on view area.");
// Default values that will be overridden by preferences (if existing)
PointSize.setValue(4);
@@ -293,7 +302,8 @@ ViewProviderSketch::ViewProviderSketch()
pObserver->initParameters();
pObserver->subscribeToParameters();
this->GridAutoSize.setValue(false); //Grid size is managed by this class
GridStyle.setEnums(GridStyleEnums);
GridSize.setConstraints(&GridSizeRange);
sPixmap = "Sketcher_Sketch";
@@ -1553,7 +1563,7 @@ bool ViewProviderSketch::isSelectable() const
if (isEditing())
return false;
else
return PartGui::ViewProvider2DObjectGrid::isSelectable();
return PartGui::ViewProvider2DObject::isSelectable();
}
void ViewProviderSketch::onSelectionChanged(const Gui::SelectionChanges& msg)
@@ -2686,7 +2696,12 @@ void ViewProviderSketch::drawEditMarkers(const std::vector<Base::Vector2d> &Edit
void ViewProviderSketch::updateData(const App::Property *prop)
{
ViewProvider2DObjectGrid::updateData(prop);
ViewProvider2DObject::updateData(prop);
if (prop->getTypeId() == Part::PropertyPartShape::getClassTypeId()) {
if (isInEditMode())
editCoinManager->drawGrid();
}
// In the case of an undo/redo transaction, updateData is triggered by SketchObject::onUndoRedoFinished() in the solve()
// In the case of an internal transaction, touching the geometry results in a call to updateData.
@@ -2721,7 +2736,16 @@ void ViewProviderSketch::updateData(const App::Property *prop)
void ViewProviderSketch::onChanged(const App::Property *prop)
{
// call father
PartGui::ViewProvider2DObjectGrid::onChanged(prop);
ViewProviderPart::onChanged(prop);
if (prop == &ShowGrid && isInEditMode())
editCoinManager->drawGrid();
if (prop == &GridSize && isInEditMode())
editCoinManager->drawGrid();
if (prop == &GridStyle && isInEditMode())
editCoinManager->drawGrid();
}
void ViewProviderSketch::attach(App::DocumentObject *pcFeat)
@@ -2853,10 +2877,6 @@ bool ViewProviderSketch::setEdit(int ModNum)
Base::Console().Warning("ViewProviderSketch::setEdit: could not import Show module. Visibility automation will not work.\n");
}
TightGrid.setValue(false);
ViewProvider2DObjectGrid::setEdit(ModNum); // notify to handle grid according to edit mode property
// start the edit dialog
if (sketchDlg)
Gui::Control().showDialog(sketchDlg);
@@ -3044,8 +3064,6 @@ void ViewProviderSketch::unsetEdit(int ModNum)
Gui::ToolBarManager::getInstance()->setToolbarVisibility(false, editModeToolbarNames());
Gui::ToolBarManager::getInstance()->setToolbarVisibility(true, nonEditModeToolbarNames());
TightGrid.setValue(true);
if(listener) {
Gui::getMainWindow()->removeEventFilter(listener);
delete listener;
@@ -3098,8 +3116,6 @@ void ViewProviderSketch::unsetEdit(int ModNum)
Base::Console().Error("ViewProviderSketch::unsetEdit: visibility automation failed with an error: \n");
e.ReportException();
}
ViewProvider2DObjectGrid::unsetEdit(ModNum); // notify grid that edit mode is being left
}
void ViewProviderSketch::setEditViewer(Gui::View3DInventorViewer* viewer, int ModNum)
@@ -3207,24 +3223,31 @@ void ViewProviderSketch::camSensCB(void *data, SoSensor *)
auto vp = proxyVPrdr->vp;
auto cam = proxyVPrdr->renderMgr->getCamera();
auto rotSk = Base::Rotation(vp->getDocument()->getEditingTransform()); //sketch orientation
vp->onCameraChanged(cam);
}
void ViewProviderSketch::onCameraChanged(SoCamera* cam)
{
auto rotSk = Base::Rotation(getDocument()->getEditingTransform()); //sketch orientation
auto rotc = cam->orientation.getValue().getValue();
auto rotCam = Base::Rotation(rotc[0], rotc[1], rotc[2], rotc[3]); // camera orientation (needed because float to double conversion)
// Is camera in the same hemisphere as positive sketch normal ?
auto orientation = (rotCam.invert()*rotSk).multVec(Base::Vector3d(0,0,1));
auto tmpFactor = orientation.z<0?-1:1;
auto orientation = (rotCam.invert() * rotSk).multVec(Base::Vector3d(0, 0, 1));
auto tmpFactor = orientation.z < 0 ? -1 : 1;
if (tmpFactor != vp->viewOrientationFactor) { // redraw only if viewing side changed
if (tmpFactor != viewOrientationFactor) { // redraw only if viewing side changed
Base::Console().Log("Switching side, now %s, redrawing\n", tmpFactor < 0 ? "back" : "front");
vp->viewOrientationFactor = tmpFactor;
vp->draw();
viewOrientationFactor = tmpFactor;
draw();
QString cmdStr = QStringLiteral(
"ActiveSketch.ViewObject.TempoVis.sketchClipPlane(ActiveSketch, ActiveSketch.ViewObject.SectionView, %1)\n")
.arg(tmpFactor<0?QLatin1String("True"):QLatin1String("False"));
.arg(tmpFactor < 0 ? QLatin1String("True") : QLatin1String("False"));
Base::Interpreter().runStringObject(cmdStr.toLatin1());
}
editCoinManager->drawGrid(true);
}
int ViewProviderSketch::getPreselectPoint() const
@@ -3466,6 +3489,28 @@ QIcon ViewProviderSketch::mergeColorfulOverlayIcons (const QIcon & orig) const
return Gui::ViewProvider::mergeColorfulOverlayIcons (mergedicon);
}
void ViewProviderSketch::handleChangedPropertyType(Base::XMLReader& reader,
const char* TypeName,
App::Property* prop)
{
Base::Type inputType = Base::Type::fromName(TypeName);
if (prop->getTypeId().isDerivedFrom(App::PropertyFloat::getClassTypeId()) &&
inputType.isDerivedFrom(App::PropertyFloat::getClassTypeId())) {
// Do not directly call the property's Restore method in case the implementation
// has changed. So, create a temporary PropertyFloat object and assign the value.
App::PropertyFloat floatProp;
floatProp.Restore(reader);
static_cast<App::PropertyFloat*>(prop)->setValue(floatProp.getValue());
}
else {
ViewProviderPart::handleChangedPropertyType(reader, TypeName, prop);
}
}
void ViewProviderSketch::Restore(Base::XMLReader& reader)
{
ViewProviderPart::Restore(reader);
}
/*************************** functions ViewProviderSketch offers to friends such as DrawHandlerSketch ************************/

View File

@@ -135,7 +135,7 @@ using GeoListFacade = Sketcher::GeoListFacade;
* concentrating the coupling in a single point (and code reuse).
*
*/
class SketcherGuiExport ViewProviderSketch : public PartGui::ViewProvider2DObjectGrid
class SketcherGuiExport ViewProviderSketch : public PartGui::ViewProvider2DObject
, public PartGui::ViewProviderAttachExtension
, public Gui::SelectionObserver
{
@@ -412,6 +412,11 @@ public:
App::PropertyBool ForceOrtho;
App::PropertyBool SectionView;
App::PropertyString EditingWorkbench;
App::PropertyBool ShowGrid;
App::PropertyLength GridSize;
App::PropertyEnumeration GridStyle;
App::PropertyBool GridSnap;
App::PropertyBool GridAuto;
//@}
// TODO: It is difficult to imagine that these functions are necessary in the public interface. This requires review at a second stage and possibly
@@ -532,6 +537,7 @@ public:
bool mouseButtonPressed(int Button, bool pressed, const SbVec2s& cursorPos, const Gui::View3DInventorViewer* viewer) override;
bool mouseWheelEvent(int delta, const SbVec2s &cursorPos, const Gui::View3DInventorViewer* viewer) override;
//@}
/// Control the overlays appearing on the Tree and reflecting different sketcher states
QIcon mergeColorfulOverlayIcons (const QIcon & orig) const override;
@@ -560,6 +566,7 @@ protected:
void setEditViewer(Gui::View3DInventorViewer*, int ModNum) override;
void unsetEditViewer(Gui::View3DInventorViewer*) override;
static void camSensCB(void *data, SoSensor *); // camera sensor callback
void onCameraChanged(SoCamera* cam);
//@}
/** @name miscelanea editing functions */
@@ -775,6 +782,12 @@ private:
SoNodeSensor cameraSensor;
int viewOrientationFactor; // stores if sketch viewed from front or back
void Restore(Base::XMLReader& reader) override;
void handleChangedPropertyType(Base::XMLReader& reader, const char* TypeName, App::Property* prop) override;
static const char* GridStyleEnums[];
static App::PropertyQuantityConstraint::Constraints GridSizeRange;
};
} // namespace PartGui

View File

@@ -80,7 +80,6 @@ private:
static inline const GeoList getGeoList(const ViewProviderSketch & vp);
static inline const GeoListFacade getGeoListFacade(const ViewProviderSketch & vp);
static inline Base::Placement getEditingPlacement(const ViewProviderSketch & vp);
static inline void updateGridExtent(ViewProviderSketch & vp, float minx, float maxx, float miny, float maxy);
static inline bool isShownVirtualSpace(const ViewProviderSketch & vp);
static inline std::unique_ptr<SoRayPickAction> getRayPickAction(const ViewProviderSketch & vp);
@@ -114,6 +113,7 @@ private:
friend class EditModeCoinManager;
friend class EditModeConstraintCoinManager;
friend class EditModeGeometryCoinManager;
friend class EditModeGridCoinManager;
friend class EditModeInformationOverlayCoinConverter;
friend class EditModeGeometryCoinConverter;
};
@@ -143,11 +143,6 @@ inline Base::Placement ViewProviderSketchCoinAttorney::getEditingPlacement(const
return vp.getEditingPlacement();
}
inline void ViewProviderSketchCoinAttorney::updateGridExtent(ViewProviderSketch & vp, float minx, float maxx, float miny, float maxy)
{
vp.updateGridExtent(minx, maxx, miny, maxy);
}
inline bool ViewProviderSketchCoinAttorney::isShownVirtualSpace(const ViewProviderSketch & vp)
{
return vp.viewProviderParameters.isShownVirtualSpace;

View File

@@ -187,7 +187,8 @@ inline void SketcherAddWorkbenchSketchEditModeActions(Gui::ToolBarItem& sketch)
{
sketch << "Sketcher_LeaveSketch"
<< "Sketcher_ViewSketch"
<< "Sketcher_ViewSection";
<< "Sketcher_ViewSection"
<< "Sketcher_CompGrid";
}
template <typename T>