-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_Module.cxx
// Author : Laurent CORNABE
#include "SVTK_RenderWindowInteractor.h"
#include "VISU_Event.h"
+#include "VTKViewer_Algorithm.h"
+
#include "VisuGUI_Prs3dTools.h"
#include "VisuGUI_ClippingDlg.h"
#include "VISU_Gen_i.hh"
#include "VISU_Result_i.hh"
-#include "VISU_CutLines_i.hh"
+#include "VISU_CutLinesBase_i.hh"
#include "VISU_Actor.h"
#include "VISU_ScalarMapAct.h"
#define GAUSS_DISPLAY_PRS 5500
#define GAUSS_DISPLAY_ONLY_PRS 5600
-#define GAUSS_SAVE_CONFIGURATION 5700
-#define GAUSS_OVERWRITE_CONFIGURATION 5701
-#define GAUSS_RESTORE_CONFIGURATION 5702
-#define GAUSS_RENAME_CONFIGURATION 5703
+//#define GAUSS_SAVE_CONFIGURATION 5700
+//#define GAUSS_OVERWRITE_CONFIGURATION 5701
+//#define GAUSS_RESTORE_CONFIGURATION 5702
+//#define GAUSS_RENAME_CONFIGURATION 5703
using namespace std;
void
CreateCurves( SalomeApp_Module* theModule,
- VISU::CutLines_i* thePrs,
+ VISU::CutLinesBase_i* thePrs,
QDialog* theDlg,
const bool theCreate = true );
//---------------------------------------------------------------
typedef void (SUIT_ViewWindow::* TViewVisibility)();
void SetViewVisibility(SalomeApp_Application* app,
- TViewVisibility theViewVisibility)
+ TViewVisibility theViewVisibility)
{
ViewManagerList l;
//app->viewManagers( VVTK_Viewer::Type(), l );
for( ; anIt!=aLast; anIt++ )
if( SUIT_ViewManager* aViewManager = *anIt )
{
- QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- int aSize = aViews.size();
- for(int anId = 0; anId < aSize; anId++)
- {
- if(SUIT_ViewWindow* aView = aViews[anId])
- (aView->* theViewVisibility)();
- }
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ int aSize = aViews.size();
+ for(int anId = 0; anId < aSize; anId++)
+ {
+ if(SUIT_ViewWindow* aView = aViews[anId])
+ (aView->* theViewVisibility)();
+ }
}
}
}
//---------------------------------------------------------------
VisuGUI_Module::VisuGUI_Module() :
- VisuGUI()
+ VisuGUI(),
+ LightApp_Module("VISU")
{
}
// "Save VISU State" command is moved from SalomeApp_Applicaiton
createAction( SAVE_VISU_STATE, tr( "TOT_DESK_FILE_SAVE_GUI_STATE" ), QIcon(),
- tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ),
- 0, getApp()->desktop(), false, getApp(), SLOT( onSaveGUIState() ) );
+ tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ),
+ 0, getApp()->desktop(), false, getApp(), SLOT( onSaveGUIState() ) );
int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
createMenu( SAVE_VISU_STATE, fileMenu, 9, -1 );
QPixmap aPixmap;
/* aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_NEW_VIEWER"));
createAction( GAUSS_NEW_VIEWER,
- tr("MEN_GAUSS_NEW_VIEWER"),
- aPixmap,
+ tr("MEN_GAUSS_NEW_VIEWER"),
+ aPixmap,
tr("MEN_GAUSS_NEW_VIEWER"),
- tr("MEN_GAUSS_NEW_VIEWER"),
- Qt::ALT+Qt::Key_S,
- this,
- false,
+ tr("MEN_GAUSS_NEW_VIEWER"),
+ Qt::ALT+Qt::Key_S,
+ this,
+ false,
this,
- SLOT(onCreateViewManager()));
+ SLOT(onCreateViewManager()));
int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 );
int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
createMenu( action( GAUSS_NEW_VIEWER ), newWinMenu, -1 );
this, SLOT(OnCreateGaussPoints()));
mgr->insert( action( GAUSS_CREATE_PRS ), -1, 0, -1 );
mgr->setRule( action( GAUSS_CREATE_PRS ),
- "client='ObjectBrowser' and selcount=1 "
- "and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'} "
- "and $medEntity in {'EDGE_ENTITY' 'FACE_ENTITY' 'CELL_ENTITY'} "
- "and $medSource in {'eImportFile' 'eCopyAndImportFile'}" );
+ "client='ObjectBrowser' and selcount=1 "
+ "and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'} "
+ "and $medEntity in {'EDGE_ENTITY' 'FACE_ENTITY' 'CELL_ENTITY'} "
+ "and $medSource in {'eImportFile' 'eCopyAndImportFile'}" );
createMenu( action( GAUSS_CREATE_PRS ), createMenu( tr( "MEN_VISUALISATION" ), -1 ), -1 );
createTool( GAUSS_CREATE_PRS, createTool( tr( "TOOL_VISUALISATION" ) ), -1 );
- createAction( GAUSS_RENAME, VisuGUI::tr("MEN_RENAME"), QIcon(),
+ /*
+ createAction( GAUSS_RENAME, VisuGUI::tr("MEN_RENAME"), QIcon(),
VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
this, SLOT(OnRename()));
- mgr->insert( action( GAUSS_RENAME ), -1, 0, -1 );
- mgr->setRule( action( GAUSS_RENAME ),
- "selcount=1 and type='VISU::TGAUSSPOINTS'" );
-
+ mgr->insert( action( GAUSS_RENAME ), -1, 0, -1 );
+ mgr->setRule( action( GAUSS_RENAME ),
+ "selcount=1 and type='VISU::TGAUSSPOINTS'" );
+ */
+
createAction( GAUSS_EDIT_PRS, VisuGUI::tr("MEN_EDIT_PRS"), QIcon(),
VisuGUI::tr("MEN_EDIT_PRS"), "", 0, this, false,
this, SLOT(OnEditGaussPoints()));
"selcount=1 and type='VISU::TGAUSSPOINTS'" );
action( GAUSS_COPY_PRS )->setEnabled(false);
-
+
QStringList viewers;
#ifndef DISABLE_OCCVIEWER
aRule = "(selcount>0 and type='VISU::TGAUSSPOINTS')";
- createAction( GAUSS_ERASE_PRS, VisuGUI::tr("MEN_HIDE"), QIcon(),
+/* createAction( GAUSS_ERASE_PRS, VisuGUI::tr("MEN_HIDE"), QIcon(),
VisuGUI::tr("MEN_HIDE"), "", 0, this, false,
this, SLOT(OnErasePrs()));
mgr->insert( action( GAUSS_ERASE_PRS ), -1, -1, -1 ); // erase
this, SLOT(OnDisplayOnlyPrs()));
mgr->insert( action( GAUSS_DISPLAY_ONLY_PRS ), -1, -1, -1 ); // display only
mgr->setRule( action( GAUSS_DISPLAY_ONLY_PRS ),
- aRule + " and ({true} in $canBeDisplayed)" );
-
+ aRule + " and ({true} in $canBeDisplayed)" );*/
+/*
createAction( GAUSS_RENAME_CONFIGURATION, VisuGUI::tr("MEN_RENAME"), QIcon(),
- VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
+ VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
this, SLOT(OnRename()));
mgr->insert( action( GAUSS_RENAME_CONFIGURATION ), -1, -1, -1 );
mgr->setRule( action( GAUSS_RENAME_CONFIGURATION ), "selcount=1 and type='VISU::TGAUSSVIEW'" );
mgr->insert( action( GAUSS_RESTORE_CONFIGURATION ), -1, -1, -1 );
mgr->setRule( action( GAUSS_RESTORE_CONFIGURATION ),
"selcount=1 and type='VISU::TGAUSSVIEW'" );
+*/
}
// //---------------------------------------------------------------
// aViewer->setBackgroundColor( aResourceMgr->colorValue( "VTKViewer", "background", aViewer->backgroundColor() ) );
// aViewer->setProjectionMode( aResourceMgr->integerValue( "VTKViewer", "projection_mode", aViewer->projectionMode() ) );
// aViewer->setTrihedronSize( aResourceMgr->integerValue( "VTKViewer", "trihedron_size", aViewer->trihedronSize() ),
-// aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) );
+// aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) );
// aViewer->setIncrementalSpeed( aResourceMgr->integerValue( "VTKViewer", "speed_value", aViewer->incrementalSpeed() ),
-// aResourceMgr->integerValue( "VTKViewer", "speed_mode", aViewer->incrementalSpeedMode() ) );
+// aResourceMgr->integerValue( "VTKViewer", "speed_mode", aViewer->incrementalSpeedMode() ) );
// aViewer->setInteractionStyle( aResourceMgr->integerValue( "VTKViewer", "navigation_mode", aViewer->interactionStyle() ) );
// aViewer->setSpacemouseButtons( aResourceMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", aViewer->spacemouseBtn(1) ),
-// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", aViewer->spacemouseBtn(1) ),
-// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", aViewer->spacemouseBtn(1) ) );
+// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", aViewer->spacemouseBtn(1) ),
+// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", aViewer->spacemouseBtn(1) ) );
// new LightApp_VTKSelector( aViewer, anApp->selectionMgr() );
VisuGUI::createPreferences();
createGaussPointsPreferences();
- createInsideCursorPreferences();
- createOutsideCursorPreferences();
+ //createInsideCursorPreferences();
+ //createOutsideCursorPreferences();
createPickingPreferences();
// createSpaceMousePreferences();
//createRecorderPreferences();
setPreferenceProperty( primitiveGr, "columns", 2 );
int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
- LightApp_Preferences::Selector, "VISU",
+ LightApp_Preferences::Selector, "VISU",
"point_sprite_primitive_type" );
QStringList values;
setPreferenceProperty( primitiveTypePref, "indexes", indices );
int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "point_sprite_clamp" );
+ LightApp_Preferences::IntSpin, "VISU", "point_sprite_clamp" );
setPreferenceProperty( clampPref, "min", 1 );
setPreferenceProperty( clampPref, "max", 512 );
addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "point_sprite_main_texture" );
+ LightApp_Preferences::File, "VISU", "point_sprite_main_texture" );
addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "point_sprite_alpha_texture" );
+ LightApp_Preferences::File, "VISU", "point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU",
+ LightApp_Preferences::DblSpin, "VISU",
"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", "geom_sphere_resolution" );
+ LightApp_Preferences::IntSpin, "VISU", "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", "geom_sphere_face_limit" );
+ LightApp_Preferences::IntSpin, "VISU", "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", "point_sprite_min_size" );
+ LightApp_Preferences::IntSpin, "VISU", "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", "point_sprite_max_size" );
+ LightApp_Preferences::IntSpin, "VISU", "point_sprite_max_size" );
setPreferenceProperty( maxSizePref, "min", 1 );
setPreferenceProperty( maxSizePref, "max", 100 );
int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU",
+ LightApp_Preferences::IntSpin, "VISU",
"point_sprite_magnification" );
setPreferenceProperty( magnificationPref, "min", 10 );
setPreferenceProperty( magnificationPref, "max", 1000 );
int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), sizeGr,
- LightApp_Preferences::DblSpin, "VISU", "point_sprite_increment" );
+ LightApp_Preferences::DblSpin, "VISU", "point_sprite_increment" );
setPreferenceProperty( incrementPref, "min", 0.01 );
setPreferenceProperty( incrementPref, "max", 10 );
setPreferenceProperty( incrementPref, "step", 0.1 );
setPreferenceProperty( geomGr, "columns", 2 );
int sizePref = addPreference( tr( "VISU_GAUSS_PREF_SIZE" ), geomGr,
- LightApp_Preferences::IntSpin, "VISU", "point_sprite_size" );
+ LightApp_Preferences::IntSpin, "VISU", "point_sprite_size" );
setPreferenceProperty( sizePref, "min", 1 );
setPreferenceProperty( sizePref, "max", 100 );
addPreference( tr( "VISU_GAUSS_PREF_COLOR" ), geomGr,
- LightApp_Preferences::Color, "VISU", "point_sprite_color" );
+ LightApp_Preferences::Color, "VISU", "point_sprite_color" );
// ScalarBar Preferences
int scalarBarGr = addPreference( tr( "VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL" ), gaussTab );
setPreferenceProperty( scalarBarGr, "columns", 2 );
int activeBarPref = addPreference( tr( "VISU_GAUSS_PREF_ACTIVE_BAR" ), scalarBarGr,
- LightApp_Preferences::Selector, "VISU", "scalar_bar_active_local" );
+ LightApp_Preferences::Selector, "VISU", "scalar_bar_active_local" );
values.clear();
values.append( tr( "VISU_GAUSS_PREF_LOCAL" ) );
setPreferenceProperty( activeBarPref, "indexes", indices );
addPreference( tr( "VISU_GAUSS_PREF_DISPLAY_GLOBAL" ), scalarBarGr,
- LightApp_Preferences::Bool, "VISU", "scalar_bar_display_global" );
+ LightApp_Preferences::Bool, "VISU", "scalar_bar_display_global" );
int colorPref = addPreference( tr( "VISU_GAUSS_PREF_SCALAR_BAR_MODE" ), scalarBarGr,
- LightApp_Preferences::Selector, "VISU", "scalar_bar_bicolor" );
+ LightApp_Preferences::Selector, "VISU", "scalar_bar_bicolor" );
values.clear();
values.append( tr( "VISU_GAUSS_PREF_BICOLOR" ) );
setPreferenceProperty( colorPref, "indexes", indices );
int spacingPref = addPreference( tr( "VISU_GAUSS_PREF_SPACING" ), scalarBarGr,
- LightApp_Preferences::DblSpin, "VISU", "scalar_bar_spacing" );
+ LightApp_Preferences::DblSpin, "VISU", "scalar_bar_spacing" );
setPreferenceProperty( spacingPref, "min", 0.01 );
setPreferenceProperty( spacingPref, "max", 1.0 );
setPreferenceProperty( spacingPref, "step", 0.01 );
setPreferenceProperty( primitiveTypePref, "indexes", indices );
int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_clamp" );
+ LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_clamp" );
setPreferenceProperty( clampPref, "min", 1 );
setPreferenceProperty( clampPref, "max", 512 );
addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "inside_point_sprite_main_texture" );
+ LightApp_Preferences::File, "VISU", "inside_point_sprite_main_texture" );
addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" );
+ LightApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU",
+ 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",
+ 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",
+ LightApp_Preferences::IntSpin, "VISU",
"inside_geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
setPreferenceProperty( sizeGr, "columns", 4 );
int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU",
+ 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",
+ LightApp_Preferences::IntSpin, "VISU",
"inside_point_sprite_max_size" );
setPreferenceProperty( maxSizePref, "min", 1 );
setPreferenceProperty( maxSizePref, "max", 100 );
setPreferenceProperty( magnificationGr, "columns", 4 );
int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), magnificationGr,
- LightApp_Preferences::IntSpin, "VISU",
+ 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",
+ LightApp_Preferences::DblSpin, "VISU",
"inside_point_sprite_increment" );
setPreferenceProperty( incrementPref, "min", 0.01 );
setPreferenceProperty( incrementPref, "max", 10 );
setPreferenceProperty( primitiveTypePref, "indexes", indices );
int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_clamp" );
+ LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_clamp" );
setPreferenceProperty( clampPref, "min", 1 );
setPreferenceProperty( clampPref, "max", 512 );
addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "outside_point_sprite_main_texture" );
+ LightApp_Preferences::File, "VISU", "outside_point_sprite_main_texture" );
addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" );
+ LightApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU",
+ 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",
+ 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",
+ LightApp_Preferences::IntSpin, "VISU",
"outside_geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
setPreferenceProperty( sizeGr, "columns", 2 );
int sizePref = addPreference( tr( "VISU_GAUSS_PREF_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_size" );
+ LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_size" );
setPreferenceProperty( sizePref, "min", 1 );
setPreferenceProperty( sizePref, "max", 100 );
setPreferenceProperty( colorGr, "columns", 2 );
addPreference( tr( "VISU_GAUSS_PREF_UNIFORM_COLOR" ), colorGr,
- LightApp_Preferences::Bool, "VISU", "outside_point_sprite_uniform" );
+ LightApp_Preferences::Bool, "VISU", "outside_point_sprite_uniform" );
addPreference( tr( "VISU_GAUSS_PREF_COLOR" ), colorGr,
- LightApp_Preferences::Color, "VISU", "outside_point_sprite_color" );
+ LightApp_Preferences::Color, "VISU", "outside_point_sprite_color" );
}
setPreferenceProperty( cursorSizePref, "step", 0.1 );
int pyramidHeightPref = addPreference( tr( "VISU_PICKING_PREF_PYRAMID_HEIGHT" ), cursorGr,
- LightApp_Preferences::DblSpin, "VISU", "picking_pyramid_height" );
+ LightApp_Preferences::DblSpin, "VISU", "picking_pyramid_height" );
setPreferenceProperty( pyramidHeightPref, "min", 1 );
setPreferenceProperty( pyramidHeightPref, "max", 100 );
setPreferenceProperty( infoWindowGr, "columns", 2 );
int infoWindowPref = addPreference( tr( "VISU_PICKING_PREF_INFO_WINDOW" ), infoWindowGr,
- LightApp_Preferences::Bool, "VISU", "picking_info_window" );
+ LightApp_Preferences::Bool, "VISU", "picking_info_window" );
setPreferenceProperty( infoWindowPref, "columns", 2 );
int transparencyPref = addPreference( tr( "VISU_PICKING_PREF_TRANSPARENCY" ), infoWindowGr,
- LightApp_Preferences::IntSpin, "VISU", "picking_transparency" );
+ LightApp_Preferences::IntSpin, "VISU", "picking_transparency" );
setPreferenceProperty( transparencyPref, "min", 0 );
setPreferenceProperty( transparencyPref, "max", 100 );
setPreferenceProperty( transparencyPref, "step", 10 );
int positionPref = addPreference( tr( "VISU_PICKING_PREF_POSITION" ), infoWindowGr,
- LightApp_Preferences::Selector, "VISU", "picking_position" );
+ LightApp_Preferences::Selector, "VISU", "picking_position" );
QStringList values;
values.append( tr( "VISU_PICKING_PREF_BELOW_POINT" ) );
values.append( tr( "VISU_PICKING_PREF_TOP_LEFT_CORNER" ) );
setPreferenceProperty( cameraGr, "columns", 2 );
int cameraPref = addPreference( tr( "VISU_PICKING_PREF_CAMERA_MOVEMENT" ), cameraGr,
- LightApp_Preferences::Bool, "VISU", "picking_camera_movement" );
+ LightApp_Preferences::Bool, "VISU", "picking_camera_movement" );
setPreferenceProperty( cameraPref, "columns", 2 );
int zoomFactorPref = addPreference( tr( "VISU_PICKING_PREF_ZOOM_FACTOR" ), cameraGr,
- LightApp_Preferences::DblSpin, "VISU", "picking_zoom_factor" );
+ LightApp_Preferences::DblSpin, "VISU", "picking_zoom_factor" );
setPreferenceProperty( zoomFactorPref, "min", 0.1 );
setPreferenceProperty( zoomFactorPref, "max", 10.0 );
setPreferenceProperty( zoomFactorPref, "step", 0.1 );
int stepNumberPref = addPreference( tr( "VISU_PICKING_PREF_STEP_NUMBER" ), cameraGr,
- LightApp_Preferences::IntSpin, "VISU", "picking_step_number" );
+ LightApp_Preferences::IntSpin, "VISU", "picking_step_number" );
setPreferenceProperty( stepNumberPref, "min", 1 );
setPreferenceProperty( stepNumberPref, "max", 100 );
setPreferenceProperty( parentMeshGr, "columns", 1 );
addPreference( tr( "VISU_PICKING_PREF_DISPLAY_PARENT_MESH" ), parentMeshGr,
- LightApp_Preferences::Bool, "VISU", "picking_display_parent_mesh" );
+ LightApp_Preferences::Bool, "VISU", "picking_display_parent_mesh" );
}
setPreferenceProperty( recorderGr, "columns", 2 );
int modePref = addPreference( tr( "VISU_RECORDER_PREF_RECORDING_MODE" ), recorderGr,
- LightApp_Preferences::Selector, "VISU", "recorder_mode" );
+ LightApp_Preferences::Selector, "VISU", "recorder_mode" );
QStringList values;
values.append( tr( "VISU_RECORDER_PREF_SKIPPED_FRAMES" ) );
values.append( tr( "VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES" ) );
setPreferenceProperty( modePref, "indexes", indices );
int fpsPref = addPreference( tr( "VISU_RECORDER_PREF_FPS" ), recorderGr,
- LightApp_Preferences::DblSpin, "VISU", "recorder_fps" );
+ LightApp_Preferences::DblSpin, "VISU", "recorder_fps" );
setPreferenceProperty( fpsPref, "min", 0.1 );
setPreferenceProperty( fpsPref, "max", 100 );
int qualityPref = addPreference( tr( "VISU_RECORDER_PREF_QUALITY" ), recorderGr,
- LightApp_Preferences::IntSpin, "VISU", "recorder_quality" );
+ LightApp_Preferences::IntSpin, "VISU", "recorder_quality" );
setPreferenceProperty( qualityPref, "min", 1 );
setPreferenceProperty( qualityPref, "max", 100 );
addPreference( tr( "VISU_RECORDER_PREF_PROGRESSIVE" ), recorderGr,
- LightApp_Preferences::Bool, "VISU", "recorder_progressive" );
+ LightApp_Preferences::Bool, "VISU", "recorder_progressive" );
}
double initialTime = vtkTimerLog::GetCPUTime();
//CreatePrs3d<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg, 1>(this, VVTK_Viewer::Type());
Prs3d_i* aPrs = CreatePrs3d<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg, 1>(this, SVTK_Viewer::Type());
- if (aPrs)
- emit presentationCreated(aPrs);
+ processPresentationCreated(aPrs);
INFOS( "VisuGUI_Module::OnCreateGaussPoints() : Gauss Points created in " <<
- vtkTimerLog::GetCPUTime() - initialTime << " seconds" );
+ vtkTimerLog::GetCPUTime() - initialTime << " seconds" );
}
// void VisuGUI_Module::OnViewManagerAdded(SUIT_ViewManager* viewMgr)
VisuGUI::preferencesChanged(group,pref);
// if ( group == "VISU" && ( pref == "speed_increment" || pref == "spacemouse_func1_btn" ||
-// pref == "spacemouse_func2_btn" || pref == "spacemouse_func3_btn" ||
-// pref == "spacemouse_func4_btn" || pref == "spacemouse_func5_btn" ) ) {
+// pref == "spacemouse_func2_btn" || pref == "spacemouse_func3_btn" ||
+// pref == "spacemouse_func4_btn" || pref == "spacemouse_func5_btn" ) ) {
// // update properties of VVTK view windows
// SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false );
namespace
{
/* void GetViewParams(VVTK_MainWindow* theViewWindow,
- const char* theSuffix,
- std::ostringstream& theStr)
+ const char* theSuffix,
+ std::ostringstream& theStr)
{
vtkFloatingPointType aColor[3];
vtkRenderer* aRenderer = theViewWindow->getRenderer();
*/
//---------------------------------------------------------------
/* void SetViewParams(VVTK_MainWindow* theViewWindow,
- const char* theSuffix,
- const Storable::TRestoringMap& theMap)
+ const char* theSuffix,
+ const Storable::TRestoringMap& theMap)
{
vtkFloatingPointType aColor[3];
aColor[0] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".R").toDouble();
*/
//---------------------------------------------------------------
/* void GetViewParams(VVTK_MainWindow1* theViewWindow,
- std::ostringstream& theStr)
+ std::ostringstream& theStr)
{
GetViewParams(theViewWindow,"1",theStr);
if(aWidgetCtrl->GetEnabled()){
std::string aSegmentationMode;
if(aWidgetCtrl->IsPlanesActive()){
- VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
- vtkFloatingPointType anOrigin[3];
- aPlanesWidget->GetOrigin(anOrigin);
- Storable::DataToStream(theStr,"myCursorOrigin[0]",anOrigin[0]);
- Storable::DataToStream(theStr,"myCursorOrigin[1]",anOrigin[1]);
- Storable::DataToStream(theStr,"myCursorOrigin[2]",anOrigin[2]);
-
- vtkFloatingPointType aNormal[3];
- aPlanesWidget->GetNormal(aNormal);
- Storable::DataToStream(theStr,"myCursorNormal[0]",aNormal[0]);
- Storable::DataToStream(theStr,"myCursorNormal[1]",aNormal[1]);
- Storable::DataToStream(theStr,"myCursorNormal[2]",aNormal[2]);
-
- vtkFloatingPointType aDepth = aPlanesWidget->Distance();
- Storable::DataToStream(theStr,"myCursorDepth",aDepth);
-
- aSegmentationMode = "Planes";
+ VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
+ vtkFloatingPointType anOrigin[3];
+ aPlanesWidget->GetOrigin(anOrigin);
+ Storable::DataToStream(theStr,"myCursorOrigin[0]",anOrigin[0]);
+ Storable::DataToStream(theStr,"myCursorOrigin[1]",anOrigin[1]);
+ Storable::DataToStream(theStr,"myCursorOrigin[2]",anOrigin[2]);
+
+ vtkFloatingPointType aNormal[3];
+ aPlanesWidget->GetNormal(aNormal);
+ Storable::DataToStream(theStr,"myCursorNormal[0]",aNormal[0]);
+ Storable::DataToStream(theStr,"myCursorNormal[1]",aNormal[1]);
+ Storable::DataToStream(theStr,"myCursorNormal[2]",aNormal[2]);
+
+ vtkFloatingPointType aDepth = aPlanesWidget->Distance();
+ Storable::DataToStream(theStr,"myCursorDepth",aDepth);
+
+ aSegmentationMode = "Planes";
}else if(aWidgetCtrl->IsSphereActive()){
- VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
- vtkFloatingPointType aCenter[3];
- aSphereWidget->GetCenter(aCenter);
- Storable::DataToStream(theStr,"mySphereCursorCenter[0]",aCenter[0]);
- Storable::DataToStream(theStr,"mySphereCursorCenter[1]",aCenter[1]);
- Storable::DataToStream(theStr,"mySphereCursorCenter[2]",aCenter[2]);
+ VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
+ vtkFloatingPointType aCenter[3];
+ aSphereWidget->GetCenter(aCenter);
+ Storable::DataToStream(theStr,"mySphereCursorCenter[0]",aCenter[0]);
+ Storable::DataToStream(theStr,"mySphereCursorCenter[1]",aCenter[1]);
+ Storable::DataToStream(theStr,"mySphereCursorCenter[2]",aCenter[2]);
- vtkFloatingPointType aRadius = aSphereWidget->GetRadius();
- Storable::DataToStream(theStr,"mySphereCursorRaduis",aRadius);
+ vtkFloatingPointType aRadius = aSphereWidget->GetRadius();
+ Storable::DataToStream(theStr,"mySphereCursorRaduis",aRadius);
- aSegmentationMode = "Sphere";
+ aSegmentationMode = "Sphere";
}
Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode.c_str());
*/
//---------------------------------------------------------------
/*void SetViewParams(VVTK_MainWindow1* theViewWindow,
- const Storable::TRestoringMap& theMap)
+ const Storable::TRestoringMap& theMap)
{
SetViewParams(theViewWindow,"1",theMap);
}
*/
//---------------------------------------------------------------
/*void GetViewParams(VVTK_MainWindow2* theViewWindow,
- std::ostringstream& theStr)
+ std::ostringstream& theStr)
{
GetViewParams(theViewWindow,"2",theStr);
}
void SetViewParams(VVTK_MainWindow2* theViewWindow,
- const Storable::TRestoringMap& theMap)
+ const Storable::TRestoringMap& theMap)
{
SetViewParams(theViewWindow,"2",theMap);
}
void operator()(VISU_GaussPtsAct* theActor)
{
if(theActor->GetVisibility()){
- const Handle(SALOME_InteractiveObject)& anIO = theActor->getIO();
- myVisibleEntries.insert(TVisibleEntries::value_type(anIO->getEntry(),TSelection()));
+ const Handle(SALOME_InteractiveObject)& anIO = theActor->getIO();
+ myVisibleEntries.insert(TVisibleEntries::value_type(anIO->getEntry(),TSelection()));
}
}
};
/*void GetGaussPointsSelection(SVTK_ViewWindow* theViewWindow,
- TVisibleEntries& theVisibleEntries)
+ TVisibleEntries& theVisibleEntries)
{
// First find all visible Gauss Points presentations
vtkRenderer* aRenderer = theViewWindow->getRenderer();
vtkActorCollection* anActors = aRenderer->GetActors();
TGetVisibleEntries aGetVisibleEntries(theVisibleEntries);
SVTK::ForEach<VISU_GaussPtsAct>(anActors,
- aGetVisibleEntries);
+ aGetVisibleEntries);
// Next, find the sub-ids for the visible Gauss Points presentations
SVTK_Selector* aSelector = theViewWindow->GetSelector();
std::string anEntry = anIO->getEntry();
TVisibleEntries::iterator anEntriesIter = theVisibleEntries.find(anEntry);
if(anEntriesIter != theVisibleEntries.end()){
- TSelection& aSelection = anEntriesIter->second;
- aSelection.myIsSelected = true;
- TColStd_IndexedMapOfInteger anIndexes;
- aSelector->GetIndex(anIO,anIndexes);
- if(anIndexes.Extent() > 0){
- aSelection.myHasSubId = true;
- aSelection.mySubId = anIndexes(1);
- }
+ TSelection& aSelection = anEntriesIter->second;
+ aSelection.myIsSelected = true;
+ TColStd_IndexedMapOfInteger anIndexes;
+ aSelector->GetIndex(anIO,anIndexes);
+ if(anIndexes.Extent() > 0){
+ aSelection.myHasSubId = true;
+ aSelection.mySubId = anIndexes(1);
+ }
}
}
}
//---------------------------------------------------------------
inline void CreateReference(_PTR(Study) theStudyDocument,
- _PTR(StudyBuilder) theStudyBuilder,
- _PTR(SObject) theFatherSObject,
- const string& theRefEntry,
- const TSelection& theSelection)
+ _PTR(StudyBuilder) theStudyBuilder,
+ _PTR(SObject) theFatherSObject,
+ const string& theRefEntry,
+ const TSelection& theSelection)
{
_PTR(SObject) aNewObj = theStudyBuilder->NewObject(theFatherSObject);
_PTR(SObject) aRefSObj = theStudyDocument->FindObjectID(theRefEntry);
//---------------------------------------------------------------
/*void SetGaussPointsSelection(VisuGUI* theModule,
- SVTK_ViewWindow* theViewWindow,
- _PTR(Study) theCStudy,
- _PTR(SObject) theSObject)
+ SVTK_ViewWindow* theViewWindow,
+ _PTR(Study) theCStudy,
+ _PTR(SObject) theSObject)
{
SVTK_Selector* aSelector = theViewWindow->GetSelector();
aSelector->ClearIObjects();
_PTR(SObject) aChildSObject = aChildIter->Value();
_PTR(SObject) aSObject;
if(aChildSObject->ReferencedObject(aSObject)){
- CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
- PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
- if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in())){
- // To set visiblity
- VISU::UpdateViewer(theModule, aPrs3d, anIsFirst, false);
- anIsFirst = false;
-
- // To update selection
- Storable::TRestoringMap aMap = Storable::GetStorableMap(aChildSObject);
- if(!aMap.empty()){
- bool anIsSelected = aMap["myIsSelected"].toInt();
- bool aHasSubId = aMap["myHasSubId"].toInt();
- int aSubId = aMap["mySubId"].toInt();
-
- if(anIsSelected){
- std::string anEntry = aSObject->GetID();
- Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(anEntry.c_str(),"");
- aSelector->AddIObject(anIO);
- if(aHasSubId)
- aSelector->AddOrRemoveIndex(anIO,aSubId,false);
- }
- }
- }
+ CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
+ PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
+ if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in())){
+ // To set visiblity
+ VISU::UpdateViewer(theModule, aPrs3d, anIsFirst, false);
+ anIsFirst = false;
+
+ // To update selection
+ Storable::TRestoringMap aMap = Storable::GetStorableMap(aChildSObject);
+ if(!aMap.empty()){
+ bool anIsSelected = aMap["myIsSelected"].toInt();
+ bool aHasSubId = aMap["myHasSubId"].toInt();
+ int aSubId = aMap["mySubId"].toInt();
+
+ if(anIsSelected){
+ std::string anEntry = aSObject->GetID();
+ Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(anEntry.c_str(),"");
+ aSelector->AddIObject(anIO);
+ if(aHasSubId)
+ aSelector->AddOrRemoveIndex(anIO,aSubId,false);
+ }
+ }
+ }
}
}
//---------------------------------------------------------------
/*void OnStoreConfiguration(SalomeApp_Module* theModule,
- bool theIsNew)
+ bool theIsNew)
{
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
if (CheckLock(aCStudy,GetDesktop(theModule)))
std::string aValue = GetViewParams(aViewWindow);
if(theIsNew){
- _PTR(SComponent) aSComponent = ClientFindOrCreateVisuComponent(aCStudy);
-
- static int myNbConfigs = 0;
- std::string aName = VISU::GenerateName("Config.", ++myNbConfigs).toLatin1().data();
-
- std::string aSComponentEntry = aSComponent->GetID();
- anEntry = CreateAttributes(aCStudy,
- aSComponentEntry.c_str(),
- "",
- "",
- aName.c_str(),
- "",
- aValue.c_str());
+ _PTR(SComponent) aSComponent = ClientFindOrCreateVisuComponent(aCStudy);
+
+ static int myNbConfigs = 0;
+ std::string aName = VISU::GenerateName("Config.", ++myNbConfigs).toLatin1().data();
+
+ std::string aSComponentEntry = aSComponent->GetID();
+ anEntry = CreateAttributes(aCStudy,
+ aSComponentEntry.c_str(),
+ "",
+ "",
+ aName.c_str(),
+ "",
+ aValue.c_str());
}else{
- SALOME_ListIO aListIO;
- aSelectionMgr->selectedObjects(aListIO);
- SALOME_ListIteratorOfListIO aListIter( aListIO );
- for(; aListIter.More(); aListIter.Next()){
- Handle(SALOME_InteractiveObject) anIO = aListIter.Value();
- _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
- _PTR(GenericAttribute) anAttr;
- if(aSObject->FindAttribute(anAttr,"AttributeString")){
- _PTR(AttributeString) aComment(anAttr);
- std::string aCommentValue(aComment->Value());
- if(aCommentValue.compare("myComment=GAUSSVIEW") >= 0){
- aComment->SetValue(aValue.c_str());
- anEntry = aSObject->GetID();
-
- _PTR(ChildIterator) aChildIter = aCStudy->NewChildIterator(aSObject);
- for (; aChildIter->More(); aChildIter->Next()) {
- _PTR(SObject) aChildSObject = aChildIter->Value();
- aStudyBuilder->RemoveObject(aChildSObject);
- }
- break;
- }
- }
- }
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects(aListIO);
+ SALOME_ListIteratorOfListIO aListIter( aListIO );
+ for(; aListIter.More(); aListIter.Next()){
+ Handle(SALOME_InteractiveObject) anIO = aListIter.Value();
+ _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
+ _PTR(GenericAttribute) anAttr;
+ if(aSObject->FindAttribute(anAttr,"AttributeString")){
+ _PTR(AttributeString) aComment(anAttr);
+ std::string aCommentValue(aComment->Value());
+ if(aCommentValue.compare("myComment=GAUSSVIEW") >= 0){
+ aComment->SetValue(aValue.c_str());
+ anEntry = aSObject->GetID();
+
+ _PTR(ChildIterator) aChildIter = aCStudy->NewChildIterator(aSObject);
+ for (; aChildIter->More(); aChildIter->Next()) {
+ _PTR(SObject) aChildSObject = aChildIter->Value();
+ aStudyBuilder->RemoveObject(aChildSObject);
+ }
+ break;
+ }
+ }
+ }
}
if(anEntry != ""){
- TVisibleEntries aVisibleEntries;
- GetGaussPointsSelection(aViewWindow,
- aVisibleEntries);
-
- _PTR(SObject) aSObject = aCStudy->FindObjectID(anEntry);
- _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
- TVisibleEntries::const_iterator anIter = aVisibleEntries.begin();
- for(; anIter != aVisibleEntries.end(); anIter++){
- const std::string& anEntry = anIter->first;
- const TSelection& aSelection = anIter->second;
-
- CreateReference(aCStudy,
- aStudyBuilder,
- aSObject,
- anEntry,
- aSelection);
- }
-
- //UpdateObjBrowser(theModule,true,aSObject);
- UpdateObjBrowser(theModule,true);
+ TVisibleEntries aVisibleEntries;
+ GetGaussPointsSelection(aViewWindow,
+ aVisibleEntries);
+
+ _PTR(SObject) aSObject = aCStudy->FindObjectID(anEntry);
+ _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
+ TVisibleEntries::const_iterator anIter = aVisibleEntries.begin();
+ for(; anIter != aVisibleEntries.end(); anIter++){
+ const std::string& anEntry = anIter->first;
+ const TSelection& aSelection = anIter->second;
+
+ CreateReference(aCStudy,
+ aStudyBuilder,
+ aSObject,
+ anEntry,
+ aSelection);
+ }
+
+ //UpdateObjBrowser(theModule,true,aSObject);
+ UpdateObjBrowser(theModule,true);
}
}
}*/
//---------------------------------------------------------------
/* template<class TMainWindow>
void SetMainWindowParams(VisuGUI* theModule,
- _PTR(SObject) theSObject,
- VVTK_ViewWindow* theViewWindow,
- TMainWindow* theMainWindow)
+ _PTR(SObject) theSObject,
+ VVTK_ViewWindow* theViewWindow,
+ TMainWindow* theMainWindow)
{
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
std::string aSegmentationMode;
if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){
- aMainWindow->SetPlanesSegementation(false);
- aMainWindow->SetSphereSegementation(false);
- VISU_WidgetCtrl* aWidgetCtrl = aMainWindow->GetWidgetCtrl();
- aSegmentationMode = Storable::FindValue(aMap,"mySegmentationMode").toLatin1().data();
-
- if(aSegmentationMode == "Planes"){
- VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
- vtkFloatingPointType anOrigin[3];
- anOrigin[0] = Storable::FindValue(aMap,"myCursorOrigin[0]").toDouble();
- anOrigin[1] = Storable::FindValue(aMap,"myCursorOrigin[1]").toDouble();
- anOrigin[2] = Storable::FindValue(aMap,"myCursorOrigin[2]").toDouble();
- aPlanesWidget->SetOrigin(anOrigin);
-
- vtkFloatingPointType aNormal[3];
- aNormal[0] = Storable::FindValue(aMap,"myCursorNormal[0]").toDouble();
- aNormal[1] = Storable::FindValue(aMap,"myCursorNormal[1]").toDouble();
- aNormal[2] = Storable::FindValue(aMap,"myCursorNormal[2]").toDouble();
- aPlanesWidget->SetNormal(aNormal);
-
- vtkFloatingPointType aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble();
- aPlanesWidget->SetDistance(aDepth);
-
- aMainWindow->SetPlanesSegementation(true);
- }else if(aSegmentationMode == "Sphere"){
- VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
- vtkFloatingPointType aCenter[3];
- aCenter[0] = Storable::FindValue(aMap,"mySphereCursorCenter[0]").toDouble();
- aCenter[1] = Storable::FindValue(aMap,"mySphereCursorCenter[1]").toDouble();
- aCenter[2] = Storable::FindValue(aMap,"mySphereCursorCenter[2]").toDouble();
- aSphereWidget->SetCenter(aCenter);
-
- vtkFloatingPointType aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble();
- aSphereWidget->SetRadius(aRadius);
-
- aMainWindow->SetSphereSegementation(true);
- }
+ aMainWindow->SetPlanesSegementation(false);
+ aMainWindow->SetSphereSegementation(false);
+ VISU_WidgetCtrl* aWidgetCtrl = aMainWindow->GetWidgetCtrl();
+ aSegmentationMode = Storable::FindValue(aMap,"mySegmentationMode").toLatin1().data();
+
+ if(aSegmentationMode == "Planes"){
+ VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
+ vtkFloatingPointType anOrigin[3];
+ anOrigin[0] = Storable::FindValue(aMap,"myCursorOrigin[0]").toDouble();
+ anOrigin[1] = Storable::FindValue(aMap,"myCursorOrigin[1]").toDouble();
+ anOrigin[2] = Storable::FindValue(aMap,"myCursorOrigin[2]").toDouble();
+ aPlanesWidget->SetOrigin(anOrigin);
+
+ vtkFloatingPointType aNormal[3];
+ aNormal[0] = Storable::FindValue(aMap,"myCursorNormal[0]").toDouble();
+ aNormal[1] = Storable::FindValue(aMap,"myCursorNormal[1]").toDouble();
+ aNormal[2] = Storable::FindValue(aMap,"myCursorNormal[2]").toDouble();
+ aPlanesWidget->SetNormal(aNormal);
+
+ vtkFloatingPointType aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble();
+ aPlanesWidget->SetDistance(aDepth);
+
+ aMainWindow->SetPlanesSegementation(true);
+ }else if(aSegmentationMode == "Sphere"){
+ VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
+ vtkFloatingPointType aCenter[3];
+ aCenter[0] = Storable::FindValue(aMap,"mySphereCursorCenter[0]").toDouble();
+ aCenter[1] = Storable::FindValue(aMap,"mySphereCursorCenter[1]").toDouble();
+ aCenter[2] = Storable::FindValue(aMap,"mySphereCursorCenter[2]").toDouble();
+ aSphereWidget->SetCenter(aCenter);
+
+ vtkFloatingPointType aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble();
+ aSphereWidget->SetRadius(aRadius);
+
+ aMainWindow->SetSphereSegementation(true);
+ }
}
if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){
- SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
- if(anInteractor->isVisible()){
- SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
- }else
- anInteractor->installEventFilter(this);
+ SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+ if(anInteractor->isVisible()){
+ SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+ }else
+ anInteractor->installEventFilter(this);
}
if(aSegmentationMode != ""){
- if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){
- SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
- if(anInteractor->isVisible())
- SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
- else
- anInteractor->installEventFilter(this);
- }
+ if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){
+ SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+ if(anInteractor->isVisible())
+ SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+ else
+ anInteractor->installEventFilter(this);
+ }
}
SetGaussPointsSelection(this,aViewWindow,aCStudy,aSObject);
// SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
// VVTK_ViewWindow* aViewWindow = dynamic_cast<VVTK_ViewWindow*>(aWindow);
// if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){
-// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
-// if(theWatched == anInteractor){
-// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
-// anInteractor->removeEventFilter(this);
-// }
+// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+// if(theWatched == anInteractor){
+// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+// anInteractor->removeEventFilter(this);
+// }
// }
// if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){
-// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
-// if(theWatched == aMainWindow->GetInteractor()){
-// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
-// anInteractor->removeEventFilter(this);
-// }
+// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+// if(theWatched == aMainWindow->GetInteractor()){
+// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+// anInteractor->removeEventFilter(this);
+// }
// }
// }
// }
vwin->getVisualParameters().toLatin1().data() );
if ( application()->desktop()->activeWindow() == vwin )
- ip->setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).toLatin1().data() );
+ ip->setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).toLatin1().data() );
vvtkViewers++;
}
}
// 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)
+ vType == VVTK_Viewer::Type()*/ ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow)
QVector<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.toLatin1().data();
+ if ( SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>( views[i] ) ) {
+ VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors());
+ vtkActorCollection* allActors = aCopy.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.toLatin1().data();
vtkParam += gSeparator;
- vtkParam += QString::number( *viewsCounter ).toLatin1().data();
+ vtkParam += QString::number( *viewsCounter ).toLatin1().data();
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() ).toLatin1().data() );
- param = vtkParam + "Opacity";
- ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() );
- vtkFloatingPointType r, g, b;
- vActor->GetColor(r, g, b);
- QString colorStr = QString::number( r ); colorStr += gDigitsSep;
- colorStr += QString::number( g ); colorStr += gDigitsSep;
+ 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() ).toLatin1().data() );
+ param = vtkParam + "Quadratic2DRepresentation";
+ ip->setParameter( entry, param, QString::number( vActor->GetQuadratic2DRepresentation() ).toLatin1().data() );
+ param = vtkParam + "Opacity";
+ ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() );
+ vtkFloatingPointType 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.toLatin1().data() );
- param = vtkParam + "LineWidth";
- ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() );
- if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
- param = vtkParam + "ShrinkMode";
- ip->setParameter( entry, param, "On" );
- param = vtkParam + "ShrinkFactor";
- ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() );
- }
- 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";
- int nPlanes = vPrs->GetNumberOfClippingPlanes();
- if ( !nPlanes )
- ip->setParameter( entry, param, "Off" );
- for ( int p = 0; p < nPlanes; p++ ) {
- vtkPlane* plane = vPrs->GetClippingPlane( p );
- vtkFloatingPointType normal[3], origin[3];
- plane->GetNormal( normal );
- plane->GetOrigin( origin );
- std::string planeValue = QString::number( normal[0] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( normal[1] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( normal[2] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( origin[0] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( origin[1] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( origin[2] ).toLatin1().data();
- param = QString( "%1ClippingPlane_%2" ).arg( vtkParam.c_str() ).arg( p+1 ).toLatin1().data();
- ip->setParameter( entry, param, planeValue );
- }
- }
-
- } // hasIO
- } // salome_actor successfull downcast to the VISU_Actor
- else if ( VISU_PointMap3dActor* vActor = VISU_PointMap3dActor::SafeDownCast( actor ) ) { // PointMap3D
- 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.toLatin1().data();
+ param = vtkParam + "Color";
+ ip->setParameter( entry, param, colorStr.toLatin1().data() );
+ param = vtkParam + "LineWidth";
+ ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() );
+ if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
+ param = vtkParam + "ShrinkMode";
+ ip->setParameter( entry, param, "On" );
+ param = vtkParam + "ShrinkFactor";
+ ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() );
+ }
+ 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";
+ int nPlanes = vPrs->GetNumberOfClippingPlanes();
+ if ( !nPlanes )
+ ip->setParameter( entry, param, "Off" );
+ for ( int p = 0; p < nPlanes; p++ ) {
+ vtkPlane* plane = vPrs->GetClippingPlane( p );
+ vtkFloatingPointType normal[3], origin[3];
+ plane->GetNormal( normal );
+ plane->GetOrigin( origin );
+ std::string planeValue = QString::number( normal[0] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( normal[1] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( normal[2] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[0] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[1] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[2] ).toLatin1().data();
+ param = QString( "%1ClippingPlane_%2" ).arg( vtkParam.c_str() ).arg( p+1 ).toLatin1().data();
+ ip->setParameter( entry, param, planeValue );
+ }
+ }
+
+ } // hasIO
+ } // salome_actor successfull downcast to the VISU_Actor
+ else if ( VISU_PointMap3dActor* vActor = VISU_PointMap3dActor::SafeDownCast( actor ) ) { // PointMap3D
+ 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.toLatin1().data();
vtkParam += gSeparator;
- vtkParam += QString::number( *viewsCounter ).toLatin1().data();
+ vtkParam += QString::number( *viewsCounter ).toLatin1().data();
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() ).toLatin1().data() );
- param = vtkParam + "Opacity";
- ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() );
- vtkFloatingPointType 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.toLatin1().data() );
- param = vtkParam + "LineWidth";
- ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() );
- if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
- param = vtkParam + "ShrinkMode";
- ip->setParameter( entry, param, "On" );
- param = vtkParam + "ShrinkFactor";
- ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() );
- }
- }
- } // salome actor is downcasted to the VISU_PointMap3dActor
- } // isVisible
- } // end of ..while.. actors traversal
- } // if ( vtkView )
+ 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() ).toLatin1().data() );
+ param = vtkParam + "Opacity";
+ ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() );
+ vtkFloatingPointType 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.toLatin1().data() );
+ param = vtkParam + "LineWidth";
+ ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() );
+ if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
+ param = vtkParam + "ShrinkMode";
+ ip->setParameter( entry, param, "On" );
+ param = vtkParam + "ShrinkFactor";
+ ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() );
+ }
+ }
+ } // salome actor is downcasted to the VISU_PointMap3dActor
+ } // isVisible
+ } // end of ..while.. actors traversal
+ } // if ( vtkView )
} // for ( views )
(*viewsCounter)++;
} // if ( SVTK view model )
else if ( vType == SPlot2d_Viewer::Type() ) { // processing Plot2d viewers
QVector<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();
- QList<Plot2d_Curve*> curves;
+ if ( Plot2d_ViewWindow* plotView = dynamic_cast<Plot2d_ViewWindow*>( views[i] ) ) {
+ Plot2d_ViewFrame* plotVF = plotView->getViewFrame();
+ QList<Plot2d_Curve*> curves;
QList<Plot2d_Curve*>::Iterator itCurve;
- plotVF->getCurves( curves );
-
- //Plot2d_Curve* curve;
- for ( itCurve = curves.begin(); itCurve != curves.end(); itCurve++ ) {
- if ( SPlot2d_Curve* sCurve = dynamic_cast<SPlot2d_Curve*>( *itCurve ) ) {
- 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.toLatin1().data(); plotParam += gSeparator;
- plotParam += QString::number( *viewsCounter ).toLatin1().data(); plotParam += gSeparator;
-
- param = plotParam + "Visibility";
- ip->setParameter( entry, param, "On" );
- }
- }
- } // for curves
- } // if ( plotView )
+ plotVF->getCurves( curves );
+
+ //Plot2d_Curve* curve;
+ for ( itCurve = curves.begin(); itCurve != curves.end(); itCurve++ ) {
+ if ( SPlot2d_Curve* sCurve = dynamic_cast<SPlot2d_Curve*>( *itCurve ) ) {
+ 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.toLatin1().data(); plotParam += gSeparator;
+ plotParam += QString::number( *viewsCounter ).toLatin1().data(); plotParam += gSeparator;
+
+ param = plotParam + "Visibility";
+ ip->setParameter( entry, param, "On" );
+ }
+ }
+ } // for curves
+ } // if ( plotView )
} // for ( views )
(*viewsCounter)++;
} // if ( SPlot2d view model )
_PTR(IParameters) ip = ClientFactory::getIParameters(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)
+ QMap<QString, QMap<QString, VISU_ActorBase*> > vtkActors; // map: entry to map: ViewType_<ID> to actor (SVTK/VVTK)
std::vector<std::string> entries = ip->getEntries();
// 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->setWindowTitle( (*namesIt).c_str() );
+// SUIT_ViewManager* vman = onCreateViewManager();
+// SUIT_ViewWindow* vwin = vman->getActiveView();
+// vwin->setWindowTitle( (*namesIt).c_str() );
-// // wait untill the window is really shown. This step fixes MANY bugs..
-// while ( !vwin->isVisible() )
-// qApp->processEvents();
+// // wait untill the window is really shown. This step fixes MANY bugs..
+// while ( !vwin->isVisible() )
+// qApp->processEvents();
-// vwin->setVisualParameters( (*valuesIt).c_str() );
+// vwin->setVisualParameters( (*valuesIt).c_str() );
// }
// continue; // skip to next entry
// }
std::string viewIndexStr = ::getParam( *namesIt, ViewIndex );
int viewIndex = QString( viewIndexStr.c_str() ).toUInt( &ok );
if ( !ok ) // bad conversion of view index to integer
- continue;
+ continue;
// cout << " -- " << viewerType << ": entry = " << entry.latin1() << ", paramName = " << paramName << endl;
if ( viewerType == SVTK_Viewer::Type().toLatin1().data() /*||
- viewerType == VVTK_Viewer::Type().toLatin1().data()*/ ) {
-
- // used as inner map key for locating the actor.
- QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex );
-
- if ( paramName == "Visibility" && displayer() ) {
- // if VVTK, then we must create viewer first, because
-
- QList<SUIT_ViewManager*> lst;
- getApp()->viewManagers( viewerType.c_str(), 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();
- // both SVTK and VVTK view models can be casted to SALOME_View
- displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
-
- // store displayed actor in a temporary map for quicker access later when restoring other parameters
- SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
- QMap<QString, VISU_Actor*> viewActorMap;
- if ( vtkActors.contains( entry ) )
- viewActorMap = vtkActors[ entry ];
- viewActorMap[ viewerTypeIndex ] = FindActor( GetAppStudy(this), vtkView, entry );
- 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 ];
+ viewerType == VVTK_Viewer::Type().toLatin1().data()*/ ) {
+
+ // used as inner map key for locating the actor.
+ QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex );
+
+ if ( paramName == "Visibility" && displayer() ) {
+ // if VVTK, then we must create viewer first, because
+
+ QList<SUIT_ViewManager*> lst;
+ getApp()->viewManagers( viewerType.c_str(), 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();
+ // both SVTK and VVTK view models can be casted to SALOME_View
+ displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
+
+ // store displayed actor in a temporary map for quicker access later when restoring other parameters
+ SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
+ QMap<QString, VISU_ActorBase*> viewActorMap;
+ if ( vtkActors.contains( entry ) )
+ viewActorMap = vtkActors[ entry ];
+ viewActorMap[ viewerTypeIndex ] = FindActorBase( GetAppStudy(this), vtkView, entry );
+ vtkActors[ entry ] = viewActorMap;
+ }
+ }
+ else { // the rest properties "work" with VISU_Actor, so we initialize it at first
+ VISU_Actor* vActor = 0;
+ VISU_PointMap3dActor* vP3dActor = 0;
+ if ( vtkActors.contains( entry ) ) {
+ QMap<QString, VISU_ActorBase*> viewActorMap = vtkActors[ entry ];
+ if ( viewActorMap.contains( viewerTypeIndex ) ) {
+ vActor = VISU_Actor::SafeDownCast( viewActorMap[ viewerTypeIndex ] );
+ vP3dActor = VISU_PointMap3dActor::SafeDownCast( viewActorMap[ viewerTypeIndex ] );
+ }
}
- if ( !vActor )
- continue;
-
- QString val( (*valuesIt).c_str() );
-
- if ( paramName == "Name" )
- vActor->setName( val.toLatin1().data() );
+ QString val( (*valuesIt).c_str() );
+ if ( vActor ) {
+ // salome_actor successfull downcast to the VISU_Actor
+ if ( paramName == "Name" )
+ vActor->setName( val.toLatin1().data() );
+
+ else if ( paramName == "RepresentationMode" )
+ vActor->SetRepresentation( val.toInt() );
+
+ else if (paramName == "Quadratic2DRepresentation")
+ vActor->SetQuadratic2DRepresentation(VISU_Actor::EQuadratic2DRepresentation(val.toInt()));
+
+ else if ( paramName == "Opacity" )
+ vActor->SetOpacity( val.toFloat() );
+
+ else if ( paramName == "Color" ) {
+ QStringList colors = val.split( gDigitsSep, QString::SkipEmptyParts );
+ if ( colors.count() == 3 )
+ vActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() );
+ }
- else if ( paramName == "RepresentationMode" )
- vActor->SetRepresentation( val.toInt() );
+ else if ( paramName == "LineWidth" )
+ vActor->SetLineWidth( val.toFloat() );
- else if ( paramName == "Opacity" )
- vActor->SetOpacity( val.toFloat() );
+ else if ( paramName == "ShrinkMode" ) {
+ vActor->SetShrinkable( true );
+ vActor->SetShrink();
+ }
- else if ( paramName == "Color" ) {
- QStringList colors = val.split( gDigitsSep, QString::SkipEmptyParts );
- if ( colors.count() == 3 )
- vActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() );
- }
+ else if ( paramName == "ShrinkFactor" )
+ vActor->SetShrinkFactor( val.toFloat() );
- else if ( paramName == "LineWidth" )
- vActor->SetLineWidth( val.toFloat() );
+ else if ( paramName == "Shading" ) {
+ if ( VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor ) )
+ scalarMapActor->SetShading();
+ }
- else if ( paramName == "ShrinkMode" ) {
- vActor->SetShrinkable( true );
- vActor->SetShrink();
- }
+ else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) {
+ VISU::Prs3d_i* prs = vActor->GetPrs3d();
+ if ( !prs )
+ continue;
+
+ //prs->RemoveAllClippingPlanes();
+ for (int i = prs->GetNumberOfClippingPlanes() - 1; i >= 0 ; i--) {
+ OrientedPlane* aPlane = dynamic_cast<OrientedPlane*>(prs->GetClippingPlane(i));
+ if (aPlane)
+ prs->RemoveClippingPlane(i);
+ }
+ if ( val != "Off" ) {
+ QStringList vals = val.split( gDigitsSep, QString::SkipEmptyParts );
+ if ( vals.count() == 6 ) { // format check: 6 float values
+ vtkFloatingPointType normal[3], origin[3];
+ for (int x = 0; x < 3; x++ ) {
+ normal[x] = vals[x].toFloat();
+ origin[x] = vals[x+3].toFloat();
+ }
+ OrientedPlane* plane = OrientedPlane::New();
+ plane->SetNormal( normal );
+ plane->SetOrigin( origin );
+ prs->AddClippingPlane( plane );
+ plane->Delete();
+ }
+ }
+ }
+ } // if ( vActor ) --> salome_actor successfull downcast to the VISU_Actor
+ else if ( vP3dActor ) {
+ // salome actor is downcasted to the VISU_PointMap3dActor
+ if ( paramName == "Name" )
+ vP3dActor->setName( val.toLatin1().data() );
+
+ else if ( paramName == "RepresentationMode" )
+ vP3dActor->SetRepresentation( val.toInt() );
+
+ else if ( paramName == "Opacity" )
+ vP3dActor->SetOpacity( val.toFloat() );
+
+ else if ( paramName == "Color" ) {
+ QStringList colors = val.split( gDigitsSep, QString::SkipEmptyParts );
+ if ( colors.count() == 3 )
+ vP3dActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() );
+ }
- else if ( paramName == "ShrunkFactor" )
- vActor->SetShrinkFactor( val.toFloat() );
+ else if ( paramName == "LineWidth" )
+ vP3dActor->SetLineWidth( val.toFloat() );
- else if ( paramName == "Shading" ) {
- if ( VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor ) )
- scalarMapActor->SetShading();
- }
+ else if ( paramName == "ShrinkMode" ) {
+ vP3dActor->SetShrinkable( true );
+ vP3dActor->SetShrink();
+ }
- else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) {
- VISU::Prs3d_i* prs = vActor->GetPrs3d();
- if ( !prs )
- continue;
+ else if ( paramName == "ShrinkFactor" )
+ vP3dActor->SetShrinkFactor( val.toFloat() );
- //prs->RemoveAllClippingPlanes();
- for (int i = prs->GetNumberOfClippingPlanes() - 1; i >= 0 ; i--) {
- OrientedPlane* aPlane = dynamic_cast<OrientedPlane*>(prs->GetClippingPlane(i));
- if (aPlane)
- prs->RemoveClippingPlane(i);
- }
- if ( val != "Off" ) {
- QStringList vals = val.split( gDigitsSep, QString::SkipEmptyParts );
- if ( vals.count() == 6 ) { // format check: 6 float values
- vtkFloatingPointType normal[3], origin[3];
- for (int x = 0; x < 3; x++ ) {
- normal[x] = vals[x].toFloat();
- origin[x] = vals[x+3].toFloat();
- }
- OrientedPlane* plane = OrientedPlane::New();
- plane->SetNormal( normal );
- plane->SetOrigin( origin );
- prs->AddClippingPlane( plane );
- plane->Delete();
- }
- }
- }
- } // else ..
+ } // else if ( vP3dActor ) --> salome actor is downcasted to the VISU_PointMap3dActor
+ } // else ..
} // if SVTK
else if ( viewerType == SPlot2d_Viewer::Type().toLatin1().data() ) {
- if ( paramName == "Visibility" && displayer() ) {
- QList<SUIT_ViewManager*> lst;
- getApp()->viewManagers( viewerType.c_str(), lst );
+ if ( paramName == "Visibility" && displayer() ) {
+ QList<SUIT_ViewManager*> lst;
+ getApp()->viewManagers( viewerType.c_str(), 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 ( 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
if ( !vmodel )
continue;
if ( vmodel->getType() == SVTK_Viewer::Type() /*|| // processing SVTK and VVTK viewers
- vmodel->getType() == VVTK_Viewer::Type()*/ ) { // in the same way
+ vmodel->getType() == VVTK_Viewer::Type()*/ ) { // in the same way
SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) (*it)->getActiveView();
vtkView->getRenderer()->ResetCameraClippingRange();
vtkView->Repaint();
// if ( activeGaussViewer >= 0 && activeGaussViewer < lst.count() ) {
// SUIT_ViewWindow* activeView = lst.at( activeGaussViewer )->getActiveView();
// if ( activeView ) {
-// activeView->activateWindow();
-// //activeView->setFocus();
+// activeView->activateWindow();
+// //activeView->setFocus();
// }
// }
// }