diff --git a/src/container/vcontainer.h b/src/container/vcontainer.h
index 3db6e1744..c91009ada 100644
--- a/src/container/vcontainer.h
+++ b/src/container/vcontainer.h
@@ -279,6 +279,7 @@ public:
* @brief ClearLineAngles clear angles of lines
*/
inline void ClearLineAngles() {lineAngles.clear();}
+ inline void ClearDetails() {details.clear();}
/**
* @brief SetSize set value of size
* @param size value of size in mm
diff --git a/src/dialogs/dialogdetail.cpp b/src/dialogs/dialogdetail.cpp
index 1d57d7505..d0801cfff 100644
--- a/src/dialogs/dialogdetail.cpp
+++ b/src/dialogs/dialogdetail.cpp
@@ -56,6 +56,8 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
connect(ui.checkBoxSeams, &QCheckBox::clicked, this, &DialogDetail::ClickedSeams);
connect(ui.checkBoxClosed, &QCheckBox::clicked, this, &DialogDetail::ClickedClosed);
connect(ui.lineEditNameDetail, &QLineEdit::textChanged, this, &DialogDetail::NamePointChanged);
+
+ connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem);
}
void DialogDetail::ChoosedObject(qint64 id, const Scene::Scenes &type)
@@ -80,6 +82,7 @@ void DialogDetail::ChoosedObject(qint64 id, const Scene::Scenes &type)
qWarning()<
setEnabled(true);
this->show();
}
}
@@ -170,6 +173,7 @@ void DialogDetail::setDetails(const VDetail &value)
ui.doubleSpinBoxSeams->setValue(details.getWidth());
ui.listWidget->setCurrentRow(0);
ui.listWidget->setFocus(Qt::OtherFocusReason);
+ ui.toolButtonDelete->setEnabled(true);
}
void DialogDetail::BiasXChanged(qreal d)
@@ -215,3 +219,9 @@ void DialogDetail::ObjectChanged(int row)
ui.doubleSpinBoxBiasX->setValue(toMM(node.getMx()));
ui.doubleSpinBoxBiasY->setValue(toMM(node.getMy()));
}
+
+void DialogDetail::DeleteItem()
+{
+ qint32 row = ui.listWidget->currentRow();
+ delete ui.listWidget->item( row );
+}
diff --git a/src/dialogs/dialogdetail.h b/src/dialogs/dialogdetail.h
index 476b7cc90..4328afef9 100644
--- a/src/dialogs/dialogdetail.h
+++ b/src/dialogs/dialogdetail.h
@@ -91,6 +91,7 @@ public slots:
* @param row number of row
*/
void ObjectChanged(int row);
+ void DeleteItem();
private:
/**
* @brief ui keeps information about user interface
diff --git a/src/dialogs/dialogdetail.ui b/src/dialogs/dialogdetail.ui
index 3775555bd..6519b344d 100644
--- a/src/dialogs/dialogdetail.ui
+++ b/src/dialogs/dialogdetail.ui
@@ -6,8 +6,8 @@
0
0
- 544
- 327
+ 565
+ 324
@@ -211,6 +211,16 @@
+ -
+
+
+ false
+
+
+ Delete
+
+
+
diff --git a/src/geometry/vdetail.cpp b/src/geometry/vdetail.cpp
index 59dfd3a3a..d771cdd59 100644
--- a/src/geometry/vdetail.cpp
+++ b/src/geometry/vdetail.cpp
@@ -232,6 +232,29 @@ VDetail VDetail::RemoveEdge(const ptrdiff_t &index) const
return det;
}
+QList VDetail::Missing(const VDetail &det) const
+{
+ QList list;
+ if(nodes.size() == det.CountNode())
+ {
+ return list;
+ }
+
+ qint32 j = 0;
+ for(qint32 i = 0; i < nodes.size(); ++i)
+ {
+ if(nodes[i].getId() == det.at(j).getId())
+ {
+ ++j;
+ }
+ else
+ {
+ list.append(nodes[i].getId());
+ }
+ }
+ return list;
+}
+
QVector VDetail::listNodePoint() const
{
QVector list;
diff --git a/src/geometry/vdetail.h b/src/geometry/vdetail.h
index 9edbdfdbf..4825a8a13 100644
--- a/src/geometry/vdetail.h
+++ b/src/geometry/vdetail.h
@@ -183,6 +183,7 @@ public:
ptrdiff_t Edge(const qint64 &p1, const qint64 &p2)const;
void NodeOnEdge(const ptrdiff_t &index, VNodeDetail &p1, VNodeDetail &p2)const;
VDetail RemoveEdge(const ptrdiff_t &index) const;
+ QList Missing(const VDetail &det) const;
private:
qint64 _id;
/**
diff --git a/src/tools/nodeDetails/vabstractnode.cpp b/src/tools/nodeDetails/vabstractnode.cpp
index 0b964aea2..4a9464eb2 100644
--- a/src/tools/nodeDetails/vabstractnode.cpp
+++ b/src/tools/nodeDetails/vabstractnode.cpp
@@ -39,6 +39,40 @@ VAbstractNode::VAbstractNode(VDomDocument *doc, VContainer *data, const qint64 &
_referens = 0;
}
+void VAbstractNode::DeleteNode()
+{
+ if (_referens <= 1)
+ {
+ //remove from xml file
+ QDomElement domElement = doc->elementById(QString().setNum(id));
+ if (domElement.isElement())
+ {
+ QDomNode element = domElement.parentNode();
+ if (element.isNull() == false)
+ {
+ if (element.isElement())
+ {
+ RemoveReferens();//deincrement referens
+ element.removeChild(domElement);//remove form file
+ emit toolhaveChange();//set enabled save button
+ }
+ else
+ {
+ qWarning()<<"parent isn't element"<