#include <boost/thread/thread.hpp>
#include <boost/bind.hpp>
+#include <qfileinfo.h>
+#include <qfile.h>
+#include <qdir.h>
+
#include <strstream>
//---------------------------------------------------------------
VISU::MultiResult_i
::~MultiResult_i()
-{}
+{
+ //cout<<"MultiResult_i::~MultiResult_i - '"<<myRepresentation2Input.size()<<"' - "<<endl;
+ TRepresentation2Input::iterator anIter = myRepresentation2Input.begin();
+ for ( ; anIter != myRepresentation2Input.end() ; anIter++) {
+ const PInput& anInput = anIter->second;
+ std::string aFileName = anInput->GetName();
+ //cout<<"'"<<aFileName<<"'; "<<endl;
+ QFileInfo aFileInfo(aFileName.c_str());
+ QFile(aFileInfo.absFilePath()).remove();
+ QDir().rmdir(aFileInfo.dirPath(TRUE));
+ }
+}
//---------------------------------------------------------------
void
VISU::MultiResult_i
-::SetResolution(const std::string& theName,
+::SetResolution(const std::string& thePartName,
TResolutionID theNewResolution)
{
- TPartName2FileName::iterator anIter = myPartName2FileName.find(theName);
+ if(!IsFullResolution(thePartName))
+ return;
+
+ TPartName2FileName::iterator anIter = myPartName2FileName.find(thePartName);
if(anIter == myPartName2FileName.end())
return;
- TResolutionID& aNewResolution = myPartName2ResolutionID[theName];
+ TResolutionID& aNewResolution = myPartName2ResolutionID[thePartName];
if(aNewResolution == theNewResolution)
return;
MultiResult_i::TPartName2ResolutionID::const_iterator anIter = thePartName2ResolutionID.begin();
for ( ; anIter != thePartName2ResolutionID.end() ; anIter++) {
const MultiResult_i::TPartName& aPartName = anIter->first;
- const MultiResult_i::TResolutionID& aResolutionID = anIter->second;
- if(aResolutionID == 'F')
- UpdateRepresentationKey(thePartName2FileName, aRepresentationKey, aPartName);
- if(aResolutionID == 'M')
- UpdateRepresentationKey(thePartName2FileName, aRepresentationKey, aPartName + "_MED");
- else if(aResolutionID == 'L')
- UpdateRepresentationKey(thePartName2FileName, aRepresentationKey, aPartName + "_LOW");
+ if(IsFullResolution(aPartName)){
+ const MultiResult_i::TResolutionID& aResolutionID = anIter->second;
+ if(aResolutionID == 'F')
+ UpdateRepresentationKey(thePartName2FileName, aRepresentationKey, aPartName);
+ if(aResolutionID == 'M')
+ UpdateRepresentationKey(thePartName2FileName, aRepresentationKey, aPartName + "_MED");
+ else if(aResolutionID == 'L')
+ UpdateRepresentationKey(thePartName2FileName, aRepresentationKey, aPartName + "_LOW");
+ }
}
return aRepresentationKey;
}
TRepresentation2Input::iterator anIter = myRepresentation2Input.find(aRepresentationKey);
if(anIter == myRepresentation2Input.end()){
std::string aFileName = SALOMEDS_Tool::GetTmpDir() + "tmp.med";
- //cout<<"MultiResult_i::GetInput - '"<<aFileName<<"'"<<endl;
+ //cout<<"MultiResult_i::GetInput - '"<<aFileName<<"' - "<<endl;
+ {
+ TFileNames::const_iterator anIter = aFileNames.begin();
+ for ( ; anIter != aFileNames.end() ; anIter++) {
+ const MultiResult_i::TFileName& aFileName = *anIter;
+ //cout<<"'"<<aFileName<<"'; "<<endl;
+ }
+ }
int aRes = multipr::merge(aFileNames, theMeshName.c_str(), theFieldName.c_str(), aFileName.c_str());
+ //cout<<"aRes = "<<aRes<<endl;
if (aRes == 0) {
QFile(aFileName.c_str()).remove();
throw std::runtime_error("empty mesh");
}
PInput anInput(CreateConvertor(aFileName));
- anInput->Build();
+ anInput->BuildFields();
myRepresentation2Input[aRepresentationKey] = anInput;
return anInput;
}