]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
PAL10721. OCC_debug_for_3_2_0b1 mergeto_trunk_06May06
authormzn <mzn@opencascade.com>
Fri, 5 May 2006 09:05:59 +0000 (09:05 +0000)
committermzn <mzn@opencascade.com>
Fri, 5 May 2006 09:05:59 +0000 (09:05 +0000)
13 files changed:
resources/SalomeApp.xml
src/VISUGUI/VISU_msg_en.po
src/VISUGUI/VisuGUI.cxx
src/VISU_I/VISU_CutLines_i.cc
src/VISU_I/VISU_CutPlanes_i.cc
src/VISU_I/VISU_DeformedShape_i.cc
src/VISU_I/VISU_IsoSurfaces_i.cc
src/VISU_I/VISU_Mesh_i.cc
src/VISU_I/VISU_Plot3D_i.cc
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_StreamLines_i.cc
src/VISU_I/VISU_Vectors_i.cc

index 8b10eebb0736df8d82ac9eec0c15558dca597626..8fa38a99c559c035544266011dbe61888115921b 100644 (file)
@@ -6,7 +6,21 @@
     <!-- Other module preferences -->
     <parameter name="use_build_progress" value="false"/>
     <parameter name="full_med_loading"   value="false"/>
-    <parameter name="represent_shading"  value="false"/>
+    <parameter name="mesh_represent"           value="2"/>
+    <parameter name="mesh_shrink"              value="false"/>
+    <parameter name="scalar_map_represent"     value="2"/>
+    <parameter name="scalar_map_shrink"        value="false"/>
+    <parameter name="iso_surfaces_represent"   value="2"/>
+    <parameter name="cut_planes_represent"     value="2"/>
+    <parameter name="cut_lines_represent"      value="1"/>
+    <parameter name="deformed_shape_represent" value="1"/>
+    <parameter name="deformed_shape_shrink"    value="false"/>
+    <parameter name="vectors_represent"        value="1"/>
+    <parameter name="stream_lines_represent"   value="1"/>
+    <parameter name="plot3d_represent"         value="2"/>
+    <parameter name="scalar_def_represent"     value="2"/>
+    <parameter name="scalar_def_shrink"        value="false"/>
+    <parameter name="represent_shading"        value="false"/>
     <parameter name="scalar_bar_horizontal_height" value="0.05"/>
     <parameter name="scalar_bar_horizontal_width"  value="0.5" />
     <parameter name="scalar_bar_horizontal_x" value="0.01"/>
index 8f2d484b1b9e2d2459f545d1aebaecc015d821d7..6f3156eeac93986433cc149194d9c1ec1c629c59 100644 (file)
@@ -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
index e6b590e30b4f1dbe072c720432a4975360a4abc2..de9daebf7d4224a574f0d7b5c5c7b0566e087234 100644 (file)
@@ -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<QVariant> 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<QVariant> indices1 = mesh_indices;
+  indices1.remove( 4 );
+  
+  QStringList modes2 = modes1;
+  modes2.remove( "Insideframe" );
+  QValueList<QVariant> indices2 = indices1;
+  indices2.remove( 3 );
+
+  QStringList modes3 = modes2;
+  modes3.remove( "Surface" );
+  QValueList<QVariant> 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" );
 }
 
index 065956566954f254a41e8649615801b69cc470d9..9b181be3bdf2dd9673dc026701f54f434156a846 100644 (file)
@@ -32,6 +32,8 @@
 #include "VISU_Convertor.hxx"
 #include "VISU_PipeLineUtils.hxx"
 
+#include "SUIT_ResourceMgr.h"
+
 #include <vtkAppendPolyData.h>
 
 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;
index d5c0ea04ac4fd0c0057b12bae0c172e453b178d3..38f9a0e92a34ab6b69068ef08d964f5f0a4e9e12 100644 (file)
@@ -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;
index 83f679ce03552b0a79252f047ada9e81046c6fa3..46cc36dc2e693d1eac2caf50640421bc698ae80d 100644 (file)
@@ -31,6 +31,8 @@
 #include "VISU_DeformedShapePL.hxx"
 #include "VISU_Convertor.hxx"
 
+#include "SUIT_ResourceMgr.h"
+
 #include <vtkDataSetMapper.h>
 #include <vtkProperty.h>
 
@@ -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;
 }
 
index eac046c3284345a74253a7bd3369366ee9555ae1..712c9ede80058d1414c512482c09e9b5045f9339 100644 (file)
@@ -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;
index a38ea37bf2273d9dae712885ff42dd3215a1d232..bc5013fbec396ab9644e9795063931f4660dfe19 100644 (file)
@@ -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();
index 0cc631b20c278920007658e0fc3ff79aed51ed7c..43cbe79f11c1824480637fba6cd4ea6994572828 100644 (file)
@@ -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;
index 2639b5b7078a723abdadd94501c42008d6000639..f1fae4422ef5ae657f950e5202c935b741d1f132 100644 (file)
@@ -31,6 +31,8 @@
 #include "VISU_Convertor.hxx"
 #include "VISU_ScalarMapAct.h"
 
+#include "SUIT_ResourceMgr.h"
+
 #include <vtkUnstructuredGrid.h>
 #include <vtkProperty.h>
 #include <vtkMapper.h>
@@ -227,7 +229,11 @@ VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_In
 {
   if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::CreateActor:"<<__LINE__<<endl;
   VISU_Actor* anActor = TSuperClass::CreateActor(theIO);
-  anActor->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;
index ec5e160ba5f3ca9bb6cc33b88c5643c90110a612..f80c950b204624e01e6712ac56c22d76fb6e3c1c 100644 (file)
@@ -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(...){
index fbeeb75f5c204a386db9f79602741464f6536c6b..b5439316311eff8ac8de7d3dd4504583d55f9169 100644 (file)
@@ -31,6 +31,8 @@
 #include "VISU_StreamLinesPL.hxx"
 #include "VISU_Convertor.hxx"
 
+#include "SUIT_ResourceMgr.h"
+
 #include <vtkDataSetMapper.h>
 #include <vtkAppendFilter.h>
 #include <vtkUnstructuredGrid.h>
@@ -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;
index 071ba81109455fc4f7672e11ac95d854ce3f8da3..878f25e823787d150c73698891fee802a5cebc26 100644 (file)
@@ -31,6 +31,8 @@
 #include "VISU_VectorsPL.hxx"
 #include "VISU_Convertor.hxx"
 
+#include "SUIT_ResourceMgr.h"
+
 #include <vtkProperty.h>
 
 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();