#include <TopoDS_Wire.hxx>
#include <gp_Pnt.hxx>
-
#ifdef WIN32
#include <windows.h>
#include <process.h>
*/
//=============================================================================
-GEOM::GEOM_Gen_var SMESH_Gen_i::GetGeomEngine( bool isShaper )
-{
- Engines::EngineComponent_ptr temp =
- GetLCC()->FindOrLoad_Component( isShaper ? "FactoryServer" : "FactoryServer",
- isShaper ? "SHAPERSTUDY" : "GEOM" );
- myGeomGen = GEOM::GEOM_Gen::_narrow( temp );
-
- return myGeomGen;
-}
-
-//=============================================================================
-/*!
- * GetGeomEngine [ static ]
- *
- * Get GEOM::GEOM_Gen reference
- */
-//=============================================================================
-
GEOM::GEOM_Gen_var SMESH_Gen_i::GetGeomEngine( GEOM::GEOM_Object_ptr go )
{
GEOM::GEOM_Gen_ptr gen = GEOM::GEOM_Gen::_nil();
PortableServer::POA_ptr poa,
PortableServer::ObjectId* contId,
const char* instanceName,
- const char* interfaceName )
- : Engines_Component_i( orb, poa, contId, instanceName, interfaceName )
+ const char* interfaceName,
+ bool checkNS)
+ : Engines_Component_i( orb, poa, contId, instanceName, interfaceName, false, checkNS )
{
myOrb = CORBA::ORB::_duplicate(orb);
// find out mode (embedded or standalone) here else
// meshes created before calling SMESH_Client::GetSMESHGen(), which calls
// SMESH_Gen_i::SetEmbeddedMode(), have wrong IsEmbeddedMode flag
- if ( SALOME_NamingService* ns = GetNS() )
+ if(checkNS)
{
- CORBA::Object_var obj = ns->Resolve( "/Kernel/Session" );
- SALOME::Session_var session = SALOME::Session::_narrow( obj ) ;
- if ( !session->_is_nil() )
+ if ( SALOME_NamingService* ns = GetNS() )
{
- CORBA::String_var str_host = session->getHostname();
- CORBA::Long s_pid = session->getPID();
- string my_host = Kernel_Utils::GetHostname();
+ CORBA::Object_var obj = ns->Resolve( "/Kernel/Session" );
+ SALOME::Session_var session = SALOME::Session::_narrow( obj ) ;
+ if ( !session->_is_nil() )
+ {
+ CORBA::String_var str_host = session->getHostname();
+ CORBA::Long s_pid = session->getPID();
+ string my_host = Kernel_Utils::GetHostname();
#ifdef WIN32
- long my_pid = (long)_getpid();
+ long my_pid = (long)_getpid();
#else
- long my_pid = (long) getpid();
+ long my_pid = (long) getpid();
#endif
- SetEmbeddedMode( s_pid == my_pid && my_host == str_host.in() );
+ SetEmbeddedMode( s_pid == my_pid && my_host == str_host.in() );
+ }
}
}
}
SALOMEDS::SObject_wrap aSO = PublishHypothesis( hyp );
if ( !aSO->_is_nil() ) {
// Update Python script
- TPythonDump() << aSO << " = " << this << ".CreateHypothesis('"
+ TPythonDump(this) << aSO << " = " << this << ".CreateHypothesis('"
<< theHypName << "', '" << theLibName << "')";
}
}
initParams );
SALOMEDS::SObject_wrap so = PublishHypothesis( hyp );
- TPythonDump() << hyp << " = " << this << ".CreateHypothesisByAverageLength( '"
+ TPythonDump(this) << hyp << " = " << this << ".CreateHypothesisByAverageLength( '"
<< theHypType << "', '"
<< theLibName << "', "
<< theAverageLength << ", "
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
- TPythonDump() << aSO << " = " << this << ".CreateMesh(" << theShapeObject << ")";
+ TPythonDump(this) << aSO << " = " << this << ".CreateMesh(" << theShapeObject << ")";
}
}
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
- TPythonDump() << aSO << " = " << this << ".CreateEmptyMesh()";
+ TPythonDump(this) << aSO << " = " << this << ".CreateEmptyMesh()";
}
}
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
- TPythonDump() << aSO << " = " << this << ".CreateMeshesFromUNV(r'" << theFileName << "')";
+ TPythonDump(this) << aSO << " = " << this << ".CreateMeshesFromUNV(r'" << theFileName << "')";
}
}
{ // open a new scope to make aPythonDump die before PythonDump in SMESH_Mesh::GetGroups()
// Python Dump
- TPythonDump aPythonDump;
+ TPythonDump aPythonDump(this);
aPythonDump << "([";
if (theStatus == SMESH::DRS_OK) {
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
- TPythonDump() << aSO << " = " << this << ".CreateMeshesFromSTL(r'" << theFileName << "')";
+ TPythonDump(this) << aSO << " = " << this << ".CreateMeshesFromSTL(r'" << theFileName << "')";
}
}
{ // open a new scope to make aPythonDump die before PythonDump in SMESH_Mesh::GetGroups()
// Python Dump
- TPythonDump aPythonDump;
+ TPythonDump aPythonDump(this);
aPythonDump << "([";
if (theStatus == SMESH::DRS_OK)
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
- TPythonDump() << "("<< aSO << ", error) = " << this << ".CreateMeshesFromGMF(r'"
+ TPythonDump(this) << "("<< aSO << ", error) = " << this << ".CreateMeshesFromGMF(r'"
<< theFileName << "', "
<< theMakeRequiredGroups << " )";
}
if ( SMESH_Mesh_i* meshServant = SMESH::DownCast<SMESH_Mesh_i*>( theMesh ))
{
groups = meshServant->MakeGroupsOfBadInputElements( theSubShapeID, theGroupName );
- TPythonDump() << groups << " = " << this
+ TPythonDump(this) << groups << " = " << this
<< ".MakeGroupsOfBadInputElements( "
<< theMesh << ", " << theSubShapeID << ", '" << theGroupName << "' )";
}
SALOME::BAD_PARAM );
// Update Python script
- TPythonDump() << "isDone = " << this << ".Compute( "
+ TPythonDump(this) << "isDone = " << this << ".Compute( "
<< theMesh << ", " << theShapeObject << ")";
try {
nbels[i] = 0;
// Update Python script
- TPythonDump() << "theNbElems = " << this << ".Evaluate( "
+ TPythonDump(this) << "theNbElems = " << this << ".Evaluate( "
<< theMesh << ", " << theShapeObject << ")";
try {
CORBA::Boolean theCommonGroups,
SMESH::SMESH_Mesh_ptr theMeshToAppendTo)
{
- std::unique_ptr< TPythonDump > pPythonDump( new TPythonDump );
+ std::unique_ptr< TPythonDump > pPythonDump( new TPythonDump(this) );
TPythonDump& pythonDump = *pPythonDump; // prevent dump of called methods
// create mesh if theMeshToAppendTo not provided
{
Unexpect aCatch(SALOME_SalomeException);
- TPythonDump* pyDump = new TPythonDump; // prevent dump from CreateMesh()
+ TPythonDump* pyDump = new TPythonDump(this); // prevent dump from CreateMesh()
std::unique_ptr<TPythonDump> pyDumpDeleter( pyDump );
// 1. Get source mesh
bool ok = true;
SMESH_TRY;
- TPythonDump pyDump; // prevent dump from CreateMesh()
+ TPythonDump pyDump(this); // prevent dump from CreateMesh()
theNewMesh = CreateMesh( theNewGeometry );
theNewGroups = new SMESH::ListOfGroups();
SMESH::SMESH_Mesh_var myMesh = SMESH::SMESH_Mesh::_narrow( anObject ) ;
if ( !myMesh->_is_nil() ) {
myMesh->Load(); // load from study file if not yet done
- TPythonDump pd; // not to dump GetGroups()
+ TPythonDump pd(this); // not to dump GetGroups()
SMESH::ListOfGroups_var groups = myMesh->GetGroups();
for ( CORBA::ULong i = 0; i < groups->length(); ++i )
{
return false;
}
- TPythonDump pd; // prevent dump during loading
+ TPythonDump pd(this); // prevent dump during loading
// For PAL13473 ("Repetitive mesh") implementation.
// New dependencies between SMESH objects are established:
}
return res;
}
-
-//=============================================================================
-/*!
- * SMESHEngine_factory
- *
- * C factory, accessible with dlsym, after dlopen
- */
-//=============================================================================
-
-extern "C"
-{ SMESH_I_EXPORT
- PortableServer::ObjectId* SMESHEngine_factory( CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId* contId,
- const char* instanceName,
- const char* interfaceName )
- {
- if(MYDEBUG) MESSAGE( "PortableServer::ObjectId* SMESHEngine_factory()" );
- if(MYDEBUG) SCRUTE(interfaceName);
- SMESH_Gen_i* aSMESHGen = new SMESH_Gen_i(orb, poa, contId, instanceName, interfaceName);
- return aSMESHGen->getId() ;
- }
-}