Commit c0def5ca authored by Michel Rasquin's avatar Michel Rasquin

Fix reader for empty views in msh v2 files

parent e44fb9dc
Pipeline #2868 passed with stage
in 19 minutes and 37 seconds
......@@ -268,25 +268,27 @@ bool PView::readMSH(const std::string &fileName, int fileIndex)
}
}
}
// either get existing viewData, or create new one
PView *p = getViewByName(viewName, timeStep, partition);
PViewDataGModel *d = 0;
if(p) d = dynamic_cast<PViewDataGModel *>(p->getData());
bool create = d ? false : true;
if(create) d = new PViewDataGModel(type);
if(!d->readMSH(viewName, fileName, fileIndex, fp, binary, swap,
timeStep, time, partition, numComp, numEnt,
interpolationScheme)) {
Msg::Error("Could not read data in msh file");
if(create) delete d;
fclose(fp);
return false;
}
else {
d->setName(viewName);
d->setFileName(fileName);
d->setFileIndex(index);
if(create) new PView(d);
if(numEnt > 0) {
// either get existing viewData, or create new one
PView *p = getViewByName(viewName, timeStep, partition);
PViewDataGModel *d = 0;
if(p) d = dynamic_cast<PViewDataGModel *>(p->getData());
bool create = d ? false : true;
if(create) d = new PViewDataGModel(type);
if(!d->readMSH(viewName, fileName, fileIndex, fp, binary, swap,
timeStep, time, partition, numComp, numEnt,
interpolationScheme)) {
Msg::Error("Could not read data in msh file");
if(create) delete d;
fclose(fp);
return false;
}
else {
d->setName(viewName);
d->setFileName(fileName);
d->setFileIndex(index);
if(create) new PView(d);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment