Salome HOME
Merge branch 'V8_2_BR' into pre/V8_2_BR
authorPaul RASCLE <paul.rascle@edf.fr>
Thu, 24 Nov 2016 18:07:48 +0000 (19:07 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Thu, 24 Nov 2016 18:07:48 +0000 (19:07 +0100)
22 files changed:
src/DriverGMF/DriverGMF_Read.cxx
src/DriverGMF/DriverGMF_Write.cxx
src/OBJECT/SMESH_Actor.cxx
src/OBJECT/SMESH_CellLabelActor.cxx
src/OBJECT/SMESH_DeviceActor.cxx
src/OBJECT/SMESH_DeviceActor.h
src/OBJECT/SMESH_NodeLabelActor.cxx
src/SMDS/SMDS_Mesh.cxx
src/SMDS/SMDS_Mesh.hxx
src/SMDS/SMDS_UnstructuredGrid.cxx
src/SMDS/SMDS_UnstructuredGrid.hxx
src/SMESH/SMESH_Mesh.cxx
src/SMESH/SMESH_MesherHelper.cxx
src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx
src/SMESH_I/SMESH_Gen_i.cxx
src/StdMeshers/StdMeshers_FaceSide.cxx
src/StdMeshers/StdMeshers_Prism_3D.cxx
src/StdMeshers/StdMeshers_Projection_2D.cxx
src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx
src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx
src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx
src/StdMeshers_I/StdMeshers_QuadrangleParams_i.cxx

index f1b9d4a184dccefa984440c0674eaf962df65ff6..54edf6a9c8413a0ab6f1e40bd62caa89026769f3 100644 (file)
@@ -299,7 +299,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
     for ( int i = 1; i <= nbPyr; ++i )
     {
       GmfGetLin(meshID, GmfPyramids, &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &ref);
-      if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3], iN[4], pyrIDShift + i ))
+      if ( !myMesh->AddVolumeWithID( iN[3], iN[2], iN[1], iN[0], iN[4], pyrIDShift + i ))
         status = storeBadNodeIds( "GmfPyramids",i, 5, iN[0], iN[1],iN[2], iN[3], iN[4] );
     }
   }
index 27f1ce065ed78601161ebf50301f8e0c9feb8dc1..723f73d321f6c07b7da5ee52c89f5873cdf3c7c9 100644 (file)
@@ -204,10 +204,10 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
 
   // pyramids
   BEGIN_ELEM_WRITE( SMDSEntity_Pyramid, GmfPyramids, pyra )
-    node2IdMap[ pyra->GetNode( 0 )],
+    node2IdMap[ pyra->GetNode( 3 )],
     node2IdMap[ pyra->GetNode( 2 )],
     node2IdMap[ pyra->GetNode( 1 )],
-    node2IdMap[ pyra->GetNode( 3 )],
+    node2IdMap[ pyra->GetNode( 0 )],
     node2IdMap[ pyra->GetNode( 4 )],
     END_ELEM_WRITE( pyra );
 
index 0c876a190bb5af1e370c97851154f28ebbc246a8..5c2e918ab00908321c1b5a94d495cea394842f48 100644 (file)
@@ -1529,10 +1529,10 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation)
       }
     }
 
-    if(myNodeActor->GetPointsLabeled()){
+    if(myNodeActor->GetPointsLabeled()) {
+      myNodeActor->UpdateLabels();
       myNodeActor->VisibilityOn();
     }
-
     if(my0DActor)
       my0DActor->UpdateLabels();
 
@@ -1940,9 +1940,9 @@ int SMESH_ActorDef::RenderTranslucentGeometry(vtkViewport *vp)
 
 void SMESH_ActorDef::Render(vtkRenderer *ren)
 {
-  unsigned long aTime = myTimeStamp->GetMTime();
-  unsigned long anObjTime = myVisualObj->GetUnstructuredGrid()->GetMTime();
-  unsigned long aClippingTime = myImplicitBoolean->GetMTime();
+  vtkMTimeType aTime = myTimeStamp->GetMTime();
+  vtkMTimeType anObjTime = myVisualObj->GetUnstructuredGrid()->GetMTime();
+  vtkMTimeType aClippingTime = myImplicitBoolean->GetMTime();
   if(anObjTime > aTime || aClippingTime > aTime)
     Update();
 }
index 0172da00b49ebf2a048accfd735cf504e61fa84d..7b5e7aec6d6f37a866cf54ef7c93e4d1714530b7 100644 (file)
@@ -140,18 +140,19 @@ void SMESH_CellLabelActor::SetFontProperties( SMESH::LabelFont family, int size,
   myClsTextProp->SetBold( bold );
   myClsTextProp->SetItalic( italic );
   myClsTextProp->SetShadow( shadow );
-  myClsTextProp->SetColor( r, g, b ); 
+  myClsTextProp->SetColor( r, g, b );
 }
 
 void SMESH_CellLabelActor::SetCellsLabeled(bool theIsCellsLabeled)
 {
+  myIsCellsLabeled = theIsCellsLabeled;
+
+  myCellsLabels->SetVisibility(false);
+
   myTransformFilter->Update();
   vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::SafeDownCast(myTransformFilter->GetOutput());
-  if ( !aGrid )
-    return;
 
-  myIsCellsLabeled = theIsCellsLabeled && aGrid->GetNumberOfPoints();
-  if ( myIsCellsLabeled )
+  if ( myIsCellsLabeled && aGrid )
   {
     myCellsNumDataSet->ShallowCopy(aGrid);
     vtkUnstructuredGrid *aDataSet = myCellsNumDataSet;
@@ -172,8 +173,6 @@ void SMESH_CellLabelActor::SetCellsLabeled(bool theIsCellsLabeled)
     aDataSet->GetCellData()->SetScalars(anArray);
     myCellCenters->SetInputData(aDataSet);
     myCellsLabels->SetVisibility(GetVisibility());
-  }else{
-    myCellsLabels->SetVisibility(false);
   }
 }
 
index f6db97d25e162aec96042df4255cdb7114ff7d03..2f6ccd06f0044e7a26e03d7b5a87c80db50f26f9 100644 (file)
@@ -615,7 +615,7 @@ SMESH_DeviceActor
 
 
 
-unsigned long int
+vtkMTimeType
 SMESH_DeviceActor
 ::GetMTime()
 {
@@ -640,7 +640,7 @@ SMESH_DeviceActor
   //      << " " << myTransformFilter->GetMTime()
   //      << " " << myFaceOrientationFilter->GetMTime() << endl;
 
-  unsigned long mTime = this->Superclass::GetMTime();
+  vtkMTimeType mTime = this->Superclass::GetMTime();
   mTime = max(mTime,myExtractGeometry->GetMTime());
   mTime = max(mTime,myExtractUnstructuredGrid->GetMTime());
   mTime = max(mTime,myMergeFilter->GetMTime());
index b9e7496081003182b1379b3716eb4900190ab2e2..1b8ceb48ebe216b8bca4876a5c0628dd8e6fae6c 100644 (file)
@@ -75,7 +75,7 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{
   virtual vtkCell* GetElemCell(int theObjID);
 
   virtual void SetTransform(VTKViewer_Transform* theTransform); 
-  virtual unsigned long int GetMTime();
+  virtual vtkMTimeType GetMTime();
 
   virtual void SetFacesOriented(bool theIsFacesOriented);
   virtual bool GetFacesOriented() { return myIsFacesOriented; }
index c023dfe8f389348c82c42bb35852d90107b0f0af..a1ed15ad7db9e5388c1111ae2486bd0838710bde 100644 (file)
@@ -44,7 +44,8 @@ vtkStandardNewMacro(SMESH_NodeLabelActor);
 /*!
   Constructor.
 */
-SMESH_NodeLabelActor::SMESH_NodeLabelActor() {
+SMESH_NodeLabelActor::SMESH_NodeLabelActor()
+{
   //Definition of points numbering pipeline
   //---------------------------------------
   myPointsNumDataSet = vtkUnstructuredGrid::New();
@@ -57,12 +58,12 @@ SMESH_NodeLabelActor::SMESH_NodeLabelActor() {
   myPtsSelectVisiblePoints->SetInputConnection(myPtsMaskPoints->GetOutputPort());
   myPtsSelectVisiblePoints->SelectInvisibleOff();
   myPtsSelectVisiblePoints->SetTolerance(0.1);
-    
+
   myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
   myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort());
   myPtsLabeledDataMapper->SetLabelFormat("%d");
   myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
-    
+
   myPtsTextProp = vtkTextProperty::New();
   myPtsTextProp->SetFontFamilyToTimes();
   myPtsTextProp->SetFontSize(10);
@@ -90,19 +91,20 @@ SMESH_NodeLabelActor::SMESH_NodeLabelActor() {
 /*!
   Destructor
 */
-SMESH_NodeLabelActor::~SMESH_NodeLabelActor() {
+SMESH_NodeLabelActor::~SMESH_NodeLabelActor()
+{
   //Deleting of points numbering pipeline
   //---------------------------------------
   myPointsNumDataSet->Delete();
-  
+
   // commented: porting to vtk 5.0
   //  myPtsLabeledDataMapper->RemoveAllInputs();
   myPtsLabeledDataMapper->Delete();
-  
+
   // commented: porting to vtk 5.0
   //  myPtsSelectVisiblePoints->UnRegisterAllOutputs();
   myPtsSelectVisiblePoints->Delete();
-  
+
   // commented: porting to vtk 5.0
   //  myPtsMaskPoints->UnRegisterAllOutputs();
   myPtsMaskPoints->Delete();
@@ -130,16 +132,16 @@ void SMESH_NodeLabelActor::SetFontProperties( SMESH::LabelFont family, int size,
   myPtsTextProp->SetColor( r, g, b ); 
 }
 
-void SMESH_NodeLabelActor::SetPointsLabeled(bool theIsPointsLabeled) {
+void SMESH_NodeLabelActor::SetPointsLabeled(bool theIsPointsLabeled)
+{
+  myIsPointsLabeled = theIsPointsLabeled;
+
+  myPointLabels->SetVisibility( false );
+
   myTransformFilter->Update();
   vtkDataSet* aGrid = vtkUnstructuredGrid::SafeDownCast(myTransformFilter->GetOutput());
 
-  if(!aGrid)
-    return;
-    
-  myIsPointsLabeled = theIsPointsLabeled && aGrid->GetNumberOfPoints();
-
-  if ( myIsPointsLabeled )
+  if ( myIsPointsLabeled && aGrid )
   {
     myPointsNumDataSet->ShallowCopy(aGrid);
     vtkUnstructuredGrid *aDataSet = myPointsNumDataSet;
@@ -160,10 +162,6 @@ void SMESH_NodeLabelActor::SetPointsLabeled(bool theIsPointsLabeled) {
     myPointLabels->SetVisibility( GetVisibility() );
     anArray->Delete();
   }
-  else
-  {
-    myPointLabels->SetVisibility( false );
-  } 
 }
 
 
@@ -189,7 +187,8 @@ void SMESH_NodeLabelActor::RemoveFromRender(vtkRenderer* theRenderer)
   SMESH_DeviceActor::RemoveFromRender(theRenderer);
 }
 
-void SMESH_NodeLabelActor::UpdateLabels() {
+void SMESH_NodeLabelActor::UpdateLabels()
+{
   if(myIsPointsLabeled)
     SetPointsLabeled(myIsPointsLabeled);
 }
@@ -198,8 +197,9 @@ void SMESH_NodeLabelActor::UpdateLabels() {
 void SMESH_NodeLabelActor::ProcessEvents(vtkObject* vtkNotUsed(theObject),
                                          unsigned long theEvent,
                                          void* theClientData,
-                                         void* vtkNotUsed(theCallData)) {
-  SMESH_NodeLabelActor* self = reinterpret_cast<SMESH_NodeLabelActor*>(theClientData);    
+                                         void* vtkNotUsed(theCallData))
+{
+  SMESH_NodeLabelActor* self = reinterpret_cast<SMESH_NodeLabelActor*>(theClientData);
   if(self)
     self->UpdateLabels();
 }
index 74148811fa0e8194e50a0663830cd13d60060a54..d70ff4bcdf59aebdf0e0fbcaf26a83f0033fae89 100644 (file)
@@ -4708,7 +4708,7 @@ void SMDS_Mesh::Modified()
 }
 
 //! get last modification timeStamp
-unsigned long SMDS_Mesh::GetMTime() const
+vtkMTimeType SMDS_Mesh::GetMTime() const
 {
   return this->myModifTime;
 }
index 1d6b2cf11ab402faa9a3a60ed1a9620eaa1293d2..459befaa9d8eaf087bb99552db9e3a603f031d6e 100644 (file)
@@ -750,7 +750,7 @@ public:
   inline void setMyModified() { this->myModified = true; }
 
   void Modified();
-  unsigned long GetMTime() const;
+  vtkMTimeType GetMTime() const;
   bool isCompacted();
 
 protected:
index d37eec1397e1c92cd7b93bcd8c8a05b633638e9d..bf9df36cffc1c1c80eb5fa3b3fde23e680f301a0 100644 (file)
@@ -125,9 +125,9 @@ SMDS_UnstructuredGrid::~SMDS_UnstructuredGrid()
 {
 }
 
-unsigned long SMDS_UnstructuredGrid::GetMTime()
+vtkMTimeType SMDS_UnstructuredGrid::GetMTime()
 {
-  unsigned long mtime = vtkUnstructuredGrid::GetMTime();
+  vtkMTimeType mtime = vtkUnstructuredGrid::GetMTime();
   return mtime;
 }
 
index 67dada6c9552e03512dc09c74675f19bdc855017..7750a4b8107abd4ee6895358d40cdd94180fc618 100644 (file)
@@ -69,7 +69,7 @@ public:
                    int               newNodeSize,
                    std::vector<int>& idCellsOldToNew,
                    int               newCellSize);
-  virtual unsigned long GetMTime();
+  virtual vtkMTimeType GetMTime();
   virtual vtkPoints *GetPoints();
 
   int InsertNextLinkedCell(int type, int npts, vtkIdType *pts);
index 76d2dbc05d7938820cfa847df0bb9a808f489c49..ff127dece72588a29e297dde56a32e072bd7efb2 100644 (file)
@@ -2368,7 +2368,7 @@ bool SMESH_Mesh::SortByMeshOrder(std::vector<SMESH_subMesh*>& theListToSort) con
   vector<SMESH_subMesh*>::iterator onlyBIt = onlyOrderedList.begin();
   vector<SMESH_subMesh*>::iterator onlyEIt = onlyOrderedList.end();
 
-  // iterate on ordered submeshes and insert them in detected positions
+  // iterate on ordered sub-meshes and insert them in detected positions
   map< int, TPosInList >::iterator i_pos = sortedPos.begin();
   for ( ; onlyBIt != onlyEIt; ++onlyBIt, ++i_pos )
     *(i_pos->second) = *onlyBIt;
@@ -2386,18 +2386,27 @@ bool SMESH_Mesh::IsOrderOK( const SMESH_subMesh* smBefore,
                             const SMESH_subMesh* smAfter ) const
 {
   TListOfListOfInt::const_iterator listIdsIt = _mySubMeshOrder.begin();
-  TListOfInt::const_iterator idBef, idAft;
   for( ; listIdsIt != _mySubMeshOrder.end(); listIdsIt++)
   {
     const TListOfInt& listOfId = *listIdsIt;
-    idBef = std::find( listOfId.begin(), listOfId.end(), smBefore->GetId() );
-    if ( idBef != listOfId.end() )
-      idAft = std::find( listOfId.begin(), listOfId.end(), smAfter->GetId() );
-    if ( idAft != listOfId.end () )
-      return ( std::distance( listOfId.begin(), idBef ) <
-               std::distance( listOfId.begin(), idAft )   );
+    int iB = -1, iA = -1, i = 0;
+    for ( TListOfInt::const_iterator id = listOfId.begin(); id != listOfId.end(); ++id, ++i )
+    {
+      if ( *id == smBefore->GetId() )
+      {
+        iB = i;
+        if ( iA > -1 )
+          return iB < iA;
+      }
+      else if ( *id == smAfter->GetId() )
+      {
+        iA = i;
+        if ( iB > -1 )
+          return iB < iA;
+      }
+    }
   }
-  return true; // no order imposed to given submeshes
+  return true; // no order imposed to given sub-meshes
 } 
 
 //=============================================================================
index e9e9f58b62b6a572fbe351c7693e6f1828c0e235..67df8daebb388f8127ad0e94026a6bcb89fea7ec 100644 (file)
@@ -2930,7 +2930,7 @@ bool SMESH_MesherHelper::IsReversedSubMesh (const TopoDS_Face& theFace)
         TopoDS_Shape s0 = GetSubShapeByNode( nn[0], GetMeshDS() );
         TopoDS_Shape s1 = GetSubShapeByNode( nn[1], GetMeshDS() );
         TopoDS_Shape  E = GetCommonAncestor( s0, s1, *myMesh, TopAbs_EDGE );
-        if ( !E.IsNull() && !s0.IsSame( s1 ))
+        if ( !E.IsNull() && !s0.IsSame( s1 ) && E.Orientation() != TopAbs_INTERNAL )
         {
           // is E seam edge?
           int nb = 0;
index f6574cb5a967494be53b1573112b12dd3ebead07..33baabf0beee9064dcdf6ed4cc1939b0f95a32de 100644 (file)
@@ -69,7 +69,7 @@
 #define UnLoadLib( handle ) FreeLibrary( handle );
 #else
 #define LibHandle void*
-#define LoadLib( name ) dlopen( name, RTLD_LAZY )
+#define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL )
 #define GetProc dlsym
 #define UnLoadLib( handle ) dlclose( handle );
 #endif
index 6371c3806294b26a9685e11e6b9e2d5a0f21a148..845e0d9f081da9ac32d720fdcb1db1a0dd68ec66 100644 (file)
@@ -63,7 +63,7 @@
  #define UnLoadLib( handle ) FreeLibrary( handle );
 #else
  #define LibHandle void*
- #define LoadLib( name ) dlopen( name, RTLD_LAZY )
+ #define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL )
  #define GetProc dlsym
  #define UnLoadLib( handle ) dlclose( handle );
 #endif
index 66bae01e026929239ce2c94a07d007c5e86c18a5..b7a492654a7cae3da753594a2ff3f7d5fbe55ed9 100644 (file)
@@ -448,8 +448,11 @@ const std::vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool   isXCons
     if ((int) u2node.size() + nbProxyNodes != myNbPonits &&
         (int) u2node.size() + nbProxyNodes != NbPoints( /*update=*/true ))
     {
-      MESSAGE("Wrong node parameters on edges, u2node.size():"
-              <<u2node.size()<<" !=  myNbPonits:"<<myNbPonits);
+      return myPoints;
+    }
+    if (( myNbPonits > 0 ) &&
+        ( u2node.begin()->first < 0 || u2node.rbegin()->first > 1 ))
+    {
       return myPoints;
     }
 
index 3d6249a79570ac2574e98f7b9b75965bef54b8cc..75219db95b4374617c7a473e00266b303a097d4b 100644 (file)
@@ -2544,8 +2544,8 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable()
     bool        _isBase;  /* is used in a base FACE */
     EdgeWithNeighbors(const TopoDS_Edge& E, int iE, int nbE, int shift, bool isBase ):
       _edge( E ), _iBase( iE + shift ),
-      _iL( SMESH_MesherHelper::WrapIndex( iE-1, nbE ) + shift ),
-      _iR( SMESH_MesherHelper::WrapIndex( iE+1, nbE ) + shift ),
+      _iL( SMESH_MesherHelper::WrapIndex( iE-1, Max( 1, nbE )) + shift ),
+      _iR( SMESH_MesherHelper::WrapIndex( iE+1, Max( 1, nbE )) + shift ),
       _isBase( isBase )
     {
     }
@@ -2674,16 +2674,16 @@ namespace // utils used by StdMeshers_Prism_3D::IsApplicable()
           edges[ iFirst ]._iL = edges[ iFirst ]._iBase; // connect to self
           edges[ iLast  ]._iR = edges[ iLast ]._iBase;
 
-          // look for an EDGE of the outer WIRE connected to vv
+          // look for an EDGE of the outer WIREs connected to vv
           TopoDS_Vertex v0, v1;
-          for ( iE = 0; iE < nbEdgesInWires.front(); ++iE )
+          for ( iE = 0; iE < iFirst; ++iE )
           {
             v0 = SMESH_MesherHelper::IthVertex( 0, edges[ iE ]._edge );
             v1 = SMESH_MesherHelper::IthVertex( 1, edges[ iE ]._edge );
             if ( vv[0].IsSame( v0 ) || vv[0].IsSame( v1 ))
               edges[ iFirst ]._iL = edges[ iE ]._iBase;
             if ( vv[1].IsSame( v0 ) || vv[1].IsSame( v1 ))
-              edges[ iLast ]._iR = edges[ iE ]._iBase;
+              edges[ iLast  ]._iR = edges[ iE ]._iBase;
           }
         }
         iFirst += *nbE;
index 6ef4c57320b90fe5de63ab40d0d8d96109feea3c..31db57e967fd3f2702c6bd6fbf8d17131acccf48 100644 (file)
 
 #include <utilities.h>
 
+#include <BRepAdaptor_Curve.hxx>
 #include <BRepAdaptor_Surface.hxx>
 #include <BRepMesh_Delaun.hxx>
 #include <BRep_Tool.hxx>
 #include <Bnd_B2d.hxx>
 #include <GeomAPI_ProjectPointOnSurf.hxx>
 #include <GeomLib_IsPlanarSurface.hxx>
+#include <Precision.hxx>
 #include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
@@ -656,6 +658,8 @@ namespace {
 
     SMESH_MesherHelper srcHelper( *srcMesh );
     srcHelper.SetSubShape( srcFace );
+    SMESH_MesherHelper edgeHelper( *tgtMesh );
+    edgeHelper.ToFixNodeParameters( true );
 
     const SMDS_MeshNode* nullNode = 0;
     TAssocTool::TNodeNodeMap::iterator srcN_tgtN;
@@ -694,10 +698,30 @@ namespace {
           }
           case SMDS_TOP_EDGE:
           {
-            const TopoDS_Shape & srcE = srcMeshDS->IndexToShape( srcNode->getshapeId() );
-            const TopoDS_Shape & tgtE = shape2ShapeMap( srcE, /*isSrc=*/true );
-            double srcU = srcHelper.GetNodeU( TopoDS::Edge( srcE ), srcNode );
-            tgtMeshDS->SetNodeOnEdge( n, TopoDS::Edge( tgtE ), srcU );
+            const TopoDS_Edge& srcE = TopoDS::Edge( srcMeshDS->IndexToShape( srcNode->getshapeId()));
+            const TopoDS_Edge& tgtE = TopoDS::Edge( shape2ShapeMap( srcE, /*isSrc=*/true ));
+            double srcU = srcHelper.GetNodeU( srcE, srcNode );
+            tgtMeshDS->SetNodeOnEdge( n, tgtE, srcU );
+            if ( !tgtFace.IsPartner( srcFace ))
+            {
+              bool isOk = true;
+              edgeHelper.SetSubShape( tgtE );
+              edgeHelper.GetNodeU( tgtE, n, 0, &isOk );
+              if ( !isOk ) // projection of n to tgtE failed (23395)
+              {
+                double sF, sL, tF, tL;
+                BRep_Tool::Range( srcE, sF, sL );
+                BRep_Tool::Range( tgtE, tF, tL );
+                double srcR = ( srcU - sF ) / ( sL - sF );
+                double tgtU  = tF + srcR * ( tL - tF );
+                tgtMeshDS->SetNodeOnEdge( n, tgtE, tgtU );
+                gp_Pnt newP = BRepAdaptor_Curve( tgtE ).Value( tgtU );
+                double dist = newP.Distance( tgtP );
+                double tol = BRep_Tool::Tolerance( tgtE );
+                if ( tol < dist && dist < 1000*tol )
+                  tgtMeshDS->MoveNode( n, newP.X(), newP.Y(), newP.Z() );
+              }
+            }
             break;
           }
           case SMDS_TOP_VERTEX:
@@ -728,12 +752,9 @@ namespace {
 
     if ( !tgtFace.IsPartner( srcFace ) )
     {
-      SMESH_MesherHelper edgeHelper( *tgtMesh );
-      edgeHelper.ToFixNodeParameters( true );
       helper.ToFixNodeParameters( true );
 
       int nbOkPos = 0;
-      bool toCheck = true;
       const double tol2d = 1e-12;
       srcN_tgtN = src2tgtNodes.begin();
       for ( ; srcN_tgtN != src2tgtNodes.end(); ++srcN_tgtN )
@@ -754,9 +775,9 @@ namespace {
         }
         case SMDS_TOP_EDGE:
         {
-          const TopoDS_Edge & tgtE = TopoDS::Edge( tgtMeshDS->IndexToShape( n->getshapeId() ));
-          edgeHelper.SetSubShape( tgtE );
-          edgeHelper.GetNodeU( tgtE, n, 0, &toCheck );
+          // const TopoDS_Edge & tgtE = TopoDS::Edge( tgtMeshDS->IndexToShape( n->getshapeId() ));
+          // edgeHelper.SetSubShape( tgtE );
+          // edgeHelper.GetNodeU( tgtE, n, 0, &toCheck );
           break;
         }
         default:;
index 279e556f3ff22536730db97e7694bb73f6771938..8c0d9778b3803e30017311df07924dc37e5c28ee 100644 (file)
@@ -287,11 +287,14 @@ void StdMeshers_ProjectionSource1D_i::LoadFrom( const char* theStream )
   }
 
   myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( mesh );
-  GetImpl()->SetSourceMesh       ( meshImpl );
-  GetImpl()->SetSourceEdge       ( shapes[ SRC_EDGE ] );
-  GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX ],
-                                   shapes[ TGT_VERTEX ]);
-
+  try {
+    GetImpl()->SetSourceMesh       ( meshImpl );
+    GetImpl()->SetSourceEdge       ( shapes[ SRC_EDGE ] );
+    GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX ],
+                                     shapes[ TGT_VERTEX ]);
+  }
+  catch (...) {
+  }
   myBaseImpl->LoadFrom( is );
 
   std::istringstream str( theStream );
index 93cd392c0f14609ede6d0eebaba4651f9b684eed..0c030a040e9d69c63118b0efa09b1cd27eb0c190 100644 (file)
@@ -298,12 +298,16 @@ void StdMeshers_ProjectionSource2D_i::LoadFrom( const char* theStream )
 
   myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( mesh );
 
-  GetImpl()->SetSourceMesh       ( meshImpl );
-  GetImpl()->SetSourceFace       ( shapes[ SRC_FACE ] );
-  GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX1 ],
-                                   shapes[ SRC_VERTEX2 ],
-                                   shapes[ TGT_VERTEX1 ],
-                                   shapes[ TGT_VERTEX2 ]);
+  try {
+    GetImpl()->SetSourceMesh       ( meshImpl );
+    GetImpl()->SetSourceFace       ( shapes[ SRC_FACE ] );
+    GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX1 ],
+                                     shapes[ SRC_VERTEX2 ],
+                                     shapes[ TGT_VERTEX1 ],
+                                     shapes[ TGT_VERTEX2 ]);
+  }
+  catch( ... ) {
+  }
   myBaseImpl->LoadFrom( is );
 
   std::istringstream str( theStream );
index a97d95104366e28687341289edfafe334daa61b1..84ad6ca62d67acd3b8e16db247ba11a026b60fc8 100644 (file)
@@ -252,7 +252,7 @@ CORBA::Boolean StdMeshers_ProjectionSource3D_i::IsDimSupported( SMESH::Dimension
 //================================================================================
 /*!
  * \brief Write parameters in a string
 * \retval char* - resulting string
+ * \retval char* - resulting string
  */
 //================================================================================
 
@@ -273,7 +273,7 @@ char* StdMeshers_ProjectionSource3D_i::SaveTo()
 //================================================================================
 /*!
  * \brief Retrieve parameters from the string
 * \param theStream - the input string
+ * \param theStream - the input string
  */
 //================================================================================
 
@@ -299,13 +299,16 @@ void StdMeshers_ProjectionSource3D_i::LoadFrom( const char* theStream )
 
   myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( mesh );
 
-  GetImpl()->SetSourceMesh       ( meshImpl );
-  GetImpl()->SetSource3DShape    ( shapes[ SRC_SHAPE3D ] );
-  GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX1 ],
-                                   shapes[ SRC_VERTEX2 ],
-                                   shapes[ TGT_VERTEX1 ],
-                                   shapes[ TGT_VERTEX2 ]);
-
+  try {
+    GetImpl()->SetSourceMesh       ( meshImpl );
+    GetImpl()->SetSource3DShape    ( shapes[ SRC_SHAPE3D ] );
+    GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX1 ],
+                                     shapes[ SRC_VERTEX2 ],
+                                     shapes[ TGT_VERTEX1 ],
+                                     shapes[ TGT_VERTEX2 ]);
+  }
+  catch (...) {
+  }
   myBaseImpl->LoadFrom( is );
 
   std::istringstream str( theStream );
index ebff90789f44fad934783cb8c1ef1af5a23d347f..7f17b00f6ba44f15daa0366a03315350e9eefa54 100644 (file)
@@ -379,7 +379,11 @@ void StdMeshers_QuadrangleParams_i::LoadFrom( const char* theStream )
       for ( int i = 0; i < nb; ++i )
         shapes.push_back( StdMeshers_ObjRefUlils::LoadFromStream( is, & myShapeEntries[i] ));
 
-      GetImpl()->SetEnforcedNodes( shapes, points );
+      try {
+        GetImpl()->SetEnforcedNodes( shapes, points );
+      }
+      catch (...) {
+      }
     }
   }