DRS_FAIL // general failure (exception etc.)
};
+ /*!
+ * Enumeration for DriverMED (used by Perform() method)
+ */
+ enum MED_VERSION // in the order of severity
+ {
+ MED_V2_1,
+ MED_V2_2
+ };
+
typedef sequence<log_block> log_array;
raises (SALOME::SALOME_Exception);
/*!
- * Export Mesh with DAT and MED Formats
+ * Export Mesh to MED Formats
*/
- void ExportDAT( in string file )
+ void ExportToMED( in string file, in boolean auto_groups, in MED_VERSION theVersion )
raises (SALOME::SALOME_Exception);
void ExportMED( in string file, in boolean auto_groups )
raises (SALOME::SALOME_Exception);
+
+ /*!
+ * Export Mesh to DAT, UNV and STL Formats
+ */
+ void ExportDAT( in string file )
+ raises (SALOME::SALOME_Exception);
void ExportUNV( in string file )
raises (SALOME::SALOME_Exception);
void ExportSTL( in string file, in boolean isascii )
my3DActor->GetMapper()->SetScalarVisibility(false);
myScalarBarActor->SetVisibility(false);
- if(theMode != eNone){
+ bool anIsScalarVisible = theMode > eNone;
+
+ if(anIsScalarVisible){
SMESH::Controls::FunctorPtr aFunctor;
- SMESH::Controls::NumericalFunctor* aNumFunctor = NULL;
switch(theMode){
case eLength:
{
- aNumFunctor = new SMESH::Controls::Length();
- aFunctor.reset( aNumFunctor );
+ SMESH::Controls::Length* aControl = new SMESH::Controls::Length();
+ aControl->SetPrecision( myControlsPrecision );
+ aFunctor.reset( aControl );
myControlActor = my1DActor;
break;
}
break;
case eArea:
{
- aNumFunctor = new SMESH::Controls::Area();
- aFunctor.reset( aNumFunctor );
+ SMESH::Controls::Area* aControl = new SMESH::Controls::Area();
+ aControl->SetPrecision( myControlsPrecision );
+ aFunctor.reset( aControl );
myControlActor = my2DActor;
break;
}
case eTaper:
{
- aNumFunctor = new SMESH::Controls::Taper();
- aFunctor.reset( aNumFunctor );
+ SMESH::Controls::Taper* aControl = new SMESH::Controls::Taper();
+ aControl->SetPrecision( myControlsPrecision );
+ aFunctor.reset( aControl );
myControlActor = my2DActor;
break;
}
case eAspectRatio:
{
- aNumFunctor = new SMESH::Controls::AspectRatio();
- aFunctor.reset( aNumFunctor );
+ SMESH::Controls::AspectRatio* aControl = new SMESH::Controls::AspectRatio();
+ aControl->SetPrecision( myControlsPrecision );
+ aFunctor.reset( aControl );
myControlActor = my2DActor;
break;
}
case eAspectRatio3D:
{
- aNumFunctor = new SMESH::Controls::AspectRatio3D();
- aFunctor.reset( aNumFunctor );
+ SMESH::Controls::AspectRatio3D* aControl = new SMESH::Controls::AspectRatio3D();
+ aControl->SetPrecision( myControlsPrecision );
+ aFunctor.reset( aControl );
myControlActor = my3DActor;
break;
}
case eMinimumAngle:
{
- aNumFunctor = new SMESH::Controls::MinimumAngle();
- aFunctor.reset( aNumFunctor );
+ SMESH::Controls::MinimumAngle* aControl = new SMESH::Controls::MinimumAngle();
+ aControl->SetPrecision( myControlsPrecision );
+ aFunctor.reset( aControl );
myControlActor = my2DActor;
break;
}
case eWarping:
{
- aNumFunctor = new SMESH::Controls::Warping();
- aFunctor.reset( aNumFunctor );
+ SMESH::Controls::Warping* aControl = new SMESH::Controls::Warping();
+ aControl->SetPrecision( myControlsPrecision );
+ aFunctor.reset( aControl );
myControlActor = my2DActor;
break;
}
case eSkew:
{
- aNumFunctor = new SMESH::Controls::Skew();
- aFunctor.reset( aNumFunctor );
+ SMESH::Controls::Skew* aControl = new SMESH::Controls::Skew();
+ aControl->SetPrecision( myControlsPrecision );
+ aFunctor.reset( aControl );
myControlActor = my2DActor;
break;
}
return;
}
- if(aNumFunctor)
- aNumFunctor->SetPrecision( myControlsPrecision );
-
vtkUnstructuredGrid* aGrid = myControlActor->GetUnstructuredGrid();
vtkIdType aNbCells = aGrid->GetNumberOfCells();
if(aNbCells){
*/
//=============================================================================
-void SMESH_Mesh::ExportMED(const char *file, const char* theMeshName, bool theAutoGroups) throw(SALOME_Exception)
+void SMESH_Mesh::ExportMED(const char *file,
+ const char* theMeshName,
+ bool theAutoGroups,
+ int theVersion)
+ throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
DriverMED_W_SMESHDS_Mesh myWriter;
// return list of ancestors of theSubShape in the order
// that lower dimention shapes come first.
+ void ExportMED(const char *file,
+ const char* theMeshName = NULL,
+ bool theAutoGroups = true,
+ int theVersion = 0)
+ throw(SALOME_Exception);
+
void ExportDAT(const char *file) throw(SALOME_Exception);
- void ExportMED(const char *file, const char* theMeshName = NULL, bool theAutoGroups = true) throw(SALOME_Exception);
void ExportUNV(const char *file) throw(SALOME_Exception);
void ExportSTL(const char *file, const bool isascii) throw(SALOME_Exception);
SMESH::SMESH_Gen_ptr theComponentMesh,
int theCommandID)
{
- QString filter;
+ QStringList filter;
string myExtension;
if(theCommandID == 113){
- filter = QObject::tr("MED files (*.med)");
+ filter.append(QObject::tr("MED files (*.med)"));
+ filter.append(QObject::tr("All files (*)"));
}else if (theCommandID == 112){
- filter = QObject::tr("IDEAS files (*.unv)");
+ filter.append(QObject::tr("IDEAS files (*.unv)"));
}else if (theCommandID == 111){
- filter = QObject::tr("DAT files (*.dat)");
+ filter.append(QObject::tr("DAT files (*.dat)"));
}
QString filename = QAD_FileDlg::getFileName(parent,
"",
QAD_WaitCursor wc;
switch ( theCommandID ) {
case 122:
- aMesh->ExportMED( aFilename.latin1(), true ); // currently, automatic groups are always created
+ aMesh->ExportToMED( aFilename.latin1(), true, SMESH::MED_V2_1 ); // currently, automatic groups are always created
break;
case 121:
aMesh->ExportDAT( aFilename.latin1() );
#include "OpUtil.hxx"
#include "TCollection_AsciiString.hxx"
+#include <TColStd_MapOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TColStd_SequenceOfInteger.hxx>
#include "SMESHDS_Command.hxx"
#include "SMESHDS_CommandType.hxx"
#include "SMESH_MeshEditor_i.hxx"
#include "SMESH_Gen_i.hxx"
#include "DriverMED_R_SMESHDS_Mesh.h"
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
-#include <TColStd_SequenceOfInteger.hxx>
-
#include <string>
#include <iostream>
+// _CS_gbo_050504 Ajout explicite du sstream pour ostringstream
#include <sstream>
#ifdef _DEBUG_
*/
//=============================================================================
-void SMESH_Mesh_i::ExportMED(const char *file, CORBA::Boolean auto_groups) throw(SALOME::SALOME_Exception)
+void SMESH_Mesh_i::ExportToMED( const char* file,
+ CORBA::Boolean auto_groups,
+ SMESH::MED_VERSION theVersion )
+ throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
-
+
char* aMeshName = "Mesh";
SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
if ( !aStudy->_is_nil() ) {
//SCRUTE(file);
//SCRUTE(aMeshName);
//SCRUTE(aMeshSO->GetID());
-
+
// asv : 27.10.04 : fix of 6903: check for StudyLocked before adding attributes
if ( !aStudy->GetProperties()->IsLocked() )
- {
+ {
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
SALOMEDS::AttributeExternalFileDef_var aFileName;
aFileType = SALOMEDS::AttributeFileType::_narrow(anAttr);
ASSERT(!aFileType->_is_nil());
aFileType->SetValue("FICHIERMED");
- }
+ }
}
}
- _impl->ExportMED( file, aMeshName, auto_groups );
+ _impl->ExportMED( file, aMeshName, auto_groups, theVersion );
+}
+
+void SMESH_Mesh_i::ExportMED( const char* file,
+ CORBA::Boolean auto_groups)
+ throw(SALOME::SALOME_Exception)
+{
+ ExportToMED(file,auto_groups,SMESH::MED_V2_1);
}
void SMESH_Mesh_i::ExportDAT(const char *file) throw(SALOME::SALOME_Exception)
SMESH::DriverMED_ReadStatus ImportMEDFile( const char* theFileName, const char* theMeshName )
throw (SALOME::SALOME_Exception);
+ void ExportToMED( const char* file, CORBA::Boolean auto_groups, SMESH::MED_VERSION theVersion )
+ throw (SALOME::SALOME_Exception);
void ExportMED( const char* file, CORBA::Boolean auto_groups )
throw (SALOME::SALOME_Exception);
+
void ExportDAT( const char* file )
throw (SALOME::SALOME_Exception);
void ExportUNV( const char* file )