[vtkusers] AddNodeAtWorldPosition - Crash

itkvtk123 at gmx.net itkvtk123 at gmx.net
Wed Oct 21 16:57:03 EDT 2009


Why does the following code produce a crash?

#include "vtkOrientedGlyphFocalPlaneContourRepresentation.h"

int main()
{
	vtkOrientedGlyphFocalPlaneContourRepresentation* cr = vtkOrientedGlyphFocalPlaneContourRepresentation::New();
	double wp[3] = {1.0, 1.0, 1.0};
	cr->AddNodeAtWorldPosition(wp); //crash here - access violation reading location 0x00000000
	return 0;
}


The crash goes down to vtkcontourrepresentation.cxx, line 1106

//----------------------------------------------------------------------
void vtkContourRepresentation
::GetRendererComputedDisplayPositionFromWorldPosition( double worldPos[3],
                                double * vtkNotUsed(worldOrient[9]), double displayPos[2] )
{
  double pos[4];
  pos[0] = worldPos[0];
  pos[1] = worldPos[1];
  pos[2] = worldPos[2];
  pos[3] = 1.0;
  
  this->Renderer->SetWorldPoint( pos );	//crashes here
  this->Renderer->WorldToDisplay();
  this->Renderer->GetDisplayPoint( pos );
  
  displayPos[0] = pos[0];
  displayPos[1] = pos[1];
}
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the vtkusers mailing list