mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-07 15:20:34 +05:00
IPAL21396 Quadrangle parameters Hypothesis Construction Bugs.
This commit is contained in:
parent
b81483e2d9
commit
fd25c844b1
@ -1000,12 +1000,14 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
|
|||||||
anEntry = h->GetObjectEntry();
|
anEntry = h->GetObjectEntry();
|
||||||
aDirectionWidget->SetGeomShapeEntry( anEntry );
|
aDirectionWidget->SetGeomShapeEntry( anEntry );
|
||||||
aDirectionWidget->SetMainShapeEntry( aMainEntry );
|
aDirectionWidget->SetMainShapeEntry( aMainEntry );
|
||||||
SMESH::long_array_var aVec = new SMESH::long_array;
|
if ( !isCreation() ) {
|
||||||
int vertID = h->GetTriaVertex();
|
SMESH::long_array_var aVec = new SMESH::long_array;
|
||||||
if(vertID>0) {
|
int vertID = h->GetTriaVertex();
|
||||||
aVec->length(1);
|
if(vertID>0) {
|
||||||
aVec[0] = vertID;
|
aVec->length(1);
|
||||||
aDirectionWidget->SetListOfIDs( aVec );
|
aVec[0] = vertID;
|
||||||
|
aDirectionWidget->SetListOfIDs( aVec );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
aDirectionWidget->showPreview( true );
|
aDirectionWidget->showPreview( true );
|
||||||
customWidgets()->append ( aDirectionWidget );
|
customWidgets()->append ( aDirectionWidget );
|
||||||
|
@ -143,6 +143,9 @@ void StdMeshersGUI_SubShapeSelectorWdg::init()
|
|||||||
myListOfIDs.clear();
|
myListOfIDs.clear();
|
||||||
mySelectedIDs.clear();
|
mySelectedIDs.clear();
|
||||||
|
|
||||||
|
myAddButton->setEnabled( false );
|
||||||
|
myRemoveButton->setEnabled( false );
|
||||||
|
|
||||||
mySMESHGUI = SMESHGUI::GetSMESHGUI();
|
mySMESHGUI = SMESHGUI::GetSMESHGUI();
|
||||||
mySelectionMgr = SMESH::GetSelectionMgr( mySMESHGUI );
|
mySelectionMgr = SMESH::GetSelectionMgr( mySMESHGUI );
|
||||||
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
|
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
|
||||||
@ -196,63 +199,76 @@ void StdMeshersGUI_SubShapeSelectorWdg::SelectionIntoArgument()
|
|||||||
mySelectionMgr->selectedObjects( aList );
|
mySelectionMgr->selectedObjects( aList );
|
||||||
int nbSel = aList.Extent();
|
int nbSel = aList.Extent();
|
||||||
|
|
||||||
if (nbSel < 1)
|
if (nbSel > 0) {
|
||||||
return;
|
SALOME_ListIteratorOfListIO anIt (aList);
|
||||||
|
|
||||||
SALOME_ListIteratorOfListIO anIt (aList);
|
for ( ; anIt.More(); anIt.Next()) { // Loop on selected objects
|
||||||
|
Handle(SALOME_InteractiveObject) IO = anIt.Value();
|
||||||
|
|
||||||
for ( ; anIt.More(); anIt.Next()) { // Loop on selected objects
|
GEOM::GEOM_Object_var aGeomObj = GetGeomObjectByEntry( IO->getEntry() );
|
||||||
Handle(SALOME_InteractiveObject) IO = anIt.Value();
|
if ( !CORBA::is_nil( aGeomObj ) ) { // Selected Object From Study
|
||||||
|
GEOM::GEOM_Object_ptr aGeomFatherObj = aGeomObj->GetMainShape();
|
||||||
GEOM::GEOM_Object_var aGeomObj = GetGeomObjectByEntry( IO->getEntry() );
|
QString aFatherEntry = "";
|
||||||
if ( !CORBA::is_nil( aGeomObj ) ) { // Selected Object From Study
|
QString aMainFatherEntry = "";
|
||||||
GEOM::GEOM_Object_ptr aGeomFatherObj = aGeomObj->GetMainShape();
|
TopoDS_Shape shape;
|
||||||
QString aFatherEntry = "";
|
if ( !CORBA::is_nil( aGeomFatherObj ) ) {
|
||||||
QString aMainFatherEntry = "";
|
// Get Main Shape
|
||||||
TopoDS_Shape shape;
|
GEOM::GEOM_Object_var aGeomMain = GetGeomObjectByEntry( myEntry );
|
||||||
if ( !CORBA::is_nil( aGeomFatherObj ) ) {
|
if ( !CORBA::is_nil( aGeomMain ) && aGeomMain->GetType() == 37 ) { // Main Shape is a Group
|
||||||
// Get Main Shape
|
GEOM::GEOM_Object_ptr aMainFatherObj = aGeomMain->GetMainShape();
|
||||||
GEOM::GEOM_Object_var aGeomMain = GetGeomObjectByEntry( myEntry );
|
if ( !CORBA::is_nil( aMainFatherObj ) )
|
||||||
if ( !CORBA::is_nil( aGeomMain ) && aGeomMain->GetType() == 37 ) { // Main Shape is a Group
|
aMainFatherEntry = aMainFatherObj->GetStudyEntry();
|
||||||
GEOM::GEOM_Object_ptr aMainFatherObj = aGeomMain->GetMainShape();
|
}
|
||||||
if ( !CORBA::is_nil( aMainFatherObj ) )
|
aFatherEntry = aGeomFatherObj->GetStudyEntry();
|
||||||
aMainFatherEntry = aMainFatherObj->GetStudyEntry();
|
|
||||||
}
|
}
|
||||||
aFatherEntry = aGeomFatherObj->GetStudyEntry();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( aFatherEntry != "" && ( aFatherEntry == myEntry || aFatherEntry == aMainFatherEntry ) ) {
|
if ( aFatherEntry != "" && ( aFatherEntry == myEntry || aFatherEntry == aMainFatherEntry ) ) {
|
||||||
if ( aGeomObj->GetType() == 37 /*GEOM_GROUP*/ ) { // Selected Group that belongs the main object
|
if ( aGeomObj->GetType() == 37 /*GEOM_GROUP*/ ) { // Selected Group that belongs the main object
|
||||||
GEOMBase::GetShape(aGeomObj, shape);
|
GEOMBase::GetShape(aGeomObj, shape);
|
||||||
if ( !shape.IsNull() ) {
|
if ( !shape.IsNull() ) {
|
||||||
TopExp_Explorer exp( shape, mySubShType );
|
TopExp_Explorer exp( shape, mySubShType );
|
||||||
for ( ; exp.More(); exp.Next() ) {
|
for ( ; exp.More(); exp.Next() ) {
|
||||||
int index = myPreviewActor->GetIndexByShape( exp.Current() );
|
int index = myPreviewActor->GetIndexByShape( exp.Current() );
|
||||||
|
if ( index ) {
|
||||||
|
mySelectedIDs.append( index );
|
||||||
|
myPreviewActor->HighlightID( index );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if ( aGeomObj->GetType() == 28 /*GEOM_SUBSHAPE*/ ) {
|
||||||
|
GEOMBase::GetShape(aGeomObj, shape);
|
||||||
|
if ( !shape.IsNull() && shape.ShapeType() == mySubShType ) {
|
||||||
|
int index = myPreviewActor->GetIndexByShape( shape );
|
||||||
if ( index ) {
|
if ( index ) {
|
||||||
mySelectedIDs.append( index );
|
mySelectedIDs.append( index );
|
||||||
myPreviewActor->HighlightID( index );
|
myPreviewActor->HighlightID( index );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ( aGeomObj->GetType() == 28 /*GEOM_SUBSHAPE*/ ) {
|
|
||||||
GEOMBase::GetShape(aGeomObj, shape);
|
|
||||||
if ( !shape.IsNull() && shape.ShapeType() == mySubShType ) {
|
|
||||||
int index = myPreviewActor->GetIndexByShape( shape );
|
|
||||||
if ( index ) {
|
|
||||||
mySelectedIDs.append( index );
|
|
||||||
myPreviewActor->HighlightID( index );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else { // Selected Actor from Actor Collection
|
||||||
|
QString anEntry = IO->getEntry();
|
||||||
|
QString str = "_";
|
||||||
|
int index = anEntry.lastIndexOf( str );
|
||||||
|
anEntry.remove(0, index+1);
|
||||||
|
int ind = anEntry.toInt();
|
||||||
|
if ( ind )
|
||||||
|
mySelectedIDs.append( ind );
|
||||||
}
|
}
|
||||||
} else { // Selected Actor from Actor Collection
|
}
|
||||||
QString anEntry = IO->getEntry();
|
}
|
||||||
QString str = "_";
|
// update add button
|
||||||
int index = anEntry.lastIndexOf( str );
|
myAddButton->setEnabled( myListWidget->count() < myMaxSize && mySelectedIDs.size() > 0 && ( mySelectedIDs.size() <= myMaxSize || myMaxSize == -1 ) );
|
||||||
anEntry.remove(0, index+1);
|
|
||||||
int ind = anEntry.toInt();
|
//Connect Selected Ids in viewer and dialog's Ids list
|
||||||
if ( ind )
|
myListWidget->clearSelection();
|
||||||
mySelectedIDs.append( ind );
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -324,6 +340,9 @@ void StdMeshersGUI_SubShapeSelectorWdg::onListSelectionChanged()
|
|||||||
QListWidgetItem* anItem;
|
QListWidgetItem* anItem;
|
||||||
foreach(anItem, selItems)
|
foreach(anItem, selItems)
|
||||||
myPreviewActor->HighlightID( anItem->text().toInt() );
|
myPreviewActor->HighlightID( anItem->text().toInt() );
|
||||||
|
|
||||||
|
// update remove button
|
||||||
|
myRemoveButton->setEnabled( selItems.size() > 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -352,8 +371,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::updateState()
|
|||||||
state = true;
|
state = true;
|
||||||
|
|
||||||
myListWidget->setEnabled( state );
|
myListWidget->setEnabled( state );
|
||||||
myAddButton->setEnabled( state );
|
myAddButton->setEnabled( mySelectedIDs.size() > 0 );
|
||||||
myRemoveButton->setEnabled( state );
|
|
||||||
|
|
||||||
if (state) {
|
if (state) {
|
||||||
myPreviewActor = new SMESH_PreviewActorsCollection();
|
myPreviewActor = new SMESH_PreviewActorsCollection();
|
||||||
|
Loading…
Reference in New Issue
Block a user