28 #ifndef StdMeshers_ObjRefUlils_HeaderFile
29 #define StdMeshers_ObjRefUlils_HeaderFile
52 return gen->ShapeToGeomObject( theShape );
54 return GEOM::GEOM_Object::_nil();
64 return gen->GeomObjectToShape( theGeomObject );
66 return TopoDS_Shape();
85 const TopoDS_Shape& theShape);
93 static void SaveToStream(
const TopoDS_Shape& theShape, std::ostream & stream);
100 static TopoDS_Shape
LoadFromStream( std::istream & stream, std::string* entry=NULL );
107 static void SaveToStream( CORBA::Object_ptr obj, std::ostream & stream );
114 template<
class TInterface>
121 if (
StudyContext* myStudyContext = gen->GetStudyContext() ) {
122 std::string ior = myStudyContext->getIORbyOldId( atoi( str.c_str() ));
124 return TInterface::_narrow(gen->GetORB()->string_to_object( ior.c_str() ));
128 return TInterface::_nil();
136 static void SaveToStream(
const std::string& studyEntry, std::ostream & stream);
#define STDMESHERS_I_EXPORT
Definition: SMESH_StdMeshers_I.hxx:38
Definition: SMESH_Gen_i.hxx:99
static SMESH_Gen_i * GetSMESHGen()
Definition: SMESH_Gen_i.hxx:102
Class encapsulates methods.
Definition: StdMeshers_ObjRefUlils.hxx:43
static std::string GeomObjectToEntry(GEOM::GEOM_Object_ptr theGeomObject)
Return study entry of GEOM Object.
Definition: StdMeshers_ObjRefUlils.cxx:40
static GEOM::GEOM_Object_ptr ShapeToGeomObject(const TopoDS_Shape &theShape)
Return GEOM Object corresponding to TopoDS_Shape.
Definition: StdMeshers_ObjRefUlils.hxx:50
static void SaveToStream(const TopoDS_Shape &theShape, std::ostream &stream)
Store the shape in the stream.
Definition: StdMeshers_ObjRefUlils.cxx:83
static TopoDS_Shape EntryToShape(const std::string theEntry)
Return TopoDS_Shape by a study entry.
Definition: StdMeshers_ObjRefUlils.cxx:171
static GEOM::GEOM_Object_ptr EntryOrShapeToGeomObject(const std::string &theEntry, const TopoDS_Shape &theShape)
Return GEOM Object by its study entry or TopoDS_Shape.
Definition: StdMeshers_ObjRefUlils.cxx:55
static TopoDS_Shape LoadFromStream(std::istream &stream, std::string *entry=NULL)
Retrieve a shape from the stream.
Definition: StdMeshers_ObjRefUlils.cxx:111
static TInterface::_var_type LoadObjectFromStream(std::istream &stream)
Retrieve a CORBA object from the stream.
Definition: StdMeshers_ObjRefUlils.hxx:116
static TopoDS_Shape GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject)
Return TopoDS_Shape corresponding to GEOM_Object.
Definition: StdMeshers_ObjRefUlils.hxx:62
Definition: SMESH_Gen_i.hxx:66