-
+// VISU VISUGUI : GUI of VISU component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include "LightApp_SelectionMgr.h"
#include "LightApp_VTKSelector.h"
#include "LightApp_Preferences.h"
+#include "LightApp_Displayer.h"
+
+#include "SALOMEDS_IParameters.hxx"
#include "VVTK_ViewManager.h"
#include "VVTK_ViewWindow.h"
#include "VISU_CutLines_i.hh"
#include "VISU_Actor.h"
+#include "VISU_ScalarMapAct.h"
#include "VisuGUI_Tools.h"
#include "VisuGUI_ActionsDef.h"
#include <vtkRenderer.h>
#include <vtkCamera.h>
#include <vtkTimerLog.h>
+#include <vtkPlane.h>
#include <sstream>
}
//---------------------------------------------------------------
-VisuGUI_Module
-::VisuGUI_Module() :
+VisuGUI_Module::
+VisuGUI_Module() :
VisuGUI()
{
}
//---------------------------------------------------------------
-VisuGUI_Module
-::~VisuGUI_Module()
+VisuGUI_Module::
+~VisuGUI_Module()
{
}
//---------------------------------------------------------------
void
-VisuGUI_Module
-::initialize( CAM_Application* theApp )
+VisuGUI_Module::
+initialize( CAM_Application* theApp )
{
VisuGUI::initialize( theApp );
accel->setActionKey( SVTK::PlusSpeedIncrementEvent, Key_Plus, aViewerType );
accel->setActionKey( SVTK::MinusSpeedIncrementEvent, Key_Minus, aViewerType );
- connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ), this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) );
+ connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ),
+ this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) );
// Prepare popup menus
QtxPopupMgr* mgr = popupMgr();
this, SLOT(OnErasePrs()));
mgr->insert( action( GAUSS_ERASE_PRS ), -1, -1, -1 ); // erase
mgr->setRule( action( GAUSS_ERASE_PRS ),
- aRule + " and (isVisible=true)", true );
+ aRule + " and ({true} in $canBeDisplayed) and (isVisible=true)", true );
createAction( GAUSS_DISPLAY_PRS, VisuGUI::tr("MEN_DISPLAY"), QIconSet(),
VisuGUI::tr("MEN_DISPLAY"), "", 0, this, false,
this, SLOT(OnDisplayPrs()));
mgr->insert( action( GAUSS_DISPLAY_PRS ), -1, -1, -1 ); // display
mgr->setRule( action( GAUSS_DISPLAY_PRS ),
- aRule + " and (isVisible=false)", true );
+ aRule + " and ({true} in $canBeDisplayed) and (isVisible=false)", true );
createAction( GAUSS_DISPLAY_ONLY_PRS, VisuGUI::tr("MEN_DISPLAY_ONLY"), QIconSet(),
VisuGUI::tr("MEN_DISPLAY_ONLY"), "", 0, this, false,
this, SLOT(OnDisplayOnlyPrs()));
mgr->insert( action( GAUSS_DISPLAY_ONLY_PRS ), -1, -1, -1 ); // display only
mgr->setRule( action( GAUSS_DISPLAY_ONLY_PRS ),
- aRule, true );
+ aRule + " and ({true} in $canBeDisplayed)", true );
createAction( GAUSS_RENAME_CONFIGURATION, VisuGUI::tr("MEN_RENAME"), QIconSet(),
VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
tr("MEN_SAVE_CONFIGURATION"), "", 0, this, false,
this, SLOT(OnSaveConfiguration()));
mgr->insert( action( GAUSS_SAVE_CONFIGURATION ), -1, -1, -1 );
- mgr->setRule( action( GAUSS_SAVE_CONFIGURATION ), "selcount>=0 and client='VVTK' and activeView='VVTK'", true );
+ mgr->setRule( action( GAUSS_SAVE_CONFIGURATION ),
+ "selcount>=0 and client='VVTK' and activeView='VVTK'", true );
createAction( GAUSS_OVERWRITE_CONFIGURATION, tr("MEN_OVERWRITE_CONFIGURATION"), QIconSet(),
tr("MEN_OVERWRITE_CONFIGURATION"), "", 0, this, false,
//---------------------------------------------------------------
bool
-VisuGUI_Module
-::activateModule( SUIT_Study* theStudy )
+VisuGUI_Module::
+activateModule( SUIT_Study* theStudy )
{
VisuGUI::activateModule( theStudy );
//---------------------------------------------------------------
bool
-VisuGUI_Module
-::deactivateModule( SUIT_Study* theStudy )
+VisuGUI_Module::
+deactivateModule( SUIT_Study* theStudy )
{
VisuGUI::deactivateModule( theStudy );
//---------------------------------------------------------------
SUIT_ViewManager*
-VisuGUI_Module
-::onCreateViewManager()
+VisuGUI_Module::
+onCreateViewManager()
{
Viewer* aViewer = new Viewer( this, myViewerMap );
return aViewer->getViewManager();
//---------------------------------------------------------------
void
-VisuGUI_Module
-::onLastViewClosed(SUIT_ViewManager* theViewManager)
+VisuGUI_Module::
+onLastViewClosed(SUIT_ViewManager* theViewManager)
{
myViewerMap.erase(theViewManager);
}
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createPreferences()
+VisuGUI_Module::
+createPreferences()
{
VisuGUI::createPreferences();
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createGaussPointsPreferences()
+VisuGUI_Module::
+createGaussPointsPreferences()
{
int gaussTab = addPreference( tr( "VISU_GAUSS_PREF_TAB_TTL" ) );
int primitiveGr = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL" ), gaussTab );
setPreferenceProperty( primitiveGr, "columns", 1 );
int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
- LightApp_Preferences::Selector, "VISU", "point_sprite_primitive_type" );
+ LightApp_Preferences::Selector, "VISU",
+ "point_sprite_primitive_type" );
QStringList values;
values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
LightApp_Preferences::File, "VISU", "point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU", "point_sprite_alpha_threshold" );
+ LightApp_Preferences::DblSpin, "VISU",
+ "point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
setPreferenceProperty( maxSizePref, "max", 100 );
int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "point_sprite_magnification" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "point_sprite_magnification" );
setPreferenceProperty( magnificationPref, "min", 10 );
setPreferenceProperty( magnificationPref, "max", 1000 );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createInsideCursorPreferences()
+VisuGUI_Module::
+createInsideCursorPreferences()
{
int insideCursorTab = addPreference( tr( "VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL" ) );
setPreferenceProperty( primitiveGr, "columns", 1 );
int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
- LightApp_Preferences::Selector, "VISU", "inside_point_sprite_primitive_type" );
+ LightApp_Preferences::Selector, "VISU",
+ "inside_point_sprite_primitive_type" );
QStringList values;
values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
LightApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU", "inside_point_sprite_alpha_threshold" );
+ LightApp_Preferences::DblSpin, "VISU",
+ "inside_point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_geom_sphere_resolution" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_geom_sphere_resolution" );
setPreferenceProperty( resolutionPref, "min", 3 );
setPreferenceProperty( resolutionPref, "max", 100 );
int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_geom_sphere_face_limit" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
setPreferenceProperty( sizeGr, "columns", 2 );
int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_min_size" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_point_sprite_min_size" );
setPreferenceProperty( minSizePref, "min", 1 );
setPreferenceProperty( minSizePref, "max", 100 );
int maxSizePref = addPreference( tr( "VISU_GAUSS_PREF_MAX_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_max_size" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_point_sprite_max_size" );
setPreferenceProperty( maxSizePref, "min", 1 );
setPreferenceProperty( maxSizePref, "max", 100 );
setPreferenceProperty( magnificationGr, "columns", 2 );
int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), magnificationGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_magnification" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "inside_point_sprite_magnification" );
setPreferenceProperty( magnificationPref, "min", 10 );
setPreferenceProperty( magnificationPref, "max", 1000 );
int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), magnificationGr,
- LightApp_Preferences::DblSpin, "VISU", "inside_point_sprite_increment" );
+ LightApp_Preferences::DblSpin, "VISU",
+ "inside_point_sprite_increment" );
setPreferenceProperty( incrementPref, "min", 0.01 );
setPreferenceProperty( incrementPref, "max", 10 );
setPreferenceProperty( incrementPref, "step", 0.1 );
-
}
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createOutsideCursorPreferences()
+VisuGUI_Module::
+createOutsideCursorPreferences()
{
int outsideCursorTab = addPreference( tr( "VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL" ) );
setPreferenceProperty( primitiveGr, "columns", 1 );
int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
- LightApp_Preferences::Selector, "VISU", "outside_point_sprite_primitive_type" );
+ LightApp_Preferences::Selector, "VISU",
+ "outside_point_sprite_primitive_type" );
QStringList values;
values.append( tr( "VISU_GAUSS_PREF_POINTSPRITE" ) );
LightApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU", "outside_point_sprite_alpha_threshold" );
+ LightApp_Preferences::DblSpin, "VISU",
+ "outside_point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "outside_geom_sphere_resolution" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "outside_geom_sphere_resolution" );
setPreferenceProperty( resolutionPref, "min", 3 );
setPreferenceProperty( resolutionPref, "max", 100 );
int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "outside_geom_sphere_face_limit" );
+ LightApp_Preferences::IntSpin, "VISU",
+ "outside_geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createPickingPreferences()
+VisuGUI_Module::
+createPickingPreferences()
{
int pickingTab = addPreference( tr( "VISU_PICKING_PREF_TAB_TTL" ) );
setPreferenceProperty( cursorGr, "columns", 1 );
int cursorSizePref = addPreference( tr( "VISU_PICKING_PREF_CURSOR_SIZE" ), cursorGr,
- LightApp_Preferences::DblSpin, "VISU", "picking_cursor_size" );
+ LightApp_Preferences::DblSpin, "VISU", "picking_cursor_size" );
setPreferenceProperty( cursorSizePref, "min", 0 );
setPreferenceProperty( cursorSizePref, "max", 1.0 );
setPreferenceProperty( cursorSizePref, "step", 0.1 );
setPreferenceProperty( pyramidHeightPref, "min", 1 );
setPreferenceProperty( pyramidHeightPref, "max", 100 );
- int selectionColorPref = addPreference( tr( "VISU_PICKING_PREF_SELECTION_COLOR" ), cursorGr,
- LightApp_Preferences::Color, "VISU", "picking_selection_color" );
+ /*int selectionColorPref = */
+ addPreference( tr( "VISU_PICKING_PREF_SELECTION_COLOR" ), cursorGr,
+ LightApp_Preferences::Color, "VISU", "picking_selection_color" );
// Tolerance
int toleranceGr = addPreference( tr( "VISU_PICKING_PREF_TOLERANCE_GROUP_TTL" ), pickingTab );
int pointTolerancePref = addPreference( tr( "VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE" ), toleranceGr,
- LightApp_Preferences::DblSpin, "VISU", "picking_point_tolerance" );
+ LightApp_Preferences::DblSpin, "VISU", "picking_point_tolerance" );
setPreferenceProperty( pointTolerancePref, "min", 0.001 );
setPreferenceProperty( pointTolerancePref, "max", 10 );
setPreferenceProperty( pointTolerancePref, "step", 0.01 );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createSpaceMousePreferences()
+VisuGUI_Module::
+createSpaceMousePreferences()
{
int mouseTab = addPreference( tr( "VISU_MOUSE_PREF_TAB_TLT" ) );
int mouseGr = addPreference( tr( "VISU_MOUSE_PREF_GROUP_TLT" ), mouseTab );
- int mousePref = addPreference( tr( "VISU_MOUSE_PREF" ), mouseGr, LightApp_Preferences::Selector, "VISU", "mouse_behaviour" );
+ int mousePref = addPreference( tr( "VISU_MOUSE_PREF" ), mouseGr,
+ LightApp_Preferences::Selector, "VISU", "mouse_behaviour" );
QStringList values;
values.append( tr( "VISU_MOUSE_PREF_STANDARD" ) );
values.append( tr( "VISU_MOUSE_PREF_KEYBOARD_FREE" ) );
setPreferenceProperty( mousePref, "indexes", indices );
int keybrdGr = addPreference( tr( "VISU_KEYBOARD_PREF_GROUP_TTL" ), mouseTab );
- int keybrdPref = addPreference( tr( "VISU_KEYBOARD_PREF" ), keybrdGr, LightApp_Preferences::IntSpin, "VISU", "speed_increment" );
+ int keybrdPref = addPreference( tr( "VISU_KEYBOARD_PREF" ), keybrdGr,
+ LightApp_Preferences::IntSpin, "VISU", "speed_increment" );
setPreferenceProperty( keybrdPref, "max", 1000 );
int spacemouseGr = addPreference( tr( "VISU_SPACEMOUSE_PREF" ), mouseTab );
setPreferenceProperty( spacemouseGr, "columns", 1 );
- int spacemousePref1 = addPreference( tr( "VISU_SPACEMOUSE_PREF_1" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func1_btn" ); //decrease_speed_increment
- int spacemousePref2 = addPreference( tr( "VISU_SPACEMOUSE_PREF_2" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func2_btn" ); //increase_speed_increment
- int spacemousePref3 = addPreference( tr( "VISU_SPACEMOUSE_PREF_3" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func3_btn" ); //decrease_gauss_point_magnification
- int spacemousePref4 = addPreference( tr( "VISU_SPACEMOUSE_PREF_4" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func4_btn" ); //increase_gauss_point_magnification
- int spacemousePref5 = addPreference( tr( "VISU_SPACEMOUSE_PREF_5" ), spacemouseGr, LightApp_Preferences::Selector, "VISU", "spacemouse_func5_btn" ); //dominant_combined_switch
+ int spacemousePref1 = addPreference( tr( "VISU_SPACEMOUSE_PREF_1" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func1_btn" ); //decrease_speed_increment
+ int spacemousePref2 = addPreference( tr( "VISU_SPACEMOUSE_PREF_2" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func2_btn" ); //increase_speed_increment
+ int spacemousePref3 = addPreference( tr( "VISU_SPACEMOUSE_PREF_3" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func3_btn" ); //decrease_gauss_point_magnification
+ int spacemousePref4 = addPreference( tr( "VISU_SPACEMOUSE_PREF_4" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func4_btn" ); //increase_gauss_point_magnification
+ int spacemousePref5 = addPreference( tr( "VISU_SPACEMOUSE_PREF_5" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func5_btn" ); //dominant_combined_switch
values.clear();
values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_1" ) );
values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_2" ) );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::createRecorderPreferences()
+VisuGUI_Module::
+createRecorderPreferences()
{
int recorderTab = addPreference( tr( "VISU_RECORDER_PREF_TAB_TTL" ) );
//---------------------------------------------------------------
void
-VisuGUI_Module
-::OnCreateGaussPoints()
+VisuGUI_Module::
+OnCreateGaussPoints()
{
double initialTime = vtkTimerLog::GetCPUTime();
- CreatePrs3d<VISU::GaussPoints_i,VVTK_Viewer,VisuGUI_GaussPointsDlg,1>(this,true);
+ CreatePrs3d<VISU::GaussPoints_i, VVTK_Viewer, VisuGUI_GaussPointsDlg, 1>(this);
INFOS( "VisuGUI_Module::OnCreateGaussPoints() : Gauss Points created in " <<
vtkTimerLog::GetCPUTime() - initialTime << " seconds" );
}
void
-VisuGUI_Module
-::OnViewManagerAdded(SUIT_ViewManager* viewMgr)
+VisuGUI_Module::
+OnViewManagerAdded(SUIT_ViewManager* viewMgr)
{
QString type = viewMgr->getViewModel()->getType();
if ( type == VVTK_Viewer::Type() )
- connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ), this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) );
+ connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ),
+ this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) );
}
void
-VisuGUI_Module
-::OnViewCreated(SUIT_ViewWindow* view)
+VisuGUI_Module::
+OnViewCreated(SUIT_ViewWindow* view)
{
SVTK_ViewWindow* viewWindow = dynamic_cast<SVTK_ViewWindow*>( view );
if ( viewWindow ) {
}
void
-VisuGUI_Module
-::setProperty( SVTK_ViewWindow* viewWindow, const QString& pref )
+VisuGUI_Module::
+setProperty( SVTK_ViewWindow* viewWindow, const QString& pref )
{
if ( !viewWindow )
return;
}
void
-VisuGUI_Module
-::setProperty( SVTK_ViewManager* vm, const QString& prop )
+VisuGUI_Module::
+setProperty( SVTK_ViewManager* vm, const QString& prop )
{
if ( !vm )
return;
}
void
-VisuGUI_Module
-::preferencesChanged( const QString& group, const QString& pref )
+VisuGUI_Module::
+preferencesChanged( const QString& group, const QString& pref )
{
VisuGUI::preferencesChanged(group,pref);
//---------------------------------------------------------------
SUIT_ViewManager*
-VisuGUI_Module
-::getViewManager(const QString& theType,
- const bool theIsCreate)
+VisuGUI_Module::
+getViewManager(const QString& theType,
+ const bool theIsCreate)
{
- if(SUIT_ViewManager* aViewManager = VisuGUI::getViewManager(theType,theIsCreate))
+ if (SUIT_ViewManager* aViewManager = VisuGUI::getViewManager(theType,theIsCreate))
return aViewManager;
- if(theIsCreate && VVTK_Viewer::Type() == theType)
+ if (theIsCreate && theType == VVTK_Viewer::Type())
return onCreateViewManager();
return NULL;
//---------------------------------------------------------------
void
-VisuGUI_Module
-::OnEditGaussPoints()
+VisuGUI_Module::
+OnEditGaussPoints()
{
Handle(SALOME_InteractiveObject) anIO;
- if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
- EditPrs3d<VISU::GaussPoints_i,VisuGUI_GaussPointsDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow<VVTK_Viewer>(this,true)){
- aViewWindow->highlight(anIO,1);
+ if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) {
+ // Create VVTK_ViewWindow, if it does not exist
+ if (VVTK_ViewWindow* aViewWindow = GetViewWindow<VVTK_Viewer>(this)) {
+ EditPrs3d<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg, 1>(this, anIO, aPrs3d, aViewWindow);
}
}
}
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnDisplayPrs()
-{
- if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs");
-
- QApplication::setOverrideCursor(Qt::waitCursor);
-
- if(LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this)){
- SALOME_ListIO aSel, aList;
- aSelectionMgr->selectedObjects(aSel);
- extractContainers(aSel, aList);
-
- for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){
- Handle(SALOME_InteractiveObject) anIO = it.Value();
- CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
-
- // is it a Prs3d object ?
- if(!CORBA::is_nil(anObject)){
- if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in())){
- if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs : Prs3d object");
- if(aPrs3d->GetType() == VISU::TGAUSSPOINTS)
- VISU::UpdateViewer<VVTK_Viewer>(this,aPrs3d,false,true,true);
- else if(SUIT_ViewManager* aViewManager = getApp()->activeViewManager()){
- QString aType = aViewManager->getType();
- if(aType == SVTK_Viewer::Type())
- VISU::UpdateViewer<SVTK_Viewer>(this,aPrs3d,false,true,true);
- else if(aType == VVTK_Viewer::Type())
- VISU::UpdateViewer<VVTK_Viewer>(this,aPrs3d,false,true,true);
- }
- continue;
- }
- }
-
- // is it Curve ?
- if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in())){
- if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs : Curve object");
- PlotCurve( this, aCurve, VISU::eDisplay );
- continue;
- }
-
- // is it Container ?
- if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in())){
- if(MYDEBUG) MESSAGE("VisuGUI_Module::DisplayPrs : Container object");
- PlotContainer( this, aContainer, VISU::eDisplay );
- continue;
- }
-
- // is it Table ?
- if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in())){
- if(MYDEBUG) MESSAGE("VisuGUI_Module::DisplayPrs : Table object");
- PlotTable( this, aTable, VISU::eDisplay );
- continue;
- }
- }
- }
-
- QApplication::restoreOverrideCursor();
-}
-
-
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnEraseAll()
-{
- if(SUIT_ViewManager* aViewManager = getApp()->activeViewManager()){
- QString aType = aViewManager->getType();
- if(aType == SVTK_Viewer::Type())
- VISU::OnEraseAll<SVTK_Viewer>(this);
- else if(aType == VVTK_Viewer::Type())
- VISU::OnEraseAll<VVTK_Viewer>(this);
- else if(aType == SPlot2d_Viewer::Type())
- VISU::OnEraseAll<SPlot2d_Viewer>(this);
- }
-}
-
-
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnDisplayOnlyPrs()
-{
- OnEraseAll();
- OnDisplayPrs();
-}
-
-
-//---------------------------------------------------------------
-void
-VisuGUI_Module
-::OnErasePrs()
-{
- QApplication::setOverrideCursor(Qt::waitCursor);
-
- LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
- SALOME_ListIO aSel, aList;
- aSelectionMgr->selectedObjects(aSel);
- extractContainers(aSel, aList);
-
- for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){
- Handle(SALOME_InteractiveObject) anIO = it.Value();
- CORBA::Object_var anObject = GetSelectedObj(GetAppStudy(this),anIO->getEntry());
- if(!CORBA::is_nil(anObject)){
- VISU::Base_var aBase = VISU::Base::_narrow(anObject);
- if(!CORBA::is_nil(aBase))
- VISU::ErasePrs(this,aBase,true);
- }
- }
-
- QApplication::restoreOverrideCursor();
-}
-
-
//---------------------------------------------------------------
namespace
{
PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in())){
// To set visiblity
- VISU::UpdateViewer<VVTK_Viewer>(theModule,aPrs3d,anIsFirst,false,false);
+ VISU::UpdateViewer(theModule, aPrs3d, /*disp_only = */anIsFirst, /*highlight = */false);
anIsFirst = false;
// To update selection
}
return aRet;
}
+
+
+const char gSeparator = '_'; // character used to separate parameter names
+const char gDigitsSep = ':'; // character used to separate numeric parameter values (color = r:g:b)
+/*!
+ * \brief Virtual public
+ *
+ * This method is called just before the study document is saved, so the module has a possibility
+ * to store visual parameters in AttributeParameter attribue(s)
+ */
+void VisuGUI_Module::storeVisualParameters(int savePoint)
+{
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+ if( !study || !study->studyDS() )
+ return;
+ _PTR(Study) studyDS = study->studyDS();
+ _PTR(AttributeParameter) ap = studyDS->GetModuleParameters("Interface Applicative", moduleName().latin1(), savePoint);
+ SALOMEDS_IParameters ip(ap);
+
+ // viewers counters are used for storing view_numbers in IParameters
+ int svtkViewers( 0 ), vvtkViewers( 0 ), plotViewers( 0 );
+
+ // componentName is used for encoding of entries when storing them in IParameters
+ _PTR(SComponent) visuEng = ClientFindOrCreateVisuComponent( studyDS );
+ std::string componentName = visuEng->ComponentDataType();
+
+ QPtrList<SUIT_ViewManager> lst;
+
+ // saving VVTK viewer parameters. VVTK (Gauss Viewers) are NOT created by SalomeApp since
+ // VVTK is declared in VISU, so here we store VVTK view window parameters.
+ // VisuGUI_Module::restoreVisualParameters() creates VVTK_Views and restores its parameters.
+ ip.setProperty( "ActiveGaussViewer", "-1" );
+ getApp()->viewManagers( VVTK_Viewer::Type(), lst );
+ for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
+ SUIT_ViewManager* vman = it.current();
+ if ( SUIT_ViewWindow* vwin = vman->getActiveView() ) {
+ // using predefined string "GaussViewer" as "entry".. it's a hardcoded "workaround".
+ // gauss viewer parameters are retrieved using this "entry" string.
+ // name of parameter = caption of gauss ViewWindow
+ // value of parameter = ViewWindow's visual parameters
+ ip.setParameter( "GaussViewer", vwin->caption().latin1(), vwin->getVisualParameters().latin1() );
+
+ if ( application()->desktop()->activeWindow() == vwin )
+ ip.setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).latin1() );
+ vvtkViewers++;
+ }
+ }
+
+ // VISU module opens one SVTK viewer in activateModule(). This causes a bug in save-restore visual
+ // parameters: it no SVTK view was saved, we need NOT any SVTK on restore. Here we store if any is open..
+ /*
+ lst.clear();
+ getApp()->viewManagers( SVTK_Viewer::Type(), lst );
+ ip.setProperty( "VtkViewersCount", QString::number( lst.count() ).latin1() );
+ */
+
+ // main cycle to store parameters of displayed objects
+ lst.clear();
+ getApp()->viewManagers( lst );
+ vvtkViewers = svtkViewers = plotViewers = 0;
+ for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
+ SUIT_ViewManager* vman = it.current();
+ QString vType = vman->getType();
+ int* viewsCounter = vType == SVTK_Viewer::Type() ? &svtkViewers :
+ vType == VVTK_Viewer::Type() ? &vvtkViewers :
+ vType == SPlot2d_Viewer::Type() ? &plotViewers : 0;
+
+ // saving VTK actors' properties
+ if ( vType == SVTK_Viewer::Type() || // processing SVTK and VVTK viewers in the same
+ vType == VVTK_Viewer::Type() ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow)
+
+ QPtrVector<SUIT_ViewWindow> views = vman->getViews();
+ for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) {
+ if ( SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>( views[i] ) ) {
+ vtkActorCollection* allActors = vtkView->getRenderer()->GetActors();
+ allActors->InitTraversal();
+ while ( vtkActor* actor = allActors->GetNextActor() ) {
+ if ( actor->GetVisibility() ) { // store only visible actors
+ if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) {
+ if ( vActor->hasIO() ) { // actor corresponds to existing obj
+
+ Handle(SALOME_InteractiveObject) io = vActor->getIO();
+ // entry is "ecoded" = it does NOT contain component adress, since it is a
+ // subject to change on next component loading
+ std::string entry = ip.encodeEntry( io->getEntry(), componentName );
+
+ std::string param, vtkParam = vType.latin1(); vtkParam += gSeparator;
+ vtkParam += QString::number( *viewsCounter ).latin1(); vtkParam += gSeparator;
+
+ param = vtkParam + "Visibility";
+ ip.setParameter( entry, param, "On" );
+ param = vtkParam + "Name";
+ ip.setParameter( entry, param, vActor->getName() );
+ param = vtkParam + "RepresentationMode";
+ ip.setParameter( entry, param, QString::number( vActor->GetRepresentation() ).latin1() );
+ param = vtkParam + "Opacity";
+ ip.setParameter( entry, param, QString::number( vActor->GetOpacity() ).latin1() );
+ float r, g, b;
+ vActor->GetColor(r, g, b);
+ QString colorStr = QString::number( r ); colorStr += gDigitsSep;
+ colorStr += QString::number( g ); colorStr += gDigitsSep;
+ colorStr += QString::number( b );
+ param = vtkParam + "Color";
+ ip.setParameter( entry, param, colorStr.latin1() );
+ param = vtkParam + "LineWidth";
+ ip.setParameter( entry, param, QString::number( vActor->GetLineWidth() ).latin1() );
+ if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
+ param = vtkParam + "ShrinkMode";
+ ip.setParameter( entry, param, "On" );
+ param = vtkParam + "ShrinkFactor";
+ ip.setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).latin1() );
+ }
+ VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor );
+ if ( scalarMapActor && scalarMapActor->IsShading() ) {
+ param = vtkParam + "Shading";
+ ip.setParameter( entry, param, "On" );
+ }
+ if ( const VISU::Prs3d_i* vPrs = vActor->GetPrs3d() ) {
+ param = vtkParam + "ClippingPlane_";
+ for ( int p = 0, nPlanes = vPrs->GetNumberOfClippingPlanes(); p < nPlanes; p++ ) {
+ vtkPlane* plane = vPrs->GetClippingPlane( p );
+ float normal[3], origin[3];
+ plane->GetNormal( normal );
+ plane->GetOrigin( origin );
+ std::string planeValue = QString::number( normal[0] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( normal[1] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( normal[2] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[0] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[1] ).latin1(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[2] ).latin1();
+ param += QString::number( p+1 ).latin1();
+ ip.setParameter( entry, param, planeValue );
+ }
+ }
+
+ } // hasIO
+ } // salome_actor successfull downcast
+ } // isVisible
+ } // end of ..while.. actors traversal
+ } // if ( vtkView )
+ } // for ( views )
+ (*viewsCounter)++;
+ } // if ( SVTK view model )
+ else if ( vType == SPlot2d_Viewer::Type() ) { // processing Plot2d viewers
+ QPtrVector<SUIT_ViewWindow> views = vman->getViews();
+ for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) {
+ if ( Plot2d_ViewWindow* plotView = dynamic_cast<Plot2d_ViewWindow*>( views[i] ) ) {
+ Plot2d_ViewFrame* plotVF = plotView->getViewFrame();
+ QPtrList<Plot2d_Curve> curves;
+ plotVF->getCurves( curves );
+
+ Plot2d_Curve* curve;
+ for ( curve = curves.first(); curve; curve = curves.next() ) {
+ if ( SPlot2d_Curve* sCurve = dynamic_cast<SPlot2d_Curve*>( curve ) ) {
+ if ( sCurve->hasIO() ) {
+
+ Handle(SALOME_InteractiveObject) io = sCurve->getIO();
+ // entry is "ecoded" = it does NOT contain component adress, since it is a
+ // subject to change on next component loading
+ std::string entry = ip.encodeEntry( io->getEntry(), componentName );
+
+ std::string param, plotParam = vType.latin1(); plotParam += gSeparator;
+ plotParam += QString::number( *viewsCounter ).latin1(); plotParam += gSeparator;
+
+ param = plotParam + "Visibility";
+ ip.setParameter( entry, param, "On" );
+ }
+ }
+ } // for curves
+ } // if ( plotView )
+ } // for ( views )
+ (*viewsCounter)++;
+ } // if ( SPlot2d view model )
+ }
+}
+
+// returns VISU_Actor with IO with given entry
+VISU_Actor* getActor( const QString& entry, SVTK_ViewWindow* vtkView )
+{
+ if ( vtkView && !entry.isEmpty() ) {
+ vtkActorCollection* allActors = vtkView->getRenderer()->GetActors();
+ allActors->InitTraversal();
+ while ( vtkActor* actor = allActors->GetNextActor() ) {
+ if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) {
+ if ( vActor->hasIO() ) { // actor corresponds to existing obj
+ Handle(SALOME_InteractiveObject) io = vActor->getIO();
+ if ( entry == io->getEntry() )
+ return vActor;
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+const int ViewerType = 0;
+const int ViewIndex = 1;
+const int ParamName = 2;
+// visual parameters are stored in strings as follows:
+// ViewerType_ViewNumber_ParamName. '_' is used as separator and should not be used in
+// viewer type or parameter names
+
+// return viewer type substring from parameter name
+std::string getParam( const std::string& paramName, const int index )
+{
+ QStringList lst = QStringList::split( gSeparator, QString( paramName.c_str() ) );
+ if ( !lst.isEmpty() && index < lst.size() )
+ return lst[index];
+ return "";
+}
+
+
+/*!
+ * \brief Virtual public
+ *
+ * This method is called after the study document is opened, so the module has a possibility to restore
+ * visual parameters
+ */
+void VisuGUI_Module::restoreVisualParameters(int savePoint)
+{
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+ if( !study || !study->studyDS() )
+ return;
+ _PTR(Study) studyDS = study->studyDS();
+ _PTR(AttributeParameter) ap = studyDS->GetModuleParameters("Interface Applicative", moduleName().latin1(), savePoint);
+ SALOMEDS_IParameters ip(ap);
+
+ // actors are stored in a map after displaying of them for quicker access in future
+ QMap<QString, QMap<QString, VISU_Actor*> > vtkActors; // map: entry to map: ViewType_<ID> to actor (SVTK/VVTK)
+
+ std::vector<std::string> entries = ip.getEntries();
+
+ for ( std::vector<std::string>::iterator entIt = entries.begin(); entIt != entries.end(); ++entIt ) {
+
+ std::vector<std::string> paramNames = ip.getAllParameterNames( *entIt );
+ std::vector<std::string> paramValues = ip.getAllParameterValues( *entIt );
+ std::vector<std::string>::iterator namesIt = paramNames.begin();
+ std::vector<std::string>::iterator valuesIt = paramValues.begin();
+
+ if ( *entIt == "GaussViewer" ) {
+ // parameter names are view window's captions, values - visual parameters.
+ for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) {
+ SUIT_ViewManager* vman = onCreateViewManager();
+ SUIT_ViewWindow* vwin = vman->getActiveView();
+ vwin->setCaption( (*namesIt).c_str() );
+
+ // wait untill the window is really shown. This step fixes MANY bugs..
+ while ( !vwin->isVisible() )
+ qApp->processEvents();
+
+ vwin->setVisualParameters( (*valuesIt).c_str() );
+ }
+ continue; // skip to next entry
+ }
+
+ // entry is a normal entry - it should be "decoded" (setting base adress of component)
+ QString entry( ip.decodeEntry( *entIt ).c_str() );
+
+ for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) {
+ std::string viewerType = ::getParam( *namesIt, ViewerType );
+
+ std::string paramName = ::getParam( *namesIt, ParamName );
+ bool ok;
+ std::string viewIndexStr = ::getParam( *namesIt, ViewIndex );
+ int viewIndex = QString( viewIndexStr.c_str() ).toUInt( &ok );
+ if ( !ok ) // bad conversion of view index to integer
+ continue;
+
+ // cout << " -- " << viewerType << ": entry = " << entry.latin1() << ", paramName = " << paramName << endl;
+
+ if ( viewerType == SVTK_Viewer::Type().latin1() ||
+ viewerType == VVTK_Viewer::Type().latin1() ) {
+
+ // used as inner map key for locating the actor.
+ QString viewerTypeIndex = viewerType + QString::number( viewIndex );
+
+ if ( paramName == "Visibility" && displayer() ) {
+ // if VVTK, then we must create viewer first, because
+
+ QPtrList<SUIT_ViewManager> lst;
+ getApp()->viewManagers( viewerType, lst );
+
+ // SVTK/VVTK ViewManager always has 1 ViewWindow, so view index is index of view manager
+ if ( viewIndex >= 0 && viewIndex < lst.count() ) {
+ SUIT_ViewManager* vman = lst.at( viewIndex );
+ SUIT_ViewModel* vmodel = vman->getViewModel();
+ // SVTK and VVTK view models can be casted to SALOME_View
+ displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
+ SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
+ // vtkView->getRenderer()->ResetCameraClippingRange();
+ // vtkView->Repaint();
+
+ // store displayed actor so setting of color, opacity, etc. will be much faster
+ QMap<QString, VISU_Actor*> viewActorMap;
+ if ( vtkActors.contains( entry ) )
+ viewActorMap = vtkActors[ entry ];
+ viewActorMap[ viewerTypeIndex ] = getActor( entry, vtkView );
+ vtkActors[ entry ] = viewActorMap;
+ }
+ }
+ else { // the rest properties "work" with VISU_Actor, so we initialize it at first
+ VISU_Actor* vActor = 0;
+ if ( vtkActors.contains( entry ) ) {
+ QMap<QString, VISU_Actor*> viewActorMap = vtkActors[ entry ];
+ if ( viewActorMap.contains( viewerTypeIndex ) )
+ vActor = viewActorMap[ viewerTypeIndex ];
+ }
+ if ( !vActor )
+ continue;
+
+ QString val( (*valuesIt).c_str() );
+
+ if ( paramName == "Name" )
+ vActor->setName( val.latin1() );
+
+ else if ( paramName == "RepresentationMode" )
+ vActor->SetRepresentation( val.toInt() );
+
+ else if ( paramName == "Opacity" )
+ vActor->SetOpacity( val.toFloat() );
+
+ else if ( paramName == "Color" ) {
+ QStringList colors = QStringList::split( gDigitsSep, val );
+ if ( colors.count() == 3 )
+ vActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() );
+ }
+
+ else if ( paramName == "LineWidth" )
+ vActor->SetLineWidth( val.toFloat() );
+
+ else if ( paramName == "ShrinkMode" ) {
+ vActor->SetShrinkable( true );
+ vActor->SetShrink();
+ }
+
+ else if ( paramName == "ShrunkFactor" )
+ vActor->SetShrinkFactor( val.toFloat() );
+
+ else if ( paramName == "Shading" ) {
+ if ( VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor ) )
+ scalarMapActor->SetShading();
+ }
+
+ else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) {
+ QStringList vals = QStringList::split( gDigitsSep, val );
+ if ( vals.count() == 6 && vActor->GetPrs3d() ) {
+ float normal[3], origin[3];
+ for (int x = 0; x < 3; x++ ) {
+ normal[x] = vals[x].toFloat();
+ origin[x] = vals[x+3].toFloat();
+ }
+ vtkPlane* plane = vtkPlane::New();
+ plane->SetNormal( normal );
+ plane->SetOrigin( origin );
+ vActor->GetPrs3d()->AddClippingPlane( plane );
+ }
+ }
+ } // else ..
+ } // if SVTK
+
+ else if ( viewerType == SPlot2d_Viewer::Type().latin1() ) {
+
+ if ( paramName == "Visibility" && displayer() ) {
+ QPtrList<SUIT_ViewManager> lst;
+ getApp()->viewManagers( viewerType, lst );
+
+ if ( viewIndex >= 0 && viewIndex < lst.count() ) {
+ SUIT_ViewManager* vman = lst.at( viewIndex );
+ SUIT_ViewModel* vmodel = vman->getViewModel();
+ // SVTK and VVTK view models can be casted to SALOME_View
+ displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
+ }
+ }
+
+ } // if SPlot2d
+
+ } // for names/parameters iterator
+ } // for entries iterator
+
+ // [ update all SVTK/VVTK views
+ QPtrList<SUIT_ViewManager> lst;
+ getApp()->viewManagers( lst );
+ for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it ) {
+ SUIT_ViewManager* vman = it.current();
+ SUIT_ViewModel* vmodel = vman->getViewModel();
+ if ( !vmodel )
+ continue;
+ if ( vmodel->getType() == SVTK_Viewer::Type() || // processing SVTK and VVTK viewers
+ vmodel->getType() == VVTK_Viewer::Type() ) { // in the same way
+ SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
+ vtkView->getRenderer()->ResetCameraClippingRange();
+ vtkView->Repaint();
+ }
+ else if ( vmodel->getType() == SPlot2d_Viewer::Type().latin1() ) {
+ Plot2d_ViewWindow* plotView = (Plot2d_ViewWindow*) vman->getActiveView();
+ plotView->getViewFrame()->Repaint();
+ }
+ } // ] end of update views
+
+ // VISU module opens one SVTK viewer in activateModule(). This causes a bug in save-restore visual
+ // parameters: it no SVTK view was saved, we need NOT any SVTK on restore. Here we close one
+ // default SVTK if needed.
+ /*
+ QString openedSvtkViewerStr = ip.getProperty( "VtkViewersCount" ).c_str();
+ int openedSvtkViewer = openedSvtkViewerStr.toInt( &ok );
+ if ( ok && openedSvtkViewer == 0 ) {
+ lst.clear();
+ getApp()->viewManagers( SVTK_Viewer::Type(), lst );
+ if ( lst.count() )
+ lst.at( 0 )->closeAllViews();
+ }
+ */
+
+ // if active Gauss Viewer is set ( != -1) then raise the gauss view window.
+ bool ok;
+ QString activeGaussViewerStr = ip.getProperty( "ActiveGaussViewer" ).c_str();
+ int activeGaussViewer = activeGaussViewerStr.toInt( &ok );
+ if ( ok && activeGaussViewer != -1 ) {
+ lst.clear();
+ getApp()->viewManagers( VVTK_Viewer::Type(), lst );
+ if ( activeGaussViewer >= 0 && activeGaussViewer < lst.count() ) {
+ SUIT_ViewWindow* activeView = lst.at( activeGaussViewer )->getActiveView();
+ if ( activeView ) {
+ activeView->setActiveWindow();
+ activeView->setFocus();
+ }
+ }
+ }
+}
+