	protected void createData(LeafNode.DataProvider dataProvider)
	{
		data = new vtkPolyData();
		data.SetPoints(Utils.createPoints(dataProvider.getNodes()));
		vtkCellArray cells = Utils.createCells(dataProvider.getNbrOfVertices(),
			dataProvider.getVertices());
		data.SetVerts(cells);		
		cells=Utils.createCells(dataProvider.getNbrOfLines(), dataProvider.getLines());
		data.SetLines(cells);
		cells=Utils.createCells(dataProvider.getNbrOfPolys(), dataProvider.getPolys());
		data.SetPolys(cells);
		if(LOGGER.isLoggable(Level.FINEST))
		{
			LOGGER.finest("Number of points : " + data.GetPoints().GetNumberOfPoints());
			LOGGER.finest("Number of vertices : " + data.GetVerts().GetNumberOfCells());
			LOGGER.finest("Number of lines : " + data.GetLines().GetNumberOfCells());
			LOGGER.finest("Number of polys : " + data.GetPolys().GetNumberOfCells());
			LOGGER.finest("vertex coherance : " + Utils.isMeshCoherent(dataProvider.getNodes(), dataProvider.getVertices()));
			LOGGER.finest("line coherance : " + Utils.isMeshCoherent(dataProvider.getNodes(), dataProvider.getLines()));
			LOGGER.finest("polys coherance : " + Utils.isMeshCoherent(dataProvider.getNodes(), dataProvider.getPolys()));
		}
		if(dataProvider.getNormals() == null)
			return;
		vtkPolyDataNormals algoNormals = new vtkPolyDataNormals();
		algoNormals.SetInput(data);
		algoNormals.SplittingOff();
		algoNormals.FlipNormalsOff();
		algoNormals.AutoOrientNormalsOff();
		algoNormals.ComputePointNormalsOn();
		algoNormals.Update();
		data = algoNormals.GetOutput();
		vtkPointData pointData = data.GetPointData();
		vtkFloatArray computedNormals = (vtkFloatArray) pointData.GetNormals();		
		float[] javaComputedNormals = computedNormals.GetJavaArray();
		float[] javaNormals = dataProvider.getNormals();
		for(int i = 0 ; i < javaComputedNormals.length / 3 ; i += 3)
		{
			if(javaNormals[i] == 0. && javaNormals[i + 1] == 0. && javaNormals[i + 2] == 0.)
			{
				javaNormals[i] = javaComputedNormals[i];
				javaNormals[i + 1] = javaComputedNormals[i  + 1];
				javaNormals[i + 2] = javaComputedNormals[i + 2];
			}
		}
		vtkFloatArray normals = new vtkFloatArray();
		normals.SetNumberOfComponents(3);
		normals.SetJavaArray(javaNormals);
		pointData.SetNormals(normals);
	}

	protected void createData(LeafNode.DataProvider dataProvider)
	{
		data = new vtkPolyData();
		data.SetPoints(Utils.createPoints(dataProvider.getNodes()));
		vtkCellArray cells = Utils.createCells(dataProvider.getNbrOfVertices(),
			dataProvider.getVertices());
		data.SetVerts(cells);		
		cells=Utils.createCells(dataProvider.getNbrOfLines(), dataProvider.getLines());
		data.SetLines(cells);
		cells=Utils.createCells(dataProvider.getNbrOfPolys(), dataProvider.getPolys());
		data.SetPolys(cells);
		if(LOGGER.isLoggable(Level.FINEST))
		{
			LOGGER.finest("Number of points : " + data.GetPoints().GetNumberOfPoints());
			LOGGER.finest("Number of vertices : " + data.GetVerts().GetNumberOfCells());
			LOGGER.finest("Number of lines : " + data.GetLines().GetNumberOfCells());
			LOGGER.finest("Number of polys : " + data.GetPolys().GetNumberOfCells());
			LOGGER.finest("vertex coherance : " + Utils.isMeshCoherent(dataProvider.getNodes(), dataProvider.getVertices()));
			LOGGER.finest("line coherance : " + Utils.isMeshCoherent(dataProvider.getNodes(), dataProvider.getLines()));
			LOGGER.finest("polys coherance : " + Utils.isMeshCoherent(dataProvider.getNodes(), dataProvider.getPolys()));
		}
		if(dataProvider.getNormals() == null)
			return;
		vtkPolyDataNormals algoNormals = new vtkPolyDataNormals();
		algoNormals.SetInput(data);
		algoNormals.SplittingOff();
		algoNormals.FlipNormalsOff();
		algoNormals.AutoOrientNormalsOff();
		algoNormals.ComputePointNormalsOn();
		algoNormals.Update();
		data = algoNormals.GetOutput();
		vtkPointData pointData = data.GetPointData();
		vtkFloatArray computedNormals = (vtkFloatArray) pointData.GetNormals();		
		float[] javaComputedNormals = computedNormals.GetJavaArray();
		float[] javaNormals = dataProvider.getNormals();
		for(int i = 0 ; i < javaComputedNormals.length ; i+= 3)
		{
			if(javaNormals[i] == 0. && javaNormals[i + 1] == 0. && javaNormals[i + 2] == 0.)
			{
				javaNormals[i] = javaComputedNormals[i];
				javaNormals[i + 1] = javaComputedNormals[i  + 1];
				javaNormals[i + 2] = javaComputedNormals[i + 2];
			}
		}
		vtkFloatArray normals = new vtkFloatArray();
		normals.SetNumberOfComponents(3);
		normals.SetJavaArray(javaNormals);
		pointData.SetNormals(normals);
	}
