<div>Update: its working now using vtkAssignAttribute, which is then connected to the vtkDataSetSurfaceFilter...</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkAssignAttribute *m_AssignFilter = vtkAssignAttribute::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>m_AssignFilter-&gt;SetInput(mb);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>m_AssignFilter-&gt;Assign(m_TargetArray.toAscii().constData(), </div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>vtkDataSetAttributes::SCALARS, vtkAssignAttribute::POINT_DATA);</div><div><br></div><div>I remember when I tried this before that this assigns the active attribute of vtkPointData class, so changing from one array to another would mess up if there were multiple contours (say, contours on array 1 and array 2, but there is only one active attribute so both contours would map the same array), however I didn&#39;t notice it this time. Anyone have more info on this?</div>
<br><div class="gmail_quote">On Tue, Jan 19, 2010 at 4:45 PM, da <span dir="ltr">&lt;<a href="mailto:remywendy@gmail.com">remywendy@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hey guys,<div><br></div><div>I&#39;ve been trying to fix this all day and can&#39;t seem to figure out what the problem is.</div><div>I have a vtkMultiBlockDataSet that I want to draw contour lines on the surface of. </div>

<div><br></div><div>When I run the following code, the contour lines show up (correctly as well - matches Paraview&#39;s lines); however the lines are all solid color - white, instead of based on the lookup table... (I&#39;ve also tried building a lookup table with the same results). I&#39;ve debugged and checked that the m_NumberContours and other parameters are all okay... Although m_TargetArray is a qstring thats something like &quot;Var 0 - f00000.00183.p3d&quot; </div>

<div><br></div><div><br></div><div><div><span style="white-space:pre">        </span>// Composite Pipeline</div><div><span style="white-space:pre">        </span>vtkCompositeDataPipeline* prototype = vtkCompositeDataPipeline::New();</div>

<div><span style="white-space:pre">        </span>vtkAlgorithm::SetDefaultExecutivePrototype(prototype);</div><div><span style="white-space:pre">        </span>prototype-&gt;Delete();</div>
</div><div><br></div><div><div><span style="white-space:pre">        </span>// Extract the Surface, then Contour</div><div><span style="white-space:pre">        </span>vtkDataSetSurfaceFilter *surfaceFilter = vtkDataSetSurfaceFilter::New();</div>

<div><span style="white-space:pre">        </span>surfaceFilter-&gt;SetInput(mb);</div><div><span style="white-space:pre">        </span>m_ContourFilter = vtkContourFilter::New();</div><div>
<span style="white-space:pre">        </span>m_ContourFilter-&gt;SetInputConnection(surfaceFilter-&gt;GetOutputPort());</div><div><span style="white-space:pre">        </span>m_ContourFilter-&gt;SetInputArrayToProcess(0,0,0,</div>
<div><span style="white-space:pre">                </span>vtkDataObject::FIELD_ASSOCIATION_POINTS,m_TargetArray.toAscii().constData());</div><div><span style="white-space:pre">        </span>m_ContourFilter-&gt;GenerateValues(m_NumberContours, m_Min, m_Max);</div>

<div><span style="white-space:pre">        </span>m_ContourFilter-&gt;ComputeScalarsOn();</div><div><span style="white-space:pre">        </span>surfaceFilter-&gt;Delete();</div><div><br></div>
<div><span style="white-space:pre">        </span>// Mapper</div><div><span style="white-space:pre">        </span>m_Mapper = vtkCompositePolyDataMapper::New();</div><div><span style="white-space:pre">        </span>m_Mapper-&gt;SetInputConnection( m_ContourFilter-&gt;GetOutputPort() );</div>

<div><div><span style="white-space:pre">        </span>m_Mapper-&gt;SetScalarRange(m_Min, m_Max);</div><div><span style="white-space:pre">        </span>m_Mapper-&gt;SetInterpolateScalarsBeforeMapping(1);</div>
<div><span style="white-space:pre">        </span>m_Mapper-&gt;SetColorModeToMapScalars();</div></div><div><span style="white-space:pre">        </span>m_Mapper-&gt;CreateDefaultLookupTable();</div>
<div><br></div><div><span style="white-space:pre">         </span>this-&gt;SetupScalarBar();</div><div><br></div><div><span style="white-space:pre">        </span>// Actor</div><div><div>
<span style="white-space:pre">        </span>m_Actor = vtkLODActor::New();</div><div><span style="white-space:pre">        </span>m_Actor-&gt;SetNumberOfCloudPoints(1000);</div><div><div><span style="white-space:pre">        </span>m_Actor-&gt;GetProperty()-&gt;SetRepresentation(2);</div>

<div><span style="white-space:pre">        </span>m_Actor-&gt;SetMapper(m_Mapper);</div><div><span style="white-space:pre">        </span>m_Renderer-&gt;AddActor(m_Actor);</div><div><br></div>
<div><span style="white-space:pre">        </span>vtkAlgorithm::SetDefaultExecutivePrototype(0);<span style="white-space:pre">        </span>// End composite pipeline</div><div><br></div><div>
<br></div><div>A side question I have is about vtkAssignAttribute class - this class just assigns the active attribute correct? So if I wanted to show two contours from the same vtkPointData, I couldn&#39;t use this class?</div>

<div><br></div><div>Any info is appreciated!</div><div>Thanks,</div><div>Da</div><div><br></div><div><br></div></div></div></div>
</blockquote></div><br>