Sketcher: UI Improvement Smart button for constraints and geometry toogle/creation

==================================================================================

Geometry button:
- if no object selected, the legacy toggle icon has a new functionality, switch to/from creating in construction mode
- if object selected, it has the legacy functionality
- the button can be clicked during "continuos creation mode" to switch from creating to/from creating in construction mode

Constraint button:
- The button is not selectable if nothing is selected (it would be impossible to determine the effect)
- When constraints are selected, the button toggles the constraints to/from Driving.
- When geometry is selected, the button switches from/to reference mode, the change is apparent from the color of the constraint icons.

Continuous creation mode:
- Default changed so that it is active unless you change it in settings

Updated terminology
This commit is contained in:
Abdullah Tahiri 2015-05-26 16:47:33 +02:00 committed by wmayer
parent a1c3b942aa
commit 0bd3801314
6 changed files with 344 additions and 364 deletions

View File

@ -60,6 +60,7 @@ SET(SketcherGui_SRCS
${SketcherGui_UIC_HDRS}
AppSketcherGui.cpp
AppSketcherGuiPy.cpp
GeometryCreationMode.h
Command.cpp
CommandCreateGeo.cpp
CommandConstraints.h

View File

@ -26,37 +26,41 @@
# include <QMessageBox>
#endif
#include <Gui/Action.h>
#include <Gui/Application.h>
#include <Gui/Document.h>
#include <Gui/Selection.h>
#include <Gui/Command.h>
#include <Gui/MainWindow.h>
#include <Gui/BitmapFactory.h>
#include <Gui/DlgEditFileIncludeProptertyExternal.h>
#include <Mod/Part/App/Geometry.h>
#include <Mod/Sketcher/App/SketchObject.h>
#include "ViewProviderSketch.h"
#include "GeometryCreationMode.h"
using namespace std;
using namespace SketcherGui;
using namespace Sketcher;
bool isAlterGeoActive(Gui::Document *doc)
{
if (doc) {
// checks if a Sketch Viewprovider is in Edit and is in no special mode
SketcherGui::ViewProviderSketch* edit = dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit());
if (edit && edit->getSketchMode() == ViewProviderSketch::STATUS_NONE) {
return Gui::Selection().isSelected(edit->getObject());
{
if (doc) {
// checks if a Sketch Viewprovider is in Edit
if (doc->getInEdit() && doc->getInEdit()->isDerivedFrom
(SketcherGui::ViewProviderSketch::getClassTypeId())) {
return true;
}
}
return false;
}
namespace SketcherGui {
extern GeometryCreationMode geometryCreationMode;
/* Constrain commands =======================================================*/
DEF_STD_CMD_A(CmdSketcherToggleConstruction);
@ -66,8 +70,8 @@ CmdSketcherToggleConstruction::CmdSketcherToggleConstruction()
{
sAppModule = "Sketcher";
sGroup = QT_TR_NOOP("Sketcher");
sMenuText = QT_TR_NOOP("Toggle construction line");
sToolTipText = QT_TR_NOOP("Toggles the currently selected lines to/from construction mode");
sMenuText = QT_TR_NOOP("Toggle construction geometry");
sToolTipText = QT_TR_NOOP("Toggles the toolbar or selected geometry to/from construction mode");
sWhatsThis = "Sketcher_ToggleConstruction";
sStatusTip = sToolTipText;
sPixmap = "Sketcher_AlterConstruction";
@ -77,47 +81,175 @@ CmdSketcherToggleConstruction::CmdSketcherToggleConstruction()
void CmdSketcherToggleConstruction::activated(int iMsg)
{
// get the selection
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
// Option A: nothing is selected change creation mode from/to construction
if(Gui::Selection().countObjectsOfType(Sketcher::SketchObject::getClassTypeId()) == 0){
// only one sketch with its subelements are allowed to be selected
if (selection.size() != 1) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select edge(s) from the sketch."));
return;
}
// get the needed lists and objects
const std::vector<std::string> &SubNames = selection[0].getSubNames();
if (SubNames.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select edge(s) from the sketch."));
return;
}
// make sure the selected object is the sketch in edit mode
const App::DocumentObject* obj = selection[0].getObject();
ViewProviderSketch* sketchView = static_cast<ViewProviderSketch*>
(Gui::Application::Instance->getViewProvider(obj));
// undo command open
openCommand("Toggle draft from/to draft");
// go through the selected subelements
for (std::vector<std::string>::const_iterator it=SubNames.begin();it!=SubNames.end();++it){
// only handle edges
if (it->size() > 4 && it->substr(0,4) == "Edge") {
int GeoId = std::atoi(it->substr(4,4000).c_str()) - 1;
// issue the actual commands to toggle
doCommand(Doc,"App.ActiveDocument.%s.toggleConstruction(%d) ",selection[0].getFeatName(),GeoId);
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
if(geometryCreationMode==Construction) {
geometryCreationMode=Normal;
rcCmdMgr.getCommandByName("Sketcher_CreateLine")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreateLine"));
rcCmdMgr.getCommandByName("Sketcher_CreateRectangle")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreateRectangle"));
rcCmdMgr.getCommandByName("Sketcher_CreatePolyline")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreatePolyline"));
rcCmdMgr.getCommandByName("Sketcher_CreateSlot")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreateSlot"));
// Comp commands require a distinctive treatment
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateArc")->getAction());
QList<QAction*> a = pcAction->actions();
int index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateArc"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Create3PointArc"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateArc")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateArc"):
Gui::BitmapFactory().pixmap("Sketcher_Create3PointArc"));
// Conics
pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateConic")->getAction());
a = pcAction->actions();
index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_3points"));
a[2]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Elliptical_Arc"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateConic")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse"):
index==1?Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_3points"):
Gui::BitmapFactory().pixmap("Sketcher_Elliptical_Arc"));
// Circle
pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateCircle")->getAction());
a = pcAction->actions();
index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateCircle"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Create3PointCircle"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateCircle")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateCircle"):
Gui::BitmapFactory().pixmap("Sketcher_Create3PointCircle"));
// Polygon
pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateRegularPolygon")->getAction());
a = pcAction->actions();
index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateTriangle"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateSquare"));
a[2]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreatePentagon"));
a[3]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateHexagon"));
a[4]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateHeptagon"));
a[5]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateOctagon"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateRegularPolygon")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateTriangle"):
index==1?Gui::BitmapFactory().pixmap("Sketcher_CreateSquare"):
index==2?Gui::BitmapFactory().pixmap("Sketcher_CreatePentagon"):
index==3?Gui::BitmapFactory().pixmap("Sketcher_CreateHexagon"):
index==4?Gui::BitmapFactory().pixmap("Sketcher_CreateHeptagon"):
Gui::BitmapFactory().pixmap("Sketcher_CreateOctagon"));
}
else {
geometryCreationMode=Construction;
rcCmdMgr.getCommandByName("Sketcher_CreateLine")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreateLine_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CreateRectangle")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreateRectangle_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CreatePolyline")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreatePolyline_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CreateSlot")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreateSlot_Constr"));
// Comp commands require a distinctive treatment
// Arc
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateArc")->getAction());
QList<QAction*> a = pcAction->actions();
int index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateArc_Constr"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Create3PointArc_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateArc")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateArc_Constr"):
Gui::BitmapFactory().pixmap("Sketcher_Create3PointArc_Constr"));
// Conics
pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateConic")->getAction());
a = pcAction->actions();
index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_Constr"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_3points_Constr"));
a[2]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Elliptical_Arc_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateConic")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_Constr"):
index==1?Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_3points_Constr"):
Gui::BitmapFactory().pixmap("Sketcher_Elliptical_Arc_Constr"));
// Circle
pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateCircle")->getAction());
a = pcAction->actions();
index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateCircle_Constr"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Create3PointCircle_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateCircle")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateCircle_Constr"):
Gui::BitmapFactory().pixmap("Sketcher_Create3PointCircle_Constr"));
// Polygon
pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateRegularPolygon")->getAction());
a = pcAction->actions();
index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateTriangle_Constr"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateSquare_Constr"));
a[2]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreatePentagon_Constr"));
a[3]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateHexagon_Constr"));
a[4]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateHeptagon_Constr"));
a[5]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateOctagon_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateRegularPolygon")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateTriangle_Constr"):
index==1?Gui::BitmapFactory().pixmap("Sketcher_CreateSquare_Constr"):
index==2?Gui::BitmapFactory().pixmap("Sketcher_CreatePentagon_Constr"):
index==3?Gui::BitmapFactory().pixmap("Sketcher_CreateHexagon_Constr"):
index==4?Gui::BitmapFactory().pixmap("Sketcher_CreateHeptagon_Constr"):
Gui::BitmapFactory().pixmap("Sketcher_CreateOctagon_Constr"));
}
}
// finish the transaction and update
commitCommand();
updateActive();
else // there was a selection, so operate in toggle mode.
{
// get the selection
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
// clear the selection (convenience)
getSelection().clearSelection();
// only one sketch with its subelements are allowed to be selected
if (selection.size() != 1) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select edge(s) from the sketch."));
return;
}
// get the needed lists and objects
const std::vector<std::string> &SubNames = selection[0].getSubNames();
if (SubNames.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select edge(s) from the sketch."));
return;
}
// make sure the selected object is the sketch in edit mode
const App::DocumentObject* obj = selection[0].getObject();
ViewProviderSketch* sketchView = static_cast<ViewProviderSketch*>
(Gui::Application::Instance->getViewProvider(obj));
// undo command open
openCommand("Toggle draft from/to draft");
// go through the selected subelements
for (std::vector<std::string>::const_iterator it=SubNames.begin();it!=SubNames.end();++it){
// only handle edges
if (it->size() > 4 && it->substr(0,4) == "Edge") {
int GeoId = std::atoi(it->substr(4,4000).c_str()) - 1;
// issue the actual commands to toggle
doCommand(Doc,"App.ActiveDocument.%s.toggleConstruction(%d) ",selection[0].getFeatName(),GeoId);
}
}
// finish the transaction and update
commitCommand();
updateActive();
// clear the selection (convenience)
getSelection().clearSelection();
}
}
bool CmdSketcherToggleConstruction::isActive(void)
@ -125,11 +257,8 @@ bool CmdSketcherToggleConstruction::isActive(void)
return isAlterGeoActive( getActiveGuiDocument() );
}
}
void CreateSketcherCommandsAlterGeo(void)
{
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
@ -137,3 +266,4 @@ void CreateSketcherCommandsAlterGeo(void)
rcCmdMgr.addCommand(new CmdSketcherToggleConstruction());
}

View File

@ -3355,87 +3355,7 @@ bool CmdSketcherConstrainInternalAlignment::isActive(void)
return isCreateConstraintActive( getActiveGuiDocument() );
}
/*** Creation Mode ***/
DEF_STD_CMD_A(CmdSketcherConstraintCreationMode);
CmdSketcherConstraintCreationMode::CmdSketcherConstraintCreationMode()
: Command("Sketcher_ConstraintCreationMode")
{
sAppModule = "Sketcher";
sGroup = QT_TR_NOOP("Sketcher");
sMenuText = QT_TR_NOOP("Toggle driving/reference constraint mode");
sToolTipText = QT_TR_NOOP("Toggle between inserting driving or reference constraints");
sWhatsThis = "Sketcher_ConstraintCreationMode";
sStatusTip = sToolTipText;
sPixmap = "Sketcher_Toggle_Constraint_Driving";
sAccel = "";
eType = ForEdit;
}
void CmdSketcherConstraintCreationMode::activated(int iMsg)
{
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
if(constraintCreationMode==Driving) {
constraintCreationMode=Reference;
rcCmdMgr.getCommandByName("Sketcher_ConstraintCreationMode")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_Toggle_Constraint_Driven"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainLock")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_ConstrainLock_Driven"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainDistance")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_Length_Driven"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainDistanceX")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_HorizontalDistance_Driven"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainDistanceY")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_VerticalDistance_Driven"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainRadius")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_Radius_Driven"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainAngle")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_InternalAngle_Driven"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainSnellsLaw")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_SnellsLaw_Driven"));
}
else {
constraintCreationMode=Driving;
rcCmdMgr.getCommandByName("Sketcher_ConstraintCreationMode")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_Toggle_Constraint_Driving"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainLock")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_ConstrainLock"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainDistance")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_Length"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainDistanceX")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_HorizontalDistance"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainDistanceY")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_VerticalDistance"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainRadius")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_Radius"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainAngle")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_InternalAngle"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainSnellsLaw")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_SnellsLaw"));
}
}
bool CmdSketcherConstraintCreationMode::isActive(void)
{
Gui::Document * doc=getActiveGuiDocument();
if (doc) {
// checks if a Sketch Viewprovider is in Edit and is in no special mode
if (doc->getInEdit() && doc->getInEdit()->isDerivedFrom
(SketcherGui::ViewProviderSketch::getClassTypeId())) {
if (dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit())->
getSketchMode() == ViewProviderSketch::STATUS_NONE)
return true;
}
}
return false;
}
/* Constrain commands =======================================================*/
/*** Creation Mode / Toggle to or from Reference ***/
DEF_STD_CMD_A(CmdSketcherToggleDrivingConstraint);
CmdSketcherToggleDrivingConstraint::CmdSketcherToggleDrivingConstraint()
@ -3444,67 +3364,134 @@ CmdSketcherToggleDrivingConstraint::CmdSketcherToggleDrivingConstraint()
sAppModule = "Sketcher";
sGroup = QT_TR_NOOP("Sketcher");
sMenuText = QT_TR_NOOP("Toggle reference/driving constraint");
sToolTipText = QT_TR_NOOP("Toggles the currently selected constraint to/from reference mode");
sToolTipText = QT_TR_NOOP("Toggles the toolbar or selected constraints to/from reference mode");
sWhatsThis = "Sketcher_ToggleDrivingConstraint";
sStatusTip = sToolTipText;
sPixmap = "Sketcher_ToggleDrivingConstraint";
sPixmap = "Sketcher_ToggleConstraint";
sAccel = "";
eType = ForEdit;
}
void CmdSketcherToggleDrivingConstraint::activated(int iMsg)
{
// get the selection
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
bool modeChange=true;
std::vector<Gui::SelectionObject> selection;
if (Gui::Selection().countObjectsOfType(Sketcher::SketchObject::getClassTypeId()) > 0){
// Now we check whether we have a constraint selected or not.
// get the selection
selection = getSelection().getSelectionEx();
// only one sketch with its subelements are allowed to be selected
if (selection.size() != 1) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select constraint(s) from the sketch."));
return;
// only one sketch with its subelements are allowed to be selected
if (selection.size() != 1) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select constraint(s) from the sketch."));
return;
}
// get the needed lists and objects
const std::vector<std::string> &SubNames = selection[0].getSubNames();
if (SubNames.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select constraint(s) from the sketch."));
return;
}
for (std::vector<std::string>::const_iterator it=SubNames.begin();it!=SubNames.end();++it){
// see if we have constraints, if we do it is not a mode change, but a toggle.
if (it->size() > 10 && it->substr(0,10) == "Constraint")
modeChange=false;
}
}
if (modeChange){
// Here starts the code for mode change
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
if(constraintCreationMode==Driving) {
constraintCreationMode=Reference;
rcCmdMgr.getCommandByName("Sketcher_ConstrainLock")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_ConstrainLock_Driven"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainDistance")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_Length_Driven"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainDistanceX")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_HorizontalDistance_Driven"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainDistanceY")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_VerticalDistance_Driven"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainRadius")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_Radius_Driven"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainAngle")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_InternalAngle_Driven"));
/*rcCmdMgr.getCommandByName("Sketcher_ConstrainSnellsLaw")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_SnellsLaw_Driven"));*/
}
else {
constraintCreationMode=Driving;
rcCmdMgr.getCommandByName("Sketcher_ConstrainLock")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_ConstrainLock"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainDistance")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_Length"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainDistanceX")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_HorizontalDistance"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainDistanceY")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_VerticalDistance"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainRadius")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_Radius"));
rcCmdMgr.getCommandByName("Sketcher_ConstrainAngle")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_InternalAngle"));
/*rcCmdMgr.getCommandByName("Sketcher_ConstrainSnellsLaw")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Constraint_SnellsLaw"));*/
}
}
else // toggle the selected constraint(s)
{
// get the needed lists and objects
const std::vector<std::string> &SubNames = selection[0].getSubNames();
if (SubNames.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select constraint(s) from the sketch."));
return;
}
// get the needed lists and objects
const std::vector<std::string> &SubNames = selection[0].getSubNames();
if (SubNames.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select constraint(s) from the sketch."));
return;
}
// make sure the selected object is the sketch in edit mode
const App::DocumentObject* obj = selection[0].getObject();
ViewProviderSketch* sketchView = static_cast<ViewProviderSketch*>
(Gui::Application::Instance->getViewProvider(obj));
// make sure the selected object is the sketch in edit mode
const App::DocumentObject* obj = selection[0].getObject();
ViewProviderSketch* sketchView = static_cast<ViewProviderSketch*>
(Gui::Application::Instance->getViewProvider(obj));
// undo command open
openCommand("Toggle driving from/to non-driving");
// undo command open
openCommand("Toggle driving from/to non-driving");
int succesful=SubNames.size();
// go through the selected subelements
for (std::vector<std::string>::const_iterator it=SubNames.begin();it!=SubNames.end();++it){
// only handle constraints
if (it->size() > 10 && it->substr(0,10) == "Constraint") {
int ConstrId = std::atoi(it->substr(10,4000).c_str()) - 1;
try {
// issue the actual commands to toggle
doCommand(Doc,"App.ActiveDocument.%s.toggleDriving(%d) ",selection[0].getFeatName(),ConstrId);
}
catch(const Base::Exception& e) {
succesful--;
int succesful=SubNames.size();
// go through the selected subelements
for (std::vector<std::string>::const_iterator it=SubNames.begin();it!=SubNames.end();++it){
// only handle constraints
if (it->size() > 10 && it->substr(0,10) == "Constraint") {
int ConstrId = std::atoi(it->substr(10,4000).c_str()) - 1;
try {
// issue the actual commands to toggle
doCommand(Doc,"App.ActiveDocument.%s.toggleDriving(%d) ",selection[0].getFeatName(),ConstrId);
}
catch(const Base::Exception& e) {
succesful--;
}
}
}
if(succesful>0)
commitCommand();
else
abortCommand();
updateActive();
// clear the selection (convenience)
getSelection().clearSelection();
}
if(succesful>0)
commitCommand();
else
abortCommand();
updateActive();
// clear the selection (convenience)
getSelection().clearSelection();
}
bool CmdSketcherToggleDrivingConstraint::isActive(void)
@ -3533,6 +3520,5 @@ void CreateSketcherCommandsConstraints(void)
rcCmdMgr.addCommand(new CmdSketcherConstrainSymmetric());
rcCmdMgr.addCommand(new CmdSketcherConstrainSnellsLaw());
rcCmdMgr.addCommand(new CmdSketcherConstrainInternalAlignment());
rcCmdMgr.addCommand(new CmdSketcherConstraintCreationMode());
rcCmdMgr.addCommand(new CmdSketcherToggleDrivingConstraint());
}

View File

@ -55,19 +55,14 @@
#include <Gui/ToolBarManager.h>
#include "GeometryCreationMode.h"
using namespace std;
using namespace SketcherGui;
/***** Creation Mode ************/
namespace SketcherGui
{
enum GeometryCreationMode {
Normal,
Construction
};
}
namespace SketcherGui {
GeometryCreationMode geometryCreationMode=Normal;
}
/* helper functions ======================================================*/
@ -276,7 +271,7 @@ public:
sketchgui->drawEdit(EditCurve);
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
// This code enables the continuous creation mode.
@ -515,7 +510,7 @@ public:
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
// This code enables the continuous creation mode.
@ -883,7 +878,7 @@ public:
sketchgui->drawEdit(EditCurve);
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
// This code enables the continuous creation mode.
@ -1024,7 +1019,7 @@ public:
sketchgui->drawEdit(EditCurve);
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
// This code enables the continuous creation mode.
@ -1371,7 +1366,7 @@ public:
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
// This code enables the continuous creation mode.
@ -1668,7 +1663,7 @@ public:
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
// This code enables the continuous creation mode.
@ -1949,7 +1944,7 @@ public:
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
// This code enables the continuous creation mode.
@ -2258,7 +2253,7 @@ public:
if (mode == STATUS_Close) {
saveEllipse();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
if (constrMethod == 0) {
@ -2790,7 +2785,7 @@ private:
sketchgui->drawEdit(editCurve);
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
@ -3184,7 +3179,7 @@ public:
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
// This code enables the continuous creation mode.
@ -3525,7 +3520,7 @@ public:
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
// This code enables the continuous creation mode.
@ -3749,7 +3744,7 @@ public:
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
// This code enables the continuous creation mode.
@ -4686,7 +4681,7 @@ public:
Gui::Command::updateActive();
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
// This code enables the continuous creation mode.
@ -4909,7 +4904,7 @@ public:
Gui::Command::updateActive();
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", false);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode",true);
if(continuousMode){
// This code enables the continuous creation mode.
@ -5203,165 +5198,6 @@ bool CmdSketcherCompCreateRegularPolygon::isActive(void)
return isCreateGeoActive(getActiveGuiDocument());
}
/*** Creation Mode ***/
DEF_STD_CMD_A(CmdSketcherGeometryCreationMode);
CmdSketcherGeometryCreationMode::CmdSketcherGeometryCreationMode()
: Command("Sketcher_GeometryCreationMode")
{
sAppModule = "Sketcher";
sGroup = QT_TR_NOOP("Sketcher");
sMenuText = QT_TR_NOOP("Toogle construction/normal creation mode");
sToolTipText = QT_TR_NOOP("Toogle between creating construction or normal geometry");
sWhatsThis = "Sketcher_GeometryCreationMode";
sStatusTip = sToolTipText;
sPixmap = "Sketcher_ToggleNormal";
sAccel = "";
eType = ForEdit;
}
void CmdSketcherGeometryCreationMode::activated(int iMsg)
{
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
if(geometryCreationMode==Construction) {
geometryCreationMode=Normal;
rcCmdMgr.getCommandByName("Sketcher_GeometryCreationMode")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_ToggleNormal"));
rcCmdMgr.getCommandByName("Sketcher_CreateLine")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreateLine"));
rcCmdMgr.getCommandByName("Sketcher_CreateRectangle")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreateRectangle"));
rcCmdMgr.getCommandByName("Sketcher_CreatePolyline")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreatePolyline"));
rcCmdMgr.getCommandByName("Sketcher_CreateSlot")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreateSlot"));
// Comp commands require a distinctive treatment
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateArc")->getAction());
QList<QAction*> a = pcAction->actions();
int index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateArc"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Create3PointArc"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateArc")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateArc"):
Gui::BitmapFactory().pixmap("Sketcher_Create3PointArc"));
// Conics
pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateConic")->getAction());
a = pcAction->actions();
index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_3points"));
a[2]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Elliptical_Arc"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateConic")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse"):
index==1?Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_3points"):
Gui::BitmapFactory().pixmap("Sketcher_Elliptical_Arc"));
// Circle
pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateCircle")->getAction());
a = pcAction->actions();
index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateCircle"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Create3PointCircle"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateCircle")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateCircle"):
Gui::BitmapFactory().pixmap("Sketcher_Create3PointCircle"));
// Polygon
pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateRegularPolygon")->getAction());
a = pcAction->actions();
index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateTriangle"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateSquare"));
a[2]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreatePentagon"));
a[3]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateHexagon"));
a[4]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateHeptagon"));
a[5]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateOctagon"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateRegularPolygon")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateTriangle"):
index==1?Gui::BitmapFactory().pixmap("Sketcher_CreateSquare"):
index==2?Gui::BitmapFactory().pixmap("Sketcher_CreatePentagon"):
index==3?Gui::BitmapFactory().pixmap("Sketcher_CreateHexagon"):
index==4?Gui::BitmapFactory().pixmap("Sketcher_CreateHeptagon"):
Gui::BitmapFactory().pixmap("Sketcher_CreateOctagon"));
}
else {
geometryCreationMode=Construction;
rcCmdMgr.getCommandByName("Sketcher_GeometryCreationMode")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_ToggleConstruction"));
rcCmdMgr.getCommandByName("Sketcher_CreateLine")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreateLine_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CreateRectangle")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreateRectangle_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CreatePolyline")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreatePolyline_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CreateSlot")->getAction()->setIcon(
Gui::BitmapFactory().pixmap("Sketcher_CreateSlot_Constr"));
// Comp commands require a distinctive treatment
// Arc
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateArc")->getAction());
QList<QAction*> a = pcAction->actions();
int index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateArc_Constr"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Create3PointArc_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateArc")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateArc_Constr"):
Gui::BitmapFactory().pixmap("Sketcher_Create3PointArc_Constr"));
// Conics
pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateConic")->getAction());
a = pcAction->actions();
index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_Constr"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_3points_Constr"));
a[2]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Elliptical_Arc_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateConic")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_Constr"):
index==1?Gui::BitmapFactory().pixmap("Sketcher_CreateEllipse_3points_Constr"):
Gui::BitmapFactory().pixmap("Sketcher_Elliptical_Arc_Constr"));
// Circle
pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateCircle")->getAction());
a = pcAction->actions();
index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateCircle_Constr"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_Create3PointCircle_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateCircle")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateCircle_Constr"):
Gui::BitmapFactory().pixmap("Sketcher_Create3PointCircle_Constr"));
// Polygon
pcAction = qobject_cast<Gui::ActionGroup*>(rcCmdMgr.getCommandByName("Sketcher_CompCreateRegularPolygon")->getAction());
a = pcAction->actions();
index = pcAction->property("defaultAction").toInt();
a[0]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateTriangle_Constr"));
a[1]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateSquare_Constr"));
a[2]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreatePentagon_Constr"));
a[3]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateHexagon_Constr"));
a[4]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateHeptagon_Constr"));
a[5]->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateOctagon_Constr"));
rcCmdMgr.getCommandByName("Sketcher_CompCreateRegularPolygon")->getAction()->setIcon(
index==0?Gui::BitmapFactory().pixmap("Sketcher_CreateTriangle_Constr"):
index==1?Gui::BitmapFactory().pixmap("Sketcher_CreateSquare_Constr"):
index==2?Gui::BitmapFactory().pixmap("Sketcher_CreatePentagon_Constr"):
index==3?Gui::BitmapFactory().pixmap("Sketcher_CreateHexagon_Constr"):
index==4?Gui::BitmapFactory().pixmap("Sketcher_CreateHeptagon_Constr"):
Gui::BitmapFactory().pixmap("Sketcher_CreateOctagon_Constr"));
}
}
bool CmdSketcherGeometryCreationMode::isActive(void)
{
Gui::Document * doc=getActiveGuiDocument();
if (doc) {
// checks if a Sketch Viewprovider is in Edit and is in no special mode
if (doc->getInEdit() && doc->getInEdit()->isDerivedFrom
(SketcherGui::ViewProviderSketch::getClassTypeId())) {
return true;
}
}
return false;
}
void CreateSketcherCommandsCreateGeo(void)
{
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
@ -5393,5 +5229,4 @@ void CreateSketcherCommandsCreateGeo(void)
//rcCmdMgr.addCommand(new CmdSketcherCreateDraftLine());
rcCmdMgr.addCommand(new CmdSketcherTrimming());
rcCmdMgr.addCommand(new CmdSketcherExternal());
rcCmdMgr.addCommand(new CmdSketcherGeometryCreationMode());
}

View File

@ -0,0 +1,31 @@
/***************************************************************************
* Copyright (c) 2015 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 *
* *
***************************************************************************/
/***** Creation Mode ************/
namespace SketcherGui
{
enum GeometryCreationMode {
Normal,
Construction
};
}

View File

@ -177,7 +177,6 @@ inline void SketcherAddWorkbenchGeometries(T& geom){
<< "Sketcher_Trimming"
<< "Sketcher_External"
<< "Sketcher_ToggleConstruction"
<< "Sketcher_GeometryCreationMode"
/*<< "Sketcher_CreateText"*/
/*<< "Sketcher_CreateDraftLine"*/;
}
@ -206,8 +205,7 @@ inline void SketcherAddWorkbenchConstraints<Gui::MenuItem>(Gui::MenuItem& cons){
<< "Sketcher_ConstrainSnellsLaw"
<< "Sketcher_ConstrainInternalAlignment"
<< "Separator"
<< "Sketcher_ToggleDrivingConstraint"
<< "Sketcher_ConstraintCreationMode";
<< "Sketcher_ToggleDrivingConstraint";
}
template <>
@ -230,8 +228,7 @@ inline void SketcherAddWorkbenchConstraints<Gui::ToolBarItem>(Gui::ToolBarItem&
<< "Sketcher_ConstrainAngle"
<< "Sketcher_ConstrainSnellsLaw"
<< "Separator"
<< "Sketcher_ToggleDrivingConstraint"
<< "Sketcher_ConstraintCreationMode";
<< "Sketcher_ToggleDrivingConstraint";
}
template <typename T>