-// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
// Qt includes
#include <QGridLayout>
QTreeWidgetItem * headerItem = new QTreeWidgetItem( columnNames );
theTreeWidget->setHeaderItem ( headerItem );
theTreeWidget->header()->moveSection( 1, 0 );
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
theTreeWidget->header()->setClickable( true );
theTreeWidget->header()->setMovable( false );
theTreeWidget->header()->setResizeMode( 1, QHeaderView::ResizeToContents );
+#else
+ theTreeWidget->header()->setSectionsClickable( true );
+ theTreeWidget->header()->setSectionsMovable( false );
+ theTreeWidget->header()->setSectionResizeMode( 1, QHeaderView::ResizeToContents );
+#endif
theTreeWidget->setSelectionMode( QAbstractItemView::ExtendedSelection );
}
{
GEOMToolsGUI_TreeWidgetItem* item;
if( !theObject->IsMainShape() ) {
- GEOMToolsGUI_TreeWidgetItem* parentItem = addSubObject( theWidget, theObjects, theObject->GetMainShape() );
+ GEOM::GEOM_Object_var aMainShape = theObject->GetMainShape();
+ if ( CORBA::is_nil( aMainShape ) )
+ return NULL;
+ GEOMToolsGUI_TreeWidgetItem* parentItem = addSubObject( theWidget, theObjects, aMainShape );
item = findObjectInTree( theWidget, theObject );
if( !item )
item = new GEOMToolsGUI_TreeWidgetItem( parentItem, QStringList() << theObject->GetName(), theObject->GetStudyEntry() );
_PTR(AttributeDrawable) aDrw = aStudyBuilder->FindOrCreateAttribute( obj, "AttributeDrawable" );
aDrw->SetDrawable( false );
myDisplayer.EraseWithChildren( new SALOME_InteractiveObject( studyEntry.c_str(), "GEOM", "TEMP_IO" ) );
+ // hide references if any
+ std::vector< _PTR(SObject) > vso = myStudy->FindDependances(obj);
+ for ( int i = 0; i < vso.size(); i++ ) {
+ _PTR(SObject) refObj = vso[i];
+ aDrw = aStudyBuilder->FindOrCreateAttribute( refObj, "AttributeDrawable" );
+ aDrw->SetDrawable( false );
+ }
}
}
myApp->updateObjectBrowser( false );
_PTR(SObject) obj ( myStudy->FindObjectID( theStudyEntry.c_str() ) );
if ( obj ) {
// remove visual properties of the object
- appStudy->removeObjectFromAll(obj->GetID().c_str());
+ appStudy->removeObjectProperties(obj->GetID().c_str());
// remove references to this object
appStudy->deleteReferencesTo( obj );
// remove objects from study
objectsToBeUnpublished.insert( *iter );
}
if( myGroupIntermediates->checkedId() == 2 ) { // remove
- if( myCBSoftRemoval->isChecked() )
- for( iter = myListParents.begin(); iter != myListParents.end(); ++iter )
- objectsToBeRemoved.insert( *iter );
- else {
- if ( SUIT_MessageBox::question( this,
- tr( "GEOM_WRN_WARNING" ),
- tr( "GEOM_REDUCE_STUDY_WARNING_DELETE" ),
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::Yes ) == QMessageBox::Yes ) {
- for( iter = myListParents.begin(); iter != myListParents.end(); ++iter )
- objectsToBeRemoved.insert( *iter );
- }
- else
- return;
- }
+ if( !myCBSoftRemoval->isChecked() &&
+ SUIT_MessageBox::question( this,
+ tr( "GEOM_WRN_WARNING" ),
+ tr( "GEOM_REDUCE_STUDY_WARNING_DELETE" ),
+ QMessageBox::Yes | QMessageBox::No,
+ QMessageBox::Yes ) == QMessageBox::No ) {
+ return;
+ }
+ for( iter = myListParents.begin(); iter != myListParents.end(); ++iter )
+ objectsToBeRemoved.insert( *iter );
}
// Create lists of sub-objects to be removed or to be unpublished