allow origin lines in datum features
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <App/Plane.h>
|
||||
#include <App/Line.h>
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/Document.h>
|
||||
#include <Gui/BitmapFactory.h>
|
||||
@@ -44,6 +45,7 @@
|
||||
#include <Base/Console.h>
|
||||
#include <Gui/Selection.h>
|
||||
#include <Gui/Command.h>
|
||||
#include <Gui/ViewProviderOrigin.h>
|
||||
#include <Mod/Part/App/PrimitiveFeature.h>
|
||||
#include <Mod/Part/App/DatumFeature.h>
|
||||
#include <Mod/PartDesign/App/Body.h>
|
||||
@@ -62,8 +64,9 @@ const QString makeRefString(const App::DocumentObject* obj, const std::string& s
|
||||
return QObject::tr("No reference selected");
|
||||
|
||||
if (obj->getTypeId().isDerivedFrom(App::Plane::getClassTypeId()) ||
|
||||
obj->getTypeId().isDerivedFrom(App::Line::getClassTypeId()) ||
|
||||
obj->getTypeId().isDerivedFrom(Part::Datum::getClassTypeId()))
|
||||
// App::Plane or Datum feature
|
||||
// App::Plane, Liine or Datum feature
|
||||
return QString::fromAscii(obj->getNameInDocument());
|
||||
|
||||
if ((sub.size() > 4) && (sub.substr(0,4) == "Face")) {
|
||||
@@ -183,6 +186,15 @@ TaskDatumParameters::TaskDatumParameters(ViewProviderDatum *DatumView,QWidget *p
|
||||
ui->buttonRef3->blockSignals(false);
|
||||
ui->lineRef3->blockSignals(false);
|
||||
updateUI();
|
||||
|
||||
//temporary show all coordinate systems for selection
|
||||
for(auto origin : Gui::Application::Instance->activeDocument()->getViewProvidersOfType(Gui::ViewProviderOrigin::getClassTypeId())) {
|
||||
|
||||
static_cast<Gui::ViewProviderOrigin*>(origin)->setTemporaryVisibilityMode(true, Gui::Application::Instance->activeDocument());
|
||||
static_cast<Gui::ViewProviderOrigin*>(origin)->setTemporaryVisibilityAxis(true);
|
||||
static_cast<Gui::ViewProviderOrigin*>(origin)->setTemporaryVisibilityPlanes(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const QString makeRefText(std::set<QString> hint)
|
||||
@@ -363,6 +375,7 @@ void TaskDatumParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
|
||||
// Remove subname for planes and datum features
|
||||
if (selObj->getTypeId().isDerivedFrom(App::Plane::getClassTypeId()) ||
|
||||
selObj->getTypeId().isDerivedFrom(App::Line::getClassTypeId()) ||
|
||||
selObj->getTypeId().isDerivedFrom(Part::Datum::getClassTypeId()))
|
||||
subname = "";
|
||||
|
||||
@@ -512,8 +525,11 @@ void TaskDatumParameters::onRefName(const QString& text, const int idx)
|
||||
if (obj->getTypeId().isDerivedFrom(App::Plane::getClassTypeId())) {
|
||||
// everything is OK (we assume a Part can only have exactly 3 App::Plane objects located at the base of the feature tree)
|
||||
subElement = "";
|
||||
} else if (obj->getTypeId().isDerivedFrom(App::Line::getClassTypeId())) {
|
||||
// everything is OK (we assume a Part can only have exactly 3 App::Line objects located at the base of the feature tree)
|
||||
subElement = "";
|
||||
} else if (obj->getTypeId().isDerivedFrom(Part::Datum::getClassTypeId())) {
|
||||
if (!activeBody->hasFeature(obj))
|
||||
if (!activeBody->hasFeature(obj))
|
||||
return;
|
||||
subElement = "";
|
||||
} else {
|
||||
@@ -625,6 +641,12 @@ QString TaskDatumParameters::getReference(const int idx) const
|
||||
|
||||
TaskDatumParameters::~TaskDatumParameters()
|
||||
{
|
||||
//end temporary view mode of all coordinate systems
|
||||
for(auto origin : Gui::Application::Instance->activeDocument()->getViewProvidersOfType(Gui::ViewProviderOrigin::getClassTypeId())) {
|
||||
|
||||
static_cast<Gui::ViewProviderOrigin*>(origin)->setTemporaryVisibilityMode(false);
|
||||
}
|
||||
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user