<div dir="ltr">The problem is that vtkGraph (the superclass) is abstract and does not specify directionality. You should determine whether vtkPolyDataToGraph outputs a vtkDirectedGraph or vtkUndirectedGraph and store the output in a variable of that type before sending it to write_graph.<div>
<br></div><div>Jeff</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 7, 2013 at 5:01 AM, Dr. Roman Grothausmann <span dir="ltr">&lt;<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannover.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear mailing list members,<br>
<br>
<br>
It seems there is no vtk-Filter to save a vtkGraph as a graphviz dot-file. Therefore, I tried to create a simple program for that but it fails during compilation with:<br>
<br>
<br>
/usr/include/boost/graph/<u></u>graphviz.hpp:297:5:   required from ‘void boost::write_graphviz(std::<u></u>ostream&amp;, const Graph&amp;, typename boost::enable_if_c&lt;boost::is_<u></u>base_and_derived&lt;boost::<u></u>vertex_list_graph_tag, typename boost::graph_traits&lt;Graph&gt;::<u></u>traversal_category&gt;::value, boost::graph::detail::no_<u></u>parameter&gt;::type) [with Graph = vtkGraph*; std::ostream = std::basic_ostream&lt;char&gt;; typename boost::enable_if_c&lt;boost::is_<u></u>base_and_derived&lt;boost::<u></u>vertex_list_graph_tag, typename boost::graph_traits&lt;Graph&gt;::<u></u>traversal_category&gt;::value, boost::graph::detail::no_<u></u>parameter&gt;::type = boost::graph::detail::no_<u></u>parameter]’<br>

/home/grothama/vtk/graphviz-<u></u>vtk/vtp2dot_01.cxx:47:38:   required from here<br>
/usr/include/boost/graph/<u></u>graphviz.hpp:255:61: error: no type named ‘directed_category’ in ‘struct boost::graph_traits&lt;vtkGraph*&gt;<u></u>’<br>
/usr/include/boost/graph/<u></u>graphviz.hpp:256:42: error: no type named ‘directed_category’ in ‘struct boost::graph_traits&lt;vtkGraph*&gt;<u></u>’<br>
make[2]: *** [CMakeFiles/vtp2dot_01.dir/<u></u>vtp2dot_01.cxx.o] Error 1<br>
<br>
<br>
Am I missing something in my code (see attached zip)?<br>
<br>
Any help or hints are very much appreciated<br>
Roman<br>
_____<br>
<br>
<br>
////convert a graph stored in a vtp-file to a dot-file (graphviz)<br>
<br>
<br>
#include &lt;vtkSmartPointer.h&gt;<br>
#include &lt;vtkXMLPolyDataReader.h&gt;//for vtp-files<br>
#include &lt;vtkPolyDataToGraph.h&gt;<br>
<br>
#include &quot;vtkBoostGraphAdapter.h&quot;<br>
#include &lt;boost/graph/graphviz.hpp&gt; // For writing graphs to a file<br>
<br>
<br>
int main(int argc, char* argv[]){<br>
    if( argc != 3 )<br>
        {<br>
        std::cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; argv[0];<br>
        std::cerr &lt;&lt; &quot; inputMesh&quot;;<br>
        std::cerr &lt;&lt; &quot; outputFile&quot;;<br>
        std::cerr &lt;&lt; std::endl;<br>
        return EXIT_FAILURE;<br>
        }<br>
<br>
    if(!(strcasestr(argv[1],&quot;.vtp&quot;<u></u>))) {<br>
        std::cout &lt;&lt; &quot;The input should end with .vtp&quot; &lt;&lt; std::endl;<br>
        return -1;<br>
        }<br>
<br>
    if(!(strcasestr(argv[2],&quot;.dot&quot;<u></u>))) {<br>
        std::cout &lt;&lt; &quot;The input should end with .dot&quot; &lt;&lt; std::endl;<br>
        return -1;<br>
        }<br>
<br>
<br>
    vtkSmartPointer&lt;<u></u>vtkXMLPolyDataReader&gt; reader = vtkSmartPointer&lt;<u></u>vtkXMLPolyDataReader&gt;::New();<br>
<br>
    //reader-&gt;SetFileName(<u></u>inputFileName);<br>
    reader-&gt;SetFileName(argv[1]);<br>
    reader-&gt;Update();<br>
<br>
    vtkSmartPointer&lt;<u></u>vtkPolyDataToGraph&gt; polyDataToGraphFilter= vtkSmartPointer&lt;<u></u>vtkPolyDataToGraph&gt;::New();<br>
    polyDataToGraphFilter-&gt;<u></u>SetInputConnection(reader-&gt;<u></u>GetOutputPort());<br>
    polyDataToGraphFilter-&gt;Update(<u></u>);<br>
<br>
    vtkGraph* graph= polyDataToGraphFilter-&gt;<u></u>GetOutput();<br>
<br>
    std::ofstream fout(argv[2]);<br>
    boost::write_graphviz(fout, graph);<br>
<br>
<br>
    return EXIT_SUCCESS;<br>
    }<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
-- <br>
Dr. Roman Grothausmann<br>
<br>
Tomographie und Digitale Bildverarbeitung<br>
Tomography and Digital Image Analysis<br>
<br>
Institut für Funktionelle und Angewandte Anatomie, OE 4120<br>
Medizinische Hochschule Hannover<br>
Carl-Neuberg-Str. 1<br>
D-30625 Hannover<br>
<br>
Tel. <a href="tel:%2B49%20511%20532-9574" value="+495115329574" target="_blank">+49 511 532-9574</a><br>
</font></span><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>