mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-13 18:20:34 +05:00
bos #24009 EDF 22760 - integration of dev in SMESH: minor problems
1/ Remove explicit memory leaks (e.g. CORBA ptr are not destroyed). 2/ Remove redundant includes. 4/ Fix architectural problems: avoid raising CORBA exceptions from low level, instead catch and rethrow exceptions from upper level. 7/ Fix declarations - IDL stubs overrides must not be declared as raising std exceptions. 10/ Remove redundant code duplication. In particular class ToComment to be replaced by existing SMESH_Comment. 11/ Clean-up unused member fields. 12/ Fix errors in documentation.
This commit is contained in:
parent
f696a3b7ee
commit
56ef953ea5
@ -9,10 +9,10 @@ Adaptation
|
||||
MG_Adapt
|
||||
========
|
||||
|
||||
.. literalinclude:: ../../../examples/adaptation_ex01.py
|
||||
.. literalinclude:: ../../../examples/MGAdaptTests_without_session.py
|
||||
:language: python
|
||||
|
||||
:download:`Download this script <../../../examples/adaptation_ex01.py>`
|
||||
:download:`Download this script <../../../examples/MGAdaptTests_without_session.py>`
|
||||
|
||||
|
||||
**See Also** the GUI :ref:`adaptation_page`.
|
||||
|
@ -29,7 +29,6 @@
|
||||
|
||||
module SMESH{
|
||||
|
||||
typedef sequence<string> str_array ;
|
||||
struct MgAdaptHypothesisData
|
||||
{
|
||||
string myFileInDir, myMeshFileIn, myInMeshName, myMeshFileBackground, myOutMeshName,
|
||||
@ -48,7 +47,6 @@ module SMESH{
|
||||
|
||||
interface MG_ADAPT : SALOME::GenericObj
|
||||
{
|
||||
//MG_ADAPT CreateMG_ADAPT(in PortableServer::POA_var poa);
|
||||
void setData( inout MgAdaptHypothesisData data);
|
||||
|
||||
void setMedFileIn(in string MedFileIn );
|
||||
@ -133,8 +131,8 @@ module SMESH{
|
||||
boolean hasOptionDefined( in string optionName ) ;
|
||||
void setOptionValue(in string optionName, in string optionValue) raises (SALOME::SALOME_Exception);
|
||||
string getOptionValue(in string optionName, inout boolean isDefault) raises (SALOME::SALOME_Exception);
|
||||
str_array getCustomOptionValuesStrVec() ;
|
||||
str_array getOptionValuesStrVec() ;
|
||||
SMESH::string_array getCustomOptionValuesStrVec() ;
|
||||
SMESH::string_array getOptionValuesStrVec() ;
|
||||
};
|
||||
|
||||
typedef MG_ADAPT MG_ADAPT_HYPOTHESIS;
|
||||
|
@ -22,25 +22,21 @@
|
||||
|
||||
#include "MG_ADAPT.hxx"
|
||||
|
||||
#include "MeshFormatReader.hxx"
|
||||
#include "MeshFormatWriter.hxx"
|
||||
#include "MEDFileMesh.hxx"
|
||||
#include "MCAuto.hxx"
|
||||
#include "MEDFileData.hxx"
|
||||
#include "MEDFileField.hxx"
|
||||
#include "MEDCouplingFieldDouble.hxx"
|
||||
#include "SMESH_File.hxx"
|
||||
#include "SMESH_Comment.hxx"
|
||||
|
||||
#include <MEDFileData.hxx>
|
||||
#include <MEDFileField.hxx>
|
||||
#include <MEDFileMesh.hxx>
|
||||
#include <MeshFormatReader.hxx>
|
||||
#include <MeshFormatWriter.hxx>
|
||||
|
||||
#include <SALOME_NamingService.hxx>
|
||||
#include <Utils_SALOME_Exception.hxx>
|
||||
#include "Utils_CorbaException.hxx"
|
||||
|
||||
#include <utilities.h>
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <unistd.h> // getpid()
|
||||
#include <memory> // unique_ptr
|
||||
|
||||
typedef SMESH_Comment ToComment;
|
||||
|
||||
using namespace MG_ADAPT;
|
||||
static std::string removeFile(std::string fileName, int& notOk)
|
||||
@ -52,13 +48,104 @@ static std::string removeFile(std::string fileName, int& notOk)
|
||||
|
||||
return errStr;
|
||||
}
|
||||
std::string remove_extension(const std::string& filename) {
|
||||
std::string MG_ADAPT::remove_extension(const std::string& filename) {
|
||||
size_t lastdot = filename.find_last_of(".");
|
||||
if (lastdot == std::string::npos) return filename;
|
||||
return filename.substr(0, lastdot);
|
||||
}
|
||||
namespace
|
||||
{
|
||||
|
||||
bool isFileExist( const std::string& fName )
|
||||
{
|
||||
return SMESH_File( fName ).exists();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
med_idt openMedFile(const std::string aFile)
|
||||
// =======================================================================
|
||||
// renvoie le medId associe au fichier Med apres ouverture
|
||||
{
|
||||
med_idt medIdt = MEDfileOpen(aFile.c_str(),MED_ACC_RDONLY);
|
||||
if (medIdt <0)
|
||||
{
|
||||
THROW_SALOME_EXCEPTION("\nThe med file " << aFile << " cannot be opened.\n");
|
||||
}
|
||||
return medIdt;
|
||||
}
|
||||
|
||||
|
||||
// =======================================================================
|
||||
void getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit, std::string fieldName)
|
||||
// =======================================================================
|
||||
{
|
||||
// Il faut voir si plusieurs maillages
|
||||
|
||||
herr_t erreur = 0 ;
|
||||
med_idt medIdt ;
|
||||
|
||||
|
||||
// Ouverture du fichier
|
||||
//~SCRUTE(aFile.toStdString());
|
||||
medIdt = openMedFile(aFile);
|
||||
if ( medIdt < 0 ) return ;
|
||||
// Lecture du nombre de champs
|
||||
med_int ncha = MEDnField(medIdt) ;
|
||||
if (ncha < 1 )
|
||||
{
|
||||
//~addMessage( ToComment(" error: there is no field in ") << aFile, /*fatal=*/true );
|
||||
return;
|
||||
}
|
||||
// Lecture des caracteristiques du champs
|
||||
|
||||
// Lecture du type du champ, des noms des composantes et du nom de l'unite
|
||||
char nomcha [MED_NAME_SIZE+1];
|
||||
strcpy(nomcha, fieldName.c_str());
|
||||
// Lecture du nombre de composantes
|
||||
med_int ncomp = MEDfieldnComponentByName(medIdt, nomcha);
|
||||
char meshname[MED_NAME_SIZE+1];
|
||||
char * comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1);
|
||||
char * unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1);
|
||||
char dtunit[MED_SNAME_SIZE+1];
|
||||
med_bool local;
|
||||
med_field_type typcha;
|
||||
med_int nbofcstp;
|
||||
erreur = MEDfieldInfoByName (medIdt, nomcha, meshname,&local,&typcha,comp,unit,dtunit, &nbofcstp);
|
||||
free(comp);
|
||||
free(unit);
|
||||
if ( erreur < 0 )
|
||||
{
|
||||
//~addMessage( ToComment(" error: error while reading field ") << nomcha << " in file " << aFile , /*fatal=*/true );
|
||||
return;
|
||||
}
|
||||
|
||||
med_float dt;
|
||||
med_int tmp_numdt, tmp_numit;
|
||||
|
||||
//~med_int step = data->myUseLastTimeStep ? nbofcstp : data->myTimeStep+1;
|
||||
//~myPrint("step ", step);
|
||||
erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, 1, &numdt, &numit, &dt );
|
||||
for( int step = 1; step <= nbofcstp; step++ )
|
||||
{
|
||||
erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, step, &tmp_numdt, &tmp_numit, &dt );
|
||||
if(tmp_numdt > numdt)
|
||||
{
|
||||
numdt = tmp_numdt;
|
||||
numit = tmp_numit;
|
||||
}
|
||||
}
|
||||
if ( erreur < 0 )
|
||||
{
|
||||
//~addMessage( ToComment(" error: error while reading field ") << nomcha << "step (numdt, numit) = " <<"("<< numdt<< ", "
|
||||
//numit<< ")" <<" in file " << aFile , /*fatal=*/true );
|
||||
return;
|
||||
}
|
||||
|
||||
// Fermeture du fichier
|
||||
if ( medIdt > 0 ) MEDfileClose(medIdt);
|
||||
|
||||
}
|
||||
|
||||
struct GET_DEFAULT // struct used to get default value from GetOptionValue()
|
||||
{
|
||||
bool isDefault;
|
||||
@ -66,6 +153,11 @@ struct GET_DEFAULT // struct used to get default value from GetOptionValue()
|
||||
return &isDefault;
|
||||
}
|
||||
};
|
||||
|
||||
class outFileStream : public std::ofstream{
|
||||
public:
|
||||
~outFileStream(){close();} //to close file at dtor
|
||||
};
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
@ -232,11 +324,7 @@ void MgAdapt::setMedFileIn(std::string fileName)
|
||||
}
|
||||
else
|
||||
{
|
||||
SALOME::ExceptionStruct es;
|
||||
es.type = SALOME::BAD_PARAM;
|
||||
std::string text = "\nThe file " + fileName + " does not exist.\n" ;
|
||||
es.text = CORBA::string_dup(text.c_str());
|
||||
throw SALOME::SALOME_Exception(es);
|
||||
THROW_SALOME_EXCEPTION("\nThe file "<< fileName <<" does not exist.\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -384,11 +472,7 @@ void MgAdapt::setSizeMapFile(std::string mapFile)
|
||||
}
|
||||
else
|
||||
{
|
||||
SALOME::ExceptionStruct es;
|
||||
es.type = SALOME::BAD_PARAM;
|
||||
std::string text = "\nThe file " + mapFile + " does not exist.\n" ;
|
||||
es.text = CORBA::string_dup(text.c_str());
|
||||
throw SALOME::SALOME_Exception(es);
|
||||
THROW_SALOME_EXCEPTION("\nThe file "<< mapFile <<" does not exist.\n");
|
||||
}
|
||||
}
|
||||
std::string MgAdapt::getSizeMapFile()
|
||||
@ -525,7 +609,6 @@ void MgAdapt::checkDirPath(std::string& dirPath)
|
||||
//=============================================================================
|
||||
void MgAdapt::setOptionValue(const std::string& optionName,
|
||||
const std::string& optionValue)
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
// INFOS("setOptionValue");
|
||||
// std::cout << "optionName: " << optionName << ", optionValue: " << optionValue << std::endl;
|
||||
@ -544,7 +627,7 @@ throw (std::invalid_argument)
|
||||
// strip white spaces
|
||||
while (ptr[0] == ' ')
|
||||
ptr++;
|
||||
int i = strlen(ptr);
|
||||
size_t i = strlen(ptr);
|
||||
while (i != 0 && ptr[i - 1] == ' ')
|
||||
i--;
|
||||
// check value type
|
||||
@ -597,7 +680,6 @@ throw (std::invalid_argument)
|
||||
// then *isDefault == true. If isDefault is not provided, the value will be
|
||||
// empty if it equals a default one.
|
||||
std::string MgAdapt::getOptionValue(const std::string& optionName, bool* isDefault) const
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
// INFOS("getOptionValue");
|
||||
// std::cout << "optionName: " << optionName << ", isDefault: " << isDefault << std::endl;
|
||||
@ -630,7 +712,6 @@ throw (std::invalid_argument)
|
||||
//================================================================================
|
||||
|
||||
double MgAdapt::toDbl(const std::string& str, bool* isOk )
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
if ( str.empty() ) throw std::invalid_argument("Empty value provided");
|
||||
|
||||
@ -656,7 +737,7 @@ std::string MgAdapt::toLowerStr(const std::string& str)
|
||||
{
|
||||
std::string s = str;
|
||||
for ( size_t i = 0; i <= s.size(); ++i )
|
||||
s[i] = tolower( s[i] );
|
||||
s[i] = (char) tolower( s[i] );
|
||||
return s;
|
||||
}
|
||||
//================================================================================
|
||||
@ -666,13 +747,12 @@ std::string MgAdapt::toLowerStr(const std::string& str)
|
||||
//================================================================================
|
||||
|
||||
bool MgAdapt::toBool(const std::string& str, bool* isOk )
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
std::string s = str;
|
||||
if ( isOk ) *isOk = true;
|
||||
|
||||
for ( size_t i = 0; i <= s.size(); ++i )
|
||||
s[i] = tolower( s[i] );
|
||||
s[i] = (char) tolower( s[i] );
|
||||
|
||||
if ( s == "1" || s == "true" || s == "active" || s == "yes" )
|
||||
return true;
|
||||
@ -696,7 +776,6 @@ throw (std::invalid_argument)
|
||||
//================================================================================
|
||||
|
||||
int MgAdapt::toInt(const std::string& str, bool* isOk )
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
if ( str.empty() ) throw std::invalid_argument("Empty value provided");
|
||||
|
||||
@ -729,7 +808,7 @@ bool MgAdapt::hasOptionDefined( const std::string& optionName ) const
|
||||
}
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Return command to run MG-Tetra mesher excluding file prefix (-f)
|
||||
* \brief Return command to run MG-Adapt mesher excluding file prefix (-f)
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
@ -738,8 +817,6 @@ std::string MgAdapt::getCommandToRun(MgAdapt* hyp)
|
||||
return hyp ? hyp->getCommandToRun() : ToComment("error with hypothesis!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
int MgAdapt::compute(std::string& errStr)
|
||||
{
|
||||
std::string cmd = getCommandToRun();
|
||||
@ -752,6 +829,11 @@ int MgAdapt::compute(std::string& errStr)
|
||||
{
|
||||
errStr = ToComment("system(mg-adapt.exe ...) command failed with error: ") << strerror( errno );
|
||||
}
|
||||
else if ( !isFileExist( meshFormatOutputMesh ))
|
||||
{
|
||||
errStr = ToComment(" failed to find file ") << meshFormatOutputMesh
|
||||
<< " output from MG-Adapt run";
|
||||
}
|
||||
else
|
||||
{
|
||||
convertMeshFile(meshFormatOutputMesh, solFormatOutput);
|
||||
@ -928,16 +1010,6 @@ std::string MgAdapt::getCommandToRun()
|
||||
return cmd;
|
||||
}
|
||||
|
||||
bool MgAdapt::isFileExist(const std::string& fName)
|
||||
{
|
||||
|
||||
if ( fName.empty() ) return false;
|
||||
|
||||
boost::system::error_code err;
|
||||
bool res = boost::filesystem::exists( fName, err );
|
||||
|
||||
return err ? false : res;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : defaultMaximumMemory
|
||||
//=======================================================================
|
||||
@ -966,7 +1038,7 @@ double MgAdapt::defaultMaximumMemory()
|
||||
if ( err == 0 )
|
||||
{
|
||||
long ramMB = si.totalram * si.mem_unit / 1024 / 1024;
|
||||
return ( 0.7 * ramMB );
|
||||
return ( 0.7 * double( ramMB ));
|
||||
}
|
||||
#endif
|
||||
return 1024;
|
||||
@ -978,7 +1050,7 @@ double MgAdapt::defaultMaximumMemory()
|
||||
|
||||
std::string MgAdapt::defaultWorkingDirectory()
|
||||
{
|
||||
TCollection_AsciiString aTmpDir;
|
||||
std::string aTmpDir;
|
||||
|
||||
char *Tmp_dir = getenv("SALOME_TMP_DIR");
|
||||
if(Tmp_dir != NULL)
|
||||
@ -987,12 +1059,12 @@ std::string MgAdapt::defaultWorkingDirectory()
|
||||
}
|
||||
else {
|
||||
#ifdef WIN32
|
||||
aTmpDir = TCollection_AsciiString("C:\\");
|
||||
aTmpDir = "C:\\";
|
||||
#else
|
||||
aTmpDir = TCollection_AsciiString("/tmp/");
|
||||
aTmpDir = "/tmp/";
|
||||
#endif
|
||||
}
|
||||
return aTmpDir.ToCString();
|
||||
return aTmpDir;
|
||||
}
|
||||
//================================================================================
|
||||
/*!
|
||||
@ -1010,13 +1082,13 @@ std::string MgAdapt::getFileName() const
|
||||
if(lastChar != '/') aTmpDir+='/';
|
||||
#endif
|
||||
|
||||
TCollection_AsciiString aGenericName = (char*)aTmpDir.c_str();
|
||||
aGenericName += "MgAdapt_";
|
||||
aGenericName += getpid();
|
||||
aGenericName += "_";
|
||||
aGenericName += Abs((Standard_Integer)(long) aGenericName.ToCString());
|
||||
SMESH_Comment aGenericName( aTmpDir );
|
||||
aGenericName << "MgAdapt_";
|
||||
aGenericName << getpid();
|
||||
aGenericName << "_";
|
||||
aGenericName << std::abs((int)(long) aGenericName.data());
|
||||
|
||||
return aGenericName.ToCString();
|
||||
return aGenericName;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : defaultLogFile
|
||||
@ -1203,11 +1275,8 @@ void MgAdapt::checkDimensionOptionAdaptation()
|
||||
{
|
||||
if ( optionValue != "surface" )
|
||||
{
|
||||
SALOME::ExceptionStruct es;
|
||||
es.type = SALOME::BAD_PARAM;
|
||||
std::string text = "Mesh dimension is 2; the option should be 'surface' instead of '" + optionValue + "'." ;
|
||||
es.text = CORBA::string_dup(text.c_str());
|
||||
throw SALOME::SALOME_Exception(es);
|
||||
THROW_SALOME_EXCEPTION("Mesh dimension is 2; the option should be 'surface'"
|
||||
" instead of '" << optionValue << "'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1232,11 +1301,7 @@ void MgAdapt::checkFieldName(std::string fileIn)
|
||||
std::cout << "Available field names:" << std::endl;
|
||||
for(std::size_t j=0;j<jaux;j++)
|
||||
{ std::cout << listFieldsNames[j] << std::endl;}
|
||||
SALOME::ExceptionStruct es;
|
||||
es.type = SALOME::BAD_PARAM;
|
||||
std::string text = "Field " + fieldName + " is not found." ;
|
||||
es.text = CORBA::string_dup(text.c_str());
|
||||
throw SALOME::SALOME_Exception(es);
|
||||
THROW_SALOME_EXCEPTION( "Field " << fieldName << " is not found.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1261,11 +1326,7 @@ void MgAdapt::checkTimeStepRank(std::string fileIn)
|
||||
std::cout << "Available (Time step, Rank):" << std::endl;
|
||||
for(std::size_t j=0;j<jaux;j++)
|
||||
{ std::cout << "(Time step = " << timesteprank[j].first << ", Rank = " << timesteprank[j].second << ")" << std::endl;}
|
||||
SALOME::ExceptionStruct es;
|
||||
es.type = SALOME::BAD_PARAM;
|
||||
std::string text = "(Time step = " + std::to_string(timeStep) + ", Rank = " + std::to_string(rank) + ") is not found." ;
|
||||
es.text = CORBA::string_dup(text.c_str());
|
||||
throw SALOME::SALOME_Exception(es);
|
||||
THROW_SALOME_EXCEPTION("(Time step = " << timeStep << ", Rank = " << rank << ") is not found.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1360,11 +1421,10 @@ void MgAdapt::storeGroups(MEDCoupling::MEDFileMesh* fileMesh)
|
||||
std::vector<std::string> famNames = g2ff->second;
|
||||
|
||||
if ( famNames.empty() ) continue;
|
||||
std::size_t k = 0;
|
||||
std::vector< mcIdType> famListId;
|
||||
std::vector< int> famListId;
|
||||
for ( size_t i = 0; i < famNames.size(); ++i )
|
||||
{
|
||||
famListId.push_back( fileMesh->getFamilyId( famNames[i].c_str() ) );
|
||||
famListId.push_back( FromIdType<int>( fileMesh->getFamilyId( famNames[i].c_str() )));
|
||||
}
|
||||
group grp(groupName, famListId, famNames);
|
||||
groupVec.push_back(grp);
|
||||
@ -1379,7 +1439,7 @@ void MgAdapt::storefams(MEDCoupling::MEDFileMesh* fileMesh)
|
||||
for ( ; f != grpFams.end(); ++f )
|
||||
{
|
||||
if(!f->second) continue; // FAMILLE_ZERO
|
||||
family fs(f->first, f->second);
|
||||
family fs(f->first, FromIdType<int>( f->second ));
|
||||
famVec.push_back(fs);
|
||||
}
|
||||
|
||||
@ -1417,14 +1477,14 @@ void MgAdapt::restoreGroups(MEDCoupling::MEDFileMesh* fileMesh) const
|
||||
fileMesh->setGroupInfo(info);
|
||||
}
|
||||
|
||||
void MgAdapt::buildConstantSizeMapSolFile(const std::string& solFormatFieldFileName, const int dim, const int version, const mcIdType nbNodes) const
|
||||
void MgAdapt::buildConstantSizeMapSolFile(const std::string& solFormatFieldFileName, const int dim, const int version, const size_t nbNodes) const
|
||||
{
|
||||
MeshFormat::Localizer loc;
|
||||
MeshFormat::MeshFormatParser writer;
|
||||
int fileId = writer.GmfOpenMesh( solFormatFieldFileName.c_str(), GmfWrite, version, dim);
|
||||
int typTab[] = {GmfSca};
|
||||
writer.GmfSetKwd(fileId, MeshFormat::GmfSolAtVertices, (int)nbNodes, 1, typTab);
|
||||
for (mcIdType i = 0; i<nbNodes; i++)
|
||||
for (size_t i = 0; i<nbNodes; i++)
|
||||
{
|
||||
double valTab[1] = {constantValue};
|
||||
writer.GmfSetLin( fileId, MeshFormat::GmfSolAtVertices, valTab);
|
||||
@ -1452,22 +1512,6 @@ void MgAdapt::buildBackGroundMeshAndSolFiles(const std::vector<std::string>& fie
|
||||
tmpWriter.setMEDFileDS(tmpMfd);
|
||||
tmpWriter.write();
|
||||
}
|
||||
// =======================================================================
|
||||
med_idt MgAdapt::openMedFile(const std::string aFile)
|
||||
// =======================================================================
|
||||
// renvoie le medId associe au fichier Med apres ouverture
|
||||
{
|
||||
med_idt medIdt = MEDfileOpen(aFile.c_str(),MED_ACC_RDONLY);
|
||||
if (medIdt <0)
|
||||
{
|
||||
SALOME::ExceptionStruct es;
|
||||
es.type = SALOME::BAD_PARAM;
|
||||
std::string text = "\nThe med file " + aFile + " cannot be opened.\n" ;
|
||||
es.text = CORBA::string_dup(text.c_str());
|
||||
throw SALOME::SALOME_Exception(es);
|
||||
}
|
||||
return medIdt;
|
||||
}
|
||||
|
||||
MgAdapt::Status MgAdapt::addMessage(const std::string& msg,
|
||||
const bool isFatal/*=false*/)
|
||||
@ -1484,77 +1528,6 @@ MgAdapt::Status MgAdapt::addMessage(const std::string& msg,
|
||||
return ( _myStatus = isFatal ? MgAdapt::DRS_FAIL : MgAdapt::DRS_WARN_SKIP_ELEM );
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
void MgAdapt::getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit)
|
||||
// =======================================================================
|
||||
{
|
||||
// Il faut voir si plusieurs maillages
|
||||
|
||||
herr_t erreur = 0 ;
|
||||
med_idt medIdt ;
|
||||
|
||||
|
||||
// Ouverture du fichier
|
||||
//~SCRUTE(aFile.toStdString());
|
||||
medIdt = openMedFile(aFile);
|
||||
if ( medIdt < 0 ) return ;
|
||||
// Lecture du nombre de champs
|
||||
med_int ncha = MEDnField(medIdt) ;
|
||||
if (ncha < 1 )
|
||||
{
|
||||
//~addMessage( ToComment(" error: there is no field in ") << aFile, /*fatal=*/true );
|
||||
return;
|
||||
}
|
||||
// Lecture des caracteristiques du champs
|
||||
|
||||
// Lecture du type du champ, des noms des composantes et du nom de l'unite
|
||||
char nomcha [MED_NAME_SIZE+1];
|
||||
strcpy(nomcha, fieldName.c_str());
|
||||
// Lecture du nombre de composantes
|
||||
med_int ncomp = MEDfieldnComponentByName(medIdt, nomcha);
|
||||
char meshname[MED_NAME_SIZE+1];
|
||||
char * comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1);
|
||||
char * unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1);
|
||||
char dtunit[MED_SNAME_SIZE+1];
|
||||
med_bool local;
|
||||
med_field_type typcha;
|
||||
med_int nbofcstp;
|
||||
erreur = MEDfieldInfoByName (medIdt, nomcha, meshname,&local,&typcha,comp,unit,dtunit, &nbofcstp);
|
||||
free(comp);
|
||||
free(unit);
|
||||
if ( erreur < 0 )
|
||||
{
|
||||
//~addMessage( ToComment(" error: error while reading field ") << nomcha << " in file " << aFile , /*fatal=*/true );
|
||||
return;
|
||||
}
|
||||
|
||||
med_float dt;
|
||||
med_int tmp_numdt, tmp_numit;
|
||||
|
||||
//~med_int step = data->myUseLastTimeStep ? nbofcstp : data->myTimeStep+1;
|
||||
//~myPrint("step ", step);
|
||||
erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, 1, &numdt, &numit, &dt );
|
||||
for(med_int step = 1; step <= nbofcstp; step++ )
|
||||
{
|
||||
erreur = MEDfieldComputingStepInfo ( medIdt, nomcha, step, &tmp_numdt, &tmp_numit, &dt );
|
||||
if(tmp_numdt > numdt)
|
||||
{
|
||||
numdt = tmp_numdt;
|
||||
numit = tmp_numit;
|
||||
}
|
||||
}
|
||||
if ( erreur < 0 )
|
||||
{
|
||||
//~addMessage( ToComment(" error: error while reading field ") << nomcha << "step (numdt, numit) = " <<"("<< numdt<< ", " \
|
||||
numit<< ")" <<" in file " << aFile , /*fatal=*/true );
|
||||
return;
|
||||
}
|
||||
|
||||
// Fermeture du fichier
|
||||
if ( medIdt > 0 ) MEDfileClose(medIdt);
|
||||
|
||||
}
|
||||
|
||||
void MgAdapt::updateTimeStepRank()
|
||||
{
|
||||
|
||||
@ -1569,7 +1542,7 @@ void MgAdapt::updateTimeStepRank()
|
||||
else if (myUseLastTimeStep)
|
||||
{
|
||||
std::string fieldFile = useBackgroundMap ? sizeMapFile : medFileIn;
|
||||
getTimeStepInfos(fieldFile, tmst, arank);
|
||||
getTimeStepInfos(fieldFile, tmst, arank, fieldName);
|
||||
setRankTimeStep((int)tmst, (int)arank);
|
||||
}
|
||||
}
|
||||
|
@ -20,28 +20,24 @@
|
||||
//
|
||||
#ifndef MG_ADAPT_HXX
|
||||
#define MG_ADAPT_HXX
|
||||
|
||||
#include <string>
|
||||
# include <sstream>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <fstream>
|
||||
|
||||
#include "MCAuto.hxx"
|
||||
#include "MCType.hxx"
|
||||
#include "MEDFileMesh.hxx"
|
||||
|
||||
#include <med.h>
|
||||
// SMESH includes
|
||||
|
||||
//~#include <med.h>
|
||||
std::string remove_extension(const std::string& filename);
|
||||
namespace MG_ADAPT{
|
||||
class MgAdapt;
|
||||
namespace MEDCoupling
|
||||
{
|
||||
class MEDFileMesh;
|
||||
}
|
||||
|
||||
namespace MG_ADAPT
|
||||
{
|
||||
typedef std::map< std::string, std::string > TOptionValues;
|
||||
typedef std::set< std::string > TOptionNames;
|
||||
|
||||
std::string remove_extension(const std::string& filename);
|
||||
|
||||
struct MgAdaptHypothesisData
|
||||
{
|
||||
std::string myFileInDir, myMeshFileIn, myInMeshName, myMeshFileBackground, myOutMeshName,
|
||||
@ -57,55 +53,6 @@ struct MgAdaptHypothesisData
|
||||
int myVerboseLevel;
|
||||
};
|
||||
|
||||
class outFileStream : public std::ofstream{
|
||||
public:
|
||||
~outFileStream(){close();} //to close file at dtor
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief Class to generate string from any type
|
||||
*/
|
||||
class ToComment : public std::string
|
||||
{
|
||||
std::ostringstream _s ;
|
||||
|
||||
public :
|
||||
|
||||
ToComment():std::string("") {}
|
||||
|
||||
ToComment(const ToComment& c):std::string() {
|
||||
_s << c.c_str() ;
|
||||
this->std::string::operator=( _s.str() );
|
||||
}
|
||||
|
||||
ToComment & operator=(const ToComment& c) {
|
||||
_s << c.c_str() ;
|
||||
this->std::string::operator=( _s.str() );
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
ToComment( const T &anything ) {
|
||||
_s << anything ;
|
||||
this->std::string::operator=( _s.str() );
|
||||
}
|
||||
|
||||
template <class T>
|
||||
ToComment & operator<<( const T &anything ) {
|
||||
_s << anything ;
|
||||
this->std::string::operator=( _s.str() );
|
||||
return *this ;
|
||||
}
|
||||
|
||||
operator char*() const {
|
||||
return (char*)c_str();
|
||||
}
|
||||
|
||||
std::ostream& Stream() {
|
||||
return _s;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class MgAdapt
|
||||
{
|
||||
@ -202,18 +149,18 @@ public:
|
||||
|
||||
bool hasOptionDefined( const std::string& optionName ) const;
|
||||
void setOptionValue(const std::string& optionName,
|
||||
const std::string& optionValue) throw (std::invalid_argument);
|
||||
const std::string& optionValue);
|
||||
std::string getOptionValue(const std::string& optionName,
|
||||
bool* isDefault=0) const throw (std::invalid_argument);
|
||||
bool* isDefault=0) const;
|
||||
std::vector <std::string> getCustomOptionValuesStrVec() const;
|
||||
std::vector <std::string> getOptionValuesStrVec() const;
|
||||
|
||||
|
||||
TOptionValues getOptionValues() const;
|
||||
const TOptionValues& getCustomOptionValues() const ;
|
||||
static double toDbl(const std::string&, bool* isOk = 0) throw (std::invalid_argument);
|
||||
static bool toBool(const std::string&, bool* isOk = 0) throw (std::invalid_argument);
|
||||
static int toInt(const std::string&, bool* isOk = 0 ) throw (std::invalid_argument);
|
||||
static double toDbl(const std::string&, bool* isOk = 0);
|
||||
static bool toBool(const std::string&, bool* isOk = 0);
|
||||
static int toInt(const std::string&, bool* isOk = 0 );
|
||||
static std::string toLowerStr(const std::string& str);
|
||||
|
||||
/* default values */
|
||||
@ -233,7 +180,6 @@ public:
|
||||
static bool defaultUseLastTimeStep();
|
||||
static bool defaultUseChosenTimeStep();
|
||||
static double defaultMaximumMemory();
|
||||
static bool isFileExist(const std::string& fName);
|
||||
|
||||
enum Status {
|
||||
DRS_OK,
|
||||
@ -246,27 +192,20 @@ public:
|
||||
DRS_NO_TIME_STEP // general failure (exception etc.)
|
||||
};
|
||||
|
||||
struct group {
|
||||
|
||||
std::string _name;
|
||||
std::vector<MEDCoupling::mcIdType> _famListId;
|
||||
std::vector<std::string> _famNames;
|
||||
group(std::string name, std::vector<MEDCoupling::mcIdType> famListId, std::vector<std::string> famNames):_name(name)
|
||||
struct group
|
||||
{
|
||||
std::vector<MEDCoupling::mcIdType>::iterator it = famListId.begin();
|
||||
for (; it!=famListId.end(); ++it)
|
||||
_famListId.push_back(*it);
|
||||
|
||||
std::vector<std::string>::iterator itt = famNames.begin();
|
||||
for (; itt!=famNames.end(); ++itt)
|
||||
_famNames.push_back(*itt);
|
||||
}
|
||||
std::string _name;
|
||||
std::vector<int> _famListId;
|
||||
std::vector<std::string> _famNames;
|
||||
group(std::string name, std::vector<int> famListId, std::vector<std::string> famNames)
|
||||
:_name(name), _famListId( famListId ), _famNames( famNames ) {}
|
||||
};
|
||||
|
||||
struct family {
|
||||
struct family
|
||||
{
|
||||
std::string _famName;
|
||||
mcIdType _famId;
|
||||
family(std::string famName, MEDCoupling::mcIdType famId):_famName(famName), _famId(famId) {}
|
||||
int _famId;
|
||||
family(std::string famName, int famId):_famName(famName), _famId(famId) {}
|
||||
};
|
||||
|
||||
|
||||
@ -320,11 +259,9 @@ private :
|
||||
void storeGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh);
|
||||
void restoreGroupsAndFams(MEDCoupling::MEDFileMesh* fileMesh) const;
|
||||
void convertMeshFile(std::string& meshFormatIn, std::vector< std::string>& solFieldFileNames) const ;
|
||||
void buildConstantSizeMapSolFile(const std::string& solFormatFieldFileName, const int dim, const int version, const mcIdType nbNodes) const;
|
||||
void buildConstantSizeMapSolFile(const std::string& solFormatFieldFileName, const int dim, const int version, const size_t nbNodes) const;
|
||||
void buildBackGroundMeshAndSolFiles(const std::vector<std::string>& fieldFileNames, const std::string& meshFormatsizeMapFile) const;
|
||||
void getTimeStepInfos(std::string aFile, med_int& numdt, med_int& numit);
|
||||
Status addMessage(const std::string& msg, const bool isFatal = false);
|
||||
med_idt openMedFile(const std::string aFile) ;
|
||||
void execCmd( const char* cmd, int& err);
|
||||
void cleanUp();
|
||||
void appendMsgToLogFile(std::string& msg);
|
||||
@ -335,6 +272,6 @@ private :
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace MG_ADAPT
|
||||
|
||||
#endif // MG_ADAPT_HXX
|
||||
|
@ -45,7 +45,6 @@ INCLUDE_DIRECTORIES(
|
||||
${PROJECT_SOURCE_DIR}/src/SMESH_I
|
||||
${PROJECT_BINARY_DIR}
|
||||
${PROJECT_BINARY_DIR}/idl
|
||||
${MEDCOUPLING_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# additional preprocessor / compiler flags
|
||||
@ -76,7 +75,6 @@ SET(_link_LIBRARIES
|
||||
SMESHControls
|
||||
SMESHObject
|
||||
SMESHEngine
|
||||
${MEDCoupling_medloader}
|
||||
)
|
||||
|
||||
# --- headers ---
|
||||
@ -149,9 +147,8 @@ SET(_moc_HEADERS
|
||||
SMESHGUI_SplitBiQuad.h
|
||||
SMESHGUI_IdPreview.h
|
||||
SMESHGUI_PreVisualObj.h
|
||||
SMESHGUI_AdaptDlg.h
|
||||
SMESHGUI_MG_ADAPTDRIVER.h
|
||||
MG_ADAPTGUI.hxx # to replace in ../ADAPTGUI/
|
||||
MG_ADAPTGUI.h
|
||||
)
|
||||
|
||||
# header files / no moc processing
|
||||
@ -174,7 +171,6 @@ SET(_other_HEADERS
|
||||
SMESHGUI_FileValidator.h
|
||||
SMESHGUI_SelectionProxy.h
|
||||
SMESH_SMESHGUI.hxx
|
||||
#~MG_ADAPT.hxx # to replace in ../ADAPT/
|
||||
)
|
||||
|
||||
# header files / to install
|
||||
@ -268,10 +264,8 @@ SET(_other_SOURCES
|
||||
SMESHGUI_SplitBiQuad.cxx
|
||||
SMESHGUI_PreVisualObj.cxx
|
||||
SMESHGUI_IdPreview.cxx
|
||||
SMESHGUI_AdaptDlg.cxx
|
||||
SMESHGUI_MG_ADAPTDRIVER.cxx
|
||||
MG_ADAPTGUI.cxx # to replace in ../ADAPTGUI/
|
||||
#MG_ADAPT.cxx
|
||||
MG_ADAPTGUI.cxx
|
||||
)
|
||||
|
||||
# sources / to compile
|
||||
|
@ -21,84 +21,152 @@
|
||||
//
|
||||
// file : MG_ADAPTGUI.cxx
|
||||
|
||||
#include "MG_ADAPTGUI.hxx"
|
||||
#include "MG_ADAPTGUI.h"
|
||||
|
||||
#include "MEDFileData.hxx"
|
||||
#include "MEDLoader.hxx"
|
||||
#include "MED_Factory.hxx"
|
||||
|
||||
#include "SUIT_Desktop.h"
|
||||
#include "SUIT_Application.h"
|
||||
#include "SUIT_Session.h"
|
||||
|
||||
#include "SalomeApp_Application.h"
|
||||
#include "SalomeApp_Module.h"
|
||||
#include "SalomeApp_Study.h"
|
||||
#include <SalomeApp_Tools.h>
|
||||
#include <SalomeApp_Module.h>
|
||||
#include <SUIT_MessageBox.h>
|
||||
#include <LightApp_SelectionMgr.h>
|
||||
#include <SUIT_OverrideCursor.h>
|
||||
#include <SUIT_ResourceMgr.h>
|
||||
#include <SVTK_ViewWindow.h>
|
||||
#include <SALOME_ListIO.hxx>
|
||||
#include <SUIT_FileDlg.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QButtonGroup>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QFileDialog>
|
||||
#include <QGridLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QHeaderView>
|
||||
#include <QItemDelegate>
|
||||
#include <QKeyEvent>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QCheckBox>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QRadioButton>
|
||||
#include <QTabWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QSpacerItem>
|
||||
#include <QSpinBox>
|
||||
#include <QString>
|
||||
#include <QTabWidget>
|
||||
#include <QTreeWidget>
|
||||
#include <QTreeWidgetItem>
|
||||
#include <QSpacerItem>
|
||||
#include <QString>
|
||||
#include <QHeaderView>
|
||||
#include <QItemDelegate>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QComboBox>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include <vtkPoints.h>
|
||||
#include <vtkUnstructuredGrid.h>
|
||||
#include <vtkIdList.h>
|
||||
#include <vtkCellArray.h>
|
||||
#include <vtkUnsignedCharArray.h>
|
||||
#include <vtkDataSetMapper.h>
|
||||
#include <VTKViewer_CellLocationsArray.h>
|
||||
#include <vtkProperty.h>
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
// SALOME KERNEL includes
|
||||
#include <SALOMEDS_SComponent.hxx>
|
||||
#include <SALOMEDS_SObject.hxx>
|
||||
#include <SALOMEDS_Study.hxx>
|
||||
#include <SALOMEDS_wrap.hxx>
|
||||
#include "SalomeApp_Tools.h"
|
||||
#include <SALOMEconfig.h>
|
||||
#include <med.h>
|
||||
#include <utilities.h>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
//#include <SALOMEDS_wrap.hxx>
|
||||
|
||||
const int SPACING = 6; // layout spacing
|
||||
const int MARGIN = 9; // layout margin
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
// ======================================================
|
||||
QString lireNomDimMaillage(QString aFile, int& meshdim)
|
||||
// ========================================================
|
||||
{
|
||||
QString nomMaillage = QString::null ;
|
||||
|
||||
try {
|
||||
while ( true )
|
||||
{
|
||||
|
||||
MED::PWrapper aMed = MED::CrWrapperR( aFile.toUtf8().data() );
|
||||
MED::TInt numberOfMeshes = aMed->GetNbMeshes();
|
||||
|
||||
if (numberOfMeshes == 0 )
|
||||
{
|
||||
QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"),
|
||||
QObject::tr("MG_ADAPT_MED_FILE_2") );
|
||||
break ;
|
||||
}
|
||||
if (numberOfMeshes > 1 )
|
||||
{
|
||||
QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"),
|
||||
QObject::tr("MG_ADAPT_MED_FILE_3") );
|
||||
break ;
|
||||
}
|
||||
|
||||
MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo( 1 );
|
||||
nomMaillage = aMeshInfo->GetName().c_str();
|
||||
meshdim = (int) aMeshInfo->GetDim();
|
||||
|
||||
break ;
|
||||
}
|
||||
}
|
||||
catch ( const SALOME::SALOME_Exception & S_ex )
|
||||
{
|
||||
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
||||
}
|
||||
|
||||
return nomMaillage;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
std::map<QString, int> GetListeChamps(QString aFile, bool errorMessage=true)
|
||||
// =======================================================================
|
||||
{
|
||||
// Il faut voir si plusieurs maillages
|
||||
|
||||
std::map<QString, int> ListeChamp ;
|
||||
|
||||
try
|
||||
{
|
||||
while ( true )
|
||||
{
|
||||
MED::PWrapper aMed = MED::CrWrapperR( aFile.toUtf8().data() );
|
||||
MED::TInt jaux = aMed->GetNbFields();
|
||||
if (jaux < 1 )
|
||||
{
|
||||
if(errorMessage)
|
||||
{
|
||||
QMessageBox::critical( 0, QObject::tr("_ERROR"),
|
||||
QObject::tr("HOM_MED_FILE_5") );
|
||||
}
|
||||
break ;
|
||||
}
|
||||
// nbofcstp inutile pour le moment
|
||||
MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo( 1 );
|
||||
int nbofcstp = 1;
|
||||
for( MED::TInt j=0;j<jaux;j++)
|
||||
{
|
||||
MED::PFieldInfo aFiledInfo = aMed->GetPFieldInfo( aMeshInfo, j + 1 );
|
||||
ListeChamp.insert({ QString( aFiledInfo->GetName().c_str()), nbofcstp });
|
||||
}
|
||||
break ;
|
||||
}
|
||||
}
|
||||
catch ( const SALOME::SALOME_Exception & S_ex )
|
||||
{
|
||||
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
||||
}
|
||||
|
||||
return ListeChamp;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
std::string remove_extension(const std::string& filename)
|
||||
// =======================================================================
|
||||
{
|
||||
size_t lastdot = filename.find_last_of(".");
|
||||
if (lastdot == std::string::npos) return filename;
|
||||
return filename.substr(0, lastdot);
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : SMESHGUI_MgAdaptDlg()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
SMESHGUI_MgAdaptDlg::SMESHGUI_MgAdaptDlg( SalomeApp_Module* theModule, SMESH::MG_ADAPT_ptr myModel, QWidget* parent, bool isCreation )
|
||||
: mySMESHGUI( theModule ), QDialog(parent)
|
||||
: QDialog(parent), mySMESHGUI( theModule )
|
||||
{
|
||||
//~model = new MgAdapt(*myModel);
|
||||
model = SMESH::MG_ADAPT::_duplicate(myModel);
|
||||
model->Register();
|
||||
myData = model->getData();
|
||||
buildDlg();
|
||||
if (!isCreation) readParamsFromHypo();
|
||||
@ -116,17 +184,17 @@ void SMESHGUI_MgAdaptDlg::buildDlg()
|
||||
// Arguments
|
||||
|
||||
myArgs = new SMESHGUI_MgAdaptArguments( myTabWidget );
|
||||
SMESH::str_array* str = model->getOptionValuesStrVec();
|
||||
SMESH::str_array* str2 = model->getCustomOptionValuesStrVec();
|
||||
SMESH::string_array_var str = model->getOptionValuesStrVec();
|
||||
SMESH::string_array_var str2 = model->getCustomOptionValuesStrVec();
|
||||
std::vector<std::string> s;
|
||||
for (int i = 0; i< str->length(); i++) s.push_back( (*str)[i].in());
|
||||
for (int j = str->length(); j< str2->length(); j++) s.push_back((*str2)[ j - str->length() ].in() );
|
||||
for (CORBA::ULong i = 0; i< str->length(); i++) s.push_back( str[i].in());
|
||||
for (CORBA::ULong j = str->length(); j< str2->length(); j++) s.push_back(str[ j - str->length() ].in() );
|
||||
//~str.insert( str.end(), str2.begin(), str2.end() );
|
||||
|
||||
myAdvOpt = new MgAdaptAdvWidget(myTabWidget, &s);
|
||||
|
||||
int argsTab = myTabWidget->addTab( myArgs, tr( "Args" ) );
|
||||
int advTab = myTabWidget->addTab( myAdvOpt, tr( "ADVOP" ) );
|
||||
/*int argsTab =*/ myTabWidget->addTab( myArgs, tr( "Args" ) );
|
||||
/*int advTab =*/ myTabWidget->addTab( myAdvOpt, tr( "ADVOP" ) );
|
||||
|
||||
myAdvOpt->workingDirectoryLabel ->setText (tr( "WORKING_DIR" ));
|
||||
myAdvOpt->workingDirectoryPushButton ->setText (tr( "SELECT_DIR" ));
|
||||
@ -214,7 +282,7 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromHypo( ) const
|
||||
if (myData->fromMedFile)
|
||||
{
|
||||
|
||||
*(myArgs->myFileInDir) = QString(myData->myFileInDir) ;
|
||||
myArgs->myFileInDir = myData->myFileInDir;
|
||||
myArgs->selectMedFileLineEdit->setText(QString(myData->myMeshFileIn)) ;
|
||||
// myData->myInMeshName = // TODO
|
||||
|
||||
@ -230,12 +298,12 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromHypo( ) const
|
||||
|
||||
if(myData->myMeshOutMed)
|
||||
{
|
||||
*(myArgs->myFileOutDir) = QString(myData->myFileOutDir);
|
||||
myArgs->selectOutMedFileLineEdit->setText(QString(myData->myMeshFileOut));
|
||||
myArgs->myFileOutDir = QString(myData->myFileOutDir);
|
||||
myArgs->selectOutMedFileLineEdit->setText(myData->myMeshFileOut.in());
|
||||
}
|
||||
else
|
||||
{
|
||||
*(myArgs->myFileOutDir) = QString(""); //TODO
|
||||
myArgs->myFileOutDir = ""; //TODO
|
||||
}
|
||||
|
||||
myArgs->publishOut->setChecked(myData->myPublish);
|
||||
@ -256,12 +324,12 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromHypo( ) const
|
||||
if (myData->myUseBackgroundMap)
|
||||
{
|
||||
|
||||
*(myArgs->myFileSizeMapDir) = QString(myData->myFileSizeMapDir) ;
|
||||
myArgs->myFileSizeMapDir = QString(myData->myFileSizeMapDir) ;
|
||||
myArgs->selectMedFileBackgroundLineEdit->setText(QString(myData->myMeshFileBackground));
|
||||
}
|
||||
else
|
||||
{
|
||||
*(myArgs->myFileSizeMapDir) = QString("") ; //TODO
|
||||
myArgs->myFileSizeMapDir = ""; //TODO
|
||||
myArgs->selectMedFileBackgroundLineEdit->setText(""); //TODO
|
||||
}
|
||||
|
||||
@ -288,17 +356,16 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromHypo( ) const
|
||||
|
||||
bool SMESHGUI_MgAdaptDlg::readParamsFromWidgets()
|
||||
{
|
||||
MESSAGE ("readParamsFromWidgets") ;
|
||||
bool ret = true ;
|
||||
SMESH::MgAdaptHypothesisData* aData = new SMESH::MgAdaptHypothesisData();
|
||||
SMESH::MgAdaptHypothesisData data, *aData = &data;
|
||||
while ( ret )
|
||||
{
|
||||
// 1. Fichier du maillage de départ
|
||||
aData->fromMedFile = myArgs->aMedfile->isChecked();
|
||||
if (aData->fromMedFile)
|
||||
{
|
||||
aData->myFileInDir = CORBA::string_dup(myArgs->myFileInDir->toStdString().c_str());
|
||||
aData->myMeshFileIn = CORBA::string_dup(myArgs->selectMedFileLineEdit->text().toStdString().c_str());
|
||||
aData->myFileInDir = CORBA::string_dup(myArgs->myFileInDir.toUtf8().data());
|
||||
aData->myMeshFileIn = CORBA::string_dup(myArgs->selectMedFileLineEdit->text().toUtf8().data());
|
||||
// aData->myInMeshName = // TODO
|
||||
}
|
||||
else // TODO browser
|
||||
@ -325,8 +392,8 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromWidgets()
|
||||
aData->myMeshOutMed = myArgs->medFileCheckBox->isChecked();
|
||||
if(aData->myMeshOutMed)
|
||||
{
|
||||
aData->myFileOutDir = CORBA::string_dup(myArgs->myFileOutDir->toStdString().c_str());
|
||||
aData->myMeshFileOut = CORBA::string_dup(myArgs->selectOutMedFileLineEdit->text().toStdString().c_str());
|
||||
aData->myFileOutDir = CORBA::string_dup(myArgs->myFileOutDir.toUtf8().data());
|
||||
aData->myMeshFileOut = CORBA::string_dup(myArgs->selectOutMedFileLineEdit->text().toUtf8().data());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -350,8 +417,8 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromWidgets()
|
||||
// 3.2. Arrière-plan
|
||||
if (aData->myUseBackgroundMap)
|
||||
{
|
||||
aData->myFileSizeMapDir = CORBA::string_dup(myArgs->myFileSizeMapDir->toStdString().c_str());
|
||||
aData->myMeshFileBackground = CORBA::string_dup(myArgs->selectMedFileBackgroundLineEdit->text().toStdString().c_str());
|
||||
aData->myFileSizeMapDir = CORBA::string_dup(myArgs->myFileSizeMapDir.toUtf8().data());
|
||||
aData->myMeshFileBackground = CORBA::string_dup(myArgs->selectMedFileBackgroundLineEdit->text().toUtf8().data());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -394,12 +461,11 @@ bool SMESHGUI_MgAdaptDlg::readParamsFromWidgets()
|
||||
break ;
|
||||
}
|
||||
|
||||
delete aData;
|
||||
|
||||
return ret;
|
||||
}
|
||||
bool SMESHGUI_MgAdaptDlg::storeParamsToHypo( const SMESH::MgAdaptHypothesisData& ) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
/*!
|
||||
\brief Show help page
|
||||
@ -470,20 +536,17 @@ SMESHGUI_MgAdaptArguments::SMESHGUI_MgAdaptArguments( QWidget* parent )
|
||||
:QWidget(parent)
|
||||
{
|
||||
|
||||
myFileInDir = new QString("");
|
||||
myFileOutDir = new QString("");
|
||||
myFileSizeMapDir = new QString("");
|
||||
if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
|
||||
{
|
||||
*myFileInDir = QDir::currentPath();
|
||||
*myFileOutDir = QDir::currentPath();
|
||||
*myFileSizeMapDir = QDir::currentPath();
|
||||
myFileInDir = QDir::currentPath();
|
||||
myFileOutDir = QDir::currentPath();
|
||||
myFileSizeMapDir = QDir::currentPath();
|
||||
}
|
||||
else
|
||||
{
|
||||
*myFileInDir = SUIT_FileDlg::getLastVisitedPath();
|
||||
*myFileOutDir = SUIT_FileDlg::getLastVisitedPath();
|
||||
*myFileSizeMapDir = SUIT_FileDlg::getLastVisitedPath();
|
||||
myFileInDir = SUIT_FileDlg::getLastVisitedPath();
|
||||
myFileOutDir = SUIT_FileDlg::getLastVisitedPath();
|
||||
myFileSizeMapDir = SUIT_FileDlg::getLastVisitedPath();
|
||||
}
|
||||
|
||||
meshDim = 0;
|
||||
@ -648,7 +711,7 @@ void SMESHGUI_MgAdaptArguments::onLastTimeStep(bool disableOther)
|
||||
timeStep->setValue(-1);
|
||||
noTimeStep->setDisabled(disableOther);
|
||||
}
|
||||
void SMESHGUI_MgAdaptArguments::onChosenTimeStep(bool disableOther, int vmax)
|
||||
void SMESHGUI_MgAdaptArguments::onChosenTimeStep(bool /*disableOther*/, int vmax)
|
||||
{
|
||||
chosenTimeStep->setChecked(true);
|
||||
|
||||
@ -675,7 +738,7 @@ void SMESHGUI_MgAdaptArguments::onSelectOutMedFilebutton()
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("SAVE_MED"), QString(""), filtre);
|
||||
QFileInfo myFileInfo(fileName);
|
||||
selectOutMedFileLineEdit->setText(myFileInfo.fileName());
|
||||
*myFileOutDir = myFileInfo.path();
|
||||
myFileOutDir = myFileInfo.path();
|
||||
|
||||
}
|
||||
void SMESHGUI_MgAdaptArguments::onSelectMedFileBackgroundbutton()
|
||||
@ -703,8 +766,7 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFileBackgroundbutton()
|
||||
timeStepGroupChanged(typeStepInField, false);
|
||||
}
|
||||
// Dimension du maillage de fonds
|
||||
MEDCoupling::MCAuto<MEDCoupling::MEDFileData> mfd = MEDCoupling::MEDFileData::New(fileName.toStdString());
|
||||
meshDimBG = mfd->getMeshes()->getMeshAtPos(0)->getMeshDimension() ;
|
||||
lireNomDimMaillage( fileName, meshDimBG );
|
||||
valueAdaptation ();
|
||||
}
|
||||
}
|
||||
@ -715,7 +777,7 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFileBackgroundbutton()
|
||||
}
|
||||
|
||||
QFileInfo myFileInfo(fileName);
|
||||
*myFileSizeMapDir = myFileInfo.path();
|
||||
myFileSizeMapDir = myFileInfo.path();
|
||||
selectMedFileBackgroundLineEdit->setText(myFileInfo.fileName());
|
||||
|
||||
}
|
||||
@ -751,8 +813,8 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFilebuttonClicked()
|
||||
QString fileName = getMedFileName(false);
|
||||
if(fileName != QString::null)
|
||||
{
|
||||
QString aMeshName = lireNomMaillage(fileName.trimmed(), meshDim);
|
||||
if (aMeshName == QString::null )
|
||||
QString aMeshName = lireNomDimMaillage(fileName.trimmed(), meshDim);
|
||||
if (aMeshName.isEmpty() )
|
||||
{
|
||||
QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"),
|
||||
QObject::tr("MG_ADAPT_MED_FILE_2") );
|
||||
@ -772,8 +834,8 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFilebuttonClicked()
|
||||
}
|
||||
|
||||
QFileInfo myFileInfo(fileName);
|
||||
*myFileInDir = myFileInfo.path();
|
||||
*myFileOutDir = myFileInfo.path();
|
||||
myFileInDir = myFileInfo.path();
|
||||
myFileOutDir = myFileInfo.path();
|
||||
selectMedFileLineEdit->setText(myFileInfo.fileName());
|
||||
QString outF = fileName == QString::null ? myFileInfo.fileName() :
|
||||
QString( remove_extension(myFileInfo.fileName().toStdString() ).c_str() )+ QString(".adapt.med");
|
||||
@ -828,7 +890,7 @@ void SMESHGUI_MgAdaptArguments::onLocalSelected(QString filePath)
|
||||
// 2) retourne le nom du fichier asocie a l objet
|
||||
// selectionne dans l arbre d etude
|
||||
// =======================================================================
|
||||
QString SMESHGUI_MgAdaptArguments::getMedFileName(bool avertir)
|
||||
QString SMESHGUI_MgAdaptArguments::getMedFileName(bool /*avertir*/)
|
||||
{
|
||||
|
||||
QString aFile = QString::null;
|
||||
@ -893,7 +955,7 @@ void SMESHGUI_MgAdaptArguments::sizeMapDefChanged( int theSizeMap )
|
||||
sizeMapField->setEnabled(true);
|
||||
if (!selectMedFileLineEdit->text().isEmpty())
|
||||
{
|
||||
QFileInfo myFileInfo(QDir(*myFileInDir), selectMedFileLineEdit->text());
|
||||
QFileInfo myFileInfo(QDir(myFileInDir), selectMedFileLineEdit->text());
|
||||
onLocalSelected(myFileInfo.filePath());
|
||||
}
|
||||
}
|
||||
@ -967,7 +1029,7 @@ MgAdaptAdvWidget::MgAdaptAdvWidget( QWidget* parent, std::vector <std::string>*
|
||||
myOptionTable->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
|
||||
myOptionTable->setItemDelegate( new ItemDelegate( myOptionTable ) );
|
||||
|
||||
for ( int i = 0, nb = myOptions->size(); i < nb; ++i )
|
||||
for ( size_t i = 0, nb = myOptions->size(); i < nb; ++i )
|
||||
{
|
||||
AddOption( (*myOptions)[i].c_str() );
|
||||
}
|
||||
@ -1280,86 +1342,3 @@ void MgAdaptAdvWidgetTreeWidget::keyPressEvent( QKeyEvent* e )
|
||||
}
|
||||
QTreeWidget::keyPressEvent( e );
|
||||
}
|
||||
|
||||
// ======================================================
|
||||
// ========================================================
|
||||
QString lireNomMaillage(QString aFile, med_int& meshdim)
|
||||
{
|
||||
QString nomMaillage = QString::null ;
|
||||
|
||||
while ( true )
|
||||
{
|
||||
std::vector<std::string> listMeshesNames = MEDCoupling::GetMeshNames(aFile.toStdString());
|
||||
|
||||
std::size_t numberOfMeshes(listMeshesNames.size());
|
||||
// std::cout << "numberOfMeshes:" << numberOfMeshes << std::endl;
|
||||
if (numberOfMeshes == 0 )
|
||||
{
|
||||
QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"),
|
||||
QObject::tr("MG_ADAPT_MED_FILE_2") );
|
||||
break ;
|
||||
}
|
||||
if (numberOfMeshes > 1 )
|
||||
{
|
||||
QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"),
|
||||
QObject::tr("MG_ADAPT_MED_FILE_3") );
|
||||
break ;
|
||||
}
|
||||
|
||||
// std::cout << "nomMaillage:" << listMeshesNames[0] << std::endl;
|
||||
nomMaillage = QString(listMeshesNames[0].c_str());
|
||||
|
||||
// Dimension du maillage
|
||||
MEDCoupling::MCAuto<MEDCoupling::MEDFileData> mfd = MEDCoupling::MEDFileData::New(aFile.toStdString());
|
||||
meshdim = mfd->getMeshes()->getMeshAtPos(0)->getMeshDimension() ;
|
||||
// std::cout << "meshdim:" << meshdim << std::endl;
|
||||
|
||||
break ;
|
||||
}
|
||||
|
||||
return nomMaillage;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
std::map<QString, int> GetListeChamps(QString aFile, bool errorMessage)
|
||||
// =======================================================================
|
||||
{
|
||||
// Il faut voir si plusieurs maillages
|
||||
|
||||
std::map<QString, int> ListeChamp ;
|
||||
|
||||
while ( true )
|
||||
{
|
||||
MEDCoupling::MCAuto<MEDCoupling::MEDFileData> mfd = MEDCoupling::MEDFileData::New(aFile.toStdString());
|
||||
std::vector<std::string> listFieldsNames(mfd->getFields()->getFieldsNames());
|
||||
std::size_t jaux(listFieldsNames.size());
|
||||
if (jaux < 1 )
|
||||
{
|
||||
if(errorMessage)
|
||||
{
|
||||
QMessageBox::critical( 0, QObject::tr("_ERROR"),
|
||||
QObject::tr("HOM_MED_FILE_5") );
|
||||
}
|
||||
break ;
|
||||
}
|
||||
// nbofcstp inutile pour le moment
|
||||
med_int nbofcstp = 1;
|
||||
for(std::size_t j=0;j<jaux;j++)
|
||||
{
|
||||
// std::cout << listFieldsNames[j] << std::endl;
|
||||
ListeChamp.insert(std::pair<QString, int> (QString(listFieldsNames[j].c_str()), nbofcstp));
|
||||
}
|
||||
break ;
|
||||
}
|
||||
|
||||
return ListeChamp;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
std::string remove_extension(const std::string& filename)
|
||||
// =======================================================================
|
||||
{
|
||||
size_t lastdot = filename.find_last_of(".");
|
||||
if (lastdot == std::string::npos) return filename;
|
||||
return filename.substr(0, lastdot);
|
||||
}
|
||||
|
@ -1,329 +0,0 @@
|
||||
// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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, or (at your option) any later version.
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// SMESH SMESHGUI : GUI for the adaptation in the SMESH component
|
||||
// File : MG_ADAPTGUI.hxx
|
||||
//
|
||||
#ifndef MG_ADAPTGUI_HXX
|
||||
#define MG_ADAPTGUI_HXX
|
||||
|
||||
#include <set>
|
||||
// SMESH includes
|
||||
|
||||
// Qt includes
|
||||
#include <QDialog>
|
||||
#include <QTreeWidget>
|
||||
#include<QItemDelegate>
|
||||
|
||||
#include "LightApp_DataOwner.h"
|
||||
#include "SalomeApp_Application.h"
|
||||
#include <SALOMEconfig.h>
|
||||
#include <SALOME_ListIO.hxx>
|
||||
#include "SalomeApp_Module.h"
|
||||
#include "SalomeApp_Study.h"
|
||||
#include <med.h>
|
||||
#include <map>
|
||||
|
||||
|
||||
// model
|
||||
|
||||
|
||||
//~#include "MG_ADAPT.hxx"
|
||||
|
||||
#include CORBA_SERVER_HEADER(MG_ADAPT)
|
||||
|
||||
class SUIT_ViewWindow;
|
||||
class SUIT_Desktop;
|
||||
class SUIT_Study;
|
||||
class SUIT_ResourceMgr;
|
||||
|
||||
class CAM_Module;
|
||||
|
||||
class SALOMEDSClient_Study;
|
||||
class SALOMEDSClient_SObject;
|
||||
|
||||
class SalomeApp_Study;
|
||||
class SalomeApp_Module;
|
||||
class LightApp_SelectionMgr;
|
||||
|
||||
|
||||
class QButtonGroup;
|
||||
class QLineEdit;
|
||||
class QGroupBox;
|
||||
class QRadioButton;
|
||||
class QLabel;
|
||||
class QCheckBox;
|
||||
class QGridLayout;
|
||||
class QTabWidget;
|
||||
class QDoubleSpinBox;
|
||||
class QSpinBox;
|
||||
class QTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
class QSpacerItem;
|
||||
class QHBoxLayout;
|
||||
class QItemDelegate;
|
||||
class QComboBox;
|
||||
|
||||
// IDL includes
|
||||
#include <SALOMEconfig.h>
|
||||
|
||||
class SVTK_ViewWindow;
|
||||
class SVTK_Selector;
|
||||
class SMESHGUI_MgAdaptDlg;
|
||||
class SMESHGUI_MgAdaptArguments;
|
||||
class SMESHGUI_SpinBox;
|
||||
class MgAdaptAdvWidgetTreeWidget;
|
||||
class MgAdaptAdvWidget;
|
||||
//~class MgAdapt;
|
||||
class QHeaderView;
|
||||
class QFileDialog;
|
||||
|
||||
|
||||
std::map<QString, int> GetListeChamps(QString aFile, bool errorMessage = true);
|
||||
QString lireNomMaillage(QString aFile, med_int& meshDim);
|
||||
|
||||
std::string remove_extension(const std::string& filename);
|
||||
|
||||
enum ADAPTATION_MODE{
|
||||
SURFACE,
|
||||
VOLUME,
|
||||
BOTH
|
||||
};
|
||||
//=================================================================================
|
||||
// class : SMESHGUI_MgAdaptDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class SMESHGUI_MgAdaptDlg : public QDialog
|
||||
{
|
||||
Q_OBJECT;
|
||||
public:
|
||||
//! Property type
|
||||
enum Mode { Arguments, AdvancedOptions};
|
||||
SMESHGUI_MgAdaptDlg( SalomeApp_Module*, SMESH::MG_ADAPT_ptr, QWidget* parent= 0,bool isCreation = true );
|
||||
~SMESHGUI_MgAdaptDlg();
|
||||
|
||||
void buildDlg();
|
||||
void reject();
|
||||
bool checkParams(QString& msg) ;
|
||||
//~void setModel(MgAdapt*);
|
||||
SMESH::MG_ADAPT_ptr getModel() const;
|
||||
|
||||
public slots:
|
||||
|
||||
protected slots:
|
||||
virtual bool PushOnApply();
|
||||
|
||||
private slots:
|
||||
virtual void PushOnHelp();
|
||||
virtual void PushOnOK();
|
||||
|
||||
protected :
|
||||
|
||||
SMESHGUI_MgAdaptArguments* myArgs;
|
||||
MgAdaptAdvWidget* myAdvOpt;
|
||||
bool readParamsFromHypo( ) const ;
|
||||
bool readParamsFromWidgets( ) ;
|
||||
bool storeParamsToHypo( const SMESH::MgAdaptHypothesisData & ) const;
|
||||
|
||||
private:
|
||||
|
||||
SalomeApp_Module* mySMESHGUI; /* Current SMESHGUI object */
|
||||
QTabWidget* myTabWidget;
|
||||
|
||||
|
||||
SMESH::MgAdaptHypothesisData* myData;
|
||||
SMESH::MG_ADAPT_ptr model;
|
||||
|
||||
};
|
||||
|
||||
class SMESHGUI_MgAdaptArguments : public QWidget
|
||||
{
|
||||
Q_OBJECT;
|
||||
public:
|
||||
//! Property type
|
||||
enum Mode { Mesh, Browser};
|
||||
enum SIZEMAP { Local, Background, Constant};
|
||||
SMESHGUI_MgAdaptArguments( QWidget* parent);
|
||||
~SMESHGUI_MgAdaptArguments();
|
||||
void setMode( const Mode, const SIZEMAP );
|
||||
|
||||
QString* myFileInDir;
|
||||
QString* myFileOutDir;
|
||||
QString* myFileSizeMapDir;
|
||||
QGroupBox* aMeshIn ;
|
||||
QRadioButton* aMedfile;
|
||||
QRadioButton* aBrowser ;
|
||||
QLineEdit* aBrowserObject;
|
||||
QPushButton* selectMedFilebutton ;
|
||||
QSpacerItem* hspacer;
|
||||
QLineEdit* selectMedFileLineEdit ;
|
||||
QButtonGroup* meshInGroup ;
|
||||
QGridLayout* meshIn ;
|
||||
|
||||
QGroupBox* aMeshOut ;
|
||||
QLabel* meshName;
|
||||
QLineEdit* meshNameLineEdit;
|
||||
QSpacerItem* secondHspacer;
|
||||
QCheckBox* medFileCheckBox;
|
||||
QPushButton* selectOutMedFilebutton;
|
||||
QLineEdit* selectOutMedFileLineEdit;
|
||||
QSpacerItem* thirdHspacer;
|
||||
QCheckBox* publishOut;
|
||||
QGridLayout* meshOut ;
|
||||
|
||||
QGroupBox* sizeMapDefinition ;
|
||||
QRadioButton* localButton;
|
||||
QRadioButton* backgroundButton ;
|
||||
QRadioButton* constantButton ;
|
||||
QLabel* medFileBackground;
|
||||
QPushButton* selectMedFileBackgroundbutton;
|
||||
QLineEdit* selectMedFileBackgroundLineEdit;
|
||||
QLabel* valueLabel;
|
||||
QDoubleSpinBox* dvalue;
|
||||
QButtonGroup* sizeMapDefGroup ;
|
||||
QGridLayout* sizeMapDefGroupLayout;
|
||||
|
||||
|
||||
QGroupBox* sizeMapField;
|
||||
QLabel* fieldName;
|
||||
QComboBox* fieldNameCmb;
|
||||
QRadioButton* noTimeStep;
|
||||
QRadioButton* lastTimeStep ;
|
||||
QRadioButton* chosenTimeStep;
|
||||
QLabel* timeStepLabel;
|
||||
QSpinBox* timeStep;
|
||||
QLabel* rankLabel;
|
||||
QSpinBox* rankSpinBox;
|
||||
QButtonGroup* timeStepGroup;
|
||||
QGridLayout* sizeMapFieldGroupLayout;
|
||||
|
||||
signals:
|
||||
void updateSelection();
|
||||
void toExportMED(const char *);
|
||||
void meshDimSignal(ADAPTATION_MODE aMode);
|
||||
public slots:
|
||||
|
||||
protected slots:
|
||||
|
||||
private slots:
|
||||
void modeChanged( int);
|
||||
void sizeMapDefChanged(int);
|
||||
void timeStepGroupChanged(int timeStepType, bool disableOther = false, int vmax = 0);
|
||||
void onSelectMedFilebuttonClicked();
|
||||
void clear();
|
||||
void onMedFileCheckBox(int);
|
||||
void onPublishOut(int);
|
||||
void onSelectOutMedFilebutton();
|
||||
void onSelectMedFileBackgroundbutton();
|
||||
void onLocalSelected(QString);
|
||||
void onNoTimeStep(bool disableOther = false);
|
||||
void onLastTimeStep(bool disableOther = false);
|
||||
void onChosenTimeStep(bool disableOther = false, int vmax = 0);
|
||||
void visibleTimeStepRankLabel(bool visible);
|
||||
void valueAdaptation ();
|
||||
|
||||
private:
|
||||
|
||||
QString getMedFileName(bool avertir);
|
||||
LightApp_SelectionMgr* selMgr ;
|
||||
med_int meshDim;
|
||||
med_int meshDimBG;
|
||||
std::map<QString, int> myFieldList;
|
||||
|
||||
};
|
||||
enum {
|
||||
OPTION_ID_COLUMN = 0,
|
||||
OPTION_TYPE_COLUMN,
|
||||
OPTION_NAME_COLUMN = 0,
|
||||
OPTION_VALUE_COLUMN,
|
||||
NB_COLUMNS,
|
||||
};
|
||||
|
||||
//////////////////////////////////////////
|
||||
// MgAdaptAdvWidget
|
||||
//////////////////////////////////////////
|
||||
class MgAdaptAdvWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MgAdaptAdvWidget( QWidget* = 0, std::vector <std::string> * = nullptr, Qt::WindowFlags = 0 );
|
||||
~MgAdaptAdvWidget();
|
||||
std::vector < std::string > * myOptions;
|
||||
QGridLayout *gridLayout_4;
|
||||
MgAdaptAdvWidgetTreeWidget *myOptionTable;
|
||||
QPushButton *addBtn;
|
||||
QSpacerItem *horizontalSpacer;
|
||||
QGroupBox *logGroupBox;
|
||||
QGridLayout *gridLayout_2;
|
||||
QGridLayout *gridLayout;
|
||||
QLabel *workingDirectoryLabel;
|
||||
QLineEdit *workingDirectoryLineEdit;
|
||||
QPushButton *workingDirectoryPushButton;
|
||||
QLabel *verboseLevelLabel;
|
||||
QSpinBox *verboseLevelSpin;
|
||||
QHBoxLayout *horizontalLayout;
|
||||
QCheckBox *logInFileCheck;
|
||||
QCheckBox *removeLogOnSuccessCheck;
|
||||
QCheckBox *keepWorkingFilesCheck;
|
||||
|
||||
void AddOption( const char* name_value_type, bool isCustom = false );
|
||||
void GetOptionAndValue( QTreeWidgetItem * tblRow, QString& option, QString& value, bool& dflt );
|
||||
void setupWidget();
|
||||
|
||||
public slots:
|
||||
void onAddOption();
|
||||
void itemChanged(QTreeWidgetItem * tblRow, int column);
|
||||
void onMeshDimChanged(ADAPTATION_MODE aMode);
|
||||
private slots:
|
||||
void _onWorkingDirectoryPushButton();
|
||||
private:
|
||||
void setOptionValue(QString& option, QString& value);
|
||||
std::map<QString, QTreeWidgetItem *> optionTreeWidgetItem;
|
||||
|
||||
QTreeWidgetItem* getNewQTreeWidgetItem(QTreeWidget* table, const char* option, QString& name, bool isCustom);
|
||||
|
||||
};
|
||||
|
||||
enum { EDITABLE_ROLE = Qt::UserRole + 1, PARAM_NAME,
|
||||
NAME_COL = 0, VALUE_COL
|
||||
};
|
||||
|
||||
class ItemDelegate: public QItemDelegate
|
||||
{
|
||||
public:
|
||||
|
||||
ItemDelegate(QObject* parent=0): QItemDelegate(parent) {}
|
||||
QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &o, const QModelIndex &index) const;
|
||||
};
|
||||
|
||||
class MgAdaptAdvWidgetTreeWidget : public QTreeWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MgAdaptAdvWidgetTreeWidget( QWidget* );
|
||||
|
||||
protected:
|
||||
QModelIndex moveCursor( CursorAction, Qt::KeyboardModifiers );
|
||||
void keyPressEvent( QKeyEvent* );
|
||||
};
|
||||
|
||||
#endif // MG_ADAPTGUI_HXX
|
@ -30,7 +30,6 @@
|
||||
|
||||
// SMESH includes
|
||||
#include "SMESHGUI.h"
|
||||
#include "SMESHGUI_AdaptDlg.h"
|
||||
#include "SMESHGUI_Add0DElemsOnAllNodesDlg.h"
|
||||
#include "SMESHGUI_AddMeshElementDlg.h"
|
||||
#include "SMESHGUI_AddQuadraticElementDlg.h"
|
||||
@ -61,6 +60,7 @@
|
||||
#include "SMESHGUI_GroupUtils.h"
|
||||
#include "SMESHGUI_Hypotheses.h"
|
||||
#include "SMESHGUI_HypothesesUtils.h"
|
||||
#include "SMESHGUI_MG_ADAPTDRIVER.h"
|
||||
#include "SMESHGUI_Make2DFrom3DOp.h"
|
||||
#include "SMESHGUI_MakeNodeAtPointDlg.h"
|
||||
#include "SMESHGUI_Measurements.h"
|
||||
@ -168,22 +168,22 @@
|
||||
#include <vtkRenderer.h>
|
||||
|
||||
// SALOME KERNEL includes
|
||||
#include <Basics_Utils.hxx>
|
||||
#include <SALOMEDSClient_ClientFactory.hxx>
|
||||
#include <SALOMEDSClient_IParameters.hxx>
|
||||
#include <SALOMEDSClient_SComponent.hxx>
|
||||
#include <SALOMEDSClient_StudyBuilder.hxx>
|
||||
#include <SALOMEDS_Study.hxx>
|
||||
#include <SALOMEDS_SObject.hxx>
|
||||
#include "utilities.h"
|
||||
#include <SALOMEDS_Study.hxx>
|
||||
#include <SALOME_GenericObj_wrap.hxx>
|
||||
#include <SALOME_LifeCycleCORBA.hxx>
|
||||
#include <utilities.h>
|
||||
|
||||
// OCCT includes
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <NCollection_DoubleMap.hxx>
|
||||
|
||||
#include <Basics_Utils.hxx>
|
||||
|
||||
// Below macro, when uncommented, switches on simplified (more performant) algorithm
|
||||
// of auto-color picking up
|
||||
#define SIMPLE_AUTOCOLOR
|
||||
@ -3046,8 +3046,14 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
||||
// Adaptation - begin
|
||||
case SMESHOp::OpMGAdapt:
|
||||
{
|
||||
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil();
|
||||
SMESHGUI_AdaptDlg *objet = new SMESHGUI_AdaptDlg( this, theCommandID, aMesh);
|
||||
if ( isStudyLocked() )
|
||||
break;
|
||||
EmitSignalDeactivateDialog();
|
||||
|
||||
SALOME::GenericObj_wrap< SMESH::MG_ADAPT > model = GetSMESHGen()->CreateMG_ADAPT();
|
||||
bool isCreation = false;
|
||||
( new SMESHGUI_MG_ADAPTDRIVER( this, model, isCreation ))->show();
|
||||
break;
|
||||
}
|
||||
// Adaptation - end
|
||||
case SMESHOp::OpSplitBiQuadratic:
|
||||
|
@ -1,162 +0,0 @@
|
||||
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
|
||||
//
|
||||
// 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, or (at your option) any later version.
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
// SMESH SMESHGUI : GUI for the adaptation in the SMESH component
|
||||
// File : SMESHGUI_AdaptDlg.cxx
|
||||
// Author : Gerald NICOLAS, EDF
|
||||
|
||||
// SMESH includes
|
||||
#include "SMESHGUI.h"
|
||||
#include "SMESHGUI_AdaptDlg.h"
|
||||
#include "SMESHGUI_MG_ADAPTDRIVER.h"
|
||||
//~#include "MG_ADAPT_i.hxx"
|
||||
//~#include "MG_ADAPT.hxx"
|
||||
|
||||
// SALOME GUI includes
|
||||
#include <SUIT_Desktop.h>
|
||||
#include <SUIT_ResourceMgr.h>
|
||||
#include <SUIT_Session.h>
|
||||
#include <SalomeApp_Application.h>
|
||||
#include <SalomeApp_Study.h>
|
||||
|
||||
// SALOME KERNEL includes
|
||||
#include "utilities.h"
|
||||
#include <SALOME_LifeCycleCORBA.hxx>
|
||||
|
||||
//=================================================================================
|
||||
// function : SMESHGUI_AdaptDlg()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
SMESHGUI_AdaptDlg::SMESHGUI_AdaptDlg( SMESHGUI* theModule,
|
||||
int theCommandID,
|
||||
SMESH::SMESH_Mesh_ptr theMesh )
|
||||
: mySMESHGUI( theModule )
|
||||
{
|
||||
action( theCommandID ) ;
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ~SMESHGUI_AdaptDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
SMESHGUI_AdaptDlg::~SMESHGUI_AdaptDlg()
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Pilote les actions d'adaption de maillage
|
||||
* \param
|
||||
* \return bool OK/notOK
|
||||
*/
|
||||
void SMESHGUI_AdaptDlg::action (int theCommandID)
|
||||
//=======================================================================
|
||||
{
|
||||
// std::cout << "SMESHGUI_AdaptDlg::action avec theCommandID : " << theCommandID << std::endl;
|
||||
|
||||
// Preferences
|
||||
// recupPreferences();
|
||||
|
||||
// Menus and actions
|
||||
bool ok = OnGUIEvent (theCommandID) ;
|
||||
if ( ! ok ) INFOS("Erreur");
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
// /*!
|
||||
// * \brief Gets the preferences for the adaptation
|
||||
// * \param
|
||||
// * \return
|
||||
// *
|
||||
// * Pour chaque valeur, le defaut est la valeur definie dans ADAPT_Gen
|
||||
// * . Si la recuperation dans config/salome s'est bien passee a la creation de ADAPT_Gen
|
||||
// * ces valeurs sont les valeurs definies.
|
||||
// * . Si cela ne s'est pas bien passe, ce sont les valeurs par defaut de ADAPT_Gen
|
||||
// */
|
||||
// void SMESHGUI_AdaptDlg::recupPreferences()
|
||||
// {
|
||||
// INFOS("Début de recupPreferences")
|
||||
// //
|
||||
// // A. Declarations
|
||||
// //
|
||||
// SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||
// SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA(app->namingService());
|
||||
// Engines::EngineComponent_var comp = ls->FindOrLoad_Component("FactoryServer", "SMESH");
|
||||
// ADAPT::ADAPT_Gen_var adaptGen = ADAPT::ADAPT_Gen::_narrow(comp);
|
||||
// if (!CORBA::is_nil(adaptGen))
|
||||
// adaptGen->UpdateStudy();
|
||||
//
|
||||
// SUIT_ResourceMgr* resMgr = mySMESHGUI->getApp()->resourceMgr();
|
||||
//
|
||||
// }
|
||||
|
||||
/*!
|
||||
* \brief Launches the GUI for the adaptation
|
||||
* \param theCommandID - the integer that references the operation
|
||||
* \return bool OK/notOK
|
||||
*/
|
||||
bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID)
|
||||
{
|
||||
// std::cout << "SMESHGUI_AdaptDlg:OnGUIEvent avec theCommandID : " << theCommandID << std::endl;
|
||||
// A. Controles
|
||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||
if ( !app ) return false;
|
||||
|
||||
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
|
||||
if ( !aStudy )
|
||||
{
|
||||
INFOS ( "FAILED to cast active study to SalomeApp_Study" );
|
||||
return false;
|
||||
}
|
||||
|
||||
SUIT_Desktop* parent = SUIT_Session::session()->activeApplication()->desktop();
|
||||
|
||||
SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA(app->namingService());
|
||||
Engines::EngineComponent_var comp = ls->FindOrLoad_Component("FactoryServer", "SMESH");
|
||||
// ADAPT::ADAPT_Gen_var adaptGen = ADAPT::ADAPT_Gen::_narrow(comp);
|
||||
// if (!CORBA::is_nil(adaptGen))
|
||||
// adaptGen->UpdateStudy();
|
||||
|
||||
mySMESHGUI->getApp()->updateObjectBrowser();
|
||||
//
|
||||
// B. Choix selon les commandes
|
||||
bool ok = true ;
|
||||
SCRUTE(theCommandID);
|
||||
switch (theCommandID)
|
||||
{
|
||||
case 8020: // Adaptation avec MG-Adpat
|
||||
{
|
||||
// INFOS("Interface avec MG-Adapt" );
|
||||
|
||||
SMESH::MG_ADAPT_ptr model = SMESHGUI::GetSMESHGen()->CreateMG_ADAPT();
|
||||
bool isCreation = false;
|
||||
if (mySMESHGUI->isStudyLocked()) break;
|
||||
mySMESHGUI->EmitSignalDeactivateDialog();
|
||||
SMESHGUI_MG_ADAPTDRIVER *mgAdapt = new SMESHGUI_MG_ADAPTDRIVER(mySMESHGUI, model, isCreation);
|
||||
mgAdapt->show();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
mySMESHGUI->getApp()->updateObjectBrowser();
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,77 +0,0 @@
|
||||
// Copyright (C) 2011-2020 CEA/DEN, EDF R&D
|
||||
//
|
||||
// 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, or (at your option) any later version.
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
// SMESH SMESHGUI : GUI for the adaptation in the SMESH component
|
||||
// File : SMESHGUI_AdaptDlg.h
|
||||
// Author : Gérald NICOLAS, EDF
|
||||
//
|
||||
#ifndef SMESHGUI_ADAPTDLG_H
|
||||
#define SMESHGUI_ADAPTDLG_H
|
||||
|
||||
// SMESH includes
|
||||
#include "SMESH_SMESHGUI.hxx"
|
||||
|
||||
// Qt includes
|
||||
#include <QDialog>
|
||||
|
||||
// IDL includes
|
||||
#include <SALOMEconfig.h>
|
||||
#include CORBA_SERVER_HEADER(SMESH_Mesh)
|
||||
|
||||
class SMESHGUI;
|
||||
|
||||
//=================================================================================
|
||||
// class : SMESHGUI_AdaptDlg
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
class SMESHGUI_EXPORT SMESHGUI_AdaptDlg : public QWidget
|
||||
{
|
||||
public:
|
||||
SMESHGUI_AdaptDlg( SMESHGUI*,
|
||||
int theCommandID,
|
||||
SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
|
||||
~SMESHGUI_AdaptDlg();
|
||||
|
||||
void action (int theCommandID);
|
||||
virtual bool OnGUIEvent (int theCommandID);
|
||||
|
||||
// static ADAPT::ADAPT_Gen_var InitAdaptGen(SalomeApp_Application*);
|
||||
|
||||
public slots:
|
||||
|
||||
protected slots:
|
||||
|
||||
private slots:
|
||||
|
||||
private:
|
||||
|
||||
// void recupPreferences();
|
||||
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
||||
|
||||
QString _ObjectName;
|
||||
QString _LanguageShort ;
|
||||
int _PublisMeshIN ;
|
||||
int _PublisMeshOUT ;
|
||||
int _YACSMaxIter ;
|
||||
int _YACSMaxNode ;
|
||||
int _YACSMaxElem ;
|
||||
int _YACSTypeTest ;
|
||||
};
|
||||
|
||||
#endif // SMESHGUI_ADAPTDLG_H
|
@ -23,227 +23,72 @@
|
||||
|
||||
#include "SMESHGUI_MG_ADAPTDRIVER.h"
|
||||
|
||||
#include "SUIT_Desktop.h"
|
||||
#include "SUIT_Application.h"
|
||||
#include "SUIT_Session.h"
|
||||
|
||||
#include "SalomeApp_Application.h"
|
||||
#include "SalomeApp_Module.h"
|
||||
#include "SalomeApp_Study.h"
|
||||
|
||||
#include "SMESH_Comment.hxx"
|
||||
#include "SMESH_Actor.h"
|
||||
#include "SMESHGUI.h"
|
||||
#include "SMESHGUI_FilterDlg.h"
|
||||
#include "SMESHGUI_Selection.h"
|
||||
#include <SUIT_MessageBox.h>
|
||||
#include "SMESHGUI_IdValidator.h"
|
||||
#include "SMESHGUI_Utils.h"
|
||||
#include "SMESHGUI_MeshEditPreview.h"
|
||||
#include "SMESHGUI_VTKUtils.h"
|
||||
#include <SMESH_TypeFilter.hxx>
|
||||
#include <SMESH_MeshAlgos.hxx>
|
||||
#include <SMESH_LogicalFilter.hxx>
|
||||
#include <SMDS_Mesh.hxx>
|
||||
#include <SMDS_MeshNode.hxx>
|
||||
#include "SMESHGUI_SpinBox.h"
|
||||
#include "SMESHGUI_MeshUtils.h"
|
||||
#include "SMESH_TryCatch.hxx"
|
||||
|
||||
#include <LightApp_SelectionMgr.h>
|
||||
#include <SUIT_OverrideCursor.h>
|
||||
#include <SUIT_ResourceMgr.h>
|
||||
#include <SUIT_Application.h>
|
||||
#include <SUIT_Desktop.h>
|
||||
#include <SUIT_MessageBox.h>
|
||||
#include <SUIT_Session.h>
|
||||
#include <SVTK_ViewWindow.h>
|
||||
#include <SALOME_ListIO.hxx>
|
||||
#include <SUIT_FileDlg.h>
|
||||
#include "SMESHGUI_MeshUtils.h"
|
||||
#include <SalomeApp_Application.h>
|
||||
|
||||
|
||||
#include <QApplication>
|
||||
#include <QButtonGroup>
|
||||
#include <QGridLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QKeyEvent>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QCheckBox>
|
||||
#include <QPushButton>
|
||||
#include <QRadioButton>
|
||||
#include <QTabWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QSpinBox>
|
||||
#include <QTreeWidget>
|
||||
#include <QTreeWidgetItem>
|
||||
#include <QSpacerItem>
|
||||
#include <QString>
|
||||
#include <QHeaderView>
|
||||
#include <QItemDelegate>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QComboBox>
|
||||
#include <QKeyEvent>
|
||||
|
||||
#include <vtkPoints.h>
|
||||
#include <vtkUnstructuredGrid.h>
|
||||
#include <vtkIdList.h>
|
||||
#include <vtkCellArray.h>
|
||||
#include <vtkUnsignedCharArray.h>
|
||||
#include <vtkDataSetMapper.h>
|
||||
#include <VTKViewer_CellLocationsArray.h>
|
||||
#include <vtkProperty.h>
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
// SALOME KERNEL includes
|
||||
#include <SALOMEDS_SComponent.hxx>
|
||||
#include <SALOMEDS_SObject.hxx>
|
||||
#include <SALOMEDS_Study.hxx>
|
||||
#include <SALOMEDS_wrap.hxx>
|
||||
#include "SalomeApp_Tools.h"
|
||||
#include <SALOMEconfig.h>
|
||||
#include <med.h>
|
||||
#include <utilities.h>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
const int SPACING = 6; // layout spacing
|
||||
const int MARGIN = 9; // layout margin
|
||||
|
||||
SALOME_ListIO mySelected;
|
||||
// bool createMgAdaptObject(MgAdapt *myMgAdapt )
|
||||
// {
|
||||
// // SMESH::SMESH_Mesh_var newMesh = SMESHGUI::GetSMESHGen()->CreateEmptyMesh();
|
||||
|
||||
// // _PTR(SObject) aHypothesis;
|
||||
// _PTR(Study) aStudy = SMESH::getStudy();
|
||||
// QStringList anEntryList;
|
||||
// _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
|
||||
// _PTR(SComponent) mgadapt = aStudy->FindComponent("MG-ADAPT");
|
||||
// _PTR(GenericAttribute) ga;
|
||||
// if (!aBuilder->FindAttribute(mgadapt, ga, "AttributeName") )
|
||||
// {
|
||||
// mgadapt = aBuilder->NewComponent("MG-ADAPT");
|
||||
// _PTR(AttributeName) Name = aBuilder->FindOrCreateAttribute(mgadapt, "AttributeName");
|
||||
// Name->SetValue("MG-ADAPT");
|
||||
// _PTR(AttributePixMap) myPixmap = aBuilder->FindOrCreateAttribute( mgadapt, "AttributePixMap" );
|
||||
// myPixmap->SetPixMap( "ICON_MG_ADAPT" );
|
||||
// anEntryList.append( mgadapt->GetID().c_str() );
|
||||
// }
|
||||
|
||||
//================================================================
|
||||
// Function : firstIObject
|
||||
// Purpose : Return the first selected object in the selected object list
|
||||
//================================================================
|
||||
Handle(SALOME_InteractiveObject) firstIObject()
|
||||
{
|
||||
const SALOME_ListIO& aList = selectedIO();
|
||||
return aList.Extent() > 0 ? aList.First() : Handle(SALOME_InteractiveObject)();
|
||||
}
|
||||
//================================================================
|
||||
// Function : selectedIO
|
||||
// Return the list of selected SALOME_InteractiveObject's
|
||||
//================================================================
|
||||
const SALOME_ListIO& selectedIO()
|
||||
{
|
||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* > ( SUIT_Session::session()->activeApplication() );
|
||||
LightApp_SelectionMgr* aSelectionMgr = app->selectionMgr();
|
||||
if( aSelectionMgr )
|
||||
{
|
||||
aSelectionMgr->selectedObjects( mySelected );
|
||||
for (SALOME_ListIteratorOfListIO it (mySelected); it.More(); it.Next())
|
||||
SCRUTE(it.Value()->getEntry());
|
||||
};
|
||||
return mySelected;
|
||||
}
|
||||
//================================================================
|
||||
// Function : getStudy
|
||||
// Returne un pointeur sur l'etude active
|
||||
//================================================================
|
||||
_PTR(Study) getStudy()
|
||||
{
|
||||
static _PTR(Study) _study;
|
||||
if(!_study)
|
||||
_study = SalomeApp_Application::getStudy();
|
||||
return _study;
|
||||
}
|
||||
// _PTR(SObject) obj = aBuilder->NewObject(mgadapt);
|
||||
// _PTR(AttributeName) myName = aBuilder->FindOrCreateAttribute(obj, "AttributeName");
|
||||
// myName->SetValue("hypo");
|
||||
// _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( obj, "AttributePixMap" );
|
||||
// aPixmap->SetPixMap( "ICON_SMESH_TREE_HYPO" );
|
||||
// anEntryList.append( obj->GetID().c_str() );
|
||||
|
||||
bool createAndPublishMed(QString fileName)
|
||||
{
|
||||
|
||||
SMESH::DriverMED_ReadStatus res;
|
||||
SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
|
||||
// SMESHGUI aGui;
|
||||
|
||||
aMeshes = SMESHGUI::GetSMESHGen()->CreateMeshesFromMED( fileName.toUtf8().constData(), res );
|
||||
_PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[0] );
|
||||
_PTR(Study) aStudy = SMESH::getStudy();
|
||||
QStringList anEntryList;
|
||||
// bool isEmpty;
|
||||
if ( aMeshSO )
|
||||
{
|
||||
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
|
||||
_PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" );
|
||||
aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" );
|
||||
anEntryList.append( aMeshSO->GetID().c_str() );
|
||||
}
|
||||
else
|
||||
{
|
||||
// isEmpty = true;
|
||||
return false;
|
||||
}
|
||||
SMESHGUI::GetSMESHGUI()->updateObjBrowser();
|
||||
|
||||
// browse to the published meshes
|
||||
if( LightApp_Application* anApp =
|
||||
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||
anApp->browseObjects( anEntryList );
|
||||
return true;
|
||||
}
|
||||
bool createMgAdaptObject(MgAdapt *myMgAdapt )
|
||||
{
|
||||
// SMESH::SMESH_Mesh_var newMesh = SMESHGUI::GetSMESHGen()->CreateEmptyMesh();
|
||||
|
||||
// _PTR(SObject) aHypothesis;
|
||||
_PTR(Study) aStudy = SMESH::getStudy();
|
||||
QStringList anEntryList;
|
||||
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
|
||||
_PTR(SComponent) mgadapt = aStudy->FindComponent("MG-ADAPT");
|
||||
_PTR(GenericAttribute) ga;
|
||||
if (!aBuilder->FindAttribute(mgadapt, ga, "AttributeName") )
|
||||
{
|
||||
mgadapt = aBuilder->NewComponent("MG-ADAPT");
|
||||
_PTR(AttributeName) Name = aBuilder->FindOrCreateAttribute(mgadapt, "AttributeName");
|
||||
Name->SetValue("MG-ADAPT");
|
||||
_PTR(AttributePixMap) myPixmap = aBuilder->FindOrCreateAttribute( mgadapt, "AttributePixMap" );
|
||||
myPixmap->SetPixMap( "ICON_MG_ADAPT" );
|
||||
anEntryList.append( mgadapt->GetID().c_str() );
|
||||
}
|
||||
|
||||
_PTR(SObject) obj = aBuilder->NewObject(mgadapt);
|
||||
_PTR(AttributeName) myName = aBuilder->FindOrCreateAttribute(obj, "AttributeName");
|
||||
myName->SetValue("hypo");
|
||||
_PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( obj, "AttributePixMap" );
|
||||
aPixmap->SetPixMap( "ICON_SMESH_TREE_HYPO" );
|
||||
anEntryList.append( obj->GetID().c_str() );
|
||||
|
||||
SMESHGUI::GetSMESHGUI()->updateObjBrowser();
|
||||
|
||||
// // browse to the published meshes
|
||||
if( LightApp_Application* anApp =
|
||||
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||
anApp->browseObjects( anEntryList );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// MG ADAPT UTILS
|
||||
//================================================================
|
||||
// Function : IObjectCount
|
||||
// Return the number of selected objects
|
||||
//================================================================
|
||||
int IObjectCount()
|
||||
{
|
||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||
LightApp_SelectionMgr* aSelectionMgr = app->selectionMgr();
|
||||
if( aSelectionMgr )
|
||||
{
|
||||
aSelectionMgr->selectedObjects( mySelected );
|
||||
SCRUTE(mySelected.Extent());
|
||||
return mySelected.Extent();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
// SMESHGUI::GetSMESHGUI()->updateObjBrowser();
|
||||
|
||||
// // // browse to the published meshes
|
||||
// if( LightApp_Application* anApp =
|
||||
// dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||
// anApp->browseObjects( anEntryList );
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
SMESHGUI_MG_ADAPTDRIVER::SMESHGUI_MG_ADAPTDRIVER( SMESHGUI* theModule, SMESH::MG_ADAPT_ptr myModel, bool isCreation )
|
||||
: mySMESHGUI( theModule ),
|
||||
myFilterDlg(0),
|
||||
myIsApplyAndClose( false ),
|
||||
SMESHGUI_MgAdaptDlg((SalomeApp_Module*)theModule, myModel, SMESHGUI::desktop(), isCreation)
|
||||
: SMESHGUI_MgAdaptDlg((SalomeApp_Module*)theModule, myModel, SMESHGUI::desktop(), isCreation),
|
||||
mySMESHGUI( theModule ),
|
||||
myIsApplyAndClose( false )
|
||||
{
|
||||
|
||||
resMgr = resourceMgr();
|
||||
//resMgr = mySMESHGUI->resourceMgr();
|
||||
|
||||
selMgr = selectionMgr();
|
||||
|
||||
@ -252,10 +97,10 @@ SMESHGUI_MG_ADAPTDRIVER::SMESHGUI_MG_ADAPTDRIVER( SMESHGUI* theModule, SMESH::MG
|
||||
connect(myArgs, SIGNAL(toExportMED(const char*)), this, SLOT(exportMED(const char*)));
|
||||
}
|
||||
|
||||
SUIT_ResourceMgr* SMESHGUI_MG_ADAPTDRIVER::resourceMgr()
|
||||
{
|
||||
return dynamic_cast<SUIT_ResourceMgr*>( SUIT_Session::session()->resourceMgr() );
|
||||
}
|
||||
// SUIT_ResourceMgr* SMESHGUI_MG_ADAPTDRIVER::resourceMgr()
|
||||
// {
|
||||
// return dynamic_cast<SUIT_ResourceMgr*>( SUIT_Session::session()->resourceMgr() );
|
||||
// }
|
||||
|
||||
LightApp_SelectionMgr* SMESHGUI_MG_ADAPTDRIVER::selectionMgr()
|
||||
{
|
||||
@ -271,7 +116,7 @@ void SMESHGUI_MG_ADAPTDRIVER::updateSelection()
|
||||
disconnect( selMgr, 0, this, 0 );
|
||||
selMgr->clearFilters();
|
||||
|
||||
SMESH::SetPointRepresentation( true );
|
||||
SMESH::SetPointRepresentation( false );
|
||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() )
|
||||
aViewWindow->SetSelectionMode( ActorSelection );
|
||||
if (myArgs->aBrowser->isChecked())
|
||||
@ -297,8 +142,8 @@ void SMESHGUI_MG_ADAPTDRIVER::selectionChanged()
|
||||
{
|
||||
myMesh = mesh;
|
||||
|
||||
mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
|
||||
if ( mySelectedObject->_is_nil() )
|
||||
SMESH::SMESH_IDSource_var sSelectedObj = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
|
||||
if ( sSelectedObj->_is_nil() )
|
||||
return;
|
||||
}
|
||||
else
|
||||
@ -309,7 +154,7 @@ void SMESHGUI_MG_ADAPTDRIVER::selectionChanged()
|
||||
else aString = aString.trimmed();
|
||||
|
||||
|
||||
bool ok = !aString.isEmpty();
|
||||
//bool ok = !aString.isEmpty();
|
||||
if ( !mesh->_is_nil() )
|
||||
{
|
||||
myArgs->aBrowserObject->setText( aString );
|
||||
@ -351,10 +196,9 @@ void SMESHGUI_MG_ADAPTDRIVER::PushOnOK()
|
||||
// std::cout << "SMESHGUI_MG_ADAPTDRIVER::PushOnOK ret : " <<ret<<std::endl;
|
||||
if ( ret ) reject();
|
||||
}
|
||||
|
||||
bool SMESHGUI_MG_ADAPTDRIVER::PushOnApply()
|
||||
{
|
||||
MESSAGE("PushOnApply");
|
||||
|
||||
if ( SMESHGUI::isStudyLocked() )
|
||||
return false;
|
||||
if( !isValid() )
|
||||
@ -383,72 +227,37 @@ bool SMESHGUI_MG_ADAPTDRIVER::PushOnApply()
|
||||
return ok;
|
||||
}
|
||||
|
||||
// macro used to initialize errStr by exception description
|
||||
// returned by SMESH_CATCH( SMESH::returnError )
|
||||
#undef SMESH_CAUGHT
|
||||
#define SMESH_CAUGHT errStr =
|
||||
|
||||
#undef SMY_OWN_CATCH
|
||||
#define SMY_OWN_CATCH catch ( SALOME::SALOME_Exception & e ) { errStr = e.details.text; }
|
||||
|
||||
bool SMESHGUI_MG_ADAPTDRIVER::execute()
|
||||
{
|
||||
int err = 1;
|
||||
char* errStr;
|
||||
try
|
||||
std::string errStr;
|
||||
SMESH_TRY;
|
||||
{
|
||||
getModel()->compute();
|
||||
err = 0;
|
||||
errStr = getModel()->getErrMsg();
|
||||
std::string msg = err == 0 ? " ok" : std::string("Not ok \n")+CORBA::string_dup(errStr) ;
|
||||
errStr = SMESH::toStdStr( getModel()->getErrMsg() );
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
SMESH_CATCH( SMESH::returnError );
|
||||
|
||||
std::string msg = " ok";
|
||||
if ( !errStr.empty() || err != 0 )
|
||||
{
|
||||
std::cerr<<e.what();
|
||||
msg = "Not ok \n" + errStr + "\n";
|
||||
std::cerr << msg;
|
||||
err = 1;
|
||||
}
|
||||
return err == 0;
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void SMESHGUI_MG_ADAPTDRIVER::Init (bool ResetControls)
|
||||
{
|
||||
myBusy = false;
|
||||
|
||||
if ( ResetControls )
|
||||
{
|
||||
myLineEditElements->clear();
|
||||
myNbOkElements = 0;
|
||||
|
||||
buttonOk->setEnabled(false);
|
||||
buttonApply->setEnabled(false);
|
||||
|
||||
//~myActor = 0;
|
||||
myMesh = SMESH::SMESH_Mesh::_nil();
|
||||
|
||||
myIdSourceCheck->setChecked(true);
|
||||
|
||||
onConstructor( 0 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : onConstructor
|
||||
//purpose : switch operation mode
|
||||
//=======================================================================
|
||||
|
||||
void SMESHGUI_MG_ADAPTDRIVER::onConstructor( int withGeom )
|
||||
{
|
||||
|
||||
myGeomLabel ->setVisible( withGeom );
|
||||
myGeomNameEdit ->setVisible( withGeom );
|
||||
myReuseHypCheck ->setVisible( withGeom );
|
||||
myCopyElementsCheck->setVisible( withGeom );
|
||||
myFilterBtn ->setVisible( !withGeom );
|
||||
myIdSourceCheck ->setVisible( !withGeom );
|
||||
|
||||
if ( !withGeom )
|
||||
myMeshNameEdit->setText( SMESH::UniqueMeshName("Mesh"));
|
||||
|
||||
}
|
||||
|
||||
//~void SMESHGUI_MG_ADAPTDRIVER::onSelectIdSource( bool )
|
||||
//~{}
|
||||
#undef SMESH_CAUGHT
|
||||
#define SMESH_CAUGHT
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
@ -499,82 +308,6 @@ void SMESHGUI_MG_ADAPTDRIVER::PushOnHelp()
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : getErrorMsg
|
||||
//purpose : Return an error message and entries of invalid smesh object
|
||||
//=======================================================================
|
||||
|
||||
QString SMESHGUI_MG_ADAPTDRIVER::getErrorMsg( SMESH::string_array_var theInvalidEntries,
|
||||
QStringList & theEntriesToBrowse )
|
||||
{
|
||||
|
||||
if ( theInvalidEntries->length() == 0 )
|
||||
return tr("OPERATION_FAILED");
|
||||
|
||||
// theInvalidEntries - SObject's that hold geometry objects whose
|
||||
// counterparts are not found in the newGeometry, followed by SObject's
|
||||
// holding mesh sub-objects that are invalid because they depend on a not found
|
||||
// preceding sub-shape
|
||||
|
||||
QString msg = tr("SUBSHAPES_NOT_FOUND_MSG") + "\n";
|
||||
|
||||
QString objString;
|
||||
for ( CORBA::ULong i = 0; i < theInvalidEntries->length(); ++i )
|
||||
{
|
||||
_PTR(SObject) so = SMESH::getStudy()->FindObjectID( theInvalidEntries[i].in() );
|
||||
|
||||
int objType = SMESHGUI_Selection::type( theInvalidEntries[i].in() );
|
||||
if ( objType < 0 ) // geom object
|
||||
{
|
||||
objString += "\n";
|
||||
if ( so )
|
||||
objString += so->GetName().c_str();
|
||||
else
|
||||
objString += theInvalidEntries[i].in(); // it's something like "FACE #2"
|
||||
}
|
||||
else // smesh object
|
||||
{
|
||||
theEntriesToBrowse.push_back( theInvalidEntries[i].in() );
|
||||
|
||||
objString += "\n ";
|
||||
switch ( objType ) {
|
||||
case SMESH::MESH:
|
||||
objString += tr("SMESH_MESH");
|
||||
break;
|
||||
case SMESH::HYPOTHESIS:
|
||||
objString += tr("SMESH_HYPOTHESIS");
|
||||
break;
|
||||
case SMESH::ALGORITHM:
|
||||
objString += tr("SMESH_ALGORITHM");
|
||||
break;
|
||||
case SMESH::SUBMESH_VERTEX:
|
||||
case SMESH::SUBMESH_EDGE:
|
||||
case SMESH::SUBMESH_FACE:
|
||||
case SMESH::SUBMESH_SOLID:
|
||||
case SMESH::SUBMESH_COMPOUND:
|
||||
case SMESH::SUBMESH:
|
||||
objString += tr("SMESH_SUBMESH");
|
||||
break;
|
||||
case SMESH::GROUP:
|
||||
objString += tr("SMESH_GROUP");
|
||||
break;
|
||||
default:
|
||||
;
|
||||
}
|
||||
objString += " \"";
|
||||
if ( so )
|
||||
objString += so->GetName().c_str();
|
||||
objString += "\" (";
|
||||
objString += theInvalidEntries[i].in();
|
||||
objString += ")";
|
||||
}
|
||||
}
|
||||
if ( !objString.isEmpty() )
|
||||
msg += objString;
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : isValid
|
||||
// purpose :
|
||||
@ -588,15 +321,16 @@ bool SMESHGUI_MG_ADAPTDRIVER::isValid()
|
||||
|
||||
bool SMESHGUI_MG_ADAPTDRIVER::createMeshInObjectBrowser()
|
||||
{
|
||||
QString filename(getModel()->getMedFileOut());
|
||||
QString filename( SMESH::toQStr( getModel()->getMedFileOut() ));
|
||||
QStringList errors;
|
||||
QStringList anEntryList;
|
||||
bool isEmpty = false;
|
||||
bool ok = false;
|
||||
// bool ok = false;
|
||||
SMESH::SMESH_Gen_var SMESH_Gen_ptr = SMESHGUI::GetSMESHGen();
|
||||
if (!SMESH_Gen_ptr) {
|
||||
std::cerr << "Could not retrieve SMESH_Gen_ptr" << std::endl;
|
||||
throw SALOME_Exception(LOCALIZED("Could not retrieve SMESH::GetSMESHGen()"));
|
||||
if ( SMESH_Gen_ptr->_is_nil() ) {
|
||||
QMessageBox::critical( 0, QObject::tr("MG_ADAPT_ERROR"),
|
||||
QObject::tr("Could not retrieve SMESH_Gen_ptr") );
|
||||
return false;
|
||||
}
|
||||
SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
|
||||
aMeshes->length( 1 ); // one mesh only
|
||||
@ -652,7 +386,8 @@ bool SMESHGUI_MG_ADAPTDRIVER::createMeshInObjectBrowser()
|
||||
void SMESHGUI_MG_ADAPTDRIVER::setIsApplyAndClose( const bool theFlag )
|
||||
{
|
||||
myIsApplyAndClose = theFlag;
|
||||
}//================================================================
|
||||
}
|
||||
//================================================================
|
||||
// function : isApplyAndClose
|
||||
// Purpose : Get value of the flag indicating that the dialog is
|
||||
// accepted by Apply & Close button
|
||||
@ -668,16 +403,12 @@ bool SMESHGUI_MG_ADAPTDRIVER::isApplyAndClose() const
|
||||
//=================================================================================
|
||||
void SMESHGUI_MG_ADAPTDRIVER::deactivateActiveDialog()
|
||||
{
|
||||
if (ConstructorsBox->isEnabled())
|
||||
{
|
||||
ConstructorsBox->setEnabled(false);
|
||||
GroupArguments->setEnabled(false);
|
||||
GroupButtons->setEnabled(false);
|
||||
mySMESHGUI->ResetState();
|
||||
mySMESHGUI->SetActiveDialogBox(0);
|
||||
if ( selMgr )
|
||||
selMgr->removeFilter( myIdSourceFilter );
|
||||
}
|
||||
// if (isEnabled())
|
||||
// {
|
||||
// mySMESHGUI->ResetState();
|
||||
// mySMESHGUI->SetActiveDialogBox(0);
|
||||
// setEnabled( false );
|
||||
// }
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
@ -699,60 +430,3 @@ void SMESHGUI_MG_ADAPTDRIVER::activateThisDialog()
|
||||
|
||||
// SelectionIntoArgument();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : setFilters()
|
||||
// purpose : SLOT. Called when "Filter" button pressed.
|
||||
//=================================================================================
|
||||
void SMESHGUI_MG_ADAPTDRIVER::setFilters()
|
||||
{
|
||||
if(myMesh->_is_nil())
|
||||
{
|
||||
SUIT_MessageBox::critical(this,
|
||||
tr("SMESH_ERROR"),
|
||||
tr("NO_MESH_SELECTED"));
|
||||
return;
|
||||
}
|
||||
if ( !myFilterDlg )
|
||||
myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );
|
||||
|
||||
QList<int> types;
|
||||
if ( myMesh->NbEdges() ) types << SMESH::EDGE;
|
||||
if ( myMesh->NbFaces() ) types << SMESH::FACE;
|
||||
if ( myMesh->NbVolumes() ) types << SMESH::VOLUME;
|
||||
if ( myMesh->NbBalls() ) types << SMESH::BALL;
|
||||
if ( myMesh->Nb0DElements()) types << SMESH::ELEM0D;
|
||||
if ( types.count() > 1 ) types << SMESH::ALL;
|
||||
|
||||
myFilterDlg->Init( types );
|
||||
myFilterDlg->SetSelection();
|
||||
myFilterDlg->SetMesh( myMesh );
|
||||
myFilterDlg->SetSourceWg( myLineEditElements );
|
||||
|
||||
myFilterDlg->show();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : onOpenView()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void SMESHGUI_MG_ADAPTDRIVER::onOpenView()
|
||||
{
|
||||
if ( mySelector ) {
|
||||
SMESH::SetPointRepresentation(false);
|
||||
}
|
||||
else {
|
||||
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
|
||||
activateThisDialog();
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : onCloseView()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void SMESHGUI_MG_ADAPTDRIVER::onCloseView()
|
||||
{
|
||||
deactivateActiveDialog();
|
||||
mySelector = 0;
|
||||
}
|
||||
|
@ -23,89 +23,31 @@
|
||||
#ifndef SMESHGUI_MG_ADAPTDRIVER_H
|
||||
#define SMESHGUI_MG_ADAPTDRIVER_H
|
||||
|
||||
#include <set>
|
||||
// SMESH includes
|
||||
#include "SMESH_SMESHGUI.hxx"
|
||||
|
||||
// Qt includes
|
||||
#include <QDialog>
|
||||
#include <QTreeWidget>
|
||||
#include<QItemDelegate>
|
||||
|
||||
#include <QThread>
|
||||
|
||||
#include "LightApp_DataOwner.h"
|
||||
#include "SalomeApp_Application.h"
|
||||
#include <SALOMEconfig.h>
|
||||
#include <SALOME_ListIO.hxx>
|
||||
#include "SalomeApp_Module.h"
|
||||
#include "SalomeApp_Study.h"
|
||||
#include <med.h>
|
||||
#include <QObject>
|
||||
// model
|
||||
#include "MG_ADAPTGUI.hxx"
|
||||
|
||||
#include CORBA_SERVER_HEADER(MG_ADAPT)
|
||||
|
||||
class SUIT_ViewWindow;
|
||||
class SUIT_Desktop;
|
||||
class SUIT_Study;
|
||||
class SUIT_ResourceMgr;
|
||||
|
||||
class CAM_Module;
|
||||
|
||||
class SALOMEDSClient_Study;
|
||||
class SALOMEDSClient_SObject;
|
||||
|
||||
class SalomeApp_Study;
|
||||
class SalomeApp_Module;
|
||||
class LightApp_SelectionMgr;
|
||||
class SUIT_SelectionFilter;
|
||||
|
||||
|
||||
class QButtonGroup;
|
||||
class QLineEdit;
|
||||
class QGroupBox;
|
||||
class QRadioButton;
|
||||
class QLabel;
|
||||
class QCheckBox;
|
||||
class QGridLayout;
|
||||
class QTabWidget;
|
||||
class QDoubleSpinBox;
|
||||
class QSpinBox;
|
||||
class QTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
class QSpacerItem;
|
||||
class QHBoxLayout;
|
||||
class QItemDelegate;
|
||||
class QComboBox;
|
||||
class QObject;
|
||||
|
||||
#include "MG_ADAPTGUI.h"
|
||||
|
||||
// IDL includes
|
||||
#include <SALOMEconfig.h>
|
||||
#include CORBA_SERVER_HEADER(SMESH_Mesh)
|
||||
#include CORBA_SERVER_HEADER(SMESH_Gen)
|
||||
#include CORBA_SERVER_HEADER(MG_ADAPT)
|
||||
|
||||
class SMESHGUI;
|
||||
class SMESHGUI_MgAdaptDlg;
|
||||
class SMESHGUI_IdValidator;
|
||||
class SMESHGUI_FilterDlg;
|
||||
class MgAdapt;
|
||||
class QHeaderView;
|
||||
class QFileDialog;
|
||||
class LightApp_SelectionMgr;
|
||||
//class MgAdapt;
|
||||
|
||||
|
||||
int IObjectCount();
|
||||
const SALOME_ListIO& selectedIO();
|
||||
_PTR(Study) getStudy();
|
||||
Handle(SALOME_InteractiveObject) firstIObject();
|
||||
bool createAndPublishMed(QString fileName);
|
||||
bool createMgAdaptObject(MgAdapt* myMgAdapt = 0);
|
||||
// int IObjectCount();
|
||||
// const SALOME_ListIO& selectedIO();
|
||||
// _PTR(Study) getStudy();
|
||||
// Handle(SALOME_InteractiveObject) firstIObject();
|
||||
// bool createAndPublishMed(QString fileName);
|
||||
// bool createMgAdaptObject(MgAdapt* myMgAdapt = 0);
|
||||
|
||||
|
||||
class SMESHGUI_MG_ADAPTDRIVER : public SMESHGUI_MgAdaptDlg
|
||||
{
|
||||
Q_OBJECT;
|
||||
Q_OBJECT
|
||||
|
||||
public :
|
||||
SMESHGUI_MG_ADAPTDRIVER( SMESHGUI*, SMESH::MG_ADAPT_ptr, bool isCreation = true );
|
||||
@ -116,68 +58,20 @@ private :
|
||||
|
||||
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
||||
LightApp_SelectionMgr* selMgr ;
|
||||
SUIT_ResourceMgr* resMgr;
|
||||
SUIT_ResourceMgr* resourceMgr();
|
||||
LightApp_SelectionMgr* selectionMgr();
|
||||
SMESH::SMESH_Mesh_var myMesh ;
|
||||
bool myIsApplyAndClose;
|
||||
|
||||
|
||||
|
||||
void Init( bool = true );
|
||||
void enterEvent( QEvent* ); /* mouse enter the QWidget */
|
||||
void keyPressEvent( QKeyEvent* );
|
||||
QString getErrorMsg( SMESH::string_array_var invalidEntries,
|
||||
QStringList & entriesToBrowse );
|
||||
|
||||
bool isValid();
|
||||
bool createMeshInObjectBrowser();
|
||||
void setIsApplyAndClose( const bool theFlag );
|
||||
bool isApplyAndClose() const;
|
||||
bool execute();
|
||||
SMESHGUI_IdValidator* myIdValidator;
|
||||
int myNbOkElements; /* to check when elements are defined */
|
||||
|
||||
SVTK_Selector* mySelector;
|
||||
|
||||
bool myBusy;
|
||||
GEOM::GEOM_Object_var myNewGeometry;
|
||||
//~SMESH_Actor* myActor; //
|
||||
SUIT_SelectionFilter* myIdSourceFilter;
|
||||
|
||||
SMESH::SMESH_IDSource_var mySelectedObject;
|
||||
|
||||
QTabWidget* myTabWidget;
|
||||
QButtonGroup* GroupConstructors;
|
||||
|
||||
QGroupBox* ConstructorsBox;
|
||||
QGroupBox* GroupArguments;
|
||||
QGroupBox* GroupButtons;
|
||||
|
||||
QPushButton* buttonOk;
|
||||
QPushButton* buttonCancel;
|
||||
QPushButton* buttonApply;
|
||||
QPushButton* buttonHelp;
|
||||
|
||||
QLabel* myTextLabelElements;
|
||||
QLabel* myGeomLabel;
|
||||
QLineEdit* myLineEditElements;
|
||||
QLineEdit* myMeshNameEdit;
|
||||
QLineEdit* myGeomNameEdit;
|
||||
QCheckBox* myIdSourceCheck;
|
||||
QCheckBox* myCopyGroupsCheck;
|
||||
QCheckBox* myReuseHypCheck;
|
||||
QCheckBox* myCopyElementsCheck;
|
||||
QCheckBox* myKeepIdsCheck;
|
||||
|
||||
QPushButton* myFilterBtn;
|
||||
SMESHGUI_FilterDlg* myFilterDlg;
|
||||
|
||||
QString myHelpFileName;
|
||||
|
||||
bool myIsApplyAndClose;
|
||||
|
||||
QString inputMeshName;
|
||||
QString outputMeshName;
|
||||
private slots:
|
||||
void selectionChanged();
|
||||
void updateSelection();
|
||||
@ -194,17 +88,6 @@ private slots:
|
||||
|
||||
void deactivateActiveDialog();
|
||||
void activateThisDialog();
|
||||
void onConstructor( int );
|
||||
//~void onTextChange( const QString& );
|
||||
//~void onSelectIdSource( bool );
|
||||
void setFilters();
|
||||
void onOpenView();
|
||||
void onCloseView();
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // SMESHGUI_MG_ADAPTDRIVER_H
|
||||
|
@ -40,7 +40,6 @@ INCLUDE_DIRECTORIES(
|
||||
${PROJECT_SOURCE_DIR}/src/SMESHUtils
|
||||
${PROJECT_BINARY_DIR}
|
||||
${PROJECT_BINARY_DIR}/idl
|
||||
${MEDCOUPLING_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# additional preprocessor / compiler flags
|
||||
@ -85,7 +84,6 @@ SET(_link_LIBRARIES
|
||||
SMESHDS
|
||||
SMESHControls
|
||||
MeshDriverMED
|
||||
${MEDCoupling_medloader}
|
||||
)
|
||||
|
||||
# --- headers ---
|
||||
|
@ -19,23 +19,14 @@
|
||||
|
||||
#include "MG_ADAPT_i.hxx"
|
||||
|
||||
#include "string.h"
|
||||
#include "MG_ADAPT.hxx"
|
||||
#include "SMESH_File.hxx"
|
||||
#include "SMESH_Gen_i.hxx"
|
||||
#include <SMESH_Gen.hxx>
|
||||
#include <SALOMEconfig.h>
|
||||
#include CORBA_CLIENT_HEADER(SALOMEDS)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* SMESH_Gen_i::CreateMG_ADAPT
|
||||
*
|
||||
* Create measurement instance
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
#include "SMESH_PythonDump.hxx"
|
||||
#include "SMESH_TryCatch.hxx"
|
||||
|
||||
using namespace SMESH;
|
||||
|
||||
void MG_ADAPT_i::copyHypothesisDataToImpl(const SMESH::MgAdaptHypothesisData& from, ::MG_ADAPT::MgAdaptHypothesisData* to) const
|
||||
{
|
||||
to->myFileInDir = from.myFileInDir;
|
||||
@ -94,6 +85,15 @@ void MG_ADAPT_i::copyHypothesisDataFromImpl(const ::MG_ADAPT::MgAdaptHypothesisD
|
||||
to->myRemoveLogOnSuccess = from->myRemoveLogOnSuccess;
|
||||
to->myVerboseLevel = from->myVerboseLevel;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* SMESH_Gen_i::CreateMG_ADAPT
|
||||
*
|
||||
* Create measurement instance
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
SMESH::MG_ADAPT_ptr SMESH_Gen_i::CreateMG_ADAPT()
|
||||
{
|
||||
SMESH::MG_ADAPT_i* aMGadapt = new SMESH::MG_ADAPT_i();
|
||||
@ -115,16 +115,8 @@ SMESH::MG_ADAPT_OBJECT_ptr SMESH_Gen_i::Adaptation( const char* adaptationType)
|
||||
SMESH::MG_ADAPT_OBJECT_var anObj = mg_adapt_object->_this();
|
||||
return anObj._retn();
|
||||
}
|
||||
|
||||
return SMESH::MG_ADAPT_OBJECT_ptr();
|
||||
}
|
||||
//~SMESH::MG_ADAPT_ptr MG_ADAPT_i::CreateMG_ADAPT()
|
||||
//~{
|
||||
|
||||
//~SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen();
|
||||
//~SMESH::MG_ADAPT_i* aMGadapt = new SMESH::MG_ADAPT_i(smeshGen_i->GetPOA());
|
||||
//~SMESH::MG_ADAPT_var anObj = aMGadapt->_this();
|
||||
//~return anObj._retn();
|
||||
//~}
|
||||
//=============================================================================
|
||||
/*!
|
||||
* standard constructor
|
||||
@ -134,24 +126,6 @@ MG_ADAPT_i::MG_ADAPT_i(): SALOME::GenericObj_i( SMESH_Gen_i::GetPOA() )
|
||||
{
|
||||
myMgAdapt = new ::MG_ADAPT::MgAdapt();
|
||||
}
|
||||
//~MG_ADAPT_i::MG_ADAPT_i(PortableServer::POA_var myPoa): SALOME::GenericObj_i( myPoa )
|
||||
//~{
|
||||
//~myMgAdapt = new ::MG_ADAPT::MgAdapt();
|
||||
//~}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* standard constructor
|
||||
*/
|
||||
//=============================================================================
|
||||
//~MG_ADAPT_i::MG_ADAPT_i( CORBA::ORB_ptr orb,
|
||||
//~ADAPT::ADAPT_Gen_var engine )
|
||||
//~{
|
||||
|
||||
//~_gen_i = engine;
|
||||
//~_orb = orb;
|
||||
//~myMgAdapt = new MgAdapt();
|
||||
//~}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
@ -160,6 +134,7 @@ MG_ADAPT_i::MG_ADAPT_i(): SALOME::GenericObj_i( SMESH_Gen_i::GetPOA() )
|
||||
//=============================================================================
|
||||
MG_ADAPT_i::~MG_ADAPT_i()
|
||||
{
|
||||
delete myMgAdapt;
|
||||
}
|
||||
void MG_ADAPT_i::setData( SMESH::MgAdaptHypothesisData& data)
|
||||
{
|
||||
@ -272,7 +247,7 @@ void MG_ADAPT_i::setRemoveOnSuccess(bool mybool)
|
||||
}
|
||||
bool MG_ADAPT_i::getRemoveOnSuccess()
|
||||
{
|
||||
myMgAdapt->getRemoveOnSuccess();
|
||||
return myMgAdapt->getRemoveOnSuccess();
|
||||
}
|
||||
SMESH::MgAdaptHypothesisData* MG_ADAPT_i::getData()
|
||||
{
|
||||
@ -372,19 +347,38 @@ char* MG_ADAPT_i::getCommandToRun()
|
||||
return CORBA::string_dup(myMgAdapt->getCommandToRun().c_str());
|
||||
}
|
||||
|
||||
// macro used to initialize excStr by exception description
|
||||
// returned by SMESH_CATCH( SMESH::returnError )
|
||||
#undef SMESH_CAUGHT
|
||||
#define SMESH_CAUGHT excStr =
|
||||
|
||||
void MG_ADAPT_i::compute()
|
||||
{
|
||||
SMESH::TPythonDump noDumpSoFar;
|
||||
|
||||
errStr = "";
|
||||
try
|
||||
{
|
||||
std::string excStr;
|
||||
SMESH_TRY;
|
||||
|
||||
myMgAdapt->compute(errStr);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
|
||||
SMESH_CATCH( SMESH::returnError );
|
||||
|
||||
SMESH_Comment errMsg;
|
||||
if ( !excStr.empty() )
|
||||
{
|
||||
std::ostringstream oss; oss << "Exception thrown on MG_ADAPT_i::compute invocation with error message \"" << errStr
|
||||
<< "\" with exception message \"" << e.what() << "\"";
|
||||
THROW_SALOME_CORBA_EXCEPTION(oss.str().c_str(),SALOME::INTERNAL_ERROR);
|
||||
errMsg << "Exception thrown on MG_ADAPT_i::compute invocation with error message \""
|
||||
<< errStr << "\" with exception \"" << excStr << "\"";
|
||||
}
|
||||
else if ( !errStr.empty() )
|
||||
{
|
||||
errMsg << "MG_ADAPT_i::compute invocation returned error message \"" << errStr << "\"";
|
||||
}
|
||||
if ( !errMsg.empty() )
|
||||
{
|
||||
THROW_SALOME_CORBA_EXCEPTION( errMsg.c_str(), SALOME::INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
if(myMgAdapt->getPublish())
|
||||
{
|
||||
SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen();
|
||||
@ -392,6 +386,9 @@ void MG_ADAPT_i::compute()
|
||||
smeshGen_i->CreateMeshesFromMED(myMgAdapt->getMedFileOut().c_str(), theStatus);
|
||||
}
|
||||
}
|
||||
#undef SMESH_CAUGHT
|
||||
#define SMESH_CAUGHT
|
||||
|
||||
char* MG_ADAPT_i::getErrMsg()
|
||||
{
|
||||
return CORBA::string_dup(errStr.c_str());
|
||||
@ -422,31 +419,36 @@ bool MG_ADAPT_i::hasOptionDefined( const char* optionName )
|
||||
return myMgAdapt->hasOptionDefined(optionName);
|
||||
}
|
||||
void MG_ADAPT_i::setOptionValue(const char* optionName,
|
||||
const char* optionValue) throw (std::invalid_argument)
|
||||
const char* optionValue)
|
||||
{
|
||||
SMESH_TRY;
|
||||
myMgAdapt->setOptionValue(optionName, optionValue);
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
}
|
||||
|
||||
char* MG_ADAPT_i::getOptionValue(const char* optionName,
|
||||
bool& isDefault) throw (std::invalid_argument)
|
||||
bool& isDefault)
|
||||
{
|
||||
SMESH_TRY;
|
||||
return CORBA::string_dup(myMgAdapt->getOptionValue(optionName, &isDefault).c_str());
|
||||
SMESH_CATCH( SMESH::throwCorbaException );
|
||||
return 0;
|
||||
}
|
||||
str_array* MG_ADAPT_i::getCustomOptionValuesStrVec()
|
||||
SMESH::string_array* MG_ADAPT_i::getCustomOptionValuesStrVec()
|
||||
{
|
||||
SMESH::str_array_var result = new SMESH::str_array();
|
||||
SMESH::string_array_var result = new SMESH::string_array();
|
||||
std::vector <std::string> vals = myMgAdapt->getCustomOptionValuesStrVec();
|
||||
result->length(vals.size());
|
||||
for (int i = 0; i<vals.size(); i++) result[i] = CORBA::string_dup(vals[i].c_str());
|
||||
result->length((CORBA::ULong) vals.size()) ;
|
||||
for (CORBA::ULong i = 0; i<vals.size(); i++) result[i] = CORBA::string_dup(vals[i].c_str());
|
||||
return result._retn();
|
||||
}
|
||||
str_array* MG_ADAPT_i::getOptionValuesStrVec()
|
||||
SMESH::string_array* MG_ADAPT_i::getOptionValuesStrVec()
|
||||
{
|
||||
|
||||
SMESH::str_array_var result = new SMESH::str_array();
|
||||
SMESH::string_array_var result = new SMESH::string_array();
|
||||
std::vector <std::string> vals = myMgAdapt->getOptionValuesStrVec();
|
||||
result->length(vals.size());
|
||||
for (int i = 0; i<vals.size(); i++) result[i] = CORBA::string_dup(vals[i].c_str());
|
||||
result->length((CORBA::ULong) vals.size());
|
||||
for (CORBA::ULong i = 0; i<vals.size(); i++) result[i] = CORBA::string_dup(vals[i].c_str());
|
||||
return result._retn();
|
||||
}
|
||||
|
||||
@ -493,9 +495,12 @@ void MG_ADAPT_OBJECT_i::AddHypothesis(SMESH::MG_ADAPT_ptr mg)
|
||||
mg->setMedFileOut(medFileOut.c_str());
|
||||
mg->setSizeMapFile(medFileBackground.c_str());
|
||||
hypothesis = SMESH::MG_ADAPT::_duplicate(mg);
|
||||
hypothesis->Register();
|
||||
}
|
||||
CORBA::Long MG_ADAPT_OBJECT_i::Compute(bool publish)
|
||||
{
|
||||
SMESH::TPythonDump noDumpSoFar;
|
||||
|
||||
if(!checkMeshFileIn()){
|
||||
std::cerr<< "\n Error : Please check the MED file input or mesh input. \n";
|
||||
return -1;
|
||||
@ -507,22 +512,22 @@ CORBA::Long MG_ADAPT_OBJECT_i::Compute(bool publish)
|
||||
|
||||
bool MG_ADAPT_OBJECT_i::checkMeshFileIn()
|
||||
{
|
||||
SMESH::TPythonDump noDumpSoFar;
|
||||
|
||||
bool ret = false; // 1 ok , 0 nook
|
||||
if(!::MG_ADAPT::MgAdapt::isFileExist(medFileIn))
|
||||
if ( !( ret = SMESH_File( medFileIn ).exists()))
|
||||
{
|
||||
if(!myMesh->_is_nil())
|
||||
{
|
||||
bool toOverwrite = true;
|
||||
bool toFindOutDim = true;
|
||||
medFileIn = hypothesis->getFileName();
|
||||
medFileIn = (CORBA::String_var( hypothesis->getFileName() )).in();
|
||||
medFileIn+= ".med";
|
||||
myMesh->ExportMED(medFileIn.c_str(), false, -1, toOverwrite, toFindOutDim);
|
||||
hypothesis->setMedFileIn(medFileIn.c_str());
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
ret = true;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1,25 +1,21 @@
|
||||
#ifndef MG_ADAPT_I_HXX
|
||||
#define MG_ADAPT_I_HXX
|
||||
|
||||
#include "MG_ADAPT.hxx"
|
||||
#include "SMESH.hxx"
|
||||
#include <SALOMEconfig.h>
|
||||
//~#include CORBA_SERVER_HEADER(ADAPT_Gen)
|
||||
#include CORBA_SERVER_HEADER(MG_ADAPT)
|
||||
|
||||
#include <SALOMEconfig.h>
|
||||
#include CORBA_SERVER_HEADER(MG_ADAPT)
|
||||
#include "SALOME_GenericObj_i.hh"
|
||||
#include "SALOME_Component_i.hxx"
|
||||
#include "SALOME_NamingService.hxx"
|
||||
#include "Utils_CorbaException.hxx"
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <SALOME_GenericObj_wrap.hxx>
|
||||
|
||||
#include <string>
|
||||
|
||||
//~struct MgAdaptHypothesisData;
|
||||
//~static void copyHypothesisDataToImpl(SMESH::MgAdaptHypothesisData& from, MG_ADAPT::MgAdaptHypothesisData* to);
|
||||
//~static void copyHypothesisDataFromImpl(MG_ADAPT::MgAdaptHypothesisData* from, SMESH::MgAdaptHypothesisData& to);
|
||||
//~class MgAdapt;
|
||||
namespace MG_ADAPT
|
||||
{
|
||||
class MgAdaptHypothesisData;
|
||||
class MgAdapt;
|
||||
}
|
||||
|
||||
namespace SMESH
|
||||
{
|
||||
|
||||
@ -28,12 +24,8 @@ class SMESH_I_EXPORT MG_ADAPT_i :
|
||||
public virtual POA_SMESH::MG_ADAPT
|
||||
{
|
||||
public:
|
||||
//~MG_ADAPT_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i );
|
||||
//~static SMESH::MG_ADAPT_ptr CreateMG_ADAPT();
|
||||
//~MG_ADAPT_i(PortableServer::POA_var poa);
|
||||
MG_ADAPT_i();
|
||||
virtual ~MG_ADAPT_i();
|
||||
//~void setData( SMESH::MgAdaptHypothesisData* data);
|
||||
void setData( SMESH::MgAdaptHypothesisData& data);
|
||||
|
||||
void setMedFileIn(const char* str);
|
||||
@ -121,11 +113,11 @@ public:
|
||||
|
||||
bool hasOptionDefined( const char* optionName ) ;
|
||||
void setOptionValue(const char* optionName,
|
||||
const char* optionValue) throw (std::invalid_argument);
|
||||
const char* optionValue);
|
||||
char* getOptionValue(const char* optionName,
|
||||
bool& isDefault) throw (std::invalid_argument);
|
||||
str_array* getCustomOptionValuesStrVec() ;
|
||||
str_array* getOptionValuesStrVec() ;
|
||||
bool& isDefault);
|
||||
SMESH::string_array* getCustomOptionValuesStrVec() ;
|
||||
SMESH::string_array* getOptionValuesStrVec() ;
|
||||
void copyHypothesisDataFromImpl(const ::MG_ADAPT::MgAdaptHypothesisData* from, SMESH::MgAdaptHypothesisData* to) const;
|
||||
void copyHypothesisDataToImpl(const SMESH::MgAdaptHypothesisData& from, ::MG_ADAPT::MgAdaptHypothesisData* to) const;
|
||||
//~TOptionValues getOptionValues() const;
|
||||
@ -134,8 +126,6 @@ public:
|
||||
private:
|
||||
::MG_ADAPT::MgAdapt* myMgAdapt;
|
||||
std::string errStr;
|
||||
//~CORBA::ORB_ptr _orb;
|
||||
//~ADAPT::ADAPT_Gen_var _gen_i;
|
||||
|
||||
};
|
||||
|
||||
@ -154,8 +144,8 @@ private:
|
||||
std::string medFileIn, medFileOut, medFileBackground;
|
||||
bool checkMeshFileIn();
|
||||
bool publish;
|
||||
SMESH::SMESH_Mesh_ptr myMesh;
|
||||
SMESH::MG_ADAPT_ptr hypothesis;
|
||||
SMESH::SMESH_Mesh_var myMesh;
|
||||
SALOME::GenericObj_wrap<SMESH::MG_ADAPT> hypothesis;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user