[vtkusers] Point Selection on vtkChartXY

Darshan Pai darshanpai at gmail.com
Tue Sep 4 10:54:24 EDT 2012


If yu have access to the vtkChartXY object in the getPointSelected
function()
you can retrieve the ID's using the following command

vtkIdTypeArray *idarray = chartxy->GetPlot(0)->GetSelection();

you can iterate through the Id's and retrieve the corresponding points .

Regards


On Mon, Sep 3, 2012 at 7:11 PM, Giuseppe Marco Randazzo <
gmrandazzo at gmail.com> wrote:

>  Points are selected, but i'm not able to get these selected points...
> i'm not able to accesso to selection.
> vtkChartXY i know that is not a Qt Widget. I put a vtkchartXY into a
> qvtkwidget.
>
> My connection works, but i'm my slot getPointSelected() is empty
>
> getPointSelected()
> {
>    // how to get point selected?
> }
>
> regards and thanks a lot :)
>
>
>
>
> On 09/04/2012 12:41 AM, Darshan Pai wrote:
>
> What exactly is your error? Does it highlight or not?
> vtkChartXY is not a Qt Widget , so I am not sure how were you able to use
> vtkQtSlotConnect .
>
> Regards
>
>
> On Mon, Sep 3, 2012 at 11:56 AM, Giuseppe Marco Randazzo <
> gmrandazzo at gmail.com> wrote:
>
>> Hello,
>>
>> i've some questions about Rubberband selection on vtkchartxy. I'm not
>> able to use this features.
>>
>> I'm using vtk inside a qt widget, so i implemented a slot and after
>> connectet this through:
>>
>>   Connections = vtkEventQtSlotConnect::New();
>> Connections->Connect(ui.qvtkWidget->GetRenderWindow()->GetInteractor(),
>>                         vtkCommand::RightButtonReleaseEvent,
>>                         this,
>>                         SLOT(getPointSelected()),0, 1.0);
>>
>>
>> When i select some points on plot with the rubberband selector, the
>> points are highlited and the slot getPointSelected() work.
>> My questions are:
>>
>> Is possible get the points highlighted? and how?
>> is there a better solution than mine?
>>
>> Thanks
>>
>> Giuseppe Marco Randazzo
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120904/360e46b3/attachment.htm>


More information about the vtkusers mailing list