Salome HOME
typo-fix by Kunda + minor changes
authoreap <eap@opencascade.com>
Tue, 28 Nov 2017 11:15:48 +0000 (14:15 +0300)
committereap <eap@opencascade.com>
Tue, 28 Nov 2017 11:15:48 +0000 (14:15 +0300)
23 files changed:
doc/salome/examples/grouping_elements_ex03.py
doc/salome/gui/SMESH/input/smesh_migration.doc
idl/SMESH_Mesh.idl
src/Controls/SMESH_Controls.cxx
src/Controls/SMESH_ControlsDef.hxx
src/SMESH/SMESH_Algo.cxx
src/SMESH/SMESH_Mesh.cxx
src/SMESH/SMESH_MesherHelper.cxx
src/SMESH/SMESH_MesherHelper.hxx
src/SMESH/SMESH_ProxyMesh.cxx
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
src/SMESHGUI/SMESHGUI_Operations.h
src/SMESHUtils/SMESH_FillHole.cxx
src/SMESHUtils/SMESH_TypeDefs.hxx
src/SMESH_I/SMESH_2smeshpy.cxx
src/SMESH_I/SMESH_Gen_i.cxx
src/SMESH_SWIG/StdMeshersBuilder.py
src/SMESH_SWIG/smeshBuilder.py
src/StdMeshers/StdMeshers_AutomaticLength.cxx
src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx
src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx
src/Tools/padder/meshjob/impl/MeshJobManager_i.hxx

index bd85e09e05f55d79c3648a2f95121eb61eaf5ade..abe275c64e28993bc54fb01b3df622fd208f78e6 100644 (file)
@@ -28,22 +28,22 @@ critaria = [ \
     ]
 filt = smesh.GetFilterFromCriteria( critaria )
 filtGroup = mesh.GroupOnFilter( SMESH.FACE, "group on filter", filt )
-print "Group on filter contains %s elemens" % filtGroup.Size()
+print "Group on filter contains %s elements" % filtGroup.Size()
 
 # group on filter is updated if the mesh is modified
 hyp1D.SetStartLength( 2.5 )
 hyp1D.SetEndLength( 2.5 )
 mesh.Compute()
-print "After mesh change, group on filter contains %s elemens" % filtGroup.Size()
+print "After mesh change, group on filter contains %s elements" % filtGroup.Size()
 
 # set a new filter defining the group
 filt2 = smesh.GetFilter( SMESH.FACE, SMESH.FT_RangeOfIds, "1-50" )
 filtGroup.SetFilter( filt2 )
-print "With a new filter, group on filter contains %s elemens" % filtGroup.Size()
+print "With a new filter, group on filter contains %s elements" % filtGroup.Size()
 
 # group is updated at modification of the filter
 filt2.SetCriteria( [ smesh.GetCriterion( SMESH.FACE, SMESH.FT_RangeOfIds, "1-70" )])
 filtIDs3 = filtGroup.GetIDs()
-print "After filter modification, group on filter contains %s elemens" % filtGroup.Size()
+print "After filter modification, group on filter contains %s elements" % filtGroup.Size()
 
 salome.sg.updateObjBrowser(True)
index 3713fae3752f9ace9d6ba3d5003cc71eba043e98..f869fd16d6975d867394a1b7ed45538490c782e4 100644 (file)
@@ -31,7 +31,7 @@ smesh =  smeshBuilder.New(salome.myStudy)
 
 
 <b> Of course, <em>from smesh import *</em> is no more possible.</b>
-\n You have to explicitely write <em>smesh.some_method()</em>.
+\n You have to explicitly write <em>smesh.some_method()</em>.
 
 <b>All algorithms have been transferred from the namespace <em>smesh</em> to the namespace <em>smeshBuilder</em>.</b>
 \n For instance:
@@ -79,7 +79,7 @@ is replaced by:
 Compound1 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
 \endcode
 
-<b>If you need to import a %SMESH Plugin explicitely, keep in mind that  they are now located in separate namespaces.</b>
+<b>If you need to import a %SMESH Plugin explicitly, keep in mind that they are now located in separate namespaces.</b>
 \n For instance:
 \code
 import StdMeshers
index f3feeaea385f47448b350298f81d6c3bda35356c..fbb9430d3bd0e31a8c70ee2f31a76f266579045f 100644 (file)
@@ -551,7 +551,7 @@ module SMESH
       raises (SALOME::SALOME_Exception);
 
     /*!
-     * Remove an hypothesis previouly added with AddHypothesis.
+     * Remove an hypothesis previously added with AddHypothesis.
      */
     Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
                                        in SMESH_Hypothesis anHyp)
@@ -734,7 +734,7 @@ module SMESH
     double GetComputeProgress();
 
     /*!
-     * Get informations about mesh contents
+     * Get information about mesh contents
      */
     long NbNodes()
       raises (SALOME::SALOME_Exception);
index aa1eb5eaadbb63f1bf1c4e13870256a25fd92380..13a2a0008a8ecfa2845b68459e4467f1b35775dc 100644 (file)
@@ -45,6 +45,7 @@
 #include <BRepClass3d_SolidClassifier.hxx>
 #include <BRepClass_FaceClassifier.hxx>
 #include <BRep_Tool.hxx>
+#include <GeomLib_IsPlanarSurface.hxx>
 #include <Geom_CylindricalSurface.hxx>
 #include <Geom_Plane.hxx>
 #include <Geom_Surface.hxx>
@@ -98,6 +99,15 @@ namespace {
       v2.Magnitude() < gp::Resolution() ? 0 : v1.Angle( v2 );
   }
 
+  inline double getCos2( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
+  {
+    gp_Vec v1( P1 - P2 ), v2( P3 - P2 );
+    double dot = v1 * v2, len1 = v1.SquareMagnitude(), len2 = v2.SquareMagnitude();
+
+    return ( len1 < gp::Resolution() || len2 < gp::Resolution() ? -1 :
+             dot * dot / len1 / len2 );
+  }
+
   inline double getArea( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
   {
     gp_Vec aVec1( P2 - P1 );
@@ -713,21 +723,25 @@ SMDSAbs_ElementType MaxElementLength3D::GetType() const
 
 double MinimumAngle::GetValue( const TSequenceOfXYZ& P )
 {
-  double aMin;
-
-  if (P.size() <3)
+  if ( P.size() < 3 )
     return 0.;
 
-  aMin = getAngle(P( P.size() ), P( 1 ), P( 2 ));
-  aMin = Min(aMin,getAngle(P( P.size()-1 ), P( P.size() ), P( 1 )));
+  double aMaxCos2;
+
+  aMaxCos2 = getCos2( P( P.size() ), P( 1 ), P( 2 ));
+  aMaxCos2 = Max( aMaxCos2, getCos2( P( P.size()-1 ), P( P.size() ), P( 1 )));
 
   for ( size_t i = 2; i < P.size(); i++ )
   {
-    double A0 = getAngle( P( i-1 ), P( i ), P( i+1 ) );
-    aMin = Min(aMin,A0);
+    double A0 = getCos2( P( i-1 ), P( i ), P( i+1 ) );
+    aMaxCos2 = Max( aMaxCos2, A0 );
   }
+  if ( aMaxCos2 <= 0 )
+    return 0; // all nodes coincide
 
-  return aMin * 180.0 / M_PI;
+  double cos = sqrt( aMaxCos2 );
+  if ( cos >=  1 ) return 0;
+  return acos( cos ) * 180.0 / M_PI;
 }
 
 double MinimumAngle::GetBadRate( double Value, int nbNodes ) const
@@ -786,58 +800,51 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
 
   if ( nbNodes == 3 ) {
     // Compute lengths of the sides
-    std::vector< double > aLen (nbNodes);
-    for ( int i = 0; i < nbNodes - 1; i++ )
-      aLen[ i ] = getDistance( P( i + 1 ), P( i + 2 ) );
-    aLen[ nbNodes - 1 ] = getDistance( P( 1 ), P( nbNodes ) );
+    double aLen1 = getDistance( P( 1 ), P( 2 ));
+    double aLen2 = getDistance( P( 2 ), P( 3 ));
+    double aLen3 = getDistance( P( 3 ), P( 1 ));
     // Q = alfa * h * p / S, where
     //
     // alfa = sqrt( 3 ) / 6
     // h - length of the longest edge
     // p - half perimeter
     // S - triangle surface
-    const double alfa = sqrt( 3. ) / 6.;
-    double maxLen = Max( aLen[ 0 ], Max( aLen[ 1 ], aLen[ 2 ] ) );
-    double half_perimeter = ( aLen[0] + aLen[1] + aLen[2] ) / 2.;
-    double anArea = getArea( P( 1 ), P( 2 ), P( 3 ) );
+    const double     alfa = sqrt( 3. ) / 6.;
+    double         maxLen = Max( aLen1, Max( aLen2, aLen3 ));
+    double half_perimeter = ( aLen1 + aLen2 + aLen3 ) / 2.;
+    double         anArea = getArea( P( 1 ), P( 2 ), P( 3 ));
     if ( anArea <= theEps  )
       return theInf;
     return alfa * maxLen * half_perimeter / anArea;
   }
   else if ( nbNodes == 6 ) { // quadratic triangles
     // Compute lengths of the sides
-    std::vector< double > aLen (3);
-    aLen[0] = getDistance( P(1), P(3) );
-    aLen[1] = getDistance( P(3), P(5) );
-    aLen[2] = getDistance( P(5), P(1) );
-    // Q = alfa * h * p / S, where
-    //
-    // alfa = sqrt( 3 ) / 6
-    // h - length of the longest edge
-    // p - half perimeter
-    // S - triangle surface
-    const double alfa = sqrt( 3. ) / 6.;
-    double maxLen = Max( aLen[ 0 ], Max( aLen[ 1 ], aLen[ 2 ] ) );
-    double half_perimeter = ( aLen[0] + aLen[1] + aLen[2] ) / 2.;
-    double anArea = getArea( P(1), P(3), P(5) );
+    double aLen1 = getDistance( P( 1 ), P( 3 ));
+    double aLen2 = getDistance( P( 3 ), P( 5 ));
+    double aLen3 = getDistance( P( 5 ), P( 1 ));
+    // algo same as for the linear triangle
+    const double     alfa = sqrt( 3. ) / 6.;
+    double         maxLen = Max( aLen1, Max( aLen2, aLen3 ));
+    double half_perimeter = ( aLen1 + aLen2 + aLen3 ) / 2.;
+    double         anArea = getArea( P( 1 ), P( 3 ), P( 5 ));
     if ( anArea <= theEps )
       return theInf;
     return alfa * maxLen * half_perimeter / anArea;
   }
   else if( nbNodes == 4 ) { // quadrangle
     // Compute lengths of the sides
-    std::vector< double > aLen (4);
+    double aLen[4];
     aLen[0] = getDistance( P(1), P(2) );
     aLen[1] = getDistance( P(2), P(3) );
     aLen[2] = getDistance( P(3), P(4) );
     aLen[3] = getDistance( P(4), P(1) );
     // Compute lengths of the diagonals
-    std::vector< double > aDia (2);
+    double aDia[2];
     aDia[0] = getDistance( P(1), P(3) );
     aDia[1] = getDistance( P(2), P(4) );
     // Compute areas of all triangles which can be built
     // taking three nodes of the quadrangle
-    std::vector< double > anArea (4);
+    double anArea[4];
     anArea[0] = getArea( P(1), P(2), P(3) );
     anArea[1] = getArea( P(1), P(2), P(4) );
     anArea[2] = getArea( P(1), P(3), P(4) );
@@ -853,35 +860,35 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
     // Si - areas of the triangles
     const double alpha = sqrt( 1 / 32. );
     double L = Max( aLen[ 0 ],
-                 Max( aLen[ 1 ],
-                   Max( aLen[ 2 ],
-                     Max( aLen[ 3 ],
-                       Max( aDia[ 0 ], aDia[ 1 ] ) ) ) ) );
+                    Max( aLen[ 1 ],
+                         Max( aLen[ 2 ],
+                              Max( aLen[ 3 ],
+                                   Max( aDia[ 0 ], aDia[ 1 ] ) ) ) ) );
     double C1 = sqrt( ( aLen[0] * aLen[0] +
                         aLen[1] * aLen[1] +
                         aLen[2] * aLen[2] +
                         aLen[3] * aLen[3] ) / 4. );
     double C2 = Min( anArea[ 0 ],
-                  Min( anArea[ 1 ],
-                    Min( anArea[ 2 ], anArea[ 3 ] ) ) );
+                     Min( anArea[ 1 ],
+                          Min( anArea[ 2 ], anArea[ 3 ] ) ) );
     if ( C2 <= theEps )
       return theInf;
     return alpha * L * C1 / C2;
   }
   else if( nbNodes == 8 || nbNodes == 9 ) { // nbNodes==8 - quadratic quadrangle
     // Compute lengths of the sides
-    std::vector< double > aLen (4);
+    double aLen[4];
     aLen[0] = getDistance( P(1), P(3) );
     aLen[1] = getDistance( P(3), P(5) );
     aLen[2] = getDistance( P(5), P(7) );
     aLen[3] = getDistance( P(7), P(1) );
     // Compute lengths of the diagonals
-    std::vector< double > aDia (2);
+    double aDia[2];
     aDia[0] = getDistance( P(1), P(5) );
     aDia[1] = getDistance( P(3), P(7) );
     // Compute areas of all triangles which can be built
     // taking three nodes of the quadrangle
-    std::vector< double > anArea (4);
+    double anArea[4];
     anArea[0] = getArea( P(1), P(3), P(5) );
     anArea[1] = getArea( P(1), P(3), P(7) );
     anArea[2] = getArea( P(1), P(5), P(7) );
@@ -1922,6 +1929,12 @@ double Deflection2D::GetValue( const TSequenceOfXYZ& P )
       if ( !S.IsNull() && S.ShapeType() == TopAbs_FACE )
       {
         mySurface = new ShapeAnalysis_Surface( BRep_Tool::Surface( TopoDS::Face( S )));
+
+        GeomLib_IsPlanarSurface isPlaneCheck( mySurface->Surface() );
+        if ( isPlaneCheck.IsPlanar() )
+          myPlane.reset( new gp_Pln( isPlaneCheck.Plan() ));
+        else
+          myPlane.reset();
       }
     }
     // project gravity center to the surface
@@ -1947,12 +1960,22 @@ double Deflection2D::GetValue( const TSequenceOfXYZ& P )
 
       double maxLen = MaxElementLength2D().GetValue( P );
       double    tol = 1e-3 * maxLen;
-      if ( uv.X() != 0 && uv.Y() != 0 ) // faster way
-        mySurface->NextValueOfUV( uv, gc, tol, 0.5 * maxLen );
+      double dist;
+      if ( myPlane )
+      {
+        dist = myPlane->Distance( gc );
+        if ( dist < tol )
+          dist = 0;
+      }
       else
-        mySurface->ValueOfUV( gc, tol );
-
-      return Round( mySurface->Gap() );
+      {
+        if ( uv.X() != 0 && uv.Y() != 0 ) // faster way
+          mySurface->NextValueOfUV( uv, gc, tol, 0.5 * maxLen );
+        else
+          mySurface->ValueOfUV( gc, tol );
+        dist = mySurface->Gap();
+      }
+      return Round( dist );
     }
   }
   return 0;
@@ -1962,6 +1985,7 @@ void Deflection2D::SetMesh( const SMDS_Mesh* theMesh )
 {
   NumericalFunctor::SetMesh( dynamic_cast<const SMESHDS_Mesh* >( theMesh ));
   myShapeIndex = -100;
+  myPlane.reset();
 }
 
 SMDSAbs_ElementType Deflection2D::GetType() const
index 048b10d0b18ecfd12d2a15581439f9f505f5f9cd..452b27a39216186bc307386159484f824f34b9ca 100644 (file)
@@ -53,9 +53,10 @@ class SMESHDS_Mesh;
 class SMESHDS_SubMesh;
 class SMESHDS_GroupBase;
 
-class gp_Pnt;
 class BRepClass3d_SolidClassifier;
 class ShapeAnalysis_Surface;
+class gp_Pln;
+class gp_Pnt;
 
 namespace SMESH{
   namespace Controls{
@@ -321,6 +322,7 @@ namespace SMESH{
     private:
       Handle(ShapeAnalysis_Surface) mySurface;
       int                           myShapeIndex;
+      boost::shared_ptr<gp_Pln>     myPlane;
     };
 
     /*
index 4e4002ee321eee827dc676a97d1117a0942295b5..95e775433db585fdc6579a205a3f24fb71b299bd 100644 (file)
@@ -87,7 +87,7 @@ using namespace std;
 bool SMESH_Algo::Features::IsCompatible( const SMESH_Algo::Features& algo2 ) const
 {
   if ( _dim > algo2._dim ) return algo2.IsCompatible( *this );
-  // algo2 is of highter dimension
+  // algo2 is of higher dimension
   if ( _outElemTypes.empty() || algo2._inElemTypes.empty() )
     return false;
   bool compatible = true;
index 76987e5b1f39032709595b1e2b6129ccc526abbb..93fbbac35e74cd245dda6e429bcaafdeebc1e142 100644 (file)
@@ -2188,7 +2188,7 @@ ostream& SMESH_Mesh::Dump(ostream& save)
         save << clause << ".3) Faces in detail: " << endl;
         map <int,int>::iterator itF;
         for (itF = myFaceMap.begin(); itF != myFaceMap.end(); itF++)
-          save << "--> nb nodes: " << itF->first << " - nb elemens:\t" << itF->second << endl;
+          save << "--> nb nodes: " << itF->first << " - nb elements:\t" << itF->second << endl;
       }
     }
     save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl;
@@ -2213,7 +2213,7 @@ ostream& SMESH_Mesh::Dump(ostream& save)
         save << clause << ".5) Volumes in detail: " << endl;
         map <int,int>::iterator itV;
         for (itV = myVolumesMap.begin(); itV != myVolumesMap.end(); itV++)
-          save << "--> nb nodes: " << itV->first << " - nb elemens:\t" << itV->second << endl;
+          save << "--> nb nodes: " << itV->first << " - nb elements:\t" << itV->second << endl;
       }
     }
     save << endl;
index 022e091ba698440bc1e2596e219b55ba2871023a..6b167f13297962d6fa17a50acc2866036eda79a0 100644 (file)
@@ -3460,6 +3460,24 @@ double SMESH_MesherHelper::GetOtherParam(const double param) const
   return fabs(param-myPar1[i]) < fabs(param-myPar2[i]) ? myPar2[i] : myPar1[i];
 }
 
+//=======================================================================
+//function : NbRealSeam
+//purpose  : Return a number of real seam edges in the shape set through
+//           IsQuadraticSubMesh() or SetSubShape(). A real seam edge encounters twice in a wire
+//=======================================================================
+
+size_t SMESH_MesherHelper::NbRealSeam() const
+{
+  size_t nb = 0;
+
+  std::set< int >::const_iterator id = mySeamShapeIds.begin();
+  for ( ; id != mySeamShapeIds.end(); ++id )
+    if ( *id < 0 ) ++nb;
+    else break;
+
+  return nb;
+}
+
 //=======================================================================
 //function : IsOnSeam
 //purpose  : Check if UV is on seam. Return 0 if not, 1 for U seam, 2 for V seam
@@ -5126,7 +5144,7 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
             MSG("Internal chain - ignore");
             continue;
           }
-          // mesure chain length and compute link position along the chain
+          // measure chain length and compute link position along the chain
           double chainLen = 0;
           vector< double > linkPos;
           TChain savedChain; // backup
index cf3506fea7af1d83ed6c12f37debde26c5b88622..d4f54833ae574dacf157d599aa2f7d4ea926213c 100644 (file)
@@ -52,7 +52,7 @@ typedef std::map<SMESH_TLink, const SMDS_MeshNode*>::iterator ItTLinkNode;
 
 typedef SMDS_Iterator<const TopoDS_Shape*>  PShapeIterator;
 typedef boost::shared_ptr< PShapeIterator > PShapeIteratorPtr;
-  
+
 typedef std::vector<const SMDS_MeshNode* > TNodeColumn;
 typedef std::map< double, TNodeColumn >    TParam2ColumnMap;
 
@@ -561,9 +561,15 @@ public:
   /*!
    * \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape()
    *        has a degenerated edges
-    * \retval bool - true if it has
+   *  \retval bool - true if there are degenerated edges
    */
   bool HasDegeneratedEdges() const { return !myDegenShapeIds.empty(); }
+  /*!
+   * \brief Return a number of degenerated edges in the shape set through
+   *        IsQuadraticSubMesh() or SetSubShape()
+   *  \retval size_t - nb edges
+   */
+  size_t NbDegeneratedEdges() const { return myDegenShapeIds.size(); }
 
   /*!
    * \brief Check if shape is a seam edge or it's vertex
@@ -610,6 +616,12 @@ public:
    *  \retval bool - true if it has
    */
   bool HasRealSeam() const { return HasSeam() && ( *mySeamShapeIds.begin() < 0 ); }
+  /*!
+   * \brief Return a number of real seam edges in the shape set through
+   *        IsQuadraticSubMesh() or SetSubShape(). A real seam edge encounters twice in a wire
+   *  \retval size_t - nb of real seams
+   */
+  size_t NbRealSeam() const;
   /*!
    * \brief Return index of periodic parametric direction of a closed face
    *  \retval int - 1 for U, 2 for V direction
index f994b83ecd020ed74828c79b950ec3f0515aac10..a28033fda4fe6c43d0bf337a5b1ec1ea1f66f75c 100644 (file)
@@ -95,7 +95,7 @@ SMESH_ProxyMesh::SMESH_ProxyMesh(std::vector<SMESH_ProxyMesh::Ptr>& components):
 
 //================================================================================
 /*!
- * \brief Destructor deletes proxy submeshes and tmp elemens
+ * \brief Destructor deletes proxy submeshes and tmp elements
  */
 //================================================================================
 
index 1dc5e7e12fcdf901ad5eeac9841cd1662beacf87..ce634a4b30471ba91a2dce300f393304e70f029c 100644 (file)
@@ -1539,7 +1539,7 @@ SMESHGUI_ComputeOp::SMESHGUI_ComputeOp()
 
 //================================================================================
 /*!
- * \brief Desctructor
+ * \brief Destructor
 */
 //================================================================================
 
@@ -2158,7 +2158,7 @@ SMESHGUI_EvaluateOp::SMESHGUI_EvaluateOp()
 
 //================================================================================
 /*!
- * \brief Desctructor
+ * \brief Destructor
 */
 //================================================================================
 
index 06163d911b63080ec08dc7a75c3f282079c12600..c45b9eae15288d4f6fee9404f1275b2d09bbc045 100644 (file)
@@ -91,7 +91,7 @@ namespace SMESHOp {
     OpRemoveElemGroupPopup   = 2082,   // POPUP MENU - REMOVE ELEMENTS FROM GROUP
     OpMeshInformation        = 2100,   // MENU MESH  - MESH INFORMATION
     OpWhatIs                 = 2101,   // MENU MESH  - MESH ELEMENT INFORMATION
-    OpStdInfo                = 2102,   // MENU MESH  - MESH STANDART INFORMATION
+    OpStdInfo                = 2102,   // MENU MESH  - MESH STANDARD INFORMATION
     OpFindElementByPoint     = 2103,   // MENU MESH  - FIND ELEMENT BY POINT
     OpUpdate                 = 2200,   // POPUP MENU - UPDATE
     // Controls -----------------------//--------------------------------
index 4ded1127fc06327d6f910f4c9bb952ae16085886..ee22ef944fd4d79ea7b1ab427c19d4ceeb043b8c 100644 (file)
@@ -66,6 +66,7 @@ namespace
     double                  myDirCoef; // 1. or -1, to make myDir oriented as myNodes in myFace
     double                  myLength;  // between nodes
     double                  myAngleWithPrev; // between myDir and -myPrev->myDir
+    double                  myMinMaxRatio; // of a possible triangle sides
     TAngleMap::iterator     myAngleMapPos;
     double                  myOverlapAngle;  // angle delta due to overlapping
     const SMDS_MeshNode*    myNode1Shift;    // nodes created to avoid overlapping of faces
@@ -87,11 +88,13 @@ namespace
                             std::vector<const SMDS_MeshElement*>& newFaces,
                             const bool                            isReverse );
     gp_XYZ GetInFaceDir() const { return myFaceNorm ^ myDir * myDirCoef; }
+    double ShapeFactor()  const { return 0.5 * ( 1. - myMinMaxRatio ); }
     void   InsertSelf(TAngleMap& edgesByAngle, bool isReverseFaces, bool reBind, bool useOverlap )
     {
       if ( reBind ) edgesByAngle.erase( myAngleMapPos );
       double key = (( isReverseFaces ? 2 * M_PI - myAngleWithPrev : myAngleWithPrev )
-                    + myOverlapAngle * useOverlap );
+                    + myOverlapAngle * useOverlap
+                    + ShapeFactor() );
       myAngleMapPos = edgesByAngle.insert( std::make_pair( key, this ));
     }
 
@@ -163,7 +166,6 @@ namespace
       myFaceNorm *= -1;
       myDirCoef  *= -1;
     }
-
   }
 
   //================================================================================
@@ -174,21 +176,28 @@ namespace
 
   void BEdge::ComputeAngle( bool theReverseAngle )
   {
-    myAngleWithPrev = ACos( myDir.Dot( myPrev->myDir.Reversed() ));
+    double dot = myDir.Dot( myPrev->myDir.Reversed() );
+    if      ( dot >=  1 ) myAngleWithPrev = 0;
+    else if ( dot <= -1 ) myAngleWithPrev = M_PI;
+    else                  myAngleWithPrev = acos( dot );
 
     bool isObtuse;
-    gp_XYZ inNewFaceDir = myDir - myPrev->myDir;
-    double         dot1 = myDir.Dot( myPrev->myFaceNorm );
-    double         dot2 = myPrev->myDir.Dot( myFaceNorm );
-    bool     isOverlap1 = ( inNewFaceDir * myPrev->GetInFaceDir() > 0 );
-    bool     isOverlap2 = ( inNewFaceDir * GetInFaceDir()         > 0 );
+    gp_XYZ inFaceDirNew = myDir - myPrev->myDir;
+    gp_XYZ   inFaceDir1 = myPrev->GetInFaceDir();
+    gp_XYZ   inFaceDir2 = this->GetInFaceDir();
+    double         dot1 = inFaceDirNew * inFaceDir1;
+    double         dot2 = inFaceDirNew * inFaceDir2;
+    bool     isOverlap1 = ( dot1 > 0 );
+    bool     isOverlap2 = ( dot2 > 0 );
     if ( !myPrev->myFace )
       isObtuse = isOverlap1;
     else if  ( !myFace )
       isObtuse = isOverlap2;
     else
     {
-      isObtuse = ( dot1 > 0 || dot2 < 0 ); // suppose face normals point outside the border
+      double dt1 = myDir.Dot( myPrev->myFaceNorm );
+      double dt2 = myPrev->myDir.Dot( myFaceNorm );
+      isObtuse = ( dt1 > 0 || dt2 < 0 ); // suppose face normals point outside the border
       if ( theReverseAngle )
         isObtuse = !isObtuse;
     }
@@ -207,15 +216,22 @@ namespace
       // check if myFace and a triangle built on this and prev edges overlap
       if ( isOverlap1 )
       {
-        double cos2 = dot1 * dot1 / myPrev->myFaceNorm.SquareModulus();
-        myOverlapAngle += 0.5 * M_PI * ( 1 - cos2 );
+        double cos2 = dot1 * dot1 / inFaceDirNew.SquareModulus() / inFaceDir1.SquareModulus();
+        myOverlapAngle += 1. * M_PI * cos2;
       }
       if ( isOverlap2 )
       {
-        double cos2 = dot2 * dot2 / myFaceNorm.SquareModulus();
-        myOverlapAngle += 0.5 * M_PI * ( 1 - cos2 );
+        double cos2 = dot2 * dot2 / inFaceDirNew.SquareModulus() / inFaceDir2.SquareModulus();
+        myOverlapAngle += 1. * M_PI * cos2;
       }
     }
+
+    {
+      double len3 = SMESH_NodeXYZ( myPrev->myNode1 ).Distance( myNode2 );
+      double minLen = Min( myLength, Min( myPrev->myLength, len3 ));
+      double maxLen = Max( myLength, Max( myPrev->myLength, len3 ));
+      myMinMaxRatio = minLen / maxLen;
+    }
   }
 
   //================================================================================
@@ -445,11 +461,12 @@ void SMESH_MeshAlgos::FillHole(const SMESH_MeshAlgos::TFreeBorder &  theFreeBord
   while ( edgesByAngle.size() > 2 )
   {
     TAngleMap::iterator a2e = edgesByAngle.begin();
-    if ( useOverlap && a2e->first > M_PI - angTol ) // all new triangles need shift
+    edge = a2e->second;
+    if ( useOverlap &&
+         a2e->first - edge->ShapeFactor() > M_PI - angTol ) // all new triangles need shift
     {
-      // re-sort the edges
+      // re-sort the edges w/o overlap consideration
       useOverlap = false;
-      edge    = a2e->second;
       nbEdges = edgesByAngle.size();
       edgesByAngle.clear();
       for ( size_t i = 0; i < nbEdges; ++i, edge = edge->myNext )
index c9be990f65b274515dd082b134ac98494fa3619a..4c2dddab0b6ccbf5f4d11ccd38cb021a229eecaf 100644 (file)
@@ -149,7 +149,6 @@ struct SMESH_OrientedLink: public SMESH_TLink
 struct SMESH_TNodeXYZ : public gp_XYZ
 {
   const SMDS_MeshNode* _node;
-  double               _xyz[3];
   SMESH_TNodeXYZ( const SMDS_MeshElement* e=0):gp_XYZ(0,0,0),_node(0)
   {
     Set(e);
@@ -159,15 +158,14 @@ struct SMESH_TNodeXYZ : public gp_XYZ
     if (e) {
       assert( e->GetType() == SMDSAbs_Node );
       _node = static_cast<const SMDS_MeshNode*>(e);
-      _node->GetXYZ(_xyz); // - thread safe getting coords
-      SetCoord( _xyz[0], _xyz[1], _xyz[2] );
+      _node->GetXYZ( ChangeData() ); // - thread safe getting coords
       return true;
     }
     return false;
   }
   double Distance(const SMDS_MeshNode* n)       const { return (SMESH_TNodeXYZ( n )-*this).Modulus(); }
   double SquareDistance(const SMDS_MeshNode* n) const { return (SMESH_TNodeXYZ( n )-*this).SquareModulus(); }
-  bool operator==(const SMESH_TNodeXYZ& other) const { return _node == other._node; }
+  bool operator==(const SMESH_TNodeXYZ& other)  const { return _node == other._node; }
 };
 typedef SMESH_TNodeXYZ SMESH_NodeXYZ;
 
index 38fc1414f629b63ffeba159393db4acc18114a3f..2718b0c1d3bf121e6bc59c48e3f4cf58909d5e08 100644 (file)
@@ -72,7 +72,7 @@ using SMESH::TPythonDump;
 
 /*!
  * \brief Container of commands into which the initial script is split.
- *        It also contains data coresponding to SMESH_Gen contents
+ *        It also contains data corresponding to SMESH_Gen contents
  */
 static Handle(_pyGen) theGen;
 
index 916a1f2221aebb4f30521f2abd379ee1ee2ae740..33aa46a9614daad8ea5e283add38569efa3aa714 100644 (file)
@@ -3812,7 +3812,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                 // "Face V positions" - V parameter of node on face
 
                 // Find out nb of nodes on edges and faces
-                // Collect corresponing sub-meshes
+                // Collect corresponding sub-meshes
                 int nbEdgeNodes = 0, nbFaceNodes = 0;
                 list<SMESHDS_SubMesh*> aEdgeSM, aFaceSM;
                 // loop on SMESHDS_SubMesh'es
index 4fef40fab884171b624d58acd2f477d1db1fa34e..beea2de8dd50cf27c54944cf9c8f66ad5e1736f2 100644 (file)
@@ -953,6 +953,10 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm):
     ## doc string of the method
     #  @internal
     docHelper  = "Creates prism 3D algorithm for volumes"
+    ## flag pointing whether this algorithm should be used by default in dynamic method
+    #  of smeshBuilder.Mesh class
+    #  @internal
+    isDefault  = True
 
     ## Private constructor.
     #  @param mesh parent mesh object algorithm is assigned to
index e83fbe9936a673b1b59cd757d956f441a26c3249..24aaad3b84e3457854226fd9403d33cce1b6affc 100644 (file)
@@ -2303,10 +2303,10 @@ class Mesh:
         return self.editor.MakeIDSource(ids, elemType)
 
 
-    # Get informations about mesh contents:
+    # Get information about mesh contents:
     # ------------------------------------
 
-    ## Get the mesh stattistic
+    ## Get the mesh statistic
     #  @return dictionary type element - count of elements
     #  @ingroup l1_meshinfo
     def GetMeshInfo(self, obj = None):
@@ -4924,12 +4924,12 @@ class Mesh:
 
     ## Identify the elements that will be affected by node duplication (actual duplication is not performed.
     #  This method is the first step of DoubleNodeElemGroupsInRegion.
-    #  @param theElems - list of groups of elements (edges or faces) to be replicated
+    #  @param theElems - list of groups of nodes or elements (edges or faces) to be replicated
     #  @param theNodesNot - list of groups of nodes not to replicated
     #  @param theShape - shape to detect affected elements (element which geometric center
     #         located on or inside shape).
     #         The replicated nodes should be associated to affected elements.
-    #  @return groups of affected elements
+    #  @return groups of affected elements in order: volumes, faces, edges
     #  @ingroup l2_modif_duplicat
     def AffectedElemGroupsInRegion(self, theElems, theNodesNot, theShape):
         return self.editor.AffectedElemGroupsInRegion(theElems, theNodesNot, theShape)
index ad5f5263f42152e2100bbfa441c0470d718e2e70..c86e02a78782a6f36d4ba28f7d9307276b3358b5 100644 (file)
@@ -191,7 +191,7 @@ namespace {
       theTShapeToLengthMap.insert( make_pair( getTShape( edge ), L ));
     }
 
-    // Compute S0 - minimal segement length, is computed by the shortest EDGE
+    // Compute S0 - minimal segment length, is computed by the shortest EDGE
 
     /* image attached to PAL10237
 
index a4d3ffbdd04d533ae97ba9083fa8df465e3bbfc3..85592db51614dc9379c56d4cbf06e21df962e797 100644 (file)
@@ -604,7 +604,7 @@ namespace
              theSinuEdges [0].size() > 0 && theSinuEdges [1].size() > 0 );
 
     // the sinuous EDGEs can be composite and C0 continuous,
-    // therefor we use a complex criterion to find TWO short non-sinuous EDGEs
+    // therefore we use a complex criterion to find TWO short non-sinuous EDGEs
     // and the rest EDGEs will be treated as sinuous.
     // A short edge should have the following features:
     // a) straight
index 994089cfe4e7fe09482f3102aa8eb5ea3e942894..66654eeacccd8bc915858474981d0508dec675b8 100644 (file)
@@ -4593,7 +4593,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face&          theFace,
           {
             d = Abs( idealLen - accuLength[ iEV ]);
 
-            // take into account presence of a coresponding halfDivider
+            // take into account presence of a corresponding halfDivider
             const double cornerWgt = 0.5  / nbSides;
             const double vertexWgt = 0.25 / nbSides;
             TGeoIndex hd = halfDivider[ evVec[ iEV ]];
index 9f951022550af9bbb8ccde20c22220fdde98d656..a4ba0446d617011afba5a1957cc5b3f09c50da5c 100644 (file)
@@ -429,7 +429,7 @@ CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobFileList & meshJo
   //jobParameters->maximum_duration = CORBA::string_dup("01:00");
   jobParameters->queue = CORBA::string_dup("");
 
-  // Setting resource and additionnal properties (if needed)
+  // Setting resource and additional properties (if needed)
   // The resource parameters can be initiated from scratch, for
   // example by specifying the values in hard coding:
   // >>>
@@ -451,7 +451,7 @@ CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobFileList & meshJo
     resourceDefinition = _resourcesManager->GetResourceDefinition(resourceName);
   }
   catch (const CORBA::SystemException& ex) {
-    _lastErrorMessage = std::string("We can not access to the ressource ") + std::string(resourceName);
+    _lastErrorMessage = std::string("We can not access the resource ") + std::string(resourceName);
     _lastErrorMessage+= std::string("(check the file CatalogResource.xml)");
     LOG(_lastErrorMessage);
     return JOBID_UNDEFINED;
@@ -462,7 +462,7 @@ CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobFileList & meshJo
   // Then, the values can be used to initiate the resource parameters
   // of the job:
   jobParameters->resource_required.name     = CORBA::string_dup(resourceDefinition->name.in());
-  // CAUTION: the additionnal two following parameters MUST be
+  // CAUTION: the additional two following parameters MUST be
   // specified explicitly, because they are not provided by the
   // resource definition:
   jobParameters->resource_required.mem_mb   = resourceDefinition->mem_mb;
@@ -682,7 +682,7 @@ std::vector<std::string> * MeshJobManager_i::_getResourceNames() {
   // SALOME application.
   // In the code instructions, you just have to choose a resource
   // configuration by its name and then define the ResourceParameters
-  // that specify additionnal properties for a specific job submission
+  // that specify additional properties for a specific job submission
   // (use the attribute resource_required of the JobParameters).
 
   return resourceNames;
index 618a4a2f2239e0bb03a02f210c4745a06bcdfba8..177c4ccfa910bf39937414d117600ef7dd93109d 100644 (file)
@@ -73,7 +73,7 @@ private:
   Engines::ResourcesManager_var _resourcesManager;
   
   // This maps the config identifier to the config parameters. A
-  // config is a resource with additionnal data specifying the
+  // config is a resource with additional data specifying the
   // location of the binary program to be executed by the task
   std::map<std::string, MESHJOB::ConfigParameter> _configMap;