[vtkusers] vtkVRMLImporter::GetVRMLDEFObject access violation

Rex Schilasky Rex.Schilasky at gmx.de
Mon Oct 27 04:28:08 EST 2003


Hello,

I use the class vtkVRMLImporter in VC 6.0 and it works fine. There is only
one problem. I want to access single actors of the VRML world and use
the method "GetVRMLDEFObject". This method call is ending in a access
violation under VisualC 6.0.
I use the latest release from vtk 4.2. First linked my application with the
prebuilded windows shared libs. The I recompiled vtk via CMake and VC 6.0
as SHARED_LIBS and tried to debug the code. I ended in
in vtkVRMLImporter.cxx line 6286 
 ... for (int i = VrmlNodeType::useList->Count()-1;i >=0 ; i--)
and my debugger shows VrmlNodeType::useList as NULL.  What is the problem ?
Have I forgotten something to initialize ??

Hope somebody can help, grettings ReX


Here is the demo code. VC 6.0 console application.


#include "vtkVRMLImporter.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"


void main()
{
  class vtkRenderWindow* pRenWin;
  class vtkRenderer* pRen;
  class vtkRenderWindowInteractor* pRenInt;
  class vtkVRMLImporter* pVRMLImporter;

  // open renderer
  pRenWin = vtkRenderWindow::New();
  
  if(pRenWin)
  {
    pRen    = vtkRenderer::New();
    pRenInt = vtkRenderWindowInteractor::New();
    
    if(pRen)
    {
      pRenWin->AddRenderer(pRen);
      pRenInt->SetRenderWindow(pRenWin);
      pRenInt->Initialize();
      
      // import VRML
      pVRMLImporter = vtkVRMLImporter::New();
      if(pVRMLImporter)
      {
        pVRMLImporter->SetRenderWindow(pRenWin);
        pVRMLImporter->SetFileName("bot2.wrl");
        pVRMLImporter->Read();

        // CRASH in VTKHYBRID.DLL
        // in vtkVRMLImporter.cxx line 6286 
        // ... for (int i = VrmlNodeType::useList->Count()-1;i >=0 ; i--)
        //
        // VrmlNodeType::useList == 0x00000000
        pVRMLImporter->GetVRMLDEFObject("fixbot2");
      }
      
      // render
      pRen->Render();
      pRenInt->Start();
    }
  }
}

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++




More information about the vtkusers mailing list