X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Filter_i.cxx;h=98ae207dec57ab53a1f73e58128b6a82c681138d;hb=7e350caa2f1f4cbb2f3d948558c2710d73e76136;hp=fbd399f711e187898f6e2c2e8e42f815dd217c6e;hpb=7a9f3cc854b7a575b2923587d966ecebb3f1a62f;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index fbd399f71..98ae207de 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; } @@ -792,7 +791,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 ) @@ -1036,7 +1035,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();