#include <SVTK_ViewModel.h>
#include <SVTK_ViewManager.h>
+#include <VTKViewer_Algorithm.h>
+
#include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_FileDlg.h>
{
if (SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>(views[i]))
{
- vtkActorCollection* allActors = vtkView->getRenderer()->GetActors();
+ VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors());
+ vtkActorCollection* allActors = aCopy.GetActors();
allActors->InitTraversal();
while (vtkActor* actor = allActors->GetNextActor())
{
// access later when restoring other parameters
SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
vtkRenderer* Renderer = vtkView->getRenderer();
- vtkActorCollection* theActors = Renderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(Renderer->GetActors());
+ vtkActorCollection* theActors = aCopy.GetActors();
theActors->InitTraversal();
bool isFound = false;
vtkActor *ac = theActors->GetNextActor();
#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
+#include <VTKViewer_Algorithm.h>
+
#include <LightApp_SelectionMgr.h>
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
for ( int iV = 0; iV < views.count(); ++iV ) {
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
vtkRenderer *aRenderer = vtkWnd->getRenderer();
- vtkActorCollection *actors = aRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection *actors = aCopy.GetActors();
for (int i = 0; i < actors->GetNumberOfItems(); ++i ) {
// size of actors changes inside the loop
while (SMESH_Actor *actor = dynamic_cast<SMESH_Actor*>(actors->GetItemAsObject(i)))
for ( int iV = 0; iV < views.count(); ++iV ) {
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
vtkRenderer *aRenderer = vtkWnd->getRenderer();
- vtkActorCollection *actors = aRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection *actors = aCopy.GetActors();
for (int i = 0; i < actors->GetNumberOfItems(); ++i ) {
// size of actors changes inside the loop
while(SMESH_Actor *actor = dynamic_cast<SMESH_Actor*>(actors->GetItemAsObject(i)))
{
if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWindow)){
vtkRenderer *aRenderer = aViewWindow->getRenderer();
- vtkActorCollection *aCollection = aRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
{
if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWnd)) {
vtkRenderer *aRenderer = aViewWindow->getRenderer();
- vtkActorCollection *aCollection = aRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor())
if(dynamic_cast<SMESH_Actor*>(anAct))
{
OK = true;
vtkRenderer *aRenderer = aViewWnd->getRenderer();
- vtkActorCollection *aCollection = aRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
switch (theAction) {
if( selected.Extent() == 0){
vtkRenderer* aRenderer = aWnd->getRenderer();
- vtkActorCollection *aCollection = aRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
PW);
// update actors
vtkRenderer* aRenderer = aVtkView->getRenderer();
- vtkActorCollection *aCollection = aRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
void SetPointRepresentation(bool theIsVisible){
if(SVTK_ViewWindow* aViewWindow = GetCurrentVtkView()){
vtkRenderer *aRenderer = aViewWindow->getRenderer();
- vtkActorCollection *aCollection = aRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
if(SVTK_ViewWindow* aWnd = GetCurrentVtkView()){
int anIsAllPickable = (theActor == NULL);
vtkRenderer *aRenderer = aWnd->getRenderer();
- vtkActorCollection *aCollection = aRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
if(SALOME_Actor *anActor = dynamic_cast<SALOME_Actor*>(anAct)){
if( SVTK_ViewWindow* aWnd = SMESH::GetCurrentVtkView() )
{
vtkRenderer *aRenderer = aWnd->getRenderer();
- vtkActorCollection *aCollection = aRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while ( vtkActor *anAct = aCollection->GetNextActor())