]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
VISU 2008 - Introduction of the Feature Edges presentation mode
authorouv <ouv@opencascade.com>
Tue, 8 Jul 2008 09:17:11 +0000 (09:17 +0000)
committerouv <ouv@opencascade.com>
Tue, 8 Jul 2008 09:17:11 +0000 (09:17 +0000)
src/VISUGUI/VISU_msg_en.ts
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h
src/VISUGUI/VisuGUI_ActionsDef.h
src/VISUGUI/VisuGUI_Selection.cxx

index 56f7bff6df4ad160ab699a95aebfd3f8ac956b0d..3318d6790860609432dac479fc676a91b1f3c543 100644 (file)
@@ -98,6 +98,10 @@ number of time stamps or number of components is not the same!</translation>
         </message>
         <message><source>VISU_3DCACHE_PREFERENCES</source><translation>3D Cache</translation></message>
         <message><source>VISU_ANIMATION_PREFERENCES</source><translation>Animation</translation></message>
+        <message>
+            <source>VISU_BOUNDARY_EDGES</source>
+            <translation>Boundary edges</translation>
+        </message>
         <message>
             <source>VISU_COLORS_AND_LABELS</source>
             <translation>Colors &amp;&amp; Labels</translation>
@@ -130,6 +134,22 @@ number of time stamps or number of components is not the same!</translation>
             <source>VISU_DISP_ONLY</source>
             <translation>Display only on creation</translation>
         </message>
+        <message>
+            <source>VISU_FEATURE_EDGES</source>
+            <translation>Feature edges</translation>
+        </message>
+        <message>
+            <source>VISU_FEATURE_EDGES_ANGLE</source>
+            <translation>Feature edges angle</translation>
+        </message>
+        <message>
+            <source>VISU_FEATURE_EDGES_COLORING</source>
+            <translation>Coloring</translation>
+        </message>
+        <message>
+            <source>VISU_FEATURE_EDGES_PROPS</source>
+            <translation>Feature edges properties</translation>
+        </message>
         <message>
             <source>VISU_FIELD_RANGE</source>
             <translation>Field range</translation>
@@ -186,6 +206,10 @@ number of time stamps or number of components is not the same!</translation>
             <source>VISU_LOGARITHMIC_SCALING</source>
             <translation>Logarithmic scaling</translation>
         </message>
+        <message>
+            <source>VISU_MANIFOLD_EDGES</source>
+            <translation>Manifold edges</translation>
+        </message>
         <message>
             <source>VISU_MAX</source>
             <translation>Max:</translation>
@@ -234,6 +258,10 @@ number of time stamps or number of components is not the same!</translation>
             <source>VISU_NB_STEPS</source>
             <translation>Number of steps</translation>
         </message>
+        <message>
+            <source>VISU_NON_MANIFOLD_EDGES</source>
+            <translation>Non-manifold edges</translation>
+        </message>
         <message>
             <source>VISU_ORIENTATION</source>
             <translation>Orientation</translation>
@@ -982,6 +1010,14 @@ Please, refer to the documentation.</translation>
             <source>MEN_EXPORT_TABLE</source>
             <translation>Export Table</translation>
         </message>
+        <message>
+            <source>MEN_FEATURE_EDGES</source>
+            <translation>Feature edges</translation>
+        </message>
+        <message>
+            <source>MEN_FEATURE_EDGES_DISABLE</source>
+            <translation>Disable feature edges</translation>
+        </message>
         <message>
             <source>MEN_FREE_SCALAR_BARS</source>
             <translation>Use Field Range</translation>
index 0e138ad504692311846f8a6b52d4455fd5e510a1..cd863a7f968e2a62cb92d271635a9e551ce6ba79 100644 (file)
@@ -993,6 +993,14 @@ VisuGUI
   ChangeRepresentation(this, VISU::SHRINK);
 }
 
+//----------------------------------------------------------------------------
+void
+VisuGUI
+::OnMakeFeatureEdges()
+{
+  ChangeRepresentation(this, VISU::FEATURE_EDGES);
+}
+
 //----------------------------------------------------------------------------
 void
 VisuGUI
@@ -2216,6 +2224,10 @@ VisuGUI
                 tr("MEN_UNSHRINK"), "", 0, aParent, false,
                 this, SLOT(OnMakeShrink()));
 
+  createAction( VISU_FEATURE_EDGES, tr("MEN_FEATURE_EDGES"), QIcon(),
+                tr("MEN_FEATURE_EDGES"), "", 0, aParent, false,
+                this, SLOT(OnMakeFeatureEdges()));
+
   createAction( VISU_SHADING, tr("MEN_SHADING"), QIcon(),
                 tr("MEN_SHADING"), "", 0, aParent, false,
                 this, SLOT(OnSetShadingOn()));
@@ -2411,8 +2423,8 @@ VisuGUI
   createMenu( VISU_PLOT_3D, aMenuId, 10 ); // Plot3d
   createMenu( VISU_SCALAR_MAP_ON_DEFORMED_SHAPE, aMenuId, 10 ); // scalar map on deformed shape
 
-  aMenuId = createMenu( tr( "MEN_SELECTION" ), -1, -1, 30 );
-  createMenu( VISU_SELECTION_INFO, aMenuId, 10 ); // selection info
+  //aMenuId = createMenu( tr( "MEN_SELECTION" ), -1, -1, 30 );
+  //createMenu( VISU_SELECTION_INFO, aMenuId, 10 ); // selection info
 
   aMenuId = createMenu( tr( "MEN_REPRESENTATION" ), -1, -1, 30 );
   int parentId =
@@ -2534,6 +2546,7 @@ VisuGUI
   mgr->insert( action( VISU_SURFACE )     , parentId, -1, -1 ); // surface
   mgr->insert( action( VISU_INSIDEFRAME ) , parentId, -1, -1 ); // insideframe
   mgr->insert( action( VISU_SURFACEFRAME ), parentId, -1, -1 ); // surfaceframe
+  mgr->insert( action( VISU_FEATURE_EDGES ), parentId, -1, -1 ); // feature edges
   mgr->insert( action( VISU_SHRINK )      , parentId, -1, -1 ); // shrink
   mgr->insert( action( VISU_UNSHRINK )    , parentId, -1, -1 ); // unshrink
   mgr->insert( separator(), parentId, -1, -1 );
@@ -2573,7 +2586,7 @@ VisuGUI
 
   mgr->insert( action( VISU_CURVE_PROPS ), -1, -1, -1 ); // curve properties
 
-  mgr->insert( action( VISU_SELECTION_INFO ), -1, -1, -1 ); // Selection info
+  //mgr->insert( action( VISU_SELECTION_INFO ), -1, -1, -1 ); // Selection info
 
   mgr->insert( action( VISU_MULTIPR_FULL_RES ), -1, -1, -1 );
   mgr->insert( action( VISU_MULTIPR_MED_RES ), -1, -1, -1 );
@@ -2655,23 +2668,26 @@ VisuGUI
   QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
   QString aLineType   = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' "
                         "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' }";
+  QString aFeatureEdgesType =  " and $type in {'VISU::TMESH'}";
 
   aRule = "selcount=1";
   mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType );
   aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
 
   // "Representation" submenu
-  QString aNotPoints = " and $representation in {'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
-  QString aNotWirefr = " and $representation in {'VISU::POINT' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
-  QString aNotSurfac = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
-  QString aNotInside = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::SURFACEFRAME'}";
-  QString aNotSurffr = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}";
+  QString aNotPoints = " and $representation in {'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
+  QString aNotWirefr = " and $representation in {'VISU::POINT' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
+  QString aNotSurfac = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
+  QString aNotInside = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
+  QString aNotSurffr = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::FEATURE_EDGES'}";
+  QString aNotFeatureEdges =  " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
 
   mgr->setRule( action( VISU_POINTS )      , aRule + aPrsType + aNotPoints );
   mgr->setRule( action( VISU_WIREFRAME )   , aRule + aPrsType + aNotWirefr );
   mgr->setRule( action( VISU_SURFACE )     , aRule + aSurfType + aNotSurfac );
   mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + anInsideType + aNotInside );
   mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfFrameType + aNotSurffr );
+  mgr->setRule( action( VISU_FEATURE_EDGES ), aRule + aFeatureEdgesType + aNotFeatureEdges );
 
   mgr->setRule( action( VISU_SHRINK )  , aRule + aShrinkType + " and isShrunk=0" );
   mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1" );
@@ -2733,8 +2749,8 @@ VisuGUI
   mgr->setRule( action( VISU_SWEEP ), aRule );
 
   // "Selection info" popup item
-  aRule = "client='VTKViewer' and selcount=1" + anInsideType;
-  mgr->setRule( action( VISU_SELECTION_INFO ), aRule );
+  //aRule = "client='VTKViewer' and selcount=1" + anInsideType;
+  //mgr->setRule( action( VISU_SELECTION_INFO ), aRule );
 
   aRule = "client='ObjectBrowser' and selcount>0";
   aRule += " and $type in {'VISU::TFIELD'}";
@@ -3384,16 +3400,23 @@ void VisuGUI::createPreferences()
   mesh_modes.append( "Insideframe" );
   mesh_modes.append( "Surfaceframe" );
   mesh_modes.append( "Surface" );
+  mesh_modes.append( "Feature edges" );
   QList<QVariant> mesh_indices;
   mesh_indices.append( 0 );
   mesh_indices.append( 1 );
   mesh_indices.append( 3 );
   mesh_indices.append( 4 );
   mesh_indices.append( 2 );
+  mesh_indices.append( 5 );
+
+  QStringList modes0 = mesh_modes;
+  modes0.removeAll( "Feature edges" );
+  QList<QVariant> indices0 = mesh_indices;
+  indices0.removeAll( 5 );
 
-  QStringList modes1 = mesh_modes;
+  QStringList modes1 = modes0;
   modes1.removeAll( "Insideframe" );
-  QList<QVariant> indices1 = mesh_indices;
+  QList<QVariant> indices1 = indices0;
   indices1.removeAll( 3 );
 
   QStringList modes2 = modes1;
@@ -3413,8 +3436,8 @@ void VisuGUI::createPreferences()
   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", mesh_modes );
-  setPreferenceProperty( scalar_map_represent, "indexes", mesh_indices );
+  setPreferenceProperty( scalar_map_represent, "strings", modes0 );
+  setPreferenceProperty( scalar_map_represent, "indexes", indices0 );
   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" );
@@ -3433,8 +3456,8 @@ void VisuGUI::createPreferences()
   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", mesh_modes );
-  setPreferenceProperty( deformed_shape_represent, "indexes", mesh_indices );
+  setPreferenceProperty( deformed_shape_represent, "strings", modes0 );
+  setPreferenceProperty( deformed_shape_represent, "indexes", indices0 );
   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" );
@@ -3463,6 +3486,24 @@ void VisuGUI::createPreferences()
 
   addPreference( tr( "VISU_DISP_ONLY" ), representGr,
                  LightApp_Preferences::Bool, "VISU", "display_only" );
+
+  // TAB: Feature edges ; group: "Feature edges properties"
+  int featureEdgesTab = addPreference( tr( "VISU_FEATURE_EDGES" ) );
+
+  int featureEdgesGr = addPreference( tr( "VISU_FEATURE_EDGES_PROPS" ), featureEdgesTab );
+  setPreferenceProperty( featureEdgesGr, "columns", 2 );
+
+  int featureEdgesAnglePref = addPreference( tr( "VISU_FEATURE_EDGES_ANGLE" ), featureEdgesGr,
+                                            LightApp_Preferences::DblSpin, "VISU", "feature_edges_angle" );
+  setPreferenceProperty( featureEdgesAnglePref, "step", 1.0 );
+  setPreferenceProperty( featureEdgesAnglePref, "min", 0.0 );
+  setPreferenceProperty( featureEdgesAnglePref, "max", 90.0 );
+
+  addPreference( tr( "VISU_FEATURE_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "feature_edges" );
+  addPreference( tr( "VISU_BOUNDARY_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "boundary_edges" );
+  addPreference( tr( "VISU_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "manifold_edges" );
+  addPreference( tr( "VISU_NON_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "non_manifold_edges" );
+  addPreference( tr( "VISU_FEATURE_EDGES_COLORING" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "feature_edges_coloring" );
 }
 
 void VisuGUI::preferencesChanged( const QString& a, const QString& b)
index fbe7ef558149a23cd4a724e3c9c9a168fb8bc5e9..61351cfa149edbd3bb77c4d0712e9676efca331c 100644 (file)
@@ -144,6 +144,8 @@ protected slots:
   void OnMakePoints();
   void OnMakeShrink();
 
+  void OnMakeFeatureEdges();
+
   void OnSetShadingOn();
   void OnSetShadingOff();
 
index 22633b45cce4288c05bae6ef3bdc52453adc581b..72c49e657d27a4bdf6c6f8d041ad269b201350f2 100644 (file)
@@ -74,6 +74,9 @@
 #define VISU_SHRINK                 4055
 #define VISU_UNSHRINK               4056
 
+#define VISU_FEATURE_EDGES          4091
+#define VISU_FEATURE_EDGES_DISABLE  4092
+
 #define VISU_SHADING                4083
 #define VISU_NOSHADING              4084
 
index cf25b0b9a74162056069a9246d0267af7ec11792..ce18a01e71591db685c580804e3eaf930cb5720a 100644 (file)
@@ -415,6 +415,7 @@ struct TGetRepesentationFunctor: TViewFunctor
       ENUM2STRING( aResStr, VISU::SHADED );
       ENUM2STRING( aResStr, VISU::INSIDEFRAME );
       ENUM2STRING( aResStr, VISU::SURFACEFRAME );
+      ENUM2STRING( aResStr, VISU::FEATURE_EDGES );
     }      
     return aResStr;
   }