<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->SetInput(mb);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>m_AssignFilter->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'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"><<a href="mailto:remywendy@gmail.com">remywendy@gmail.com</a>></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've been trying to fix this all day and can'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's lines); however the lines are all solid color - white, instead of based on the lookup table... (I've also tried building a lookup table with the same results). I've debugged and checked that the m_NumberContours and other parameters are all okay... Although m_TargetArray is a qstring thats something like "Var 0 - f00000.00183.p3d" </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->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->SetInput(mb);</div><div><span style="white-space:pre">        </span>m_ContourFilter = vtkContourFilter::New();</div><div>
<span style="white-space:pre">        </span>m_ContourFilter->SetInputConnection(surfaceFilter->GetOutputPort());</div><div><span style="white-space:pre">        </span>m_ContourFilter->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->GenerateValues(m_NumberContours, m_Min, m_Max);</div>
<div><span style="white-space:pre">        </span>m_ContourFilter->ComputeScalarsOn();</div><div><span style="white-space:pre">        </span>surfaceFilter->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->SetInputConnection( m_ContourFilter->GetOutputPort() );</div>
<div><div><span style="white-space:pre">        </span>m_Mapper->SetScalarRange(m_Min, m_Max);</div><div><span style="white-space:pre">        </span>m_Mapper->SetInterpolateScalarsBeforeMapping(1);</div>
<div><span style="white-space:pre">        </span>m_Mapper->SetColorModeToMapScalars();</div></div><div><span style="white-space:pre">        </span>m_Mapper->CreateDefaultLookupTable();</div>
<div><br></div><div><span style="white-space:pre">         </span>this->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->SetNumberOfCloudPoints(1000);</div><div><div><span style="white-space:pre">        </span>m_Actor->GetProperty()->SetRepresentation(2);</div>
<div><span style="white-space:pre">        </span>m_Actor->SetMapper(m_Mapper);</div><div><span style="white-space:pre">        </span>m_Renderer->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'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>