<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>For efficiency reasons, when you change the points directly in
a vtkDoubleArray object, the "Modified" flag doesn't get set (otherwise when you
created datasets, it would be touched millions of times for no good
reason).</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Call myDoubleArray->Modified()</FONT></DIV>
<DIV><FONT size=2>after you have adjusted the points. This will make the dataset
think it's been tweaked and when you do Mapper->Update, you should get a
result.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>JB</FONT></DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=davidmichell@rediffmail.com
href="mailto:davidmichell@rediffmail.com">david michell</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=vtkusers@vtk.org
href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, February 09, 2004 8:45
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [vtkusers] Dynamic
resizing</DIV>
<DIV><BR></DIV>
<P>Hello Everybody,<BR>Iam using vtk42 and vc++7.<BR>Iam trying to resize a
polygon at runtime.<BR>I created a polygon made of triangle strips.<BR>The
coordinate points are in a vtkdoublearray and then Iam storing the values in
vtkpoints.<BR>Then the vtkcellarray hold the cell values, and Iam using
vtkpolydata to hold the points and the cells.<BR>Iam using vtkpolydatamapper
to map the data and then a vtkactor.<BR>In a while loop after rendering for
sometime (iam not using interactor), I change the coordinates of the
<BR>polygon in the vtkdoublearray.Then I update the mapper.<BR>BUT the polygon
is not resized, I dont know why. Can someone please tell me why its not
happening and correct it please.<BR><BR>Thank you,<BR>David
Michell<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>void main(
)<BR>{<BR> <BR>vtkOpenGLRenderer *rn=vtkOpenGLRenderer::New();
<BR>vtkWin32RenderWindowInteractor *ract;<BR><BR>vtkWin32OpenGLRenderWindow
*win=vtkWin32OpenGLRenderWindow::New();<BR>win->AddRenderer(rn);<BR>
<BR>vtkPropAssembly
*m_assembly;<BR>m_assembly=vtkPropAssembly::New();<BR><BR>tkDoubleArray
*m_coordinates;<BR>vtkPoints
*m_points;<BR>vtkCellArray
*m_cells;<BR>vtkPolyData
*m_polys;<BR>vtkPolyDataMapper
*m_polyMapper;<BR>vtkActor
*m_polyActor;<BR> <BR> <BR> <BR>
<BR><BR>m_coordinates
=vtkDoubleArray::New();<BR>m_coordinates->SetNumberOfComponents(3);<BR>m_coordinates->SetNumberOfTuples(4);<BR><BR>
<BR>m_coordinates->SetTuple3(0,0.0,0.0,0.0);
<BR>m_coordinates->SetTuple3(1,0.0,5.0,0.0);<BR>
<BR>m_coordinates->SetTuple3(2,5.0,0.0,0.0);<BR>m_coordinates->SetTuple3(3,5.0,5.0,0.0);<BR>
<BR>m_points
=vtkPoints::New();<BR>m_points->SetNumberOfPoints(4);<BR>m_points->SetData(m_coordinates
);<BR> <BR>
<BR><BR> <BR>m_cells
=vtkCellArray::New();<BR>m_cells->InsertNextCell(4);<BR>m_cells->InsertCellPoint(0);<BR>m_cells->InsertCellPoint(2);<BR>m_cells->InsertCellPoint(3);<BR>m_cells->InsertCellPoint(1);<BR>
<BR> <BR>m_polys
=vtkPolyData::New();<BR>m_polys->SetPoints(m_points
);<BR>m_polys->SetPolys(m_cells);<BR><BR>m_polyMapper
=vtkPolyDataMapper::New();<BR>m_polyMapper->SetInput(m_polys );<BR>
<BR><BR>
<BR>m_polyActor =vtkActor::New();<BR>m_polyActor->SetMapper(m_polyMapper
);<BR>m_polyActor->GetProperty()->SetColor(0.0,1.0,0.0);<BR>m_polyActor->GetProperty()->SetOpacity(0.25);<BR>
<BR>m_assembly->AddPart(m_polyActor);<BR>rn->AddActor(m_assembly);<BR><BR><BR>unsigned
long x;<BR><BR>while (true)<BR>{<BR>for
(x=0;x<300;x++);<BR>win->Render();<BR> <BR>//here iam changing the
coordiantes <BR>m_coordinates->SetTuple3(0,0.0,0.0,0.0);
<BR>m_coordinates->SetTuple3(1,0.0,5.0,0.0);
<BR>m_coordinates->SetTuple3(2,8.0,0.0,0.0);<BR>m_coordinates->SetTuple3(3,8.0,5.0,0.0);<BR><BR>m_polyMapper->Update();<BR><BR>}<BR>
<BR><BR>}<BR><BR><BR><BR></P><BR><BR><A
href="http://clients.rediff.com/signature/track_sig.asp" target=_blank><IMG
height=74 hspace=0
src="http://ads.rediff.com/RealMedia/ads/adstream_nx.cgi/www.rediffmail.com/inbox.htm@Bottom"
width=496 border=0></A> </BLOCKQUOTE></BODY></HTML>