Gui: Disable Show Placement for Body Features

This commit is contained in:
Kacper Donat
2025-04-04 00:52:14 +02:00
committed by Benjamin Nauck
parent 5dc2ba40ea
commit a86c300688
6 changed files with 9 additions and 13 deletions

View File

@@ -62,11 +62,6 @@ PROPERTY_SOURCE(Gui::ViewProviderDragger, Gui::ViewProviderDocumentObject)
ViewProviderDragger::ViewProviderDragger()
{
ADD_PROPERTY_TYPE(TransformOrigin, ({}), nullptr, App::Prop_Hidden, nullptr);
ADD_PROPERTY_TYPE(ShowPlacement,
(false),
"Display Options",
App::Prop_None,
"If true, placement of object is additionally rendered.");
pcPlacement = new SoSwitch;
pcPlacement->whichChild = SO_SWITCH_NONE;
@@ -108,9 +103,6 @@ void ViewProviderDragger::onChanged(const App::Property* property)
if (property == &TransformOrigin) {
updateDraggerPosition();
}
else if (property == &ShowPlacement || property == &Visibility) {
pcPlacement->whichChild = (ShowPlacement.getValue() && Visibility.getValue()) ? SO_SWITCH_ALL : SO_SWITCH_NONE;
}
ViewProviderDocumentObject::onChanged(property);
}

View File

@@ -56,10 +56,6 @@ public:
/// destructor.
~ViewProviderDragger() override;
/// Property controlling visibility of the placement indicator, useful for displaying origin
/// position of attached Document Object.
App::PropertyBool ShowPlacement;
/// Origin used when object is transformed. It temporarily changes the origin of object.
/// Dragger is normally placed at the transform origin, unless explicitly overridden via
/// ViewProviderDragger#setDraggerPlacement() method.

View File

@@ -184,6 +184,7 @@ ViewProviderPartExt::ViewProviderPartExt()
Lighting.setEnums(LightingEnums);
ADD_PROPERTY_TYPE(DrawStyle,((long int)0), osgroup, App::Prop_None, "Defines the style of the edges in the 3D view.");
DrawStyle.setEnums(DrawStyleEnums);
ADD_PROPERTY_TYPE(ShowPlacement,(false), "Display Options", App::Prop_None, "If true, placement of object is additionally rendered.");
coords = new SoCoordinate3();
coords->ref();
@@ -373,6 +374,9 @@ void ViewProviderPartExt::onChanged(const App::Property* prop)
else
pcLineStyle->linePattern = 0xff88;
}
else if (prop == &ShowPlacement) {
pcPlacement->whichChild = (ShowPlacement.getValue() && Visibility.getValue()) ? SO_SWITCH_ALL : SO_SWITCH_NONE;
}
else {
// if the object was invisible and has been changed, recreate the visual
if (prop == &Visibility && (isUpdateForced() || Visibility.getValue()) && VisualTouched) {
@@ -385,6 +389,7 @@ void ViewProviderPartExt::onChanged(const App::Property* prop)
App::Property::NoModify, &ShapeAppearance);
// The material has to be checked again (#0001736)
onChanged(&ShapeAppearance);
onChanged(&ShowPlacement);
}
}

View File

@@ -76,6 +76,8 @@ public:
App::PropertyAngle AngularDeflection;
App::PropertyEnumeration Lighting;
App::PropertyEnumeration DrawStyle;
/// Property controlling visibility of the placement indicator, useful for displaying origin
/// position of attached Document Object.
App::PropertyBool ShowPlacement;
// Points
App::PropertyFloatConstraint PointSize;

View File

@@ -238,7 +238,7 @@ QIcon ViewProvider::mergeColorfulOverlayIcons (const QIcon & orig) const
return Gui::ViewProvider::mergeColorfulOverlayIcons (mergedicon);
}
bool ViewProvider::onDelete(const std::vector<std::string> &)
bool ViewProvider::onDelete(const std::vector<std::string>&)
{
PartDesign::Feature* feature = getObject<PartDesign::Feature>();

View File

@@ -282,6 +282,7 @@ void ViewProviderBody::unifyVisualProperty(const App::Property* prop) {
prop == &Selectable ||
prop == &DisplayModeBody ||
prop == &PointColorArray ||
prop == &ShowPlacement ||
prop == &LineColorArray) {
return;
}