<!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>&nbsp;</DIV>
<DIV><FONT size=2>Call myDoubleArray-&gt;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-&gt;Update, you should get a 
result.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>JB</FONT></DIV>
<DIV>&nbsp;</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&nbsp; main( 
  )<BR>{<BR>&nbsp; <BR>vtkOpenGLRenderer *rn=vtkOpenGLRenderer::New();&nbsp; 
  <BR>vtkWin32RenderWindowInteractor *ract;<BR><BR>vtkWin32OpenGLRenderWindow 
  *win=vtkWin32OpenGLRenderWindow::New();<BR>win-&gt;AddRenderer(rn);<BR>&nbsp; 
  &nbsp; &nbsp; <BR>vtkPropAssembly&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
  *m_assembly;<BR>m_assembly=vtkPropAssembly::New();<BR><BR>tkDoubleArray&nbsp; 
  &nbsp; &nbsp; &nbsp; &nbsp; *m_coordinates;<BR>vtkPoints&nbsp; &nbsp; &nbsp; 
  &nbsp; &nbsp; &nbsp; &nbsp; *m_points;<BR>vtkCellArray&nbsp; &nbsp; &nbsp; 
  &nbsp; &nbsp; *m_cells;<BR>vtkPolyData&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
  &nbsp; &nbsp; *m_polys;<BR>vtkPolyDataMapper&nbsp; &nbsp; 
  *m_polyMapper;<BR>vtkActor&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
  *m_polyActor;<BR>&nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 
  <BR><BR>m_coordinates 
  =vtkDoubleArray::New();<BR>m_coordinates-&gt;SetNumberOfComponents(3);<BR>m_coordinates-&gt;SetNumberOfTuples(4);<BR><BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; &nbsp; 
  <BR>m_coordinates-&gt;SetTuple3(0,0.0,0.0,0.0);&nbsp; &nbsp; 
  <BR>m_coordinates-&gt;SetTuple3(1,0.0,5.0,0.0);<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
  &nbsp; &nbsp; &nbsp; 
  <BR>m_coordinates-&gt;SetTuple3(2,5.0,0.0,0.0);<BR>m_coordinates-&gt;SetTuple3(3,5.0,5.0,0.0);<BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; &nbsp; <BR>m_points 
  =vtkPoints::New();<BR>m_points-&gt;SetNumberOfPoints(4);<BR>m_points-&gt;SetData(m_coordinates 
  );<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
  &nbsp; <BR><BR>&nbsp; &nbsp; <BR>m_cells 
  =vtkCellArray::New();<BR>m_cells-&gt;InsertNextCell(4);<BR>m_cells-&gt;InsertCellPoint(0);<BR>m_cells-&gt;InsertCellPoint(2);<BR>m_cells-&gt;InsertCellPoint(3);<BR>m_cells-&gt;InsertCellPoint(1);<BR>&nbsp; 
  &nbsp; <BR>&nbsp; &nbsp; <BR>m_polys 
  =vtkPolyData::New();<BR>m_polys-&gt;SetPoints(m_points 
  );<BR>m_polys-&gt;SetPolys(m_cells);<BR><BR>m_polyMapper 
  =vtkPolyDataMapper::New();<BR>m_polyMapper-&gt;SetInput(m_polys );<BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; &nbsp; <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
  <BR>m_polyActor =vtkActor::New();<BR>m_polyActor-&gt;SetMapper(m_polyMapper 
  );<BR>m_polyActor-&gt;GetProperty()-&gt;SetColor(0.0,1.0,0.0);<BR>m_polyActor-&gt;GetProperty()-&gt;SetOpacity(0.25);<BR>&nbsp; 
  &nbsp; &nbsp; &nbsp; &nbsp; 
  <BR>m_assembly-&gt;AddPart(m_polyActor);<BR>rn-&gt;AddActor(m_assembly);<BR><BR><BR>unsigned 
  long x;<BR><BR>while (true)<BR>{<BR>for 
  (x=0;x&lt;300;x++);<BR>win-&gt;Render();<BR>&nbsp; <BR>//here iam changing the 
  coordiantes <BR>m_coordinates-&gt;SetTuple3(0,0.0,0.0,0.0);&nbsp; &nbsp; 
  <BR>m_coordinates-&gt;SetTuple3(1,0.0,5.0,0.0);&nbsp; &nbsp; &nbsp; &nbsp; 
  &nbsp; 
  <BR>m_coordinates-&gt;SetTuple3(2,8.0,0.0,0.0);<BR>m_coordinates-&gt;SetTuple3(3,8.0,5.0,0.0);<BR><BR>m_polyMapper-&gt;Update();<BR><BR>}<BR>&nbsp; 
  <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>