Replace shape in Mesh object

This commit is contained in:
vsv 2019-12-27 16:22:48 +03:00
parent 26999fa04d
commit 00b30e0d6c
4 changed files with 28 additions and 0 deletions

View File

@ -347,6 +347,12 @@ module SMESH
GEOM::GEOM_Object GetShapeToMesh()
raises (SALOME::SALOME_Exception);
/*!
* Replaces a shape in the mesh
*/
void ReplaceShape(in GEOM::GEOM_Object theNewGeom, in GEOM::GEOM_Object theOldGeom)
raises (SALOME::SALOME_Exception);
/*!
* Return false if the mesh is not yet fully loaded from the study file
*/

View File

@ -86,6 +86,9 @@ class SMESH_EXPORT SMESH_Mesh
* \brief Return true if there is a geometry to be meshed, not PseudoShape()
*/
bool HasShapeToMesh() const { return _isShapeToMesh; }
void UndefShapeToMesh() { _isShapeToMesh = false; }
/*!
* \brief Return diagonal size of bounding box of shape to mesh.
*/

View File

@ -254,6 +254,22 @@ GEOM::GEOM_Object_ptr SMESH_Mesh_i::GetShapeToMesh()
return aShapeObj._retn();
}
//================================================================================
/*!
* \brief Replaces a shape in the mesh
*/
//================================================================================
void SMESH_Mesh_i::ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom, GEOM::GEOM_Object_ptr theOldGeom)
throw (SALOME::SALOME_Exception)
{
GEOM_Client* geomClient = _gen_i->GetShapeReader();
GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine(theOldGeom);
CORBA::String_var groupIOR = geomGen->GetStringFromIOR(theOldGeom);
geomClient->RemoveShapeFromBuffer(groupIOR.in());
_impl->UndefShapeToMesh();
SetShape(theNewGeom);
}
//================================================================================
/*!
* \brief Return false if the mesh is not yet fully loaded from the study file

View File

@ -74,6 +74,9 @@ public:
GEOM::GEOM_Object_ptr GetShapeToMesh()
throw (SALOME::SALOME_Exception);
virtual void ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom, GEOM::GEOM_Object_ptr theOldGeom)
throw (SALOME::SALOME_Exception);
CORBA::Boolean IsLoaded()
throw (SALOME::SALOME_Exception);