GeomSelectionTools* HYBRIDPluginGUI_HypothesisCreator::getGeomSelectionTool()
{
HYBRIDPluginGUI_HypothesisCreator* that = (HYBRIDPluginGUI_HypothesisCreator*)this;
-- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-- if (that->GeomToolSelected == NULL || that->GeomToolSelected->getMyStudy() != aStudy) {
-- that->GeomToolSelected = new GeomSelectionTools(aStudy);
++ if (that->GeomToolSelected == NULL) {
++ that->GeomToolSelected = new GeomSelectionTools();
}
return that->GeomToolSelected;
}
int elementType = myEnfMeshConstraint->currentIndex();
-- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
++ _PTR(Study) aStudy = SMESH::getStudy();
_PTR(SObject) aSObj; //SMESH::SMESH_IDSource::_nil;
QString meshEntry = myEnfMeshWdg->GetValue();
- MESSAGE("myEnfMeshWdg->GetValue()" << meshEntry.toStdString());
if (selEnfMeshes == 1)
{
// myEnfMesh = myEnfMeshWdg->GetObject< SMESH::SMESH_IDSource >();
// std::string entry = myEnfMeshWdg->GetValue();
aSObj = aStudy->FindObjectID(meshEntry.toStdString().c_str());
-- CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj,aStudy);
++ CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj);
if (!CORBA::is_nil(anObj)) {
// SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
QStringListIterator meshEntriesIt (meshEntries);
while (meshEntriesIt.hasNext()) {
aSObj = aStudy->FindObjectID(meshEntriesIt.next().toStdString().c_str());
-- CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj,aStudy);
++ CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj);
if (!CORBA::is_nil(anObj)) {
// SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
TEnfMeshList::const_iterator itEnfMesh;
-- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
++ _PTR(Study) aStudy = SMESH::getStudy();
for(itEnfMesh = h_data.myEnforcedMeshes.begin() ; itEnfMesh != h_data.myEnforcedMeshes.end(); itEnfMesh++ ) {
TEnfMesh* enfMesh = (*itEnfMesh);
*/
//=============================================================================
- HYBRIDPlugin_HYBRID::HYBRIDPlugin_HYBRID(int hypId, int studyId, SMESH_Gen* gen)
- : SMESH_3D_Algo(hypId, studyId, gen)
+ HYBRIDPlugin_HYBRID::HYBRIDPlugin_HYBRID(int hypId, SMESH_Gen* gen)
+ : SMESH_3D_Algo(hypId, gen)
{
- MESSAGE("HYBRIDPlugin_HYBRID::HYBRIDPlugin_HYBRID");
_name = Name();
_shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type
_onlyUnaryInput = true; // Compute() will be called on each solid
_iShape=0;
_nbShape=0;
_compatibleHypothesis.push_back( HYBRIDPlugin_Hypothesis::GetHypType());
- _requireShape = false; // can work without shape_studyId
-
- smeshGen_i = SMESH_Gen_i::GetSMESHGen();
- CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/myStudyManager");
- SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
-
- myStudy = NULL;
- myStudy = aStudyMgr->GetStudyByID(_studyId);
-
- //_compatibleHypothesis.push_back( StdMeshers_ViscousLayers::GetHypType() );
+ _requireShape = false; // can work without shape
-
- smeshGen_i = SMESH_Gen_i::GetSMESHGen();
- CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/Study");
-
- myStudy = SALOMEDS::Study::_narrow(anObject);
- if (!myStudy->_is_nil())
- MESSAGE("Study not empty");
-
_computeCanceled = false;
}
TopoDS_Shape HYBRIDPlugin_HYBRID::entryToShape(std::string entry)
{
- MESSAGE("HYBRIDPlugin_HYBRID::entryToShape "<<entry );
-- if ( myStudy->_is_nil() )
++ if ( SMESH_Gen_i::getStudyServant()->_is_nil() )
throw SALOME_Exception("MG-HYBRID plugin can't work w/o publishing in the study");
GEOM::GEOM_Object_var aGeomObj;
TopoDS_Shape S = TopoDS_Shape();
-- SALOMEDS::SObject_var aSObj = myStudy->FindObjectID( entry.c_str() );
++ SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( entry.c_str() );
if (!aSObj->_is_nil() ) {
CORBA::Object_var obj = aSObj->GetObject();
aGeomObj = GEOM::GEOM_Object::_narrow(obj);
aSObj->UnRegister();
}
if ( !aGeomObj->_is_nil() )
-- S = smeshGen_i->GeomObjectToShape( aGeomObj.in() );
++ S = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( aGeomObj.in() );
return S;
}
bool _keepFiles;
bool _removeLogOnSuccess;
bool _logInStandardOutput;
-- SALOMEDS::Study_var myStudy;
-- SMESH_Gen_i* smeshGen_i;
};
/*!
SMESH_Algo_i( thePOA ),
SMESH_3D_Algo_i( thePOA )
{
- MESSAGE( "HYBRIDPlugin_HYBRID_i::HYBRIDPlugin_HYBRID_i" );
myBaseImpl = new ::HYBRIDPlugin_HYBRID (theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theGenImpl );
}
//=============================================================================
SMESH::SMESH_Mesh_ptr HYBRIDPlugin_HYBRID_i::importGMFMesh(const char* theGMFFileName)
{
- MESSAGE( "HYBRIDPlugin_HYBRID_i::importGMFMesh" );
SMESH_Gen_i* smeshGen = SMESH_Gen_i::GetSMESHGen();
SMESH::SMESH_Mesh_ptr theMesh = smeshGen->CreateEmptyMesh();
- smeshGen->RemoveLastFromPythonScript(smeshGen->GetCurrentStudy()->StudyId());
- SALOMEDS::SObject_ptr theSMesh = smeshGen->ObjectToSObject(smeshGen->GetCurrentStudy(), theMesh);
+ smeshGen->RemoveLastFromPythonScript();
+ SALOMEDS::SObject_ptr theSMesh = smeshGen->ObjectToSObject(theMesh);
#ifdef WINNT
#define SEP '\\'
#else
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "HYBRIDPlugin_Hypothesis_i::HYBRIDPlugin_Hypothesis_i" );
myBaseImpl = new ::HYBRIDPlugin_Hypothesis (theGenImpl->GetANewId(),
- theStudyId,
theGenImpl);
}