Skip to content

Commit

Permalink
Sketcher: fix typos in Constraint Widget
Browse files Browse the repository at this point in the history
- Follow-up to 2f789e6

- Sketcher: fix relevant typos

- Re-Add mistakenly deleted files

- fix build
  • Loading branch information
luzpaz authored and abdullahtahiriyo committed Oct 23, 2021
1 parent 398381c commit 0449293
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion src/Mod/Sketcher/App/SketchObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ int SketchObject::solve(bool updateGeoAfterSolving/*=true*/)
// Some examples:
// Redundant: a vertical line, a horizontal line and an angle constraint of 90 degrees between the two lines
// Conflicting: a 80 degrees angle between a vertical line and another line, then adding a horizontal constraint to that other line
// OverConstrained: a conflicting constraint when all other DoF are already constraint (it has more constrains than parameters and the extra constraints are not redundant)
// OverConstrained: a conflicting constraint when all other DoF are already constrained (it has more constraints than parameters and the extra constraints are not redundant)

solverNeedsUpdate=false;

Expand Down
8 changes: 4 additions & 4 deletions src/Mod/Sketcher/Gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ else()
endif()

set(SketcherGui_UIC_SRCS
TaskSketcherConstrains.ui
TaskSketcherConstraints.ui
TaskSketcherElements.ui
TaskSketcherGeneral.ui
TaskSketcherMessages.ui
Expand Down Expand Up @@ -78,10 +78,10 @@ SET(SketcherGui_SRCS
SoDatumLabel.h
PropertyConstraintListItem.h
PropertyConstraintListItem.cpp
TaskSketcherConstrains.ui
TaskSketcherConstrains.cpp
TaskSketcherConstraints.ui
TaskSketcherConstraints.cpp
ConstraintFilters.h
TaskSketcherConstrains.h
TaskSketcherConstraints.h
TaskSketcherElements.ui
TaskSketcherElements.cpp
TaskSketcherElements.h
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Sketcher/Gui/CommandCreateGeo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4812,7 +4812,7 @@ class DrawSketchHandlerBSpline: public DrawSketchHandler

// autoconstraints were added to the circles of the poles, which is ok because they must go to the
// right position, or the user will freak-out if they appear out of the autoconstrained position.
// However, autoconstrains on the first and last pole, in normal non-periodic b-splines (with appropriate endpoint knot multiplicity)
// However, autoconstraints on the first and last pole, in normal non-periodic b-splines (with appropriate endpoint knot multiplicity)
// as the ones created by this tool are intended for the b-spline endpoints, and not for the poles,
// so here we retrieve any autoconstraint on those poles' center and mangle it to the endpoint.
if (ConstrMethod == 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ TaskDlgEditSketch::TaskDlgEditSketch(ViewProviderSketch *sketchView)
: TaskDialog(),sketchView(sketchView)
{
assert(sketchView);
Constraints = new TaskSketcherConstrains(sketchView);
Constraints = new TaskSketcherConstraints(sketchView);
Elements = new TaskSketcherElements(sketchView);
General = new TaskSketcherGeneral(sketchView);
Messages = new TaskSketcherMessages(sketchView);
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Sketcher/Gui/TaskDlgEditSketch.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <Gui/TaskView/TaskDialog.h>

#include "ViewProviderSketch.h"
#include "TaskSketcherConstrains.h"
#include "TaskSketcherConstraints.h"
#include "TaskSketcherElements.h"
#include "TaskSketcherGeneral.h"
#include "TaskSketcherMessages.h"
Expand Down Expand Up @@ -72,7 +72,7 @@ class SketcherGuiExport TaskDlgEditSketch : public Gui::TaskView::TaskDialog

protected:
ViewProviderSketch *sketchView;
TaskSketcherConstrains *Constraints;
TaskSketcherConstraints *Constraints;
TaskSketcherElements *Elements;
TaskSketcherGeneral *General;
TaskSketcherMessages *Messages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
# include <boost_bind_bind.hpp>
#endif

#include "TaskSketcherConstrains.h"
#include "ui_TaskSketcherConstrains.h"
#include "TaskSketcherConstraints.h"
#include "ui_TaskSketcherConstraints.h"
#include "EditDatumDialog.h"
#include "ViewProviderSketch.h"

Expand Down Expand Up @@ -565,7 +565,7 @@ void ConstraintView::modifyCurrentItem()

void ConstraintView::renameCurrentItem()
{
// See also TaskSketcherConstrains::on_listWidgetConstraints_itemChanged
// See also TaskSketcherConstraints::on_listWidgetConstraints_itemChanged
QListWidgetItem* item = currentItem();
if (item)
editItem(item);
Expand Down Expand Up @@ -631,10 +631,10 @@ void ConstraintView::swapNamedOfSelectedItems()

// ----------------------------------------------------------------------------

TaskSketcherConstrains::TaskSketcherConstrains(ViewProviderSketch *sketchView) :
TaskSketcherConstraints::TaskSketcherConstraints(ViewProviderSketch *sketchView) :
TaskBox(Gui::BitmapFactory().pixmap("document-new"), tr("Constraints"), true, 0),
sketchView(sketchView), inEditMode(false),
ui(new Ui_TaskSketcherConstrains)
ui(new Ui_TaskSketcherConstraints)
{
// we need a separate container widget to add all controls to
proxy = new QWidget(this);
Expand Down Expand Up @@ -709,7 +709,7 @@ TaskSketcherConstrains::TaskSketcherConstrains(ViewProviderSketch *sketchView) :
);

connectionConstraintsChanged = sketchView->signalConstraintsChanged.connect(
boost::bind(&SketcherGui::TaskSketcherConstrains::slotConstraintsChanged, this));
boost::bind(&SketcherGui::TaskSketcherConstraints::slotConstraintsChanged, this));

this->groupLayout()->addWidget(proxy);

Expand All @@ -718,13 +718,13 @@ TaskSketcherConstrains::TaskSketcherConstrains(ViewProviderSketch *sketchView) :
slotConstraintsChanged();
}

TaskSketcherConstrains::~TaskSketcherConstrains()
TaskSketcherConstraints::~TaskSketcherConstraints()
{
connectionConstraintsChanged.disconnect();
}


void TaskSketcherConstrains::createVisibilityButtonActions()
void TaskSketcherConstraints::createVisibilityButtonActions()
{
QAction* action = new QAction(QString::fromLatin1("Show only filtered Constraints"),this);

Expand All @@ -741,7 +741,7 @@ void TaskSketcherConstrains::createVisibilityButtonActions()
ui->visibilityButton->addAction(action);
}

void TaskSketcherConstrains::updateSelectionFilter()
void TaskSketcherConstraints::updateSelectionFilter()
{
// Snapshot current selection
auto items = ui->listWidgetConstraints->selectedItems();
Expand All @@ -752,7 +752,7 @@ void TaskSketcherConstrains::updateSelectionFilter()
selectionFilter.push_back(static_cast<ConstraintItem*>(item)->ConstraintNbr);
}

void TaskSketcherConstrains::updateAssociatedConstraintsFilter()
void TaskSketcherConstraints::updateAssociatedConstraintsFilter()
{
associatedConstraintsFilter.clear();

Expand Down Expand Up @@ -793,7 +793,7 @@ void TaskSketcherConstrains::updateAssociatedConstraintsFilter()
updateList();
}

void TaskSketcherConstrains::updateList()
void TaskSketcherConstraints::updateList()
{
// enforce constraint visibility
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
Expand All @@ -805,7 +805,7 @@ void TaskSketcherConstrains::updateList()
slotConstraintsChanged();
}

void TaskSketcherConstrains::on_multipleFilterButton_clicked(bool)
void TaskSketcherConstraints::on_multipleFilterButton_clicked(bool)
{
ConstraintMultiFilterDialog mf;

Expand All @@ -825,7 +825,7 @@ void TaskSketcherConstrains::on_multipleFilterButton_clicked(bool)
}
}

void TaskSketcherConstrains::on_settingsDialogButton_clicked(bool)
void TaskSketcherConstraints::on_settingsDialogButton_clicked(bool)
{
ConstraintSettingsDialog cs;

Expand All @@ -845,7 +845,7 @@ void TaskSketcherConstrains::on_settingsDialogButton_clicked(bool)
cs.exec(); // The dialog reacted on any change, so the result of running the dialog is already reflected on return.
}

void TaskSketcherConstrains::changeFilteredVisibility(bool show, ActionTarget target)
void TaskSketcherConstraints::changeFilteredVisibility(bool show, ActionTarget target)
{
assert(sketchView);
const Sketcher::SketchObject * sketch = sketchView->getSketchObject();
Expand Down Expand Up @@ -918,27 +918,27 @@ void TaskSketcherConstrains::changeFilteredVisibility(bool show, ActionTarget ta

}

void TaskSketcherConstrains::on_showAllButton_clicked(bool)
void TaskSketcherConstraints::on_showAllButton_clicked(bool)
{
changeFilteredVisibility(true);
}

void TaskSketcherConstrains::on_hideAllButton_clicked(bool)
void TaskSketcherConstraints::on_hideAllButton_clicked(bool)
{
changeFilteredVisibility(false);
}

void TaskSketcherConstrains::on_listWidgetConstraints_emitHideSelection3DVisibility()
void TaskSketcherConstraints::on_listWidgetConstraints_emitHideSelection3DVisibility()
{
changeFilteredVisibility(false, ActionTarget::Selected);
}

void TaskSketcherConstrains::on_listWidgetConstraints_emitShowSelection3DVisibility()
void TaskSketcherConstraints::on_listWidgetConstraints_emitShowSelection3DVisibility()
{
changeFilteredVisibility(true, ActionTarget::Selected);
}

void TaskSketcherConstrains::onSelectionChanged(const Gui::SelectionChanges& msg)
void TaskSketcherConstraints::onSelectionChanged(const Gui::SelectionChanges& msg)
{
assert(sketchView);

Expand Down Expand Up @@ -1014,7 +1014,7 @@ void TaskSketcherConstrains::onSelectionChanged(const Gui::SelectionChanges& msg
}
}

void TaskSketcherConstrains::getSelectionGeoId(QString expr, int & geoid, Sketcher::PointPos & pointpos)
void TaskSketcherConstraints::getSelectionGeoId(QString expr, int & geoid, Sketcher::PointPos & pointpos)
{
QRegExp rxEdge(QString::fromLatin1("^Edge(\\d+)$"));
int pos = expr.indexOf(rxEdge);
Expand Down Expand Up @@ -1043,7 +1043,7 @@ void TaskSketcherConstrains::getSelectionGeoId(QString expr, int & geoid, Sketch
}
}

void TaskSketcherConstrains::on_comboBoxFilter_currentIndexChanged(int filterindex)
void TaskSketcherConstraints::on_comboBoxFilter_currentIndexChanged(int filterindex)
{
selectionFilter.clear(); // reset the stored selection filter
associatedConstraintsFilter.clear();
Expand All @@ -1058,13 +1058,13 @@ void TaskSketcherConstrains::on_comboBoxFilter_currentIndexChanged(int filterind
updateList();
}

void TaskSketcherConstrains::on_filterInternalAlignment_stateChanged(int state)
void TaskSketcherConstraints::on_filterInternalAlignment_stateChanged(int state)
{
Q_UNUSED(state);
slotConstraintsChanged();
}

void TaskSketcherConstrains::on_visualisationTrackingFilter_stateChanged(int state)
void TaskSketcherConstraints::on_visualisationTrackingFilter_stateChanged(int state)
{
// Synchronise button drop state
{
Expand All @@ -1078,7 +1078,7 @@ void TaskSketcherConstrains::on_visualisationTrackingFilter_stateChanged(int sta
change3DViewVisibilityToTrackFilter();
}

void TaskSketcherConstrains::on_visibilityButton_trackingaction_changed()
void TaskSketcherConstraints::on_visibilityButton_trackingaction_changed()
{
// synchronise VisualisationTrackingFilter parameter
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
Expand All @@ -1095,23 +1095,23 @@ void TaskSketcherConstrains::on_visibilityButton_trackingaction_changed()
change3DViewVisibilityToTrackFilter();
}

void TaskSketcherConstrains::on_visibilityButton_clicked(bool)
void TaskSketcherConstraints::on_visibilityButton_clicked(bool)
{
change3DViewVisibilityToTrackFilter();
}

void TaskSketcherConstrains::on_extendedInformation_stateChanged(int state)
void TaskSketcherConstraints::on_extendedInformation_stateChanged(int state)
{
Q_UNUSED(state);
slotConstraintsChanged();
}

void TaskSketcherConstrains::on_listWidgetConstraints_emitCenterSelectedItems()
void TaskSketcherConstraints::on_listWidgetConstraints_emitCenterSelectedItems()
{
sketchView->centerSelection();
}

void TaskSketcherConstrains::on_listWidgetConstraints_itemSelectionChanged(void)
void TaskSketcherConstraints::on_listWidgetConstraints_itemSelectionChanged(void)
{
std::string doc_name = sketchView->getSketchObject()->getDocument()->getName();
std::string obj_name = sketchView->getSketchObject()->getNameInDocument();
Expand All @@ -1132,7 +1132,7 @@ void TaskSketcherConstrains::on_listWidgetConstraints_itemSelectionChanged(void)
this->blockConnection(block);
}

void TaskSketcherConstrains::on_listWidgetConstraints_itemActivated(QListWidgetItem *item)
void TaskSketcherConstraints::on_listWidgetConstraints_itemActivated(QListWidgetItem *item)
{
ConstraintItem *it = dynamic_cast<ConstraintItem*>(item);
if (!it) return;
Expand All @@ -1145,7 +1145,7 @@ void TaskSketcherConstrains::on_listWidgetConstraints_itemActivated(QListWidgetI
}
}

void TaskSketcherConstrains::on_listWidgetConstraints_updateDrivingStatus(QListWidgetItem *item, bool status)
void TaskSketcherConstraints::on_listWidgetConstraints_updateDrivingStatus(QListWidgetItem *item, bool status)
{
Q_UNUSED(status);
ConstraintItem *citem = dynamic_cast<ConstraintItem*>(item);
Expand All @@ -1155,7 +1155,7 @@ void TaskSketcherConstrains::on_listWidgetConstraints_updateDrivingStatus(QListW
slotConstraintsChanged();
}

void TaskSketcherConstrains::on_listWidgetConstraints_updateActiveStatus(QListWidgetItem *item, bool status)
void TaskSketcherConstraints::on_listWidgetConstraints_updateActiveStatus(QListWidgetItem *item, bool status)
{
Q_UNUSED(status);
ConstraintItem *citem = dynamic_cast<ConstraintItem*>(item);
Expand All @@ -1165,7 +1165,7 @@ void TaskSketcherConstrains::on_listWidgetConstraints_updateActiveStatus(QListWi
slotConstraintsChanged();
}

void TaskSketcherConstrains::on_listWidgetConstraints_itemChanged(QListWidgetItem *item)
void TaskSketcherConstraints::on_listWidgetConstraints_itemChanged(QListWidgetItem *item)
{
const ConstraintItem *it = dynamic_cast<const ConstraintItem*>(item);
if (!it || inEditMode)
Expand Down Expand Up @@ -1224,7 +1224,7 @@ void TaskSketcherConstrains::on_listWidgetConstraints_itemChanged(QListWidgetIte
inEditMode = false;
}

void TaskSketcherConstrains::change3DViewVisibilityToTrackFilter()
void TaskSketcherConstraints::change3DViewVisibilityToTrackFilter()
{
assert(sketchView);
// Build up ListView with the constraints
Expand Down Expand Up @@ -1302,7 +1302,7 @@ void TaskSketcherConstrains::change3DViewVisibilityToTrackFilter()

}

bool TaskSketcherConstrains::isConstraintFiltered(QListWidgetItem * item)
bool TaskSketcherConstraints::isConstraintFiltered(QListWidgetItem * item)
{
assert(sketchView);
const Sketcher::SketchObject * sketch = sketchView->getSketchObject();
Expand Down Expand Up @@ -1407,7 +1407,7 @@ bool TaskSketcherConstrains::isConstraintFiltered(QListWidgetItem * item)
return !visible;
}

void TaskSketcherConstrains::slotConstraintsChanged(void)
void TaskSketcherConstraints::slotConstraintsChanged(void)
{
assert(sketchView);
// Build up ListView with the constraints
Expand Down Expand Up @@ -1460,7 +1460,7 @@ void TaskSketcherConstrains::slotConstraintsChanged(void)
}
}

void TaskSketcherConstrains::changeEvent(QEvent *e)
void TaskSketcherConstraints::changeEvent(QEvent *e)
{
TaskBox::changeEvent(e);
if (e->type() == QEvent::LanguageChange) {
Expand All @@ -1469,10 +1469,10 @@ void TaskSketcherConstrains::changeEvent(QEvent *e)
}

template <class T>
bool TaskSketcherConstrains::isFilter(T filterValue) {
bool TaskSketcherConstraints::isFilter(T filterValue) {
return isFilterMatch(filterValue, ui->comboBoxFilter->currentIndex());
}



#include "moc_TaskSketcherConstrains.cpp"
#include "moc_TaskSketcherConstraints.cpp"

0 comments on commit 0449293

Please sign in to comment.