[vtkusers] vtkDelaunay3D filter generate a tetrahedral mesh
    Ali Habib 
    ali.mahmoud.habib at gmail.com
       
    Tue Sep 22 07:40:44 EDT 2009
    
    
  
Dear All,
I have two questions regards tetrahedral mesh generated by vtkDelaunay3D
1. how to display the output, it give me always error regard scalar values
(even I added array of scalers) attached is the code it was written using c#
,
2. I want to get the matrix of Neighbors how can I do that please
best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090922/092b421c/attachment.htm>
-------------- next part --------------
 // Add scaler value
           vtkDoubleArray arr =new vtkDoubleArray();
           arr.SetNumberOfTuples(unstructuredReader.GetOutput().GetNumberOfPoints());
           arr.FillComponent(0, 1.0); // e.g. double value = 1.0;            arr.SetName("myarray");
          // MessageBox.Show(arr.GetData(
           //unstructuredReader.GetOutput().GetPointData().SetScalars();
           unstructuredReader.GetOutput().GetPointData().AddArray(arr);            unstructuredReader.GetOutput().GetPointData().SetActiveScalars("myarray");           
           // composite function for strucured grid renderer
           vtkVolumeRayCastCompositeFunction compositeFunction = new vtkVolumeRayCastCompositeFunction();
           compositeFunction.SetCompositeMethod(compos);
           //unstructuredGridRendering
           vtkUnstructuredGridVolumeRayCastMapper volumeUnstructedMapper = new vtkUnstructuredGridVolumeRayCastMapper();
           //vtkVolumeRayCastMapper volumeUnstructedMapper = new vtk.vtkVolumeRayCastMapper();
           //volumeUnstructedMapper.set  (compositeFunction);
           volumeUnstructedMapper.SetInput(unstructuredReader.GetOutput());
           vtkVolume volume = new vtkVolume();
           volume.SetMapper(volumeUnstructedMapper);
           volume.SetProperty(volumeProperty);
           // add volume to renderer
           ren1.AddVolume(volume);
           renWin.Render();
           iren1.Start();
           ren1.Dispose();
           renWin.Dispose();
           iren1.Dispose();
           opacityTransferFunction.Dispose();
           colorTransferFunction.Dispose();
           volumeProperty.Dispose();
           compositeFunction.Dispose();
           // unstructured grid case
           volumeUnstructedMapper.Dispose();
           unstructuredReader.Dispose();
           volume.Dispose();
           ///////////////////////////////////////////////
    
    
More information about the vtkusers
mailing list