SVTK_Prs* vtkPrs =
stvkViewer ? dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0;
if ( vtkPrs && !vtkPrs->IsNull() ) {
- if ( mode == 0 )
- aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
- else if ( mode == 1 )
- aView->ChangeRepresentationToSurface( vtkPrs->GetObjects() );
- else if ( mode == 2 ) {
- vtkActorCollection* anActors = vtkPrs->GetObjects();
- anActors->InitTraversal();
- while (vtkActor* anAct = anActors->GetNextActor()) {
- GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(anAct);
- aGeomActor->SetVectorMode(!aGeomActor->GetVectorMode());
- }
- }
+ if ( mode == 0 )
+ aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
+ else if ( mode == 1 )
+ aView->ChangeRepresentationToSurface( vtkPrs->GetObjects() );
+ else if ( mode == 2 ) {
+ vtkActorCollection* anActors = vtkPrs->GetObjects();
+ anActors->InitTraversal();
+ while (vtkActor* anAct = anActors->GetNextActor()) {
+ GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(anAct);
+ aGeomActor->SetVectorMode(!aGeomActor->GetVectorMode());
+ }
+ }
}
}
aView->Repaint();
SOCC_Viewer* soccViewer = (SOCC_Viewer*)(viewWindow->getViewManager()->getViewModel());
SOCC_Prs* occPrs = dynamic_cast<SOCC_Prs*>( soccViewer->CreatePrs( It.Value()->getEntry() ) );
if ( occPrs && !occPrs->IsNull() ) {
- AIS_ListOfInteractive shapes; occPrs->GetObjects( shapes );
- AIS_ListIteratorOfListOfInteractive interIter( shapes );
- for ( ; interIter.More(); interIter.Next() ) {
- if ( mode == 0 )
- ic->SetDisplayMode( interIter.Value(), AIS_WireFrame, false );
- else if ( mode == 1 )
- ic->SetDisplayMode( interIter.Value(), AIS_Shaded, false );
- if (mode == 2 ) {
- Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( interIter.Value() );
- aSh->SetDisplayVectors(!aSh->isShowVectors());
- ic->RecomputePrsOnly(interIter.Value());
- }
- }
+ AIS_ListOfInteractive shapes; occPrs->GetObjects( shapes );
+ AIS_ListIteratorOfListOfInteractive interIter( shapes );
+ for ( ; interIter.More(); interIter.Next() ) {
+ if ( mode == 0 )
+ ic->SetDisplayMode( interIter.Value(), AIS_WireFrame, false );
+ else if ( mode == 1 )
+ ic->SetDisplayMode( interIter.Value(), AIS_Shaded, false );
+ if (mode == 2 ) {
+ Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( interIter.Value() );
+ if ( !aSh.IsNull() ) {
+ aSh->SetDisplayVectors(!aSh->isShowVectors());
+ ic->RecomputePrsOnly(interIter.Value());
+ }
+ }
+ }
}
}
ic->UpdateCurrentViewer();
SALOME_Prs* prs = view->CreatePrs( entry( index ).toLatin1().constData() );
if ( prs ) {
if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC
- SOCC_Prs* occPrs = (SOCC_Prs*) prs;
- AIS_ListOfInteractive lst;
- occPrs->GetObjects( lst );
- if ( lst.Extent() ) {
- Handle(AIS_InteractiveObject) io = lst.First();
- if ( !io.IsNull() ) {
- Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(io);
- ret = aSh->isShowVectors();
- }
- }
+ SOCC_Prs* occPrs = (SOCC_Prs*) prs;
+ AIS_ListOfInteractive lst;
+ occPrs->GetObjects( lst );
+ if ( lst.Extent() ) {
+ Handle(AIS_InteractiveObject) io = lst.First();
+ if ( !io.IsNull() ) {
+ Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(io);
+ if ( !aSh.IsNull() )
+ ret = aSh->isShowVectors();
+ }
+ }
} else if ( viewType == SVTK_Viewer::Type() ) { // assuming VTK
- SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( prs );
- vtkActorCollection* lst = vtkPrs ? vtkPrs->GetObjects() : 0;
- if ( lst ) {
- lst->InitTraversal();
- vtkActor* actor = lst->GetNextActor();
- if ( actor ) {
- GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(actor);
- if ( aGeomActor )
- ret = aGeomActor->GetVectorMode();
- }
- }
+ SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( prs );
+ vtkActorCollection* lst = vtkPrs ? vtkPrs->GetObjects() : 0;
+ if ( lst ) {
+ lst->InitTraversal();
+ vtkActor* actor = lst->GetNextActor();
+ if ( actor ) {
+ GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(actor);
+ if ( aGeomActor )
+ ret = aGeomActor->GetVectorMode();
+ }
+ }
}
}
}