<parameter name="scalar_def_shrink" value="false"/>
<parameter name="represent_shading" value="false"/>
<parameter name="feature_edges_angle" value="30.0"/>
- <parameter name="feature_edges" value="true"/>
- <parameter name="boundary_edges" value="false"/>
- <parameter name="manifold_edges" value="false"/>
- <parameter name="non_manifold_edges" value="false"/>
+ <parameter name="show_feature_edges" value="true"/>
+ <parameter name="show_boundary_edges" value="false"/>
+ <parameter name="show_manifold_edges" value="false"/>
+ <parameter name="show_non_manifold_edges" value="false"/>
<parameter name="feature_edges_coloring" value="false"/>
<parameter name="scalar_bar_horizontal_height" value="0.05"/>
<parameter name="scalar_bar_horizontal_width" value="0.5" />
VisuGUI_SelectionPrefDlg.cxx \
VisuGUI_GaussPointsSelectionPane.cxx \
VisuGUI_FindPane.cxx \
+ VisuGUI_FeatureEdgesPanel.cxx \
VisuGUI_Tools.cxx \
VisuGUI_ViewTools.cxx \
VisuGUI_Selection.cxx \
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 \
</message>
<message><source>VISU_3DCACHE_PREFERENCES</source><translation>3D Cache</translation></message>
<message><source>VISU_ANIMATION_PREFERENCES</source><translation>Animation</translation></message>
- <message>
- <source>VISU_BOUNDARY_EDGES</source>
- <translation>Boundary edges</translation>
- </message>
<message>
<source>VISU_COLORS_AND_LABELS</source>
<translation>Colors && Labels</translation>
<source>VISU_LOGARITHMIC_SCALING</source>
<translation>Logarithmic scaling</translation>
</message>
- <message>
- <source>VISU_MANIFOLD_EDGES</source>
- <translation>Manifold edges</translation>
- </message>
<message>
<source>VISU_MAX</source>
<translation>Max:</translation>
<source>VISU_NB_STEPS</source>
<translation>Number of steps</translation>
</message>
- <message>
- <source>VISU_NON_MANIFOLD_EDGES</source>
- <translation>Non-manifold edges</translation>
- </message>
<message>
<source>VISU_ORIENTATION</source>
<translation>Orientation</translation>
<source>VISU_SCALAR_RANGE</source>
<translation>Scalar range</translation>
</message>
+ <message>
+ <source>VISU_SHOW_BOUNDARY_EDGES</source>
+ <translation>Show boundary edges</translation>
+ </message>
+ <message>
+ <source>VISU_SHOW_FEATURE_EDGES</source>
+ <translation>Show feature edges</translation>
+ </message>
+ <message>
+ <source>VISU_SHOW_MANIFOLD_EDGES</source>
+ <translation>Show manifold edges</translation>
+ </message>
+ <message>
+ <source>VISU_SHOW_NON_MANIFOLD_EDGES</source>
+ <translation>Show non-manifold edges</translation>
+ </message>
<message>
<source>VISU_SHRINK</source>
<translation>Shrink</translation>
<translation>Table</translation>
</message>
</context>
+ <context>
+ <name>VisuGUI_FeatureEdgesPanel</name>
+ <message>
+ <source>WINDOW_TITLE</source>
+ <translation>Feature edges</translation>
+ </message>
+ <message>
+ <source>FEATURE_EDGES_ANGLE</source>
+ <translation>Feature edges angle</translation>
+ </message>
+ <message>
+ <source>FEATURE_EDGES_COLORING</source>
+ <translation>Coloring</translation>
+ </message>
+ <message>
+ <source>FEATURE_EDGES_PROPERTIES</source>
+ <translation>Feature edges properties</translation>
+ </message>
+ <message>
+ <source>SHOW_BOUNDARY_EDGES</source>
+ <translation>Show boundary edges</translation>
+ </message>
+ <message>
+ <source>SHOW_FEATURE_EDGES</source>
+ <translation>Show feature edges</translation>
+ </message>
+ <message>
+ <source>SHOW_MANIFOLD_EDGES</source>
+ <translation>Show manifold edges</translation>
+ </message>
+ <message>
+ <source>SHOW_NON_MANIFOLD_EDGES</source>
+ <translation>Show non-manifold edges</translation>
+ </message>
+ </context>
<context>
<name>VisuGUI_FileDlg</name>
<message>
#include "VisuGUI_Tools.h"
#include "VisuGUI_SelectionPanel.h"
+#include "VisuGUI_FeatureEdgesPanel.h"
#include "VisuGUI_NameDlg.h"
#include "VisuGUI_CursorDlg.h"
#include "VisuGUI_Selection.h"
::VisuGUI():
SalomeApp_Module( "VISU" ),
myDisplayer( 0 ),
- mySelectionPanel( 0 ),
mySlider( NULL ),
mySweep( NULL )
{
{
if (GetActiveViewWindow<SVTK_ViewWindow>(this))
{
- if( mySelectionPanel->isVisible() )
- mySelectionPanel->hide();
- else
- mySelectionPanel->show();
+ if( myPanels.find( SelectionPanelId ) != myPanels.end() )
+ {
+ if( VisuGUI_SelectionPanel* aSelectionPanel =
+ dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
+ {
+ if( aSelectionPanel->isVisible() )
+ aSelectionPanel->hide();
+ else
+ aSelectionPanel->show();
+ }
+ }
}
else
SUIT_MessageBox::warning(GetDesktop(this),
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<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
+ aSelectionPanel->setSelectionMode( anId - VISU_ACTOR_SELECTION );
+ }
}
}
createMenus();
createToolBars();
createPopupMenus();
-
- createSelectionPanel();
+ createPanels();
// tmp
action( VISU_ACTOR_SELECTION )->setChecked( true );
}
}
-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 );
+ }
+ }
}
//***************************************************************************
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);
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" );
}
#ifndef VisuGUI_HeaderFile
#define VisuGUI_HeaderFile
-#include <map>
-#include <set>
+#include <SalomeApp_Module.h>
-#include "SalomeApp_Module.h"
+#include <SVTK_ViewWindow.h>
+#include <VISU_Prs3d_i.hh>
-#include "SALOME_ListIO.hxx"
-#include "VISU_Prs3d_i.hh"
-#include "SVTK_ViewWindow.h"
+#include "VisuGUI_Panel.h"
+#include <map>
+#include <set>
class SUIT_ViewManager;
-class SVTK_ViewWindow;
-class VisuGUI_SelectionPanel;
class VisuGUI_Slider;
class VisuGUI_Sweep;
Q_OBJECT;
public:
+ enum PanelId { SelectionPanelId = 0,
+ FeatureEdgesPanelId };
+public:
VisuGUI();
virtual ~VisuGUI();
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;
--- /dev/null
+// 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 <QCheckBox>
+#include <QGroupBox>
+#include <QKeyEvent>
+#include <QLabel>
+#include <QLayout>
+#include <QPushButton>
+
+#include <QtxDoubleSpinBox.h>
+
+#include <SUIT_MessageBox.h>
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+
+#include <SalomeApp_Application.h>
+
+#include <LightApp_SelectionMgr.h>
+
+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<SalomeApp_Application*>( 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<SVTK_ViewWindow>( 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();
+ }
+}
--- /dev/null
+// 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 <VisuGUI_Panel.h>
+
+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
// Module : VISU
#include "VisuGUI_Panel.h"
+
+#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
#include "SUIT_ResourceMgr.h"
\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 ),
// Create buttons
QWidget* aBtnWg = new QWidget( aGrp );
QHBoxLayout* aBtnWgLayout = new QHBoxLayout( aBtnWg );
- //aBtnWgLayout->setSpacing( 5 );
aBtnWgLayout->addStretch();
class QScrollArea;
class QPushButton;
+class VisuGUI;
+
class VisuGUI_Panel : public QtxDockWidget
{
Q_OBJECT
};
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 );
QPushButton* myApply;
QPushButton* myClose;
QPushButton* myHelp;
+
+ const VisuGUI* myModule;
};
#endif
}
};
-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() );
TopLayout->addWidget( aPrefBtn );
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
- (SUIT_Session::session()->activeApplication());
- mySelectionMgr = anApp->selectionMgr();
- connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionEvent()));
+ SalomeApp_Application* anApp =
+ dynamic_cast<SalomeApp_Application*>( 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;
#include <VisuGUI_Panel.h>
-#include <vtkSmartPointer.h>
-
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;
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 );
VisuGUI_SelectionPrefDlg* myPreferencesDlg;
- const SalomeApp_Module* myModule;
- LightApp_SelectionMgr* mySelectionMgr;
bool myFl;
};
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();
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);
}
}