CORBA::String_var aCompDataType = aSComp->ComponentDataType();
QString anInfo ("Loading ");
- anInfo = anInfo + aCompDataType.in() + " Component Data ...";
+ anInfo = anInfo + aCompDataType.in() + " Component Data ...";
application()->putInfo( anInfo );
// obtain a driver by a component data type
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
_PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
- if (!aSObj)
+ if (!aSObj)
return;
VISU::VISUType aType = VISU::Storable::SObject2Type( aSObj );
- if (aType != VISU::TANIMATION)
+ if (aType != VISU::TANIMATION)
return;
VisuGUI_TimeAnimationDlg* aAnimationDlg =
mgr->insert( action( VISU_MULTIPR_MED_RES ), -1, -1, -1 );
mgr->insert( action( VISU_MULTIPR_LOW_RES ), -1, -1, -1 );
mgr->insert( action( VISU_MULTIPR_HIDE ), -1, -1, -1 );
-
+
// Rules
QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
//aRule = "client='ObjectBrowser' and type='MEDFIELD'";
//mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
-
+
aRule = "client='ObjectBrowser' and selcount>=1 and $type in {'VISU::TPART'} and ";
{
QString aCustomRule = aRule + "fullResolution=1 and resolutionState!='F'";
SALOME_ListIteratorOfListIO It (aListIO);
for (; It.More(); It.Next()) {
Handle(SALOME_InteractiveObject)& anIO = It.Value();
-
+
if (!anIO.IsNull() && anIO->hasEntry()) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
if ( !aSObject )
_PTR(SObject) aPrs;
for (; anIter->More(); anIter->Next()) {
aPrs = anIter->Value();
- if (!aPrs)
+ if (!aPrs)
continue;
std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
nbPrs += aSubList.size();
// group: "Font"
int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
- setPreferenceProperty( fontGr, "columns", 4 );
- int tfont = addPreference( tr( "VISU_TITLE" ), fontGr,
- LightApp_Preferences::Font, "VISU", "scalar_bar_title_font" );
- addPreference( tr( "VISU_TITLE" ), fontGr,
- LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" );
- int lfont = addPreference( tr( "VISU_LABELS" ), fontGr,
- LightApp_Preferences::Font, "VISU", "scalar_bar_label_font" );
- addPreference( tr( "VISU_LABELS" ), fontGr,
- LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
+ setPreferenceProperty( fontGr, "columns", 2 );
+
+ int tfont = addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_title_font" );
+ addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" );
+ int lfont = addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_label_font" );
+ addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
QStringList fam;
fam.append( tr( "VISU_FONT_ARIAL" ) );
// group: "Origin & Size Vertical"
int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ), sbarTab );
- setPreferenceProperty( posVSizeGr, "columns", 10 );
+ setPreferenceProperty( posVSizeGr, "columns", 2 );
int xv = addPreference( tr( "VISU_X" ), posVSizeGr,
LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
- int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr,
- LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" );
- int twv = addPreference( tr( "VISU_TITLE_WIDTH" ), posVSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_title_width" );
- int lwv = addPreference( tr( "VISU_LABEL_WIDTH" ), posVSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_label_width" );
- int bwv = addPreference( tr( "VISU_BAR_WIDTH" ), posVSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_bar_width" );
-
int yv = addPreference( tr( "VISU_Y" ), posVSizeGr,
LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" );
+
+ int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr,
+ LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" );
int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr,
LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" );
+
+ int twv = addPreference( tr( "VISU_TITLE_WIDTH" ), posVSizeGr,
+ LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_title_width" );
int thv = addPreference( tr( "VISU_TITLE_HEIGHT" ), posVSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_title_height" );
+
+ int lwv = addPreference( tr( "VISU_LABEL_WIDTH" ), posVSizeGr,
+ LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_label_width" );
int lhv = addPreference( tr( "VISU_LABEL_HEIGHT" ), posVSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_label_height" );
+
+ int bwv = addPreference( tr( "VISU_BAR_WIDTH" ), posVSizeGr,
+ LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_bar_width" );
int bhv = addPreference( tr( "VISU_BAR_HEIGHT" ), posVSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_bar_height" );
+
setPreferenceProperty( xv, "step", 0.1 );
setPreferenceProperty( yv, "step", 0.1 );
setPreferenceProperty( wv, "step", 0.1 );
// group: "Origin & Size Horizontal"
int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ), sbarTab );
- setPreferenceProperty( posHSizeGr, "columns", 10 );
+ setPreferenceProperty( posHSizeGr, "columns", 2 );
+
int xh = addPreference( tr( "VISU_X" ), posHSizeGr,
LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" );
- int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr,
- LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" );
- int twh = addPreference( tr( "Title width (%)" ), posHSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_title_width" );
- int lwh = addPreference( tr( "Label width (%)" ), posHSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_label_width" );
- int bwh = addPreference( tr( "Bar width (%)" ), posHSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_bar_width" );
-
int yh = addPreference( tr( "VISU_Y" ), posHSizeGr,
LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_y" );
+
+ int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr,
+ LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" );
int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr,
LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" );
+
+ int twh = addPreference( tr( "Title width (%)" ), posHSizeGr,
+ LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_title_width" );
int thh = addPreference( tr( "Title height (%)" ), posHSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_title_height" );
+
+ int lwh = addPreference( tr( "Label width (%)" ), posHSizeGr,
+ LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_label_width" );
int lhh = addPreference( tr( "Label height (%)" ), posHSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_label_height" );
+
+ int bwh = addPreference( tr( "Bar width (%)" ), posHSizeGr,
+ LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_bar_width" );
int bhh = addPreference( tr( "Bar height (%)" ), posHSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_bar_height" );
+
setPreferenceProperty( xh, "step", 0.1 );
setPreferenceProperty( yh, "step", 0.1 );
setPreferenceProperty( wh, "step", 0.1 );
int iso_surfaces_represent = addPreference( tr( "VISU_ISO_SURFACES" ), representGr, LightApp_Preferences::Selector, "VISU", "iso_surfaces_represent" );
setPreferenceProperty( iso_surfaces_represent, "strings", modes2 );
setPreferenceProperty( iso_surfaces_represent, "indexes", indices2 );
- addPreference( "", representGr, LightApp_Preferences::Space );
+ int sp = addPreference( "", representGr, LightApp_Preferences::Space );
+ setPreferenceProperty( sp, "hstretch", 0 );
+ setPreferenceProperty( sp, "vstretch", 0 );
int cut_planes_represent = addPreference( tr( "VISU_CUT_PLANES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_planes_represent" );
setPreferenceProperty( cut_planes_represent, "strings", modes2 );
int cut_lines_represent = addPreference( tr( "VISU_CUT_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_lines_represent" );
setPreferenceProperty( cut_lines_represent, "strings", modes3 );
setPreferenceProperty( cut_lines_represent, "indexes", indices3 );
- addPreference( "", representGr, LightApp_Preferences::Space );
+ sp = addPreference( "", representGr, LightApp_Preferences::Space );
+ setPreferenceProperty( sp, "hstretch", 0 );
+ setPreferenceProperty( sp, "vstretch", 0 );
int deformed_shape_represent = addPreference( tr( "VISU_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "deformed_shape_represent" );
setPreferenceProperty( deformed_shape_represent, "strings", mesh_modes );
int vectors_represent = addPreference( tr( "VISU_VECTORS" ), representGr, LightApp_Preferences::Selector, "VISU", "vectors_represent" );
setPreferenceProperty( vectors_represent, "strings", modes3 );
setPreferenceProperty( vectors_represent, "indexes", indices3 );
- addPreference( "", representGr, LightApp_Preferences::Space );
+ sp = addPreference( "", representGr, LightApp_Preferences::Space );
+ setPreferenceProperty( sp, "hstretch", 0 );
+ setPreferenceProperty( sp, "vstretch", 0 );
int stream_lines_represent = addPreference( tr( "VISU_STREAM_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "stream_lines_represent" );
setPreferenceProperty( stream_lines_represent, "strings", modes3 );
setPreferenceProperty( stream_lines_represent, "indexes", indices3 );
- addPreference( "", representGr, LightApp_Preferences::Space );
+ sp = addPreference( "", representGr, LightApp_Preferences::Space );
+ setPreferenceProperty( sp, "hstretch", 0 );
+ setPreferenceProperty( sp, "vstretch", 0 );
int plot3d_represent = addPreference( tr( "VISU_PLOT3D" ), representGr, LightApp_Preferences::Selector, "VISU", "plot3d_represent" );
setPreferenceProperty( plot3d_represent, "strings", modes2 );
setPreferenceProperty( plot3d_represent, "indexes", indices2 );
- addPreference( "", representGr, LightApp_Preferences::Space );
+ sp = addPreference( "", representGr, LightApp_Preferences::Space );
+ setPreferenceProperty( sp, "hstretch", 0 );
+ setPreferenceProperty( sp, "vstretch", 0 );
int scalar_def_represent = addPreference( tr( "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_def_represent" );
setPreferenceProperty( scalar_def_represent, "strings", modes1 );
setPreferenceProperty( scalar_def_represent, "indexes", indices1 );
addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" );
- addPreference( tr( "VISU_USE_SHADING" ), representGr,
- LightApp_Preferences::Bool, "VISU", "represent_shading" );
- addPreference( "", representGr, LightApp_Preferences::Space );
+ addPreference( tr( "VISU_USE_SHADING" ), representGr, LightApp_Preferences::Bool, "VISU", "represent_shading" );
+ sp = addPreference( "", representGr, LightApp_Preferences::Space );
+ setPreferenceProperty( sp, "hstretch", 0 );
+ setPreferenceProperty( sp, "vstretch", 0 );
- addPreference( tr( "VISU_DISP_ONLY" ), representGr,
- LightApp_Preferences::Bool, "VISU", "display_only" );
+ addPreference( tr( "VISU_DISP_ONLY" ), representGr, LightApp_Preferences::Bool, "VISU", "display_only" );
// TAB: 3D Cache ; group: "Cache properties"
int cacheTab = addPreference( tr( "3D Cache" ) );
VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aRestoringMap );
if (aType != TTIMESTAMP )
return;
-
+
QString aMeshName = aRestoringMap["myMeshName"];
QString anEntity = aRestoringMap["myEntityId"];
QString aFieldName = aRestoringMap["myFieldName"];
VISU::Result_var aResult = FindResult( VISU::GetSObject( aSObject ).in() );
if(CORBA::is_nil(aResult.in()))
continue;
-
+
VISU::Result_i* aCResult = dynamic_cast<VISU::Result_i*>(VISU::GetServant(aResult).in());
if(!aCResult)
continue;
QString aMeshName = Storable::FindValue(aRestoringMap, "myMeshName", &anIsFound);
if(!anIsFound)
continue;
-
+
std::string aPartName = aSObject->GetName();
aCResult->SetResolution(aMeshName.toLatin1().data(), aPartName.c_str(), theResolution);
//---------------------------------------------------------------
VisuGUI_Module::
-VisuGUI_Module() :
+VisuGUI_Module() :
VisuGUI()
{
}
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 );
-
+ 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"),
+ createAction( GAUSS_NEW_VIEWER,
+ tr("MEN_GAUSS_NEW_VIEWER"),
aPixmap,
- tr("MEN_GAUSS_NEW_VIEWER"),
+ tr("MEN_GAUSS_NEW_VIEWER"),
tr("MEN_GAUSS_NEW_VIEWER"),
- Qt::ALT+Qt::Key_S,
- this,
+ Qt::ALT+Qt::Key_S,
+ this,
false,
- this,
+ this,
SLOT(onCreateViewManager()));
int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 );
int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
tr("MEN_GAUSS_CREATE_PRS"), "", 0, this, false,
this, SLOT(OnCreateGaussPoints()));
mgr->insert( action( GAUSS_CREATE_PRS ), -1, 0, -1 );
- mgr->setRule( action( GAUSS_CREATE_PRS ),
+ 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'} "
VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
this, SLOT(OnRename()));
mgr->insert( action( GAUSS_RENAME ), -1, 0, -1 );
- mgr->setRule( action( GAUSS_RENAME ),
+ 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()));
mgr->insert( action( GAUSS_EDIT_PRS ), -1, 0, -1 );
- mgr->setRule( action( GAUSS_EDIT_PRS ),
+ mgr->setRule( action( GAUSS_EDIT_PRS ),
"selcount=1 and type='VISU::TGAUSSPOINTS'" );
createAction( GAUSS_COPY_PRS, VisuGUI::tr("MEN_COPY_PRS"), QIcon(),
VisuGUI::tr("MEN_COPY_PRS"), "", 0, this, false,
this, SLOT(OnCopyPresentation()));
mgr->insert( action( GAUSS_COPY_PRS ), -1, 0, -1 );
- mgr->setRule( action( GAUSS_COPY_PRS ),
+ mgr->setRule( action( GAUSS_COPY_PRS ),
"selcount=1 and type='VISU::TGAUSSPOINTS'" );
-
+
action( GAUSS_COPY_PRS )->setEnabled(false);
QStringList viewers;
-
+
#ifndef DISABLE_OCCVIEWER
#ifndef DISABLE_SALOMEOBJECT
viewers.append( SOCC_Viewer::Type() );
VisuGUI::tr("MEN_HIDE"), "", 0, this, false,
this, SLOT(OnErasePrs()));
mgr->insert( action( GAUSS_ERASE_PRS ), -1, -1, -1 ); // erase
- mgr->setRule( action( GAUSS_ERASE_PRS ),
+ mgr->setRule( action( GAUSS_ERASE_PRS ),
aRule + " and ({true} in $canBeDisplayed) and (isVisible=true)" );
createAction( GAUSS_DISPLAY_PRS, VisuGUI::tr("MEN_SHOW"), QIcon(),
VisuGUI::tr("MEN_SHOW"), "", 0, this, false,
this, SLOT(OnDisplayPrs()));
mgr->insert( action( GAUSS_DISPLAY_PRS ), -1, -1, -1 ); // display
- mgr->setRule( action( GAUSS_DISPLAY_PRS ),
+ mgr->setRule( action( GAUSS_DISPLAY_PRS ),
aRule + " and ({true} in $canBeDisplayed) and (isVisible=false)" );
createAction( GAUSS_DISPLAY_ONLY_PRS, VisuGUI::tr("MEN_DISPLAY_ONLY"), QIcon(),
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 ),
+ mgr->setRule( action( GAUSS_DISPLAY_ONLY_PRS ),
aRule + " and ({true} in $canBeDisplayed)" );
- createAction( GAUSS_RENAME_CONFIGURATION, VisuGUI::tr("MEN_RENAME"), QIcon(),
+ createAction( GAUSS_RENAME_CONFIGURATION, VisuGUI::tr("MEN_RENAME"), QIcon(),
VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
this, SLOT(OnRename()));
mgr->insert( action( GAUSS_RENAME_CONFIGURATION ), -1, -1, -1 );
aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) );
new LightApp_VTKSelector( aViewer, anApp->selectionMgr() );
anApp->addViewManager( aViewManager );
-
+
VVTK_ViewWindow* aViewWindow = ( VVTK_ViewWindow* )aViewManager->createViewWindow();
if( aViewWindow )
{
//---------------------------------------------------------------
-void
+void
VisuGUI_Module::
createPreferences()
{
//---------------------------------------------------------------
-void
+void
VisuGUI_Module::
createGaussPointsPreferences()
{
setPreferenceProperty( faceLimitPref, "max", 1000000 );
int sizeGr = addPreference( tr( "VISU_GAUSS_PREF_SIZE_GROUP_TTL" ), gaussTab );
- setPreferenceProperty( sizeGr, "columns", 4 );
+ setPreferenceProperty( sizeGr, "columns", 2 );
int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr,
LightApp_Preferences::IntSpin, "VISU", "point_sprite_min_size" );
//---------------------------------------------------------------
-void
+void
VisuGUI_Module::
createInsideCursorPreferences()
{
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
LightApp_Preferences::DblSpin, "VISU",
- "inside_point_sprite_alpha_threshold" );
+ "inside_point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
//---------------------------------------------------------------
-void
+void
VisuGUI_Module::
createOutsideCursorPreferences()
{
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
LightApp_Preferences::DblSpin, "VISU",
- "outside_point_sprite_alpha_threshold" );
+ "outside_point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
//---------------------------------------------------------------
-void
+void
VisuGUI_Module::
createPickingPreferences()
{
//---------------------------------------------------------------
-void
+void
VisuGUI_Module::
createSpaceMousePreferences()
{
//---------------------------------------------------------------
-void
+void
VisuGUI_Module::
createRecorderPreferences()
{
OnViewManagerAdded(SUIT_ViewManager* viewMgr)
{
QString type = viewMgr->getViewModel()->getType();
- if ( type == VVTK_Viewer::Type() )
+ if ( type == VVTK_Viewer::Type() )
connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ),
this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) );
}
VisuGUI::preferencesChanged(group,pref);
if ( group == "VISU" && ( pref == "speed_increment" || pref == "spacemouse_func1_btn" ||
- pref == "spacemouse_func2_btn" || pref == "spacemouse_func3_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 );
- if ( vm )
+ if ( vm )
setProperty( dynamic_cast<SVTK_ViewManager*>( vm ), pref );
}
}
//---------------------------------------------------------------
SUIT_ViewManager*
VisuGUI_Module::
-getViewManager(const QString& theType,
+getViewManager(const QString& theType,
const bool theIsCreate)
{
if (SUIT_ViewManager* aViewManager = VisuGUI::getViewManager(theType,theIsCreate))
Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".R").c_str(),aColor[0]);
Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".G").c_str(),aColor[1]);
Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".B").c_str(),aColor[2]);
-
+
double aPosition[3];
vtkCamera* aCamera = aRenderer->GetActiveCamera();
aCamera->GetPosition(aPosition);
Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[0]").c_str(),aFocalPnt[0]);
Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[1]").c_str(),aFocalPnt[1]);
Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[2]").c_str(),aFocalPnt[2]);
-
+
double aViewUp[3];
aCamera->GetViewUp(aViewUp);
Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[0]").c_str(),aViewUp[0]);
Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[1]").c_str(),aViewUp[1]);
Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[2]").c_str(),aViewUp[2]);
-
+
vtkFloatingPointType aParallelScale = aCamera->GetParallelScale();
Storable::DataToStream(theStr,(std::string("myParallelScale") + theSuffix).c_str(),aParallelScale);
-
+
double aScaleFactor[3];
theViewWindow->GetScale(aScaleFactor);
Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[0]").c_str(),aScaleFactor[0]);
aColor[2] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".B").toDouble();
vtkRenderer* aRenderer = theViewWindow->getRenderer();
aRenderer->SetBackground(aColor);
-
+
double aPosition[3];
aPosition[0] = Storable::FindValue(theMap,std::string("myPosition") + theSuffix + "[0]").toDouble();
aPosition[1] = Storable::FindValue(theMap,std::string("myPosition") + theSuffix + "[1]").toDouble();
aFocalPnt[1] = Storable::FindValue(theMap,std::string("myFocalPnt") + theSuffix + "[1]").toDouble();
aFocalPnt[2] = Storable::FindValue(theMap,std::string("myFocalPnt") + theSuffix + "[2]").toDouble();
aCamera->SetFocalPoint(aFocalPnt);
-
+
double aViewUp[3];
aViewUp[0] = Storable::FindValue(theMap,std::string("myViewUp") + theSuffix + "[0]").toDouble();
aViewUp[1] = Storable::FindValue(theMap,std::string("myViewUp") + theSuffix + "[1]").toDouble();
vtkFloatingPointType aParallelScale = Storable::FindValue(theMap,std::string("myParallelScale") + theSuffix).toDouble();
aCamera->SetParallelScale(aParallelScale);
-
+
double aScaleFactor[3];
aScaleFactor[0] = Storable::FindValue(theMap,std::string("myScaleFactor") + theSuffix + "[0]").toDouble();
aScaleFactor[1] = Storable::FindValue(theMap,std::string("myScaleFactor") + theSuffix + "[1]").toDouble();
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();
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);
-
+
aSegmentationMode = "Sphere";
}
-
+
Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode.c_str());
}
}
std::ostringstream aStream;
Storable::DataToStream(aStream,"myComment","GAUSSVIEW");
-
+
SVTK_Selector* aSelector = theViewWindow->GetSelector();
Selection_Mode aSelectionMode = aSelector->SelectionMode();
Storable::DataToStream(aStream,"mySelectionMode",aSelectionMode);
-
+
GetViewParams(theViewWindow->getMainWindow1(),aStream);
GetViewParams(theViewWindow->getMainWindow2(),aStream);
bool myIsSelected;
bool myHasSubId;
int mySubId;
-
+
TSelection():
myIsSelected(false),
myHasSubId(false),
{}
void
- operator()(VISU_GaussPtsAct* theActor)
+ operator()(VISU_GaussPtsAct* theActor)
{
if(theActor->GetVisibility()){
const Handle(SALOME_InteractiveObject)& anIO = theActor->getIO();
TGetVisibleEntries aGetVisibleEntries(theVisibleEntries);
SVTK::ForEach<VISU_GaussPtsAct>(anActors,
aGetVisibleEntries);
-
+
// Next, find the sub-ids for the visible Gauss Points presentations
SVTK_Selector* aSelector = theViewWindow->GetSelector();
const SALOME_ListIO& aListIO = aSelector->StoredIObjects();
void
CreateReference(_PTR(Study) theStudyDocument,
_PTR(StudyBuilder) theStudyBuilder,
- _PTR(SObject) theFatherSObject,
+ _PTR(SObject) theFatherSObject,
const string& theRefEntry,
const TSelection& theSelection)
{
// To set visiblity
VISU::UpdateViewer(theModule, aPrs3d, /*disp_only = */anIsFirst, /*highlight = */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(),"");
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
if (CheckLock(aCStudy,GetDesktop(theModule)))
return;
-
+
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(theModule);
-
+
SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager();
if(aViewManager->getType() == VVTK_Viewer::Type()){
SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
VVTK_ViewWindow* aViewWindow = dynamic_cast<VVTK_ViewWindow*>(aWindow);
-
+
SUIT_Study* aSStudy = aViewManager->study();
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy);
_PTR(Study) aCStudy = aStudy->studyDS();
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(),
- "",
- "",
+ anEntry = CreateAttributes(aCStudy,
+ aSComponentEntry.c_str(),
+ "",
+ "",
aName.c_str(),
"",
aValue.c_str());
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();
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,
+ aSObject,
anEntry,
aSelection);
}
-
+
//UpdateObjBrowser(theModule,true,aSObject);
UpdateObjBrowser(theModule,true);
}
if(!aMap.empty()){
SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
VVTK_ViewWindow* aViewWindow = dynamic_cast<VVTK_ViewWindow*>(aWindow);
-
+
Selection_Mode aSelectionMode = Storable::FindValue(aMap,"mySelectionMode").toInt();
SVTK_Selector* aSelector = aViewWindow->GetSelector();
aSelector->SetSelectionMode(aSelectionMode);
-
+
SetGaussPointsSelection(this,aViewWindow,aCStudy,aSObject);
std::string aSegmentationMode;
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[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();
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);
}
}
// 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" );
+ ip->setProperty( "ActiveGaussViewer", "-1" );
getApp()->viewManagers( VVTK_Viewer::Type(), lst );
for ( it = lst.begin(); it != lst.end(); it++ ) {
- if ( SUIT_ViewWindow* vwin = (*it)->getActiveView() ) {
- // using predefined string "GaussViewer" as "entry".. it's a hardcoded "workaround".
+ if ( SUIT_ViewWindow* vwin = (*it)->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
+ // name of parameter = caption of gauss ViewWindow
// value of parameter = ViewWindow's visual parameters
ip->setParameter( "GaussViewer",
vwin->windowTitle().toLatin1().data(),
// 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 ( 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
+ // 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 entry = ip->encodeEntry( io->getEntry(), componentName );
std::string param, vtkParam = vType.toLatin1().data();
- vtkParam += gSeparator;
+ vtkParam += gSeparator;
vtkParam += QString::number( *viewsCounter ).toLatin1().data();
- vtkParam += gSeparator;
+ vtkParam += gSeparator;
- param = vtkParam + "Visibility";
+ 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";
+ 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";
+ 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() );
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();
+ 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 );
}
} // isVisible
} // end of ..while.. actors traversal
} // if ( vtkView )
- } // for ( views )
- (*viewsCounter)++;
+ } // for ( views )
+ (*viewsCounter)++;
} // if ( SVTK view model )
else if ( vType == SPlot2d_Viewer::Type() ) { // processing Plot2d viewers
QVector<SUIT_ViewWindow*> views = vman->getViews();
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
+ // 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 entry = ip->encodeEntry( io->getEntry(), componentName );
- std::string param, plotParam = vType.toLatin1().data(); plotParam += gSeparator;
- plotParam += QString::number( *viewsCounter ).toLatin1().data(); plotParam += gSeparator;
+ std::string param, plotParam = vType.toLatin1().data(); plotParam += gSeparator;
+ plotParam += QString::number( *viewsCounter ).toLatin1().data(); plotParam += gSeparator;
- param = plotParam + "Visibility";
+ param = plotParam + "Visibility";
ip->setParameter( entry, param, "On" );
}
}
} // for curves
} // if ( plotView )
- } // for ( views )
+ } // for ( views )
(*viewsCounter)++;
} // if ( SPlot2d view model )
}
studyDS->GetModuleParameters("Interface Applicative", moduleName().toLatin1().data(), savePoint);
_PTR(IParameters) ip = ClientFactory::getIParameters(ap);
- // actors are stored in a map after displaying of them for quicker access in future
+ // 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();
+ SUIT_ViewWindow* vwin = vman->getActiveView();
vwin->setWindowTitle( (*namesIt).c_str() );
// wait untill the window is really shown. This step fixes MANY bugs..
}
continue; // skip to next entry
}
-
- // entry is a normal entry - it should be "decoded" (setting base adress of component)
+
+ // entry is a normal entry - it should be "decoded" (setting base adress of component)
QString entry( ip->decodeEntry( *entIt ).c_str() );
//SRN: Added a check that the entry corresponds to Standard_Real object in the Study
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;
QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex );
if ( paramName == "Visibility" && displayer() ) {
- // if VVTK, then we must create viewer first, because
+ // if VVTK, then we must create viewer first, because
QList<SUIT_ViewManager*> lst;
getApp()->viewManagers( viewerType.c_str(), lst );
continue;
QString val( (*valuesIt).c_str() );
-
+
if ( paramName == "Name" )
vActor->setName( val.toLatin1().data() );
- else if ( paramName == "RepresentationMode" )
+ else if ( paramName == "RepresentationMode" )
vActor->SetRepresentation( val.toInt() );
else if ( paramName == "Opacity" )
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 ) );
+ displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
}
}
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 ( activeView ) {
activeView->activateWindow();
//activeView->setFocus();
- }
+ }
}
}
}