]> SALOME platform Git repositories - plugins/netgenplugin.git/commitdiff
Salome HOME
Merge from V4_1_0_maintainance branch (from tag mergeto_BR_QT4_Dev_08Jul08)
authorvsr <vsr@opencascade.com>
Mon, 28 Jul 2008 06:29:05 +0000 (06:29 +0000)
committervsr <vsr@opencascade.com>
Mon, 28 Jul 2008 06:29:05 +0000 (06:29 +0000)
build_configure
configure.ac
resources/NETGENPlugin.xml
resources/mesh_tree_algo_netgen.png [new file with mode: 0644]
src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx
src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx
src/NETGENPlugin/NETGENPlugin_icons.po [deleted file]

index c97ecbaba48add8941b58b26534e6edd56345e7a..2fcfb1d28c3ca349faf9257aa0cbd11fa1273981 100755 (executable)
@@ -32,10 +32,10 @@ fi
 for option
 do
   case $option in
-      -with-ihm | --with-ihm)
+      -with-gui | --with-gui)
           NETGENPLUGIN_WITH_GUI="yes"
           break;;
-      -without-ihm | --without-ihm | -with-ihm=no | --with-ihm=no)
+      -without-gui | --without-gui | -with-gui=no | --with-gui=no)
           NETGENPLUGIN_WITH_GUI="no"
           break;;
   esac
index 08c096c7ed63fc52d4b72e4188daac41ef44fc5c..3b5e9a85dcf882a8dd14ae0199d824a6fd0eddb0 100644 (file)
@@ -223,19 +223,11 @@ AC_SUBST_FILE(CORBA)
 corba=make_$ORB
 CORBA=adm_local/unix/$corba
 
-NETGENPLUGIN_WITH_GUI=no
+NETGENPLUGIN_WITH_GUI=yes
 
 AM_CONDITIONAL(NETGENPLUGIN_ENABLE_GUI, [test "${NETGENPLUGIN_WITH_GUI}" = "yes"])
 
 if test "${NETGENPLUGIN_WITH_GUI}" = "yes"; then
-    echo
-    echo ---------------------------------------------
-    echo testing MSG2QM
-    echo ---------------------------------------------
-    echo
-
-    CHECK_MSG2QM
-
     echo
     echo ---------------------------------------------
     echo testing openGL
index 6135daa16edb583950db12c3789870573e8346de..4d6c0a20c72b768c41b4c5c9bca8db83ff30fac9 100644 (file)
@@ -25,7 +25,7 @@
                icon-id="mesh_algo_tetra.png"
                hypos="MaxElementVolume"
               need-geom="false"
-               input="TRIA"
+               input="TRIA,QUAD"
                dim="3"/>
     <algorithm type="NETGEN_2D"
                label-id="Netgen 1D-2D"
diff --git a/resources/mesh_tree_algo_netgen.png b/resources/mesh_tree_algo_netgen.png
new file mode 100644 (file)
index 0000000..cb75b7e
Binary files /dev/null and b/resources/mesh_tree_algo_netgen.png differ
index a474e036b136b22274d0ed90ba4a9364a2e4ec65..9a9086abd04c69e346642cc8b4b597948c4ab335 100644 (file)
@@ -114,11 +114,15 @@ bool NETGENPlugin_NETGEN_2D_ONLY::CheckHypothesis (SMESH_Mesh&         aMesh,
   _hypLengthFromEdges = 0;
   _hypQuadranglePreference = 0;
 
-  aStatus = HYP_MISSING;
-
   const list<const SMESHDS_Hypothesis*>& hyps = GetUsedHypothesis(aMesh, aShape, false);
 
-  if (hyps.empty()) return false;  // can't work with no hypothesis
+  if (hyps.empty())
+  {
+    aStatus = HYP_OK; //SMESH_Hypothesis::HYP_MISSING;
+    return true;  // (PAL13464) can work with no hypothesis, LengthFromEdges is default one
+  }
+
+  aStatus = HYP_MISSING;
 
   list<const SMESHDS_Hypothesis*>::const_iterator ith;
   for (ith = hyps.begin(); ith != hyps.end(); ++ith )
@@ -328,7 +332,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh&         aMesh,
   // --------------------
 
   double edgeLength = 0;
-  if (_hypLengthFromEdges)
+  if (_hypLengthFromEdges || !_hypLengthFromEdges && !_hypMaxElementArea)
   {
     int nbSegments = 0;
     for ( int iW = 0; iW < nbWires; ++iW )
index 66e3b9573d40823ad125cf9456ebbddbb69afd4d..e02b65fe807900ffef67a8e0d1e4a54c19801554 100644 (file)
@@ -38,6 +38,7 @@
 #include "SMESH_Gen.hxx"
 #include "SMESH_Mesh.hxx"
 #include "SMESH_MesherHelper.hxx"
+#include "StdMeshers_QuadToTriaAdaptor.hxx"
 
 #include <BRep_Tool.hxx>
 #include <TopExp.hxx>
@@ -80,6 +81,8 @@ NETGENPlugin_NETGEN_3D::NETGENPlugin_NETGEN_3D(int hypId, int studyId,
   _maxElementVolume = 0.;
 
   _hypMaxElementVolume = NULL;
+
+  _requireShape = false; // can work without shape
 }
 
 //=============================================================================
@@ -179,6 +182,9 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh&         aMesh,
   map< int, int* >::iterator shId_ngId;
   list< int > degenNgIds;
 
+  StdMeshers_QuadToTriaAdaptor Adaptor;
+  Adaptor.Compute(aMesh,aShape);
+
   for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next())
   {
     const TopoDS_Shape& aShapeFace = exp.Current();
@@ -195,20 +201,43 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh&         aMesh,
         if ( !elem )
           return error( COMPERR_BAD_INPUT_MESH, "Null element encounters");
         bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 ));
-        if ( !isTraingle )
-          return error( COMPERR_BAD_INPUT_MESH,
-                        SMESH_Comment("Not triangle element ")<<elem->GetID());
-        // keep a triangle
-        triangles.push_back( elem );
-        isReversed.push_back( isRev );
-        // put elem nodes to nodeToNetgenID map
-        SMDS_ElemIteratorPtr triangleNodesIt = elem->nodesIterator();
-        while ( triangleNodesIt->more() ) {
-         const SMDS_MeshNode * node =
-            static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
-          if(myTool->IsMedium(node))
-            continue;
-          nodeToNetgenID.insert( make_pair( node, invalid_ID ));
+        if ( !isTraingle ) {
+          //return error( COMPERR_BAD_INPUT_MESH,
+          //              SMESH_Comment("Not triangle element ")<<elem->GetID());
+          // using adaptor
+          std::list<const SMDS_FaceOfNodes*> faces = Adaptor.GetTriangles(elem);
+          if(faces.size()==0) {
+            return error( COMPERR_BAD_INPUT_MESH,
+                          SMESH_Comment("Not triangles in adaptor for element ")<<elem->GetID());
+          }
+          std::list<const SMDS_FaceOfNodes*>::iterator itf = faces.begin();
+          for(; itf!=faces.end(); itf++ ) {
+            triangles.push_back( (*itf) );
+            isReversed.push_back( isRev );
+            // put triange's nodes to nodeToNetgenID map
+            SMDS_ElemIteratorPtr triangleNodesIt = (*itf)->nodesIterator();
+            while ( triangleNodesIt->more() ) {
+              const SMDS_MeshNode * node =
+                static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
+              if(myTool->IsMedium(node))
+                continue;
+              nodeToNetgenID.insert( make_pair( node, invalid_ID ));
+            }
+          }
+        }
+        else {
+          // keep a triangle
+          triangles.push_back( elem );
+          isReversed.push_back( isRev );
+          // put elem nodes to nodeToNetgenID map
+          SMDS_ElemIteratorPtr triangleNodesIt = elem->nodesIterator();
+          while ( triangleNodesIt->more() ) {
+            const SMDS_MeshNode * node =
+              static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
+            if(myTool->IsMedium(node))
+              continue;
+            nodeToNetgenID.insert( make_pair( node, invalid_ID ));
+          }
         }
 #ifdef _DEBUG_
         // check if a trainge is degenerated
@@ -413,30 +442,51 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
   else if (MeshType == SMESH_MesherHelper::QUADRATIC)
     _quadraticMesh = true;
     
-  SMDS_FaceIteratorPtr iteratorFace = MeshDS->facesIterator();
+  StdMeshers_QuadToTriaAdaptor Adaptor;
+  Adaptor.Compute(aMesh);
 
-  while(iteratorFace->more())
-  {
+  SMDS_FaceIteratorPtr iteratorFace = MeshDS->facesIterator();
+  while(iteratorFace->more()) {
     // check element
     const SMDS_MeshElement* elem = iteratorFace->next();
     if ( !elem )
       return error( COMPERR_BAD_INPUT_MESH, "Null element encounters");
     bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 ));
-    if ( !isTraingle )
-      return error( COMPERR_BAD_INPUT_MESH,
-                    SMESH_Comment("Not triangle element ")<<elem->GetID());
-    
-    // keep a triangle
-    triangles.push_back( elem );
-    // put elem nodes to nodeToNetgenID map
-    SMDS_ElemIteratorPtr triangleNodesIt = elem->nodesIterator();
-    while ( triangleNodesIt->more() ) {
-      const SMDS_MeshNode * node =
-        static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
-      if(aHelper->IsMedium(node))
-        continue;
-      
-      nodeToNetgenID.insert( make_pair( node, invalid_ID ));
+    if ( !isTraingle ) {
+      //return error( COMPERR_BAD_INPUT_MESH,
+      //              SMESH_Comment("Not triangle element ")<<elem->GetID());
+      // using adaptor
+      std::list<const SMDS_FaceOfNodes*> faces = Adaptor.GetTriangles(elem);
+      if(faces.size()==0) {
+        return error( COMPERR_BAD_INPUT_MESH,
+                      SMESH_Comment("Not triangles in adaptor for element ")<<elem->GetID());
+      }
+      std::list<const SMDS_FaceOfNodes*>::iterator itf = faces.begin();
+      for(; itf!=faces.end(); itf++ ) {
+        triangles.push_back( (*itf) );
+        // put triange's nodes to nodeToNetgenID map
+        SMDS_ElemIteratorPtr triangleNodesIt = (*itf)->nodesIterator();
+        while ( triangleNodesIt->more() ) {
+          const SMDS_MeshNode * node =
+            static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
+          if(aHelper->IsMedium(node))
+            continue;
+          nodeToNetgenID.insert( make_pair( node, invalid_ID ));
+        }
+      }
+    }
+    else {
+      // keep a triangle
+      triangles.push_back( elem );
+      // put elem nodes to nodeToNetgenID map
+      SMDS_ElemIteratorPtr triangleNodesIt = elem->nodesIterator();
+      while ( triangleNodesIt->more() ) {
+        const SMDS_MeshNode * node =
+          static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
+        if(aHelper->IsMedium(node))
+          continue;
+        nodeToNetgenID.insert( make_pair( node, invalid_ID ));
+      }
     }
   }
 
diff --git a/src/NETGENPlugin/NETGENPlugin_icons.po b/src/NETGENPlugin/NETGENPlugin_icons.po
deleted file mode 100644 (file)
index a3f6297..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# This is a Qt message file in .po format.  Each msgid starts with
-# a scope.  This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-
-#-----------------------------------------------------------
-# ObjectBrowser
-#-----------------------------------------------------------
-
-#mesh_tree_algo_netgen
-msgid "ICON_SMESH_TREE_ALGO_NETGEN_3D"
-msgstr "mesh_tree_algo_tetra.png"
-#msgstr "mesh_tree_algo_netgen.png"