<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jun 14, 2017 at 2:37 AM, Elvis Stansvik <span dir="ltr"><<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><p dir="ltr">Den 13 juni 2017 5:53 em skrev "Marcus D. Hanwell" <<a href="mailto:marcus.hanwell@kitware.com" target="_blank">marcus.hanwell@kitware.com</a>>:<br>
><br>
> On Tue, Jun 13, 2017 at 9:16 AM, Elvis Stansvik <<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>> wrote:<br>
>><br>
>> 2017-06-13 15:10 GMT+02:00 Elvis Stansvik <<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>><wbr>:<br>
>>><br>
>>> I'm using a<br>
>>><br>
>>> vtkChartXY<br>
>>> vtkColorTransferControlPointsI<wbr>tem<br>
>>> vtkColorTransferFunctionItem<br>
>>><br>
>>> trio for editing a vtkColorTransferFunction.<br>
>>><br>
>>> I'm now trying to make it non-editable (I want this for system "built-in" color functions). I've tried calling SetInteractive(false) on all three of them. I even tried hiding the control points item, but still I can interact with the points using the mouse.<br>
>>><br>
>>> How can I make it non-interactive?<br>
>>><br>
>>> I'm using VTK 8.0.0.rc1.<br>
>><br>
>><br>
>> I know I could always override and swallow mouse events, but that seems like the wrong approach?<br>
>><br>
>> I'm only interested in disabling interaction with the control points item. Even hiding it as well would be OK.<br>
>><br>
> So I would use the SetActionToButton method in vtkChart, and set each action to -1 (no button).</p>
</span><p dir="ltr">Ah thanks, I'll take a look at that.</p><span class="">
<p dir="ltr">> Looking at the vtkControlPointsItem the press event is not configurable, and so you would really have to derive from it, and override it that way as far as I can see. It could be modified, but that ability doesn't appear to be present. I am trying to remember how we propagate mouse events from the containing chart, but am a little rusty on that logic.<br>
><br>
> We don't have the equivalent of an event filter as far as I am aware, but in the Qt world I would use that to intercept events before they get to the chart.</p>
</span><p dir="ltr">Alright, thanks a lot for the info.</p>
<p dir="ltr">What surprised me most was that neither SetInteractive(false) on the control points item, nor hiding it with SetVisible(false) would prevent interaction with the points. Should either of those be considered bugs?</p></blockquote><div>Yes, I think these are bugs, and we should try and get them fixed up. <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p dir="ltr">The heavy-handed approach I came up with yesterday was to simply remove the control points item from the chart temporarily when I want to disable interaction. This was OK for me since having the points also disappear was actually my ultimate goal. Just thought SetVisible(false) would be enough.</p></blockquote><div>Agreed, I think it should be, although reading through the code it is clear that is not supported.</div><div><br></div><div>Marcus <br></div></div></div></div>