Hi,

I've written a Plugin to use Paraview as "LiveView" for our simulation Data. With a QFileSystemWatcher the Plugin updates the filenames of the fileseries-reader everytime a new result-file was written to disk.

Now I want to change the Representation from Point to Point Sprite automaticly after the source is created and set some standard properties.
In Pythion I used:
        xreader=liggghts_Reader(guiName="liggghts_dump")
        xreader.FileNames=files
        SetDisplayProperties(xreader, Representation="Point Sprite")
        DataRepresentation1 = Show()
        DataRepresentation1.PointSpriteDefaultsInitialized = 1
        DataRepresentation1.Texture = []
        DataRepresentation1.RadiusTransferFunctionEnabled = 1
        DataRepresentation1.RadiusMode = 'Scalar'
        DataRepresentation1.Representation = 'Point Sprite'
        DataRepresentation1.RadiusArray = [None, 'radius']
        DataRepresentation1.RadiusIsProportional = 1

And I tried this in my C++Plugin:
    src = builder->createReader(QString("sources"),type, files, s); //works
    src->rename(type);

    pqActiveView& myActiveView=pqActiveView::instance();
    this->RenderView=myActiveView.current();
pqDataRepresentation *repr = builder->createDataRepresentation(src->getOutputPort(0), this->RenderView); vtkSMPropertyHelper(repr->getProxy(),"Representation").Set("Point Sprite"); //segfault

but get segfault at last line because repr is still NULL.
I attached the code and here is a video where you can see the Plugin working.
http://youtu.be/5CGGf-kPcEQ

best,
Christian

Attachment: filewatcher.tar.gz
Description: GNU Zip compressed data

_______________________________________________
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

Reply via email to