-// Copyright (C) 2004-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2004-2015 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
#include <sys/sysinfo.h>
#endif
- int maxAvailableMemory()
+ long maxAvailableMemory()
{
#ifdef WIN32
// See http://msdn.microsoft.com/en-us/library/aa366589.aspx
MEMORYSTATUSEX statex;
statex.dwLength = sizeof (statex);
- int err = GlobalMemoryStatusEx (&statex);
+ long err = GlobalMemoryStatusEx (&statex);
if (err != 0) {
- int totMB =
+ long totMB =
statex.ullTotalPhys / 1024 / 1024 +
statex.ullTotalPageFile / 1024 / 1024 +
statex.ullTotalVirtual / 1024 / 1024;
- return (int) ( 0.7 * totMB );
+ return (long) ( 0.7 * totMB );
}
#else
struct sysinfo si;
- int err = sysinfo( &si );
+ long err = sysinfo( &si );
if ( err == 0 ) {
- int totMB =
+ long totMB =
si.totalram * si.mem_unit / 1024 / 1024 +
si.totalswap * si.mem_unit / 1024 / 1024 ;
- return (int) ( 0.7 * totMB );
+ return (long) ( 0.7 * totMB );
}
#endif
return 0;
myAdvWidget->maxMemoryCheck->setText(tr( "MAX_MEMORY_SIZE" ));
myAdvWidget->initialMemoryCheck->setText(tr( "INIT_MEMORY_SIZE" ));
- myAdvWidget->maxMemorySpin->RangeStepAndValidator(20.0, 1e6, 10.0);
- myAdvWidget->maxMemorySpin->setValue( 128.0 );
+ myAdvWidget->maxMemorySpin->stepBy(10);
+ myAdvWidget->maxMemorySpin->setValue( 128 );
- myAdvWidget->initialMemorySpin->RangeStepAndValidator(0.0, 1e6, 10.0);
- myAdvWidget->initialMemorySpin->setValue( 100.0 );
+ myAdvWidget->initialMemorySpin->stepBy(10);
+ myAdvWidget->initialMemorySpin->setValue( 100 );
myAdvWidget->initialMemoryLabel ->setText (tr( "MEGABYTE" ));
myAdvWidget->maxMemoryLabel ->setText (tr( "MEGABYTE" ));
shapeTypes.Add( TopAbs_COMPOUND );
SMESH_NumberFilter* vertexFilter = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 1, shapeTypes);
- myEnfVertexWdg = new StdMeshersGUI_ObjectReferenceParamWdg( vertexFilter, 0, /*multiSel=*/true, /*stretch=*/false);
+ myEnfVertexWdg = new StdMeshersGUI_ObjectReferenceParamWdg( vertexFilter, 0, /*multiSel=*/true);
myEnfVertexWdg->SetDefaultText(tr("GHS3D_ENF_SELECT_VERTEX"), "QLineEdit { color: grey }");
QLabel* myXCoordLabel = new QLabel( tr( "GHS3D_ENF_VER_X_LABEL" ), myEnfGroup );
break;
- if (( !isCompound && ((itemX == x) && (itemY == y) && (itemZ == z))) || /*( (itemEntry.toStdString() != "") && */ (itemEntry.toStdString() == geomEntry)/*)*/) {
+ if (( !isCompound && ((itemX == x) && (itemY == y) && (itemZ == z))) ||
+ ( !itemEntry.isEmpty() && ( itemEntry == geomEntry.c_str() )))
+ {
// update size
if (itemSize != size) {
MESSAGE("Size is updated from \"" << itemSize << "\" to \"" << size << "\"");
if (selEnfVertex == 1) {
MESSAGE("1 GEOM object selected");
myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >();
- std::string entry = "";
- if (myEnfVertex != GEOM::GEOM_Object::_nil())
- entry = myEnfVertex->GetStudyEntry();
- addEnforcedVertex(x, y, z, size, myEnfVertex->GetName(),entry, groupName, myEnfVertex->GetShapeType() == GEOM::COMPOUND);
+ std::string entry = "", name = "";
+ bool isCompound = false;
+ if ( !myEnfVertex->_is_nil() ) {
+ entry = SMESH::toStdStr( myEnfVertex->GetStudyEntry() );
+ name = SMESH::toStdStr( myEnfVertex->GetName() );
+ isCompound = ( myEnfVertex->GetShapeType() == GEOM::COMPOUND );
+ }
+ addEnforcedVertex(x, y, z, size, name, entry, groupName, isCompound);
}
else {
MESSAGE("0 GEOM object selected");
myToMakeGroupsOfDomains ->setChecked ( data.myToMakeGroupsOfDomains );
myOptimizationLevelCombo ->setCurrentIndex( data.myOptimizationLevel );
myAdvWidget->maxMemoryCheck ->setChecked ( data.myMaximumMemory > 0 );
- myAdvWidget->maxMemorySpin ->setValue ( qMax( data.myMaximumMemory,
+ myAdvWidget->maxMemorySpin ->setValue ( qMax( (int)data.myMaximumMemory,
myAdvWidget->maxMemorySpin->minimum() ));
myAdvWidget->initialMemoryCheck ->setChecked ( data.myInitialMemory > 0 );
- myAdvWidget->initialMemorySpin ->setValue ( qMax( data.myInitialMemory,
+ myAdvWidget->initialMemorySpin ->setValue ( qMax( (int)data.myInitialMemory,
myAdvWidget->initialMemorySpin->minimum() ));
myAdvWidget->workingDirectoryLineEdit ->setText ( data.myWorkingDir );
myAdvWidget->keepWorkingFilesCheck ->setChecked ( data.myKeepFiles );