Salome HOME
bos #20256: [CEA 18523] Porting SMESH to int 64 bits
[plugins/ghs3dplugin.git] / src / GUI / GHS3DPluginGUI_HypothesisCreator.cxx
index 2775a8acc3fbe81386b812da8c4bc8b71fc732ca..4023eec6ef5dda5d0a39ecfbbf23977e76415dd5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2004-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2004-2021  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -833,7 +833,7 @@ void GHS3DPluginGUI_HypothesisCreator::updateEnforcedVertexValues(QTableWidgetIt
 
 void GHS3DPluginGUI_HypothesisCreator::onSelectEnforcedVertex()
 {
-  int nbSelEnfVertex = myEnfVertexWdg->NbObjects();
+  size_t nbSelEnfVertex = myEnfVertexWdg->NbObjects();
   clearEnforcedVertexWidgets();
   if (nbSelEnfVertex == 1)
   {
@@ -1038,7 +1038,7 @@ void GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex(double x, double y, dou
 {
   myEnforcedTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
   bool okToCreate = true;
-  double itemX,itemY,itemZ,itemSize = 0;
+  double itemX=0.,itemY=0.,itemZ=0.,itemSize = 0;
   QString itemEntry, itemGroupName = QString("");
   //   bool itemIsCompound;
   int rowCount = myEnforcedTableWidget->rowCount();
@@ -1195,7 +1195,7 @@ void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
     myEnforcedMeshTableWidget->resizeColumnToContents(column);
 
   // Vertex selection
-  int selEnfMeshes = myEnfMeshWdg->NbObjects();
+  size_t selEnfMeshes = myEnfMeshWdg->NbObjects();
   if (selEnfMeshes == 0)
     return;
 
@@ -1250,7 +1250,7 @@ void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex()
     myEnforcedTableWidget->resizeColumnToContents(column);
 
   // Vertex selection
-  int selEnfVertex = myEnfVertexWdg->NbObjects();
+  size_t selEnfVertex = myEnfVertexWdg->NbObjects();
   bool coordsEmpty = (myXCoord->text().isEmpty()) || (myYCoord->text().isEmpty()) || (myZCoord->text().isEmpty());
   if ((selEnfVertex == 0) && coordsEmpty)
     return;
@@ -1292,7 +1292,7 @@ void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex()
       return;
 
     CORBA::Double x = 0, y = 0,z = 0;
-    for (int j = 0 ; j < selEnfVertex ; j++)
+    for ( size_t j = 0 ; j < selEnfVertex ; j++)
     {
       myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(j);
       if (myEnfVertex == GEOM::GEOM_Object::_nil())
@@ -1365,7 +1365,7 @@ void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex()
   myEnforcedTableWidget->selectionModel()->clearSelection();
 }
 
-void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool isOn)
+void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool /*isOn*/)
 {
   // myToMakeGroupsOfDomains->setEnabled( isOn );
   // if ( !isOn )
@@ -1791,13 +1791,13 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD
     if( isCreation() )
       SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().constData() );
 
-    h->SetOptimizationLevel           ( h_data.myOptimizationLevel );
+    h->SetOptimizationLevel           ((CORBA::Short) h_data.myOptimizationLevel );
     h->SetMinSize                     ( h_data.myUseMinSize ? h_data.myMinSize : 0 );
     h->SetMaxSize                     ( h_data.myUseMaxSize ? h_data.myMaxSize : 0 );
     h->SetMinMaxSizeDefault           ( this->myMinSizeDefault, this->myMaxSizeDefault );
     h->SetGradation                   ( h_data.myGradation         );
     h->SetVolumeProximity             ( h_data.myUseProximity      );
-    h->SetNbVolumeProximityLayers     ( h_data.myNbProximityLayers );
+    h->SetNbVolumeProximityLayers     ((CORBA::Short) h_data.myNbProximityLayers );
     h->SetToMeshHoles                 ( h_data.myToMeshHoles       );
     h->SetToMakeGroupsOfDomains       ( h_data.myToMakeGroupsOfDomains );
 
@@ -1820,7 +1820,7 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD
       opt->SetSplitOverConstrained  ( (GHS3DPlugin::Mode) h_data.mySplitOverConstrained );
       opt->SetPThreadsMode          ( (GHS3DPlugin::PThreadsMode) h_data.myPThreadsMode );
       opt->SetSmoothOffSlivers      ( h_data.mySmoothOffSlivers );
-      opt->SetMaximalNumberOfThreads( h_data.myNumberOfThreads );
+      opt->SetMaximalNumberOfThreads((CORBA::Short) h_data.myNumberOfThreads );
     }
 
     // Enforced vertices
@@ -1864,7 +1864,7 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD
       _PTR(SObject) aSObj = aStudy->FindObjectID(enfMesh->entry.c_str());
       SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
 
-      SMESH::ElementType elementType;
+      SMESH::ElementType elementType = SMESH::NODE;
       switch(enfMesh->elementType) {
       case 0:
         elementType = SMESH::NODE;
@@ -1916,11 +1916,11 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets( GHS3DHypothesisDat
     h_data.myToMeshHoles           = myToMeshHolesCheck->isChecked();
     h_data.myToMakeGroupsOfDomains = myToMakeGroupsOfDomains->isChecked();
   }
-  h_data.myMaximumMemory           = myAdvWidget->maxMemoryCheck->isChecked() ? myAdvWidget->maxMemorySpin->value() : -1;
-  h_data.myInitialMemory           = myAdvWidget->initialMemoryCheck->isChecked() ? myAdvWidget->initialMemorySpin->value() : -1;
+  h_data.myMaximumMemory           = float( myAdvWidget->maxMemoryCheck->isChecked() ? myAdvWidget->maxMemorySpin->value() : -1 );
+  h_data.myInitialMemory           = float( myAdvWidget->initialMemoryCheck->isChecked() ? myAdvWidget->initialMemorySpin->value() : -1 );
   h_data.myKeepFiles               = myAdvWidget->keepWorkingFilesCheck->isChecked();
   h_data.myWorkingDir              = myAdvWidget->workingDirectoryLineEdit->text().trimmed();
-  h_data.myVerboseLevel            = myAdvWidget->verboseLevelSpin->value();
+  h_data.myVerboseLevel            = short( myAdvWidget->verboseLevelSpin->value() );
   h_data.myLogInStandardOutput     = !myAdvWidget->logInFileCheck->isChecked();
   h_data.myRemoveLogOnSuccess      = myAdvWidget->removeLogOnSuccessCheck->isChecked();