Salome HOME
Fix compilation problems under windows.
[modules/smesh.git] / src / OBJECT / SMESH_ActorUtils.cxx
index c756156e01e9f23f8170508e89770b7439085b1f..203f7931be9664c192c4c1cf4dc76c01e3a3e862 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  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 );
@@ -157,17 +157,17 @@ 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,
+  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,int>(SMDSAbs_Ball,
+    entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_Ball,
                 theObject ? theObject->GetNbEntities(SMDSAbs_Ball) : 0));
-    entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Edge,
+    entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_Edge,
                 theObject ? theObject->GetNbEntities(SMDSAbs_Edge) : 0));
-    entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Face,
+    entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_Face,
                 theObject ? theObject->GetNbEntities(SMDSAbs_Face) : 0));
-    entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Volume,
+    entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_Volume,
                 theObject ? theObject->GetNbEntities(SMDSAbs_Volume) : 0));
     return entities;
   }