myValidator = new HYDROGUI_NameValidator(module(), myObjectName);
myObjectName->setValidator( myValidator );
- connect( myValidator, SIGNAL( emptyName() ), this, SLOT( onEmptyName() ) );
- connect( myValidator, SIGNAL( alreadyExists( QString ) ), this, SLOT( onAlreadyExists( QString ) ) );
+ connect( myValidator, SIGNAL( emptyName() ), SLOT( onEmptyName() ) );
+ connect( myValidator, SIGNAL( alreadyExists( QString ) ), SLOT( onAlreadyExists( QString ) ) );
myGeomObjects = new QListWidget( aPage );
myGeomObjects->setSelectionMode( QListWidget::SingleSelection );
myGeomObjects->setViewMode( QListWidget::ListMode );
myGeomObjects->setSortingEnabled( true );
+ connect( myGeomObjects, SIGNAL( currentTextChanged( const QString & ) ),
+ SIGNAL( objectSelected( const QString & ) ) );
+
QFrame* aBtnsFrame = new QFrame( aPage );
QVBoxLayout* aBtnsLayout = new QVBoxLayout( aBtnsFrame );
aBtnsLayout->setMargin( 5 );
}
void HYDROGUI_CalculationDlg::setGeomObjects( const QStringList& theObjects )
-{
-}
-
-void HYDROGUI_CalculationDlg::setSelectedGeomObjects( const QStringList& theObjects )
{
myGeomObjects->clear();
void setEditedObject( const Handle(HYDROData_CalculationCase) theCase );
void setGeomObjects( const QStringList& theObjects );
- void setSelectedGeomObjects( const QStringList& theObjects );
QStringList getSelectedGeomObjects() const;
HYDROGUI_Zone* getCurrentZone() const;
signals:
void addObjects();
void removeObjects();
+ void objectSelected( const QString & theObjName );
void splitZones();
void hideZones();
void setMergeType( int theMergeType, QString& theBathymetryName );
}
}
}
- thePanel->setSelectedGeomObjects( aList );
+ thePanel->setGeomObjects( aList );
}
void HYDROGUI_CalculationOp::abortOperation()
SLOT( onCreateRegion( const QList<SUIT_DataObject*>& ) ) );
connect( aPanel, SIGNAL( clickedInZonesBrowser( SUIT_DataObject* ) ),
SLOT( onClickedInZonesBrowser( SUIT_DataObject* ) ) );
+ connect( aPanel, SIGNAL( objectSelected( const QString & ) ),
+ SLOT( onObjectSelected( const QString & ) ) );
return aPanel;
}
+void HYDROGUI_CalculationOp::onObjectSelected ( const QString & theObjName )
+{
+ // Select the appropriate geometry object shape in the viewer
+ selectionMgr()->clearSelected();
+
+ // Unhighlight all objects except selected
+ HYDROGUI_Shape* aShape;
+ HYDROGUI_Shape* aSelectedShape = 0;
+ Handle(HYDROData_Entity) anEntity;
+ HYDROData_SequenceOfObjects aSeq = myEditedObject->GetGeometryObjects();
+ HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
+ bool isSelected;
+ QString aName;
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ anEntity = anIter.Value();
+ if ( !anEntity.IsNull() )
+ {
+ aShape = module()->getObjectShape( HYDROGUI_Module::VMR_PreviewCaseZones, anEntity );
+ if ( aShape )
+ {
+ aName = anEntity->GetName();
+ isSelected = ( aName == theObjName );
+ if ( isSelected )
+ {
+ aSelectedShape = aShape;
+ }
+ if ( aShape->isHighlighted() != isSelected )
+ {
+ if ( !isSelected )
+ {
+ aShape->highlight( isSelected );
+ aShape->update();
+ }
+ }
+ }
+ }
+ }
+ if ( aSelectedShape )
+ {
+ aSelectedShape->highlight( true );
+ aSelectedShape->update();
+ }
+}
+
void HYDROGUI_CalculationOp::onClickedInZonesBrowser( SUIT_DataObject* theItem )
{
HYDROGUI_Region* aRegionItem = dynamic_cast<HYDROGUI_Region*>(theItem);
* Set the given bathymetry merge type to the current zone.
*/
void onSetMergeType( int theMergeType, QString& theBathymetryName );
+ /**
+ * Selected zones are moved to the existing region.
+ */
void onMoveZones( SUIT_DataObject* theRegionItem,
const QList<SUIT_DataObject*>& theZonesList );
+ /**
+ * Selected zones are moved to the new region to be created.
+ */
void onCreateRegion( const QList<SUIT_DataObject*>& theZonesList );
+ /**
+ * Case objects must be splitted to zones if the case has been modified or new.
+ */
void onSplitZones();
void onLastViewClosed( SUIT_ViewManager* );
+ /**
+ * The zone is selected in the browser on the second page of the wizard.
+ */
void onClickedInZonesBrowser( SUIT_DataObject* theItem );
+ /**
+ * Hide zones in the viewer.
+ */
void onHideZones();
+ /**
+ * Geometry object is selected in the list on the first wizard page
+ */
+ void onObjectSelected ( const QString & theObjName );
private:
void createPreview();