mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-28 14:30:33 +05:00
0022362: EDF SMESH: Quadrangle (mapping) algorithm: enforced vertices
static TopoDS_Shape LoadFromStream( std::istream & stream, + std::string* entry=NULL );
This commit is contained in:
parent
55f0c77f45
commit
b562542616
@ -37,7 +37,7 @@ using namespace std;
|
|||||||
//purpose : Return study entry of GEOM Object
|
//purpose : Return study entry of GEOM Object
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
std::string StdMeshers_ObjRefUlils::GeomObjectToEntry(GEOM::GEOM_Object_ptr& theGeomObject)
|
std::string StdMeshers_ObjRefUlils::GeomObjectToEntry(GEOM::GEOM_Object_ptr theGeomObject)
|
||||||
{
|
{
|
||||||
if ( CORBA::is_nil( theGeomObject ))
|
if ( CORBA::is_nil( theGeomObject ))
|
||||||
return "NULL_OBJECT";
|
return "NULL_OBJECT";
|
||||||
@ -109,13 +109,16 @@ void StdMeshers_ObjRefUlils::SaveToStream( const TopoDS_Shape& theShape, ostream
|
|||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
TopoDS_Shape StdMeshers_ObjRefUlils::LoadFromStream( istream & stream)
|
TopoDS_Shape StdMeshers_ObjRefUlils::LoadFromStream( istream & stream,
|
||||||
|
std::string* entry)
|
||||||
{
|
{
|
||||||
|
string str;
|
||||||
|
if (stream >> str) {
|
||||||
|
if ( entry )
|
||||||
|
* entry = str;
|
||||||
if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
|
if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
|
||||||
SALOMEDS::Study_var study = gen->GetCurrentStudy();
|
SALOMEDS::Study_var study = gen->GetCurrentStudy();
|
||||||
if ( ! study->_is_nil() ) {
|
if ( ! study->_is_nil() ) {
|
||||||
string str;
|
|
||||||
if (stream >> str) {
|
|
||||||
SALOMEDS::SObject_wrap sobj = study->FindObjectID( str.c_str() );
|
SALOMEDS::SObject_wrap sobj = study->FindObjectID( str.c_str() );
|
||||||
CORBA::Object_var obj = gen->SObjectToObject( sobj );
|
CORBA::Object_var obj = gen->SObjectToObject( sobj );
|
||||||
GEOM::GEOM_Object_var geom = GEOM::GEOM_Object::_narrow( obj );
|
GEOM::GEOM_Object_var geom = GEOM::GEOM_Object::_narrow( obj );
|
||||||
@ -123,6 +126,8 @@ TopoDS_Shape StdMeshers_ObjRefUlils::LoadFromStream( istream & stream)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( entry )
|
||||||
|
entry->clear();
|
||||||
return TopoDS_Shape();
|
return TopoDS_Shape();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \brief Return study entry of GEOM Object
|
* \brief Return study entry of GEOM Object
|
||||||
*/
|
*/
|
||||||
static std::string GeomObjectToEntry(GEOM::GEOM_Object_ptr& theGeomObject);
|
static std::string GeomObjectToEntry(GEOM::GEOM_Object_ptr theGeomObject);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Return GEOM Object by its study entry or TopoDS_Shape
|
* \brief Return GEOM Object by its study entry or TopoDS_Shape
|
||||||
@ -89,7 +89,7 @@ public:
|
|||||||
* \param stream - the stream
|
* \param stream - the stream
|
||||||
* \retval TopoDS_Shape - resulting shape
|
* \retval TopoDS_Shape - resulting shape
|
||||||
*/
|
*/
|
||||||
static TopoDS_Shape LoadFromStream( std::istream & stream );
|
static TopoDS_Shape LoadFromStream( std::istream & stream, std::string* entry=NULL );
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Store the CORBA object in the stream
|
* \brief Store the CORBA object in the stream
|
||||||
|
Loading…
Reference in New Issue
Block a user