Salome HOME
Copyright update 2022
[modules/smesh.git] / src / OBJECT / SMESH_ActorUtils.cxx
index bb9fd64b185324fea24f498371bd67a37bedc711..d58acaa4651b3a7535cf3a14c0a216b3ab4868d6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 namespace SMESH
 {
 
-  vtkFloatingPointType
+  double
   GetFloat( const QString& theValue, 
-            vtkFloatingPointType theDefault )
+            double theDefault )
   {
     int pos = theValue.indexOf( ":" );
-    vtkFloatingPointType val = theDefault;
+    double val = theDefault;
     if( pos>=0 ) 
     {
       QString name = theValue.right( theValue.length()-pos-1 ),
@@ -71,15 +71,15 @@ namespace SMESH
     return val;
   }
 
-  vtkFloatingPointType
+  double
   GetFloat( const QString& theValue, 
             const QString& theSection, 
-            vtkFloatingPointType theDefault )
+            double theDefault )
   {
-    vtkFloatingPointType val = theDefault;
+    double val = theDefault;
     SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
     if( mgr )
-      val = (vtkFloatingPointType) mgr->doubleValue( theSection, theValue, theDefault );
+      val = (double) mgr->doubleValue( theSection, theValue, theDefault );
 
     return val;
   }
@@ -90,7 +90,7 @@ namespace SMESH
   {
     vtkXMLUnstructuredGridWriter* aWriter = vtkXMLUnstructuredGridWriter::New();
     aWriter->SetFileName(theFileName);
-    aWriter->SetInput(theGrid);
+    aWriter->SetInputData(theGrid);
     aWriter->SetDataModeToAscii();
     if(theGrid->GetNumberOfCells()){
       aWriter->Write();
@@ -129,9 +129,9 @@ namespace SMESH
   void
   GetColor( const QString& theSect, 
             const QString& theName, 
-            vtkFloatingPointType& r, 
-            vtkFloatingPointType& g, 
-            vtkFloatingPointType& b, 
+            double& r, 
+            double& g, 
+            double& b, 
             const QColor& def )
   {
     int ir( 0 ), ig( 0 ), ib( 0 );
@@ -144,10 +144,10 @@ namespace SMESH
 
   void
   GetColor(  const QString& theSect, 
-            const QString& theName, 
-            QColor& color,
-            int& delta,
-            QString def) 
+             const QString& theName, 
+             QColor& color,
+             int& delta,
+             QString def) 
   {
     
     SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
@@ -157,18 +157,18 @@ namespace SMESH
     }
   }
 
-  std::map<SMDSAbs_ElementType,int> GetEntitiesFromObject(SMESH_VisualObj *theObject) {
-    std::map<SMDSAbs_ElementType,int> entities;
-    entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_0DElement,
-               theObject ? theObject->GetNbEntities(SMDSAbs_0DElement) : 0));
-    entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Ball,
-               theObject ? theObject->GetNbEntities(SMDSAbs_Ball) : 0));
-    entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Edge,
-               theObject ? theObject->GetNbEntities(SMDSAbs_Edge) : 0));
-    entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Face,
-               theObject ? theObject->GetNbEntities(SMDSAbs_Face) : 0));
-    entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Volume,
-               theObject ? theObject->GetNbEntities(SMDSAbs_Volume) : 0));
+  std::map<SMDSAbs_ElementType,::smIdType> GetEntitiesFromObject(SMESH_VisualObj *theObject) {
+    std::map<SMDSAbs_ElementType,::smIdType> entities;
+    entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_0DElement,
+                theObject ? theObject->GetNbEntities(SMDSAbs_0DElement) : 0));
+    entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_Ball,
+                theObject ? theObject->GetNbEntities(SMDSAbs_Ball) : 0));
+    entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_Edge,
+                theObject ? theObject->GetNbEntities(SMDSAbs_Edge) : 0));
+    entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_Face,
+                theObject ? theObject->GetNbEntities(SMDSAbs_Face) : 0));
+    entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_Volume,
+                theObject ? theObject->GetNbEntities(SMDSAbs_Volume) : 0));
     return entities;
   }