else
newFaces.Append( myLastCreatedElems(i) );
}
+ // get segments adjacent to merged nodes
+ TListOfListOfNodes::iterator groupIt = nodeGroupsToMerge.begin();
+ for ( ; groupIt != nodeGroupsToMerge.end(); groupIt++ )
+ {
+ const list<const SMDS_MeshNode*>& nodes = *groupIt;
+ SMDS_ElemIteratorPtr segIt = nodes.front()->GetInverseElementIterator( SMDSAbs_Edge );
+ while ( segIt->more() )
+ segments.insert( segIt->next() );
+ }
+
// find coincident
TListOfListOfElementsID equalGroups;
if ( !segments.empty() )
myDlg->myGroupListCmBox->clear();
myDlg->myGroupListCmBox->addItem( QString() );
if ( !myIO.IsNull() && myIO->hasEntry()) {
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- _PTR(SObject) meshSO = aStudy->FindObjectID( myIO->getEntry() );
+ SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO( myIO );
+ _PTR(SObject) meshSO = SMESH::ObjectToSObject( mesh );
_PTR(SObject) group0DRoot;
- if ( meshSO->FindSubObject( SMESH::Tag_0DElementsGroups, group0DRoot ))
+ if ( meshSO && meshSO->FindSubObject( SMESH::Tag_0DElementsGroups, group0DRoot ))
{
+ _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
_PTR(ChildIterator) group0DIter = aStudy->NewChildIterator( group0DRoot );
for ( ; group0DIter->More(); group0DIter->Next() )
{
{
SMESH::SMESH_IDSource_var obj = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
if ( !CORBA::is_nil( obj ) ) {
- myBaseInfo->showInfo( obj );
- myAddInfo->showInfo( obj );
+ myAddInfo->showInfo( obj ); // nb of nodes in a group can be computed by myAddInfo,
+ myBaseInfo->showInfo( obj ); // and it will be used by myBaseInfo (IPAL52871)
myCtrlInfo->showInfo( obj );
myActor = SMESH::FindActorByEntry( IO->getEntry() );
{
//id_mesh->second->AddProcessedCmd( aCommand );
+ // Wrap Export*() into try-except
+ if ( aCommand->MethodStartsFrom("Export"))
+ {
+ _AString tab = "\t";
+ _AString indent = aCommand->GetIndentation();
+ _AString tryStr = indent + "try:";
+ _AString newCmd = indent + tab + ( aCommand->GetString().ToCString() + indent.Length() );
+ _AString excStr = indent + "except:";
+ _AString msgStr = indent + "\tprint '"; msgStr += method + "() failed. Invalid file name?'";
+
+ myCommands.insert( --myCommands.end(), new _pyCommand( tryStr, myNbCommands ));
+ aCommand->Clear();
+ aCommand->GetString() = newCmd;
+ aCommand->SetOrderNb( ++myNbCommands );
+ myCommands.push_back( new _pyCommand( excStr, ++myNbCommands ));
+ myCommands.push_back( new _pyCommand( msgStr, ++myNbCommands ));
+ }
// check for mesh editor object
if ( aCommand->GetMethod() == "GetMeshEditor" ) { // MeshEditor creation
_pyID editorID = aCommand->GetResultValue();
}
}
// ----------------------------------------------------------------------
+ else if ( method == "GetSubMeshes" ) { // clear as the command does nothing (0023156)
+ theCommand->Clear();
+ }
+ // ----------------------------------------------------------------------
else if ( method == "AddHypothesis" ) { // mesh.AddHypothesis(geom, HYPO )
myAddHypCmds.push_back( theCommand );
// set mesh to hypo
TCollection_AsciiString _pyCommand::GetIndentation()
{
int end = 1;
- if ( GetBegPos( RESULT_IND ) == UNKNOWN )
- GetWord( myString, end, true );
- else
- end = GetBegPos( RESULT_IND );
- return myString.SubString( 1, Max( end - 1, 1 ));
+ while ( end <= Length() && isblank( myString.Value( end )))
+ ++end;
+ return ( end == 1 ) ? _AString("") : myString.SubString( 1, end - 1 );
}
//================================================================================
if ( GetBegPos( METHOD_IND ) == UNKNOWN )
{
// beginning
- int begPos = GetBegPos( OBJECT_IND ) + myObj.Length();
+ int begPos = GetBegPos( OBJECT_IND );
bool forward = true;
if ( begPos < 1 ) {
begPos = myString.Location( "(", 1, Length() ) - 1;
forward = false;
}
+ else {
+ begPos += myObj.Length();
+ }
// store
myMeth = GetWord( myString, begPos, forward );
SetBegPos( METHOD_IND, begPos );