[vtkusers] vtkVectorText or vtkFollower Bug
Jeff Lee
jeff at cdnorthamerica.com
Sun Mar 24 10:11:54 EST 2002
works fine for me, vtk4.0cvs and java1.4 on linux. had to insert
static {
System.loadLibrary("vtkCommonJava");
System.loadLibrary("vtkFilteringJava");
System.loadLibrary("vtkIOJava");
System.loadLibrary("vtkHybridJava");
System.loadLibrary("vtkImagingJava");
System.loadLibrary("vtkGraphicsJava");
System.loadLibrary("vtkRenderingJava");
}
-Jeff
ahmed Tokalak wrote:
>I send the complete code:
>
>import vtk.*;
>
>public class FollowerTest {
>
> // in the static contructor we load in the native code
> // The libraries must be in your path to work
> static {
> System.loadLibrary("vtkJava");
> }
>
> // the main function
> public static void main (String[] args)
> {
> vtkVectorText atext = new vtkVectorText();
> atext.SetText("VectorText");
> vtkPolyDataMapper followMapper = new vtkPolyDataMapper();
> followMapper.SetInput(atext.GetOutput());
> vtkFollower followActor = new vtkFollower();
> followActor.SetMapper(followMapper);
> followActor.SetScale( 0.1, 0.1, 0.1);
> followActor.GetProperty().SetColor( 1, 0.2, 0.2);
> // followActor.AddPosition(0, 0, 0);
>
> // a renderer for the data
> vtkRenderer ren1 = new vtkRenderer();
>
> ren1.AddActor(followActor);
>
> ren1.GetActiveCamera().Zoom(1.6);
> ren1.ResetCameraClippingRange();
> followActor.SetCamera(ren1.GetActiveCamera());
> ren1.SetBackground(1,1,1); // background color white
>
> // a render window to display the contents
> vtkRenderWindow renWin = new vtkRenderWindow();
> renWin.AddRenderer(ren1);
> renWin.SetSize(300,300);
>
> // an interactor to allow control of the objects
> vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();
> iren.SetRenderWindow(renWin);
>
> // trigger the rendering and start the interaction
> renWin.Render();
> iren.Start();
> }
>}
>
>//end of code
>
>"ahmed Tokalak" <tokalak at web.de> schrieb am 21.03.02:
>
>>I also executed your code (VText.java) but it still shows nothing but the exit-Button. I see a black area where the text should be.
>>
>>"Randy Heiland" <heiland at ncsa.uiuc.edu> wrote:
>>
>>>Ahmed,
>>>
>>>I don't have any problem with your code - the text gets displayed. You didn't
>>>indicate which version of VTK you're using. Nor did you include your entire
>>>Java pgm. I'm using 4.0 and I attached the Java pgm I used to test this
>>>(simply using /VTK/Wrapping/Java/SimpleVTK.java as a template). Also, don't
>>>forget to include:
>>> System.loadLibrary("vtkHybridJava");
>>>
>>>in vtkPanel.java since that's where vtkVectorText is. But I assume you would
>>>have got an error otherwise.
>>>
>>>--Randy
>>>
>>>
>>>
>>>On Mar 21, 11:56am, ahmed Tokalak wrote:
>>>
>>>>Subject: [vtkusers] vtkVectorText or vtkFollower Bug
>>>>Hi Everybody,
>>>>
>>>>I use vtkVectorText to show text-labels but nothing is visible. Any idea?
>>>>
>>>This is my code:
>>>
>>>>vtkVectorText atext = new vtkVectorText();
>>>>atext.SetText("Test");
>>>>vtkPolyDataMapper followMapper = new vtkPolyDataMapper();
>>>>followMapper.SetInput(atext.GetOutput());
>>>>vtkFollower followActor = new vtkFollower();
>>>>followActor.SetMapper(followMapper);
>>>>followActor.SetScale( 0.2, 0.2, 0.2);
>>>>followActor.GetProperty().SetColor( 1, 0.2, 0.2);
>>>>followActor.SetPosition(0, -0.2, 0);
>>>>
>>>>renderer.AddActor(followActor);
>>>>
>
>
>
>______________________________________________________________________________
>Seien Sie dabei und sichern Sie sich 100% Leistung, 100% Prämie und
>100% Zufriedenheit. Jetzt unter http://club.web.de/?mc=021105
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers
>
>
More information about the vtkusers
mailing list