[Paraview] Instanciating an unknown type

Berk Geveci berk.geveci at kitware.com
Sat Feb 20 12:36:46 EST 2010


Hmmm. Then I don't have an explanation why point data is not getting copied.

output->GetPointData()->PassData(this->input->GetPointData());

should do it.

-berk

On Sat, Feb 20, 2010 at 10:43 AM, Fred Fred <stan1313 at hotmail.fr> wrote:

>  Yes, of course, it is in RequestData()
>
> ------------------------------
> Date: Sat, 20 Feb 2010 10:28:37 -0500
>
> Subject: Re: [Paraview] Instanciating an unknown type
> From: berk.geveci at kitware.com
> To: stan1313 at hotmail.fr
> CC: paraview at paraview.org
>
> Where is the code? In RequestData()?
>
> GetFieldData() != GetPointData() + GetCellData()
>
> FieldData is a set of arrays associated with the whole data object and not
> necessarily with points or cells. This may be some meta-data like integral
> of pressure for example. Or anything else your heart desires :-)
>
> -berk
>
> On Sat, Feb 20, 2010 at 5:08 AM, Fred Fred <stan1313 at hotmail.fr> wrote:
>
>  Right, vtkDataSetAlgorithm::RequestDataObject() seems to do the job but
> now I have another problem: the point data are no longer copied to the
> output.
> Here is my code, what is wrong?
>
>   // get the output
>   vtkInformation *outInfo = outputVector->GetInformationObject(0);
>   vtkDataSet *output =
> vtkDataSet::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
>
>   // pass all associated data to output dataset
>   output->CopyStructure(this->input);
>   output->GetPointData()->PassData(this->input->GetPointData());
>   output->GetFieldData()->PassData(this->input->GetFieldData());
>
> and another question: is GetFieldData() the same as GetPointData() +
> GetCellData() ?
>
> ------------------------------
> Date: Fri, 19 Feb 2010 06:38:50 -0500
> Subject: Re: [Paraview] Instanciating an unknown type
> From: berk.geveci at kitware.com
> To: stan1313 at hotmail.fr
> CC: paraview at paraview.org
>
>
> vtkDataSet* output = input->NewInstance();
>
> vtkDataSetAlgorithm::RequestDataObject() already does this though. You
> shouldn't need to. See that method for details.
>
> -berk
>
> On Fri, Feb 19, 2010 at 6:35 AM, Fred Fred <stan1313 at hotmail.fr> wrote:
>
>  My problem is as follow: I am writing a vtkDataSetAlgorithm filter and I
> need to create the ouput dataset, which must be of the same type as the
> input.
> Is there a one-line way to do it, ie avoiding if (input->IsA("vtkPolyData")
> output=vtkPolyData::New(); else if ... ?
>
>
> ------------------------------
> Avec Internet Explorer, surfez en toute discrétion sur internet Cliquez
> ici ! <http://clk.atdmt.com/FRM/go/182932252/direct/01/>
>
> _______________________________________________
> 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
>
>
>
> ------------------------------
> Windows 7 : Trouvez le PC qui vous convient! Découvrez notre offre !
> <http://clk.atdmt.com/FRM/go/181574577/direct/01/>
>
>
>
> ------------------------------
> Discute avec tes amis partout, grâce à Messenger sur ton mobile. Cliquez
> ici ! <http://www.messengersurvotremobile.com/>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100220/1de48149/attachment.htm>


More information about the ParaView mailing list