[Paraview] modifying vtkInformation object to point to new vtkDataObject

Christine Corbett Moran corbett at physik.uzh.ch
Wed Oct 14 03:37:22 EDT 2009


Hi,

Yes, I realize that I shouldn't modify the original input vector.
There are copy methods for both vtkInformationVector and
vtkInformation, so I'm planning to work with a duplicate of the
original, modified only in the data object it holds, to send to the
superclass. Would that scenario also be bad practice?

I'm not sure there is another good way, unless I copy and paste the
superclass' RequestData code into my subclass or modify the
superclass, which I'd also rather not do as the superclass is within
ParaView's main tree.

In any case, I'd like to know more about figuring out which key to use
to access data from the information vector. The get/set methods in
vtkInformation take a key as input. But if I were to create a key,
e.g. using the constructor of vtkInformationDataObjectKey I need both
a name and a location, neither of which I know.

Christine

On Wed, Oct 14, 2009 at 3:50 AM, Berk Geveci <berk.geveci at kitware.com> wrote:
> I am not sure why it doesn't work but what you are doing is not safe
> and is bad practice. The inputVector belongs to the input of this
> filter and you should not modify it (other than passing a request
> during RequestUpdateExtent). Isn't there another way you can do this?
> Maybe having a data member defined in the superclass that you set in
> the subclass? Or defining a helper function that you can call from the
> subclass with the alternative input and with the regular input from
> the superclass' RequestData?
>
>
> On Tue, Oct 13, 2009 at 3:38 PM, Christine Corbett Moran
> <corbett at physik.uzh.ch> wrote:
>> Hi,
>>
>> I want to modify a vtkInformation object (specifically one within a
>> vtkInformation vector) to point to a new data set.
>>
>> The use case is I have a derived class for which, in its RequestData
>> method, I want to do some preprocessing on the input, then send the
>> preprocessed input to the superclass via the superclass' RequestData
>> method, then post process the output within the derived class. I don't
>> want to modify the original input so I work with an (in my use case
>> much smaller) subset of it, but the problem is then passing it on to
>> the superclass for processing.
>>
>> Right now I do:
>> inputVector[0]->GetInformationObject(0)->Set(
>>  vtkDataObject::DATA_OBJECT(),newDataSet).
>> Before my call to the super's RequestData method, but the superclass
>> seems not to operate on the newDataSet, nor on the original data set,
>> so I think I'm inadvertently pummeling something, probably using the
>> wrong vtkInformationDataObjectKey. However I'm not sure how to divine
>> the correct one. Any help would be appreciated.
>>
>> Cheers,
>> Christine
>> _______________________________________________
>> 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
>>
>


More information about the ParaView mailing list