X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Filter_i.cxx;h=bfb52b21802a22e640e09a1d0ed9d5beb3f3811f;hp=d9c221ad70cc049c25b5d660099881a9056ec0a1;hb=07ec002dfd20ec187228e11533e8e2135eca08fd;hpb=358f8ddd54e7ed553eecc22ca665575e4019e3a0 diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index d9c221ad7..bfb52b218 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -37,29 +37,27 @@ #include "SMESHDS_Mesh.hxx" +#include +#include +#include +#include +#include #include #include #include -#include -#include #include -#include +#include #include +#include #include #include -#include #include -#include -#include -#include -#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include +#include using namespace SMESH; using namespace SMESH::Controls; @@ -386,7 +384,7 @@ static TopoDS_Shape getShapeByName( const char* theName ) GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( aList[ 0 ]->GetObject() ); if ( !aGeomObj->_is_nil() ) { - GEOM::GEOM_Gen_var aGEOMGen = SMESH_Gen_i::GetGeomEngine(); + GEOM::GEOM_Gen_ptr aGEOMGen = SMESH_Gen_i::GetGeomEngine(); TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, aGeomObj ); return aLocShape; } @@ -396,48 +394,49 @@ static TopoDS_Shape getShapeByName( const char* theName ) return TopoDS_Shape(); } -static TopoDS_Shape getShapeByID( const char* theID ) +static TopoDS_Shape getShapeByID (const char* theID) { - if ( theID != 0 && theID!="" ) - { + if (theID != 0 && theID != "") { SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy(); - if ( aStudy != 0 ) - { - CORBA::Object_var obj = aStudy->ConvertIORToObject(theID); - GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( obj ); + if (aStudy != 0) { + SALOMEDS::SObject_var aSObj = aStudy->FindObjectID(theID); + 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 = aStudy->ConvertIORToObject(aVal); + GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(obj); - if ( !aGeomObj->_is_nil() ) - { - GEOM::GEOM_Gen_var aGEOMGen = SMESH_Gen_i::GetGeomEngine(); + if (!aGeomObj->_is_nil()) { + GEOM::GEOM_Gen_ptr aGEOMGen = SMESH_Gen_i::GetGeomEngine(); TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, aGeomObj ); return aLocShape; } + } } } return TopoDS_Shape(); } -static char* getShapeNameByID ( const char* theID ) +static char* getShapeNameByID (const char* theID) { char* aName = ""; - if ( theID != 0 && theID!="" ) - { - SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy(); - if ( aStudy != 0 ) - { - SALOMEDS::SObject_var aSObj = aStudy->FindObjectIOR( theID ); - SALOMEDS::GenericAttribute_var anAttr; - if ( !aSObj->_is_nil() && aSObj->FindAttribute( anAttr, "AttributeName") ) - { - SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow( anAttr ); - aName = aNameAttr->Value(); - } - } + if (theID != 0 && theID != "") { + SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); + SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy(); + if (aStudy != 0) { + //SALOMEDS::SObject_var aSObj = aStudy->FindObjectIOR( theID ); + SALOMEDS::SObject_var aSObj = aStudy->FindObjectID(theID); + SALOMEDS::GenericAttribute_var anAttr; + if (!aSObj->_is_nil() && aSObj->FindAttribute(anAttr, "AttributeName")) { + SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow(anAttr); + aName = aNameAttr->Value(); + } } - + } + return aName; } @@ -793,7 +792,7 @@ void BelongToGeom_i::SetGeom( GEOM::GEOM_Object_ptr theGeom ) if ( theGeom->_is_nil() ) return; SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); - GEOM::GEOM_Gen_var aGEOMGen = SMESH_Gen_i::GetGeomEngine(); + GEOM::GEOM_Gen_ptr aGEOMGen = SMESH_Gen_i::GetGeomEngine(); TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, theGeom ); myBelongToGeomPtr->SetGeom( aLocShape ); TPythonDump()<_is_nil() ) return; SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); - GEOM::GEOM_Gen_var aGEOMGen = SMESH_Gen_i::GetGeomEngine(); + GEOM::GEOM_Gen_ptr aGEOMGen = SMESH_Gen_i::GetGeomEngine(); TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, theGeom ); if ( aLocShape.ShapeType() == TopAbs_FACE ) @@ -1037,7 +1036,7 @@ void LyingOnGeom_i::SetGeom( GEOM::GEOM_Object_ptr theGeom ) if ( theGeom->_is_nil() ) return; SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); - GEOM::GEOM_Gen_var aGEOMGen = SMESH_Gen_i::GetGeomEngine(); + GEOM::GEOM_Gen_ptr aGEOMGen = SMESH_Gen_i::GetGeomEngine(); TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, theGeom ); myLyingOnGeomPtr->SetGeom( aLocShape ); TPythonDump()< 0) + pd << "',salome.ObjectToID(" << aThresholdID + << ")," << aUnary << "," << aBinary << "," << aTolerance + << "," << aTypeOfElem << "," << aPrecision << ")"; + else + pd << "',''," << aUnary << "," << aBinary << "," << aTolerance + << "," << aTypeOfElem << "," << aPrecision << ")"; + } SMESH::Predicate_ptr aPredicate = SMESH::Predicate::_nil(); SMESH::NumericalFunctor_ptr aFunctor = SMESH::NumericalFunctor::_nil();