From: ouv Date: Tue, 8 Jul 2008 09:17:11 +0000 (+0000) Subject: VISU 2008 - Introduction of the Feature Edges presentation mode X-Git-Tag: TG_VISU2008_14_07_08~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=db6109684f3cdcff5b95585e625aae0aa06778be;p=modules%2Fvisu.git VISU 2008 - Introduction of the Feature Edges presentation mode --- diff --git a/src/VISUGUI/VISU_msg_en.ts b/src/VISUGUI/VISU_msg_en.ts index 56f7bff6..3318d679 100644 --- a/src/VISUGUI/VISU_msg_en.ts +++ b/src/VISUGUI/VISU_msg_en.ts @@ -98,6 +98,10 @@ number of time stamps or number of components is not the same! VISU_3DCACHE_PREFERENCES3D Cache VISU_ANIMATION_PREFERENCESAnimation + + VISU_BOUNDARY_EDGES + Boundary edges + VISU_COLORS_AND_LABELS Colors && Labels @@ -130,6 +134,22 @@ number of time stamps or number of components is not the same! VISU_DISP_ONLY Display only on creation + + VISU_FEATURE_EDGES + Feature edges + + + VISU_FEATURE_EDGES_ANGLE + Feature edges angle + + + VISU_FEATURE_EDGES_COLORING + Coloring + + + VISU_FEATURE_EDGES_PROPS + Feature edges properties + VISU_FIELD_RANGE Field range @@ -186,6 +206,10 @@ number of time stamps or number of components is not the same! VISU_LOGARITHMIC_SCALING Logarithmic scaling + + VISU_MANIFOLD_EDGES + Manifold edges + VISU_MAX Max: @@ -234,6 +258,10 @@ number of time stamps or number of components is not the same! VISU_NB_STEPS Number of steps + + VISU_NON_MANIFOLD_EDGES + Non-manifold edges + VISU_ORIENTATION Orientation @@ -982,6 +1010,14 @@ Please, refer to the documentation. MEN_EXPORT_TABLE Export Table + + MEN_FEATURE_EDGES + Feature edges + + + MEN_FEATURE_EDGES_DISABLE + Disable feature edges + MEN_FREE_SCALAR_BARS Use Field Range diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 0e138ad5..cd863a7f 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -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 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 indices0 = mesh_indices; + indices0.removeAll( 5 ); - QStringList modes1 = mesh_modes; + QStringList modes1 = modes0; modes1.removeAll( "Insideframe" ); - QList indices1 = mesh_indices; + QList 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) diff --git a/src/VISUGUI/VisuGUI.h b/src/VISUGUI/VisuGUI.h index fbe7ef55..61351cfa 100644 --- a/src/VISUGUI/VisuGUI.h +++ b/src/VISUGUI/VisuGUI.h @@ -144,6 +144,8 @@ protected slots: void OnMakePoints(); void OnMakeShrink(); + void OnMakeFeatureEdges(); + void OnSetShadingOn(); void OnSetShadingOff(); diff --git a/src/VISUGUI/VisuGUI_ActionsDef.h b/src/VISUGUI/VisuGUI_ActionsDef.h index 22633b45..72c49e65 100644 --- a/src/VISUGUI/VisuGUI_ActionsDef.h +++ b/src/VISUGUI/VisuGUI_ActionsDef.h @@ -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 diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index cf25b0b9..ce18a01e 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -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; }