Lars

I'm not completely sure what you want, but here's what I was thinking

class vtkMyExporter ..... {

the usual vtkSetGetStuff and all the write, update, etc

  void SetMyNameString(const char *) // for a single dataset/actor
  void SetMyNameStringList(const char **) // for a list of items
};

this gets wrapped by client server etc etc

In the GUI, you could query the name from the pqXXX stuff, I have  a similar 
snippet that does this
      pqPipelineSource *source = *it;
      std::string xmlName = source->getProxy()->GetXMLName();
now you want the name, not the XML name, so use that
but now you can
        vtkSMPropertyHelper modified(source->getProxy(), "MyNameString");
        modified.Set(xmlName.c_str()); // or something like that
then you need to push your string into the VTK class using something like
source->getProxy()->UpdateVTKObjects()
or UpdatePipeline (I forget the correct calls)
and because your custom SetMyNameString doesn't trigger a modified in the 
pipeline, you can carry on with doing the write, but the exporter has the 
string passed in from he GUI just before it writes. You can pass a string list 
if you want and make sure the order matches the order of writes so the names 
match.
Since I'm not certain what you're doing, this is a bit hand wavy, but you get 
the idea

Not sure if this helps your exact use case ...

JB


From: Lars Bilke [mailto:[email protected]]
Sent: 18 August 2011 09:14
To: Biddiscombe, John A.
Cc: Utkarsh Ayachit; ParaView Mailliste
Subject: Re: [Paraview] Get name of object in Pipeline Browser

Thanks for your answers!

John,
where on the gui-side do I need to pass that string? Do I need to modify the 
ParaView sources? Because I only want to write a plugin which should be 
redistributable to colleagues which have only the ParaView binaries installed.
And your suggestion assumes that I only want to export one actor right? What I 
want is to export all actors in one step.

Lars

Am Mittwoch, 17. August 2011 um 15:45 schrieb Biddiscombe, John A.:
It'd probably be easier to add a method to the vtk-exporter class which accepts 
a string, and from the gui, pass the string in just before export - because you 
can get it the proxy name from the gui end. Make sure the 
SetProxyName(char*...) method doesn't call Modified. (ie don't use 
SetStringMacro)

JB

-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Utkarsh Ayachit
Sent: 17 August 2011 15:16
To: Lars Bilke
Cc: ParaView Mailliste
Subject: Re: [Paraview] Get name of object in Pipeline Browser

It's not possible, not from a simple exporter plugin.The exporter
lives entirely in the VTK world without any knowledge of proxies. A
unconventional approach would be explicitly make the exporter plugin
link agains the pqCore library, then you can access the
pqApplicationCore and other singletons (like ProxyManager) and get
information about what sources are present and what their names are
(this is acceptable since exporter work entirely on the client-side).
It is still, however, non trivial to determine which actor corresponds
to what source proxy.



On Wed, Aug 17, 2011 at 3:40 AM, Lars Bilke 
<[email protected]<mailto:[email protected]>> wrote:

Dear ParaView users,
is it possible to programmatically get the name of an object in the Pipeline
Browser? To be more specific I need to get this name from a vtkActor. I am
writing a exporter plugin
(see http://www.mail-archive.com/[email protected]/msg12939.html) and
want to name my objects in the exported file.
Thanks for your help,
Lars.


_______________________________________________
Powered by www.kitware.com<http://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
_______________________________________________
Powered by www.kitware.com<http://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

_______________________________________________
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