From a3eb0d5026866cae884d9ee95416285368e9489a Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 9 Jul 2008 10:49:11 +0000 Subject: [PATCH] VISU 2008 - Introduction of the Feature Edges presentation mode --- resources/SalomeApp.xml | 8 +- src/VISUGUI/Makefile.am | 2 + src/VISUGUI/VISU_msg_en.ts | 63 +++++-- src/VISUGUI/VisuGUI.cxx | 63 ++++--- src/VISUGUI/VisuGUI.h | 22 +-- src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx | 215 ++++++++++++++++++++++ src/VISUGUI/VisuGUI_FeatureEdgesPanel.h | 74 ++++++++ src/VISUGUI/VisuGUI_Panel.cxx | 5 +- src/VISUGUI/VisuGUI_Panel.h | 9 +- src/VISUGUI/VisuGUI_SelectionPanel.cxx | 16 +- src/VISUGUI/VisuGUI_SelectionPanel.h | 15 +- src/VISU_I/VISU_Mesh_i.cc | 18 +- 12 files changed, 430 insertions(+), 80 deletions(-) create mode 100644 src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx create mode 100644 src/VISUGUI/VisuGUI_FeatureEdgesPanel.h diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml index 7bd7d5e5..670acb23 100644 --- a/resources/SalomeApp.xml +++ b/resources/SalomeApp.xml @@ -28,10 +28,10 @@ - - - - + + + + diff --git a/src/VISUGUI/Makefile.am b/src/VISUGUI/Makefile.am index d8166dd7..50a9a6bb 100644 --- a/src/VISUGUI/Makefile.am +++ b/src/VISUGUI/Makefile.am @@ -47,6 +47,7 @@ dist_libVISU_la_SOURCES= \ VisuGUI_SelectionPrefDlg.cxx \ VisuGUI_GaussPointsSelectionPane.cxx \ VisuGUI_FindPane.cxx \ + VisuGUI_FeatureEdgesPanel.cxx \ VisuGUI_Tools.cxx \ VisuGUI_ViewTools.cxx \ VisuGUI_Selection.cxx \ @@ -92,6 +93,7 @@ MOC_FILES= \ VisuGUI_SelectionPrefDlg_moc.cxx \ VisuGUI_GaussPointsSelectionPane_moc.cxx \ VisuGUI_FindPane_moc.cxx \ + VisuGUI_FeatureEdgesPanel_moc.cxx \ VisuGUI_NameDlg_moc.cxx \ VisuGUI_FileDlg_moc.cxx \ VisuGUI_CursorDlg_moc.cxx \ diff --git a/src/VISUGUI/VISU_msg_en.ts b/src/VISUGUI/VISU_msg_en.ts index bf702789..3f3c64a2 100644 --- a/src/VISUGUI/VISU_msg_en.ts +++ b/src/VISUGUI/VISU_msg_en.ts @@ -98,10 +98,6 @@ 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 @@ -206,10 +202,6 @@ 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: @@ -258,10 +250,6 @@ 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 @@ -314,6 +302,22 @@ number of time stamps or number of components is not the same! VISU_SCALAR_RANGE Scalar range + + VISU_SHOW_BOUNDARY_EDGES + Show boundary edges + + + VISU_SHOW_FEATURE_EDGES + Show feature edges + + + VISU_SHOW_MANIFOLD_EDGES + Show manifold edges + + + VISU_SHOW_NON_MANIFOLD_EDGES + Show non-manifold edges + VISU_SHRINK Shrink @@ -1752,6 +1756,41 @@ Please, provide non-empty resulting presentation. Table + + VisuGUI_FeatureEdgesPanel + + WINDOW_TITLE + Feature edges + + + FEATURE_EDGES_ANGLE + Feature edges angle + + + FEATURE_EDGES_COLORING + Coloring + + + FEATURE_EDGES_PROPERTIES + Feature edges properties + + + SHOW_BOUNDARY_EDGES + Show boundary edges + + + SHOW_FEATURE_EDGES + Show feature edges + + + SHOW_MANIFOLD_EDGES + Show manifold edges + + + SHOW_NON_MANIFOLD_EDGES + Show non-manifold edges + + VisuGUI_FileDlg diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 7ba08d0a..6757875b 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -101,6 +101,7 @@ #include "VisuGUI_Tools.h" #include "VisuGUI_SelectionPanel.h" +#include "VisuGUI_FeatureEdgesPanel.h" #include "VisuGUI_NameDlg.h" #include "VisuGUI_CursorDlg.h" #include "VisuGUI_Selection.h" @@ -174,7 +175,6 @@ VisuGUI ::VisuGUI(): SalomeApp_Module( "VISU" ), myDisplayer( 0 ), - mySelectionPanel( 0 ), mySlider( NULL ), mySweep( NULL ) { @@ -1794,10 +1794,17 @@ VisuGUI { if (GetActiveViewWindow(this)) { - if( mySelectionPanel->isVisible() ) - mySelectionPanel->hide(); - else - mySelectionPanel->show(); + if( myPanels.find( SelectionPanelId ) != myPanels.end() ) + { + if( VisuGUI_SelectionPanel* aSelectionPanel = + dynamic_cast( myPanels[ SelectionPanelId ] ) ) + { + if( aSelectionPanel->isVisible() ) + aSelectionPanel->hide(); + else + aSelectionPanel->show(); + } + } } else SUIT_MessageBox::warning(GetDesktop(this), @@ -1819,8 +1826,12 @@ VisuGUI QAction* aRefAction = action( anId ); if( anAction != aRefAction ) aRefAction->setChecked( false ); - else - mySelectionPanel->setSelectionMode( anId - VISU_ACTOR_SELECTION ); + else if( myPanels.find( SelectionPanelId ) != myPanels.end() ) + { + if( VisuGUI_SelectionPanel* aSelectionPanel = + dynamic_cast( myPanels[ SelectionPanelId ] ) ) + aSelectionPanel->setSelectionMode( anId - VISU_ACTOR_SELECTION ); + } } } @@ -1991,8 +2002,7 @@ VisuGUI createMenus(); createToolBars(); createPopupMenus(); - - createSelectionPanel(); + createPanels(); // tmp action( VISU_ACTOR_SELECTION )->setChecked( true ); @@ -2745,14 +2755,20 @@ VisuGUI } } -void VisuGUI::createSelectionPanel() +void VisuGUI::createPanels() { - mySelectionPanel = new VisuGUI_SelectionPanel( this ); - mySelectionPanel->hide(); + myPanels.insert( SelectionPanelId, new VisuGUI_SelectionPanel( this ) ); + myPanels.insert( FeatureEdgesPanelId, new VisuGUI_FeatureEdgesPanel( this ) ); - connect( mySelectionPanel, SIGNAL( selectionModeChanged( int ) ), this, SLOT( OnSwitchSelectionMode( int ) ) ); - - GetDesktop(this)->addDockWidget( Qt::RightDockWidgetArea, mySelectionPanel ); + QMap< PanelId, VisuGUI_Panel* >::iterator it = myPanels.begin(), itEnd = myPanels.end(); + for( ; it != itEnd; ++it ) + { + if( VisuGUI_Panel* aPanel = it.value() ) + { + aPanel->hide(); + GetDesktop(this)->addDockWidget( Qt::RightDockWidgetArea, aPanel ); + } + } } //*************************************************************************** @@ -2970,7 +2986,12 @@ VisuGUI setMenuShown( false ); setToolShown( false ); - mySelectionPanel->hide(); + QMap< PanelId, VisuGUI_Panel* >::iterator it = myPanels.begin(), itEnd = myPanels.end(); + for( ; it != itEnd; ++it ) + { + if( VisuGUI_Panel* aPanel = it.value() ) + aPanel->hide(); + } // Unset actions accelerator keys action(VISU_IMPORT_FROM_FILE)->setShortcuts(QKeySequence::UnknownKey); @@ -3442,14 +3463,14 @@ void VisuGUI::createPreferences() int featureEdgesAnglePref = addPreference( tr( "VISU_FEATURE_EDGES_ANGLE" ), featureEdgesGr, LightApp_Preferences::DblSpin, "VISU", "feature_edges_angle" ); - setPreferenceProperty( featureEdgesAnglePref, "step", 1.0 ); + setPreferenceProperty( featureEdgesAnglePref, "step", 10.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_SHOW_FEATURE_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_feature_edges" ); + 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" ); } diff --git a/src/VISUGUI/VisuGUI.h b/src/VISUGUI/VisuGUI.h index 9d9e6ac3..1ce6b8d1 100644 --- a/src/VISUGUI/VisuGUI.h +++ b/src/VISUGUI/VisuGUI.h @@ -29,19 +29,17 @@ #ifndef VisuGUI_HeaderFile #define VisuGUI_HeaderFile -#include -#include +#include -#include "SalomeApp_Module.h" +#include +#include -#include "SALOME_ListIO.hxx" -#include "VISU_Prs3d_i.hh" -#include "SVTK_ViewWindow.h" +#include "VisuGUI_Panel.h" +#include +#include class SUIT_ViewManager; -class SVTK_ViewWindow; -class VisuGUI_SelectionPanel; class VisuGUI_Slider; class VisuGUI_Sweep; @@ -58,7 +56,10 @@ class VisuGUI: public SalomeApp_Module Q_OBJECT; public: + enum PanelId { SelectionPanelId = 0, + FeatureEdgesPanelId }; +public: VisuGUI(); virtual ~VisuGUI(); @@ -196,11 +197,10 @@ private: void createMenus(); void createToolBars(); void createPopupMenus(); - - void createSelectionPanel(); + void createPanels(); private: - VisuGUI_SelectionPanel* mySelectionPanel; + QMap< PanelId, VisuGUI_Panel* > myPanels; VisuGUI_Slider* mySlider; VisuGUI_Sweep* mySweep; diff --git a/src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx b/src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx new file mode 100644 index 00000000..ac23e2f4 --- /dev/null +++ b/src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx @@ -0,0 +1,215 @@ +// VISU VISUGUI : GUI of VISU component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VisuGUI_FeatureEdgesPanel.cxx +// Author : Oleg Uvarov +// Module : VISU + +#include "VisuGUI_FeatureEdgesPanel.h" + +#include "VisuGUI.h" +#include "VisuGUI_Tools.h" +#include "VisuGUI_ViewTools.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include + +#include + +VisuGUI_FeatureEdgesPanel::VisuGUI_FeatureEdgesPanel( const VisuGUI* theModule, QWidget* theParent ) : + VisuGUI_Panel( tr( "WINDOW_TITLE" ), theModule, theParent, ApplyBtn | CloseBtn | HelpBtn ), + myActor( 0 ) +{ + QVBoxLayout* aTopLayout = new QVBoxLayout( mainFrame() ); + myGrp = new QGroupBox( tr( "FEATURE_EDGES_PROPERTIES" ), mainFrame() ); + + QGridLayout* aLayout = new QGridLayout( myGrp ); + aLayout->setAlignment( Qt::AlignTop ); + + QLabel* anAngleLbl = new QLabel( tr( "FEATURE_EDGES_ANGLE" ), myGrp ); + myAngleSpinBox = new QtxDoubleSpinBox( 0.0, 90.0, 10.0, myGrp ); + + myFeatureEdgesCB = new QCheckBox( tr( "SHOW_FEATURE_EDGES" ), myGrp ); + myBoundaryEdgesCB = new QCheckBox( tr( "SHOW_BOUNDARY_EDGES" ), myGrp ); + 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 ); + + aLayout->addWidget( anAngleLbl, 0, 0 ); + aLayout->addWidget( myAngleSpinBox, 0, 1 ); + aLayout->addWidget( myFeatureEdgesCB, 1, 0, 1, 2 ); + 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 ); + + aTopLayout->addWidget( myGrp ); + + SalomeApp_Application* anApp = + dynamic_cast( SUIT_Session::session()->activeApplication() ); + LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr(); + connect( aSelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionEvent() ) ); +} + +VisuGUI_FeatureEdgesPanel::~VisuGUI_FeatureEdgesPanel() +{ +} + +void VisuGUI_FeatureEdgesPanel::showEvent( QShowEvent* theEvent ) +{ + onSelectionEvent(); + + VisuGUI_Panel::showEvent(theEvent); +} + +VISU_Actor* VisuGUI_FeatureEdgesPanel::getSelectedActor() const +{ + SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow( myModule ); + if( !aViewWindow ) + return 0; + + _PTR(SObject) aSObject; + VISU::Prs3d_i* aPrs3d = 0; + Handle(SALOME_InteractiveObject) anIO; + + VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects( myModule ); + if( aSelectionInfo.size() != 1 ) + return 0; + + VISU::TSelectionItem aSelectionItem = aSelectionInfo.front(); + VISU::TObjectInfo anObjectInfo = aSelectionItem.myObjectInfo; + aPrs3d = GetPrs3dFromBase( anObjectInfo.myBase ); + if( !aPrs3d ) + return 0; + + anIO = aSelectionItem.myIO; + aSObject = anObjectInfo.mySObject; + + VISU_Actor* anActor = + VISU::FindActor( VISU::GetAppStudy( myModule ), aViewWindow, aSObject->GetID().c_str() ); + + return anActor; +} + +void VisuGUI_FeatureEdgesPanel::onSelectionEvent() +{ + myActor = getSelectedActor(); + bool anIsSelected = myActor && myActor->IsFeatureEdgesAllowed(); + + myGrp->setEnabled( anIsSelected ); + myApply->setEnabled( anIsSelected ); + + if( !anIsSelected ) + return; + + if( !myActor->IsFeatureEdgesAllowed() ) + return; + + float anAngle = myActor->GetFeatureEdgesAngle(); + + bool anIsFeatureEdges = false, + anIsBoundaryEdges = false, + anIsManifoldEdges = false, + anIsNonManifoldEdges = false; + myActor->GetFeatureEdgesFlags( anIsFeatureEdges, + anIsBoundaryEdges, + anIsManifoldEdges, + anIsNonManifoldEdges ); + + float aColoring = myActor->GetFeatureEdgesColoring(); + + myAngleSpinBox->setValue( anAngle ); + myFeatureEdgesCB->setChecked( anIsFeatureEdges ); + myBoundaryEdgesCB->setChecked( anIsBoundaryEdges ); + myManifoldEdgesCB->setChecked( anIsManifoldEdges ); + myNonManifoldEdgesCB->setChecked( anIsNonManifoldEdges ); + myColoringCB->setChecked( aColoring ); +} + +void VisuGUI_FeatureEdgesPanel::onApply() +{ + if( myActor ) + { + myActor->SetFeatureEdgesAngle( myAngleSpinBox->value() ); + myActor->SetFeatureEdgesFlags( myFeatureEdgesCB->isChecked(), + myBoundaryEdgesCB->isChecked(), + myManifoldEdgesCB->isChecked(), + myNonManifoldEdgesCB->isChecked() ); + myActor->SetFeatureEdgesColoring( myColoringCB->isChecked() ); + myActor->Update(); + } + + VisuGUI_Panel::onApply(); +} + +void VisuGUI_FeatureEdgesPanel::onClose() +{ + close(); + VisuGUI_Panel::onClose(); +} + +void VisuGUI_FeatureEdgesPanel::onHelp() +{ + QString aHelpFileName = "feature_edges_page.html"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName); + else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif + SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) ); + } + + VisuGUI_Panel::onHelp(); +} + +void VisuGUI_FeatureEdgesPanel::keyPressEvent( QKeyEvent* e ) +{ + VisuGUI_Panel::keyPressEvent( e ); + if ( e->isAccepted() ) + return; + + if ( e->key() == Qt::Key_F1 ) + { + e->accept(); + onHelp(); + } +} diff --git a/src/VISUGUI/VisuGUI_FeatureEdgesPanel.h b/src/VISUGUI/VisuGUI_FeatureEdgesPanel.h new file mode 100644 index 00000000..649c8ad3 --- /dev/null +++ b/src/VISUGUI/VisuGUI_FeatureEdgesPanel.h @@ -0,0 +1,74 @@ +// VISU VISUGUI : GUI of VISU component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VisuGUI_FeatureEdgesPanel.h +// Author : Oleg Uvarov +// Module : VISU + +#ifndef VISUGUI_FEATUREEDGESPANEL_H +#define VISUGUI_FEATUREEDGESPANEL_H + +#include + +class QCheckBox; +class QGroupBox; + +class QtxDoubleSpinBox; + +class VISU_Actor; + +class VisuGUI_FeatureEdgesPanel: public VisuGUI_Panel +{ + Q_OBJECT + +public: + VisuGUI_FeatureEdgesPanel( const VisuGUI* theModule, QWidget* theParent = 0 ); + virtual ~VisuGUI_FeatureEdgesPanel (); + +protected: + virtual void keyPressEvent( QKeyEvent* theEvent ); + virtual void showEvent( QShowEvent* theEvent ); + +private slots: + virtual void onApply(); + virtual void onClose(); + virtual void onHelp(); + + void onSelectionEvent(); + +private: + VISU_Actor* getSelectedActor() const; + +private: + QGroupBox* myGrp; + + QtxDoubleSpinBox* myAngleSpinBox; + QCheckBox* myFeatureEdgesCB; + QCheckBox* myBoundaryEdgesCB; + QCheckBox* myManifoldEdgesCB; + QCheckBox* myNonManifoldEdgesCB; + QCheckBox* myColoringCB; + + VISU_Actor* myActor; +}; + +#endif diff --git a/src/VISUGUI/VisuGUI_Panel.cxx b/src/VISUGUI/VisuGUI_Panel.cxx index fb846ba9..6e0b55bb 100755 --- a/src/VISUGUI/VisuGUI_Panel.cxx +++ b/src/VISUGUI/VisuGUI_Panel.cxx @@ -25,6 +25,8 @@ // Module : VISU #include "VisuGUI_Panel.h" + +#include "VisuGUI.h" #include "VisuGUI_Tools.h" #include "SUIT_ResourceMgr.h" @@ -79,9 +81,11 @@ public: \param theParent parent widget */ VisuGUI_Panel::VisuGUI_Panel( const QString& theName, + const VisuGUI* theModule, QWidget* theParent, const int theBtns ) : QtxDockWidget( theName, theParent ), + myModule( theModule ), myOK( 0 ), myApply( 0 ), myClose( 0 ), @@ -105,7 +109,6 @@ VisuGUI_Panel::VisuGUI_Panel( const QString& theName, // Create buttons QWidget* aBtnWg = new QWidget( aGrp ); QHBoxLayout* aBtnWgLayout = new QHBoxLayout( aBtnWg ); - //aBtnWgLayout->setSpacing( 5 ); aBtnWgLayout->addStretch(); diff --git a/src/VISUGUI/VisuGUI_Panel.h b/src/VISUGUI/VisuGUI_Panel.h index 989cd523..bd513ab5 100755 --- a/src/VISUGUI/VisuGUI_Panel.h +++ b/src/VISUGUI/VisuGUI_Panel.h @@ -33,6 +33,8 @@ class QFrame; class QScrollArea; class QPushButton; +class VisuGUI; + class VisuGUI_Panel : public QtxDockWidget { Q_OBJECT @@ -48,7 +50,10 @@ public: }; public: - VisuGUI_Panel( const QString& theName, QWidget* theParent, const int theBtns = AllBtn ); + VisuGUI_Panel( const QString& theName, + const VisuGUI* theModule, + QWidget* theParent, + const int theBtns = AllBtn ); virtual ~VisuGUI_Panel(); virtual bool isValid( QString& theMessage ); @@ -71,6 +76,8 @@ protected: QPushButton* myApply; QPushButton* myClose; QPushButton* myHelp; + + const VisuGUI* myModule; }; #endif diff --git a/src/VISUGUI/VisuGUI_SelectionPanel.cxx b/src/VISUGUI/VisuGUI_SelectionPanel.cxx index e4cc403d..0a750c34 100644 --- a/src/VISUGUI/VisuGUI_SelectionPanel.cxx +++ b/src/VISUGUI/VisuGUI_SelectionPanel.cxx @@ -122,10 +122,8 @@ public: } }; -VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const SalomeApp_Module* theModule, QWidget* theParent ) : - VisuGUI_Panel( tr("WINDOW_TITLE" ), theParent, CloseBtn | HelpBtn ), - myModule( theModule ), - mySelectionMgr( 0 ), +VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const VisuGUI* theModule, QWidget* theParent ) : + VisuGUI_Panel( tr("WINDOW_TITLE" ), theModule, theParent, CloseBtn | HelpBtn ), myPreferencesDlg( 0 ) { QVBoxLayout* TopLayout = new QVBoxLayout ( mainFrame() ); @@ -304,10 +302,12 @@ VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const SalomeApp_Module* theModul TopLayout->addWidget( aPrefBtn ); - SalomeApp_Application* anApp = dynamic_cast - (SUIT_Session::session()->activeApplication()); - mySelectionMgr = anApp->selectionMgr(); - connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionEvent())); + SalomeApp_Application* anApp = + dynamic_cast( SUIT_Session::session()->activeApplication() ); + LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr(); + connect( aSelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionEvent() ) ); + + connect( this, SIGNAL( selectionModeChanged( int ) ), myModule, SLOT( OnSwitchSelectionMode( int ) ) ); myFl = false; diff --git a/src/VISUGUI/VisuGUI_SelectionPanel.h b/src/VISUGUI/VisuGUI_SelectionPanel.h index 870597ac..b4db3d62 100644 --- a/src/VISUGUI/VisuGUI_SelectionPanel.h +++ b/src/VISUGUI/VisuGUI_SelectionPanel.h @@ -31,18 +31,11 @@ #include -#include - class QLabel; class QLineEdit; class QTableWidget; class QTabWidget; -class LightApp_SelectionMgr; -class SalomeApp_Application; -class SalomeApp_Module; -class SVTK_RenderWindowInteractor; - class VisuGUI_GaussPointsSelectionPane; class VisuGUI_FindPane; class VisuGUI_SelectionPrefDlg; @@ -52,16 +45,14 @@ class VisuGUI_SelectionPanel: public VisuGUI_Panel Q_OBJECT public: - VisuGUI_SelectionPanel( const SalomeApp_Module* theModule, QWidget* theParent = 0 ); + VisuGUI_SelectionPanel( const VisuGUI* theModule, QWidget* theParent = 0 ); virtual ~VisuGUI_SelectionPanel (); public: void setSelectionMode( int theId ); -private: - void keyPressEvent( QKeyEvent* theEvent ); - protected: + virtual void keyPressEvent( QKeyEvent* theEvent ); virtual void showEvent( QShowEvent* theEvent ); virtual void closeEvent( QCloseEvent* theEvent ); @@ -116,8 +107,6 @@ private: VisuGUI_SelectionPrefDlg* myPreferencesDlg; - const SalomeApp_Module* myModule; - LightApp_SelectionMgr* mySelectionMgr; bool myFl; }; diff --git a/src/VISU_I/VISU_Mesh_i.cc b/src/VISU_I/VISU_Mesh_i.cc index 088a3acf..c0032f67 100644 --- a/src/VISU_I/VISU_Mesh_i.cc +++ b/src/VISU_I/VISU_Mesh_i.cc @@ -510,6 +510,14 @@ VISU::Mesh_i SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); bool toShrink = aResourceMgr->booleanValue("VISU", "mesh_shrink", false); if (toShrink) anActor->SetShrink(); + + 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(); @@ -531,15 +539,7 @@ 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); - - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - anActor->SetFeatureEdgesEnabled( myPresentType == VISU::FEATURE_EDGES ); - anActor->SetFeatureEdgesAngle( aResourceMgr->doubleValue("VISU", "feature_edges_angle", 0.0) ); - anActor->SetFeatureEdgesFlags( aResourceMgr->booleanValue("VISU", "feature_edges", false), - aResourceMgr->booleanValue("VISU", "boundary_edges", false), - aResourceMgr->booleanValue("VISU", "manifold_edges", false), - aResourceMgr->booleanValue("VISU", "non_manifold_edges", false) ); - anActor->SetFeatureEdgesColoring( aResourceMgr->booleanValue("VISU", "feature_edges_coloring", false) ); + anActor->SetFeatureEdgesEnabled(myPresentType == VISU::FEATURE_EDGES); } } -- 2.39.2