Gui: fix view object global coordinate space showable checking
This commit is contained in:
@@ -71,10 +71,9 @@ PROPERTY_SOURCE(Gui::ViewProviderDocumentObject, Gui::ViewProvider)
|
||||
ViewProviderDocumentObject::ViewProviderDocumentObject()
|
||||
: pcObject(nullptr)
|
||||
, pcDocument(nullptr)
|
||||
, _UpdatingView(false)
|
||||
{
|
||||
static const char *dogroup = "Display Options";
|
||||
static const char *sgroup = "Selection";
|
||||
static const char *dogroup = "Display Options";
|
||||
static const char *sgroup = "Selection";
|
||||
|
||||
ADD_PROPERTY_TYPE(DisplayMode, ((long)0), dogroup, App::Prop_None, "Set the display mode");
|
||||
ADD_PROPERTY_TYPE(Visibility, (true), dogroup, App::Prop_None, "Show the object in the 3d view");
|
||||
@@ -236,6 +235,32 @@ void ViewProviderDocumentObject::hide(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool ViewProviderDocumentObject::isShowable() const
|
||||
{
|
||||
return _Showable;
|
||||
}
|
||||
|
||||
void ViewProviderDocumentObject::setShowable(bool enable)
|
||||
{
|
||||
if (_Showable == enable)
|
||||
return;
|
||||
|
||||
_Showable = enable;
|
||||
int which = getModeSwitch()->whichChild.getValue();
|
||||
if (_Showable && which == -1 && Visibility.getValue()) {
|
||||
setModeSwitch();
|
||||
}
|
||||
else if (!_Showable) {
|
||||
if (which >= 0)
|
||||
ViewProvider::hide();
|
||||
}
|
||||
}
|
||||
|
||||
void ViewProviderDocumentObject::setModeSwitch() {
|
||||
if(isShowable())
|
||||
ViewProvider::setModeSwitch();
|
||||
}
|
||||
|
||||
void ViewProviderDocumentObject::show(void)
|
||||
{
|
||||
if(TreeWidget::isObjectShowable(getObject()))
|
||||
|
||||
Reference in New Issue
Block a user