Back to index

salome-gui  6.5.0
SalomeApp_VisualState.cxx File Reference
#include "SalomeApp_VisualState.h"
#include "SalomeApp_Module.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
#include <SUIT_ViewManager.h>
#include <SUIT_ViewWindow.h>
#include <QtxWorkstack.h>
#include <STD_TabDesktop.h>
#include <QList>
#include <QApplication>
#include <QMultiHash>
#include <SALOMEDSClient_ClientFactory.hxx>
#include <SALOMEDSClient_IParameters.hxx>
#include <vector>
#include <string>
#include <cstdio>

Go to the source code of this file.


void nameViewWindows (const ViewManagerList &lst)
 Sets names of all view windows in given list.

Function Documentation

Sets names of all view windows in given list.

This is used in order to apply the same naming algorithm when saving and restoring view windows. Names of view windows must be the same before saving workstack (splitters) information, and before its restoring! Naming rule: ViewerType_IndexOfViewerOfThisType_IndexOfViewInThisViewer VTKViewer_0_0 OCCViewer_0_0 OCCViewer_0_1 OCCViewer_0_2 VTKViewer_1_0

Definition at line 73 of file SalomeApp_VisualState.cxx.

  QMap<QString, int> viewersCounter;
  for ( QList<SUIT_ViewManager*>::const_iterator it = lst.begin(); it != lst.end(); ++it )
    SUIT_ViewManager* aVM = *it;
    if ( !aVM )

    int view_count = aVM->getViewsCount();
    QString vType = aVM->getType();
    if ( !view_count )
      continue; //No views is opened in the viewer

    if ( !viewersCounter.contains( vType ) )
      viewersCounter.insert( vType, 0 );

    int& viewerID = viewersCounter[vType];

    QVector<SUIT_ViewWindow*> views = aVM->getViews();
    for ( int i = 0; i < view_count; i++ )
      QString vName = QString( "%1_%2_%3" ).arg( vType ).arg( viewerID ).arg( i );
      views[i]->setObjectName( vName );