Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
correction des valeurs
[modules/smesh.git]
/
src
/
SMESHGUI
/
SMESHGUI_ClippingDlg.cxx
diff --git
a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
index 09c3a39420f869d27685f798771776cca1b77fbf..11926c33c83f0cd818e7575d34c584a87e746c36 100644
(file)
--- a/
src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
+++ b/
src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
16
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-20
21
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-552,7
+552,7
@@
SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg( SMESHGUI* theModule, SVTK_ViewWindow
myIsSelectPlane = false;
myIsSelectPlane = false;
- myHelpFileName = "clipping
_page
.html";
+ myHelpFileName = "clipping.html";
// signals and slots connections :
connect( ComboBoxPlanes, SIGNAL( activated( int ) ), this, SLOT( onSelectPlane( int ) ) );
// signals and slots connections :
connect( ComboBoxPlanes, SIGNAL( activated( int ) ), this, SLOT( onSelectPlane( int ) ) );
@@
-1068,11
+1068,7
@@
void SMESHGUI_ClippingDlg::updateActorList()
{
ActorList->clear();
{
ActorList->clear();
- SalomeApp_Study* anAppStudy = SMESHGUI::activeStudy();
- if( !anAppStudy )
- return;
-
- _PTR(Study) aStudy = anAppStudy->studyDS();
+ _PTR(Study) aStudy = SMESH::getStudy();
if( !aStudy )
return;
if( !aStudy )
return;
@@
-1086,6
+1082,8
@@
void SMESHGUI_ClippingDlg::updateActorList()
std::for_each( myPlanes.begin(),myPlanes.end(), TSetVisibility( PreviewCheckBox->isChecked() ) );
aPlaneData.Plane.GetPointer()->myActor->SetVisibility( false );
std::for_each( myPlanes.begin(),myPlanes.end(), TSetVisibility( PreviewCheckBox->isChecked() ) );
aPlaneData.Plane.GetPointer()->myActor->SetVisibility( false );
+ std::map< std::string, QListWidgetItem* > itemMap; // used to sort items by entry
+
VTK::ActorCollectionCopy aCopy( myViewWindow->getRenderer()->GetActors() );
vtkActorCollection* anAllActors = aCopy.GetActors();
anAllActors->InitTraversal();
VTK::ActorCollectionCopy aCopy( myViewWindow->getRenderer()->GetActors() );
vtkActorCollection* anAllActors = aCopy.GetActors();
anAllActors->InitTraversal();
@@
-1111,13
+1109,20
@@
void SMESHGUI_ClippingDlg::updateActorList()
if ( !aFatherName.isEmpty() )
aName = aFatherName + " / " + aName;
aName += QString(" (%1)").arg( aSObj->GetID().c_str() );
if ( !aFatherName.isEmpty() )
aName = aFatherName + " / " + aName;
aName += QString(" (%1)").arg( aSObj->GetID().c_str() );
- QListWidgetItem* anItem = new ActorItem( anActor, aName,
ActorList
);
+ QListWidgetItem* anItem = new ActorItem( anActor, aName,
0
);
anItem->setCheckState( anIsChecked ? Qt::Checked : Qt::Unchecked );
anItem->setCheckState( anIsChecked ? Qt::Checked : Qt::Unchecked );
-
updateActorItem( anItem, true, false
);
+
itemMap.insert( std::make_pair( aSObj->GetID(), anItem )
);
}
}
}
}
}
}
}
}
+ std::map< std::string, QListWidgetItem* >::iterator s2i = itemMap.begin();
+ for ( ; s2i != itemMap.end(); ++s2i )
+ {
+ QListWidgetItem* anItem = s2i->second;
+ ActorList->addItem( anItem );
+ }
+ updateActorItem( 0, true, false );
}
/*!
}
/*!
@@
-1258,16
+1263,19
@@
void SMESHGUI_ClippingDlg::ClickOnNew()
SMESH::OrientedPlane* aPlane = SMESH::OrientedPlane::New(myViewWindow);
SMESH::TPlane aTPlane(aPlane);
aPlane->PlaneMode = CurrentMode;
SMESH::OrientedPlane* aPlane = SMESH::OrientedPlane::New(myViewWindow);
SMESH::TPlane aTPlane(aPlane);
aPlane->PlaneMode = CurrentMode;
- SMESH::TActorList anActorList;
+ SMESH::TActorList anActorList
, aVisibleActorList
;
VTK::ActorCollectionCopy aCopy( myViewWindow->getRenderer()->GetActors() );
vtkActorCollection* anAllActors = aCopy.GetActors();
anAllActors->InitTraversal();
while( vtkActor* aVTKActor = anAllActors->GetNextActor() )
if( SMESH_Actor* anActor = SMESH_Actor::SafeDownCast( aVTKActor ) )
VTK::ActorCollectionCopy aCopy( myViewWindow->getRenderer()->GetActors() );
vtkActorCollection* anAllActors = aCopy.GetActors();
anAllActors->InitTraversal();
while( vtkActor* aVTKActor = anAllActors->GetNextActor() )
if( SMESH_Actor* anActor = SMESH_Actor::SafeDownCast( aVTKActor ) )
+ {
anActorList.push_back( anActor );
anActorList.push_back( anActor );
-
- SMESH::TPlaneData aPlaneData(aTPlane, anActorList);
-
+ if ( anActor->GetVisibility() )
+ aVisibleActorList.push_back( anActor );
+ }
+ SMESH::TPlaneData aPlaneData(aTPlane,
+ aVisibleActorList.empty() ? anActorList : aVisibleActorList);
myPlanes.push_back(aPlaneData);
myPlanes.push_back(aPlaneData);