]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
VISU 2008 - Introduction of the Feature Edges presentation mode
authorouv <ouv@opencascade.com>
Tue, 5 Aug 2008 10:40:07 +0000 (10:40 +0000)
committerouv <ouv@opencascade.com>
Tue, 5 Aug 2008 10:40:07 +0000 (10:40 +0000)
src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_ScalarMapAct.cxx
src/OBJECT/VISU_ScalarMapAct.h
src/PIPELINE/VISU_DeformedShapePL.cxx
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx
src/PIPELINE/VISU_ScalarMapPL.cxx
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx
src/VISU_I/VISU_Mesh_i.cc
src/VISU_I/VISU_ScalarMap_i.cc

index dfab38087892832c1cd5fca11402611458edea17..2f6fb847eb4c7b4d62f9f85d3c464fdf88a63395 100644 (file)
@@ -297,8 +297,8 @@ VISU_Actor
   if(myRepresentation == VTK_POINTS)
   {
     UnShrink();
-    SetFeatureEdgesEnabled( false );
   }
+  SetFeatureEdgesEnabled( theMode == SVTK::Representation::FeatureEdges );
 }
 
 
index 670a6f1404d8f11c905cdd300471d13489773242..790bc9fc5d8213b5548f2479b2e52c74bcdee7a0 100644 (file)
@@ -346,6 +346,65 @@ VISU_ScalarMapAct
   mySurfaceActor->UnShrink();
 }
 
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapAct
+::SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed)
+{
+  Superclass::SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
+
+  mySurfaceActor->SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
+}
+
+void
+VISU_ScalarMapAct
+::SetFeatureEdgesAngle(vtkFloatingPointType theValue)
+{
+  Superclass::SetFeatureEdgesAngle(theValue);
+
+  mySurfaceActor->SetFeatureEdgesAngle(theValue);
+}
+
+void
+VISU_ScalarMapAct
+::SetFeatureEdgesFlags(bool theIsFeatureEdges,
+                      bool theIsBoundaryEdges,
+                      bool theIsManifoldEdges,
+                      bool theIsNonManifoldEdges)
+{
+  Superclass::SetFeatureEdgesFlags(theIsFeatureEdges,
+                                  theIsBoundaryEdges,
+                                  theIsManifoldEdges,
+                                  theIsNonManifoldEdges);
+
+  mySurfaceActor->SetFeatureEdgesFlags(theIsFeatureEdges,
+                                      theIsBoundaryEdges,
+                                      theIsManifoldEdges,
+                                      theIsNonManifoldEdges);
+}
+
+void
+VISU_ScalarMapAct
+::SetFeatureEdgesColoring(bool theIsColoring)
+{
+  Superclass::SetFeatureEdgesColoring(theIsColoring);
+
+  mySurfaceActor->SetFeatureEdgesColoring(theIsColoring);
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapAct
+::SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled)
+{
+  if(theIsFeatureEdgesEnabled && myRepresentation == VTK_POINTS)
+    return;
+
+  Superclass::SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
+
+  mySurfaceActor->SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
+}
+
 //----------------------------------------------------------------------------
 void
 VISU_ScalarMapAct
index 8589d05df5c3f9dc2349268526b409b874c8d594..d67cfa5f000bb6510dd9be90bb0c721b29b784c2 100644 (file)
@@ -77,6 +77,29 @@ class VTKOCC_EXPORT VISU_ScalarMapAct : public VISU_DataSetActor
   void
   UnShrink(); 
   
+  virtual
+  void
+  SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
+
+  virtual
+  void
+  SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
+
+  virtual
+  void
+  SetFeatureEdgesAngle(vtkFloatingPointType theAngle = 30.0); 
+
+  virtual
+  void
+  SetFeatureEdgesFlags(bool theIsFeatureEdges,
+                      bool theIsBoundaryEdges,
+                      bool theIsManifoldEdges,
+                      bool theIsNonManifoldEdges);
+
+  virtual
+  void
+  SetFeatureEdgesColoring(bool theIsColoring);
+
   virtual
   void
   SetOpacity(vtkFloatingPointType theValue);
index 713dabcbed51001759121a1195dd34202aea41b5..5ca2222b67a1b4d76f81fa5a06a7d7d2fddf3fda 100644 (file)
@@ -42,7 +42,7 @@ VISU_DeformedShapePL
   myScaleFactor(0.0)
 {
   SetIsShrinkable(true);
-  SetIsFeatureEdgesAllowed(false);
+  SetIsFeatureEdgesAllowed(true);
 
   myWarpVector = vtkWarpVector::New();
   myCellDataToPointData = vtkCellDataToPointData::New();
index a2b9b4d32ade9c8c37c0ef2a4603d8555b58ab5d..007820b835d0630afe22e5dd0125b6d490110891 100644 (file)
@@ -57,6 +57,8 @@ VISU_ScalarMapOnDeformedShapePL
 ::VISU_ScalarMapOnDeformedShapePL():
   myScaleFactor(0.0)
 {
+  SetIsFeatureEdgesAllowed(true);
+
   myWarpVector = vtkWarpVector::New();
 
   myScalarsMergeFilter = VISU_MergeFilter::New();
index c14ce395527b4b8487b57d5ee465f4423e43ec36..3a635a55b662fa370a8748a25c4558c02c1e612e 100644 (file)
@@ -54,7 +54,7 @@ VISU_ScalarMapPL
   myMergeFilter(VISU_MergeFilter::New())
 {
   SetIsShrinkable(true);
-  SetIsFeatureEdgesAllowed(false);
+  SetIsFeatureEdgesAllowed(true);
 
   myAppendFilter->SetMergingInputs(true);
   myAppendFilter->Delete();
index 713ae9c25f4dff3e7c982db29d6f57714e88c2c9..958c33bb3f7fb8e8e6e4f5f7c8ed6f2137db4aff 100644 (file)
@@ -2661,7 +2661,7 @@ 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'}";
+  QString aFeatureEdgesType =  " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
 
   aRule = "selcount=1";
   mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType );
@@ -3501,7 +3501,7 @@ void VisuGUI::createPreferences()
   addPreference( tr( "VISU_SHOW_BOUNDARY_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_boundary_edges" );
   addPreference( tr( "VISU_SHOW_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_manifold_edges" );
   addPreference( tr( "VISU_SHOW_NON_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_non_manifold_edges" );
-  addPreference( tr( "VISU_FEATURE_EDGES_COLORING" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "feature_edges_coloring" );
+  //addPreference( tr( "VISU_FEATURE_EDGES_COLORING" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "feature_edges_coloring" );
 }
 
 void VisuGUI::preferencesChanged( const QString& a, const QString& b)
index ac23e2f4b96c87e45e4cc6bd4b9ef2e87a7ef116..17f75578ac62bab7b47345fff9a136fa22785b82 100644 (file)
@@ -65,7 +65,7 @@ VisuGUI_FeatureEdgesPanel::VisuGUI_FeatureEdgesPanel( const VisuGUI* theModule,
   myManifoldEdgesCB = new QCheckBox( tr( "SHOW_MANIFOLD_EDGES" ), myGrp );
   myNonManifoldEdgesCB = new QCheckBox( tr( "SHOW_NON_MANIFOLD_EDGES" ), myGrp );
 
-  myColoringCB = new QCheckBox( tr( "FEATURE_EDGES_COLORING" ), myGrp );
+  //myColoringCB = new QCheckBox( tr( "FEATURE_EDGES_COLORING" ), myGrp );
 
   aLayout->addWidget( anAngleLbl, 0, 0 );
   aLayout->addWidget( myAngleSpinBox, 0, 1 );
@@ -73,7 +73,7 @@ VisuGUI_FeatureEdgesPanel::VisuGUI_FeatureEdgesPanel( const VisuGUI* theModule,
   aLayout->addWidget( myBoundaryEdgesCB, 2, 0, 1, 2 );
   aLayout->addWidget( myManifoldEdgesCB, 3, 0, 1, 2 );
   aLayout->addWidget( myNonManifoldEdgesCB, 4, 0, 1, 2 );
-  aLayout->addWidget( myColoringCB, 5, 0, 1, 2 );
+  //aLayout->addWidget( myColoringCB, 5, 0, 1, 2 );
 
   aTopLayout->addWidget( myGrp );
 
@@ -155,7 +155,7 @@ void VisuGUI_FeatureEdgesPanel::onSelectionEvent()
   myBoundaryEdgesCB->setChecked( anIsBoundaryEdges );
   myManifoldEdgesCB->setChecked( anIsManifoldEdges );
   myNonManifoldEdgesCB->setChecked( anIsNonManifoldEdges );
-  myColoringCB->setChecked( aColoring );
+  //myColoringCB->setChecked( aColoring );
 }
 
 void VisuGUI_FeatureEdgesPanel::onApply()
@@ -167,7 +167,7 @@ void VisuGUI_FeatureEdgesPanel::onApply()
                                   myBoundaryEdgesCB->isChecked(),
                                   myManifoldEdgesCB->isChecked(),
                                   myNonManifoldEdgesCB->isChecked() );
-    myActor->SetFeatureEdgesColoring( myColoringCB->isChecked() );
+    //myActor->SetFeatureEdgesColoring( myColoringCB->isChecked() );
     myActor->Update();
   }
 
index c0032f675f45b6bb27064860c363f666947bdf4c..6cf12c71a9625e33ee4e9d2b1fd967ea10b35c30 100644 (file)
@@ -539,7 +539,6 @@ VISU::Mesh_i
     anActor->GetSurfaceProperty()->SetColor(myCellColor.R, myCellColor.G, myCellColor.B);
     anActor->GetEdgeProperty()->SetColor(myLinkColor.R, myLinkColor.G, myLinkColor.B);
     anActor->GetNodeProperty()->SetColor(myNodeColor.R, myNodeColor.G, myNodeColor.B);
-    anActor->SetFeatureEdgesEnabled(myPresentType == VISU::FEATURE_EDGES);
   }
 }
 
index 14897bde3d55c461eb0ee2da3d5760cb87727f04..ec37d5fa92553c77d9e8cc74810ffb50f3927f8b 100644 (file)
@@ -402,6 +402,14 @@ VISU::ScalarMap_i
     anActor->SetRepresentation(aDispMode);
     if (toShrink && !toSupressShrinking) anActor->SetShrink();
     anActor->SetShading(toUseShading);
+
+    anActor->SetFeatureEdgesAngle( aResourceMgr->doubleValue("VISU", "feature_edges_angle", 0.0) );
+    anActor->SetFeatureEdgesFlags( aResourceMgr->booleanValue("VISU", "show_feature_edges", false),
+                                  aResourceMgr->booleanValue("VISU", "show_boundary_edges", false),
+                                  aResourceMgr->booleanValue("VISU", "show_manifold_edges", false),
+                                  aResourceMgr->booleanValue("VISU", "show_non_manifold_edges", false) );
+    anActor->SetFeatureEdgesColoring( aResourceMgr->booleanValue("VISU", "feature_edges_coloring", false) );
+
     UpdateActor(anActor);
   }catch(...){
     anActor->Delete();