mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-06 00:34:18 +05:00
Reload from file
Small refactoring
This commit is contained in:
parent
08b75b51fe
commit
224dbbb87e
@ -258,8 +258,7 @@ module SMESH
|
|||||||
SMESH_Mesh CreateEmptyMesh()
|
SMESH_Mesh CreateEmptyMesh()
|
||||||
raises ( SALOME::SALOME_Exception );
|
raises ( SALOME::SALOME_Exception );
|
||||||
|
|
||||||
SMESH_Mesh ReloadMeshFromFile( in string theFileName,
|
SMESH_Mesh ReloadMeshFromFile(in SMESH_Mesh sourceMesh)
|
||||||
in SMESH_Mesh sourceMesh)
|
|
||||||
raises(SALOME::SALOME_Exception);
|
raises(SALOME::SALOME_Exception);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -269,14 +268,6 @@ module SMESH
|
|||||||
SMESH_Mesh CreateMeshesFromUNV( in string theFileName )
|
SMESH_Mesh CreateMeshesFromUNV( in string theFileName )
|
||||||
raises ( SALOME::SALOME_Exception );
|
raises ( SALOME::SALOME_Exception );
|
||||||
|
|
||||||
/*!
|
|
||||||
* Reload Mesh object importing data from given UNV file
|
|
||||||
* (UNV supported version is I-DEAS 10)
|
|
||||||
*
|
|
||||||
SMESH_Mesh ReloadMeshesFromUNV( in string theFileName,
|
|
||||||
in SMESH_Mesh sourceMesh )
|
|
||||||
raises(SALOME::SALOME_Exception);*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Create Mesh object(s) importing data from given MED file
|
* Create Mesh object(s) importing data from given MED file
|
||||||
*/
|
*/
|
||||||
@ -284,27 +275,12 @@ module SMESH
|
|||||||
out SMESH::DriverMED_ReadStatus theStatus )
|
out SMESH::DriverMED_ReadStatus theStatus )
|
||||||
raises ( SALOME::SALOME_Exception );
|
raises ( SALOME::SALOME_Exception );
|
||||||
|
|
||||||
/*!
|
|
||||||
* Reload Mesh object(s) importing data from given MED file
|
|
||||||
*
|
|
||||||
mesh_array ReloadMeshesFromMED( in string theFileName,
|
|
||||||
in SMESH_Mesh sourceMesh,
|
|
||||||
out SMESH::DriverMED_ReadStatus theStatus )
|
|
||||||
raises(SALOME::SALOME_Exception);*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Create Mesh object importing data from given STL file
|
* Create Mesh object importing data from given STL file
|
||||||
*/
|
*/
|
||||||
SMESH_Mesh CreateMeshesFromSTL( in string theFileName )
|
SMESH_Mesh CreateMeshesFromSTL( in string theFileName )
|
||||||
raises ( SALOME::SALOME_Exception );
|
raises ( SALOME::SALOME_Exception );
|
||||||
|
|
||||||
/*!
|
|
||||||
* Reload Mesh object importing data from given STL file
|
|
||||||
*
|
|
||||||
SMESH_Mesh ReloadMeshesFromSTL( in string theFileName,
|
|
||||||
in SMESH_Mesh sourceMesh )
|
|
||||||
raises(SALOME::SALOME_Exception);*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Create Mesh object(s) importing data from given CGNS file
|
* Create Mesh object(s) importing data from given CGNS file
|
||||||
*/
|
*/
|
||||||
@ -312,14 +288,6 @@ module SMESH
|
|||||||
out SMESH::DriverMED_ReadStatus theStatus )
|
out SMESH::DriverMED_ReadStatus theStatus )
|
||||||
raises ( SALOME::SALOME_Exception );
|
raises ( SALOME::SALOME_Exception );
|
||||||
|
|
||||||
/*!
|
|
||||||
* Reload Mesh object(s) importing data from given CGNS file
|
|
||||||
*
|
|
||||||
mesh_array ReloadMeshesFromCGNS( in string theFileName,
|
|
||||||
in SMESH_Mesh sourceMesh,
|
|
||||||
out SMESH::DriverMED_ReadStatus theStatus )
|
|
||||||
raises(SALOME::SALOME_Exception);*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Create Mesh object importing data from given GMF file
|
* Create Mesh object importing data from given GMF file
|
||||||
* \param theFileName - a name of file to import
|
* \param theFileName - a name of file to import
|
||||||
@ -330,17 +298,6 @@ module SMESH
|
|||||||
out SMESH::ComputeError theError)
|
out SMESH::ComputeError theError)
|
||||||
raises ( SALOME::SALOME_Exception );
|
raises ( SALOME::SALOME_Exception );
|
||||||
|
|
||||||
/*!
|
|
||||||
* Reload Mesh object importing data from given GMF file
|
|
||||||
* \param theFileName - a name of file to import
|
|
||||||
* \param theMakeRequiredGroups - if true, groups of required entities will be created
|
|
||||||
*
|
|
||||||
SMESH_Mesh ReloadMeshesFromGMF( in string theFileName,
|
|
||||||
in SMESH_Mesh sourceMesh,
|
|
||||||
in boolean theMakeRequiredGroups,
|
|
||||||
out SMESH::ComputeError theError )
|
|
||||||
raises(SALOME::SALOME_Exception);*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Create a mesh and import data from any file supported by meshio library
|
* Create a mesh and import data from any file supported by meshio library
|
||||||
*/
|
*/
|
||||||
@ -348,13 +305,6 @@ module SMESH
|
|||||||
out SMESH::DriverMED_ReadStatus theStatus)
|
out SMESH::DriverMED_ReadStatus theStatus)
|
||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
/*!
|
|
||||||
* Reload a mesh and import data from any file supported by meshio library
|
|
||||||
*
|
|
||||||
mesh_array ReloadMeshesFromMESHIO( in string theFileName,
|
|
||||||
in SMESH_Mesh sourceMesh,
|
|
||||||
out SMESH::DriverMED_ReadStatus theStatus )
|
|
||||||
raises(SALOME::SALOME_Exception);*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Create a dual mesh of a Tetrahedron mesh
|
* Create a dual mesh of a Tetrahedron mesh
|
||||||
|
@ -1123,9 +1123,8 @@ namespace
|
|||||||
|
|
||||||
SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
|
SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
|
||||||
{
|
{
|
||||||
// Get file path and re-import mesh
|
// re-import mesh
|
||||||
QString aPath = anInfo.fileName();
|
SMESH::SMESH_Mesh_var aReloadedMesh = SMESHGUI::GetSMESHGen()->ReloadMeshFromFile(aMeshByIO);
|
||||||
SMESH::SMESH_Mesh_var aReloadedMesh = SMESHGUI::GetSMESHGen()->ReloadMeshFromFile(aPath.toUtf8().constData(), aMeshByIO);
|
|
||||||
|
|
||||||
QStringList anEntryList;
|
QStringList anEntryList;
|
||||||
|
|
||||||
|
@ -1013,6 +1013,7 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
|
|||||||
{
|
{
|
||||||
// there are methods to convert:
|
// there are methods to convert:
|
||||||
// CreateMesh( shape )
|
// CreateMesh( shape )
|
||||||
|
// ReloadMesh( shape )
|
||||||
// Concatenate( [mesh1, ...], ... )
|
// Concatenate( [mesh1, ...], ... )
|
||||||
// CreateHypothesis( theHypType, theLibName )
|
// CreateHypothesis( theHypType, theLibName )
|
||||||
// Compute( mesh, geom )
|
// Compute( mesh, geom )
|
||||||
@ -1067,6 +1068,13 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
|
|||||||
Handle(_pyMesh) mesh = new _pyMesh( theCommand, entries.front() );
|
Handle(_pyMesh) mesh = new _pyMesh( theCommand, entries.front() );
|
||||||
AddObject( mesh );
|
AddObject( mesh );
|
||||||
}
|
}
|
||||||
|
if (method == "ReloadMeshFromFile")
|
||||||
|
{
|
||||||
|
std::cout << "WhatIS" << std::endl;
|
||||||
|
Handle(_pyMesh) mesh = new _pyMesh(theCommand, theCommand->GetResultValue());
|
||||||
|
AddObject(mesh);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// CreateHypothesis()
|
// CreateHypothesis()
|
||||||
if ( method == "CreateHypothesis" )
|
if ( method == "CreateHypothesis" )
|
||||||
|
@ -1331,16 +1331,17 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateEmptyMesh()
|
|||||||
return mesh._retn();
|
return mesh._retn();
|
||||||
}
|
}
|
||||||
|
|
||||||
SMESH::SMESH_Mesh_ptr SMESH_Gen_i::ReloadMeshFromFile(const char* theFileName,
|
SMESH::SMESH_Mesh_ptr SMESH_Gen_i::ReloadMeshFromFile(SMESH::SMESH_Mesh_ptr theMesh)
|
||||||
SMESH::SMESH_Mesh_ptr theMesh)
|
|
||||||
{
|
{
|
||||||
SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
|
SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
|
||||||
|
|
||||||
|
SMESH::MedFileInfo* aMedInfo = theMesh->GetMEDFileInfo();
|
||||||
|
|
||||||
// Get file path and re-import mesh
|
// Get file path and re-import mesh
|
||||||
QString aPath = QString(theFileName);
|
QString aPath = QString(aMedInfo->fileName);
|
||||||
QStringList aSplit = aPath.split('.');
|
QStringList aSplit = aPath.split('.');
|
||||||
QStringList anEntryList;
|
QStringList anEntryList;
|
||||||
|
|
||||||
|
|
||||||
auto aStudy = getStudyServant();
|
auto aStudy = getStudyServant();
|
||||||
|
|
||||||
SMESH::SMESH_Mesh_ptr aNewMesh;
|
SMESH::SMESH_Mesh_ptr aNewMesh;
|
||||||
|
@ -237,8 +237,7 @@ public:
|
|||||||
// Create empty mesh
|
// Create empty mesh
|
||||||
SMESH::SMESH_Mesh_ptr CreateEmptyMesh();
|
SMESH::SMESH_Mesh_ptr CreateEmptyMesh();
|
||||||
|
|
||||||
SMESH::SMESH_Mesh_ptr ReloadMeshFromFile( const char* theFileName,
|
SMESH::SMESH_Mesh_ptr ReloadMeshFromFile(SMESH::SMESH_Mesh_ptr theMesh);
|
||||||
SMESH::SMESH_Mesh_ptr theMesh);
|
|
||||||
|
|
||||||
// Create a mesh and import data from an UNV file
|
// Create a mesh and import data from an UNV file
|
||||||
SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName );
|
SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName );
|
||||||
|
@ -675,13 +675,13 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ):
|
|||||||
global notebook
|
global notebook
|
||||||
notebook = salome_notebook.NoteBook( theIsEnablePublish )
|
notebook = salome_notebook.NoteBook( theIsEnablePublish )
|
||||||
|
|
||||||
def ReloadMeshFromFile(self, theFileName, theMesh):
|
def ReloadMeshFromFile(self, theMesh):
|
||||||
"""
|
"""
|
||||||
Desc for method,
|
Desc for method,
|
||||||
"""
|
"""
|
||||||
|
|
||||||
aSmeshMesh = SMESH._objref_SMESH_Gen.ReloadMeshFromFile(self,theFileName)
|
aSmeshMesh = SMESH._objref_SMESH_Gen.ReloadMeshFromFile(self, theMesh)
|
||||||
aMesh = Mesh(self, self.geompyD, theFileName, aSmeshMesh)
|
aMesh = Mesh(self, self.geompyD, aSmeshMesh)
|
||||||
return aMesh
|
return aMesh
|
||||||
|
|
||||||
def CreateMeshesFromUNV( self,theFileName ):
|
def CreateMeshesFromUNV( self,theFileName ):
|
||||||
|
Loading…
Reference in New Issue
Block a user