[vtkusers] Error

R K Shyamprakash ramakrishna.prakash at quest-global.com
Tue Mar 18 02:55:17 EST 2003


Hi All,
            Whenever I run my VTK application I get an error saying "Error
locking surface". But my application runs perfectly fine. What will be the
cause for the error message? My code Looks as follows

public class StlLoad{

	private String fileName1;

	public StlLoad(String fileName1){
		this.fileName1 = fileName1;

		Frame window = new Frame();
		window.addNotify();

		//create a vtkPanel
		vtkPanel stlPanel = new vtkPanel();
		stlPanel.setSize(400,400);

		window.removeAll();
		window.add(stlPanel,"Center");

		vtkActor stlActor1 = loadFile(fileName1);

		//get vtkrenderer
		vtkRenderer stlRenderer = stlPanel.GetRenderer();
		stlRenderer.AddActor(stlActor1);
		stlRenderer.AddActor(stlActor2);
		stlRenderer.SetBackground(1, 1, 1);
		stlRenderer.GetActiveCamera().Azimuth(30);
		stlRenderer.GetActiveCamera().Elevation(30);
		stlRenderer.GetActiveCamera().Dolly(1.5);
		stlRenderer.ResetCameraClippingRange();

		window.pack();
		window.setVisible(true);
	}

	public vtkActor loadFile(String fileName){
		//Read the STL file
		vtkSTLReader stlReader1 = new vtkSTLReader();
		stlReader1.SetFileName(fileName);

		//Construct a geometry
		/*vtkPPolyDataNormals stlNormals1 = new vtkPPolyDataNormals();
		stlNormals1.SetInput(stlReader1.GetOutput());*/

		vtkPolyDataMapper stlMapper1 = new vtkPolyDataMapper();
		stlMapper1.SetInput(stlReader1.GetOutput());

		vtkActor stlActor1 = new vtkActor();
		stlActor1.SetMapper(stlMapper1);

		return stlActor1;
	}

	public static void main(String args[]){
		StlLoad stlLoad = new StlLoad(args[0]);
	}

}

Thanks and Regards
Shyam




More information about the vtkusers mailing list