return m ? m->groupId() : CAM_DataObject::groupId();
}
+/*!
+ \brief Check if the object is visible.
+ \return \c true if this object is displayable or \c false otherwise
+*/
+bool LightApp_DataObject::isVisible() const
+{
+ LightApp_RootObject* r = dynamic_cast<LightApp_RootObject*>( root() );
+ return r && r->study() && componentDataType() != r->study()->getVisualComponentName();
+}
+
/*!
\brief Get object string identifier.
virtual bool compare( const QVariant&, const QVariant&, const int = NameId ) const;
virtual int groupId() const;
+ virtual bool isVisible() const;
+
protected:
QString myCompDataType;
SUIT_DataObject* myCompObject;
return Qt::AlignLeft;
}
+/*!
+ \brief Check if the object is visible.
+
+ This method can be re-implemented in the subclasses.
+ Default implementation returns \c true (all objects are visible by default).
+
+ \return \c true if this object is displayable or \c false otherwise
+*/
+bool SUIT_DataObject::isVisible() const
+{
+ return true;
+}
+
/*!
\brief Check if the object is draggable.
virtual QFont font( const int = NameId ) const;
virtual int alignment( const int = NameId ) const;
+ virtual bool isVisible() const;
virtual bool isDragable() const;
virtual bool isDropAccepted( SUIT_DataObject* obj );
return dynamic_cast<SUIT_AbstractModel*>( sourceModel() );
}
+/*!
+ \brief Filter rows
+ \param sourceRow row index of the source data model
+ \param sourceParent parent model index of the source data model
+ \return \c true if the specified row should be filtered out (i.e. not displayed) or \c false otherwise
+*/
+bool SUIT_ProxyModel::filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const
+{
+ SUIT_DataObject* o = treeModel()->object( sourceModel()->index( sourceRow, 0, sourceParent ) );
+ return o && o->isVisible();
+}
+
/*!
\brief Register new column in the model
\param group_id - unique data object identificator allowing the classification of objects
protected:
SUIT_AbstractModel* treeModel() const;
+ virtual bool filterAcceptsRow( int, const QModelIndex& ) const;
private:
bool mySortingEnabled;
return exp;
}
+/*!
+ \brief Check if the object is visible.
+ \return \c true if this object is displayable or \c false otherwise
+*/
+bool SalomeApp_DataObject::isVisible() const
+{
+ bool isDraw = true;
+ _PTR(GenericAttribute) anAttr;
+ if ( myObject && myObject->FindAttribute(anAttr, "AttributeDrawable") )
+ {
+ _PTR(AttributeDrawable) aAttrDraw = anAttr;
+ isDraw = aAttrDraw->IsDrawable();
+ }
+ return isDraw && LightApp_DataObject::isVisible() && ( !name().isEmpty() || isReference() );
+}
+
/*!
\brief Check if the specified column supports custom sorting.
\param id column id
bool hasChildren() const;
bool expandable() const;
+ virtual bool isVisible() const;
+
virtual QString componentDataType() const;
virtual bool customSorting( const int = NameId ) const;