Visu_scaling.png \
Visu_selectall.png \
Visu_selection_panel.png \
+Visu_slider_panel.png \
+Visu_sweep_panel.png \
Visu_selectionactor.png \
Visu_selectioncell.png \
Visu_selectionedge.png \
VisuGUI_Slider.cxx \
VisuGUI_Sweep.cxx \
VisuGUI_InputPane.cxx \
- VisuGUI_CacheDlg.cxx \
VisuGUI_FieldFilter.cxx \
VisuGUI_ViewExtender.cxx \
VisuGUI_ClippingPlaneMgr.cxx \
VisuGUI_Slider_moc.cxx \
VisuGUI_Sweep_moc.cxx \
VisuGUI_InputPane_moc.cxx \
- VisuGUI_CacheDlg_moc.cxx \
VisuGUI_ViewExtender_moc.cxx \
VisuGUI_ClippingPlaneMgr_moc.cxx \
VisuGUI_SegmentationMgr_moc.cxx
<source>ICON_SELECTION_PANEL</source>
<translation>Visu_selection_panel.png</translation>
</message>
+ <message><source>ICON_SLIDER_PANEL</source><translation>Visu_slider_panel.png</translation></message>
+ <message><source>ICON_SWEEP_PANEL</source><translation>Visu_sweep_panel.png</translation></message>
<message>
<source>ICON_SLIDER_AVI</source>
<translation>Visu_slider_avi.png</translation>
<source>UNITS_LBL</source>
<translation>Units</translation>
</message>
- <message>
- <source>VISU_3DCACHE_PROPS</source>
- <translation>3D Cache properties</translation>
- </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_COLORS_AND_LABELS</source>
<translation>Colors && Labels</translation>
<translation>Arrange Actors</translation>
</message>
<message>
- <source>MEN_CACHE_PROPERTIES</source>
- <translation>Properties</translation>
+ <source>MEN_MANAGE_CACHE</source>
+ <translation>Manage</translation>
</message>
<message>
<source>MEN_CELL_COLOR</source>
<source>MEN_WIREFRAME</source>
<translation>Wireframe</translation>
</message>
- <message>
- <source>TOOL_IMPORT</source>
- <translation>Import Toolbar</translation>
- </message>
- <message>
- <source>TOOL_REPRESENTATION</source>
- <translation>Representation Toolbar</translation>
- </message>
- <message>
- <source>TOOL_SELECTION</source>
- <translation>Selection Toolbar</translation>
- </message>
- <message>
- <source>TOOL_VISUALISATION</source>
- <translation>Visualization Toolbar</translation>
+ <message><source>TOOL_IMPORT</source><translation>Import</translation></message>
+ <message><source>TOOL_REPRESENTATION</source><translation>Representation</translation></message>
+ <message><source>TOOL_SELECTION</source><translation>Selection</translation></message>
+ <message><source>TOOL_NAVIGATION</source><translation>Navigation</translation></message>
+ <message><source>TOOL_VISUALISATION</source><translation>Visualization</translation>
</message>
<message>
<source>USE_BUILD_PROGRESS</source>
</message>
<message>
<source>TOOL_VISUALISATION</source>
- <translation>Visualization Toolbar</translation>
+ <translation>Visualization</translation>
</message>
<message>
<source>TOT_DESK_FILE_SAVE_GUI_STATE</source>
<name>VisuGUI_Sweep</name>
<message><source>TITLE</source><translation>Sweep</translation></message>
+ <message><source>MEN_SWEEP_PANE</source><translation>Sweep</translation></message>
<message><source>NAVIGATION_TAB</source><translation>Navigation</translation></message>
<message><source>START_SWEEP_POSITION</source><translation>0 %</translation></message>
<name>VisuGUI_Slider</name>
<message><source>TITLE</source><translation>Slider</translation></message>
+ <message><source>MEN_SLIDER_PANE</source><translation>Slider</translation></message>
<message><source>NAVIGATION_TAB</source><translation>Navigation</translation></message>
<message><source>IS_CYCLED</source><translation>Cycled</translation></message>
<message><source>AVAILABLE_MEMORY</source><translation>Free:</translation></message>
<message><source>SPEED</source><translation>Speed</translation></message>
-
</context>
<context>
<name>VisuGUI_StreamLinesDlg</name>
#include "VisuGUI_Displayer.h"
#include "VisuGUI_BuildProgressDlg.h"
#include "VisuGUI_TransparencyDlg.h"
-#include "VisuGUI_CacheDlg.h"
#include "VisuGUI_InputPanel.h"
#include "VISU_ScalarMap_i.hh"
VisuGUI
::VisuGUI():
SalomeApp_Module( "VISU" ),
- mySlider( NULL ),
myDisplayer( 0 ),
myInputPanel( 0 ),
- mySelectionPanel( 0 )
+ mySelectionPanel( 0 ),
+ mySlider( NULL ),
+ mySweep( NULL )
{
}
VisuGUI
::OnSweep()
{
- new VisuGUI_Sweep( this, getApp()->desktop(), getApp()->selectionMgr() );
+ mySweep->show();
}
//----------------------------------------------------------------------------
{
SalomeApp_Module::initialize( theApp );
+ mySlider = new VisuGUI_Slider( this, getApp()->desktop(), getApp()->selectionMgr() );
+
+ mySweep = new VisuGUI_Sweep( this, getApp()->desktop(), getApp()->selectionMgr() );
+
createActions();
createMenus();
createToolBars();
tr("MEN_GAUSS_POINT_SELECTION"), "", 0, aParent, true,
this, SLOT(OnSwitchSelectionMode()));
+ // Defenition of the actions for the "Navigation" tool bar
+ registerAction( VISU_SLIDER_PANEL, mySlider->toggleViewAction() );
+ registerAction( VISU_SWEEP_PANEL, mySweep->toggleViewAction() );
+
createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIcon(),
tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
this, SLOT(OnShowAnimation()));
tr("MEN_PLOT3D_FROM_CUTPLANE"), "", 0, aParent, false,
this, SLOT(OnPlot3dFromCutPlane()));
- createAction( VISU_CACHE_PROPERTIES, tr("MEN_CACHE_PROPERTIES"), QIcon(),
- tr("MEN_CACHE_PROPERTIES"), "", 0, aParent, false,
- this, SLOT(OnCacheProperties()));
+ createAction( VISU_MANAGE_CACHE, tr("MEN_MANAGE_CACHE"), QIcon(),
+ tr("MEN_MANAGE_CACHE"), "", 0, aParent, false,
+ this, SLOT( OnManageCache() ) );
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_FULL"));
createAction( VISU_MULTIPR_FULL_RES, tr("MEN_MULTIPR_VIEW_FULL_RES"), QIcon(aPixmap),
createTool( VISU_CELL_SELECTION, aToolId );
createTool( VISU_POINT_SELECTION, aToolId );
createTool( VISU_GAUSS_POINT_SELECTION, aToolId );
+
+ aToolId = createTool( tr( "TOOL_NAVIGATION" ) );
+ createTool( VISU_SLIDER_PANEL, aToolId );
+ createTool( separator(), aToolId );
+ createTool( VISU_SWEEP_PANEL, aToolId );
}
void
if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
if(aBase->GetType() == VISU::TCOLOREDPRS3DCACHE)
- theMenu->addAction( action( VISU_CACHE_PROPERTIES ) );
+ theMenu->addAction( action( VISU_MANAGE_CACHE ) );
}
theMenu->addSeparator();
{
bool aResult = SalomeApp_Module::activateModule( theStudy );
- if ( !mySlider ) {
- mySlider = new VisuGUI_Slider( this, getApp()->desktop(), getApp()->selectionMgr() );
- }
-
studyActivated();
setMenuShown( true );
setToolShown( true );
addPreference( tr( "Generate data table" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_data_table" );
addPreference( tr( "Generate curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_curves" );
- // TAB: "Sweep, Animation"
- int srangeTab = addPreference( tr( "Sweep, Animation" ) );
-
- // group: "Sweeping preferences"
- int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
- setPreferenceProperty( sweepGr, "columns", 2 );
-
- int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGr, LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
- QStringList sweep_modes;
- sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
- sweep_modes.append( tr( "VISU_COS_SWEEP" ) );
- sweep_modes.append( tr( "VISU_SIN_SWEEP" ) );
- indices.clear();
- indices.append( 0 );
- indices.append( 1 );
- indices.append( 2 );
- setPreferenceProperty( modeSw, "strings", sweep_modes );
- setPreferenceProperty( modeSw, "indexes", indices );
-
- int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGr,
- LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
- int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGr,
- LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
- int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGr,
- LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
- int rangeSw = addPreference( tr( "VISU_IS2PI" ), sweepGr, LightApp_Preferences::Selector, "VISU", "sweeping_is2PI" );
- QStringList ranges;
- ranges.append( tr( "PERIOD_PI" ) );
- ranges.append( tr( "PERIOD_2PI" ) );
- indices.clear();
- indices.append( 0 );
- indices.append( 1 );
- setPreferenceProperty( rangeSw, "strings", ranges );
- setPreferenceProperty( rangeSw, "indexes", indices );
-
- setPreferenceProperty( timestep, "min", 0.1 );
- setPreferenceProperty( timestep, "step", 0.1 );
- setPreferenceProperty( timestep, "max", 1000 );
- setPreferenceProperty( nbcycles, "max", 100 );
- setPreferenceProperty( nbsteps, "max", 200 );
-
- // group: "Animation preferences"
- int animationGr = addPreference( tr( "Animation preferences" ), srangeTab );
- setPreferenceProperty( animationGr, "columns", 3 );
+ // TAB: "Sweep, Animation, 3D Cache"
+ int animationTab = addPreference( tr( "Animation" ) );
+ {
+ // group: "3D Cache System prefereces"
+ {
+ int cacheGroup = addPreference( tr( "VISU_3DCACHE_PREFERENCES" ), animationTab );
+ setPreferenceProperty( cacheGroup, "columns", 2 );
+
+ int memory_mode = addPreference( tr( "VISU_MEMORY_MODE" ), cacheGroup,
+ LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
+
+ modes.clear();
+ modes.append( tr( "VISU_MINIMAL" ) );
+ modes.append( tr( "VISU_LIMITED" ) );
+ setPreferenceProperty( memory_mode, "strings", modes );
+
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ setPreferenceProperty( memory_mode, "indexes", indices );
+
+ int memory_limit = addPreference( tr( "VISU_MEMORY_LIMIT" ), cacheGroup,
+ LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
+ setPreferenceProperty( memory_limit, "min", 1 );
+ setPreferenceProperty( memory_limit, "max", 5000 );
+ setPreferenceProperty( memory_limit, "step", 10 );
+ }
- int speed = addPreference( tr( "Speed" ), animationGr, LightApp_Preferences::IntSpin, "VISU", "speed" );
- addPreference( tr( "Cycled animation" ), animationGr, LightApp_Preferences::Bool, "VISU", "cycled_animation" );
- addPreference( tr( "Use proportional timing" ), animationGr, LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
- addPreference( tr( "Clean memory at each frame" ), animationGr, LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
+ // group: "Animation preferences"
+ {
+ int animationGroup = addPreference( tr( "VISU_ANIMATION_PREFERENCES" ), animationTab );
+ setPreferenceProperty( animationGroup, "columns", 3 );
+
+ int speed = addPreference( tr( "Speed" ), animationGroup, LightApp_Preferences::IntSpin, "VISU", "speed" );
+ addPreference( tr( "Cycled animation" ), animationGroup, LightApp_Preferences::Bool, "VISU", "cycled_animation" );
+ addPreference( tr( "Use proportional timing" ), animationGroup, LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
+ addPreference( tr( "Clean memory at each frame" ), animationGroup, LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
+
+ setPreferenceProperty( speed, "min", 1 );
+ setPreferenceProperty( speed, "max", 99 );
+ }
- setPreferenceProperty( speed, "min", 1 );
- setPreferenceProperty( speed, "max", 99 );
+ // group: "Sweeping preferences"
+ {
+ int sweepGroup = addPreference( tr( "VISU_SWEEPING_PREF" ), animationTab );
+ setPreferenceProperty( sweepGroup, "columns", 2 );
+
+ int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGroup, LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
+ QStringList sweep_modes;
+ sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
+ sweep_modes.append( tr( "VISU_COS_SWEEP" ) );
+ sweep_modes.append( tr( "VISU_SIN_SWEEP" ) );
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ indices.append( 2 );
+ setPreferenceProperty( modeSw, "strings", sweep_modes );
+ setPreferenceProperty( modeSw, "indexes", indices );
+
+ int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGroup,
+ LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
+ int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGroup,
+ LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
+ int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGroup,
+ LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
+ int rangeSw = addPreference( tr( "VISU_IS2PI" ), sweepGroup, LightApp_Preferences::Selector, "VISU", "sweeping_is2PI" );
+ QStringList ranges;
+ ranges.append( tr( "PERIOD_PI" ) );
+ ranges.append( tr( "PERIOD_2PI" ) );
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ setPreferenceProperty( rangeSw, "strings", ranges );
+ setPreferenceProperty( rangeSw, "indexes", indices );
+
+ setPreferenceProperty( timestep, "min", 0.1 );
+ setPreferenceProperty( timestep, "step", 0.1 );
+ setPreferenceProperty( timestep, "max", 1000 );
+ setPreferenceProperty( nbcycles, "max", 100 );
+ setPreferenceProperty( nbsteps, "max", 200 );
+ }
+ }
// TAB: Representation ; group: "Representation properties"
int representationTab = addPreference( tr( "Representation" ) );
addPreference( tr( "VISU_DISP_ONLY" ), representGr,
LightApp_Preferences::Bool, "VISU", "display_only" );
-
- // TAB: 3D Cache ; group: "Cache properties"
- int cacheTab = addPreference( tr( "3D Cache" ) );
-
- int cacheGr = addPreference( tr( "VISU_3DCACHE_PROPS" ), cacheTab );
- setPreferenceProperty( cacheGr, "columns", 2 );
-
- int memory_mode = addPreference( tr( "VISU_MEMORY_MODE" ), cacheGr,
- LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
-
- modes.clear();
- modes.append( tr( "VISU_MINIMAL" ) );
- modes.append( tr( "VISU_LIMITED" ) );
- setPreferenceProperty( memory_mode, "strings", modes );
-
- indices.clear();
- indices.append( 0 );
- indices.append( 1 );
- setPreferenceProperty( memory_mode, "indexes", indices );
-
- int memory_limit = addPreference( tr( "VISU_MEMORY_LIMIT" ), cacheGr,
- LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
- setPreferenceProperty( memory_limit, "min", 1 );
- setPreferenceProperty( memory_limit, "max", 5000 );
- setPreferenceProperty( memory_limit, "step", 10 );
}
void VisuGUI::preferencesChanged( const QString& a, const QString& b)
}
}
-void VisuGUI::OnCacheProperties()
+void VisuGUI::OnManageCache()
{
- VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
- if(aSelectionInfo.empty())
- return;
-
- VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
- _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
-
- CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
- if( CORBA::is_nil( anObject ) )
- return;
-
- VISU::ColoredPrs3dCache_var aCache = VISU::GetInterface<VISU::ColoredPrs3dCache>(anObject);
- if( CORBA::is_nil( aCache ) )
- return;
-
- VisuGUI_CacheDlg* aDlg = new VisuGUI_CacheDlg( aCache, this );
- aDlg->exec();
+ mySlider->show();
}
class SUIT_ViewManager;
class SVTK_ViewWindow;
-class VisuGUI_Slider;
class VisuGUI_InputPanel;
class VisuGUI_SelectionPanel;
+class VisuGUI_Slider;
+class VisuGUI_Sweep;
namespace VISU
{
void OnArrangeActors();
void OnPlot3dFromCutPlane();
- void OnCacheProperties();
+ void OnManageCache();
// MULTIPR
void OnMultiprViewFullRes();
VisuGUI_InputPanel* myInputPanel;
VisuGUI_SelectionPanel* mySelectionPanel;
VisuGUI_Slider* mySlider;
+ VisuGUI_Sweep* mySweep;
LightApp_Displayer* myDisplayer;
VISU::TViewToPrs3d myScalarBarsMap;
#define VISU_PLOT3D_FROM_CUTPLANE 4085
-#define VISU_CACHE_PROPERTIES 4090
+#define VISU_MANAGE_CACHE 4090
// MULTIPR
#define VISU_MULTIPR_FULL_RES 4095
#define VISU_POINT_SELECTION 4103
#define VISU_GAUSS_POINT_SELECTION 4104
+#define VISU_SLIDER_PANEL 4200
+#define VISU_SWEEP_PANEL 4300
+
#endif
+++ /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_CacheDlg.cxx
-// Author : Oleg UVAROV
-// Module : VISU
-
-#include "VisuGUI_CacheDlg.h"
-
-#include "VisuGUI_Tools.h"
-
-#include "VISU_PipeLine.hxx"
-
-#include "SUIT_Desktop.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_Session.h"
-#include "SUIT_ResourceMgr.h"
-
-#include "SalomeApp_Module.h"
-
-#include "LightApp_Application.h"
-
-#include "QtxDoubleSpinBox.h"
-
-#include <QButtonGroup>
-#include <QGroupBox>
-#include <QLabel>
-#include <QLayout>
-#include <QLineEdit>
-#include <QPushButton>
-#include <QRadioButton>
-
-using namespace std;
-
-VisuGUI_CacheDlg::VisuGUI_CacheDlg( VISU::ColoredPrs3dCache_var theCache,
- SalomeApp_Module* theModule )
- : QDialog( VISU::GetDesktop( theModule ), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
- myCache( theCache )
-{
- setModal( true );
- setWindowTitle( tr( "CACHE_TITLE" ) );
- setAttribute( Qt::WA_DeleteOnClose );
-
- QVBoxLayout* aTopLayout = new QVBoxLayout( this );
- aTopLayout->setSpacing( 6 );
- aTopLayout->setMargin( 6 );
- //aTopLayout->setAutoAdd( true );
-
- long aMb = 1024 * 1024;
- bool isLimitedMemory = myCache->GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED;
- double aLimitedMemory = myCache->GetLimitedMemory();
- double aFreeMemory = (double)VISU_PipeLine::GetAvailableMemory( 2048 * aMb ) / (double)aMb;
- double anUsedMemory = myCache->GetMemorySize();
- double aLimitedMemoryMax =
-#ifdef WNT
- max
-#else
- std::max
-#endif
- (anUsedMemory + aFreeMemory, aLimitedMemory);
-
- // Settings
- QButtonGroup* aMemoryGroup = new QButtonGroup( this );
- QGroupBox* aGB = new QGroupBox( tr( "MEMORY_MODE" ), this );
- aTopLayout->addWidget( aGB );
- QGridLayout* aGridLay = new QGridLayout( aGB );
- //aMemoryGroup->setRadioButtonExclusive( true );
-
- myLimitedMemoryButton = new QRadioButton( tr( "LIMITED_MEMORY" ), aGB );
- myLimitedMemoryButton->setChecked( isLimitedMemory );
- aGridLay->addWidget( myLimitedMemoryButton, 0, 0 );
-
- myMimimalMemoryButton = new QRadioButton( tr( "MINIMAL_MEMORY" ), aGB );
- myMimimalMemoryButton->setChecked( !isLimitedMemory );
- aGridLay->addWidget( myMimimalMemoryButton, 1, 0 );
-
- myLimitedMemory = new QtxDoubleSpinBox( 1.0, aLimitedMemoryMax, 10.0, aGB );
- myLimitedMemory->setSuffix( " Mb" );
- myLimitedMemory->setValue( aLimitedMemory );
- myLimitedMemory->setEnabled( isLimitedMemory );
- aGridLay->addWidget( myLimitedMemory, 0, 1 );
-
-
- connect( myLimitedMemoryButton, SIGNAL( toggled( bool ) ), myLimitedMemory, SLOT( setEnabled( bool ) ) );
-
- // Current state
- QGroupBox* aStateGroup = new QGroupBox( tr( "MEMORY STATE" ), this );
- aTopLayout->addWidget( aStateGroup );
- //aStateGroup->setColumnLayout( 0, Qt::Vertical );
- //aStateGroup->layout()->setSpacing( 0 );
- //aStateGroup->layout()->setMargin( 0 );
-
- QGridLayout* aStateLayout = new QGridLayout( aStateGroup );
- aStateLayout->setSpacing(6);
- aStateLayout->setMargin(6);
-
- QLabel* aUsedMemoryLabel = new QLabel( tr( "USED_BY_CACHE" ), aStateGroup );
- myUsedMemory = new QLineEdit( aStateGroup );
- myUsedMemory->setText( QString::number( anUsedMemory ) + " Mb" );
- myUsedMemory->setReadOnly( true );
- myUsedMemory->setEnabled( false );
- QPalette aPal = myUsedMemory->palette();
- aPal.setColor( myUsedMemory->foregroundRole(), Qt::black );
- myUsedMemory->setPalette( aPal );
- //myUsedMemory->setPaletteForegroundColor( Qt::black );
-
- QLabel* aFreeMemoryLabel = new QLabel( tr( "FREE" ), aStateGroup );
- myFreeMemory = new QLineEdit( aStateGroup );
- myFreeMemory->setText( QString::number( aFreeMemory ) + " Mb" );
- myFreeMemory->setReadOnly( true );
- myFreeMemory->setEnabled( false );
- aPal = myFreeMemory->palette();
- aPal.setColor( myFreeMemory->foregroundRole(), Qt::black );
- myFreeMemory->setPalette( aPal );
- //myFreeMemory->setPaletteForegroundColor( Qt::black );
-
- aStateLayout->addWidget( aUsedMemoryLabel, 0, 0 );
- aStateLayout->addWidget( myUsedMemory, 0, 1 );
- aStateLayout->addWidget( aFreeMemoryLabel, 1, 0 );
- aStateLayout->addWidget( myFreeMemory, 1, 1 );
-
- // Ok / Cancel
- QGroupBox* GroupButtons = new QGroupBox( this );
- aTopLayout->addWidget( GroupButtons );
- //GroupButtons->setColumnLayout(0, Qt::Vertical );
- //GroupButtons->layout()->setSpacing( 0 );
- //GroupButtons->layout()->setMargin( 0 );
- QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons );
- GroupButtonsLayout->setAlignment( Qt::AlignTop );
- GroupButtonsLayout->setSpacing( 6 );
- GroupButtonsLayout->setMargin( 11 );
-
- QPushButton* buttonOk = new QPushButton( tr( "BUT_OK" ), GroupButtons );
- buttonOk->setAutoDefault( TRUE );
- buttonOk->setDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
- GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
-
- QPushButton* buttonCancel = new QPushButton( tr( "BUT_CANCEL" ) , GroupButtons );
- buttonCancel->setAutoDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
-
- QPushButton* buttonHelp = new QPushButton( tr( "BUT_HELP" ) , GroupButtons );
- buttonHelp->setAutoDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
-
- connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
- connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
- connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
-}
-
-VisuGUI_CacheDlg::~VisuGUI_CacheDlg()
-{
-}
-
-bool VisuGUI_CacheDlg::isLimitedMemory()
-{
- return myLimitedMemoryButton->isChecked();
-}
-
-double VisuGUI_CacheDlg::getLimitedMemory()
-{
- return myLimitedMemory->value();
-}
-
-void VisuGUI_CacheDlg::accept()
-{
- if( isLimitedMemory() )
- {
- myCache->SetMemoryMode( VISU::ColoredPrs3dCache::LIMITED );
- myCache->SetLimitedMemory( (float)getLimitedMemory() );
- }
- else
- myCache->SetMemoryMode( VISU::ColoredPrs3dCache::MINIMAL );
-
-
- QDialog::accept();
-}
-
-void VisuGUI_CacheDlg::onHelp()
-{
- QString aHelpFileName;// = "types_of_gauss_points_presentations_page.html";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- app->onHelpContextModule(app->activeModule() ?
- app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
- else {
- SUIT_MessageBox::warning(0, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
- tr("BUT_OK"));
- }
-}
+++ /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_CacheDlg.h
-// Author : Oleg UVAROV
-// Module : VISU
-
-#ifndef VISUGUI_CACHEDLG_H
-#define VISUGUI_CACHEDLG_H
-
-#include "SALOMEconfig.h"
-#include CORBA_SERVER_HEADER(VISU_Gen)
-
-#include <QDialog>
-
-class QLineEdit;
-class QRadioButton;
-class QtxDoubleSpinBox;
-
-class SalomeApp_Module;
-
-class VisuGUI_CacheDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- VisuGUI_CacheDlg( VISU::ColoredPrs3dCache_var aCache,
- SalomeApp_Module* theModule );
- virtual ~VisuGUI_CacheDlg();
-
-public:
- bool isLimitedMemory();
- double getLimitedMemory();
-
-protected slots:
- virtual void accept();
-
- void onHelp();
-
-private:
- VISU::ColoredPrs3dCache_var myCache;
-
- QRadioButton* myMimimalMemoryButton;
- QRadioButton* myLimitedMemoryButton;
- QtxDoubleSpinBox* myLimitedMemory;
-
- QLineEdit* myUsedMemory;
- QLineEdit* myFreeMemory;
-};
-
-#endif
#include <QCheckBox>
#include <QRadioButton>
#include <QTimer>
+#include <QAction>
/*!
Constructor
QVBoxLayout* aVBoxLayout = new QVBoxLayout( this );
QTabWidget* aTabWidget = new QTabWidget( this );
+ aTabWidget->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
+
aVBoxLayout->addWidget( aTabWidget );
{
myTimeStampStrings->setFocusPolicy( Qt::StrongFocus );
aGridLayout->addWidget( myTimeStampStrings, 2, 3, 1, 2 );
}
- //{
- // QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
- // aGridLayout->addItem( aSpacerItem, 3, 0 );
- //}
}
aTabWidget->addTab( aParent, tr( "NAVIGATION_TAB" ) );
aVBoxLayout->addLayout( aHBoxLayout );
}
- //{
- // QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
- // aVBoxLayout->addItem( aSpacerItem );
- //}
aTabWidget->addTab( aParent, tr( "PROPERTIES_TAB" ) );
}
//----------------------------------------------------------------------------
+ myPlayPixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) );
+ myPausePixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PAUSE" ) );
+
myTimer = new QTimer( this );
// Common
QtxDockWidget* aQtxDockWidget = new QtxDockWidget( true, theParent );
theParent->addDockWidget( Qt::BottomDockWidgetArea , aQtxDockWidget );
aQtxDockWidget->setWidget( this );
- aQtxDockWidget->show();
+
+ myToggleViewAction = aQtxDockWidget->toggleViewAction();
+ myToggleViewAction->setIcon( QIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PANEL" ) ) ) );
+ myToggleViewAction->setToolTip( tr( "MEN_SLIDER_PANE" ) );
+ myToggleViewAction->setText( tr( "MEN_SLIDER_PANE" ) );
+ myToggleViewAction->setCheckable( true );
+
+ connect( myToggleViewAction, SIGNAL( toggled( bool ) ), this, SLOT( onToggleView( bool ) ) );
+ //myToggleViewAction->setChecked( false );
}
-/*!
- Destructor
-*/
+
+//----------------------------------------------------------------------------
VisuGUI_Slider::~VisuGUI_Slider()
{
}
+
+//----------------------------------------------------------------------------
+QAction* VisuGUI_Slider::toggleViewAction()
+{
+ return myToggleViewAction;
+}
+
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onModuleDeactivated()
{
setHidden( true );
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onModuleActivated()
{
setHidden( false );
}
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onMemoryModeChanged( bool )
{
using namespace VISU;
}
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onMemorySizeChanged( double )
{
onMemoryModeChanged( myLimitedMemoryButton->isChecked() );
}
+//----------------------------------------------------------------------------
bool VisuGUI_Slider::checkHolderList()
{
THolderList aHolderList;
return myHolderList.empty();
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::enableControls( bool on )
{
setEnabled( on );
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::updateMemoryState()
{
if( checkHolderList() )
myFreeMemory->updateGeometry();
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onSelectionChanged()
{
//cout << "VisuGUI_Slider::onSelectionChanged()" << endl;
updateMemoryState();
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onTimeStampActivated( int value )
{
mySlider->setValue( value );
onValueChanged( value );
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onFirst()
{
int value = mySlider->minimum();
mySlider->setValue( value );
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onPrevious()
{
int value = mySlider->value() - 1;
mySlider->setValue( value );
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onPlay( bool on )
{
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
if( on )
{
- myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PAUSE" ) ) );
+ myPlayButton->setIcon( myPlayPixmap );
int delay = int(5000.0 / double(mySpeedSlider->value()));
myTimer->start( delay );
else
{
myTimer->stop();
- myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
+ myPlayButton->setIcon( myPausePixmap );
+ }
+}
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_Slider::onToggleView( bool on )
+{
+ if ( !on ) {
+ onPlay( on );
+ hide();
}
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onNext()
{
int value = mySlider->value() + 1;
mySlider->setValue( value );
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onLast()
{
int value = mySlider->maximum();
mySlider->setValue( value );
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onValueChanged( int value )
{
if( checkHolderList() ){
updateMemoryState();
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onSpeedChanged( int value )
{
if(myPlayButton->isChecked()){
}
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onTimeout()
{
int value = mySlider->value();
else
myPlayButton->setChecked( false );
}
+
+
+//----------------------------------------------------------------------------
#define VisuGUI_Slider_HeaderFile
#include <QWidget>
+#include <QPixmap>
#include <vector>
class QRadioButton;
class QMainWindow;
class QTimer;
+class QAction;
class QtxDoubleSpinBox;
class LightApp_SelectionMgr;
LightApp_SelectionMgr* theSelectionMgr );
virtual ~VisuGUI_Slider();
+
+ QAction* toggleViewAction();
public slots:
virtual void onSelectionChanged();
virtual void onTimeout();
+ virtual void onToggleView( bool );
+
void onMemoryModeChanged( bool );
void onMemorySizeChanged( double );
THolderList myHolderList;
QTimer* myTimer;
+ QPixmap myPlayPixmap;
+ QPixmap myPausePixmap;
+ QAction* myToggleViewAction;
};
#endif
#include <QCheckBox>
#include <QRadioButton>
#include <QTimer>
+#include <QAction>
#include <vtkMath.h>
QVBoxLayout* aVBoxLayout = new QVBoxLayout( this );
QTabWidget* aTabWidget = new QTabWidget( this );
+ aTabWidget->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
aVBoxLayout->addWidget( aTabWidget );
{
aVBoxLayout->addLayout( aHBoxLayout );
}
- //{
- // QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
- // aVBoxLayout->addItem( aSpacerItem );
- //}
aTabWidget->addTab( aNavigationTab, tr( "NAVIGATION_TAB" ) );
}
myStepDelay = new QtxDoubleSpinBox( aPropertiesTab );
myStepDelay->setValue( aResourceMgr->doubleValue("VISU", "sweeping_time_step", 0.1) );
aGridLayout->addWidget( myStepDelay, 2, 1, 1, 1 );
-
- QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
- aGridLayout->addItem( aSpacerItem, 3, 0 );
}
aTabWidget->addTab( aPropertiesTab, tr( "PROPERTIES_TAB" ) );
QtxDockWidget* aQtxDockWidget = new QtxDockWidget( true, theParent );
theParent->addDockWidget( Qt::BottomDockWidgetArea , aQtxDockWidget );
aQtxDockWidget->setWidget( this );
- aQtxDockWidget->show();
+ myToggleViewAction = aQtxDockWidget->toggleViewAction();
+ myToggleViewAction->setIcon( QIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SWEEP_PANEL" ) ) ) );
+ myToggleViewAction->setToolTip( tr( "MEN_SWEEP_PANE" ) );
+ myToggleViewAction->setText( tr( "MEN_SWEEP_PANE" ) );
+ myToggleViewAction->setCheckable( true );
+
+ connect( myToggleViewAction, SIGNAL( toggled( bool ) ), this, SLOT( onToggleView( bool ) ) );
+ //myToggleViewAction->setChecked( false );
//----------------------------------------------------------------------------
myTimer = new QTimer( this );
+ myPlayPixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) );
+ myPausePixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PAUSE" ) );
+
connect( myTimer, SIGNAL( timeout() ), SLOT( onTimeout() ) );
connect( myPlayButton, SIGNAL( toggled( bool ) ), SLOT( onPlay( bool ) ) );
onSelectionChanged();
onModeChanged( mySweepMode->currentIndex() );
-
- onPlay( true );
}
{}
+//----------------------------------------------------------------------------
+QAction* VisuGUI_Sweep::toggleViewAction()
+{
+ return myToggleViewAction;
+}
+
+
//----------------------------------------------------------------------------
void VisuGUI_Sweep::onModuleDeactivated()
{
{
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
if ( on ) {
- myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PAUSE" ) ) );
+ myPlayButton->setIcon( myPlayPixmap );
myTimer->start( int( myStepDelay->value() * 1000 ) );
myPlayButton->setChecked( true );
} else {
myTimer->stop();
myPlayButton->setChecked( false );
- myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
+ myPlayButton->setIcon( myPausePixmap );
+ }
+}
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_Sweep::onToggleView( bool on )
+{
+ if ( !on ) {
+ onPlay( on );
+ hide();
}
}
#define VisuGUI_Sweep_HeaderFile
#include <QWidget>
+#include <QPixmap>
class QComboBox;
class QToolButton;
class QCheckBox;
class QMainWindow;
class QTimer;
+class QAction;
class QtxIntSpinBox;
class QtxDoubleSpinBox;
virtual ~VisuGUI_Sweep();
+ QAction* toggleViewAction();
+
public slots:
virtual void onSelectionChanged();
virtual void onTimeout();
+ virtual void onToggleView( bool );
+
void onModuleDeactivated();
void onModuleActivated();
QtxDoubleSpinBox* myStepDelay;
QTimer* myTimer;
+ QPixmap myPlayPixmap;
+ QPixmap myPausePixmap;
+ QAction* myToggleViewAction;
VisuGUI* myModule;