Salome HOME
23315: [CEA 1929] Too much memory used to display a mesh in shading and wireframe
authoreap <eap@opencascade.com>
Fri, 11 Nov 2016 12:14:46 +0000 (15:14 +0300)
committereap <eap@opencascade.com>
Fri, 11 Nov 2016 12:14:46 +0000 (15:14 +0300)
   Deactivate ID mapping in all DeviceActor's except the pickable one.
   The ID mapping needed to show IDs in the Viewer is computed when needed
   via VTKViewer_ExtractUnstructuredGrid::BuildOut2InMap()

+ IPAL53796: Clipping related bugs

doc/salome/examples/filters_ex33.py
src/MEFISTO2/aptrte.cxx
src/OBJECT/SMESH_Actor.cxx
src/OBJECT/SMESH_CellLabelActor.cxx
src/OBJECT/SMESH_DeviceActor.cxx
src/SMDS/SMDS_Mesh.cxx
src/SMESH/SMESH_Mesh.cxx
src/SMESH_I/SMESH_Mesh_i.cxx
src/SMESH_SWIG/smeshBuilder.py

index c844e9063e57c2b23d16ac8dc5ccbe4c2b5bf04b..7ffb5548f7fcaeeb09f887137cedddf6ee98b9f2 100644 (file)
@@ -2,16 +2,19 @@
 
 # create mesh
 from SMESH_mechanic import *
 
 # create mesh
 from SMESH_mechanic import *
-# get number of linear and quadratic edges
-filter_linear = smesh.GetFilter(SMESH.EDGE, SMESH.FT_LinearOrQuadratic)
+
+# get linear and quadratic edges
+filter_linear    = smesh.GetFilter(SMESH.EDGE, SMESH.FT_LinearOrQuadratic)
 filter_quadratic = smesh.GetFilter(SMESH.EDGE, SMESH.FT_LinearOrQuadratic, SMESH.FT_LogicalNOT)
 filter_quadratic = smesh.GetFilter(SMESH.EDGE, SMESH.FT_LinearOrQuadratic, SMESH.FT_LogicalNOT)
-ids_linear = mesh.GetIdsFromFilter(filter_linear)
+ids_linear    = mesh.GetIdsFromFilter(filter_linear)
 ids_quadratic = mesh.GetIdsFromFilter(filter_quadratic)
 print "Number of linear edges:", len(ids_linear), "; number of quadratic edges:", len(ids_quadratic)
 ids_quadratic = mesh.GetIdsFromFilter(filter_quadratic)
 print "Number of linear edges:", len(ids_linear), "; number of quadratic edges:", len(ids_quadratic)
+
 # convert mesh to quadratic
 print "Convert to quadratic..."
 # convert mesh to quadratic
 print "Convert to quadratic..."
-mesh.ConvertToQuadratic(True)
-# get number of linear and quadratic edges
-ids_linear = mesh.GetIdsFromFilter(filter_linear)
+mesh.ConvertToQuadratic()
+
+# get linear and quadratic edges
+ids_linear    = mesh.GetIdsFromFilter(filter_linear)
 ids_quadratic = mesh.GetIdsFromFilter(filter_quadratic)
 print "Number of linear edges:", len(ids_linear), "; number of quadratic edges:", len(ids_quadratic)
 ids_quadratic = mesh.GetIdsFromFilter(filter_quadratic)
 print "Number of linear edges:", len(ids_linear), "; number of quadratic edges:", len(ids_quadratic)
index 6fd9db1fe99560e2c181ec8e6c727031b602cef4..3743dcf06328a6c49ce403426e15ac69fef2a0f0 100755 (executable)
@@ -182,10 +182,10 @@ void  aptrte( Z   nutysu, R      aretmx,
   // majoration empirique du nombre de sommets de la triangulation
   i = 4*nbarfr/10;
   mxsomm = Max( 20000, 64*nbpti+i*i );
   // majoration empirique du nombre de sommets de la triangulation
   i = 4*nbarfr/10;
   mxsomm = Max( 20000, 64*nbpti+i*i );
-  MESSAGE( "APTRTE: Debut de la triangulation plane avec " );
-  MESSAGE( "nutysu=" << nutysu << "  aretmx=" << aretmx
-           << "  mxsomm=" << mxsomm );
-  MESSAGE( nbarfr << " sommets sur la frontiere et " << nbpti << " points internes");
+  // MESSAGE( "APTRTE: Debut de la triangulation plane avec " );
+  // MESSAGE( "nutysu=" << nutysu << "  aretmx=" << aretmx
+  //          << "  mxsomm=" << mxsomm );
+  // MESSAGE( nbarfr << " sommets sur la frontiere et " << nbpti << " points internes");
 
  NEWDEPART:
   //mnpxyd( 3, mxsomm ) les coordonnees UV des sommets et la taille d'arete aux sommets
 
  NEWDEPART:
   //mnpxyd( 3, mxsomm ) les coordonnees UV des sommets et la taille d'arete aux sommets
@@ -366,9 +366,9 @@ void  aptrte( Z   nutysu, R      aretmx,
 //fin  ajout 9/11/2006  .................................................
 
 
 //fin  ajout 9/11/2006  .................................................
 
 
-  MESSAGE("Sur  le  bord: arete min=" << aremin << " arete max=" << aremax );
-  MESSAGE("Triangulation: arete mx=" << aretmx
-          << " triangle aire mx=" << airemx );
+  // MESSAGE("Sur  le  bord: arete min=" << aremin << " arete max=" << aremax );
+  // MESSAGE("Triangulation: arete mx=" << aretmx
+  //         << " triangle aire mx=" << airemx );
 
   //chainage des aretes frontalieres : la derniere arete frontaliere
   mnsoar[ mosoar * noar - mosoar + 5 ] = 0;
 
   //chainage des aretes frontalieres : la derniere arete frontaliere
   mnsoar[ mosoar * noar - mosoar + 5 ] = 0;
@@ -408,7 +408,7 @@ void  aptrte( Z   nutysu, R      aretmx,
   mxtree = 2 * mxsomm;
 
  NEWTREE:  //en cas de saturation de l'un des tableaux, on boucle
   mxtree = 2 * mxsomm;
 
  NEWTREE:  //en cas de saturation de l'un des tableaux, on boucle
-  MESSAGE( "Debut triangulation avec mxsomm=" << mxsomm );
+  //MESSAGE( "Debut triangulation avec mxsomm=" << mxsomm );
   if( mntree != NULL ) delete [] mntree;
   nbsomm = nbarpi;
   mntree = new Z[motree*(1+mxtree)];
   if( mntree != NULL ) delete [] mntree;
   nbsomm = nbarpi;
   mntree = new Z[motree*(1+mxtree)];
@@ -426,13 +426,13 @@ void  aptrte( Z   nutysu, R      aretmx,
     //saturation de letree => sa taille est augmentee et relance
     mxtree = mxtree * 2;
     ierr   = 0;
     //saturation de letree => sa taille est augmentee et relance
     mxtree = mxtree * 2;
     ierr   = 0;
-    MESSAGE( "Nouvelle valeur de mxtree=" << mxtree );
+    //MESSAGE( "Nouvelle valeur de mxtree=" << mxtree );
     goto NEWTREE;
   }
 
   deltacpu_( d );
   tcpu += d;
     goto NEWTREE;
   }
 
   deltacpu_( d );
   tcpu += d;
-  MESSAGE( "Temps de l'ajout arbre-4 des Triangles Equilateraux=" << d << " secondes" );
+  //MESSAGE( "Temps de l'ajout arbre-4 des Triangles Equilateraux=" << d << " secondes" );
   if( ierr != 0 ) goto ERREUR;
   //ici le tableau mnpxyd contient les sommets des te et les points frontaliers et internes
 
   if( ierr != 0 ) goto ERREUR;
   //ici le tableau mnpxyd contient les sommets des te et les points frontaliers et internes
 
@@ -452,8 +452,8 @@ void  aptrte( Z   nutysu, R      aretmx,
 
   deltacpu_( d );
   tcpu += d;
 
   deltacpu_( d );
   tcpu += d;
-  MESSAGE("Temps de l'adaptation et l'homogeneisation de l'arbre-4 des TE="
-       << d << " secondes");
+  //MESSAGE("Temps de l'adaptation et l'homogeneisation de l'arbre-4 des TE="
+       // << d << " secondes");
   if( ierr != 0 )
   {
     //destruction du tableau auxiliaire et de l'arbre
   if( ierr != 0 )
   {
     //destruction du tableau auxiliaire et de l'arbre
@@ -461,7 +461,7 @@ void  aptrte( Z   nutysu, R      aretmx,
     {
       //letree sature
       mxtree = mxtree * 2;
     {
       //letree sature
       mxtree = mxtree * 2;
-      MESSAGE( "Redemarrage avec la valeur de mxtree=" << mxtree );
+      //MESSAGE( "Redemarrage avec la valeur de mxtree=" << mxtree );
       ierr = 0;
       goto NEWTREE;
     }
       ierr = 0;
       goto NEWTREE;
     }
@@ -484,7 +484,7 @@ void  aptrte( Z   nutysu, R      aretmx,
   //Temps calcul
   deltacpu_( d );
   tcpu += d;
   //Temps calcul
   deltacpu_( d );
   tcpu += d;
-  MESSAGE( "Temps de la triangulation des TE=" << d << " secondes" );
+//MESSAGE( "Temps de la triangulation des TE=" << d << " secondes" );
 
   // ierr =0 si pas d'erreur
   //      =1 si le tableau mnsoar est sature
 
   // ierr =0 si pas d'erreur
   //      =1 si le tableau mnsoar est sature
@@ -506,11 +506,11 @@ void  aptrte( Z   nutysu, R      aretmx,
            mosoar, mxsoar, n1soar, mnsoar, na,
            moartr, mxartr, n1artr, mnartr, n );
 
            mosoar, mxsoar, n1soar, mnsoar, na,
            moartr, mxartr, n1artr, mnartr, n );
 
-  MESSAGE( "Nombre d'echanges des diagonales de 2 triangles=" << n );
+//MESSAGE( "Nombre d'echanges des diagonales de 2 triangles=" << n );
   deltacpu_( d );
   tcpu += d;
   deltacpu_( d );
   tcpu += d;
-  MESSAGE("Temps de la triangulation Delaunay par echange des diagonales="
-       << d << " secondes");
+  // MESSAGE("Temps de la triangulation Delaunay par echange des diagonales="
+  //      << d << " secondes");
 
   //qualites de la triangulation actuelle
   qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
 
   //qualites de la triangulation actuelle
   qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
@@ -539,11 +539,11 @@ void  aptrte( Z   nutysu, R      aretmx,
            mxarcf, mn1arcf, mnarcf, mnarcf1, mnarcf2,
            n, ierr );
 
            mxarcf, mn1arcf, mnarcf, mnarcf1, mnarcf2,
            n, ierr );
 
-  MESSAGE( "Restauration de " << n << " aretes perdues de la frontiere  ierr=" << ierr );
+//MESSAGE( "Restauration de " << n << " aretes perdues de la frontiere  ierr=" << ierr );
   deltacpu_( d );
   tcpu += d;
   deltacpu_( d );
   tcpu += d;
-  MESSAGE("Temps de la recuperation des aretes perdues de la frontiere="
-       << d << " secondes");
+//MESSAGE("Temps de la recuperation des aretes perdues de la frontiere="
+//     << d << " secondes");
 
   if( ierr != 0 ) goto ERREUR;
 
 
   if( ierr != 0 ) goto ERREUR;
 
@@ -585,7 +585,7 @@ void  aptrte( Z   nutysu, R      aretmx,
 
   deltacpu_( d );
   tcpu += d;
 
   deltacpu_( d );
   tcpu += d;
-  MESSAGE( "Temps de la suppression des triangles externes=" << d << "ierr=" << ierr );
+//MESSAGE( "Temps de la suppression des triangles externes=" << d << "ierr=" << ierr );
   if( ierr != 0 ) goto ERREUR;
 
   //qualites de la triangulation actuelle
   if( ierr != 0 ) goto ERREUR;
 
   //qualites de la triangulation actuelle
@@ -619,7 +619,7 @@ void  aptrte( Z   nutysu, R      aretmx,
 
   deltacpu_( d );
   tcpu += d;
 
   deltacpu_( d );
   tcpu += d;
-  MESSAGE( "Temps de l'amelioration de la qualite de la triangulation=" << d );
+//MESSAGE( "Temps de l'amelioration de la qualite de la triangulation=" << d );
   if( ierr == -13 ) ierr=0; //6/10/2006 arret de l'amelioration apres boucle infinie dans caetoi
   if( ierr !=   0 ) goto ERREUR;
 
   if( ierr == -13 ) ierr=0; //6/10/2006 arret de l'amelioration apres boucle infinie dans caetoi
   if( ierr !=   0 ) goto ERREUR;
 
@@ -713,11 +713,11 @@ void  aptrte( Z   nutysu, R      aretmx,
     }
   }
   nbt /= nbsttria;  //le nombre final de triangles de la surface
     }
   }
   nbt /= nbsttria;  //le nombre final de triangles de la surface
-  MESSAGE( "APTRTE: Fin de la triangulation plane avec "<<nbst<<" sommets et "
-           << nbt << " triangles" );
+  // MESSAGE( "APTRTE: Fin de la triangulation plane avec "<<nbst<<" sommets et "
+  //          << nbt << " triangles" );
   deltacpu_( d );
   tcpu += d;
   deltacpu_( d );
   tcpu += d;
-  MESSAGE( "APTRTE: Temps total de la triangulation plane=" << tcpu << " secondes" );
+  // MESSAGE( "APTRTE: Temps total de la triangulation plane=" << tcpu << " secondes" );
 
   // destruction des tableaux auxiliaires
   // ------------------------------------
 
   // destruction des tableaux auxiliaires
   // ------------------------------------
@@ -847,20 +847,20 @@ void
 
   //les affichages
   quamoy /= nbtria;
 
   //les affichages
   quamoy /= nbtria;
-  MESSAGE("Qualite moyenne=" << quamoy
-       << "  Qualite minimale=" << quamin
-       << " des " << nbtria << " triangles de surface plane totale="
-       << aire);
+  // MESSAGE("Qualite moyenne=" << quamoy
+  //      << "  Qualite minimale=" << quamin
+  //      << " des " << nbtria << " triangles de surface plane totale="
+  //      << aire);
 
   if( quamin<0.3 )
   {
     //le numero des 3 sommets du triangle ntqmin de qualite minimale
     nusotr(ntqmin, mosoar, mnsoar, moartr, mnartr,  nosotr );
 
   if( quamin<0.3 )
   {
     //le numero des 3 sommets du triangle ntqmin de qualite minimale
     nusotr(ntqmin, mosoar, mnsoar, moartr, mnartr,  nosotr );
-    MESSAGE("Triangle de qualite minimale "<<quamin<<" de sommets:"
-            <<nosotr[0]<<" "<<nosotr[1]<<" "<<nosotr[2]<<" ");
-    for (int i=0;i<3;i++)
-      MESSAGE("Sommet "<<nosotr[i]<<": x="<< mnpxyd[nosotr[i]-1].x
-              <<" y="<< mnpxyd[nosotr[i]-1].y);
+    // MESSAGE("Triangle de qualite minimale "<<quamin<<" de sommets:"
+    //         <<nosotr[0]<<" "<<nosotr[1]<<" "<<nosotr[2]<<" ");
+    // for (int i=0;i<3;i++)
+    //   MESSAGE("Sommet "<<nosotr[i]<<": x="<< mnpxyd[nosotr[i]-1].x
+    //           <<" y="<< mnpxyd[nosotr[i]-1].y);
   }
 
   if( nbtrianeg>0 )
   }
 
   if( nbtrianeg>0 )
index f7f6a807cd84196c9715455be3bc85e91920628b..ada5f91b8ae2f1294fc7c0ce9475546573656549 100644 (file)
@@ -215,7 +215,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   myReversedVProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255. );
 
   my2DActor = SMESH_CellLabelActor::New();
   myReversedVProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255. );
 
   my2DActor = SMESH_CellLabelActor::New();
-  my2DActor->SetStoreGemetryMapping(true);
+  my2DActor->SetStoreClippingMapping(true);
   my2DActor->SetUserMatrix(aMatrix);
   my2DActor->PickableOff();
   my2DActor->SetFontProperties( aFamilyEl, aSizeEl, aBoldEl, anItalicEl, aShadowEl, anRGBEl[0], anRGBEl[1], anRGBEl[2] );
   my2DActor->SetUserMatrix(aMatrix);
   my2DActor->PickableOff();
   my2DActor->SetFontProperties( aFamilyEl, aSizeEl, aBoldEl, anItalicEl, aShadowEl, anRGBEl[0], anRGBEl[1], anRGBEl[2] );
@@ -258,7 +258,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE);
 
   my3DActor = SMESH_CellLabelActor::New();
   aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE);
 
   my3DActor = SMESH_CellLabelActor::New();
-  my3DActor->SetStoreGemetryMapping(true);
+  my3DActor->SetStoreClippingMapping(true);
   my3DActor->SetUserMatrix(aMatrix);
   my3DActor->PickableOff();
   my3DActor->SetFontProperties( aFamilyEl, aSizeEl, aBoldEl, anItalicEl, aShadowEl, anRGBEl[0], anRGBEl[1], anRGBEl[2] );
   my3DActor->SetUserMatrix(aMatrix);
   my3DActor->PickableOff();
   my3DActor->SetFontProperties( aFamilyEl, aSizeEl, aBoldEl, anItalicEl, aShadowEl, anRGBEl[0], anRGBEl[1], anRGBEl[2] );
@@ -324,7 +324,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   myEdgeProp->SetLineWidth(aLineWidth);
 
   my1DActor = SMESH_CellLabelActor::New();
   myEdgeProp->SetLineWidth(aLineWidth);
 
   my1DActor = SMESH_CellLabelActor::New();
-  my1DActor->SetStoreGemetryMapping(true);
+  my1DActor->SetStoreClippingMapping(true);
   my1DActor->SetUserMatrix(aMatrix);
   my1DActor->PickableOff();
   my1DActor->SetHighlited(true);
   my1DActor->SetUserMatrix(aMatrix);
   my1DActor->PickableOff();
   my1DActor->SetHighlited(true);
@@ -372,7 +372,7 @@ SMESH_ActorDef::SMESH_ActorDef()
 
   my0DActor = SMESH_CellLabelActor::New();
   my0DActor->SetUserMatrix(aMatrix);
 
   my0DActor = SMESH_CellLabelActor::New();
   my0DActor->SetUserMatrix(aMatrix);
-  my0DActor->SetStoreGemetryMapping(true);
+  my0DActor->SetStoreClippingMapping(true);
   my0DActor->PickableOff();
   my0DActor->SetFontProperties( aFamilyEl, aSizeEl, aBoldEl, anItalicEl, aShadowEl, anRGBEl[0], anRGBEl[1], anRGBEl[2] );
   my0DActor->SetVisibility(false);
   my0DActor->PickableOff();
   my0DActor->SetFontProperties( aFamilyEl, aSizeEl, aBoldEl, anItalicEl, aShadowEl, anRGBEl[0], anRGBEl[1], anRGBEl[2] );
   my0DActor->SetVisibility(false);
@@ -391,7 +391,7 @@ SMESH_ActorDef::SMESH_ActorDef()
 
   myBallActor = SMESH_CellLabelActor::New();
   myBallActor->SetUserMatrix(aMatrix);
 
   myBallActor = SMESH_CellLabelActor::New();
   myBallActor->SetUserMatrix(aMatrix);
-  myBallActor->SetStoreGemetryMapping(true);
+  myBallActor->SetStoreClippingMapping(true);
   myBallActor->PickableOff();
   myBallActor->SetFontProperties( aFamilyEl, aSizeEl, aBoldEl, anItalicEl, aShadowEl, anRGBEl[0], anRGBEl[1], anRGBEl[2] );
   myBallActor->SetVisibility(false);
   myBallActor->PickableOff();
   myBallActor->SetFontProperties( aFamilyEl, aSizeEl, aBoldEl, anItalicEl, aShadowEl, anRGBEl[0], anRGBEl[1], anRGBEl[2] );
   myBallActor->SetVisibility(false);
@@ -464,6 +464,8 @@ SMESH_ActorDef::SMESH_ActorDef()
   //----------------------------------------------
 
   myBaseActor->SetUserMatrix(aMatrix);
   //----------------------------------------------
 
   myBaseActor->SetUserMatrix(aMatrix);
+  myBaseActor->SetStoreIDMapping(true);
+  myBaseActor->SetStoreClippingMapping(true);
   myBaseActor->SetStoreGemetryMapping(true);
   myBaseActor->GetProperty()->SetOpacity(0.0);
   myPickableActor = myBaseActor;
   myBaseActor->SetStoreGemetryMapping(true);
   myBaseActor->GetProperty()->SetOpacity(0.0);
   myPickableActor = myBaseActor;
@@ -1141,8 +1143,6 @@ void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer)
   {
     myBaseActor->SetUnstructuredGrid( NULL );
     myHighlitableActor->SetUnstructuredGrid( NULL );
   {
     myBaseActor->SetUnstructuredGrid( NULL );
     myHighlitableActor->SetUnstructuredGrid( NULL );
-    // theRenderer->AddActor(this);
-    // cout << "SMESH_ActorDef " << this << endl;
   }
   theRenderer->AddActor(myBaseActor);
   theRenderer->AddActor(myNodeExtActor);
   }
   theRenderer->AddActor(myBaseActor);
   theRenderer->AddActor(myNodeExtActor);
@@ -1972,6 +1972,8 @@ void SMESH_ActorDef::Update()
 {
   if(MYDEBUG) MESSAGE("SMESH_ActorDef::Update");
 
 {
   if(MYDEBUG) MESSAGE("SMESH_ActorDef::Update");
 
+  myVisualObj->Update();
+
   if(GetControlMode() != eNone) {
     unsigned long aTime = myTimeStamp->GetMTime();
     unsigned long anObjTime = myVisualObj->GetUnstructuredGrid()->GetMTime();
   if(GetControlMode() != eNone) {
     unsigned long aTime = myTimeStamp->GetMTime();
     unsigned long anObjTime = myVisualObj->GetUnstructuredGrid()->GetMTime();
index 5bca6fc0a1e126666f4a4a406067ea0017bd102c..afd31449ec82617b6ba99c647c4033c9e3aa0fc8 100644 (file)
@@ -25,6 +25,8 @@
 //
 #include "SMESH_CellLabelActor.h"
 
 //
 #include "SMESH_CellLabelActor.h"
 
+#include "SMESH_ExtractGeometry.h"
+
 #include <VTKViewer_TransformFilter.h>
 #include <VTKViewer_CellCenters.h>
 #include <VTKViewer_ExtractUnstructuredGrid.h>
 #include <VTKViewer_TransformFilter.h>
 #include <VTKViewer_CellCenters.h>
 #include <VTKViewer_ExtractUnstructuredGrid.h>
@@ -47,8 +49,9 @@ vtkStandardNewMacro(SMESH_CellLabelActor);
 /*!
   Constructor.
 */
 /*!
   Constructor.
 */
-SMESH_CellLabelActor::SMESH_CellLabelActor() {
-    //Definition of cells numbering pipeline
+SMESH_CellLabelActor::SMESH_CellLabelActor()
+{
+  //Definition of cells numbering pipeline
   //---------------------------------------
   myCellsNumDataSet = vtkUnstructuredGrid::New();
 
   //---------------------------------------
   myCellsNumDataSet = vtkUnstructuredGrid::New();
 
@@ -58,18 +61,18 @@ SMESH_CellLabelActor::SMESH_CellLabelActor() {
   myClsMaskPoints = vtkMaskPoints::New();
   myClsMaskPoints->SetInputConnection(myCellCenters->GetOutputPort());
   myClsMaskPoints->SetOnRatio(1);
   myClsMaskPoints = vtkMaskPoints::New();
   myClsMaskPoints->SetInputConnection(myCellCenters->GetOutputPort());
   myClsMaskPoints->SetOnRatio(1);
-    
+
   myClsSelectVisiblePoints = vtkSelectVisiblePoints::New();
   myClsSelectVisiblePoints->SetInputConnection(myClsMaskPoints->GetOutputPort());
   myClsSelectVisiblePoints->SelectInvisibleOff();
   myClsSelectVisiblePoints->SetTolerance(0.1);
   myClsSelectVisiblePoints = vtkSelectVisiblePoints::New();
   myClsSelectVisiblePoints->SetInputConnection(myClsMaskPoints->GetOutputPort());
   myClsSelectVisiblePoints->SelectInvisibleOff();
   myClsSelectVisiblePoints->SetTolerance(0.1);
-    
+
   myClsLabeledDataMapper = vtkLabeledDataMapper::New();
   myClsLabeledDataMapper->SetInputConnection(myClsSelectVisiblePoints->GetOutputPort());
 
   myClsLabeledDataMapper->SetLabelFormat("%d");
   myClsLabeledDataMapper->SetLabelModeToLabelScalars();
   myClsLabeledDataMapper = vtkLabeledDataMapper::New();
   myClsLabeledDataMapper->SetInputConnection(myClsSelectVisiblePoints->GetOutputPort());
 
   myClsLabeledDataMapper->SetLabelFormat("%d");
   myClsLabeledDataMapper->SetLabelModeToLabelScalars();
-    
+
   myClsTextProp = vtkTextProperty::New();
   myClsTextProp->SetFontFamilyToTimes();
   myClsTextProp->SetFontSize(12);
   myClsTextProp = vtkTextProperty::New();
   myClsTextProp->SetFontFamilyToTimes();
   myClsTextProp->SetFontSize(12);
@@ -98,7 +101,8 @@ SMESH_CellLabelActor::SMESH_CellLabelActor() {
 /*!
   Destructor.
 */
 /*!
   Destructor.
 */
-SMESH_CellLabelActor::~SMESH_CellLabelActor() {
+SMESH_CellLabelActor::~SMESH_CellLabelActor()
+{
   //Deleting of cells numbering pipeline
   //---------------------------------------
   myCellsNumDataSet->Delete();
   //Deleting of cells numbering pipeline
   //---------------------------------------
   myCellsNumDataSet->Delete();
@@ -139,22 +143,29 @@ void SMESH_CellLabelActor::SetFontProperties( SMESH::LabelFont family, int size,
   myClsTextProp->SetColor( r, g, b ); 
 }
 
   myClsTextProp->SetColor( r, g, b ); 
 }
 
-void SMESH_CellLabelActor::SetCellsLabeled(bool theIsCellsLabeled) {
+void SMESH_CellLabelActor::SetCellsLabeled(bool theIsCellsLabeled)
+{
   myTransformFilter->Update();
   vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::SafeDownCast(myTransformFilter->GetOutput());
   myTransformFilter->Update();
   vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::SafeDownCast(myTransformFilter->GetOutput());
-  if(!aGrid)
+  if ( !aGrid )
     return;
 
   myIsCellsLabeled = theIsCellsLabeled && aGrid->GetNumberOfPoints();
     return;
 
   myIsCellsLabeled = theIsCellsLabeled && aGrid->GetNumberOfPoints();
-  if(myIsCellsLabeled){
+  if ( myIsCellsLabeled )
+  {
     myCellsNumDataSet->ShallowCopy(aGrid);
     vtkUnstructuredGrid *aDataSet = myCellsNumDataSet;
     int aNbElem = aDataSet->GetNumberOfCells();
     vtkIntArray *anArray = vtkIntArray::New();
     anArray->SetNumberOfValues(aNbElem);
     myCellsNumDataSet->ShallowCopy(aGrid);
     vtkUnstructuredGrid *aDataSet = myCellsNumDataSet;
     int aNbElem = aDataSet->GetNumberOfCells();
     vtkIntArray *anArray = vtkIntArray::New();
     anArray->SetNumberOfValues(aNbElem);
-    for(int anId = 0; anId < aNbElem; anId++){
-      vtkIdType id = myExtractUnstructuredGrid->GetInputId(anId);
-      id = (id >=0) ? id : anId; 
+    myExtractUnstructuredGrid->BuildOut2InMap();
+    for(int anId = 0; anId < aNbElem; anId++)
+    {
+      vtkIdType id = anId;
+      if(IsImplicitFunctionUsed())
+        id = myExtractGeometry->GetElemObjId(id);
+      id = myExtractUnstructuredGrid->GetInputId(id);
+      id = (id >=0) ? id : anId;
       int aSMDSId = myVisualObj->GetElemObjId(id);
       anArray->SetValue(anId,aSMDSId);
     }
       int aSMDSId = myVisualObj->GetElemObjId(id);
       anArray->SetValue(anId,aSMDSId);
     }
index 2d632782db5c1fce6ee104e5c18d72eeed2fb0b6..66cb811bf2ae2d9c8f37f8f9f87ae8fa20907b37 100644 (file)
@@ -142,7 +142,7 @@ SMESH_DeviceActor
   if(MYDEBUG) MESSAGE("~SMESH_DeviceActor - "<<this);
 
   myMapper->Delete();
   if(MYDEBUG) MESSAGE("~SMESH_DeviceActor - "<<this);
 
   myMapper->Delete();
-  myPlaneCollection->Delete();
+  // myPlaneCollection->Delete(); -- it is vtkSmartPointer
   myProperty->Delete();
 
   myExtractGeometry->Delete();
   myProperty->Delete();
 
   myExtractGeometry->Delete();
@@ -172,7 +172,8 @@ SMESH_DeviceActor
 ::SetStoreGemetryMapping(bool theStoreMapping)
 {
   myGeomFilter->SetStoreMapping(theStoreMapping);
 ::SetStoreGemetryMapping(bool theStoreMapping)
 {
   myGeomFilter->SetStoreMapping(theStoreMapping);
-  SetStoreClippingMapping(theStoreMapping);
+  // for optimization, switch the mapping explicitly in each filter/algorithm
+  //SetStoreClippingMapping(theStoreMapping);
 }
 
 
 }
 
 
@@ -182,7 +183,10 @@ SMESH_DeviceActor
 {
   myStoreClippingMapping = theStoreMapping;
   myExtractGeometry->SetStoreMapping(theStoreMapping && myIsImplicitFunctionUsed);
 {
   myStoreClippingMapping = theStoreMapping;
   myExtractGeometry->SetStoreMapping(theStoreMapping && myIsImplicitFunctionUsed);
-  SetStoreIDMapping(theStoreMapping);
+  // EAP, 23315
+  // Mapping in myExtractUnstructuredGrid and myGeomFilter is ON in the pickable DeviceActor only.
+  // To show labels, the mapping is computed explicitly via myExtractUnstructuredGrid->BuildOut2InMap();
+  //SetStoreIDMapping(theStoreMapping);
 }
 
 
 }
 
 
@@ -301,8 +305,8 @@ SMESH_DeviceActor
   if(anIsInitialized){
     vtkUnstructuredGrid* aDataSet = vtkUnstructuredGrid::New();
 
   if(anIsInitialized){
     vtkUnstructuredGrid* aDataSet = vtkUnstructuredGrid::New();
 
-    SetStoreIDMapping(true);
-    myExtractUnstructuredGrid->Update();
+    // SetStoreIDMapping(true);
+    // myExtractUnstructuredGrid->Update();
     vtkUnstructuredGrid* aGrid = myExtractUnstructuredGrid->GetOutput();
 
     aDataSet->ShallowCopy(aGrid);
     vtkUnstructuredGrid* aGrid = myExtractUnstructuredGrid->GetOutput();
 
     aDataSet->ShallowCopy(aGrid);
@@ -318,7 +322,9 @@ SMESH_DeviceActor
     using namespace SMESH::Controls;
     if(NumericalFunctor* aNumericalFunctor = dynamic_cast<NumericalFunctor*>(theFunctor.get()))
     {
     using namespace SMESH::Controls;
     if(NumericalFunctor* aNumericalFunctor = dynamic_cast<NumericalFunctor*>(theFunctor.get()))
     {
-      for(vtkIdType i = 0; i < aNbCells; i++){
+      myExtractUnstructuredGrid->BuildOut2InMap();
+      for(vtkIdType i = 0; i < aNbCells; i++)
+      {
         vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i);
         vtkIdType anObjId = myVisualObj->GetElemObjId(anId);
         double aValue = aNumericalFunctor->GetValue(anObjId);
         vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i);
         vtkIdType anObjId = myVisualObj->GetElemObjId(anId);
         double aValue = aNumericalFunctor->GetValue(anObjId);
@@ -334,7 +340,9 @@ SMESH_DeviceActor
     }
     else if(Predicate* aPredicate = dynamic_cast<Predicate*>(theFunctor.get()))
     {
     }
     else if(Predicate* aPredicate = dynamic_cast<Predicate*>(theFunctor.get()))
     {
-      for(vtkIdType i = 0; i < aNbCells; i++){
+      myExtractUnstructuredGrid->BuildOut2InMap();
+      for(vtkIdType i = 0; i < aNbCells; i++)
+      {
         vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i);
         vtkIdType anObjId = myVisualObj->GetElemObjId(anId);
         bool aValue = aPredicate->IsSatisfy(anObjId);
         vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i);
         vtkIdType anObjId = myVisualObj->GetElemObjId(anId);
         bool aValue = aPredicate->IsSatisfy(anObjId);
index 9fd5499b8306c9576c77fa25f349e5a1af7cdc24..74148811fa0e8194e50a0663830cd13d60060a54 100644 (file)
@@ -2671,52 +2671,26 @@ SMDS_Mesh::~SMDS_Mesh()
 void SMDS_Mesh::Clear()
 {
   if (myParent!=NULL)
 void SMDS_Mesh::Clear()
 {
   if (myParent!=NULL)
-    {
+  {
     SMDS_ElemIteratorPtr eIt = elementsIterator();
     while ( eIt->more() )
     SMDS_ElemIteratorPtr eIt = elementsIterator();
     while ( eIt->more() )
-      {
-        const SMDS_MeshElement *elem = eIt->next();
-        myElementIDFactory->ReleaseID(elem->GetID(), elem->getVtkId());
-      }
+    {
+      const SMDS_MeshElement *elem = eIt->next();
+      myElementIDFactory->ReleaseID(elem->GetID(), elem->getVtkId());
+    }
     SMDS_NodeIteratorPtr itn = nodesIterator();
     while (itn->more())
     SMDS_NodeIteratorPtr itn = nodesIterator();
     while (itn->more())
-      {
-        const SMDS_MeshNode *node = itn->next();
-        myNodeIDFactory->ReleaseID(node->GetID(), node->getVtkId());
-      }
+    {
+      const SMDS_MeshNode *node = itn->next();
+      myNodeIDFactory->ReleaseID(node->GetID(), node->getVtkId());
     }
     }
+  }
   else
   else
-    {
+  {
     myNodeIDFactory->Clear();
     myElementIDFactory->Clear();
     myNodeIDFactory->Clear();
     myElementIDFactory->Clear();
-    }
+  }
 
 
-  // SMDS_ElemIteratorPtr itv = elementsIterator();
-  // while (itv->more())
-  //   {
-  //     SMDS_MeshElement* elem = (SMDS_MeshElement*)(itv->next());
-  //     SMDSAbs_ElementType aType = elem->GetType();
-  //     switch (aType)
-  //     {
-  //       case SMDSAbs_0DElement:
-  //         delete elem;
-  //         break;
-  //       case SMDSAbs_Edge:
-  //          myEdgePool->destroy(static_cast<SMDS_VtkEdge*>(elem));
-  //         break;
-  //       case SMDSAbs_Face:
-  //         myFacePool->destroy(static_cast<SMDS_VtkFace*>(elem));
-  //         break;
-  //       case SMDSAbs_Volume:
-  //         myVolumePool->destroy(static_cast<SMDS_VtkVolume*>(elem));
-  //         break;
-  //       case SMDSAbs_Ball:
-  //         myBallPool->destroy(static_cast<SMDS_BallElement*>(elem));
-  //         break;
-  //       default:
-  //         break;
-  //     }
-  //   }
   myVolumePool->clear();
   myFacePool->clear();
   myEdgePool->clear();
   myVolumePool->clear();
   myFacePool->clear();
   myEdgePool->clear();
@@ -2727,11 +2701,11 @@ void SMDS_Mesh::Clear()
 
   SMDS_NodeIteratorPtr itn = nodesIterator();
   while (itn->more())
 
   SMDS_NodeIteratorPtr itn = nodesIterator();
   while (itn->more())
-    {
-      SMDS_MeshNode *node = (SMDS_MeshNode*)(itn->next());
-      node->SetPosition(SMDS_SpacePosition::originSpacePosition());
-      //myNodePool->destroy(node);
-    }
+  {
+    SMDS_MeshNode *node = (SMDS_MeshNode*)(itn->next());
+    node->SetPosition(SMDS_SpacePosition::originSpacePosition());
+    //myNodePool->destroy(node);
+  }
   myNodePool->clear();
   clearVector( myNodes );
 
   myNodePool->clear();
   clearVector( myNodes );
 
@@ -2753,7 +2727,7 @@ void SMDS_Mesh::Clear()
   // rnv: to fix bug "21125: EDF 1233 SMESH: Degrardation of precision in a test case for quadratic conversion"
   // using double type for storing coordinates of nodes instead float.
   points->SetDataType(VTK_DOUBLE);
   // rnv: to fix bug "21125: EDF 1233 SMESH: Degrardation of precision in a test case for quadratic conversion"
   // using double type for storing coordinates of nodes instead float.
   points->SetDataType(VTK_DOUBLE);
-  points->SetNumberOfPoints(0 /*SMDS_Mesh::chunkSize*/);
+  points->SetNumberOfPoints( 0 );
   myGrid->SetPoints( points );
   points->Delete();
   myGrid->DeleteLinks();
   myGrid->SetPoints( points );
   points->Delete();
   myGrid->DeleteLinks();
@@ -2766,7 +2740,7 @@ void SMDS_Mesh::Clear()
 ///////////////////////////////////////////////////////////////////////////////
 bool SMDS_Mesh::hasConstructionEdges()
 {
 ///////////////////////////////////////////////////////////////////////////////
 bool SMDS_Mesh::hasConstructionEdges()
 {
-        return myHasConstructionEdges;
+  return myHasConstructionEdges;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -2778,7 +2752,7 @@ bool SMDS_Mesh::hasConstructionEdges()
 ///////////////////////////////////////////////////////////////////////////////
 bool SMDS_Mesh::hasConstructionFaces()
 {
 ///////////////////////////////////////////////////////////////////////////////
 bool SMDS_Mesh::hasConstructionFaces()
 {
-        return myHasConstructionFaces;
+  return myHasConstructionFaces;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -2787,7 +2761,7 @@ bool SMDS_Mesh::hasConstructionFaces()
 ///////////////////////////////////////////////////////////////////////////////
 bool SMDS_Mesh::hasInverseElements()
 {
 ///////////////////////////////////////////////////////////////////////////////
 bool SMDS_Mesh::hasInverseElements()
 {
-        return myHasInverseElements;
+  return myHasInverseElements;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -2796,7 +2770,7 @@ bool SMDS_Mesh::hasInverseElements()
 ///////////////////////////////////////////////////////////////////////////////
 void SMDS_Mesh::setConstructionEdges(bool b)
 {
 ///////////////////////////////////////////////////////////////////////////////
 void SMDS_Mesh::setConstructionEdges(bool b)
 {
-        myHasConstructionEdges=b;
+  myHasConstructionEdges=b;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -2805,7 +2779,7 @@ void SMDS_Mesh::setConstructionEdges(bool b)
 ///////////////////////////////////////////////////////////////////////////////
 void SMDS_Mesh::setConstructionFaces(bool b)
 {
 ///////////////////////////////////////////////////////////////////////////////
 void SMDS_Mesh::setConstructionFaces(bool b)
 {
-         myHasConstructionFaces=b;
+  myHasConstructionFaces=b;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 }
 
 ///////////////////////////////////////////////////////////////////////////////
index bcd4b4185f147891c3efad49d93ef2f4057d0eb2..094dd4fee537e9492d7cb87778e3eecfceef6bad 100644 (file)
@@ -438,6 +438,7 @@ void SMESH_Mesh::Clear()
       sm->ComputeSubMeshStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
     }
   }
       sm->ComputeSubMeshStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
     }
   }
+  GetMeshDS()->Modified();
   _isModified = false;
 }
 
   _isModified = false;
 }
 
index 3794e7231bb9467f4280864eb06880a0a6fb84a1..44195b8c8d748ec8c2061a04058112ae9a384466 100644 (file)
@@ -299,7 +299,6 @@ void SMESH_Mesh_i::Clear() throw (SALOME::SALOME_Exception)
   catch(SALOME_Exception & S_ex) {
     THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
   }
   catch(SALOME_Exception & S_ex) {
     THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
   }
-  _impl->GetMeshDS()->Modified();
 
   TPythonDump() <<  SMESH::SMESH_Mesh_var(_this()) << ".Clear()";
 }
 
   TPythonDump() <<  SMESH::SMESH_Mesh_var(_this()) << ".Clear()";
 }
index cec7eb822b0a6f608d7ecb4fbb38b067d94a0df4..47146139fa0c16b943fc66c86d09b71c6850ea53 100644 (file)
@@ -2518,7 +2518,7 @@ class Mesh:
         return self.mesh.GetElementShape(id)
 
     ## Returns the list of submesh elements IDs
         return self.mesh.GetElementShape(id)
 
     ## Returns the list of submesh elements IDs
-    #  @param Shape a geom object(sub-shape) IOR
+    #  @param Shape a geom object(sub-shape)
     #         Shape must be the sub-shape of a ShapeToMesh()
     #  @return the list of integer values
     #  @ingroup l1_meshinfo
     #         Shape must be the sub-shape of a ShapeToMesh()
     #  @return the list of integer values
     #  @ingroup l1_meshinfo
@@ -2530,7 +2530,7 @@ class Mesh:
         return self.mesh.GetSubMeshElementsId(ShapeID)
 
     ## Returns the list of submesh nodes IDs
         return self.mesh.GetSubMeshElementsId(ShapeID)
 
     ## Returns the list of submesh nodes IDs
-    #  @param Shape a geom object(sub-shape) IOR
+    #  @param Shape a geom object(sub-shape)
     #         Shape must be the sub-shape of a ShapeToMesh()
     #  @param all If true, gives all nodes of submesh elements, otherwise gives only submesh nodes
     #  @return the list of integer values
     #         Shape must be the sub-shape of a ShapeToMesh()
     #  @param all If true, gives all nodes of submesh elements, otherwise gives only submesh nodes
     #  @return the list of integer values
@@ -2543,7 +2543,7 @@ class Mesh:
         return self.mesh.GetSubMeshNodesId(ShapeID, all)
 
     ## Returns type of elements on given shape
         return self.mesh.GetSubMeshNodesId(ShapeID, all)
 
     ## Returns type of elements on given shape
-    #  @param Shape a geom object(sub-shape) IOR
+    #  @param Shape a geom object(sub-shape)
     #         Shape must be a sub-shape of a ShapeToMesh()
     #  @return element type
     #  @ingroup l1_meshinfo
     #         Shape must be a sub-shape of a ShapeToMesh()
     #  @return element type
     #  @ingroup l1_meshinfo