def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
- if noGMSHPlugin: print "Warning: GMSHPlugin module unavailable"
+ if noGMSHPlugin: print("Warning: GMSHPlugin module unavailable")
self.Create(mesh, geom, self.algoType, "libGMSHEngine.so")
self.params = None
*/
//=============================================================================
-GMSHPlugin_GMSH::GMSHPlugin_GMSH(int hypId, int studyId,
- SMESH_Gen* gen)
- : SMESH_3D_Algo(hypId, studyId, gen)
+GMSHPlugin_GMSH::GMSHPlugin_GMSH(int hypId, SMESH_Gen* gen)
+ : SMESH_3D_Algo(hypId, gen)
{
MESSAGE("GMSHPlugin_GMSH::GMSHPlugin_GMSH");
_name = "GMSH";
class GMSHPLUGIN_EXPORT GMSHPlugin_GMSH: public SMESH_3D_Algo
{
public:
- GMSHPlugin_GMSH(int hypId, int studyId, SMESH_Gen* gen);
+ GMSHPlugin_GMSH(int hypId, SMESH_Gen* gen);
virtual ~GMSHPlugin_GMSH();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
*/
//=============================================================================
-GMSHPlugin_GMSH_2D::GMSHPlugin_GMSH_2D(int hypId, int studyId,
- SMESH_Gen* gen)
- : SMESH_2D_Algo(hypId, studyId, gen)
+GMSHPlugin_GMSH_2D::GMSHPlugin_GMSH_2D(int hypId, SMESH_Gen* gen)
+ : SMESH_2D_Algo(hypId, gen)
{
MESSAGE("GMSHPlugin_GMSH_2D::GMSHPlugin_GMSH_2D");
_name = "GMSH_2D";
class GMSHPLUGIN_EXPORT GMSHPlugin_GMSH_2D: public SMESH_2D_Algo
{
public:
- GMSHPlugin_GMSH_2D(int hypId, int studyId, SMESH_Gen* gen);
+ GMSHPlugin_GMSH_2D(int hypId, SMESH_Gen* gen);
virtual ~GMSHPlugin_GMSH_2D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
//=============================================================================
GMSHPlugin_GMSH_2D_i::GMSHPlugin_GMSH_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
{
MESSAGE( "GMSHPlugin_GMSH_2D_i::GMSHPlugin_GMSH_2D_i" );
myBaseImpl = new ::GMSHPlugin_GMSH_2D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
GMSHPlugin_GMSH_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~GMSHPlugin_GMSH_2D_i();
//=============================================================================
GMSHPlugin_GMSH_i::GMSHPlugin_GMSH_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
{
MESSAGE( "GMSHPlugin_GMSH_i::GMSHPlugin_GMSH_i" );
myBaseImpl = new ::GMSHPlugin_GMSH( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
GMSHPlugin_GMSH_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~GMSHPlugin_GMSH_i();
using namespace std;
-GMSHPlugin_Hypothesis::GMSHPlugin_Hypothesis (int hypId, int studyId,
+GMSHPlugin_Hypothesis::GMSHPlugin_Hypothesis (int hypId,
SMESH_Gen * gen)
- : SMESH_Hypothesis(hypId, studyId, gen),
+ : SMESH_Hypothesis(hypId, gen),
_algo2d (automatic),
_algo3d (frontal3),
_recomb2DAlgo (standard),
{
public:
- GMSHPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen);
+ GMSHPlugin_Hypothesis(int hypId, SMESH_Gen * gen);
enum Algo2D
{
*
*/
//=============================================================================
-GMSHPlugin_Hypothesis_2D::GMSHPlugin_Hypothesis_2D (int hypId, int studyId,
- SMESH_Gen * gen)
- : GMSHPlugin_Hypothesis(hypId, studyId, gen)
+GMSHPlugin_Hypothesis_2D::GMSHPlugin_Hypothesis_2D (int hypId, SMESH_Gen * gen)
+ : GMSHPlugin_Hypothesis(hypId, gen)
{
_name = "GMSH_Parameters_2D";
{
public:
- GMSHPlugin_Hypothesis_2D(int hypId, int studyId, SMESH_Gen * gen);
+ GMSHPlugin_Hypothesis_2D(int hypId, SMESH_Gen * gen);
};
//=============================================================================
GMSHPlugin_Hypothesis_2D_i::
GMSHPlugin_Hypothesis_2D_i (PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl)
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
- GMSHPlugin_Hypothesis_i( thePOA, theStudyId, theGenImpl )
+ GMSHPlugin_Hypothesis_i( thePOA, theGenImpl )
{
MESSAGE( "GMSHPlugin_Hypothesis_2D_i::GMSHPlugin_Hypothesis_2D_i" );
if (myBaseImpl)
delete (::GMSHPlugin_Hypothesis*)myBaseImpl;
myBaseImpl = new ::GMSHPlugin_Hypothesis_2D (theGenImpl->GetANewId(),
- theStudyId,
theGenImpl);
}
public:
// Constructor
GMSHPlugin_Hypothesis_2D_i (PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl);
// Destructor
virtual ~GMSHPlugin_Hypothesis_2D_i();
GMSHPlugin_Hypothesis_i::
GMSHPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl)
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
{
MESSAGE( "GMSHPlugin_Hypothesis_i::GMSHPlugin_Hypothesis_i" );
myBaseImpl = new ::GMSHPlugin_Hypothesis (theGenImpl->GetANewId(),
- theStudyId,
theGenImpl);
}
public:
// Constructor
GMSHPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl);
// Destructor
virtual ~GMSHPlugin_Hypothesis_i();
_secondOrder = hyp->GetSecondOrder();
_useIncomplElem = hyp->GetUseIncomplElem();
_is2d = hyp->GetIs2d();
- _studyId = hyp->GetStudyId();
_compounds = hyp->GetCompoundOnEntries();
}
else
MESSAGE("GMSHPlugin_Mesher::CreateGmshCompounds");
SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen();
- CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/myStudyManager");
- SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
- SALOMEDS::Study_var myStudy = aStudyMgr->GetStudyByID(_studyId);
OCC_Internals* occgeo = _gModel->getOCCInternals();
{
GEOM::GEOM_Object_var aGeomObj;
TopoDS_Shape geomShape = TopoDS_Shape();
- SALOMEDS::SObject_var aSObj = myStudy->FindObjectID( (*its).c_str() );
+ SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( (*its).c_str() );
SALOMEDS::GenericAttribute_var anAttr;
if (!aSObj->_is_nil() && aSObj->FindAttribute(anAttr, "AttributeIOR"))
{
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
CORBA::String_var aVal = anIOR->Value();
- CORBA::Object_var obj = myStudy->ConvertIORToObject(aVal);
+ CORBA::Object_var obj = SMESH_Gen_i::getStudyServant()->ConvertIORToObject(aVal);
aGeomObj = GEOM::GEOM_Object::_narrow(obj);
}
if ( !aGeomObj->_is_nil() )
bool Evaluate(MapShapeNbElems& aResMap);
private:
- int _studyId;
SMESH_Mesh* _mesh;
const TopoDS_Shape& _shape;
int _algo2d;
GeomSelectionTools* GMSHPluginGUI_HypothesisCreator::getGeomSelectionTools()
{
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- if (myGeomSelectionTools == NULL || myGeomSelectionTools->getMyStudy() != aStudy) {
- delete myGeomSelectionTools;
- myGeomSelectionTools = new GeomSelectionTools(aStudy);
+ if (myGeomSelectionTools == NULL) {
+ myGeomSelectionTools = new GeomSelectionTools();
}
return myGeomSelectionTools;
}