From: mzn Date: Fri, 5 May 2006 09:05:59 +0000 (+0000) Subject: PAL10721. X-Git-Tag: mergeto_trunk_06May06 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5fb7b01908a03fe733aa61d20f64b8b7fb09743b;p=modules%2Fvisu.git PAL10721. --- diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml index 8b10eebb..8fa38a99 100644 --- a/resources/SalomeApp.xml +++ b/resources/SalomeApp.xml @@ -6,7 +6,21 @@ - + + + + + + + + + + + + + + + diff --git a/src/VISUGUI/VISU_msg_en.po b/src/VISUGUI/VISU_msg_en.po index 8f2d484b..6f3156ee 100644 --- a/src/VISUGUI/VISU_msg_en.po +++ b/src/VISUGUI/VISU_msg_en.po @@ -162,12 +162,15 @@ msgstr "MED files import" msgid "VISU_PREF_MED_FULL_LOAD" msgstr "Full MED loading" -msgid "VISU_PREF_REPRESENT_PROPS" +msgid "VISU_REPRESENT_PROPS" msgstr "Representation properties" -msgid "VISU_PREF_SHADING" +msgid "VISU_USE_SHADING" msgstr "Use Shading" +msgid "VISU_SHRINK" +msgstr "Shrink" + #: VisuGUI.cxx msgid "VisuGUI::MEN_IMPORT" @@ -2061,3 +2064,33 @@ msgstr "Save VISU state" msgid "VisuGUI_Module::PRP_DESK_FILE_SAVE_GUI_STATE" msgstr "Saves current state of viewers, displayed objects, etc." + +msgid "VISU_MESH" +msgstr "Mesh" + +msgid "VISU_SCALAR_MAP" +msgstr "Scalar Map" + +msgid "VISU_ISO_SURFACES" +msgstr "Iso Surfaces" + +msgid "VISU_CUT_PLANES" +msgstr "Cut Planes" + +msgid "VISU_CUT_LINES" +msgstr "Cut Lines" + +msgid "VISU_DEFORMED_SHAPE" +msgstr "Deformed Shape" + +msgid "VISU_VECTORS" +msgstr "Vectors" + +msgid "VISU_STREAM_LINES" +msgstr "Stream Lines" + +msgid "VISU_PLOT3D" +msgstr "Plot3D" + +msgid "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE" +msgstr "Scalar Map on Def. Shape" \ No newline at end of file diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index e6b590e3..de9daebf 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -2520,7 +2520,9 @@ createPopupMenus() // 3D presentations commands QString aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}"; QString aInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE'}"; - QString aSurfType = " and $type in {'VISU::TMESH'}"; + QString aSurfFrameType = " and $type in {'VISU::TMESH'}"; + QString aSurfType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' " + " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}"; QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' " "'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}"; QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' " @@ -2538,9 +2540,9 @@ createPopupMenus() mgr->setRule( action( VISU_POINTS ) , aRule + aPrsType + aNotPoints, true ); mgr->setRule( action( VISU_WIREFRAME ) , aRule + aPrsType + aNotWirefr, true ); - mgr->setRule( action( VISU_SURFACE ) , aRule + aPrsType + aNotSurfac, true ); + mgr->setRule( action( VISU_SURFACE ) , aRule + aSurfType + aNotSurfac, true ); mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + aInsideType + aNotInside, true ); - mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfType + aNotSurffr, true ); + mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfFrameType + aNotSurffr, true ); mgr->setRule( action( VISU_SHRINK ) , aRule + aShrinkType + " and isShrunk=0", true ); mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1", true ); @@ -3020,9 +3022,91 @@ void VisuGUI::createPreferences() addPreference( tr( "Build groups" ), importGr, LightApp_Preferences::Bool, "VISU", "build_groups" ); addPreference( tr( "Close dialog at finish" ), importGr, LightApp_Preferences::Bool, "VISU", "close_at_finish" ); - // group: "Representation properties" - int representGr = addPreference( tr( "VISU_PREF_REPRESENT_PROPS" ), srangeTab ); - addPreference( tr( "VISU_PREF_SHADING" ), representGr, + // TAB: Representation ; group: "Representation properties" + int representationTab = addPreference( tr( "Representation" ) ); + + int representGr = addPreference( tr( "VISU_REPRESENT_PROPS" ), representationTab ); + + QStringList mesh_modes; + mesh_modes.append( "Points" ); + mesh_modes.append( "Wireframe" ); + mesh_modes.append( "Insideframe" ); + mesh_modes.append( "Surfaceframe" ); + mesh_modes.append( "Surface" ); + QValueList mesh_indices; + mesh_indices.append( 0 ); + mesh_indices.append( 1 ); + mesh_indices.append( 3 ); + mesh_indices.append( 4 ); + mesh_indices.append( 2 ); + + QStringList modes1 = mesh_modes; + modes1.remove( "Surfaceframe" ); + QValueList indices1 = mesh_indices; + indices1.remove( 4 ); + + QStringList modes2 = modes1; + modes2.remove( "Insideframe" ); + QValueList indices2 = indices1; + indices2.remove( 3 ); + + QStringList modes3 = modes2; + modes3.remove( "Surface" ); + QValueList indices3 = indices2; + indices3.remove( 2 ); + + + int mesh_represent = addPreference( tr( "VISU_MESH" ), representGr, LightApp_Preferences::Selector, "VISU", "mesh_represent" ); + setPreferenceProperty( mesh_represent, "strings", mesh_modes ); + setPreferenceProperty( mesh_represent, "indexes", mesh_indices ); + addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "mesh_shrink" ); + + int scalar_map_represent = addPreference( tr( "VISU_SCALAR_MAP" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_map_represent" ); + setPreferenceProperty( scalar_map_represent, "strings", modes1 ); + setPreferenceProperty( scalar_map_represent, "indexes", indices1 ); + addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_map_shrink" ); + + 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 cut_planes_represent = addPreference( tr( "VISU_CUT_PLANES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_planes_represent" ); + setPreferenceProperty( cut_planes_represent, "strings", modes2 ); + setPreferenceProperty( cut_planes_represent, "indexes", indices2 ); + addPreference( "", representGr, LightApp_Preferences::Space ); + + 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 ); + + int deformed_shape_represent = addPreference( tr( "VISU_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "deformed_shape_represent" ); + setPreferenceProperty( deformed_shape_represent, "strings", modes1 ); + setPreferenceProperty( deformed_shape_represent, "indexes", indices1 ); + addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "deformed_shape_shrink" ); + + 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 ); + + 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 ); + + 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 ); + + 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", modes2 ); + setPreferenceProperty( scalar_def_represent, "indexes", indices2 ); + addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" ); + + addPreference( tr( "VISU_USE_SHADING" ), representGr, LightApp_Preferences::Bool, "VISU", "represent_shading" ); } diff --git a/src/VISU_I/VISU_CutLines_i.cc b/src/VISU_I/VISU_CutLines_i.cc index 06595656..9b181be3 100644 --- a/src/VISU_I/VISU_CutLines_i.cc +++ b/src/VISU_I/VISU_CutLines_i.cc @@ -32,6 +32,8 @@ #include "VISU_Convertor.hxx" #include "VISU_PipeLineUtils.hxx" +#include "SUIT_ResourceMgr.h" + #include using namespace VISU; @@ -311,6 +313,9 @@ VISU::CutLines_i { if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){ anActor->SetVTKMapping(true); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU" , "cut_lines_represent", 2); + anActor->SetRepresentation(aDispMode); return anActor; } return NULL; diff --git a/src/VISU_I/VISU_CutPlanes_i.cc b/src/VISU_I/VISU_CutPlanes_i.cc index d5c0ea04..38f9a0e9 100644 --- a/src/VISU_I/VISU_CutPlanes_i.cc +++ b/src/VISU_I/VISU_CutPlanes_i.cc @@ -29,6 +29,8 @@ #include "VISU_CutPlanes_i.hh" #include "VISU_Actor.h" +#include "SUIT_ResourceMgr.h" + using namespace VISU; using namespace std; @@ -189,6 +191,9 @@ VISU::CutPlanes_i { if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){ anActor->SetVTKMapping(true); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU" , "cut_planes_represent", 1); + anActor->SetRepresentation(aDispMode); return anActor; } return NULL; diff --git a/src/VISU_I/VISU_DeformedShape_i.cc b/src/VISU_I/VISU_DeformedShape_i.cc index 83f679ce..46cc36dc 100644 --- a/src/VISU_I/VISU_DeformedShape_i.cc +++ b/src/VISU_I/VISU_DeformedShape_i.cc @@ -31,6 +31,8 @@ #include "VISU_DeformedShapePL.hxx" #include "VISU_Convertor.hxx" +#include "SUIT_ResourceMgr.h" + #include #include @@ -170,9 +172,13 @@ VISU::DeformedShape_i ::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) { VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO); - anActor->SetRepresentation(1); - anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B); anActor->SetVTKMapping(false); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "deformed_shape_represent", 1); + bool toShrink = aResourceMgr->booleanValue("VISU", "deformed_shape_shrink", false); + anActor->SetRepresentation(aDispMode); + if (toShrink) anActor->SetShrink(); + anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B); return anActor; } diff --git a/src/VISU_I/VISU_IsoSurfaces_i.cc b/src/VISU_I/VISU_IsoSurfaces_i.cc index eac046c3..712c9ede 100644 --- a/src/VISU_I/VISU_IsoSurfaces_i.cc +++ b/src/VISU_I/VISU_IsoSurfaces_i.cc @@ -29,6 +29,8 @@ #include "VISU_IsoSurfaces_i.hh" #include "VISU_Actor.h" +#include "SUIT_ResourceMgr.h" + using namespace VISU; using namespace std; @@ -143,6 +145,9 @@ VISU::IsoSurfaces_i { if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){ anActor->SetVTKMapping(true); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU" , "iso_surfaces_represent", 2); + anActor->SetRepresentation(aDispMode); return anActor; } return NULL; diff --git a/src/VISU_I/VISU_Mesh_i.cc b/src/VISU_I/VISU_Mesh_i.cc index a38ea37b..bc5013fb 100644 --- a/src/VISU_I/VISU_Mesh_i.cc +++ b/src/VISU_I/VISU_Mesh_i.cc @@ -35,6 +35,8 @@ #include "SALOME_Event.hxx" +#include "SUIT_ResourceMgr.h" + using namespace VISU; using namespace std; @@ -227,7 +229,7 @@ VISU::Storable* VISU::Mesh_i::Build (int theRestoring) if (myResult->GetInput() == NULL) throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!"); if (!theRestoring) { - myPresentType = VISU::SHADED; + myPresentType = VISU::PresentationType(VISU::GetResourceMgr()->integerValue("VISU" , "mesh_represent", 2)); if(myEntity == VISU::NODE_ENTITY) myPresentType = VISU::POINT; myName = GenerateName().latin1(); @@ -301,6 +303,9 @@ VISU_Actor* VISU::Mesh_i::CreateActor(const Handle(SALOME_InteractiveObject)& th VISU_MeshAct* anActor = VISU_MeshAct::New(); try{ VISU::Prs3d_i::CreateActor(anActor,theIO); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + bool toShrink = aResourceMgr->booleanValue("VISU", "mesh_shrink", false); + if (toShrink) anActor->SetShrink(); UpdateActor(anActor); }catch (...) { anActor->Delete(); diff --git a/src/VISU_I/VISU_Plot3D_i.cc b/src/VISU_I/VISU_Plot3D_i.cc index 0cc631b2..43cbe79f 100644 --- a/src/VISU_I/VISU_Plot3D_i.cc +++ b/src/VISU_I/VISU_Plot3D_i.cc @@ -26,6 +26,8 @@ #include "VISU_Actor.h" +#include "SUIT_ResourceMgr.h" + using namespace VISU; using namespace std; @@ -190,6 +192,9 @@ VISU::Plot3D_i { if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){ anActor->SetVTKMapping(true); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "plot3d_represent", 2); + anActor->SetRepresentation(aDispMode); return anActor; } return NULL; diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc index 2639b5b7..f1fae442 100644 --- a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc +++ b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc @@ -31,6 +31,8 @@ #include "VISU_Convertor.hxx" #include "VISU_ScalarMapAct.h" +#include "SUIT_ResourceMgr.h" + #include #include #include @@ -227,7 +229,11 @@ VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_In { if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::CreateActor:"<<__LINE__<SetRepresentation(2); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2); + bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false); + anActor->SetRepresentation(aDispMode); + if (toShrink) anActor->SetShrink(); anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B); anActor->SetVTKMapping(false); return anActor; diff --git a/src/VISU_I/VISU_ScalarMap_i.cc b/src/VISU_I/VISU_ScalarMap_i.cc index ec5e160b..f80c950b 100644 --- a/src/VISU_I/VISU_ScalarMap_i.cc +++ b/src/VISU_I/VISU_ScalarMap_i.cc @@ -310,9 +310,12 @@ VISU::ScalarMap_i try{ TSuperClass::CreateActor(anActor,theIO); anActor->SetBarVisibility(true); - anActor->SetRepresentation(2); SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "scalar_map_represent", 2); + bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_map_shrink", false); bool toUseShading = aResourceMgr->booleanValue("VISU", "represent_shading", false); + anActor->SetRepresentation(aDispMode); + if (toShrink) anActor->SetShrink(); anActor->SetShading(toUseShading); UpdateActor(anActor); }catch(...){ diff --git a/src/VISU_I/VISU_StreamLines_i.cc b/src/VISU_I/VISU_StreamLines_i.cc index fbeeb75f..b5439316 100644 --- a/src/VISU_I/VISU_StreamLines_i.cc +++ b/src/VISU_I/VISU_StreamLines_i.cc @@ -31,6 +31,8 @@ #include "VISU_StreamLinesPL.hxx" #include "VISU_Convertor.hxx" +#include "SUIT_ResourceMgr.h" + #include #include #include @@ -271,6 +273,9 @@ VISU::StreamLines_i { if(VISU_Actor* anActor = VISU::DeformedShape_i::CreateActor(theIO)){ anActor->SetVTKMapping(true); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "stream_lines_represent", 1); + anActor->SetRepresentation(aDispMode); return anActor; } return NULL; diff --git a/src/VISU_I/VISU_Vectors_i.cc b/src/VISU_I/VISU_Vectors_i.cc index 071ba811..878f25e8 100644 --- a/src/VISU_I/VISU_Vectors_i.cc +++ b/src/VISU_I/VISU_Vectors_i.cc @@ -31,6 +31,8 @@ #include "VISU_VectorsPL.hxx" #include "VISU_Convertor.hxx" +#include "SUIT_ResourceMgr.h" + #include using namespace VISU; @@ -194,6 +196,9 @@ VISU_Actor* VISU::Vectors_i::CreateActor(const Handle(SALOME_InteractiveObject)& anActor->SetBarVisibility(true); anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B); anActor->GetProperty()->SetLineWidth(GetLineWidth()); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "vectors_represent", 1); + anActor->SetRepresentation(aDispMode); UpdateActor(anActor); }catch(...){ anActor->Delete();