<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hi All,<BR>
<BR>
<DIV id=result_box dir=ltr>I have a value generated by a timer component (Vmaxgrad[i][j][k]). </DIV>
<DIV dir=ltr>How is it possible to update an actor with these generated values?</DIV>
<BR>
Thanks a lot.<BR>
<BR>
<BR>
Her is my code:<BR>
<BR>
vtkFloatArray *vetores = vtkFloatArray::New();<BR> vetores->SetNumberOfComponents(3);<BR>
vtkPoints *pontos = vtkPoints::New();<BR>
vtkFloatArray *xCoords = vtkFloatArray::New();<BR>for (i=0; i<=a; i++) xCoords->InsertNextValue(xv[i]);<BR>
vtkFloatArray *yCoords = vtkFloatArray::New();<BR>for (i=0; i<=b; i++) yCoords->InsertNextValue(yv[i]);<BR>
vtkFloatArray *zCoords = vtkFloatArray::New();<BR>for (i=0; i<=c; i++) zCoords->InsertNextValue(zv[i]);<BR>
vtkRectilinearGrid *rgrid = vtkRectilinearGrid::New();<BR> rgrid->SetDimensions(a+1,b+1,c+1);<BR> rgrid->SetXCoordinates(xCoords);<BR> rgrid->SetYCoordinates(yCoords);<BR> rgrid->SetZCoordinates(zCoords);<BR>
vtkDoubleArray *array = vtkDoubleArray::New();<BR> for (k=0; k<=c; k++)<BR> for (j=0; j<=b; j++)<BR> for (i=0; i<=a; i++) {<BR> array->InsertValue(k*(a+1)*(b+1)+j*(a+1)+i, Vmaxgrad[i][j][k]);<BR> pontos->InsertPoint(k*(a+1)*(b+1)+j*(a+1)+i, i, j, k);<BR> vetores->InsertTuple3(k*(a+1)*(b+1)+j*(a+1)+i, vx[i][j][k], vy[i][j][k], vz[i][j][k]);<BR>}<BR> rgrid->GetPointData()->SetVectors(vetores);<BR> rgrid->GetPointData()->SetScalars(array);<BR>
vtkRectilinearGridGeometryFilter *plane = vtkRectilinearGridGeometryFilter::New();<BR> plane->SetInput(rgrid);<BR>
vtkLookupTable *Table = vtkLookupTable::New();<BR> Table->SetNumberOfColors(150);<BR> Table->SetHueRange(0.667 , 0);<BR> Table->SetRange(rgrid->GetScalarRange());<BR>
<BR>vtkRectilinearGridOutlineFilter *outline = vtkRectilinearGridOutlineFilter::New();<BR> outline->SetInput(rgrid);<BR>
vtkPolyDataMapper *outlineMapper = vtkPolyDataMapper::New();<BR> outlineMapper->SetInputConnection(outline->GetOutputPort());<BR>
vtkActor *outlineActor = vtkActor::New();<BR> outlineActor->SetMapper(outlineMapper);<BR> outlineActor->GetProperty()->SetColor( 0, 0, 0);<BR>
<BR>
<BR>
VTK3->GetRenderer()->AddActor(outlineActor);<BR> }<BR><BR><BR><br /><hr />Notícias direto do New York Times, gols do Lance, videocassetadas e muitos outros vídeos no MSN Videos! <a href='http://video.msn.com/?mkt=pt-br' target='_new'>Confira já!</a></body>
</html>