[Paraview] Instanciating an unknown type

Fred Fred stan1313 at hotmail.fr
Sat Feb 20 05:08:48 EST 2010


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 !

_______________________________________________

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



 		 	   		  
_________________________________________________________________
Tchattez en direct en en vidéo avec vos amis !  
http://www.windowslive.fr/messenger/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100220/6a3f9e5d/attachment-0001.htm>


More information about the ParaView mailing list