Hi,<br><br>I had observed that for vtkScalarBarActor, vtkScalarBarWidget provides support for Left mouse events and mouse
movement. <br><br>So do I need to have another widget to make my vtkLegendBoxActor movable/dragable.<br><br>If so, please share how do I create a 3D_widget similar to vtkScalarBarWidget and make vtkLegendBoxActor movable/dragable by mouse.<br>
<br>NOTE: My vtkPVCustomRenderView is inherited from vtkPVRenderView.<br><br>Please share your views.<br><br>Regards,<br>Pandu.<br><br><div class="gmail_quote">On Fri, Feb 17, 2012 at 1:29 PM, Pandu tech <span dir="ltr"><<a href="mailto:pandu4tech@gmail.com">pandu4tech@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><div class="gmail_quote"><div class="im">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></div>I want this vtkLegendBoxActor behave like a ChartLegend in XYChartView, it should be dragable.<div class="im"><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></div>this->LegendBoxActor->SetPickable(1);<div class="im"><br>this->LegendBoxActor->SetDragable(1);<br><br>this->GetNonCompositedRenderer()->AddActor(this->LegendBoxActor); // here i added this actor to my view.<span><font color="#888888"><br>
<br>-- <br><br>
</font></span></div></div><br>
</blockquote></div><br>