New Algorithm Pipeline in VTK

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

New Algorithm Pipeline in VTK

Maximilian Weiherer

Hi all,

 

I am trying to set up a new pipeline in VTK. Therefore I specified a custom class to represent poly data, named Mesh which inherits from vtkPolyData. Further, I implemented a class MeshAlgorithm which inerhits from vtkAlgorithm. The new algorithm class should only accept Mesh objects as inputs and only produce Mesh objects as outputs. At last a third class MeshReader inherits from MeshAlgorithm. MeshReader takes 0 input arguments and produces 1 output object of type Mesh.

 

I used the example that can be found here http://www.vtk.org/Wiki/VTK/Examples/Cxx/Developers/AlgorithmFilter in order to set up my pipeline.

 

However, the execution gives me the following error (and generic warning):

 

Generic Warning: In L:\VTK_7_1_1\VTK_7_1_1\Common\DataModel\vtkDataObjectTypes.cxx, line 304

NewDataObject(): You are trying to instantiate DataObjectType "Mesh" which does not exist.

 

ERROR: In L:\VTK_7_1_1\VTK_7_1_1\Common\ExecutionModel\vtkDemandDrivenPipeline.cxx, line 653

vtkCompositeDataPipeline (000001FA9B0E5090): Algorithm MeshReader(000001FA9B0AB6D0) did not create output for port 0 when asked by REQUEST_DATA_OBJECT and does not specify a concrete DATA_TYPE_NAME.

 

In MeshAlgorithm I have

 

int MeshAlgorithm::FillOutputPortInformation(

       int vtkNotUsed(port), vtkInformation* info)

{

       // now add our info

       info->Set(vtkDataObject::DATA_TYPE_NAME(), "Mesh");

       return 1;

}

 

//----------------------------------------------------------------------------

int MeshAlgorithm::FillInputPortInformation(

       int vtkNotUsed(port), vtkInformation* info)

{

       info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "Mesh");

       return 1;

}

 

and in MeshReader

 

int MeshReader::FillOutputPortInformation(int port, vtkInformation* info)

{

  info->Set(vtkDataObject::DATA_TYPE_NAME(), "Mesh");

  return 1;

}.

 

Any suggestions why this error occurs?

 

Best regards

Maximilian

 

 


Virenfrei. www.avast.com

_______________________________________________
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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Loading...