[vtkusers] $Help$: Derive from vtkGraphAlgorithm

Yang, Jinzhong jinzhong76 at gmail.com
Tue Oct 18 15:42:18 EDT 2011


Below is the original email I posted for help on the vtkGraphAlgorithm. I
did some more investigation on this issue and found the following problem. I
hope someone can help me to solve this problem. 

Here is the test. I copied the class vtkVertexDegree in VTK to my testing
class vtkVertexDegreeTest. I compiled the vtkVertexDegreeTest class as a
static lib and dynamic lib (.dll) respectively and called this class in my
test code. Now you will see the issue. If I compiled the class as a static
lib, everything was fine. However, if I compiled the class as a dynamic lib,
the previously described error happened. I attached my testing code for your
examination. In cmake configuration, there is a switch to compile the
library as a static (unchecked) or dynamic (checked) lib.  Again, my VTK
version is 5.4.2.

 

Thank you very much for your help!

-Jinzhong

 

From: Yang, Jinzhong [mailto:jinzhong76 at gmail.com] 
Sent: Tuesday, October 18, 2011 10:30 AM
To: vtkusers at vtk.org
Subject: Derive from vtkGraphAlgorithm

 

Hi All,

 

I was trying to implement a class deriving from vtkGraphAlgorithm. I used
the vtkBoostbreadthFirstSearch as the template for my implementation;
however, I did not implement the FillInputPortInformaiton and
FillOutputPortInformation. However, when I tested my code, I got the
following error message:

 

ERROR: In ..\..\source\Filtering\vtkExecutive.cxx, line 757

vtkStreamingDemandDrivenPipeline (01965648): Algorithm
vtkUndirectedGraphCPP(01963930) returned failure for request: vtkInformation
(01965E08)

  Debug: Off

  Modified Time: 23

  Reference Count: 1

  Registered Events: (none)

  Request: REQUEST_DATA_OBJECT

  ALGORITHM_AFTER_FORWARD: 1

  FORWARD_DIRECTION: 0

 

The following is the testing code to call my implemented class
vtkUndirectedGraphCPP:

 

  vtkUndirectedGraphCPP * cpp = vtkUndirectedGraphCPP::New();

  cpp->SetInput(g);

  cpp->SetOriginVertex(0);

  cpp->SetEdgeCostArrayName("weights");

  cpp->Update();

 

Here g is a vtkMutableUndirectedGraph. I did a little bit search and found
that I should overwrite RequestDataObject instead of RequestData. This would
be quite different from other implementations in vtk. Could anybody help to
solve this problem? My VTK version is  5.4.2.

 

Thanks,

Jinzhong

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111018/c11b95dc/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111018/c11b95dc/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TestCPP.cpp
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111018/c11b95dc/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vtkVertexDegreeTest.cpp
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111018/c11b95dc/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vtkVertexDegreeTest.h
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111018/c11b95dc/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Win32Header.h
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111018/c11b95dc/attachment-0001.asc>


More information about the vtkusers mailing list