<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Great!  Thanks<br>
Gib<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF361411"><font size="2" color="#000000" face="Tahoma"><b>From:</b> David Gobbi [david.gobbi@gmail.com]<br>
<b>Sent:</b> Sunday, 19 October 2014 3:27 p.m.<br>
<b>To:</b> Gib Bogle<br>
<b>Cc:</b> vtkusers@vtk.org<br>
<b>Subject:</b> Re: [vtkusers] Polygon colouring<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div>polyData->GetCellData()->SetScalars(array);</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sat, Oct 18, 2014 at 8:18 PM, Gib Bogle <span dir="ltr">
<<a href="mailto:g.bogle@auckland.ac.nz" target="_blank">g.bogle@auckland.ac.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt"><font color="000000">I'm rendering a shape using
</font><span style="color:#800080"><font color="000000">vtkPolyData, i.e. as a collection of polygons.  Is there a way to colour each polygon separately?</font><br>
</span><span style="color:#c0c0c0"></span><br>
<font color="000000">polygonPolyData = vtkSmartPointer<vtkPolyData>::New();<br>
polygonPolyData-><span style="font-style:italic">SetPoints</span>(points);<br>
polygonPolyData->SetPolys(polygons);<br>
<font>hexmapper = vtkSmartPointer<vtkPolyDataMapper>::New();<br>
hexmapper->SetInput(polygonPolyData);<br>
hexactor = vtkSmartPointer<vtkActor>::New(); <br>
hexactor-><span style="font-style:italic">SetMapper</span>(hexmapper); </font></font>
<pre style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px"><font color="000000" face="Tahoma">ren->AddActor(hexactor);</font></pre>
<font color="000000"></font></div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>