Commit 650f0c34 authored by Jan Möbius's avatar Jan Möbius

More intelligent update handling for visibility

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7795 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 9d121eb4
......@@ -265,8 +265,11 @@ bool BaseObject::visible() {
}
void BaseObject::visible(bool _visible) {
visible_ = _visible;
emit visibilityChanged( id() );
// Only do something if this is really a change
if ( visible_ != _visible ) {
visible_ = _visible;
emit visibilityChanged( id() );
}
}
// ===============================================================================
......
......@@ -190,17 +190,21 @@ void BaseObjectData::path(QString _path ) {
// ===============================================================================
void BaseObjectData::show() {
separatorNode_->set_status( ACG::SceneGraph::BaseNode::Active );
visible_ = true;
emit visibilityChanged( id() );
if ( !visible_ ) {
separatorNode_->set_status( ACG::SceneGraph::BaseNode::Active );
visible_ = true;
emit visibilityChanged( id() );
}
}
void BaseObjectData::hide() {
separatorNode_->set_status( ACG::SceneGraph::BaseNode::HideSubtree );
visible_ = false;
emit visibilityChanged( id() );
if ( visible_ ) {
separatorNode_->set_status( ACG::SceneGraph::BaseNode::HideSubtree );
visible_ = false;
emit visibilityChanged( id() );
}
}
bool BaseObjectData::visible(){
......@@ -209,14 +213,17 @@ bool BaseObjectData::visible(){
void BaseObjectData::visible(bool _visible) {
if (_visible)
separatorNode_->set_status( ACG::SceneGraph::BaseNode::Active );
else
separatorNode_->set_status( ACG::SceneGraph::BaseNode::HideSubtree );
if ( visible_ != _visible ) {
if (_visible)
separatorNode_->set_status( ACG::SceneGraph::BaseNode::Active );
else
separatorNode_->set_status( ACG::SceneGraph::BaseNode::HideSubtree );
visible_ = _visible;
emit visibilityChanged( id() );
visible_ = _visible;
emit visibilityChanged( id() );
}
}
SeparatorNode* BaseObjectData::baseNode() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment