/*! Gets current resolution of multi resolution structure for the given mesh and part names */
void SetResolution(in EntityName theMeshName, in EntityName thePartName, in Resolution theResolution);
+
+ /*! Gets information about imported MED file */
+ SALOME_MED::MedFileInfo GetMEDFileInfo();
};
//-------------------------------------------------------
VisuGUI_Slider.cxx \
VisuGUI_InputPane.cxx \
VisuGUI_CacheDlg.cxx \
- VisuGUI_FieldFilter.cxx
+ VisuGUI_FieldFilter.cxx \
+ VisuGUI_FileInfoDlg.cxx
MOC_FILES= \
VisuGUI_moc.cxx \
VisuGUI_TransparencyDlg_moc.cxx \
VisuGUI_Slider_moc.cxx \
VisuGUI_InputPane_moc.cxx \
- VisuGUI_CacheDlg_moc.cxx
+ VisuGUI_CacheDlg_moc.cxx \
+ VisuGUI_FileInfoDlg_moc.cxx
nodist_libVISU_la_SOURCES=$(MOC_FILES)
msgid "VisuGUI::MEN_HOLO_RENDER"
msgstr "Holo render"
+
+
+
+msgid "VisuGUI::MEN_FILE_INFO"
+msgstr "MED File information"
+
+msgid "VisuGUI_FileInfoDlg::CAPTION"
+msgstr "File information"
+
+msgid "VisuGUI_FileInfoDlg::FILE_NAME"
+msgstr "File name"
+
+msgid "VisuGUI_FileInfoDlg::FILE_SIZE"
+msgstr "File size (bytes)"
+
+msgid "VisuGUI_FileInfoDlg::MED_VERSION"
+msgstr "MED version"
#include "LightApp_SelectionMgr.h"
#include "LightApp_Selection.h"
#include "LightApp_Preferences.h"
+#include "LightApp_DataOwner.h"
#include "QtxAction.h"
#include "VisuGUI_VectorsDlg.h"
#include "VisuGUI_TableDlg.h"
+#include "VisuGUI_FileInfoDlg.h"
#include "SALOMEconfig.h"
#include CORBA_SERVER_HEADER(MED_Gen)
createAction( VISU_MULTIPR_HIDE, tr("MEN_MULTIPR_VIEW_HIDE"), QIconSet(aPixmap),
tr("MEN_MULTIPR_VIEW_HIDE"), "", 0, aParent, false,
this, SLOT(OnMultiprViewHide()));
+
+ createAction( VISU_FILE_INFO, tr("MEN_FILE_INFO"), QIconSet(),
+ tr("MEN_FILE_INFO"), "", 0, aParent, false,
+ this, SLOT(OnFileInfo()));
}
void
mgr->insert( action( VISU_MULTIPR_MED_RES ), -1, -1, -1 );
mgr->insert( action( VISU_MULTIPR_LOW_RES ), -1, -1, -1 );
mgr->insert( action( VISU_MULTIPR_HIDE ), -1, -1, -1 );
-
+
+ mgr->insert( action( VISU_FILE_INFO ), -1, -1, -1 );
+
// Rules
QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
QString aCustomRule = aRule + "resolutionState!='H'";
mgr->setRule( action( VISU_MULTIPR_HIDE), aCustomRule, true );
}
+
+ mgr->setRule( action( VISU_FILE_INFO ), "selcount=1 and type in {'VISU::TRESULT'}", true );
}
//***************************************************************************
QApplication::restoreOverrideCursor();
}
+
+//---------------------------------------------------------------
+void VisuGUI::OnFileInfo()
+{
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() );
+ SUIT_DataOwnerPtrList lst;
+ getApp()->selectionMgr()->selected( lst );
+ LightApp_DataOwner* owner = dynamic_cast<LightApp_DataOwner*>( lst.first().get() );
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry( aStudy, owner->entry() );
+ VISU::Result_i* aCResult = dynamic_cast<VISU::Result_i*>( anObjectInfo.myBase );
+ if(!aCResult)
+ return;
+ VisuGUI_FileInfoDlg dlg( getApp()->desktop(), aCResult->GetMEDFileInfo() );
+ dlg.exec();
+}
void OnMultiprViewHide();
void OnMultiprChangeRes(VISU::Result::Resolution theResolution);
+ void OnFileInfo();
+
protected:
virtual LightApp_Selection* createSelection() const;
#define VISU_MULTIPR_LOW_RES 4097
#define VISU_MULTIPR_HIDE 4098
+#define VISU_FILE_INFO 4100
+
#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_FileInfoDlg.cxx
+// Author : Alexandre SOLOVYOV
+// Module : VISU
+// $Header$
+
+#include <VisuGUI_FileInfoDlg.h>
+
+#include <MED_Common.hxx>
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+
+VisuGUI_FileInfoDlg::VisuGUI_FileInfoDlg( QWidget* parent, SALOME_MED::MedFileInfo* inf )
+ : QtxDialog( parent, 0, true, false, QtxDialog::OK )
+{
+ setCaption( tr( "CAPTION" ) );
+
+ QLineEdit* fname = new QLineEdit( mainFrame() );
+ fname->setReadOnly( true );
+ QLineEdit* fsize = new QLineEdit( mainFrame() );
+ fsize->setReadOnly( true );
+ QLineEdit* medversion = new QLineEdit( mainFrame() );
+ medversion->setReadOnly( true );
+
+ QGridLayout* lay = new QGridLayout( mainFrame(), 4, 2, 5, 5 );
+ lay->addWidget( new QLabel( tr( "FILE_NAME" ), mainFrame() ), 0, 0 );
+ lay->addWidget( fname, 0, 1 );
+ lay->addWidget( new QLabel( tr( "FILE_SIZE" ), mainFrame() ), 1, 0 );
+ lay->addWidget( fsize, 1, 1 );
+ lay->addWidget( new QLabel( tr( "MED_VERSION" ), mainFrame() ), 2, 0 );
+ lay->addWidget( medversion, 2, 1 );
+
+ fname->setText( (char*)inf->fileName );
+ fsize->setText( QString::number( inf->fileSize ) );
+
+ QString version;
+ if( inf->major>=0 )
+ {
+ version = QString::number( inf->major );
+ if( inf->minor>=0 )
+ {
+ version += "." + QString::number( inf->minor );
+ if( inf->release>=0 )
+ version += "." + QString::number( inf->release );
+ }
+ }
+ medversion->setText( version );
+ setFixedSize( 640, 480 );
+}
+
+VisuGUI_FileInfoDlg::~VisuGUI_FileInfoDlg()
+{
+}
--- /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_FileInfoDlg.h
+// Author : Alexandre SOLOVYOV
+// Module : VISU
+// $Header$
+
+#ifndef VISUGUI_FILE_INFO_DIALOG
+#define VISUGUI_FILE_INFO_DIALOG
+
+#include <MED.hh>
+#include <QtxDialog.h>
+
+class VisuGUI_FileInfoDlg : public QtxDialog
+{
+ Q_OBJECT
+
+public:
+ VisuGUI_FileInfoDlg( QWidget*, SALOME_MED::MedFileInfo* );
+ virtual ~VisuGUI_FileInfoDlg();
+};
+
+#endif
return components;
}
+
+SALOME_MED::MedFileInfo* VISU::Result_i::GetMEDFileInfo()
+{
+ SALOME_MED::MedFileInfo_var res = new SALOME_MED::MedFileInfo();
+
+ QString fpath = myFileInfo.absFilePath();
+ res->fileName = fpath.latin1();
+ res->fileSize = myFileInfo.size();
+ int major, minor, release;
+ if( !MED::getMEDVersion( fpath.latin1(), major, minor, release ) )
+ {
+ major = -1;
+ minor = -1;
+ release = -1;
+ }
+ res->major = major;
+ res->minor = minor;
+ res->release = release;
+ return res._retn();
+}
ConnectObserver(TResultObserver* theObserver,
boost::signalslib::connection& theConnection);
+ virtual
+ SALOME_MED::MedFileInfo*
+ GetMEDFileInfo();
+
typedef boost::signal0<void> TUpdateObserverSignal;
typedef VISU_Convertor TInput;