From 01d58dcb9273e7649c30253735ea3d1fc74770da Mon Sep 17 00:00:00 2001 From: mkr Date: Fri, 24 Mar 2006 11:49:44 +0000 Subject: [PATCH] Modifications to avoid compilation errors about conversion between std::string and QString. --- src/VISUGUI/VisuGUI_GaussPointsDlg.cxx | 4 +- src/VISUGUI/VisuGUI_Module.cxx | 42 +++++++++---------- src/VISUGUI/VisuGUI_PopupTools.cxx | 2 +- src/VISUGUI/VisuGUI_ScalarBarDlg.cxx | 4 +- .../VisuGUI_ScalarMapOnDeformedShapeDlg.cxx | 2 +- src/VISUGUI/VisuGUI_TimeAnimation.h | 3 ++ src/VVTK/VVTK_Recorder.cxx | 2 +- src/VVTK/VVTK_SegmentationCursorDlg.cxx | 2 +- 8 files changed, 32 insertions(+), 29 deletions(-) diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx index 7492c7f5..bfe5bb0d 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx @@ -314,13 +314,13 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs) const VISU::TNames& aCompNames = aField->myCompNames; const VISU::TNames& aUnitNames = aField->myUnitNames; for(int i = 0; i < aNbComp; i++){ - QString aComponent = QString(aCompNames[i]).simplifyWhiteSpace(); + QString aComponent = QString(aCompNames[i].c_str()).simplifyWhiteSpace(); if(aComponent.isNull() || aComponent == "") aComponent = "Component " + QString::number(i+1); else aComponent = "[" + QString::number(i+1) + "] " + aComponent; - QString anUnit = QString(aUnitNames[i]).simplifyWhiteSpace(); + QString anUnit = QString(aUnitNames[i].c_str()).simplifyWhiteSpace(); if(anUnit.isNull() || anUnit == "") anUnit = "-"; diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 743559b5..e5b5b060 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -1020,37 +1020,37 @@ namespace float aColor[3]; vtkRenderer* aRenderer = theViewWindow->getRenderer(); aRenderer->GetBackground(aColor); - Storable::DataToStream(theStr,std::string("myColor") + theSuffix + ".R",aColor[0]); - Storable::DataToStream(theStr,std::string("myColor") + theSuffix + ".G",aColor[1]); - Storable::DataToStream(theStr,std::string("myColor") + theSuffix + ".B",aColor[2]); + Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".R").c_str(),aColor[0]); + Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".G").c_str(),aColor[1]); + Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".B").c_str(),aColor[2]); double aPosition[3]; vtkCamera* aCamera = aRenderer->GetActiveCamera(); aCamera->GetPosition(aPosition); - Storable::DataToStream(theStr,std::string("myPosition") + theSuffix + "[0]",aPosition[0]); - Storable::DataToStream(theStr,std::string("myPosition") + theSuffix + "[1]",aPosition[1]); - Storable::DataToStream(theStr,std::string("myPosition") + theSuffix + "[2]",aPosition[2]); + Storable::DataToStream(theStr,(std::string("myPosition") + theSuffix + "[0]").c_str(),aPosition[0]); + Storable::DataToStream(theStr,(std::string("myPosition") + theSuffix + "[1]").c_str(),aPosition[1]); + Storable::DataToStream(theStr,(std::string("myPosition") + theSuffix + "[2]").c_str(),aPosition[2]); double aFocalPnt[3]; aCamera->GetFocalPoint(aFocalPnt); - Storable::DataToStream(theStr,std::string("myFocalPnt") + theSuffix + "[0]",aFocalPnt[0]); - Storable::DataToStream(theStr,std::string("myFocalPnt") + theSuffix + "[1]",aFocalPnt[1]); - Storable::DataToStream(theStr,std::string("myFocalPnt") + theSuffix + "[2]",aFocalPnt[2]); + Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[0]").c_str(),aFocalPnt[0]); + Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[1]").c_str(),aFocalPnt[1]); + Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[2]").c_str(),aFocalPnt[2]); double aViewUp[3]; aCamera->GetViewUp(aViewUp); - Storable::DataToStream(theStr,std::string("myViewUp") + theSuffix + "[0]",aViewUp[0]); - Storable::DataToStream(theStr,std::string("myViewUp") + theSuffix + "[1]",aViewUp[1]); - Storable::DataToStream(theStr,std::string("myViewUp") + theSuffix + "[2]",aViewUp[2]); + Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[0]").c_str(),aViewUp[0]); + Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[1]").c_str(),aViewUp[1]); + Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[2]").c_str(),aViewUp[2]); float aParallelScale = aCamera->GetParallelScale(); - Storable::DataToStream(theStr,std::string("myParallelScale") + theSuffix,aParallelScale); + Storable::DataToStream(theStr,(std::string("myParallelScale") + theSuffix).c_str(),aParallelScale); double aScaleFactor[3]; theViewWindow->GetScale(aScaleFactor); - Storable::DataToStream(theStr,std::string("myScaleFactor") + theSuffix + "[0]",aScaleFactor[0]); - Storable::DataToStream(theStr,std::string("myScaleFactor") + theSuffix + "[1]",aScaleFactor[1]); - Storable::DataToStream(theStr,std::string("myScaleFactor") + theSuffix + "[2]",aScaleFactor[2]); + Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[0]").c_str(),aScaleFactor[0]); + Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[1]").c_str(),aScaleFactor[1]); + Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[2]").c_str(),aScaleFactor[2]); } //--------------------------------------------------------------- @@ -1137,7 +1137,7 @@ namespace aSegmentationMode = "Sphere"; } - Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode); + Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode.c_str()); } } @@ -1789,7 +1789,7 @@ std::string getParam( const std::string& paramName, const int index ) { QStringList lst = QStringList::split( gSeparator, QString( paramName.c_str() ) ); if ( !lst.isEmpty() && index < lst.size() ) - return lst[index]; + return lst[index].latin1(); return ""; } @@ -1856,13 +1856,13 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) viewerType == VVTK_Viewer::Type().latin1() ) { // used as inner map key for locating the actor. - QString viewerTypeIndex = viewerType + QString::number( viewIndex ); + QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex ); if ( paramName == "Visibility" && displayer() ) { // if VVTK, then we must create viewer first, because QPtrList lst; - getApp()->viewManagers( viewerType, lst ); + getApp()->viewManagers( viewerType.c_str(), lst ); // SVTK/VVTK ViewManager always has 1 ViewWindow, so view index is index of view manager if ( viewIndex >= 0 && viewIndex < lst.count() ) { @@ -1946,7 +1946,7 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) if ( paramName == "Visibility" && displayer() ) { QPtrList lst; - getApp()->viewManagers( viewerType, lst ); + getApp()->viewManagers( viewerType.c_str(), lst ); if ( viewIndex >= 0 && viewIndex < lst.count() ) { SUIT_ViewManager* vman = lst.at( viewIndex ); diff --git a/src/VISUGUI/VisuGUI_PopupTools.cxx b/src/VISUGUI/VisuGUI_PopupTools.cxx index 624662df..20c99b44 100644 --- a/src/VISUGUI/VisuGUI_PopupTools.cxx +++ b/src/VISUGUI/VisuGUI_PopupTools.cxx @@ -174,7 +174,7 @@ QString VisuGUI_Selection::medEntity( const int ind ) const QString VisuGUI_Selection::medSource( const int ind ) const { _PTR(Study) aStudyDS = GetStudy()->studyDS(); - if(_PTR(SObject) aSObject = aStudyDS->FindObjectID(entry(ind))){ + if(_PTR(SObject) aSObject = aStudyDS->FindObjectID(entry(ind).latin1())){ VISU::Result_var aRes; if(VISU::Result_i* aResult = CheckResult(myModule,aSObject,aRes)){ using namespace VISU; diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx index 54c96b88..d6f49d89 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx @@ -576,13 +576,13 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) { const VISU::TNames& aCompNames = aField->myCompNames; const VISU::TNames& aUnitNames = aField->myUnitNames; for(int i = 0; i < aNbComp; i++){ - QString aComponent = QString(aCompNames[i]).simplifyWhiteSpace(); + QString aComponent = QString(aCompNames[i].c_str()).simplifyWhiteSpace(); if(aComponent.isNull() || aComponent == "") aComponent = "Component " + QString::number(i+1); else aComponent = "[" + QString::number(i+1) + "] " + aComponent; - QString anUnit = QString(aUnitNames[i]).simplifyWhiteSpace(); + QString anUnit = QString(aUnitNames[i].c_str()).simplifyWhiteSpace(); if(anUnit.isNull() || anUnit == "") anUnit = "-"; diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx index 54f79c9c..3aac42a0 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx @@ -159,7 +159,7 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject setFactor(myPrs->GetScale()); myTimeStampsCombo->setDisabled(isAnim); - QString aFieldName(myPrs->GetScalarFieldName()); + QString aFieldName(myPrs->GetScalarFieldName().c_str()); float aIterFloat = GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(), myPrs->GetScalarFieldName().c_str(), myPrs->GetScalarIteration(), diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.h b/src/VISUGUI/VisuGUI_TimeAnimation.h index 53191604..4d2cea5f 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.h +++ b/src/VISUGUI/VisuGUI_TimeAnimation.h @@ -19,6 +19,9 @@ #include #include +#include +#include + class VisuGUI; class VISU_TimeAnimation; diff --git a/src/VVTK/VVTK_Recorder.cxx b/src/VVTK/VVTK_Recorder.cxx index e9c734e9..f5e9b477 100755 --- a/src/VVTK/VVTK_Recorder.cxx +++ b/src/VVTK/VVTK_Recorder.cxx @@ -449,7 +449,7 @@ VVTK_Recorder if(MYDEBUG) cout<<"VVTK_Recorder::MakeFileAVI - "<second; -- 2.39.2