From 7b4cfaf12f78022a83b8b2a3ea4532d6c05ac180 Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 3 Feb 2010 12:38:21 +0000 Subject: [PATCH] Additional fix for issue 0016840: EDF PAL 569: Cut plane on Deformed --- src/VISUGUI/VisuGUI.cxx | 2 +- src/VISUGUI/VisuGUI_Selection.cxx | 14 ++++++++++++++ src/VISUGUI/VisuGUI_Selection.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 2f713a63..792634a7 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -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"; diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index 949679cf..1610288d 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -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 { diff --git a/src/VISUGUI/VisuGUI_Selection.h b/src/VISUGUI/VisuGUI_Selection.h index e1bf9155..07fd8024 100644 --- a/src/VISUGUI/VisuGUI_Selection.h +++ b/src/VISUGUI/VisuGUI_Selection.h @@ -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; -- 2.39.2