Merge pull request #23368 from kadet1090/show-placement-and-plane-in-attacher
Gui: Show placement and plane in attacher
This commit is contained in:
@@ -51,6 +51,8 @@
|
||||
#include <Mod/Part/Gui/TaskAttacher.h>
|
||||
|
||||
#include "TaskAttacher.h"
|
||||
|
||||
#include "ViewProvider2DObject.h"
|
||||
#include "ui_TaskAttacher.h"
|
||||
|
||||
|
||||
@@ -222,6 +224,7 @@ TaskAttacher::TaskAttacher(Gui::ViewProviderDocumentObject* ViewProvider, QWidge
|
||||
updateListOfModes();
|
||||
selectMapMode(eMapMode(pcAttach->MapMode.getValue()));
|
||||
updatePreview();
|
||||
showPlacementUtilities();
|
||||
|
||||
//NOLINTBEGIN
|
||||
// connect object deletion with slot
|
||||
@@ -1051,6 +1054,17 @@ void TaskAttacher::selectMapMode(eMapMode mmode) {
|
||||
ui->listOfModes->blockSignals(false);
|
||||
}
|
||||
|
||||
void TaskAttacher::showPlacementUtilities()
|
||||
{
|
||||
if (auto planarViewProvider = freecad_cast<PartGui::ViewProvider2DObject*>(ViewProvider)) {
|
||||
overrides.override(planarViewProvider->ShowPlane, true);
|
||||
}
|
||||
|
||||
if (auto partViewProvider = freecad_cast<PartGui::ViewProviderPartExt*>(ViewProvider)) {
|
||||
overrides.override(partViewProvider->ShowPlacement, true);
|
||||
}
|
||||
}
|
||||
|
||||
Attacher::eMapMode TaskAttacher::getActiveMapMode()
|
||||
{
|
||||
auto sel = ui->listOfModes->selectedItems();
|
||||
|
||||
@@ -30,8 +30,9 @@
|
||||
#include <Gui/TaskView/TaskView.h>
|
||||
#include <Gui/TaskView/TaskDialog.h>
|
||||
#include <Mod/Part/App/Attacher.h>
|
||||
#include <functional>
|
||||
#include <App/PropertyOverrides.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
class Ui_TaskAttacher;
|
||||
class QLineEdit;
|
||||
@@ -48,6 +49,7 @@ namespace PartGui {
|
||||
|
||||
class Ui_TaskAttacher;
|
||||
|
||||
|
||||
class PartGuiExport TaskAttacher : public Gui::TaskView::TaskBox, public Gui::SelectionObserver
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -94,6 +96,7 @@ private Q_SLOTS:
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e) override;
|
||||
|
||||
private:
|
||||
void objectDeleted(const Gui::ViewProviderDocumentObject&);
|
||||
void documentDeleted(const Gui::Document&);
|
||||
@@ -133,6 +136,8 @@ private:
|
||||
*/
|
||||
void selectMapMode(Attacher::eMapMode mmode);
|
||||
|
||||
void showPlacementUtilities();
|
||||
|
||||
protected:
|
||||
Gui::ViewProviderDocumentObject *ViewProvider;
|
||||
std::string ObjectName;
|
||||
@@ -152,6 +157,8 @@ private:
|
||||
using Connection = boost::signals2::connection;
|
||||
Connection connectDelObject;
|
||||
Connection connectDelDocument;
|
||||
|
||||
App::PropertyOverrideContext overrides;
|
||||
};
|
||||
|
||||
/// simulation dialog for the TaskView
|
||||
|
||||
Reference in New Issue
Block a user