<br><div class="gmail_quote">Hi,<br><br>I created a vtkLegendBoxActor and I added it to my custom view.<br><br>actor looks fine and working fine, but I am unable to drag it with the mouse. I want to make it dragable.<br><br>
I tried this->LegendBoxActor->SetDragable(1); but this did not work for me.<br><br>I want this vtkLegendBoxActor behave like a ChartLegend in XYChartView, it should be dragable.<br>
<br>Please suggest your views.<br><br>Appreciate your help in this regard.<br><br>Here is my code <br clear="all"><br>this->LegendBoxActor = vtkLegendBoxActor::New();<br> this->LegendBoxActor->SetNumberOfEntries(5);<br>
this->LegendBoxActor->SetUseBackground(1);<br> this->LegendBoxActor->SetBackgroundColor(backgroundColor);<br> this->LegendBoxActor->SetBackgroundOpacity(1.0);<br><br><br> this->LegendBoxActor->GetPositionCoordinate()->SetCoordinateSystemToView();<br>
this->LegendBoxActor->GetPositionCoordinate()->SetValue(-0.1, -0.2);<br><br> this->LegendBoxActor->GetPosition2Coordinate()->SetCoordinateSystemToView();<br> this->LegendBoxActor->GetPosition2Coordinate()->SetValue(0.1, 0.2);<br>
<br>for(int i=0; i < 5; ++i)<br> {<br> vtkSmartPointer<vtkLineSource> ls (vtkSmartPointer<vtkLineSource>::New());<br> vtkSmartPointer<vtkPolyData> pd = ls->GetOutput();<br> this->LegendBoxActor->SetEntry(i, pd, text[i], textColor[i]);<br>
}<br><br>this->LegendBoxActor->SetPickable(1);<br>this->LegendBoxActor->SetDragable(1);<br><br>this->GetNonCompositedRenderer()->AddActor(this->LegendBoxActor); // here i added this actor to my view.<span class="HOEnZb"><font color="#888888"><br>
<br>-- <br>Thanks,<br>Hanumanth.<br><br>
</font></span></div><br>