if (myRenderer)
RemoveFromRender(myRenderer);
+ QMap<int, GEOM_Actor*>::iterator iter = myMapOfActors.begin();
+ for ( ; iter != myMapOfActors.end(); ++iter )
+ if ( GEOM_Actor* anActor = iter.value() )
+ anActor->Delete();
myMapOfActors.clear();
}
TopExp_Explorer exp( theShape, theType );
for ( ; exp.More(); exp.Next() ) {
int index = myMapOfShapes.FindIndex( exp.Current() );
- if ( index ) {
+ if ( index && !myMapOfActors.contains( index ) ) {
// create actor if the index is present
if ( GEOM_Actor* anActor = createActor( exp.Current() )) {
- // Create new entry for actor
- QString aString = theEntry;
- aString += QString("_%1").arg( index ); // add index to actor entry
-
- // Create interactive object
- Handle( SALOME_InteractiveObject ) anIO = new SALOME_InteractiveObject();
- anIO->setEntry( aString.toLatin1().constData() );
-
- // Init Actor
- anActor->SetVectorMode( true );
- anActor->setIO( anIO );
- anActor->SetSelector( mySelector );
- anActor->SetPickable( true );
- anActor->SetResolveCoincidentTopology( true );
-
- // Add Actor to the Actors Map
- myMapOfActors.insert(index, anActor);
+ // Create new entry for actor
+ QString aString = theEntry;
+ aString += QString("_%1").arg( index ); // add index to actor entry
+
+ // Create interactive object
+ Handle( SALOME_InteractiveObject ) anIO = new SALOME_InteractiveObject();
+ anIO->setEntry( aString.toLatin1().constData() );
+
+ // Init Actor
+ anActor->SetVectorMode( true );
+ anActor->setIO( anIO );
+ anActor->SetSelector( mySelector );
+ anActor->SetPickable( true );
+ anActor->SetResolveCoincidentTopology( true );
+
+ // Add Actor to the Actors Map
+ myMapOfActors.insert(index, anActor);
}
}
}
actor->SetShape(shape,0,0);
//Color Properties
- /*
- vtkProperty* aProp = vtkProperty::New();
- vtkProperty* aHLProp = vtkProperty::New();
- vtkProperty* aPHLProp = vtkProperty::New();
-
- aProp->SetColor( 255, 0, 0);
- actor->SetProperty(aProp);
-
- aHLProp->SetColor( 255, 255, 255);
- actor->SetHighlightProperty(aHLProp);
-
- aPHLProp->SetColor( 155, 155, 155);
- aPHLProp->SetLineWidth ( 3 );
- aPHLProp->SetOpacity ( 0.75 );
- actor->SetPreHighlightProperty(aPHLProp);
-
- aProp->Delete();
- aHLProp->Delete();
- aPHLProp->Delete();
+ /*
+ vtkProperty* aProp = vtkProperty::New();
+ vtkProperty* aHLProp = vtkProperty::New();
+ vtkProperty* aPHLProp = vtkProperty::New();
+
+ aProp->SetColor( 255, 0, 0);
+ actor->SetProperty(aProp);
+
+ aHLProp->SetColor( 255, 255, 255);
+ actor->SetHighlightProperty(aHLProp);
+
+ aPHLProp->SetColor( 155, 155, 155);
+ aPHLProp->SetLineWidth ( 3 );
+ aPHLProp->SetOpacity ( 0.75 );
+ actor->SetPreHighlightProperty(aPHLProp);
+
+ aProp->Delete();
+ aHLProp->Delete();
+ aPHLProp->Delete();
*/
return actor;