1) Set warning mesh icon if the mesh is computed with hyp errors.
2) When edit mesh, get name of geometry from the study directly (not SO -> GEOM_Object -> SO -> name ).
3) Prevent an exception when projecting faces with many holes.
// NPAL16631: if ( !memoryLack )
{
- SMESH::ModifiedMesh(aMeshSObj, !computeFailed, myMesh->NbNodes() == 0);
+ SMESH::ModifiedMesh( aMeshSObj,
+ !computeFailed && aHypErrors.isEmpty(),
+ myMesh->NbNodes() == 0);
update( UF_ObjBrowser | UF_Model );
// SHOW MESH
return GEOM::GEOM_Object::_nil();
}
+ SMESHGUI_EXPORT char* GetGeomName( _PTR(SObject) smeshSO )
+ {
+ if (!smeshSO)
+ return 0;
+
+ _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ if (!aStudy)
+ return 0;
+
+ _PTR(ChildIterator) anIter (aStudy->NewChildIterator( smeshSO ));
+ for ( ; anIter->More(); anIter->Next()) {
+ _PTR(SObject) aSObject = anIter->Value();
+ _PTR(SObject) aRefSOClient;
+ GEOM::GEOM_Object_var aMeshShape;
+
+ if (aSObject->ReferencedObject(aRefSOClient)) {
+ SALOMEDS_SObject* aRefSO = _CAST(SObject,aRefSOClient);
+ aMeshShape = GEOM::GEOM_Object::_narrow(aRefSO->GetObject());
+ aSObject = aRefSOClient;
+ }
+ else {
+ SALOMEDS_SObject* aSO = _CAST(SObject,aSObject);
+ aMeshShape = GEOM::GEOM_Object::_narrow(aSO->GetObject());
+ }
+
+ if (!aMeshShape->_is_nil())
+ {
+ std::string name = aSObject->GetName();
+ return CORBA::string_dup( name.c_str() );
+ }
+ }
+ return 0;
+ }
+
GEOM::GEOM_Object_ptr GetSubShape (GEOM::GEOM_Object_ptr theMainShape,
long theID)
{
SMESHGUI_EXPORT GEOM::GEOM_Object_ptr GetGeom( _PTR(SObject) );
+ SMESHGUI_EXPORT char* GetGeomName( _PTR(SObject) smeshSO );
+
SMESHGUI_EXPORT GEOM::GEOM_Object_ptr GetSubShape( GEOM::GEOM_Object_ptr, long );
}
}
// Get name of geometry object
- GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
- if ( !aGeomVar->_is_nil() )
- {
- _PTR(SObject) aGeomSO = studyDS()->FindObjectID( aGeomVar->GetStudyEntry() );
- QString aShapeName = name( aGeomSO );
- myDlg->setObjectText( SMESHGUI_MeshDlg::Geom, aShapeName );
- }
+ CORBA::String_var name = SMESH::GetGeomName( pObj );
+ if ( name.in() )
+ myDlg->setObjectText( SMESHGUI_MeshDlg::Geom, name.in() );
}
// Get hypotheses and algorithms assigned to the mesh/sub-mesh
// move edge2Beg to place before edge2End
edges2.splice( edge2End, edges2, edge2Beg++ );
- if ( sameVertexUV( *edge2Beg, face2, 0, v0f1UV, vTolUV ))
+ if ( edge2Beg != edges2.end() &&
+ sameVertexUV( *edge2Beg, face2, 0, v0f1UV, vTolUV ))
{
if ( iW1 == 0 ) OK = true; // OK is for the first wire
// reverse edges2 if needed