#include "SMESH_Gen_i.hxx"#include "SMESH_Mesh_i.hxx"#include "SMESH_Hypothesis_i.hxx"#include "SMESH_Algo_i.hxx"#include "SMESH_Group_i.hxx"#include "SMESH_subMesh_i.hxx"#include <CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)>#include "utilities.h"#include "Utils_ExceptHandlers.hxx"#include <TCollection_AsciiString.hxx>
Go to the source code of this file.
Functions | |
| template<typename T > | |
| static T * | objectToServant (CORBA::Object_ptr theIOR) |
| static SALOMEDS::SObject_ptr | publish (SALOMEDS::Study_ptr theStudy, CORBA::Object_ptr theIOR, SALOMEDS::SObject_ptr theFatherObject, const int theTag=0, const char *thePixMap=0, const bool theSelectable=true) |
| static void | addReference (SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theToObject, int theTag=0) |
| static long | findMaxChildTag (SALOMEDS::SObject_ptr theSObject) |
| findMaxChildTag [ static internal ] | |
Variables | |
| static int | MYDEBUG = 0 |
| static int | VARIABLE_DEBUG = 0 |
| static void addReference | ( | SALOMEDS::Study_ptr | theStudy, |
| SALOMEDS::SObject_ptr | theSObject, | ||
| CORBA::Object_ptr | theToObject, | ||
| int | theTag = 0 |
||
| ) | [static] |
Definition at line 332 of file SMESH_Gen_i_1.cxx.
References SMESH_Gen_i.ObjectToSObject().
Referenced by SMESH_Gen_i.AddHypothesisToShape(), SMESH_Gen_i.PublishGroup(), SMESH_Gen_i.PublishMesh(), and SMESH_Gen_i.PublishSubMesh().
{
SALOMEDS::SObject_var aToObjSO = SMESH_Gen_i::ObjectToSObject( theStudy, theToObject );
if ( !aToObjSO->_is_nil() && !theSObject->_is_nil() ) {
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
SALOMEDS::SObject_var aReferenceSO;
if ( !theTag ) {
// check if the reference to theToObject already exists
// and find a free label for the reference object
bool isReferred = false;
int tag = 1;
SALOMEDS::ChildIterator_var anIter = theStudy->NewChildIterator( theSObject );
for ( ; !isReferred && anIter->More(); anIter->Next(), ++tag ) {
if ( anIter->Value()->ReferencedObject( aReferenceSO )) {
if ( strcmp( aReferenceSO->GetID(), aToObjSO->GetID() ) == 0 )
isReferred = true;
}
else if ( !theTag ) {
SALOMEDS::GenericAttribute_var anAttr;
if ( !anIter->Value()->FindAttribute( anAttr, "AttributeIOR" ))
theTag = tag;
}
}
if ( isReferred )
return;
if ( !theTag )
theTag = tag;
}
if ( !theSObject->FindSubObject( theTag, aReferenceSO ))
aReferenceSO = aStudyBuilder->NewObjectToTag( theSObject, theTag );
aStudyBuilder->Addreference( aReferenceSO, aToObjSO );
}
}
| static long findMaxChildTag | ( | SALOMEDS::SObject_ptr | theSObject | ) | [static] |
findMaxChildTag [ static internal ]
Finds maximum child tag for the given object
Definition at line 467 of file SMESH_Gen_i_1.cxx.
Referenced by SMESH_Gen_i.PublishMesh().
{
long aTag = 0;
if ( !theSObject->_is_nil() ) {
SALOMEDS::Study_var aStudy = theSObject->GetStudy();
if ( !aStudy->_is_nil() ) {
SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator( theSObject );
for ( ; anIter->More(); anIter->Next() ) {
long nTag = anIter->Value()->Tag();
if ( nTag > aTag )
aTag = nTag;
}
}
}
return aTag;
}
| static T* objectToServant | ( | CORBA::Object_ptr | theIOR | ) | [static] |
Definition at line 200 of file SMESH_Gen_i_1.cxx.
References SMESH_Gen_i.GetServant().
{
return dynamic_cast<T*>( SMESH_Gen_i::GetServant( theIOR ).in() );
}
| static SALOMEDS::SObject_ptr publish | ( | SALOMEDS::Study_ptr | theStudy, |
| CORBA::Object_ptr | theIOR, | ||
| SALOMEDS::SObject_ptr | theFatherObject, | ||
| const int | theTag = 0, |
||
| const char * | thePixMap = 0, |
||
| const bool | theSelectable = true |
||
| ) | [static] |
Definition at line 247 of file SMESH_Gen_i_1.cxx.
References SMESH_Gen_i.GetORB(), and SMESH_Gen_i.ObjectToSObject().
Referenced by SMESH_Gen_i.AddHypothesisToShape(), SMESH_Gen_i.PublishGroup(), SMESH_Gen_i.PublishHypothesis(), SMESH_Gen_i.PublishMesh(), and SMESH_Gen_i.PublishSubMesh().
{
SALOMEDS::SObject_var SO = SMESH_Gen_i::ObjectToSObject( theStudy, theIOR );
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
if ( SO->_is_nil() ) {
if ( theTag == 0 )
SO = aStudyBuilder->NewObject( theFatherObject );
else if ( !theFatherObject->FindSubObject( theTag, SO ))
SO = aStudyBuilder->NewObjectToTag( theFatherObject, theTag );
}
SALOMEDS::GenericAttribute_var anAttr;
if ( !CORBA::is_nil( theIOR )) {
anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributeIOR" );
CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theIOR );
SALOMEDS::AttributeIOR::_narrow(anAttr)->SetValue( objStr.in() );
}
if ( thePixMap ) {
anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributePixMap" );
SALOMEDS::AttributePixMap_var pm = SALOMEDS::AttributePixMap::_narrow( anAttr );
pm->SetPixMap( thePixMap );
}
if ( !theSelectable ) {
anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributeSelectable" );
SALOMEDS::AttributeSelectable::_narrow( anAttr )->SetSelectable( false );
}
return SO._retn();
}
Definition at line 47 of file SMESH_Gen_i_1.cxx.
int VARIABLE_DEBUG = 0 [static] |
Definition at line 48 of file SMESH_Gen_i_1.cxx.