[Bug PAL7252] DEVELOPMENT: Porting to MED2.2

This commit is contained in:
apo 2004-12-30 08:05:59 +00:00
parent f432a8d3c1
commit b479976b78
7 changed files with 84 additions and 40 deletions

View File

@ -132,6 +132,15 @@ module SMESH
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;
@ -315,12 +324,18 @@ module SMESH
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 )

View File

@ -629,14 +629,16 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){
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;
}
@ -660,50 +662,57 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){
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;
}
@ -711,9 +720,6 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){
return;
}
if(aNumFunctor)
aNumFunctor->SetPrecision( myControlsPrecision );
vtkUnstructuredGrid* aGrid = myControlActor->GetUnstructuredGrid();
vtkIdType aNbCells = aGrid->GetNumberOfCells();
if(aNbCells){

View File

@ -631,7 +631,11 @@ throw(SALOME_Exception)
*/
//=============================================================================
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;

View File

@ -136,8 +136,13 @@ public:
// 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);

View File

@ -155,15 +155,16 @@ namespace{
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,
"",
@ -272,7 +273,7 @@ namespace{
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() );

View File

@ -41,18 +41,18 @@
#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_
@ -1049,7 +1049,10 @@ SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor()
*/
//=============================================================================
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);
@ -1081,7 +1084,14 @@ void SMESH_Mesh_i::ExportMED(const char *file, CORBA::Boolean auto_groups) throw
}
}
}
_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)

View File

@ -150,8 +150,11 @@ public:
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 )