-// Copyright (C) 2010-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2010-2016 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
SALOME_TYPES::ListOfLong *tinyI;
SALOME_TYPES::ListOfString *tinyS;
meshPtr->getTinyInfo(tinyD,tinyI,tinyS);
- int sizePerAxe[3];
- sizePerAxe[0]=(*tinyI)[0];
- sizePerAxe[1]=(*tinyI)[1];
- sizePerAxe[2]=(*tinyI)[2];
+ int sizePerAxe[3]={1,1,1};
+ bool isOK[3]={false,false,false};
+ if((*tinyI)[0]>0)
+ { sizePerAxe[0]=(*tinyI)[0]; isOK[0]=true; }
+ if((*tinyI)[1]>0)
+ { sizePerAxe[1]=(*tinyI)[1]; isOK[1]=true; }
+ if((*tinyI)[2]>0)
+ { sizePerAxe[2]=(*tinyI)[2]; isOK[2]=true; }
ret->SetDimensions(sizePerAxe[0],sizePerAxe[1],sizePerAxe[2]);
delete tinyI;
delete tinyS;
+ delete tinyD;
SALOME_TYPES::ListOfDouble *bigD;
meshPtr->getSerialisationData(tinyI,bigD);
delete tinyI;
int offset=0;
vtkDoubleArray *da=0;
- if(sizePerAxe[0]>0)
+ if(isOK[0])
{
da=vtkDoubleArray::New();
da->SetNumberOfTuples(sizePerAxe[0]);
da->Delete();
offset+=sizePerAxe[0];
}
- if(sizePerAxe[1]>0)
+ if(isOK[1])
{
da=vtkDoubleArray::New();
da->SetNumberOfTuples(sizePerAxe[1]);
da->Delete();
offset+=sizePerAxe[1];
}
- if(sizePerAxe[2]>0)
+ else
+ {
+ da=vtkDoubleArray::New(); da->SetNumberOfTuples(1); da->SetNumberOfComponents(1);
+ double *pt=da->GetPointer(0); *pt=0.; ret->SetYCoordinates(da); da->Delete();
+ }
+ if(isOK[2])
{
da=vtkDoubleArray::New();
da->SetNumberOfTuples(sizePerAxe[2]);
ret->SetZCoordinates(da);
da->Delete();
}
+ else
+ {
+ da=vtkDoubleArray::New(); da->SetNumberOfTuples(1); da->SetNumberOfComponents(1);
+ double *pt=da->GetPointer(0); *pt=0.; ret->SetZCoordinates(da); da->Delete();
+ }
delete bigD;
meshPtr->UnRegister();
}