[Paraview] Question on Information Objects

Joshua Murphy Joshua.Murphy at lasp.colorado.edu
Fri Mar 23 00:45:42 EDT 2012


Great! Thanks!  It can be often hard to find what you are not sure you are looking for. :)

-Josh

From: burlen <burlen.loring at gmail.com<mailto:burlen.loring at gmail.com>>
Date: Thu, 22 Mar 2012 22:41:37 -0600
To: Joshua Murphy <joshua.murphy at lasp.colorado.edu<mailto:joshua.murphy at lasp.colorado.edu>>
Cc: "paraview at paraview.org<mailto:paraview at paraview.org>" <paraview at paraview.org<mailto:paraview at paraview.org>>
Subject: Re: [Paraview] Question on Information Objects

hi, information keys are more for passing info between filters through the pipeline. if all you want is to display a string, you could make a second output port to your reader that produces a vtkTable and populate it with the string. This could be displayed in the pv ui. here's a quick example of what you'd do in your request data:


315   vtkInformation *outInfo;
316   vtkTable *output;
317   vtkStringArray *data;
318
319   // output port 1 -> bw data
320   outInfo=outputVector->GetInformationObject(0);
321   output
322     = dynamic_cast<vtkTable*>(outInfo->Get(vtkDataObject::DATA_OBJECT()));
323   data=vtkStringArray::New();
324   data->SetName("BW Data");
325   data->SetNumberOfComponents(1);
326   data->InsertNextValue(bwData.c_str());
327   output->AddColumn(data);
328   data->Delete();



On 03/22/2012 03:38 PM, Joshua Murphy wrote:
Hello,

I am trying to get meta-data information from a file into ParaView.  I have successfully built the information key-value pairs in the information object in my reader, but I am uncertain how to get the data out on the ParaView side of things.

Example:

I want to get the Calendar date meta-data from my model file.  I added Key to the information object to the results info object.

I set keys as follows:


  request->AppendUnique(vtkExecutive::KEYS_TO_COPY(), vtkENLILMetaDataKeys::REFDATE_CAL());


I have a function to add the value to the key like such:


void vtkENLILMetaDataKeys::populate_meta_data(vtkInformation* request, vtkInformationStringKey *key, char* value)

{

  request->Set(key, value);

}


I then add the values to the keys as follows:


  vtkENLILMetaDataKeys::populate_meta_data(outInfo, vtkENLILMetaDataKeys::REFDATE_CAL(), temp);

After I do this, I can successfully pull the placed data from the information object from within the reader.

What I cannot figure out is how to access this object from within Paraview.

My goal is to be able to include the calendar date (as text) in the render view.

Can someone guide me in the correct direction on how to do this?  I am looking for possibly a python way of getting at this data.

Thanks,

Josh




_______________________________________________
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120322/15131c01/attachment-0001.htm>


More information about the ParaView mailing list