Salome HOME
Additional fix for issue 0016840: EDF PAL 569: Cut plane on Deformed V5_1_main_20100204
authorouv <ouv@opencascade.com>
Wed, 3 Feb 2010 12:38:21 +0000 (12:38 +0000)
committerouv <ouv@opencascade.com>
Wed, 3 Feb 2010 12:38:21 +0000 (12:38 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_Selection.cxx
src/VISUGUI/VisuGUI_Selection.h

index 2f713a63a6a0f92d9c8c5785f22033118c6897d9..792634a7eb6d84b1403a800190f480132609b0f0 100644 (file)
@@ -3290,7 +3290,7 @@ VisuGUI
   aRule = "selcount=1 and $type in {'VISU::TCUTLINES' 'VISU::TCUTSEGMENT'} and nbNamedChildren=0";
   mgr->setRule( action( VISU_CREATE_TABLE ), aRule );
 
-  aRule = "selcount=1 and ($type in {" + aSimplePrsAll + "})";
+  aRule = "selcount=1 and ($type in {" + aSimplePrsAll + "}) and isFieldPrs=0";
   mgr->setRule( action( VISU_SWEEP ), aRule );
 
   aRule = "client='ObjectBrowser' and selcount>0";
index 949679cf5563e8e4416944ee9f17eb48cf839701..1610288d3f5c7bceac769b93fff6178b527a5e91 100644 (file)
@@ -53,6 +53,7 @@ QVariant VisuGUI_Selection::parameter( const int ind, const QString& p ) const
   QVariant val( LightApp_Selection::parameter( ind, p ) );
   if ( !val.isValid() ) {
     if      ( p == "type"           ) val = QVariant( type( ind ) );
+    else if ( p == "isFieldPrs"     ) val = QVariant( isFieldPrs( ind ) );
     else if ( p == "nbComponents"   ) val = QVariant( nbComponents( ind ) );
     else if ( p == "medEntity"   ) val = QVariant( medEntity( ind ) );
     else if ( p == "medSource"   ) val = QVariant( medSource( ind ) );
@@ -154,6 +155,19 @@ QString VisuGUI_Selection::type( const int ind ) const
 }
 
 
+//---------------------------------------------------------------
+bool VisuGUI_Selection::isFieldPrs( const int ind ) const
+{
+  SalomeApp_Study* aStudy = GetStudy();
+  if ( !aStudy )
+    return false;
+
+  VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
+  VISU::Base_i* aBase = anObjectInfo.myBase;
+  return ( aBase && aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER );
+}
+
+
 //---------------------------------------------------------------
 QString VisuGUI_Selection::nbComponents( const int ind ) const
 {
index e1bf9155aca4d62ad234b09d5248838e4f72f9bc..07fd80242b1eb926117693db5214a121bfced937 100644 (file)
@@ -47,6 +47,7 @@ public:
 
 private:
   QString          type( const int ) const;
+  bool             isFieldPrs( const int ) const;
   QString          nbComponents( const int ) const;
   QString          medEntity( const int ) const;
   QString          medSource( const int ) const;