[Paraview-developers] Unable to drag vtkLegendBoxActor

Pandu tech pandu4tech at gmail.com
Fri Feb 17 08:29:15 EST 2012


Hi,

I created a vtkLegendBoxActor and I added it to my custom view.

actor looks fine and working fine, but I am unable to drag it with the
mouse. I want to make it dragable.

I tried this->LegendBoxActor->SetDragable(1); but this did not work for me.

I want this vtkLegendBoxActor behave like a ChartLegend in XYChartView, it
should be dragable.

Please suggest your views.

Appreciate your help in this regard.

Here is my code

this->LegendBoxActor = vtkLegendBoxActor::New();
    this->LegendBoxActor->SetNumberOfEntries(5);
    this->LegendBoxActor->SetUseBackground(1);
    this->LegendBoxActor->SetBackgroundColor(backgroundColor);
    this->LegendBoxActor->SetBackgroundOpacity(1.0);



this->LegendBoxActor->GetPositionCoordinate()->SetCoordinateSystemToView();
    this->LegendBoxActor->GetPositionCoordinate()->SetValue(-0.1, -0.2);


this->LegendBoxActor->GetPosition2Coordinate()->SetCoordinateSystemToView();
    this->LegendBoxActor->GetPosition2Coordinate()->SetValue(0.1, 0.2);

for(int i=0; i < 5; ++i)
      {
      vtkSmartPointer<vtkLineSource> ls
(vtkSmartPointer<vtkLineSource>::New());
      vtkSmartPointer<vtkPolyData> pd = ls->GetOutput();
      this->LegendBoxActor->SetEntry(i, pd, text[i], textColor[i]);
      }

this->LegendBoxActor->SetPickable(1);
this->LegendBoxActor->SetDragable(1);

this->GetNonCompositedRenderer()->AddActor(this->LegendBoxActor); // here i
added this actor to my view.

-- 
Thanks,
Hanumanth.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20120217/78228b2b/attachment.htm>


More information about the Paraview-developers mailing list