--- /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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : VVTK_RecorderDlg.cxx
+// Author : Oleg UVAROV
+// Module : VISU
+
+#include "VVTK_RecorderDlg.h"
+#include "VVTK_Recorder.h"
+
+#include "SUIT_FileDlg.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+
+#include "QtxDblSpinBox.h"
+#include "QtxIntSpinBox.h"
+
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+
+/*!
+ * Constructor
+ */
+VVTK_RecorderDlg::VVTK_RecorderDlg( QWidget* theParent, VVTK_Recorder* theRecorder ):
+ QDialog( theParent, "VVTK_RecorderDlg", false ),
+ myRecorder( theRecorder )
+{
+ setCaption( tr( "DLG_RECORDER_TITLE" ) );
+
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+
+ QVBoxLayout* aTopLayout = new QVBoxLayout( this );
+ aTopLayout->setSpacing( 6 );
+ aTopLayout->setMargin( 6 );
+ aTopLayout->setAutoAdd( true );
+
+ // Settings
+ QGroupBox* mySettingsBox = new QGroupBox( tr( "SETTINGS" ), this );
+ mySettingsBox->setColumnLayout( 0, Qt::Vertical );
+ mySettingsBox->layout()->setSpacing( 0 );
+ mySettingsBox->layout()->setMargin( 0 );
+
+ QGridLayout* aSettingsLayout = new QGridLayout( mySettingsBox->layout() );
+ aSettingsLayout->setSpacing( 6 );
+ aSettingsLayout->setMargin( 11 );
+
+ QLabel* aFileNameLabel = new QLabel( tr( "FILE_NAME" ), mySettingsBox );
+ myFileNameLineEdit = new QLineEdit( mySettingsBox );
+ myFileNameLineEdit->setMinimumWidth( 250 );
+ myFileNameLineEdit->setReadOnly( true );
+
+ QPushButton* aFileNameButton = new QPushButton( mySettingsBox );
+ aFileNameButton->setAutoDefault( false );
+ aFileNameButton->setPixmap( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
+ connect( aFileNameButton, SIGNAL( clicked() ), this, SLOT( onBrowseFile() ) );
+
+ QLabel* aRecordingModeLabel = new QLabel( tr( "RECORDING_MODE" ), mySettingsBox );
+ myRecordingModeComboBox = new QComboBox( mySettingsBox );
+ myRecordingModeComboBox->insertItem( tr( "SKIPPED_FRAMES" ) );
+ myRecordingModeComboBox->insertItem( tr( "ALL_DISLPAYED_FRAMES" ) );
+ myRecordingModeComboBox->setCurrentItem( aResourceMgr->integerValue( "VISU", "recorder_mode", 1 ) );
+
+ QLabel* aFPSLabel = new QLabel( tr( "FPS" ), mySettingsBox );
+ myFPSSpinBox = new QtxDblSpinBox( 0.1, 100.0, 1.0, mySettingsBox );
+ myFPSSpinBox->setValue( aResourceMgr->doubleValue( "VISU", "recorder_fps", 10.0 ) );
+
+ QLabel* aQualityLabel = new QLabel( tr( "QUALITY" ), mySettingsBox );
+ myQualitySpinBox = new QtxIntSpinBox( 1, 100, 1, mySettingsBox );
+ myQualitySpinBox->setValue( aResourceMgr->integerValue( "VISU", "recorder_quality", 80 ) );
+
+ myProgressiveCheckBox = new QCheckBox( tr( "PROGRESSIVE" ), mySettingsBox );
+ myProgressiveCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "recorder_progressive", false ) );
+
+ aSettingsLayout->addWidget( aFileNameLabel, 0, 0 );
+ aSettingsLayout->addMultiCellWidget( myFileNameLineEdit, 1, 1, 0, 1 );
+ aSettingsLayout->addWidget( aFileNameButton, 1, 2 );
+ aSettingsLayout->addWidget( aRecordingModeLabel, 2, 0 );
+ aSettingsLayout->addWidget( myRecordingModeComboBox, 2, 1 );
+ aSettingsLayout->addWidget( aFPSLabel, 3, 0 );
+ aSettingsLayout->addWidget( myFPSSpinBox, 3, 1 );
+ aSettingsLayout->addWidget( aQualityLabel, 4, 0 );
+ aSettingsLayout->addWidget( myQualitySpinBox, 4, 1 );
+ aSettingsLayout->addWidget( myProgressiveCheckBox, 5, 0 );
+
+ // Start / Close
+ QGroupBox* CommonGroup = new QGroupBox( this );
+ CommonGroup->setColumnLayout(0, Qt::Vertical );
+ CommonGroup->layout()->setSpacing( 0 );
+ CommonGroup->layout()->setMargin( 0 );
+ QGridLayout* CommonGroupLayout = new QGridLayout( CommonGroup->layout() );
+ CommonGroupLayout->setAlignment( Qt::AlignTop );
+ CommonGroupLayout->setSpacing( 6 );
+ CommonGroupLayout->setMargin( 11 );
+
+ QPushButton* aStartButton = new QPushButton( tr( "START" ), CommonGroup );
+ aStartButton->setAutoDefault( true );
+ aStartButton->setDefault( true );
+ CommonGroupLayout->addWidget( aStartButton, 0, 0 );
+ CommonGroupLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
+
+ QPushButton* aCloseButton = new QPushButton( tr( "CLOSE" ), CommonGroup );
+ aCloseButton->setAutoDefault( true );
+ CommonGroupLayout->addWidget( aCloseButton, 0, 2 );
+
+ connect( aStartButton, SIGNAL( clicked() ), this, SLOT( onStart() ) );
+ connect( aCloseButton, SIGNAL( clicked() ), this, SLOT( onClose() ) );
+}
+
+VVTK_RecorderDlg::~VVTK_RecorderDlg()
+{
+}
+
+void VVTK_RecorderDlg::show()
+{
+ if( onBrowseFile() )
+ QWidget::show();
+}
+
+void VVTK_RecorderDlg::onStart()
+{
+ if( myFileName.isNull() )
+ return;
+
+ myRecorder->SetName( myFileName.latin1() );
+
+ myRecorder->SetUseSkippedFrames( myRecordingModeComboBox->currentItem() == 0 );
+ myRecorder->SetNbFPS( myFPSSpinBox->value() );
+ myRecorder->SetQuality( myQualitySpinBox->value() );
+ myRecorder->SetProgressiveMode( myProgressiveCheckBox->isChecked() );
+
+ accept();
+
+}
+
+void VVTK_RecorderDlg::onClose()
+{
+ reject();
+}
+
+bool VVTK_RecorderDlg::onBrowseFile()
+{
+ QString aRootDir = QString( getenv( "VISU_ROOT_DIR") );
+
+ QStringList aFilter;
+ aFilter.append( tr( "FLT_AVI_FILES" ) );
+ aFilter.append( tr( "FLT_ALL_FILES" ) );
+
+ QString aFileName = SUIT_FileDlg::getFileName( this, getenv( "HOME" ), aFilter,
+ tr( "FILE_NAME" ), false );
+
+ if( aFileName.isNull() )
+ return false;
+
+ myFileName = aFileName;
+ myFileNameLineEdit->setText( aFileName.section( '/', -1 ) );
+
+ return true;
+}
--- /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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : VVTK_RecorderDlg.h
+// Author : Oleg UVAROV
+// Module : VISU
+// $Header$
+
+#ifndef VVTK_RECORDERDLG_H
+#define VVTK_RECORDERDLG_H
+
+#include <qdatetime.h>
+#include <qdialog.h>
+
+class QCheckBox;
+class QComboBox;
+class QGroupBox;
+class QLCDNumber;
+class QLineEdit;
+class QPushButton;
+class QTimer;
+
+class QtxDblSpinBox;
+class QtxIntSpinBox;
+
+class VVTK_Recorder;
+
+//! Recorder Dialog.
+class VVTK_RecorderDlg : public QDialog
+{
+ Q_OBJECT
+
+public:
+ VVTK_RecorderDlg( QWidget*, VVTK_Recorder* );
+ ~VVTK_RecorderDlg();
+
+ virtual void show();
+
+ QString fileName() const { return myFileName; }
+
+protected slots:
+ void onStart();
+ void onClose();
+
+ bool onBrowseFile();
+
+private:
+ VVTK_Recorder* myRecorder;
+ QString myFileName;
+
+ QLineEdit* myFileNameLineEdit;
+
+ QComboBox* myRecordingModeComboBox;
+ QtxDblSpinBox* myFPSSpinBox;
+ QtxIntSpinBox* myQualitySpinBox;
+ QCheckBox* myProgressiveCheckBox;
+
+};
+
+#endif