<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Sprechblasentext Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.SprechblasentextZchn
        {mso-style-name:"Sprechblasentext Zchn";
        mso-style-priority:99;
        mso-style-link:Sprechblasentext;
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:992950038;
        mso-list-type:hybrid;
        mso-list-template-ids:-118594942 67567633 67567641 67567643 67567631 67567641 67567643 67567631 67567641 67567643;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>nobody knows what&#8217;s going on ? Or is my question not clear enough ?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Does anybody have any experience with line lookupTable-&gt;SetIndexedLookup() ? For my concrete application, I found work arounds for the most pressing issues, but still I&#8217;d really like to understand what&#8217;s happening&#8230;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Daniel<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Frese Daniel Dr. <br><b>Gesendet:</b> Montag, 26. </span><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>November 2012 14:47<br><b>An:</b> <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br><b>Betreff:</b> Questions on vtkLookupTable, SetIndexedLookup in connection with graph display<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>Hello list,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>I try to display a graph with vertices in three different colors, as defined by a LookupTable. Reading the vtk 6.0 specs I thought that the SetIndexedLookup method would be the right thing to use, but somehow I can&#8217;t get it working. Most probably I don&#8217;t understand something very fundamental regarding this graph stuff &#8211; it would be great if somebody could shine some light on this.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>I put together a small piece of self containing, compilable code, to illustrate my questions. Not, that you might have to replace </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>vtkWin32OpenGLRenderWindow </span><span lang=EN-US>by some class appropriate to your system (I work with Visual Studio 2008 on Windows 7, 64 bit; using a git snapshot a few days old). Here we go with the code :<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&lt;iostream&gt;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A31515'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;vtkWin32OpenGLRenderWindow.h&quot;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;vtkRenderWindow.h&quot;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;vtkWin32RenderWindowInteractor.h&quot;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;vtkGraphLayoutView.h&quot;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;vtkViewTheme.h&quot;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;vtkLookupTable.h&quot;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;vtkMutableDirectedGraph.h&quot;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;vtkTree.h&quot;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;vtkIntArray.h&quot;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;vtkStringArray.h&quot;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;vtkDataRepresentation.h&quot;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;vtkRenderedGraphRepresentation.h&quot;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>#include</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;vtkDataSetAttributes.h&quot;<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A31515'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>void</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> main() {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkGraphLayoutView* view = vtkGraphLayoutView::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkWin32OpenGLRenderWindow* RenderWindow = vtkWin32OpenGLRenderWindow::SafeDownCast(view-&gt;GetRenderWindow());<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>// Construction of the lookup table, and debug output of GetColor<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkLookupTable* lookupTable = vtkLookupTable::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookupTable-&gt;SetNumberOfTableValues(3);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookupTable-&gt;SetTableValue(0, 1.0, 0.0, 0.0); <span style='color:green'>// red<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookupTable-&gt;SetTableValue(1, 0.0, 0.0, 1.0); <span style='color:green'>// blue<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookupTable-&gt;SetTableValue(2, 1.0, 1.0, 1.0); <span style='color:green'>// white<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookupTable-&gt;SetIndexedLookup(1);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookupTable-&gt;SetTableRange(0,2);&nbsp; <span style='color:green'>// this is ignored, if IndexedLookup = true<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookupTable-&gt;Build();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>double</span> rgb[4];<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>for</span> (<span style='color:blue'>int</span> i=0; i&lt;3; i++) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookupTable-&gt;GetColor(i,rgb);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt; <span style='color:#A31515'>&quot;Color &quot;</span> &lt;&lt; i &lt;&lt; <span style='color:#A31515'>&quot; : &quot;</span> &lt;&lt; rgb[0] &lt;&lt; <span style='color:#A31515'>&quot; &quot;</span> &lt;&lt; rgb[1] &lt;&lt; <span style='color:#A31515'>&quot; &quot;</span> &lt;&lt; rgb[2] &lt;&lt; endl;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>// construct view, theme and simple graph to display vertex colors<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkViewTheme *theme = vtkViewTheme::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; theme-&gt;SetPointLookupTable(lookupTable);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; view-&gt;ApplyViewTheme(theme);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkMutableDirectedGraph *vtkg = vtkMutableDirectedGraph::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>// array to encode the vertex colors<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkIntArray *vertexColors = vtkIntArray::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vertexColors-&gt;SetNumberOfComponents(1);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vertexColors-&gt;SetName(<span style='color:#A31515'>&quot;Vertex Color&quot;</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vertexColors-&gt;InsertNextValue(0);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vertexColors-&gt;InsertNextValue(1);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vertexColors-&gt;InsertNextValue(2);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>// array to encode vertex names<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkStringArray *names = vtkStringArray::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; names-&gt;SetName(<span style='color:#A31515'>&quot;Vertex Name&quot;</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; names-&gt;InsertNextValue(<span style='color:#A31515'>&quot;0&quot;</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; names-&gt;InsertNextValue(<span style='color:#A31515'>&quot;1&quot;</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; names-&gt;InsertNextValue(<span style='color:#A31515'>&quot;2&quot;</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:green'>// construct graph and add color/name arrays<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkIdType vtkvertex;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt; <span style='color:#A31515'>&quot;vertex 0 : &quot;</span> &lt;&lt; (<span style='color:blue'>int</span>) (vtkvertex = vtkg-&gt;AddVertex()) &lt;&lt; endl;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt; <span style='color:#A31515'>&quot;vertex 1 : &quot;</span> &lt;&lt; (<span style='color:blue'>int</span>) vtkg-&gt;AddChild(vtkvertex) &lt;&lt; endl;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt; <span style='color:#A31515'>&quot;vertex 2 : &quot;</span> &lt;&lt; (<span style='color:blue'>int</span>) vtkg-&gt;AddChild(vtkvertex) &lt;&lt; endl;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkg-&gt;GetVertexData()-&gt;AddArray(vertexColors);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; view-&gt;SetVertexColorArrayName(<span style='color:#A31515'>&quot;Vertex Color&quot;</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkg-&gt;GetVertexData()-&gt;AddArray(names);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; view-&gt;SetVertexLabelArrayName(<span style='color:#A31515'>&quot;Vertex Name&quot;</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; view-&gt;SetVertexLabelVisibility(<span style='color:blue'>true</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkTree*&nbsp; vtktree = vtkTree::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtktree-&gt;CheckedShallowCopy(vtkg);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkDataRepresentation* rep = view-&gt;SetRepresentationFromInput(vtktree);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkRenderedGraphRepresentation::SafeDownCast(view-&gt;GetRepresentation())-&gt;ColorVerticesByArrayOn();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; view-&gt;Render();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; view-&gt;ResetCamera();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; view-&gt;GetInteractor()-&gt;Initialize();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; view-&gt;GetInteractor()-&gt;Start();<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>The output in a DOS window is : <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Color 0 : 0.501961 0 0<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Color 1 : 0.501961 0 0<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Color 2 : 0.501961 0 0<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>vertex 0 : 0<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>vertex 1 : 1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>vertex 2 : 2<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>The output in a graphical window shows three connected vertices with the following coloring (see attached png) :<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Vertex 0 &nbsp;(middle vertex) : blue<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Vertex 1 (right vertex) : green<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Vertex 2 (left vertex): red<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>This output is different from the one I expect. Here are my questions:<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>1)<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span lang=EN-US>Why does the output of lookupTable-&gt;GetColor() return these strange values ? I would expect, that it returns e.g. for Color 0 the values 1 0 0 (=red). By the way, it behaves as I expect, when I comment the line lookupTable-&gt;SetIndexedLookup(1) &#8230;<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>2)<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span lang=EN-US>Why does the graphical output shows vertices in the mentioned colors ? I did not define green at all; I would rather expect the following color scheme:<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:34.8pt'><span lang=EN-US>Vertex 0 &nbsp;(middle vertex) : red<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:34.8pt'><span lang=EN-US>Vertex 1 (right vertex) : blue<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:34.8pt'><span lang=EN-US>Vertex 2 (left vertex): white<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The &#8220;wrong&#8221; coloring in the output window occurs regardless whether I call lookupTable-&gt;SetIndexedLookup(1) or not.<o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US>It feels somehow, as if the graph wouldn&#8217;t care at all about my lookuptable. Am I doing something entirely wrong here ?<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>3)<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span lang=EN-US>In the code example above would it have been necessary to call lookupTable-&gt;Build() ? It doesn&#8217;t seem to make a difference, when I try to omit it.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>I would appreciate any help on this.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Daniel<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><P style="FONT-SIZE: 13px"><span style="FONT-FAMILY: Arial">------------------------------------------------------------------------------------------------------ <br>Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut <br>Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard <br>Geschäftsführung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman),<br>Michael Grimm, Matthias Fauser, Sebastian Tondorf</span></P>
<P style="FONT-SIZE: 13px"><span style="FONT-FAMILY: Arial">E-Mail Haftungsausschluss / E-Mail Disclaimer<span style="FONT-FAMILY: Arial">&nbsp;</span></span></P></body></html>