[vtkusers] New Algorithm Pipeline in VTK

Maximilian Weiherer weiherer.maximilian at gmx.de
Sat Aug 5 09:43:54 EDT 2017


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

 

 



---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170805/5e343e9e/attachment-0001.html>


More information about the vtkusers mailing list