-// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2022 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
double size,
int row ) const
{
- MESSAGE("HexoticPluginGUI_HypothesisCreator:insertLocalSizeInWidget")
+ MESSAGE("HexoticPluginGUI_HypothesisCreator:insertLocalSizeInWidget");
int columnCount = mySmpWidget->tableWidget->columnCount();
// Add a row at the end of the table
{
// Remove the selected rows in the table
QList<QTableWidgetSelectionRange> ranges = mySmpWidget->tableWidget->selectedRanges();
- if ( ranges.isEmpty() ) // If none is selected remove the last one
+ if ( ranges.isEmpty() && mySmpWidget->tableWidget->rowCount() > 0) // If none is selected remove the last one
{
int lastRow = mySmpWidget->tableWidget->rowCount() - 1;
std::string entry = mySmpWidget->tableWidget->item( lastRow, ENTRY_COL )->text().toStdString();
{
std::string entry = mySmpWidget->tableWidget->item( row, ENTRY_COL )->text().toStdString();
mySizeMapsToRemove.push_back(entry);
- MESSAGE("ADDING entry : "<<entry<<"to the Size Maps to remove")
+ MESSAGE("ADDING entry : "<<entry<<"to the Size Maps to remove");
}
mySmpWidget->tableWidget->model()->removeRows(it->topRow(), it->rowCount());
}
GEOM::GEOM_Object_var anObject = entryToObject( entry );
std::string shapeName = anObject->GetName();
- MESSAGE(" Insert local size, entry : "<<entry<<", size : "<<size<<", at row : "<<row)
+ MESSAGE(" Insert local size, entry : "<<entry<<", size : "<<size<<", at row : "<<row);
insertLocalSizeInWidget( entry, shapeName, size , row );
}
std::string entry = CORBA::string_dup(aSizeMap.entry.in());
double size = aSizeMap.size;
h_data.mySizeMaps[ entry ] = size;
- MESSAGE("READING Size map : entry "<<entry<<" size : "<<size)
+ MESSAGE("READING Size map : entry "<<entry<<" size : "<<size);
}
// Viscous layers
for ( it = h_data.mySizeMaps.begin(); it != h_data.mySizeMaps.end(); it++ )
{
h->SetSizeMapEntry( it->first.c_str(), it->second );
- MESSAGE("STORING Size map : entry "<<it->first.c_str()<<" size : "<<it->second)
+ MESSAGE("STORING Size map : entry "<<it->first.c_str()<<" size : "<<it->second);
}
std::vector< std::string >::const_iterator entry_it;
for ( entry_it = mySizeMapsToRemove.begin(); entry_it!= mySizeMapsToRemove.end(); entry_it++ )
// Set the size maps
h_data.mySizeMaps[ entry ] = size;
- MESSAGE("READING Size map from WIDGET: entry "<<entry<<" size : "<<size)
+ MESSAGE("READING Size map from WIDGET: entry "<<entry<<" size : "<<size);
}
return true;
}
GEOM::GEOM_Object_var HexoticPluginGUI_HypothesisCreator::entryToObject( std::string entry) const
{
GEOM::GEOM_Object_var aGeomObj;
- SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( entry.c_str() );
+ SALOMEDS::SObject_var aSObj = SMESH_Gen_i::GetSMESHGen()->getStudyServant()->FindObjectID( entry.c_str() );
if (!aSObj->_is_nil()) {
CORBA::Object_var obj = aSObj->GetObject();
aGeomObj = GEOM::GEOM_Object::_narrow(obj);