[Paraview-developers] Unable to drag vtkLegendBoxActor

Pandu tech pandu4tech at gmail.com
Fri Feb 17 11:21:42 EST 2012


Hi,

I had observed that for vtkScalarBarActor,  vtkScalarBarWidget provides
support for  Left mouse events and mouse movement.

So do I need to have another widget to make my vtkLegendBoxActor
movable/dragable.

If so, please share how do I create a 3D_widget similar to
vtkScalarBarWidget and make vtkLegendBoxActor movable/dragable by mouse.

NOTE: My vtkPVCustomRenderView is inherited from vtkPVRenderView.

Please share your views.

Regards,
Pandu.

On Fri, Feb 17, 2012 at 1:29 PM, Pandu tech <pandu4tech at gmail.com> wrote:

>
> 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.
>
> --
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20120217/b9eb4699/attachment.htm>


More information about the Paraview-developers mailing list