if ( visibility )
{
- SUIT_AbstractModel* treeModel = 0;
- LightApp_Application* app = dynamic_cast<LightApp_Application*>( module()->application() );
- if ( app )
- treeModel = dynamic_cast<SUIT_AbstractModel*>( app->objectBrowser()->model() );
-
- if ( treeModel )
- {
- HYDROGUI_Module* aModule = dynamic_cast<HYDROGUI_Module*>( module() );
- bool isVisible = aModule->isObjectVisible( -1, theModelObject );
- Qtx::VisibilityState aVisState = isVisible ? Qtx::ShownState : Qtx::HiddenState;
- treeModel->setVisibilityState( aResObj->text( aResObj->customData( Qtx::IdType ).toInt() ), aVisState, false );
- }
+ setObjectVisibilityState( theModelObject, aResObj );
}
if ( theIsBuildTree )
const bool theIsBuildTree,
const bool theIsInOperation )
{
- return buildObject( theParent, new HYDROGUI_Zone( theParent, theModelObject, theParentEntry, theIsInOperation ),
- theParentEntry, theIsBuildTree, theIsInOperation );
+ HYDROGUI_Zone* aZone = new HYDROGUI_Zone( theParent, theModelObject, theParentEntry, theIsInOperation );
+ LightApp_DataObject* aDataObj = buildObject( theParent, aZone, theParentEntry, theIsBuildTree, theIsInOperation );
+
+ setObjectVisibilityState( theModelObject, aZone );
+
+ return aDataObj;
}
LightApp_DataObject* HYDROGUI_DataModel::createRegion( SUIT_DataObject* theParent,
}
return true;
}
+
+void HYDROGUI_DataModel::setObjectVisibilityState( Handle(HYDROData_Entity) theModelObject,
+ HYDROGUI_DataObject* theObject )
+{
+ SUIT_AbstractModel* treeModel = 0;
+ LightApp_Application* app = dynamic_cast<LightApp_Application*>( module()->application() );
+ if ( app )
+ treeModel = dynamic_cast<SUIT_AbstractModel*>( app->objectBrowser()->model() );
+
+ if ( treeModel )
+ {
+ HYDROGUI_Module* aModule = dynamic_cast<HYDROGUI_Module*>( module() );
+ bool isVisible = aModule->isObjectVisible( -1, theModelObject );
+ Qtx::VisibilityState aVisState = isVisible ? Qtx::ShownState : Qtx::HiddenState;
+ treeModel->setVisibilityState( theObject->text( theObject->customData( Qtx::IdType ).toInt() ), aVisState, false );
+ }
+}
\ No newline at end of file
static SUIT_DataObject* findChildByName( const SUIT_DataObject* theFather,
const QString& theName );
+ /**
+ * Set object visibility state.
+ * \param theModelObject the data model object
+ * \param theDataObject the GUI object
+ */
+ void setObjectVisibilityState( Handle(HYDROData_Entity) theModelObject,
+ HYDROGUI_DataObject* theObject );
+
+
protected:
QString myStudyURL; ///< the saved/opened document URL
QByteArray myStates;