Distributed Geom, Smesh. Modifications by Anthony GEAY.

This commit is contained in:
jfa 2007-06-18 11:10:30 +00:00
parent 362e7633ec
commit 06221800da
8 changed files with 2574 additions and 2564 deletions

View File

@ -83,6 +83,9 @@ module SMESH
interface SMESH_Gen : Engines::Component, SALOMEDS::Driver
{
//GEOM::GEOM_Gen SetGeomEngine( in string containerLoc );
void SetGeomEngine( in GEOM::GEOM_Gen geomcompo );
FilterManager CreateFilterManager();
SMESH_Pattern GetPattern();

View File

@ -386,7 +386,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;
}
@ -409,7 +409,7 @@ static TopoDS_Shape getShapeByID( const char* theID )
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;
}
@ -793,7 +793,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()<<this<<".SetGeom("<<theGeom<<")";
@ -872,7 +872,7 @@ void BelongToSurface_i::SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType t
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 );
if ( aLocShape.ShapeType() == TopAbs_FACE )
@ -1037,7 +1037,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()<<this<<".SetGeom("<<theGeom<<")";

View File

@ -126,6 +126,7 @@ static int MYDEBUG = 0;
#endif
// Static variables definition
GEOM::GEOM_Gen_var SMESH_Gen_i::myGeomGen=GEOM::GEOM_Gen::_nil();
CORBA::ORB_var SMESH_Gen_i::myOrb;
PortableServer::POA_var SMESH_Gen_i::myPoa;
SALOME_NamingService* SMESH_Gen_i::myNS = NULL;
@ -222,10 +223,14 @@ SALOME_LifeCycleCORBA* SMESH_Gen_i::GetLCC() {
* Get GEOM::GEOM_Gen reference
*/
//=============================================================================
GEOM::GEOM_Gen_ptr SMESH_Gen_i::GetGeomEngine() {
GEOM::GEOM_Gen_var aGeomEngine =
GEOM::GEOM_Gen::_narrow( GetLCC()->FindOrLoad_Component("FactoryServer","GEOM") );
return aGeomEngine._retn();
GEOM::GEOM_Gen_ptr SMESH_Gen_i::GetGeomEngine()
{
if (CORBA::is_nil(myGeomGen))
{
Engines::Component_ptr temp=GetLCC()->FindOrLoad_Component("FactoryServer","GEOM");
myGeomGen = GEOM::GEOM_Gen::_narrow(temp);
}
return myGeomGen;
}
//=============================================================================
@ -479,6 +484,22 @@ GEOM_Client* SMESH_Gen_i::GetShapeReader()
return myShapeReader;
}
//=============================================================================
/*!
* SMESH_Gen_i::SetGeomEngine
*
* Set GEOM::GEOM_Gen reference
*/
//=============================================================================
//GEOM::GEOM_Gen_ptr SMESH_Gen_i::SetGeomEngine( const char* containerLoc )
void SMESH_Gen_i::SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo )
{
//Engines::Component_ptr temp=GetLCC()->FindOrLoad_Component(containerLoc,"GEOM");
//myGeomGen=GEOM::GEOM_Gen::_narrow(temp);
myGeomGen=GEOM::GEOM_Gen::_duplicate(geomcompo);
//return myGeomGen;
}
//=============================================================================
/*!
* SMESH_Gen_i::SetEmbeddedMode
@ -1260,7 +1281,7 @@ SMESH_Gen_i::GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_var geom = FindGeometryByMeshElement(theMesh, theElementID);
if ( !geom->_is_nil() ) {
GEOM::GEOM_Object_var mainShape = theMesh->GetShapeToMesh();
GEOM::GEOM_Gen_var geomGen = GetGeomEngine();
GEOM::GEOM_Gen_ptr geomGen = GetGeomEngine();
// try to find the corresponding SObject
SALOMEDS::SObject_var SObj = ObjectToSObject( myCurrentStudy, geom.in() );
@ -1317,7 +1338,7 @@ SMESH_Gen_i::FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
THROW_SALOME_CORBA_EXCEPTION( "bad Mesh reference", SALOME::BAD_PARAM );
GEOM::GEOM_Object_var mainShape = theMesh->GetShapeToMesh();
GEOM::GEOM_Gen_var geomGen = GetGeomEngine();
GEOM::GEOM_Gen_ptr geomGen = GetGeomEngine();
// get a core mesh DS
SMESH_Mesh_i* meshServant = SMESH::DownCast<SMESH_Mesh_i*>( theMesh );

View File

@ -172,10 +172,12 @@ public:
const char* interfaceName );
// Destructor
virtual ~SMESH_Gen_i();
// *****************************************
// Interface methods
// *****************************************
//GEOM::GEOM_Gen_ptr SetGeomEngine( const char* containerLoc );
void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
// Set current study
void SetEmbeddedMode( CORBA::Boolean theMode );
@ -461,7 +463,7 @@ private:
static void loadGeomData( SALOMEDS::SComponent_ptr theCompRoot );
private:
static GEOM::GEOM_Gen_var myGeomGen;
static CORBA::ORB_var myOrb; // ORB reference
static PortableServer::POA_var myPoa; // POA reference
static SALOME_NamingService* myNS; // Naming Service

View File

@ -225,7 +225,7 @@ TopoDS_Shape SMESH_Gen_i::GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject)
TopoDS_Shape S;
if ( !theGeomObject->_is_nil() ) {
GEOM_Client* aClient = GetShapeReader();
GEOM::GEOM_Gen_var aGeomEngine = GetGeomEngine();
GEOM::GEOM_Gen_ptr aGeomEngine = GetGeomEngine();
if ( aClient && !aGeomEngine->_is_nil () )
S = aClient->GetShape( aGeomEngine, theGeomObject );
}

View File

@ -109,6 +109,7 @@ CLEANFILES = \
dist_salomescript_DATA= \
libSMESH_Swig.py \
smesh.py \
smeshDC.py \
batchmode_smesh.py \
batchmode_mefisto.py \
ex00_all.py \

File diff suppressed because it is too large Load Diff

2522
src/SMESH_SWIG/smeshDC.py Normal file

File diff suppressed because it is too large Load Diff