[vtk-developers] [VTK 0013676]: vtkLightActor crashes if the light is not positional

Mantis Bug Tracker mantis at public.kitware.com
Sun Nov 25 07:07:22 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://vtk.org/Bug/view.php?id=13676 
====================================================================== 
Reported By:                David Doria
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   13676
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     backlog
Project:                    TBD 
Type:                       crash 
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2012-11-25 07:07 EST
Last Modified:              2012-11-25 07:07 EST
====================================================================== 
Summary:                    vtkLightActor crashes if the light is not positional
Description: 
In the following demo, if 

light->SetPositional(true);

is not called, the program crashes. With the above line, it does not crash and
displays the light correctly.

#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkLightActor.h>
#include <vtkLight.h>
#include <vtkSmartPointer.h>
#include <vtkRenderWindowInteractor.h>

int main()
{
  vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();

  // Display where the light is
  vtkSmartPointer<vtkLight> light = vtkSmartPointer<vtkLight>::New();
//  light->SetPositional(true); // without this line, the program crashes
  vtkSmartPointer<vtkLightActor> lightActor =
vtkSmartPointer<vtkLightActor>::New();
  lightActor->SetLight(light);
  renderer->AddViewProp(lightActor);

  vtkSmartPointer<vtkRenderWindow> renderWindow =
vtkSmartPointer<vtkRenderWindow>::New();
  renderWindow->AddRenderer(renderer);

  vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
      vtkSmartPointer<vtkRenderWindowInteractor>::New();
  renderWindowInteractor->SetRenderWindow(renderWindow);

  renderWindow->Render();
  renderWindowInteractor->Start();

}

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-11-25 07:07 David Doria    New Issue                                    
======================================================================




More information about the vtk-developers mailing list