mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-26 17:30:33 +05:00
22526: SMESH 2864 - Projection and Extrusion
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.
This commit is contained in:
parent
86a1fe792f
commit
64b2fcfed1
@ -901,7 +901,9 @@ void SMESHGUI_BaseComputeOp::computeMesh()
|
||||
|
||||
// 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
|
||||
|
@ -108,6 +108,40 @@ namespace SMESH
|
||||
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)
|
||||
{
|
||||
|
@ -47,6 +47,8 @@ namespace SMESH
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
|
@ -2082,13 +2082,9 @@ void SMESHGUI_MeshOp::readMesh()
|
||||
}
|
||||
|
||||
// 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
|
||||
|
@ -1428,7 +1428,8 @@ int StdMeshers_ProjectionUtils::FindFaceAssociation(const TopoDS_Face& face1,
|
||||
// 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
|
||||
|
Loading…
Reference in New Issue
Block a user