+ int aCurPlaneIndex = ComboBoxPlanes->currentIndex();
+ const SMESH::TPlaneData& aPlaneData = myPlanes[ aCurPlaneIndex ];
+ const SMESH::TActorList& anActorList = aPlaneData.ActorList;
+
+ 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 ) ) {
+ if( anActor->hasIO() ) {
+ Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
+ if( _PTR(SObject) aSObj = aStudy->FindObjectID( anIO->getEntry() ) ) {
+ bool anIsChecked = false;
+ SMESH::TActorList::const_iterator anIter = anActorList.begin();
+ for ( ; anIter != anActorList.end(); anIter++ ) {
+ if( vtkActor* aVTKActorRef = *anIter ) {
+ if( SMESH_Actor* anActorRef = SMESH_Actor::SafeDownCast( aVTKActorRef ) ) {
+ if( anActorRef == anActor ) {
+ anIsChecked = true;
+ break;
+ }
+ }
+ }
+ }
+ QString aName = QString( aSObj->GetName().c_str() );
+ QListWidgetItem* anItem = new ActorItem( anActor, aName, ActorList );
+ anItem->setCheckState( anIsChecked ? Qt::Checked : Qt::Unchecked );
+ updateActorItem( anItem, true, false );
+ }
+ }
+ }
+ }
+}
+
+//=================================================================================
+// function : getCurrentActors()
+// purpose :
+//=================================================================================
+SMESH::TActorList SMESHGUI_ClippingDlg::getCurrentActors()
+{
+ SMESH::TActorList anActorList;
+ for( int i = 0, n = ActorList->count(); i < n; i++ )
+ if( ActorItem* anItem = dynamic_cast<ActorItem*>( ActorList->item( i ) ) )
+ if( anItem->checkState() == Qt::Checked )
+ if( SMESH_Actor* anActor = anItem->getActor() )
+ anActorList.push_back( anActor );
+ return anActorList;
+}
+
+//=================================================================================
+// function : dumpPlaneData()
+// purpose :
+//=================================================================================
+void SMESHGUI_ClippingDlg::dumpPlaneData() const
+{
+ printf( "----------- Plane Data -----------\n" );
+ int anId = 1;
+ SMESH::TPlaneDataVector::const_iterator anIter1 = myPlanes.begin();
+ for ( ; anIter1 != myPlanes.end(); anIter1++, anId++ ) {
+ SMESH::TPlaneData aPlaneData = *anIter1;
+ SMESH::TPlane aPlane = aPlaneData.Plane;
+ double* aNormal = aPlane->GetNormal();
+ double* anOrigin = aPlane->GetOrigin();
+ printf( "Plane N%d:\n", anId );
+ printf( " Normal = ( %f, %f, %f )\n", aNormal[0], aNormal[1], aNormal[2] );
+ printf( " Origin = ( %f, %f, %f )\n", anOrigin[0], anOrigin[1], anOrigin[2] );
+
+ SMESH::TActorList anActorList = aPlaneData.ActorList;
+ SMESH::TActorList::const_iterator anIter2 = anActorList.begin();
+ for ( ; anIter2 != anActorList.end(); anIter2++ ) {
+ if( vtkActor* aVTKActor = *anIter2 ) {
+ if( SMESH_Actor* anActor = SMESH_Actor::SafeDownCast( aVTKActor ) )
+ printf( " - Actor: '%s'\n", anActor->getName() );
+ }
+ else
+ printf( " - Actor: NULL\n");
+ }
+ }
+ printf( "----------------------------------\n" );
+}
+
+void SMESHGUI_ClippingDlg::onAutoApply(bool toggled)
+{
+ if ( toggled ) ClickOnApply();