[vtkusers] Like a "binary file"
Guiu
guilhermemm at gmail.com
Thu Mar 2 15:23:55 EST 2006
-> 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.
-------------------------------------------------------------------------------------------------
vtkCubeSource *square = vtkCubeSource::New();
square -> SetXLength(10);
square -> SetYLength(5);
// create a mapper
vtkPolyDataMapper *circleMapper = vtkPolyDataMapper::New();
circleMapper -> SetInput(circle->GetOutput());
//create an actor to represent the points
vtkActor *circleActor = vtkActor::New();
circleActor -> SetMapper( circleMapper );
circleActor -> GetProperty() -> SetColor(0, 1, 0);
// Create the Renderer and assign actors to it
vtkRenderer *circleRenderer = vtkRenderer::New();
circleRenderer -> AddActor( circleActor );
circleRenderer -> SetBackground( .1, .1, .1);
//create the render window which will show up on the screen
vtkQtRenderWindow *circleRenderWindow = new vtkQtRenderWindow(parent);
circleRenderWindow -> AddRenderer( circleRenderer );
circleRenderWindow -> setGeometry(300, 10, 400, 400);
circleRenderWindow -> show();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060302/b578a91a/attachment.htm>
More information about the vtkusers
mailing list