Commit e629f6cd authored by Ken Martin's avatar Ken Martin
Browse files

bug fix for multiple renderers

parent 487f6ee4
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "vtkRenderer.h" #include "vtkRenderer.h"
#include "vtkTextProperty.h" #include "vtkTextProperty.h"
vtkCxxRevisionMacro(vtkInteractorStyle, "1.84"); vtkCxxRevisionMacro(vtkInteractorStyle, "1.85");
vtkStandardNewMacro(vtkInteractorStyle); vtkStandardNewMacro(vtkInteractorStyle);
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
...@@ -299,19 +299,32 @@ void vtkInteractorStyle::HighlightProp3D(vtkProp3D *prop3D) ...@@ -299,19 +299,32 @@ void vtkInteractorStyle::HighlightProp3D(vtkProp3D *prop3D)
this->OutlineActor->GetProperty()->SetColor(this->PickColor); this->OutlineActor->GetProperty()->SetColor(this->PickColor);
this->OutlineActor->GetProperty()->SetAmbient(1.0); this->OutlineActor->GetProperty()->SetAmbient(1.0);
this->OutlineActor->GetProperty()->SetDiffuse(0.0); this->OutlineActor->GetProperty()->SetDiffuse(0.0);
this->CurrentRenderer->AddActor(this->OutlineActor);
} }
if ( ! prop3D ) //no prop picked now
if ( ! prop3D)
{ {
this->PickedRenderer = NULL; //was there previously?
this->OutlineActor->VisibilityOff(); if (this->PickedRenderer != NULL)
{
this->PickedRenderer->RemoveActor(this->OutlineActor);
this->PickedRenderer = NULL;
}
} }
else //prop picked now
else
{ {
this->PickedRenderer = this->CurrentRenderer; //check if picked in different renderer to previous pick
if (this->CurrentRenderer != this->PickedRenderer)
{
if (this->PickedRenderer != NULL)
{
this->PickedRenderer->RemoveActor(this->OutlineActor);
}
this->CurrentRenderer->AddActor(this->OutlineActor);
this->PickedRenderer = this->CurrentRenderer;
}
this->Outline->SetBounds(prop3D->GetBounds()); this->Outline->SetBounds(prop3D->GetBounds());
this->OutlineActor->VisibilityOn();
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment