[Surface] Allow modal adding/removal of geometric entities
This commit is contained in:
@@ -265,6 +265,12 @@ FillingPanel::FillingPanel(ViewProviderFilling* vp, Surface::Filling* obj)
|
||||
checkCommand = true;
|
||||
setEditedObject(obj);
|
||||
|
||||
// Set up button group
|
||||
buttonGroup = new Gui::ButtonGroup(this);
|
||||
buttonGroup->setExclusive(true);
|
||||
buttonGroup->addButton(ui->buttonEdgeAdd, (int)SelectionMode::AppendEdge);
|
||||
buttonGroup->addButton(ui->buttonEdgeRemove, (int)SelectionMode::RemoveEdge);
|
||||
|
||||
// Create context menu
|
||||
QAction* action = new QAction(tr("Remove"), this);
|
||||
action->setShortcut(QString::fromLatin1("Del"));
|
||||
@@ -382,7 +388,7 @@ void FillingPanel::open()
|
||||
|
||||
// if the surface is not yet created then automatically start "AppendEdge" mode
|
||||
if (editedObject->Shape.getShape().isNull()) {
|
||||
on_buttonEdgeAdd_clicked();
|
||||
ui->buttonEdgeAdd->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -492,18 +498,28 @@ void FillingPanel::on_buttonInitFace_clicked()
|
||||
selectionMode = InitFace;
|
||||
}
|
||||
|
||||
void FillingPanel::on_buttonEdgeAdd_clicked()
|
||||
void FillingPanel::on_buttonEdgeAdd_toggled(bool checked)
|
||||
{
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new ShapeSelection(selectionMode, editedObject));
|
||||
selectionMode = AppendEdge;
|
||||
if (checked) {
|
||||
selectionMode = AppendEdge;
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new ShapeSelection(selectionMode, editedObject));
|
||||
}
|
||||
else if (selectionMode == AppendEdge) {
|
||||
exitSelectionMode();
|
||||
}
|
||||
}
|
||||
|
||||
void FillingPanel::on_buttonEdgeRemove_clicked()
|
||||
void FillingPanel::on_buttonEdgeRemove_toggled(bool checked)
|
||||
{
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new ShapeSelection(selectionMode, editedObject));
|
||||
selectionMode = RemoveEdge;
|
||||
if (checked) {
|
||||
selectionMode = RemoveEdge;
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new ShapeSelection(selectionMode, editedObject));
|
||||
}
|
||||
else if (selectionMode == RemoveEdge) {
|
||||
exitSelectionMode();
|
||||
}
|
||||
}
|
||||
|
||||
void FillingPanel::on_listBoundary_itemDoubleClicked(QListWidgetItem* item)
|
||||
@@ -852,6 +868,13 @@ void FillingPanel::modifyBoundary(bool on)
|
||||
ui->buttonIgnore->setEnabled(on);
|
||||
}
|
||||
|
||||
void FillingPanel::exitSelectionMode()
|
||||
{
|
||||
// 'selectionMode' is passed by reference to the filter and changed when the filter is deleted
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Selection().rmvSelectionGate();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
TaskFilling::TaskFilling(ViewProviderFilling* vp, Surface::Filling* obj)
|
||||
|
||||
@@ -24,8 +24,11 @@
|
||||
#define SURFACEGUI_TASKFILLING_H
|
||||
|
||||
#include <Gui/DocumentObserver.h>
|
||||
#include <Gui/SelectionFilter.h>
|
||||
#include <Gui/TaskView/TaskDialog.h>
|
||||
#include <Gui/TaskView/TaskView.h>
|
||||
#include <Gui/Widgets.h>
|
||||
#include <Base/BoundBox.h>
|
||||
#include <Mod/Part/Gui/ViewProviderSpline.h>
|
||||
#include <Mod/Surface/App/FeatureFilling.h>
|
||||
|
||||
@@ -69,6 +72,7 @@ protected:
|
||||
private:
|
||||
Ui_TaskFilling* ui;
|
||||
ViewProviderFilling* vp;
|
||||
Gui::ButtonGroup *buttonGroup;
|
||||
|
||||
public:
|
||||
FillingPanel(ViewProviderFilling* vp, Surface::Filling* obj);
|
||||
@@ -93,8 +97,8 @@ protected:
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_buttonInitFace_clicked();
|
||||
void on_buttonEdgeAdd_clicked();
|
||||
void on_buttonEdgeRemove_clicked();
|
||||
void on_buttonEdgeAdd_toggled(bool checked);
|
||||
void on_buttonEdgeRemove_toggled(bool checked);
|
||||
void on_lineInitFaceName_textChanged(const QString&);
|
||||
void on_listBoundary_itemDoubleClicked(QListWidgetItem*);
|
||||
void on_buttonAccept_clicked();
|
||||
@@ -102,6 +106,9 @@ private Q_SLOTS:
|
||||
void onDeleteEdge();
|
||||
void onIndexesMoved();
|
||||
void clearSelection();
|
||||
|
||||
private:
|
||||
void exitSelectionMode();
|
||||
};
|
||||
|
||||
class TaskFilling : public Gui::TaskView::TaskDialog
|
||||
|
||||
@@ -63,6 +63,9 @@
|
||||
<property name="text">
|
||||
<string>Add Edge</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@@ -79,6 +82,9 @@
|
||||
<property name="text">
|
||||
<string>Remove Edge</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -124,6 +124,12 @@ FillingEdgePanel::FillingEdgePanel(ViewProviderFilling* vp, Surface::Filling* ob
|
||||
checkCommand = true;
|
||||
setEditedObject(obj);
|
||||
|
||||
// Set up button group
|
||||
buttonGroup = new Gui::ButtonGroup(this);
|
||||
buttonGroup->setExclusive(true);
|
||||
buttonGroup->addButton(ui->buttonUnboundEdgeAdd, (int)SelectionMode::AppendEdge);
|
||||
buttonGroup->addButton(ui->buttonUnboundEdgeRemove, (int)SelectionMode::RemoveEdge);
|
||||
|
||||
// Create context menu
|
||||
QAction* action = new QAction(tr("Remove"), this);
|
||||
action->setShortcut(QString::fromLatin1("Del"));
|
||||
@@ -286,18 +292,28 @@ bool FillingEdgePanel::reject()
|
||||
return true;
|
||||
}
|
||||
|
||||
void FillingEdgePanel::on_buttonUnboundEdgeAdd_clicked()
|
||||
void FillingEdgePanel::on_buttonUnboundEdgeAdd_toggled(bool checked)
|
||||
{
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new ShapeSelection(selectionMode, editedObject));
|
||||
selectionMode = AppendEdge;
|
||||
if (checked) {
|
||||
selectionMode = AppendEdge;
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new ShapeSelection(selectionMode, editedObject));
|
||||
}
|
||||
else if (selectionMode == AppendEdge) {
|
||||
exitSelectionMode();
|
||||
}
|
||||
}
|
||||
|
||||
void FillingEdgePanel::on_buttonUnboundEdgeRemove_clicked()
|
||||
void FillingEdgePanel::on_buttonUnboundEdgeRemove_toggled(bool checked)
|
||||
{
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new ShapeSelection(selectionMode, editedObject));
|
||||
selectionMode = RemoveEdge;
|
||||
if (checked) {
|
||||
selectionMode = RemoveEdge;
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new ShapeSelection(selectionMode, editedObject));
|
||||
}
|
||||
else if (selectionMode == RemoveEdge) {
|
||||
exitSelectionMode();
|
||||
}
|
||||
}
|
||||
|
||||
void FillingEdgePanel::on_listUnbound_itemDoubleClicked(QListWidgetItem* item)
|
||||
@@ -590,4 +606,11 @@ void FillingEdgePanel::modifyBoundary(bool on)
|
||||
}
|
||||
}
|
||||
|
||||
void FillingEdgePanel::exitSelectionMode()
|
||||
{
|
||||
// 'selectionMode' is passed by reference to the filter and changed when the filter is deleted
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Selection().rmvSelectionGate();
|
||||
}
|
||||
|
||||
#include "moc_TaskFillingEdge.cpp"
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
|
||||
#include <Gui/DocumentObserver.h>
|
||||
#include <Gui/SelectionFilter.h>
|
||||
#include <Gui/Widgets.h>
|
||||
#include <Base/BoundBox.h>
|
||||
#include <Mod/Part/Gui/ViewProviderSpline.h>
|
||||
#include <Mod/Surface/App/FeatureFilling.h>
|
||||
|
||||
|
||||
@@ -53,6 +56,7 @@ protected:
|
||||
private:
|
||||
Ui_TaskFillingEdge* ui;
|
||||
ViewProviderFilling* vp;
|
||||
Gui::ButtonGroup *buttonGroup;
|
||||
|
||||
public:
|
||||
FillingEdgePanel(ViewProviderFilling* vp, Surface::Filling* obj);
|
||||
@@ -76,13 +80,16 @@ protected:
|
||||
void modifyBoundary(bool);
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_buttonUnboundEdgeAdd_clicked();
|
||||
void on_buttonUnboundEdgeRemove_clicked();
|
||||
void on_buttonUnboundEdgeAdd_toggled(bool checked);
|
||||
void on_buttonUnboundEdgeRemove_toggled(bool checked);
|
||||
void on_listUnbound_itemDoubleClicked(QListWidgetItem*);
|
||||
void on_buttonUnboundAccept_clicked();
|
||||
void on_buttonUnboundIgnore_clicked();
|
||||
void onDeleteUnboundEdge();
|
||||
void clearSelection();
|
||||
|
||||
private:
|
||||
void exitSelectionMode();
|
||||
};
|
||||
|
||||
} //namespace SurfaceGui
|
||||
|
||||
@@ -46,6 +46,9 @@ that is, the surface will be forced to pass through these edges.</string>
|
||||
<property name="text">
|
||||
<string>Add Edge</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@@ -62,6 +65,9 @@ that is, the surface will be forced to pass through these edges.</string>
|
||||
<property name="text">
|
||||
<string>Remove Edge</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -116,6 +116,12 @@ FillingVertexPanel::FillingVertexPanel(ViewProviderFilling* vp, Surface::Filling
|
||||
checkCommand = true;
|
||||
setEditedObject(obj);
|
||||
|
||||
// Set up button group
|
||||
buttonGroup = new Gui::ButtonGroup(this);
|
||||
buttonGroup->setExclusive(true);
|
||||
buttonGroup->addButton(ui->buttonVertexAdd, (int)SelectionMode::AppendVertex);
|
||||
buttonGroup->addButton(ui->buttonVertexRemove, (int)SelectionMode::RemoveVertex);
|
||||
|
||||
// Create context menu
|
||||
QAction* action = new QAction(tr("Remove"), this);
|
||||
action->setShortcut(QString::fromLatin1("Del"));
|
||||
@@ -223,18 +229,28 @@ void FillingVertexPanel::slotDeletedObject(const Gui::ViewProviderDocumentObject
|
||||
}
|
||||
}
|
||||
|
||||
void FillingVertexPanel::on_buttonVertexAdd_clicked()
|
||||
void FillingVertexPanel::on_buttonVertexAdd_toggled(bool checked)
|
||||
{
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new VertexSelection(selectionMode, editedObject));
|
||||
selectionMode = AppendVertex;
|
||||
if (checked) {
|
||||
selectionMode = AppendVertex;
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new VertexSelection(selectionMode, editedObject));
|
||||
}
|
||||
else if (selectionMode == AppendVertex) {
|
||||
exitSelectionMode();
|
||||
}
|
||||
}
|
||||
|
||||
void FillingVertexPanel::on_buttonVertexRemove_clicked()
|
||||
void FillingVertexPanel::on_buttonVertexRemove_toggled(bool checked)
|
||||
{
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new VertexSelection(selectionMode, editedObject));
|
||||
selectionMode = RemoveVertex;
|
||||
if (checked) {
|
||||
selectionMode = RemoveVertex;
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new VertexSelection(selectionMode, editedObject));
|
||||
}
|
||||
else if (selectionMode == RemoveVertex) {
|
||||
exitSelectionMode();
|
||||
}
|
||||
}
|
||||
|
||||
void FillingVertexPanel::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
@@ -343,6 +359,13 @@ void FillingVertexPanel::onDeleteVertex()
|
||||
}
|
||||
}
|
||||
|
||||
void FillingVertexPanel::exitSelectionMode()
|
||||
{
|
||||
// 'selectionMode' is passed by reference to the filter and changed when the filter is deleted
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Selection().rmvSelectionGate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_TaskFillingVertex.cpp"
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
|
||||
#include <Gui/DocumentObserver.h>
|
||||
#include <Gui/SelectionFilter.h>
|
||||
#include <Gui/Widgets.h>
|
||||
#include <Base/BoundBox.h>
|
||||
#include <Mod/Part/Gui/ViewProviderSpline.h>
|
||||
#include <Mod/Surface/App/FeatureFilling.h>
|
||||
|
||||
|
||||
@@ -52,6 +55,7 @@ protected:
|
||||
private:
|
||||
Ui_TaskFillingVertex* ui;
|
||||
ViewProviderFilling* vp;
|
||||
Gui::ButtonGroup *buttonGroup;
|
||||
|
||||
public:
|
||||
FillingVertexPanel(ViewProviderFilling* vp, Surface::Filling* obj);
|
||||
@@ -73,10 +77,13 @@ protected:
|
||||
void slotDeletedObject(const Gui::ViewProviderDocumentObject& Obj) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_buttonVertexAdd_clicked();
|
||||
void on_buttonVertexRemove_clicked();
|
||||
void onDeleteVertex();
|
||||
void on_buttonVertexAdd_toggled(bool checked);
|
||||
void on_buttonVertexRemove_toggled(bool checked);
|
||||
void onDeleteVertex(void);
|
||||
void clearSelection();
|
||||
|
||||
private:
|
||||
void exitSelectionMode();
|
||||
};
|
||||
|
||||
} //namespace SurfaceGui
|
||||
|
||||
@@ -40,6 +40,9 @@ that is, the surface will be forced to pass through these points.</string>
|
||||
<property name="text">
|
||||
<string>Add Vertex</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@@ -56,6 +59,9 @@ that is, the surface will be forced to pass through these points.</string>
|
||||
<property name="text">
|
||||
<string>Remove Vertex</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -196,6 +196,12 @@ GeomFillSurface::GeomFillSurface(ViewProviderGeomFillSurface* vp, Surface::GeomF
|
||||
checkCommand = true;
|
||||
setEditedObject(obj);
|
||||
|
||||
// Set up button group
|
||||
buttonGroup = new Gui::ButtonGroup(this);
|
||||
buttonGroup->setExclusive(true);
|
||||
buttonGroup->addButton(ui->buttonEdgeAdd, (int)SelectionMode::Append);
|
||||
buttonGroup->addButton(ui->buttonEdgeRemove, (int)SelectionMode::Remove);
|
||||
|
||||
// Create context menu
|
||||
QAction* remove = new QAction(tr("Remove"), this);
|
||||
remove->setShortcut(QString::fromLatin1("Del"));
|
||||
@@ -400,16 +406,26 @@ void GeomFillSurface::changeFillType(GeomFill_FillingStyle fillType)
|
||||
}
|
||||
}
|
||||
|
||||
void GeomFillSurface::on_buttonEdgeAdd_clicked()
|
||||
void GeomFillSurface::on_buttonEdgeAdd_toggled(bool checked)
|
||||
{
|
||||
selectionMode = Append;
|
||||
Gui::Selection().addSelectionGate(new EdgeSelection(true, editedObject));
|
||||
if (checked) {
|
||||
selectionMode = Append;
|
||||
Gui::Selection().addSelectionGate(new EdgeSelection(true, editedObject));
|
||||
}
|
||||
else if (selectionMode == Append) {
|
||||
exitSelectionMode();
|
||||
}
|
||||
}
|
||||
|
||||
void GeomFillSurface::on_buttonEdgeRemove_clicked()
|
||||
void GeomFillSurface::on_buttonEdgeRemove_toggled(bool checked)
|
||||
{
|
||||
selectionMode = Remove;
|
||||
Gui::Selection().addSelectionGate(new EdgeSelection(false, editedObject));
|
||||
if (checked) {
|
||||
selectionMode = Remove;
|
||||
Gui::Selection().addSelectionGate(new EdgeSelection(false, editedObject));
|
||||
}
|
||||
else if (selectionMode == Remove) {
|
||||
exitSelectionMode();
|
||||
}
|
||||
}
|
||||
|
||||
void GeomFillSurface::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
@@ -581,6 +597,13 @@ void GeomFillSurface::onFlipOrientation()
|
||||
}
|
||||
}
|
||||
|
||||
void GeomFillSurface::exitSelectionMode()
|
||||
{
|
||||
selectionMode = None;
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Selection().rmvSelectionGate();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
TaskGeomFillSurface::TaskGeomFillSurface(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj)
|
||||
|
||||
@@ -26,8 +26,11 @@
|
||||
#include <GeomFill_FillingStyle.hxx>
|
||||
|
||||
#include <Gui/DocumentObserver.h>
|
||||
#include <Gui/SelectionFilter.h>
|
||||
#include <Gui/TaskView/TaskDialog.h>
|
||||
#include <Gui/TaskView/TaskView.h>
|
||||
#include <Gui/Widgets.h>
|
||||
#include <Base/BoundBox.h>
|
||||
#include <Mod/Part/Gui/ViewProviderSpline.h>
|
||||
#include <Mod/Surface/App/FeatureGeomFillSurface.h>
|
||||
|
||||
@@ -66,6 +69,7 @@ protected:
|
||||
private:
|
||||
Ui_GeomFillSurface* ui;
|
||||
ViewProviderGeomFillSurface* vp;
|
||||
Gui::ButtonGroup *buttonGroup;
|
||||
|
||||
public:
|
||||
GeomFillSurface(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj);
|
||||
@@ -93,12 +97,15 @@ private Q_SLOTS:
|
||||
void on_fillType_stretch_clicked();
|
||||
void on_fillType_coons_clicked();
|
||||
void on_fillType_curved_clicked();
|
||||
void on_buttonEdgeAdd_clicked();
|
||||
void on_buttonEdgeRemove_clicked();
|
||||
void on_buttonEdgeAdd_toggled(bool checked);
|
||||
void on_buttonEdgeRemove_toggled(bool checked);
|
||||
void on_listWidget_itemDoubleClicked(QListWidgetItem*);
|
||||
void onDeleteEdge();
|
||||
void onFlipOrientation();
|
||||
void clearSelection();
|
||||
|
||||
private:
|
||||
void exitSelectionMode();
|
||||
};
|
||||
|
||||
class TaskGeomFillSurface : public Gui::TaskView::TaskDialog
|
||||
|
||||
@@ -75,6 +75,9 @@
|
||||
<property name="text">
|
||||
<string>Add Edge</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@@ -91,6 +94,9 @@
|
||||
<property name="text">
|
||||
<string>Remove Edge</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -255,6 +255,12 @@ SectionsPanel::SectionsPanel(ViewProviderSections* vp, Surface::Sections* obj) :
|
||||
checkCommand = true;
|
||||
setEditedObject(obj);
|
||||
|
||||
// Set up button group
|
||||
buttonGroup = new Gui::ButtonGroup(this);
|
||||
buttonGroup->setExclusive(true);
|
||||
buttonGroup->addButton(ui->buttonEdgeAdd, (int)SelectionMode::AppendEdge);
|
||||
buttonGroup->addButton(ui->buttonEdgeRemove, (int)SelectionMode::RemoveEdge);
|
||||
|
||||
// Create context menu
|
||||
QAction* action = new QAction(tr("Remove"), this);
|
||||
action->setShortcut(QKeySequence::Delete);
|
||||
@@ -398,18 +404,28 @@ bool SectionsPanel::reject()
|
||||
return true;
|
||||
}
|
||||
|
||||
void SectionsPanel::on_buttonEdgeAdd_clicked()
|
||||
void SectionsPanel::on_buttonEdgeAdd_toggled(bool checked)
|
||||
{
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new ShapeSelection(selectionMode, editedObject));
|
||||
selectionMode = AppendEdge;
|
||||
if (checked) {
|
||||
selectionMode = AppendEdge;
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new ShapeSelection(selectionMode, editedObject));
|
||||
}
|
||||
else if (selectionMode == AppendEdge) {
|
||||
exitSelectionMode();
|
||||
}
|
||||
}
|
||||
|
||||
void SectionsPanel::on_buttonEdgeRemove_clicked()
|
||||
void SectionsPanel::on_buttonEdgeRemove_toggled(bool checked)
|
||||
{
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new ShapeSelection(selectionMode, editedObject));
|
||||
selectionMode = RemoveEdge;
|
||||
if (checked) {
|
||||
selectionMode = RemoveEdge;
|
||||
// 'selectionMode' is passed by reference and changed when the filter is deleted
|
||||
Gui::Selection().addSelectionGate(new ShapeSelection(selectionMode, editedObject));
|
||||
}
|
||||
else if (selectionMode == RemoveEdge) {
|
||||
exitSelectionMode();
|
||||
}
|
||||
}
|
||||
|
||||
void SectionsPanel::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
@@ -544,6 +560,13 @@ void SectionsPanel::removeCurve(App::DocumentObject* obj, const std::string& sub
|
||||
|
||||
}
|
||||
|
||||
void SectionsPanel::exitSelectionMode()
|
||||
{
|
||||
// 'selectionMode' is passed by reference to the filter and changed when the filter is deleted
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Selection().rmvSelectionGate();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
TaskSections::TaskSections(ViewProviderSections* vp, Surface::Sections* obj)
|
||||
|
||||
@@ -26,8 +26,11 @@
|
||||
#include <memory>
|
||||
|
||||
#include <Gui/DocumentObserver.h>
|
||||
#include <Gui/SelectionFilter.h>
|
||||
#include <Gui/TaskView/TaskDialog.h>
|
||||
#include <Gui/TaskView/TaskView.h>
|
||||
#include <Gui/Widgets.h>
|
||||
#include <Base/BoundBox.h>
|
||||
#include <Mod/Part/Gui/ViewProviderSpline.h>
|
||||
#include <Mod/Surface/App/FeatureSections.h>
|
||||
|
||||
@@ -69,6 +72,7 @@ protected:
|
||||
private:
|
||||
std::unique_ptr<Ui_Sections> ui;
|
||||
ViewProviderSections* vp;
|
||||
Gui::ButtonGroup *buttonGroup;
|
||||
|
||||
public:
|
||||
SectionsPanel(ViewProviderSections* vp, Surface::Sections* obj);
|
||||
@@ -91,15 +95,18 @@ protected:
|
||||
void slotDeletedObject(const Gui::ViewProviderDocumentObject& Obj) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_buttonEdgeAdd_clicked();
|
||||
void on_buttonEdgeRemove_clicked();
|
||||
void onDeleteEdge();
|
||||
void on_buttonEdgeAdd_toggled(bool checked);
|
||||
void on_buttonEdgeRemove_toggled(bool checked);
|
||||
void onDeleteEdge(void);
|
||||
void clearSelection();
|
||||
void onIndexesMoved();
|
||||
|
||||
private:
|
||||
void appendCurve(App::DocumentObject*, const std::string& subname);
|
||||
void removeCurve(App::DocumentObject*, const std::string& subname);
|
||||
|
||||
private:
|
||||
void exitSelectionMode();
|
||||
};
|
||||
|
||||
class TaskSections : public Gui::TaskView::TaskDialog
|
||||
|
||||
@@ -43,6 +43,9 @@ that is, the surface will be forced to pass through these edges.</string>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -56,6 +59,9 @@ that is, the surface will be forced to pass through these edges.</string>
|
||||
<property name="text">
|
||||
<string>Remove Edge</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
Reference in New Issue
Block a user