[Paraview] Plugin to modify the current transfer function

Joe Ping-Lin Hsiao phsiao at cs.unc.edu
Tue Dec 3 17:33:46 EST 2013


I figured it  out. What I need is

GUI_SOURCES
   ${UI_BUILT_SOURCES}

in ADD_PARAVIEW_PLUGIN().

However instead modifying the transfer function, what I actually what to do
is editing the Scalar to Color map. I have

pqDataRepresentation* repr =
pqActiveObjects::instance().activeRepresentation();

vtkColorTransferFunction *ctf =
vtkColorTransferFunction::SafeDownCast(repr->getLookupTable()->getProxy()->GetClientSideObject());
ctf->AddRGBPoint(10, 0, 0, 0);
ctf->AddRGBPoint(100, 0, 0, 0);

in my plugin's constructor, but when I open the transfer function editor
after applying the plugin, there's no new point in the color map. There are
just the two default color points. Am I missing something?


On Wed, Nov 27, 2013 at 2:56 PM, Joe Ping-Lin Hsiao <phsiao at cs.unc.edu>wrote:

> Which libraries should I link to use pqActiveObjects? I tried
> ${PARAVIEW_BUILD_SHARED_LIBS} but it doesn't work.
>
> Joe
>
>
> On Sat, Nov 23, 2013 at 5:48 PM, Utkarsh Ayachit <
> utkarsh.ayachit at kitware.com> wrote:
>
>> Yes, you can indeed write a client-side plugin that updates the active
>> opacity transfer function. Your plugin can monitor pqActiveObjects
>> singleton to get access to the active representation and from that you
>> can access it's ScalarOpacityFunction. Look at pqColorMapEditor and
>> pqColorOpacityEditorWidget in ParaView 4.1.0 source to see how that
>> could be done.
>>
>> Utkarsh
>>
>> On Fri, Nov 15, 2013 at 10:36 AM, Joe Ping-Lin Hsiao <phsiao at cs.unc.edu>
>> wrote:
>> > I want to modify the transfer function from my plugin, e.g. add and
>> delete
>> > points.
>> > In VTK, it would be calling vtkPiecewiseFunction->AddPoint(). Can I do
>> that
>> > in Paraview?
>> >
>> > Thanks,
>> > Joe
>> >
>> > _______________________________________________
>> > 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 ParaView Wiki at:
>> > http://paraview.org/Wiki/ParaView
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.paraview.org/mailman/listinfo/paraview
>> >
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20131203/2f62c5f1/attachment.htm>


More information about the ParaView mailing list