[vtkusers] important, please help simple question
Armeni Davide
Davide.Armeni at TILAB.COM
Thu Oct 28 09:23:09 EDT 2004
Hi to everyone,
i've a simple question ..
I've an actor an i want to use a vtkOutlineFilter
that contains the actor that i have to render
calculating the bounds ...
there is a function that automatically do this ?
This is the code:
int Visualize(CString pathoffile)
{
vtkPolyDataReader *part = vtkPolyDataReader::New();
part->SetFileName(pathoffile);
vtkOutlineFilter *outline = vtkOutlineFilter::New();
outline->SetInput((vtkDataSet*)part->GetOutput());
vtkDataSetMapper *partMapper = vtkDataSetMapper::New();
partMapper->SetInput((vtkDataSet*)part->GetOutput());
vtkPolyDataMapper *outlineMapper = vtkPolyDataMapper::New();
outlineMapper->SetInput(outline->GetOutput());
vtkPolyDataMapper *partMapper1 = vtkPolyDataMapper::New();
partMapper1->SetInput(axes->GetOutput());
//The actor is a grouping mechanism: besides the geometry (mapper), it
// also has a property, transformation matrix, and/or texture map.
// Here we set its color and rotate it -22.5 degrees.
vtkLODActor *partActor = vtkLODActor::New();
partActor->SetMapper(partMapper);
partActor->GetProperty()->SetColor(0.9, 0.82, 0.54);
partActor->RotateX(30.0);
partActor->RotateY(-45.0);
vtkActor *outlineActor = vtkActor::New();
outlineActor->SetMapper(outlineMapper);
outlineActor->GetProperty()->SetColor(0.9, 0.82, 0.54);
// Create the graphics structure. The renderer renders into the
// render window. The render window interactor captures mouse events
// and will perform appropriate camera or actor manipulation
// depending on the nature of the events.
vtkRenderer *ren1 = vtkRenderer::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->AddRenderer(ren1);
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renWin);
ren1->AddActor(outlineActor);
ren1->SetViewport(0.0, 0.0, 1.0, 1.0);
ren1->AddActor(partActor);
ren1->SetBackground(1.0, 1.0, 1.4);
renWin->SetSize(800, 800);
// We'll zoom in a little by accessing the camera and invoking a "Zoom"
// method on it.
renWin->Render();
// This starts the event loop and as a side effect causes an initial render.
iren->Start();
// Exiting from here, we have to delete all the instances that
// have been created.
part->Delete();
partMapper->Delete();
partActor->Delete();
ren1->Delete();
renWin->Delete();
iren->Delete();
return 0;
}
Gruppo Telecom Italia - Direzione e coordinamento di Telecom Italia S.p.A.
====================================================================
CONFIDENTIALITY NOTICE
This message and its attachments are addressed solely to the persons
above and may contain confidential information. If you have received
the message in error, be informed that any use of the content hereof
is prohibited. Please return it immediately to the sender and delete
the message. Should you have any questions, please send an e_mail to
MailAdmin at tilab.com. Thank you
====================================================================
More information about the vtkusers
mailing list