CAM_DataObject* HYDROGUI_DataModel::createRootModuleObject( SUIT_DataObject* theParent )
{
- CAM_DataObject* aRootObj = createModuleObject( theParent );
+ CAM_ModuleObject* aRootObj = createModuleObject( theParent );
+ aRootObj->setDataModel( this );
setRoot( aRootObj );
return aRootObj;
}
}
return isOk;
}
+
+bool HYDROGUI_DataModel::rename( Handle(HYDROData_Entity) theEntity, const QString& theName )
+{
+ if ( theName.isEmpty() )
+ return false;
+
+ try
+ {
+ getDocument()->StartOperation();
+ theEntity->SetName( theName );
+ getDocument()->CommitOperation( HYDROGUI_Tool::ToExtString( tr("RENAME_TO").arg( theName ) ) );
+ module()->application()->activeStudy()->Modified();
+ }
+ catch ( Standard_Failure )
+ {
+ getDocument()->AbortOperation();
+ return false;
+ }
+ return true;
+}
+