-> I have this class in vtk to draw a square and I would like as
result a binary file, I mean, get as output a matrix with 1 where is a
square and 0 where is not (in a .dat file if it is possible). Thaks to
everybody.<br>
<br>
-------------------------------------------------------------------------------------------------<br>
&nbsp;&nbsp; vtkCubeSource *square = vtkCubeSource::New();<br>
&nbsp;&nbsp;&nbsp; square -&gt; SetXLength(10);<br>
&nbsp;&nbsp;&nbsp; square -&gt; SetYLength(5);<br>
&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp; &nbsp;// create a mapper<br>
&nbsp;&nbsp; &nbsp;vtkPolyDataMapper *circleMapper = vtkPolyDataMapper::New();<br>
&nbsp;&nbsp; &nbsp;circleMapper -&gt; SetInput(circle-&gt;GetOutput());<br>
&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp; &nbsp;//create an actor to represent the points <br>
&nbsp;&nbsp; &nbsp;vtkActor *circleActor = vtkActor::New();<br>
&nbsp;&nbsp; &nbsp;circleActor -&gt; SetMapper( circleMapper );<br>
&nbsp;&nbsp; &nbsp;circleActor -&gt; GetProperty() -&gt; SetColor(0, 1, 0);<br>
&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp; &nbsp;// Create the Renderer and assign actors to it<br>
&nbsp;&nbsp; &nbsp;vtkRenderer *circleRenderer = vtkRenderer::New();<br>
&nbsp;&nbsp; &nbsp;circleRenderer -&gt; AddActor( circleActor );<br>
&nbsp;&nbsp; &nbsp;circleRenderer -&gt; SetBackground( .1, .1, .1);<br>
&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp; &nbsp;//create the render window which will show up on the screen<br>
&nbsp;&nbsp; &nbsp;vtkQtRenderWindow *circleRenderWindow = new vtkQtRenderWindow(parent);<br>
&nbsp;&nbsp; &nbsp;circleRenderWindow -&gt; AddRenderer( circleRenderer );<br>
&nbsp;&nbsp; &nbsp;circleRenderWindow -&gt; setGeometry(300, 10, 400, 400);<br>
&nbsp;&nbsp; &nbsp;circleRenderWindow -&gt; show();<br>
<br>