using namespace std;
#include "VISU_Convertor.hxx"
+#include <fstream>
+#include <strstream>
#include <vtkCellType.h>
#include <qdir.h>
#include <qfileinfo.h>
}
}
-const VISU::TMesh* VISU_Convertor::GetMesh(const string& theMeshName) const {
- string aMeshName(theMeshName == ""? myMeshMap.begin()->first: theMeshName);
- VISU::TMeshMap::const_iterator aMeshMapIter = myMeshMap.find(theMeshName);
- if(aMeshMapIter == myMeshMap.end()) return NULL;
- return &(aMeshMapIter->second);
+const VISU::TMeshMap& VISU_Convertor::GetMeshMap() throw(std::runtime_error&){
+ if(!myIsDone) { myIsDone = true; Build();}
+ return myMeshMap;
}
-const VISU::TField* VISU_Convertor::GetField(const string& theMeshName, VISU::TEntity theEntity,
- const string& theFieldName) const
+const VISU::TField& VISU_Convertor::GetField(const string& theMeshName,
+ VISU::TEntity theEntity,
+ const string& theFieldName)
+ throw (std::runtime_error&)
{
+ if(!myIsDone) { myIsDone = true; Build();}
VISU::TMeshMap::const_iterator aMeshMapIter = myMeshMap.find(theMeshName);
- if(aMeshMapIter == myMeshMap.end()) return NULL;
+ if(aMeshMapIter == myMeshMap.end())
+ throw std::runtime_error("GetField >> There is no mesh with the name !!!");
const VISU::TMesh& aMesh = aMeshMapIter->second;
VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMesh.myMeshOnEntityMap.find(theEntity);
- if(aMeshOnEntityMapIter == aMesh.myMeshOnEntityMap.end()) return NULL;
+ if(aMeshOnEntityMapIter == aMesh.myMeshOnEntityMap.end())
+ throw std::runtime_error("GetField >> There is no mesh with the entity !!!");
const VISU::TMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
const VISU::TFieldMap& aFieldMap = aMeshOnEntity.myFieldMap;
VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.find(theFieldName);
- if(aFieldMapIter == aFieldMap.end()) return NULL;
- return &(aFieldMapIter->second);
+ if(aFieldMapIter == aFieldMap.end())
+ throw std::runtime_error("GetField >> There is no field with the name !!!");
+ return aFieldMapIter->second;
}
string VISU_Convertor::GenerateName(const VISU::TField::TTime& aTime){
void parseFile(const char* theFileName) throw(std::runtime_error&){
try{
auto_ptr<VISU_Convertor> aCon(CreateConvertor(theFileName));
- const VISU::TMeshMap& aMeshMap = *(aCon->GetMeshMap());
+ const VISU::TMeshMap& aMeshMap = aCon->GetMeshMap();
VISU::TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
const string& aMeshName = aMeshMapIter->first;
return 0;
}
}catch(std::runtime_error& exc){
- MESSAGE("Follow exception was accured :\n"<<exc.what());
+ cout<<"Follow exception was accured :\n"<<exc.what()<<endl;
}catch(...){
- MESSAGE("Unknown exception was accured in VISU_Convertor_impl");
+ cout<<"Unknown exception was accured in VISU_Convertor_impl"<<endl;
}
return 1;
}
extern TVtkCellInfoMap aVtkCellInfoMap;
enum TEntity {NODE_ENTITY, EDGE_ENTITY, FACE_ENTITY, CELL_ENTITY};
+ //enum TEntity {CELL_ENTITY, FACE_ENTITY, EDGE_ENTITY, NODE_ENTITY};
template <class _Tp> class vtk_ptr {
private:
_Tp* _M_ptr;
protected:
std::string myName;
VISU::TMeshMap myMeshMap;
+ int myIsDone;
public:
virtual ~VISU_Convertor(){};
+ virtual const string& GetName() { return myName;}
+ virtual int IsDone() const { return myIsDone;}
typedef vtkUnstructuredGridReader OutputType;
- const char* GetName() { return myName.c_str();}
-
+ virtual VISU_Convertor* Build() throw (std::runtime_error&) = 0;
virtual OutputType* GetMeshOnEntity(const string& theMeshName,
const VISU::TEntity& theEntity,
const string& theFamilyName = "")
throw(std::runtime_error&) = 0;
-
virtual OutputType* GetMeshOnGroup(const string& theMeshName,
const string& theGroupName)
throw(std::runtime_error&) = 0;
-
virtual OutputType* GetFieldOnMesh(const string& theMeshName,
const VISU::TEntity& theEntity,
const string& theFieldName,
int theStampsNum)
throw(std::runtime_error&) = 0;
-
- virtual int ToMedFile(const string& theFileName) throw(std::runtime_error&) = 0;
- virtual int ToDatFile(const string& theFileName) throw(std::runtime_error&) = 0;
- virtual int ToFile(const string& theFileName) throw(std::runtime_error&) = 0;
-
- const VISU::TMeshMap* GetMeshMap() const { return &myMeshMap;}
- const VISU::TMesh* GetMesh(const string& theMeshName = "") const;
- const VISU::TField* GetField(const string& theMeshName, VISU::TEntity theEntity,
- const string& theFieldName) const;
+ virtual const VISU::TMeshMap& GetMeshMap() throw(std::runtime_error&);
+ virtual const VISU::TField& GetField(const string& theMeshName, VISU::TEntity theEntity,
+ const string& theFieldName)
+ throw(std::runtime_error&);
static string GenerateName(const VISU::TField::TTime& aTime);
static string GenerateName(const string& theName, unsigned int theTimeId);
};
}
}
-int VISU_Convertor_impl::ToFile(const string& theFileName) throw(std::runtime_error&){
- if(QFileInfo(theFileName.c_str()).extension(false) == "med")
- return ToMedFile(theFileName);
- else
- return ToDatFile(theFileName);
+VISU_Convertor_impl::VISU_Convertor_impl() {
+ myIsDone = false;
}
-VISU_Convertor_impl::VISU_Convertor_impl() : myIsDone(false) {}
-
VISU_Convertor_impl::~VISU_Convertor_impl() {}
VISU_Convertor::OutputType* VISU_Convertor_impl::GetMeshOnEntity(const string& theMeshName,
const string& theFamilyName)
throw (std::runtime_error&)
{
+ if(!myIsDone) { myIsDone = true; Build();}
if(MYDEBUG)
MESSAGE("GetMeshOnEntity - theMeshName = '"<<theMeshName<<
"'; theEntity = "<<theEntity<<"; theFamilyName = '"<<theFamilyName<<"'");
strCellsOut<<ends;
strTypesOut<<ends;
strOut<<"CELLS "<<aNbCells<<"\t"<<aCellsSize<<endl;
- strOut<<strCellsOut.str()<<endl;
+ auto_ptr<char> aRet(strCellsOut.str());
+ strOut<<aRet.get()<<endl;
strOut<<"CELL_TYPES "<<aNbCells<<endl;
- strOut<<strTypesOut.str()<<endl;
+ aRet.reset(strTypesOut.str());
+ strOut<<aRet.get()<<endl;
strOut<<ends;
aReader.reset(OutputType::New());
//aReader = OutputType::New();
//aReader->DebugOn();
aReader->ReadFromInputStringOn();
- aReader->SetInputString(strOut.str());
+ aRet.reset(strOut.str());
+ aReader->SetInputString(aRet.get());
//aReader->Update();
//aReader->Print(cout);
if(MYDEBUGWITHFILES){
string aFileName = string("/users/")+getenv("USER")+"/"+getenv("USER")+"-";
aFileName += aMeshName + dtos("-%d-",theEntity) + aFamilyName + "-Conv.vtk";
ofstream stmOut(aFileName.c_str(),ios::out);
- stmOut<<strOut.str();
+ stmOut<<aRet.get();
}
}
return aReader.get();
const string& theGroupName)
throw(std::runtime_error&)
{
+ if(!myIsDone) { myIsDone = true; Build();}
if(MYDEBUG) MESSAGE("GetMeshOnGroup - theMeshName = '"<<theMeshName<<
"'; theGroupName = '"<<theGroupName<<"'");
//Cheching possibility do the query
strCellsOut<<ends;
strTypesOut<<ends;
strOut<<"CELLS "<<aNbCells<<"\t"<<aCellsSize<<endl;
- strOut<<strCellsOut.str()<<endl;
+ auto_ptr<char> aRet(strCellsOut.str());
+ strOut<<aRet.get()<<endl;
strOut<<"CELL_TYPES "<<aNbCells<<endl;
- strOut<<strTypesOut.str()<<endl;
+ aRet.reset(strTypesOut.str());
+ strOut<<aRet.get()<<endl;
strOut<<ends;
aReader.reset(OutputType::New());
//aReader = OutputType::New();
aReader->ReadFromInputStringOn();
- aReader->SetInputString(strOut.str());
+ aRet.reset(strOut.str());
+ aReader->SetInputString(aRet.get());
if(MYDEBUGWITHFILES){
string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
string aGroupName = QString(theGroupName.c_str()).simplifyWhiteSpace().latin1();
string aFileName = string("/users/")+getenv("USER")+"/"+getenv("USER")+"-";
aFileName += aMeshName + "-" + aGroupName + "-Conv.vtk";
ofstream stmOut(aFileName.c_str(),ios::out);
- stmOut<<strOut.str();
+ stmOut<<aRet.get();
}
}
return aReader.get();
int theStampsNum)
throw(std::runtime_error&)
{
+ if(!myIsDone) { myIsDone = true; Build();}
if(MYDEBUG){
MESSAGE("GetFieldOnMesh - theMeshName = '"<<theMeshName<<"; theEntity = "<<theEntity);
MESSAGE("GetFieldOnMesh - theFieldName = '"<<theFieldName<<"'; theStampsNum = "<<theStampsNum);
strCellsOut<<ends;
strTypesOut<<ends;
strOut<<"CELLS "<<aNbCells<<"\t"<<aCellsSize<<endl;
- strOut<<strCellsOut.str()<<endl;
+ auto_ptr<char> aRet(strCellsOut.str());
+ strOut<<aRet.get()<<endl;
strOut<<"CELL_TYPES "<<aNbCells<<endl;
- strOut<<strTypesOut.str()<<endl;
+ aRet.reset(strTypesOut.str());
+ strOut<<aRet.get()<<endl;
int aNbPoints = aMesh.myPointsCoord.size()/aMesh.myDim;
strOut<<GetField(aField,aValForTime,aMesh.myDim,aNbPoints,aNbCells);
+ strOut<<ends;
aReader.reset(OutputType::New());
//aReader = OutputType::New();
aReader->ReadFromInputStringOn();
- aReader->SetInputString(strOut.str());
+ aRet.reset(strOut.str());
+ aReader->SetInputString(aRet.get());
if(MYDEBUGWITHFILES){
string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
string aFieldName = QString(theFieldName.c_str()).simplifyWhiteSpace().latin1();
string aFileName = string("/users/")+getenv("USER")+"/"+getenv("USER")+"-";
aFileName += aMeshName + dtos("-%d-",theEntity) + aFieldName + dtos("-%d",theStampsNum) + "-Conv.vtk";
ofstream stmOut(aFileName.c_str(),ios::out);
- stmOut<<strOut.str();
+ stmOut<<aRet.get();
}
}
return aReader.get();
VISU::TMeshOnEntity::TCellsConn::const_iterator aCellsConnIter = aCellsConn.begin();
for(; aCellsConnIter != aCellsConn.end(); aCellsConnIter++){
const VISU::TMeshOnEntity::TConnForCellType& anArray = aCellsConnIter->second;
- if(MYDEBUG) MESSAGE("GetCells - anArray.size() = "<<anArray.size());
int aVtkType = aCellsConnIter->first;
+ if(MYDEBUG) MESSAGE("GetCells - aVtkType = "<<aVtkType<<"; anArray.size() = "<<anArray.size());
if(!isFamilyPresent)
for(int j = 0, jEnd = anArray.size(); j < jEnd; j++)
PrintCells(strCellsOut,anArray[j],strTypesOut,aVtkType);
else{
const VISU::TFamily::TSubMesh& aSubMesh = aFamily.mySubMesh;
+ if(aSubMesh.empty()) throw std::runtime_error("GetCells >> There is no elements on the family !!!");
VISU::TFamily::TSubMesh::const_iterator aSubMeshIter = aSubMesh.find(aVtkType);
+ if(aSubMeshIter == aSubMesh.end()) continue;
const VISU::TFamily::TSubMeshOnCellType& aSubMeshOnCellType = aSubMeshIter->second;
+ if(MYDEBUG) MESSAGE("GetCells - aSubMeshOnCellType.size() = "<<aSubMeshOnCellType.size());
VISU::TFamily::TSubMeshOnCellType::const_iterator aSubMeshOnCellTypeIter = aSubMeshOnCellType.begin();
for(; aSubMeshOnCellTypeIter != aSubMeshOnCellType.end(); aSubMeshOnCellTypeIter++)
PrintCells(strCellsOut,anArray[*aSubMeshOnCellTypeIter],strTypesOut,aVtkType);
strOut<<"ASCII\n";
strOut<<"DATASET UNSTRUCTURED_GRID\n";
strOut<<ends;
- return strOut.str();
+ auto_ptr<char> aRet(strOut.str());
+ return aRet.get();
}
string VISU_Convertor_impl::GetPoints(const VISU::TMesh& theMesh) const
break;
}
strOut<<ends;
- return strOut.str();
+ auto_ptr<char> aRet(strOut.str());
+ return aRet.get();
}
string VISU_Convertor_impl::GetField(const VISU::TField& theField,
throw std::runtime_error("GetField - There is algorithm for representation the field !!!");
}
strOut<<ends;
- return strOut.str();
+ auto_ptr<char> aRet(strOut.str());
+ return aRet.get();
}
using namespace std;
class VISU_Convertor_impl: public VISU_Convertor{
- protected:
- bool myIsDone;
private:
string GetHead(const string& theMeshName) const throw (std::runtime_error&);
string GetPoints(const VISU::TMesh& theMesh) const throw (std::runtime_error&);
VISU_Convertor_impl();
virtual ~VISU_Convertor_impl();
virtual VISU_Convertor* Build() throw (std::runtime_error&) { return this;};
- virtual int ToMedFile(const string& theFileName) throw(std::runtime_error&);
- virtual int ToDatFile(const string& theFileName) throw(std::runtime_error&);
- virtual int ToFile(const string& theFileName) throw(std::runtime_error&);
-
virtual OutputType* GetMeshOnEntity(const string& theMeshName,
const VISU::TEntity& theEntity,
const string& theFamilyName = "")
#include <med.h>
}
-
namespace VISUMED{
struct TFamily{
SALOME_MED::FAMILY_var myFamily;
}
#endif
+
return 0;
}
+/*
int VISU_Convertor_impl::ToDatFile(const string& theFileName) throw(std::runtime_error&){
- /*
if(MYDEBUG) MESSAGE("VISU_Convertor_impl::ToDatFile - "<<theFileName);
if(!myIsDone && Build() != NULL) myIsDone = true;
ofstream stmOut(theFileName.c_str(),ios::out);
}
}
}
- */
return 1;
}
+*/
switch(myType){
case VISU::TENTITY :
myInput = myResult->GetInput()->GetMeshOnEntity(myMeshName,(VISU::TEntity)myEntity);
- aComment.sprintf("myComment=ENTITY;myType=%d;myResultName=%s;myMeshName=%s;myId=%d",
- VISU::TENTITY,myResult->GetName(),myMeshName.c_str(),myEntity);
+ aComment.sprintf("myComment=ENTITY;myType=%d;myMeshName=%s;myId=%d",
+ VISU::TENTITY,myMeshName.c_str(),myEntity);
break;
case VISU::TFAMILY :
myInput = myResult->GetInput()->GetMeshOnEntity(myMeshName,(VISU::TEntity)myEntity,mySubMeshName);
- aComment.sprintf("myComment=FAMILY;myType=%d;myResultName=%s;myMeshName=%s;myEntityId=%d;myName=%s",
- VISU::TFAMILY,myResult->GetName(),myMeshName.c_str(),myEntity,mySubMeshName.c_str());
+ aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s",
+ VISU::TFAMILY,myMeshName.c_str(),myEntity,mySubMeshName.c_str());
break;
case VISU::TGROUP :
myInput = myResult->GetInput()->GetMeshOnGroup(myMeshName,mySubMeshName);
- aComment.sprintf("myComment=GROUP;myType=%d;myResultName=%s;myMeshName=%s;myName=%s",
- VISU::TGROUP,myResult->GetName(),myMeshName.c_str(),mySubMeshName.c_str());
+ aComment.sprintf("myComment=GROUP;myType=%d;myMeshName=%s;myName=%s",
+ VISU::TGROUP,myMeshName.c_str(),mySubMeshName.c_str());
break;
}
if(myInput == NULL) throw std::runtime_error("Mesh_i::Build - myInput == NULL !!!");
}
}
-
//==============================================================================
int VISU::DeformedShape_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, double theIteration){
- if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration)) return 0;
- const VISU::TField* aField = theResult->GetInput()->GetField(theMeshName,(VISU::TEntity)theEntity,theFieldName);
- return aField->myNbComp > 1;
+ try{
+ if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration)) return 0;
+ const VISU::TField& aField = theResult->GetInput()->GetField(theMeshName,(VISU::TEntity)theEntity,theFieldName);
+ return aField.myNbComp > 1;
+ }catch(std::runtime_error& exc){
+ MESSAGE("Follow exception was accured :\n"<<exc.what());
+ }catch(...){
+ MESSAGE("Unknown exception was accured!");
+ }
+ return 0;
}
int VISU::DeformedShape_i::myNbPresent = 0;
const char* theFieldName, double theIteration);
InputType* GetInput() { return myInput;}
+ virtual void Update();
const VISU::TField* GetField() const { return myField;}
const string& GetFieldName() const { return myFieldName;}
int GetScalarMode() const { return myScalarMode;}
aStudyBuilder->Addreference(newObj,aRefSObj);
}
+string GetComponentDataType(SALOMEDS::SObject_ptr theSObject){
+ SALOMEDS::SComponent_var aCompRefSObj = theSObject->GetFatherComponent();
+ CORBA::String_var aDataType = aCompRefSObj->ComponentDataType();
+ return aDataType.in();
+}
+
//==============================================================================
const string VISU::Result_i::myComment = "RESULT";
VISU::Result_i::Result_i(SALOMEDS::Study_ptr theStudy) {
myStudyDocument = SALOMEDS::Study::_duplicate(theStudy);
+ myInput = NULL;
}
-VISU::Storable* VISU::Result_i::Build() {
+VISU::Storable* VISU::Result_i::Build(SALOMEDS::SObject_ptr theSObject)
+ throw (std::runtime_error&)
+{
if(MYDEBUG) MESSAGE("Result_i::Build");
const TMeshMap& aMeshMap = myInput->GetMeshMap();
if(!aMeshMap.empty()) {//apo
CreateAttributes(myStudyDocument,aEntity2Entry[anEntity].c_str(),aRefFatherEntry.c_str(),
"",aFamilyName.c_str(),"",aComment.latin1(),true);
}
- //Importing groups
- const VISU::TGroupMap& aGroupMap = aMesh.myGroupMap;
- if(aGroupMap.size() > 0){
- aComment.sprintf("myComment=GROUPS;myResultName=%s;myMeshName=%s",myName.c_str(),aMeshName.c_str());
- string aGroupsEntry = CreateAttributes(myStudyDocument,aMeshEntry.c_str(),aRefFatherEntry.c_str(),
- "","Groups","",aComment.latin1(),true);
- VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
- for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
- const string& aGroupName = aGroupMapIter->first;
- aComment.sprintf("myComment=GROUP;myType=%d;myResultName=%s;myMeshName=%s;myName=%s",
- VISU::TGROUP,myName.c_str(),aMeshName.c_str(),aGroupName.c_str());
- string aGroupEntry = CreateAttributes(myStudyDocument,aGroupsEntry.c_str(),aRefFatherEntry.c_str(),
- "",aGroupName.c_str(),"",aComment.latin1(),true);
- const VISU::TGroup& aGroup = aGroupMapIter->second;
- const VISU::TFamilyAndEntitySet& aFamilyAndEntitySet = aGroup.myFamilyAndEntitySet;
- VISU::TFamilyAndEntitySet::const_iterator aFamilyAndEntitySetIter = aFamilyAndEntitySet.begin();
- for(; aFamilyAndEntitySetIter != aFamilyAndEntitySet.end(); aFamilyAndEntitySetIter++){
- const VISU::TFamilyAndEntity& aFamilyAndEntity = *aFamilyAndEntitySetIter;
- const string& aFamilyName = aFamilyAndEntity.first;
- const VISU::TEntity& anEntity = aFamilyAndEntity.second;
- aComment.sprintf("myComment=FAMILY;myType=%d;myResultName=%s;myMeshName=%s;myEntityId=%d;myName=%s",
- VISU::TFAMILY,myName.c_str(),aMeshName.c_str(),anEntity,aFamilyName.c_str());
- string anEntry = FindEntryWithComment(myStudyDocument,aEntity2Entry[anEntity].c_str(),aComment);
- CreateReference(myStudyDocument,aGroupEntry,anEntry);
- }
+ }
+ //Importing groups
+ const VISU::TGroupMap& aGroupMap = aMesh.myGroupMap;
+ if(aGroupMap.size() > 0){
+ aComment.sprintf("myComment=GROUPS;myMeshName=%s",aMeshName.c_str());
+ string aGroupsEntry = CreateAttributes(myStudyDocument,aMeshEntry.c_str(),aRefFatherEntry.c_str(),
+ "","Groups","",aComment.latin1(),true);
+ VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
+ for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
+ const string& aGroupName = aGroupMapIter->first;
+ aComment.sprintf("myComment=GROUP;myType=%d;myMeshName=%s;myName=%s",
+ VISU::TGROUP,aMeshName.c_str(),aGroupName.c_str());
+ string aGroupEntry = CreateAttributes(myStudyDocument,aGroupsEntry.c_str(),aRefFatherEntry.c_str(),
+ "",aGroupName.c_str(),"",aComment.latin1(),true);
+ const VISU::TGroup& aGroup = aGroupMapIter->second;
+ const VISU::TFamilyAndEntitySet& aFamilyAndEntitySet = aGroup.myFamilyAndEntitySet;
+ VISU::TFamilyAndEntitySet::const_iterator aFamilyAndEntitySetIter = aFamilyAndEntitySet.begin();
+ for(; aFamilyAndEntitySetIter != aFamilyAndEntitySet.end(); aFamilyAndEntitySetIter++){
+ const VISU::TFamilyAndEntity& aFamilyAndEntity = *aFamilyAndEntitySetIter;
+ const string& aFamilyName = aFamilyAndEntity.first;
+ const VISU::TEntity& anEntity = aFamilyAndEntity.second;
+ aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s",
+ VISU::TFAMILY,aMeshName.c_str(),anEntity,aFamilyName.c_str());
+ string anEntry = FindEntryWithComment(myStudyDocument,aEntity2Entry[anEntity].c_str(),aComment);
+ CreateReference(myStudyDocument,aGroupEntry,anEntry);
}
}
}
{
if(MYDEBUG) MESSAGE("Result_i::Restore - "<<thePrefix);
try{
- myIsRestored = 1;
mySObject = SALOMEDS::SObject::_duplicate(theSObject);
myStudyDocument = mySObject->GetStudy();
mySComponent = mySObject->GetFatherComponent();
void ImportTables(const char* theFileName, TTableCont& theTableCont){
ifstream aStmIn;
+ QFileInfo aFileInfo(theFileName);
+ if(!aFileInfo.isFile() || !aFileInfo.isReadable() || !aFileInfo.size()) return;
aStmIn.open(theFileName);
QString aTmp;
do{
aName.replace(aPos, 1, "_");
aFile += aName;
aFile += ".jpeg";
- //cout<<"### save:"<<aFile<<endl;
px.save(aFile, "JPEG");
}
if (!isDumping) {
string aComm(aString);
if(MYDEBUG) MESSAGE("View3D_i::SaveViewPoint - aComm = "<<aComm);
if(aComm.compare(View3D_i::myComment) >= 0){
- aCmnt->SetValue(ToString());
+ aCmnt->SetValue(ToString().c_str());
return 1;
}
}
SALOMEDS::SComponent_var aSComponent =
FindOrCreateVisuComponent(myStudy->getStudyDocument());
CORBA::String_var aSComponentEntry = aSComponent->GetID(), anIOR(GetID());
- string anEntry = CreateAttributes(myStudy->getStudyDocument(),aSComponentEntry,"","",newName.latin1(),"",ToString());
+ string anEntry = CreateAttributes(myStudy->getStudyDocument(),aSComponentEntry,"","",newName.latin1(),"",ToString().c_str());
return 1;
}