1 // Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SMESH_ParallelMesh_i.cxx
23 // Author : Yoann AUDOUIN, EDF
26 #include "SMESH_ParallelMesh_i.hxx"
28 #include "SMESH_Gen_i.hxx"
32 static int MYDEBUG = 0;
34 static int MYDEBUG = 0;
37 //=============================================================================
41 //=============================================================================
43 SMESH_ParallelMesh_i::SMESH_ParallelMesh_i( PortableServer::POA_ptr thePOA,
45 : SMESH_Mesh_i(thePOA, gen_i)
49 //=============================================================================
52 //!< implementation of struct used to call methods of SMESH_Mesh_i from SMESH_Mesh
53 // issue 0020918: groups removal is caused by hyp modification
54 // issue 0021208: to forget not loaded mesh data at hyp modification
55 struct TCallUp_i : public SMESH_ParallelMesh::TCallUp
57 SMESH_ParallelMesh_i* _mesh;
58 TCallUp_i(SMESH_ParallelMesh_i* mesh):_mesh(mesh) {}
59 void RemoveGroup (const int theGroupID) override { _mesh->removeGroup( theGroupID ); }
60 void HypothesisModified( int hypID,
61 bool updIcons) override { _mesh->onHypothesisModified( hypID,
63 void Load () override { _mesh->Load(); }
64 bool IsLoaded() override { return _mesh->IsLoaded(); }
65 TopoDS_Shape GetShapeByEntry(const std::string& entry) override
67 GEOM::GEOM_Object_var go = SMESH_Gen_i::GetGeomObjectByEntry( entry );
68 return SMESH_Gen_i::GeomObjectToShape( go );
73 //================================================================================
75 * \brief Set mesh implementation
77 //================================================================================
79 void SMESH_ParallelMesh_i::SetImpl(::SMESH_ParallelMesh * impl)
81 if(MYDEBUG) MESSAGE("SMESH_ParallelMesh_i::SetImpl");
84 _impl->SetCallUp( new TCallUp_i(this));
87 //=============================================================================
89 * Return a mesh implementation
91 //=============================================================================
93 ::SMESH_ParallelMesh & SMESH_ParallelMesh_i::GetImpl()
95 if(MYDEBUG) MESSAGE("SMESH_ParallelMesh_i::GetImpl()");