mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 17:30:35 +05:00
[Bug PAL7252] DEVELOPMENT: Porting to MED2.2
This commit is contained in:
parent
f432a8d3c1
commit
b479976b78
@ -132,6 +132,15 @@ module SMESH
|
|||||||
DRS_FAIL // general failure (exception etc.)
|
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;
|
typedef sequence<log_block> log_array;
|
||||||
|
|
||||||
|
|
||||||
@ -315,12 +324,18 @@ module SMESH
|
|||||||
raises (SALOME::SALOME_Exception);
|
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);
|
raises (SALOME::SALOME_Exception);
|
||||||
void ExportMED( in string file, in boolean auto_groups )
|
void ExportMED( in string file, in boolean auto_groups )
|
||||||
raises (SALOME::SALOME_Exception);
|
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 )
|
void ExportUNV( in string file )
|
||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
void ExportSTL( in string file, in boolean isascii )
|
void ExportSTL( in string file, in boolean isascii )
|
||||||
|
@ -629,14 +629,16 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){
|
|||||||
my3DActor->GetMapper()->SetScalarVisibility(false);
|
my3DActor->GetMapper()->SetScalarVisibility(false);
|
||||||
myScalarBarActor->SetVisibility(false);
|
myScalarBarActor->SetVisibility(false);
|
||||||
|
|
||||||
if(theMode != eNone){
|
bool anIsScalarVisible = theMode > eNone;
|
||||||
|
|
||||||
|
if(anIsScalarVisible){
|
||||||
SMESH::Controls::FunctorPtr aFunctor;
|
SMESH::Controls::FunctorPtr aFunctor;
|
||||||
SMESH::Controls::NumericalFunctor* aNumFunctor = NULL;
|
|
||||||
switch(theMode){
|
switch(theMode){
|
||||||
case eLength:
|
case eLength:
|
||||||
{
|
{
|
||||||
aNumFunctor = new SMESH::Controls::Length();
|
SMESH::Controls::Length* aControl = new SMESH::Controls::Length();
|
||||||
aFunctor.reset( aNumFunctor );
|
aControl->SetPrecision( myControlsPrecision );
|
||||||
|
aFunctor.reset( aControl );
|
||||||
myControlActor = my1DActor;
|
myControlActor = my1DActor;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -660,50 +662,57 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){
|
|||||||
break;
|
break;
|
||||||
case eArea:
|
case eArea:
|
||||||
{
|
{
|
||||||
aNumFunctor = new SMESH::Controls::Area();
|
SMESH::Controls::Area* aControl = new SMESH::Controls::Area();
|
||||||
aFunctor.reset( aNumFunctor );
|
aControl->SetPrecision( myControlsPrecision );
|
||||||
|
aFunctor.reset( aControl );
|
||||||
myControlActor = my2DActor;
|
myControlActor = my2DActor;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eTaper:
|
case eTaper:
|
||||||
{
|
{
|
||||||
aNumFunctor = new SMESH::Controls::Taper();
|
SMESH::Controls::Taper* aControl = new SMESH::Controls::Taper();
|
||||||
aFunctor.reset( aNumFunctor );
|
aControl->SetPrecision( myControlsPrecision );
|
||||||
|
aFunctor.reset( aControl );
|
||||||
myControlActor = my2DActor;
|
myControlActor = my2DActor;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eAspectRatio:
|
case eAspectRatio:
|
||||||
{
|
{
|
||||||
aNumFunctor = new SMESH::Controls::AspectRatio();
|
SMESH::Controls::AspectRatio* aControl = new SMESH::Controls::AspectRatio();
|
||||||
aFunctor.reset( aNumFunctor );
|
aControl->SetPrecision( myControlsPrecision );
|
||||||
|
aFunctor.reset( aControl );
|
||||||
myControlActor = my2DActor;
|
myControlActor = my2DActor;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eAspectRatio3D:
|
case eAspectRatio3D:
|
||||||
{
|
{
|
||||||
aNumFunctor = new SMESH::Controls::AspectRatio3D();
|
SMESH::Controls::AspectRatio3D* aControl = new SMESH::Controls::AspectRatio3D();
|
||||||
aFunctor.reset( aNumFunctor );
|
aControl->SetPrecision( myControlsPrecision );
|
||||||
|
aFunctor.reset( aControl );
|
||||||
myControlActor = my3DActor;
|
myControlActor = my3DActor;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eMinimumAngle:
|
case eMinimumAngle:
|
||||||
{
|
{
|
||||||
aNumFunctor = new SMESH::Controls::MinimumAngle();
|
SMESH::Controls::MinimumAngle* aControl = new SMESH::Controls::MinimumAngle();
|
||||||
aFunctor.reset( aNumFunctor );
|
aControl->SetPrecision( myControlsPrecision );
|
||||||
|
aFunctor.reset( aControl );
|
||||||
myControlActor = my2DActor;
|
myControlActor = my2DActor;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eWarping:
|
case eWarping:
|
||||||
{
|
{
|
||||||
aNumFunctor = new SMESH::Controls::Warping();
|
SMESH::Controls::Warping* aControl = new SMESH::Controls::Warping();
|
||||||
aFunctor.reset( aNumFunctor );
|
aControl->SetPrecision( myControlsPrecision );
|
||||||
|
aFunctor.reset( aControl );
|
||||||
myControlActor = my2DActor;
|
myControlActor = my2DActor;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eSkew:
|
case eSkew:
|
||||||
{
|
{
|
||||||
aNumFunctor = new SMESH::Controls::Skew();
|
SMESH::Controls::Skew* aControl = new SMESH::Controls::Skew();
|
||||||
aFunctor.reset( aNumFunctor );
|
aControl->SetPrecision( myControlsPrecision );
|
||||||
|
aFunctor.reset( aControl );
|
||||||
myControlActor = my2DActor;
|
myControlActor = my2DActor;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -711,9 +720,6 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aNumFunctor)
|
|
||||||
aNumFunctor->SetPrecision( myControlsPrecision );
|
|
||||||
|
|
||||||
vtkUnstructuredGrid* aGrid = myControlActor->GetUnstructuredGrid();
|
vtkUnstructuredGrid* aGrid = myControlActor->GetUnstructuredGrid();
|
||||||
vtkIdType aNbCells = aGrid->GetNumberOfCells();
|
vtkIdType aNbCells = aGrid->GetNumberOfCells();
|
||||||
if(aNbCells){
|
if(aNbCells){
|
||||||
|
@ -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);
|
Unexpect aCatch(SalomeException);
|
||||||
DriverMED_W_SMESHDS_Mesh myWriter;
|
DriverMED_W_SMESHDS_Mesh myWriter;
|
||||||
|
@ -136,8 +136,13 @@ public:
|
|||||||
// return list of ancestors of theSubShape in the order
|
// return list of ancestors of theSubShape in the order
|
||||||
// that lower dimention shapes come first.
|
// 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 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 ExportUNV(const char *file) throw(SALOME_Exception);
|
||||||
void ExportSTL(const char *file, const bool isascii) throw(SALOME_Exception);
|
void ExportSTL(const char *file, const bool isascii) throw(SALOME_Exception);
|
||||||
|
|
||||||
|
@ -155,15 +155,16 @@ namespace{
|
|||||||
SMESH::SMESH_Gen_ptr theComponentMesh,
|
SMESH::SMESH_Gen_ptr theComponentMesh,
|
||||||
int theCommandID)
|
int theCommandID)
|
||||||
{
|
{
|
||||||
QString filter;
|
QStringList filter;
|
||||||
string myExtension;
|
string myExtension;
|
||||||
|
|
||||||
if(theCommandID == 113){
|
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){
|
}else if (theCommandID == 112){
|
||||||
filter = QObject::tr("IDEAS files (*.unv)");
|
filter.append(QObject::tr("IDEAS files (*.unv)"));
|
||||||
}else if (theCommandID == 111){
|
}else if (theCommandID == 111){
|
||||||
filter = QObject::tr("DAT files (*.dat)");
|
filter.append(QObject::tr("DAT files (*.dat)"));
|
||||||
}
|
}
|
||||||
QString filename = QAD_FileDlg::getFileName(parent,
|
QString filename = QAD_FileDlg::getFileName(parent,
|
||||||
"",
|
"",
|
||||||
@ -272,7 +273,7 @@ namespace{
|
|||||||
QAD_WaitCursor wc;
|
QAD_WaitCursor wc;
|
||||||
switch ( theCommandID ) {
|
switch ( theCommandID ) {
|
||||||
case 122:
|
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;
|
break;
|
||||||
case 121:
|
case 121:
|
||||||
aMesh->ExportDAT( aFilename.latin1() );
|
aMesh->ExportDAT( aFilename.latin1() );
|
||||||
|
@ -41,18 +41,18 @@
|
|||||||
#include "OpUtil.hxx"
|
#include "OpUtil.hxx"
|
||||||
|
|
||||||
#include "TCollection_AsciiString.hxx"
|
#include "TCollection_AsciiString.hxx"
|
||||||
|
#include <TColStd_MapOfInteger.hxx>
|
||||||
|
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
|
||||||
|
#include <TColStd_SequenceOfInteger.hxx>
|
||||||
#include "SMESHDS_Command.hxx"
|
#include "SMESHDS_Command.hxx"
|
||||||
#include "SMESHDS_CommandType.hxx"
|
#include "SMESHDS_CommandType.hxx"
|
||||||
#include "SMESH_MeshEditor_i.hxx"
|
#include "SMESH_MeshEditor_i.hxx"
|
||||||
#include "SMESH_Gen_i.hxx"
|
#include "SMESH_Gen_i.hxx"
|
||||||
#include "DriverMED_R_SMESHDS_Mesh.h"
|
#include "DriverMED_R_SMESHDS_Mesh.h"
|
||||||
|
|
||||||
#include <TColStd_MapOfInteger.hxx>
|
|
||||||
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
|
|
||||||
#include <TColStd_SequenceOfInteger.hxx>
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
// _CS_gbo_050504 Ajout explicite du sstream pour ostringstream
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#ifdef _DEBUG_
|
#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);
|
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)
|
void SMESH_Mesh_i::ExportDAT(const char *file) throw(SALOME::SALOME_Exception)
|
||||||
|
@ -150,8 +150,11 @@ public:
|
|||||||
SMESH::DriverMED_ReadStatus ImportMEDFile( const char* theFileName, const char* theMeshName )
|
SMESH::DriverMED_ReadStatus ImportMEDFile( const char* theFileName, const char* theMeshName )
|
||||||
throw (SALOME::SALOME_Exception);
|
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 )
|
void ExportMED( const char* file, CORBA::Boolean auto_groups )
|
||||||
throw (SALOME::SALOME_Exception);
|
throw (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
void ExportDAT( const char* file )
|
void ExportDAT( const char* file )
|
||||||
throw (SALOME::SALOME_Exception);
|
throw (SALOME::SALOME_Exception);
|
||||||
void ExportUNV( const char* file )
|
void ExportUNV( const char* file )
|
||||||
|
Loading…
Reference in New Issue
Block a user