Salome HOME
0020743: EDF 1271 SMESH : Create a mesh from a group / FindElementByPoint() on groups
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_StandardMeshInfosDlg.cxx
index 4b7540fc06b2282b6dc7b19bc2523d79374fe9c8..ea81f7eb24d374f43363d45767238a8e3f7787e8 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // SMESH SMESHGUI : GUI for SMESH component
 // File   : SMESHGUI_StandardMeshInfosDlg.cxx
 // Author : Michael ZORIN, Open CASCADE S.A.S.
@@ -203,20 +204,20 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
       int aDimension = 0;
       double aNbDimElements = 0;
       if (aNbVolumes > 0) {
-       aNbDimElements = aNbVolumes;
-       aDimension = 3;
+        aNbDimElements = aNbVolumes;
+        aDimension = 3;
       }
       else if(aNbFaces > 0) {
-       aNbDimElements = aNbFaces;
-       aDimension = 2;
+        aNbDimElements = aNbFaces;
+        aDimension = 2;
       }
       else if(aNbEdges > 0) {
-       aNbDimElements = aNbEdges;
-       aDimension = 1;
+        aNbDimElements = aNbEdges;
+        aDimension = 1;
       }
       else if(aNbNodes > 0) {
-       aNbDimElements = aNbNodes;
-       aDimension = 0;
+        aNbDimElements = aNbNodes;
+        aDimension = 0;
       }
 
       // information about the mesh
@@ -234,15 +235,15 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
       aMeshSO->FindSubObject(SMESH::Tag_NodeGroups, anObj);
       if (anObj) {
         _PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
-       if (it->More()) {
+        if (it->More()) {
           anInfo.append(QString("Groups:<br><br>"));
           hasGroup = true;
         }
-       for ( ; it->More(); it->Next()) {
+        for ( ; it->More(); it->Next()) {
           _PTR(SObject) subObj = it->Value();
           CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
-         SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
-         if (!aGroup->_is_nil()) {
+          SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
+          if (!aGroup->_is_nil()) {
             anInfo.append(QString("-   <b>%1</b><br>").arg(aGroup->GetName()));
             anInfo.append(QString("%1<br>").arg("on nodes"));
             anInfo.append(QString("%1<br>").arg(aGroup->Size()));
@@ -259,7 +260,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
               anInfo.append(QString("<br>"));
             }
           }
-       }
+        }
       }
 
       // info about groups on edges
@@ -271,11 +272,11 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
           anInfo.append(QString("Groups:<br><br>"));
           hasGroup = true;
         }
-       for ( ; it->More(); it->Next()) {
+        for ( ; it->More(); it->Next()) {
           _PTR(SObject) subObj = it->Value();
           CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
-         SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
-         if (!aGroup->_is_nil()) {
+          SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
+          if (!aGroup->_is_nil()) {
             anInfo.append(QString("-   <b>%1</b><br>").arg(aGroup->GetName()));
             anInfo.append(QString("%1<br>").arg("on edges"));
             anInfo.append(QString("%1<br>").arg(aGroup->Size()));
@@ -292,7 +293,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
               anInfo.append(QString("<br>"));
             }
           }
-       }
+        }
       }
 
       // info about groups on faces
@@ -300,15 +301,15 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
       aMeshSO->FindSubObject(SMESH::Tag_FaceGroups, anObj);
       if (anObj) {
         _PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
-       if (!hasGroup && it->More()) {
+        if (!hasGroup && it->More()) {
           anInfo.append(QString("Groups:<br><br>"));
           hasGroup = true;
         }
-       for ( ; it->More(); it->Next()) {
+        for ( ; it->More(); it->Next()) {
           _PTR(SObject) subObj = it->Value();
           CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
-         SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
-         if (!aGroup->_is_nil()) {
+          SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
+          if (!aGroup->_is_nil()) {
             anInfo.append(QString("-   <b>%1</b><br>").arg(aGroup->GetName()));
             anInfo.append(QString("%1<br>").arg("on faces"));
             anInfo.append(QString("%1<br>").arg(aGroup->Size()));
@@ -325,7 +326,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
               anInfo.append(QString("<br>"));
             }
           }
-       }
+        }
       }
 
       // info about groups on volumes
@@ -333,13 +334,13 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
       aMeshSO->FindSubObject(SMESH::Tag_VolumeGroups, anObj);
       if (anObj) {
         _PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
-       if (!hasGroup && it->More())
+        if (!hasGroup && it->More())
           anInfo.append(QString("Groups:<br>"));
-       for ( ; it->More(); it->Next()) {
+        for ( ; it->More(); it->Next()) {
           _PTR(SObject) subObj = it->Value();
           CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
-         SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
-         if (!aGroup->_is_nil()) {
+          SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
+          if (!aGroup->_is_nil()) {
             anInfo.append(QString("-   <b>%1</b><br>").arg(aGroup->GetName()));
             anInfo.append(QString("%1<br>").arg("on volumes"));
             anInfo.append(QString("%1<br>").arg(aGroup->Size()));
@@ -356,7 +357,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos()
               anInfo.append(QString("<br>"));
             }
           }
-       }
+        }
       }
 
       myInfo->setText(anInfo);
@@ -448,10 +449,10 @@ void SMESHGUI_StandardMeshInfosDlg::onHelp()
     platform = "application";
 #endif
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
-                            tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                            arg(app->resourceMgr()->stringValue("ExternalBrowser",
-                                                                platform)).
-                            arg(myHelpFileName));
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser",
+                                                                 platform)).
+                             arg(myHelpFileName));
   }
 }