[vtkusers] newbie question

Bernard Giroux giroux at geo.polymtl.ca
Tue Jul 25 17:06:35 EDT 2006


Mmmm... Now I get the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Update_50
	at vtk.vtkAlgorithm.Update_50(Native Method)
	at vtk.vtkAlgorithm.Update(vtkAlgorithm.java:212)
	at polymtl.geo.bhgravi.modeling_vtk.TestPolyData.main 
(TestPolyData.java:41)


However, if I don't call Update() and put the lines

	pts = sphere.GetOutput();
	System.out.printf("Number of points: %d\n", pts.GetNumberOfPoints());
	System.out.printf("Number of cells: %d\n", pts.GetNumberOfCells());


after rendering the actor, I get no error and the following output:

Number of points: 578
Number of cells: 1152

Can Update() be called explicitely in java?


Le 06-07-25 à 16:45, Francois Bertel a écrit :

> Hi Bernard,
>
> Before sphere.GetOutput();, call sphere.Update();
>
> sphere.SetThetaResolution() and sphere.SetPhiResolution() just  
> change the value of some protected variable on the SphereSource  
> object but do not update the output dataset.
>
>
> With the PolyDataMapper, it is done implicitely because it is  
> triggered by some render event that starts updating the pipeline  
> (render() is called on the mapper
> which itself calls update() on its source).
>
> Regards.
>
> Bernard Giroux wrote:
>> Hi,
>>
>> I am trying to retreive the triangular facets of a sphere created  
>> using
>> a vtkSphereSource.  I work in java, and use the following steps:
>>
>> public class TestPolyData {
>>
>>     static public void main(String[] args) {
>>         System.loadLibrary("vtkCommonJava");
>>         System.loadLibrary("vtkFilteringJava");
>>         System.loadLibrary("vtkIOJava");
>>         System.loadLibrary("vtkImagingJava");
>>         System.loadLibrary("vtkGraphicsJava");
>>         System.loadLibrary("vtkRenderingJava");
>>         try {
>>             System.loadLibrary("vtkHybridJava");
>>         } catch (Throwable e) {
>>             System.out.println("cannot load vtkHybrid, skipping...");
>>         }
>>         try {
>>             System.loadLibrary("vtkVolumeRenderingJava");
>>         } catch (Throwable e) {
>>             System.out.println("cannot load vtkVolumeRendering,
>> skipping...");
>>         }
>>
>>         vtkSphereSource sphere = new vtkSphereSource();
>>         sphere.SetThetaResolution(36);
>>         sphere.SetPhiResolution(18);
>>         vtkPolyData pts = sphere.GetOutput();
>>
>>         System.out.printf("Number of points: %d\n",
>> pts.GetNumberOfPoints());
>>         System.out.printf("Number of cells: %d\n",  
>> pts.GetNumberOfCells());
>>
>>     }
>> }
>>
>> There must be some steps missing because the output is
>>
>> Number of points: 0
>> Number of cells: 0
>>
>> If I pipe the output of the sphere object to a PolyDataMapper an  
>> then to
>> an actor, it appears correctly on the screen.
>>
>> Any help appreciated.
>>
>>
>> ---
>> Bernard Giroux, ing., Ph.D.
>> Associé de recherche
>>
>> http://geo.polymtl.ca/~giroux
>>
>>
>>
>>
>> _______________________________________________
>> This is the private VTK discussion list.Please keep messages on- 
>> topic.
>> Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
> -- 
> François Bertel, PhD  | Kitware Inc. Suite 204
> 1 (518) 371 3971 x113 | 28 Corporate Drive
>                       | Clifton Park NY 12065, USA
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/ 
> Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

---
Bernard Giroux, ing., Ph.D.
Associé de recherche

http://geo.polymtl.ca/~giroux







More information about the vtkusers mailing list