Added a check for writable folder in Screened Poisson and VCG Merging

As Screened Poisson and VCG Merging need to save temporary files, the
current folder should be writable, If it is not so, fail, and give a
proper error decription
This commit is contained in:
Marco Callieri 2017-02-21 15:47:57 +01:00
parent b0d19aa929
commit fb79c65e70
2 changed files with 16 additions and 0 deletions

View File

@ -121,6 +121,14 @@ bool PlyMCPlugin::applyFilter(QAction *filter, MeshDocument &md, RichParameterSe
{
srand(time(NULL));
//check if folder is writable
QFileInfo fi(QDir::currentPath(),"file.tmp");
if (!fi.isWritable())
{
Log("ERROR - current folder is not writable. VCG Merging need to save intermediate files in the current working folder. Project and meshes must be in a write-enabled folder");
return false;
}
tri::PlyMC<SMesh,SimpleMeshProvider<SMesh> > pmc;
pmc.MP.setCacheSize(64);
tri::PlyMC<SMesh,SimpleMeshProvider<SMesh> >::Parameter &p = pmc.p;

View File

@ -581,6 +581,14 @@ bool FilterScreenedPoissonPlugin::applyFilter( const QString& filterName,MeshDoc
{
if (filterName == "Surface Reconstruction: Screened Poisson")
{
//check if folder is writable
QFileInfo fi(QDir::currentPath(), "file.tmp");
if (!fi.isWritable())
{
Log("ERROR - current folder is not writable. VCG Merging need to save intermediate files in the current working folder. Project and meshes must be in a write-enabled folder");
return false;
}
PoissonParam<Scalarm> pp;
pp.MaxDepthVal = env.evalInt("depth");
pp.FullDepthVal = env.evalInt("fullDepth");