Commit 4e5b4544 authored by Jan Möbius's avatar Jan Möbius
Browse files

Added signals from objects for selectionChanged and visibilityChanged

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7787 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ff901022
...@@ -219,6 +219,7 @@ bool BaseObject::target() { ...@@ -219,6 +219,7 @@ bool BaseObject::target() {
void BaseObject::target(bool _target) { void BaseObject::target(bool _target) {
setFlag("target", _target); setFlag("target", _target);
emit objectSelectionChanged(id());
} }
bool BaseObject::source() { bool BaseObject::source() {
...@@ -227,6 +228,7 @@ bool BaseObject::source() { ...@@ -227,6 +228,7 @@ bool BaseObject::source() {
void BaseObject::source(bool _source) { void BaseObject::source(bool _source) {
setFlag("source", _source); setFlag("source", _source);
emit objectSelectionChanged(id());
} }
bool BaseObject::flag(QString _flag) bool BaseObject::flag(QString _flag)
...@@ -246,6 +248,7 @@ void BaseObject::setFlag(QString _flag, bool _set) ...@@ -246,6 +248,7 @@ void BaseObject::setFlag(QString _flag, bool _set)
if (_set) if (_set)
flags_ << _flag; flags_ << _flag;
} }
emit objectSelectionChanged(id());
} }
QStringList BaseObject::flags() QStringList BaseObject::flags()
...@@ -263,6 +266,7 @@ bool BaseObject::visible() { ...@@ -263,6 +266,7 @@ bool BaseObject::visible() {
void BaseObject::visible(bool _visible) { void BaseObject::visible(bool _visible) {
visible_ = _visible; visible_ = _visible;
emit visibilityChanged( id() );
} }
// =============================================================================== // ===============================================================================
......
...@@ -190,6 +190,9 @@ class DLLEXPORTONLY BaseObject : public QObject { ...@@ -190,6 +190,9 @@ class DLLEXPORTONLY BaseObject : public QObject {
* @{ */ * @{ */
//=========================================================================== //===========================================================================
signals:
void objectSelectionChanged(int _objectId);
public: public:
/** Is this item selected as a target item? /** Is this item selected as a target item?
* Most algorithms operate on target meshes. These meshes are also considered as active. * Most algorithms operate on target meshes. These meshes are also considered as active.
...@@ -237,6 +240,15 @@ class DLLEXPORTONLY BaseObject : public QObject { ...@@ -237,6 +240,15 @@ class DLLEXPORTONLY BaseObject : public QObject {
/** @name Object visualization /** @name Object visualization
* @{ */ * @{ */
//=========================================================================== //===========================================================================
signals:
/** This slot is emitted when the visibility of the object gets changed.
*
* The signal is normally handled by the core to tell the plugins that an object changed its visibility
*
*/
void visibilityChanged(int _objectId);
public : public :
/// return if object is visible /// return if object is visible
......
...@@ -196,11 +196,15 @@ void BaseObjectData::path(QString _path ) { ...@@ -196,11 +196,15 @@ void BaseObjectData::path(QString _path ) {
void BaseObjectData::show() { void BaseObjectData::show() {
separatorNode_->set_status( ACG::SceneGraph::BaseNode::Active ); separatorNode_->set_status( ACG::SceneGraph::BaseNode::Active );
visible_ = true; visible_ = true;
emit visibilityChanged( id() );
} }
void BaseObjectData::hide() { void BaseObjectData::hide() {
separatorNode_->set_status( ACG::SceneGraph::BaseNode::HideSubtree ); separatorNode_->set_status( ACG::SceneGraph::BaseNode::HideSubtree );
visible_ = false; visible_ = false;
emit visibilityChanged( id() );
} }
bool BaseObjectData::visible(){ bool BaseObjectData::visible(){
...@@ -215,6 +219,8 @@ void BaseObjectData::visible(bool _visible) { ...@@ -215,6 +219,8 @@ void BaseObjectData::visible(bool _visible) {
separatorNode_->set_status( ACG::SceneGraph::BaseNode::HideSubtree ); separatorNode_->set_status( ACG::SceneGraph::BaseNode::HideSubtree );
visible_ = _visible; visible_ = _visible;
emit visibilityChanged( id() );
} }
SeparatorNode* BaseObjectData::baseNode() { SeparatorNode* BaseObjectData::baseNode() {
......
Supports Markdown
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