[vtkusers] Problem with getVRMLDefObject of vtkVRMLImporter

jsundar at siue.edu jsundar at siue.edu
Thu Sep 4 14:52:22 EDT 2003


   Hi all,
      I have pasted below a piece of code that gave an access violation error.
It said that the error was in vtlkHybrid.dll .This is what it exactly said
"unhandled exception in import.exe(VTKHybrid.dll): 0xC0000005: Access 
Violation".If anybody knows how to fix this,Please send a mail to 
jsundar at siue.edu.
  Regards,
    Jayashree 

    #include "vtkSphereSource.h"
#include "vtkPolyDataMapper.h"
#include "vtkActor.h"
#include "vtkRenderWindow.h"
#include "vtkRenderer.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkProperty.h"
#include "vtkVRML.h"
#include "vtkVRMLImporter.h"

void main ()
{
// a renderer and render window
 vtkRenderWindow *renWin = vtkRenderWindow::New();
  vtkVRMLImporter *importObj = vtkVRMLImporter::New();
  importObj->SetFileName("C:\\vtkCode\\ImageBox.wrl");
  importObj->SetRenderWindow(renWin);
  importObj->Read();
  vtkRenderer *ren1 = importObj->GetRenderer();
  vtkObject *defObj = vtkObject::New();
  defObj = importObj->GetVRMLDEFObject("RowOfSpheres");
   // an interactor
  vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
  iren->SetRenderWindow(renWin);  
  // render an image (lights and cameras are created automatically)
  renWin->Render();
  // begin mouse interaction
  iren->Start();
}



-------------------------------------------------
SIUE Web Mail



More information about the vtkusers mailing list