Salome HOME
[bos #40653][CEA] New mesh import export formats with meshio.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_IdPreview.cxx
index f3871d1733729484d047bc8851ab0d1969a15f6e..308cf0d5ac2a7fe8089ff085b0a008b597758f83 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 
 #include "SMESHGUI_IdPreview.h"
 
-#include <SALOME_Actor.h>
 #include <SMDS_Mesh.hxx>
+
+#include <SALOME_Actor.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
 #include <SVTK_ViewWindow.h>
 
-#include <TColStd_MapOfInteger.hxx>
 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
 
 #include <vtkActor2D.h>
@@ -72,21 +74,27 @@ SMESHGUI_IdPreview::SMESHGUI_IdPreview(SVTK_ViewWindow* theViewWindow):
   myPtsSelectVisiblePoints->SetInputConnection(myPtsMaskPoints->GetOutputPort());
   myPtsSelectVisiblePoints->SelectInvisibleOff();
   myPtsSelectVisiblePoints->SetTolerance(0.1);
-    
+
   myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
   myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort());
   myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
-    
+
   vtkTextProperty* aPtsTextProp = vtkTextProperty::New();
   aPtsTextProp->SetFontFamilyToTimes();
-  static int aPointsFontSize = 12;
+  int aPointsFontSize = 12;
+  if ( SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr() )
+    if ( mgr->hasValue( "SMESH", "numbering_node_font" ) )
+    {
+      QFont f = mgr->fontValue( "SMESH", "numbering_node_font" );
+      aPointsFontSize = f.pointSize();
+    }
   aPtsTextProp->SetFontSize(aPointsFontSize);
   aPtsTextProp->SetBold(1);
   aPtsTextProp->SetItalic(0);
   aPtsTextProp->SetShadow(0);
   myPtsLabeledDataMapper->SetLabelTextProperty(aPtsTextProp);
   aPtsTextProp->Delete();
-  
+
   myIsPointsLabeled = false;
 
   myPointLabels = vtkActor2D::New();
@@ -98,13 +106,13 @@ SMESHGUI_IdPreview::SMESHGUI_IdPreview(SVTK_ViewWindow* theViewWindow):
 }
 
 void SMESHGUI_IdPreview::SetPointsData ( SMDS_Mesh*                   theMesh,
-                                         const TColStd_MapOfInteger & theNodesIdMap )
+                                         const SVTK_TVtkIDsMap & theNodesIdMap )
 {
   vtkPoints* aPoints = vtkPoints::New();
   aPoints->SetNumberOfPoints(theNodesIdMap.Extent());
   myIDs.clear();
 
-  TColStd_MapIteratorOfMapOfInteger idIter( theNodesIdMap );
+  SVTK_TVtkIDsMapIterator idIter( theNodesIdMap );
   for( int i = 0; idIter.More(); idIter.Next(), i++ )
   {
     const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key());