IPAL21396 Quadrangle parameters Hypothesis Construction Bugs.

This commit is contained in:
dmv 2010-04-27 11:57:40 +00:00
parent b81483e2d9
commit fd25c844b1
2 changed files with 75 additions and 55 deletions

View File

@ -1000,6 +1000,7 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
anEntry = h->GetObjectEntry();
aDirectionWidget->SetGeomShapeEntry( anEntry );
aDirectionWidget->SetMainShapeEntry( aMainEntry );
if ( !isCreation() ) {
SMESH::long_array_var aVec = new SMESH::long_array;
int vertID = h->GetTriaVertex();
if(vertID>0) {
@ -1007,6 +1008,7 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
aVec[0] = vertID;
aDirectionWidget->SetListOfIDs( aVec );
}
}
aDirectionWidget->showPreview( true );
customWidgets()->append ( aDirectionWidget );
}

View File

@ -143,6 +143,9 @@ void StdMeshersGUI_SubShapeSelectorWdg::init()
myListOfIDs.clear();
mySelectedIDs.clear();
myAddButton->setEnabled( false );
myRemoveButton->setEnabled( false );
mySMESHGUI = SMESHGUI::GetSMESHGUI();
mySelectionMgr = SMESH::GetSelectionMgr( mySMESHGUI );
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
@ -196,9 +199,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::SelectionIntoArgument()
mySelectionMgr->selectedObjects( aList );
int nbSel = aList.Extent();
if (nbSel < 1)
return;
if (nbSel > 0) {
SALOME_ListIteratorOfListIO anIt (aList);
for ( ; anIt.More(); anIt.Next()) { // Loop on selected objects
@ -256,6 +257,21 @@ void StdMeshersGUI_SubShapeSelectorWdg::SelectionIntoArgument()
}
}
}
// update add button
myAddButton->setEnabled( myListWidget->count() < myMaxSize && mySelectedIDs.size() > 0 && ( mySelectedIDs.size() <= myMaxSize || myMaxSize == -1 ) );
//Connect Selected Ids in viewer and dialog's Ids list
myListWidget->clearSelection();
if ( mySelectedIDs.size() > 0 ) {
for (int i = 0; i < mySelectedIDs.size(); i++) {
QString anID = QString(" %1").arg( mySelectedIDs.at(i) );
QList<QListWidgetItem*> anItems = myListWidget->findItems ( anID, Qt::MatchExactly );
QListWidgetItem* item;
foreach(item, anItems)
item->setSelected(true);
}
}
}
//=================================================================================
// function : onAdd()
@ -324,6 +340,9 @@ void StdMeshersGUI_SubShapeSelectorWdg::onListSelectionChanged()
QListWidgetItem* anItem;
foreach(anItem, selItems)
myPreviewActor->HighlightID( anItem->text().toInt() );
// update remove button
myRemoveButton->setEnabled( selItems.size() > 0 );
}
//=================================================================================
@ -352,8 +371,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::updateState()
state = true;
myListWidget->setEnabled( state );
myAddButton->setEnabled( state );
myRemoveButton->setEnabled( state );
myAddButton->setEnabled( mySelectedIDs.size() > 0 );
if (state) {
myPreviewActor = new SMESH_PreviewActorsCollection();