#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
-#include <SMESH_version.h>
+#include "SMESH_version.h"
#include "SMESH_ControlsDef.hxx"
-#include <SMESH_Actor.h>
-#include <SMESH_ActorUtils.h>
-#include <SMESH_Client.hxx>
-#include <SMESH_ScalarBarActor.h>
-#include <SMESH_TypeFilter.hxx>
+#include "SMESH_Actor.h"
+#include "SMESH_ActorUtils.h"
+#include "SMESH_Client.hxx"
+#include "SMESH_ScalarBarActor.h"
+#include "SMESH_TypeFilter.hxx"
// SALOME GUI includes
#include <SalomeApp_Application.h>
return RefType;
}
+ uint randomize( uint size )
+ {
+ static bool initialized = false;
+ if ( !initialized ) {
+ qsrand( QDateTime::currentDateTime().toTime_t() );
+ initialized = true;
+ }
+ uint v = qrand();
+ v = uint( (double)( v ) / RAND_MAX * size );
+ v = qMax( uint(0), qMin ( v, size-1 ) );
+ return v;
+ }
+
} //namespace
void SMESHGUI::OnEditDelete()
_PTR(Study) study = appStudy->studyDS();
_PTR(SObject) obj = study->FindObjectID( io->getEntry() );
if ( obj ) {
- QString aName = QString( QString::fromUtf8(obj->GetName().c_str()) );
+ QString aName = QString( SMESH::fromUtf8(obj->GetName()) );
while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of Popup
aName.remove( (aName.length() - 1), 1 );
title = aName;
_PTR(SObject) obj = study->FindObjectID( entry.toLatin1().constData() );
QString name;
if ( obj )
- name = QString::fromUtf8(obj->GetName().c_str());
+ name = SMESH::fromUtf8(obj->GetName());
if ( name.isEmpty() )
return;
}
}
}
- static int currentColor = 0;
+ static int currentColor = randomize( colors.size() );
SALOMEDS::Color color;
color.R = (double)colors[currentColor].red() / 255.0;