From adc76cf234693fd9a7bb24ea76b6f43eb0bc7b9b Mon Sep 17 00:00:00 2001 From: dmv Date: Thu, 21 May 2009 13:09:36 +0000 Subject: [PATCH] 0020104: EDF 861 SMESH : Mesh element info evolution --- src/SMESHGUI/SMESHGUI_WhatIsDlg.cxx | 48 ++++++++++++++++++++--------- src/SMESHGUI/SMESH_msg_en.ts | 4 +++ 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_WhatIsDlg.cxx b/src/SMESHGUI/SMESHGUI_WhatIsDlg.cxx index 2e62e9c5c..1af954d48 100755 --- a/src/SMESHGUI/SMESHGUI_WhatIsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_WhatIsDlg.cxx @@ -136,7 +136,7 @@ SMESHGUI_WhatIsDlg::SMESHGUI_WhatIsDlg( SMESHGUI* theModule ) // information text browser Info = new QTextBrowser(GroupArguments); - Info->setMinimumSize(200, 150); + Info->setMinimumSize(300, 200); GroupArgumentsLayout->addWidget(Info, 1, 0, 1, 2); /***************************************************************/ @@ -439,19 +439,19 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument() myActor->GetObject()->GetMesh()->FindElement(aString.toInt()); if (e) { QString anInfo; - anInfo=tr("ENTITY_TYPE") + ": "; + anInfo="" + tr("ENTITY_TYPE") + ": "; if(e->GetType() == SMDSAbs_Node) { - anInfo+=tr("MESH_NODE")+"\n"; + anInfo+=tr("MESH_NODE")+"
"; //const SMDS_MeshNode *en = (SMDS_MeshNode*) e; // VSR: not used! } else if(e->GetType() == SMDSAbs_Edge) { - anInfo+=tr("SMESH_EDGE")+"\n"; - anInfo+=tr("SMESH_MESHINFO_TYPE")+": "; + anInfo+=tr("SMESH_EDGE")+"
"; + anInfo+="" + tr("SMESH_MESHINFO_TYPE")+": "; const SMDS_MeshEdge *ee = (SMDS_MeshEdge*) e; - anInfo+=(ee->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+"\n"; + anInfo+=(ee->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+"
"; } else if(e->GetType() == SMDSAbs_Face) { const SMDS_MeshFace *ef = (SMDS_MeshFace*) e; - anInfo+=tr("SMESH_FACE")+"\n"; - anInfo+=tr("SMESH_MESHINFO_TYPE")+": "; + anInfo+=tr("SMESH_FACE")+"
"; + anInfo+="" + tr("SMESH_MESHINFO_TYPE")+": "; if(!ef->IsPoly()) anInfo+=(ef->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" "; switch(ef->NbNodes()) { @@ -470,10 +470,10 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument() default: break; } - anInfo+="\n"; + anInfo+="
"; } else if(e->GetType() == SMDSAbs_Volume) { - anInfo+=tr("SMESH_VOLUME")+"\n"; - anInfo+=tr("SMESH_MESHINFO_TYPE")+": "; + anInfo+=tr("SMESH_VOLUME")+"
"; + anInfo+="" + tr("SMESH_MESHINFO_TYPE")+": "; const SMDS_MeshVolume *ev = (SMDS_MeshVolume*) e; SMDS_VolumeTool vt(ev); if(vt.GetVolumeType() != SMDS_VolumeTool::POLYHEDA) @@ -511,19 +511,37 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument() default: break; } - anInfo+="\n"; + anInfo+="
"; } - if(e->GetType() != SMDSAbs_Node) - anInfo+=tr("GRAVITY_CENTER") + ":\n"; gp_XYZ anXYZ(0.,0.,0.); SMDS_ElemIteratorPtr nodeIt = e->nodesIterator(); int nbNodes = 0; + QString aNodesInfo=""; for( ; nodeIt->more(); nbNodes++) { const SMDS_MeshNode* node = static_cast( nodeIt->next() ); anXYZ.Add( gp_XYZ( node->X(), node->Y(), node->Z() ) ); + if(e->GetType() != SMDSAbs_Node) + aNodesInfo+=QString("Node %1:
Id=%2, X=%3, Y=%4, Z=%5
").arg(nbNodes+1).arg(node->GetID()).arg(node->X()).arg(node->Y()).arg(node->Z()); + // Calculate Connectivity + SMDS_ElemIteratorPtr it = node->GetInverseElementIterator(); + if (it) { + aNodesInfo+="" + tr("CONNECTED_ELEMENTS") + ":"; + while (it->more()) { + const SMDS_MeshElement* elem = it->next(); + aNodesInfo+=QString(" %1").arg(elem->GetID()); + } + if ( (nbNodes+1) != e->NbNodes()) + aNodesInfo+=QString("

"); + } } + if(e->GetType() != SMDSAbs_Node) + anInfo+="" + tr("GRAVITY_CENTER") + ":
"; anXYZ.Divide(e->NbNodes()); - anInfo+=QString("X=%1\nY=%2\nZ=%3\n").arg(anXYZ.X()).arg(anXYZ.Y()).arg(anXYZ.Z()); + anInfo+=QString("X=%1, Y=%2, Z=%3").arg(anXYZ.X()).arg(anXYZ.Y()).arg(anXYZ.Z()); + if(e->GetType() != SMDSAbs_Node) + anInfo+="
"; + if (aNodesInfo!="") + anInfo+= "
" + aNodesInfo; Info->setText(anInfo); } diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index e05a92a19..5dc4629bc 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -4698,6 +4698,10 @@ It is impossible to read point coordinates from file GRAVITY_CENTER Gravity center + + CONNECTED_ELEMENTS + Connected With Elements + SMESHGUI_FileInfoDlg -- 2.39.2