[vtkusers] EDL on VTK7

rich richuitnl at gmail.com
Tue Feb 23 14:18:34 EST 2016


Hi All,
I have upgraded VTK 6.1 to VTK 7/OpengL2, my app draws a basic point cloud.
Iam using a  vtkSliderWidget/ vtkSliderRepresentation2D* to change the point
size interactively. This works ok, both on 6 and 7. Now I was playing with
the vtkEDLShading and this works fine as long as I hide the Slider. As soon
as I show the slider it crashes in vtkEDLShading.cxx around line 400.

 double bb[6];
  vtkMath::UninitializeBounds(bb);
  for(int i=0; i<s.GetPropArrayCount(); i++)
  {
  double* bounds = s.GetPropArray()[i]->GetBounds();   <<<========= HERE
  if(i==0)
  {
.....


So what happens is that the SliderRepresentation shows up as a prop(? sorry
for the noob language) here but this has no bounds, so it crashes on the
nullptr. So I tried to call
SetUseBounds(false) but this did not matter, still crashes.

So then I recompiled the vtkEDLShading.cxx to:

 // FIX for crash on Slider Widgets
  int nBBCount = 0;
  for (int i = 0; i < s.GetPropArrayCount(); i++)
  {
	  if (s.GetPropArray()[i]->GetUseBounds())
	  {
		  double* bounds = s.GetPropArray()[i]->GetBounds();

		  if (bounds != 0)
		  {
			  if (nBBCount == 0)
			  {
				  bb[0] = bounds[0];
				  bb[1] = bounds[1];
				  bb[2] = bounds[2];
				  bb[3] = bounds[3];
				  bb[4] = bounds[4];
				  bb[5] = bounds[5];
			  }
			  else
			  {
				  bb[0] = (bb[0] < bounds[0] ? bb[0] : bounds[0]);
				  bb[1] = (bb[1] > bounds[1] ? bb[1] : bounds[1]);
				  bb[2] = (bb[2] < bounds[2] ? bb[2] : bounds[2]);
				  bb[3] = (bb[3] > bounds[3] ? bb[3] : bounds[3]);
				  bb[4] = (bb[4] < bounds[4] ? bb[4] : bounds[4]);
				  bb[5] = (bb[5] > bounds[5] ? bb[5] : bounds[5]);
			  }

			  nBBCount++;
		  }	 
	  }
  }

And this fixed the crash but now the slider widget is also EDL shaded.
Is there something I overlooked?

thanks,
RIch.




--
View this message in context: http://vtk.1045678.n5.nabble.com/EDL-on-VTK7-tp5736766.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list