Bug Report and a solution: vtkLODProp3D::GetActors(vtkPropCollection *ac)

Jorrit Schaap jorrit at lkeb.azl.nl
Fri May 26 04:12:49 EDT 2000


Hi again,

I forgot to mention that I'm using the nightly from 04/10/00, and that I
found out about this bug when I was trying to pick an Actor using
vtkCellPicker in a scene which contained vtkActor's and vtkLODProp3D's
containing vtkVolume's.

just to give you the full information...

Jorrit


Jorrit Schaap wrote:

> Hi,
>
> I found a bug in the class vtkLODProp3D. If you ask for its actors with
> the method GetActors(vtkPropCollection *ac) then it doesn't check its
> props if they truely are an actor. So, IMHO the lines:
>
>      ac->AddItem(this->LODs[index].Prop3D);
>
> should be replaced by:
>
>  if(this->LODs[index].Prop3D->IsA("vtkActor"))
>      ac->AddItem(this->LODs[index].Prop3D);
>
> so the complete function will look like:
>
> void vtkLODProp3D::GetActors(vtkPropCollection *ac)
> {
>   vtkDebugMacro(<< "vtkLODProp3D::GetActors");
>   int index = 0;
>   if (this->AutomaticPickLODSelection)
>     {
>     if ( this->SelectedLODIndex < 0 ||
>   this->SelectedLODIndex >= this->NumberOfEntries )
>       {
>       index = this->GetAutomaticPickPropIndex();
>       }
>     else
>       {
>       index = this->SelectedLODIndex;
>       }
>  if(this->LODs[index].Prop3D->IsA("vtkActor"))
>      ac->AddItem(this->LODs[index].Prop3D);
>     }
>   else
>     {
>     if (this->PreviousPickProp)
>       {
>       this->PreviousPickProp->SetPickMethod(NULL, NULL);
>       }
>     index = this->ConvertIDToIndex(this->SelectedPickLODID);
>     if (index == VTK_INVALID_LOD_INDEX)
>       {
>       return;
>       }
>  if(this->LODs[index].Prop3D->IsA("vtkActor"))
>      ac->AddItem(this->LODs[index].Prop3D);
>     }
> }
>
> Maybe its even better to replace it by:
>
>  if( ! this->LODs[index].Prop3D->IsA("vtkVolume"))
>     ac->AddItem(this->LODs[index].Prop3D);
>
> but that's up to the Kitware guys.
>
> Kind regards, Jorrit Schaap.
>
> --------------------------------------------------------------------
> This is the private VTK discussion list. Please keep messages on-topic.
> Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
> <majordomo at public.kitware.com>. For help, send message body containing
> "info vtkusers" to the same address.
> --------------------------------------------------------------------



--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list