-// VISU OBJECT : interactive object for VISU entities implementation
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_ResultUtils.cc
// Author : Alexey PETROV
// Module : VISU
-
+//
#include "VISU_ResultUtils.hh"
#include "SUIT_Session.h"
-#include "SALOME_Event.hxx"
+#include "SALOME_Event.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
#include "VISU_Convertor.hxx"
#include "VISU_ConvertorUtils.hxx"
-#include <qfileinfo.h>
-#include <qfile.h>
-#include <qdir.h>
+#include <QFileInfo>
+#include <QFile>
+#include <QDir>
#include <boost/thread/recursive_mutex.hpp>
#include <boost/thread/thread.hpp>
static int MYTIMEDEBUG = 0;
#endif
+using namespace std;
+
namespace VISU
{
//----------------------------------------------------------------------------
{
TLock aLock(myMutex);
SUIT_Session* aSession = SUIT_Session::session();
- QPtrList<SUIT_Application> anApplications = aSession->applications();
- QPtrListIterator<SUIT_Application> anIter (anApplications);
- while (SUIT_Application* aSApp = anIter.current()) {
+ QList<SUIT_Application*> anApplications = aSession->applications();
+ QListIterator<SUIT_Application*> anIter (anApplications);
+ while (anIter.hasNext()) {
+ SUIT_Application* aSApp = anIter.next();
if(SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aSApp)){
if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy())) {
if (_PTR(Study) aCStudy = aStudy->studyDS()) {
}
}
}
- ++anIter;
}
}
QString aResult;
if (anIter == aMap.end()) {
aMap[theName] = 0;
- aResult = theName;
+ aResult = theName.c_str();
} else {
aResult = GenerateName(theName,++aMap[theName]);
}
aName = QString("%1, -").arg(theName.c_str());
else
aName = QString("%1, %2").arg(theName.c_str()).arg(theUnits.c_str());
- aName = aName.simplifyWhiteSpace();
- return aName.latin1();
+ aName = aName.simplified();
+ return aName;
}
NO_IOR,
aMeshName,
NO_PERFSITENT_REF,
- aComment.latin1(),
+ aComment.toLatin1().data(),
true);
aComment = QString("myComment=FAMILIES;myMeshName=%1").arg(aMeshName.c_str());
NO_IOR,
"Families",
NO_PERFSITENT_REF,
- aComment.latin1(),
+ aComment.toLatin1().data(),
true);
if(theIsBuildGroups){
NO_IOR,
anEntityName.c_str(),
NO_PERFSITENT_REF,
- aComment.latin1(),
+ aComment.toLatin1().data(),
true);
}
}
NO_IOR,
aFamilyName,
NO_PERFSITENT_REF,
- aComment.latin1(),
+ aComment.toLatin1().data(),
true);
}
}
NO_IOR,
"Groups",
NO_PERFSITENT_REF,
- aComment.latin1(),
+ aComment.toLatin1().data(),
false);
TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
NO_IOR,
aGroupName,
NO_PERFSITENT_REF,
- aComment.latin1(),
+ aComment.toLatin1().data(),
true);
const TFamilySet& aFamilySet = aGroup->myFamilySet;
TFamilySet::const_iterator aFamilyIter = aFamilySet.begin();
{
aComment = "";
aComment.append("myComment=FIELDS;");
- aComment.append("myMeshName=");aComment.append(aMeshName);
+ aComment.append("myMeshName=");aComment.append(aMeshName.c_str());
CreateAttributes(theStudy,
aMesh->myFieldsEntry,
NO_IOR,
"Fields",
NO_PERFSITENT_REF,
- aComment.latin1(),
+ aComment.toLatin1().data(),
false);
anIsFieldsEntryUpdated = true;
aMesh->myFieldsEntry,
NO_ICON,
NO_IOR,
- aFieldNameWithUnit.latin1(),
+ aFieldNameWithUnit.toLatin1().data(),
NO_PERFSITENT_REF,
- aComment.latin1(),
+ aComment.toLatin1().data(),
true);
CreateReference(theStudy,
NO_IOR,
aTimeStampId,
NO_PERFSITENT_REF,
- aComment.latin1(),
+ aComment.toLatin1().data(),
true);
}
}
RemoveFile(const std::string& theFileName,
bool theRemoveEmptyDir)
{
- QFileInfo aFileInfo(theFileName);
- QFile(aFileInfo.absFilePath()).remove();
+ QFileInfo aFileInfo(theFileName.c_str());
+ QFile(aFileInfo.absoluteFilePath()).remove();
if(theRemoveEmptyDir)
- QDir().rmdir(aFileInfo.dirPath(TRUE));
+ QDir().rmdir(aFileInfo.absolutePath());
return aFileInfo.exists();
}
CopyFile(const std::string& theSourceFileName,
const std::string& theTargetFileName)
{
- QFileInfo aSourceFileInfo(theSourceFileName);
- QFileInfo aTargetFileInfo(theTargetFileName);
- if(aSourceFileInfo.absFilePath() == aTargetFileInfo.absFilePath())
+ QFileInfo aSourceFileInfo(theSourceFileName.c_str());
+ QFileInfo aTargetFileInfo(theTargetFileName.c_str());
+ if(aSourceFileInfo.absoluteFilePath() == aTargetFileInfo.absoluteFilePath())
return true;
QString aCommand;
aCommand.sprintf("%s %s %s",
COPY_COMMAND,
- aSourceFileInfo.filePath().latin1(),
- aTargetFileInfo.filePath().latin1());
+ aSourceFileInfo.filePath().toLatin1().data(),
+ aTargetFileInfo.filePath().toLatin1().data());
- return system(aCommand.latin1()) == 0;
+ return system(aCommand.toLatin1().data()) == 0;
}