[vtkusers] Drawing lines in a 3D environment

Dmitri Danewitz d.danewitz at yahoo.de
Tue Jul 1 04:07:42 EDT 2008


Thanks a lot, Mario!
 
This works perfectly. I´ve tried this with 1000 lines and it runs very fast.
 
greets
Dmitri

--- Mario Richtsfeld <rm at acin.tuwien.ac.at> schrieb am Mo, 30.6.2008:

Von: Mario Richtsfeld <rm at acin.tuwien.ac.at>
Betreff: Re: Drawing lines in a 3D environment
An: d.danewitz at yahoo.de
Datum: Montag, 30. Juni 2008, 16:03








Hello!
 
I hope it helps!
 
void Data::paintLine(double *p1, double *p2, float gr, int r, int g, int b)
{
            vtkLineSource *line = vtkLineSource::New();
            line->SetPoint1(p1[0], p1[1], p1[2]);
            line->SetPoint2(p2[0], p2[1], p2[2]);
 
            vtkPolyDataMapper *map = vtkPolyDataMapper::New();
            map->SetInput(line->GetOutput());
 
            vtkActor *Axes = vtkActor::New();
            Axes->SetMapper(map);
            Axes->GetProperty()->SetColor(r, g, b);
            Axes->GetProperty()->SetLineWidth(gr);
            Axes->GetProperty()->SetLineWidth(5.0);
            rend->AddActor(Axes);
//-----------------------------------------------------------------------
            Axes->Delete();
            line->Delete();
            map->Delete();
}
 
________________________________________
Dipl.-Ing.(FH) Mario Richtsfeld
Research assistant
AUTOMATION & CONTROL INSTITUTE | ACIN
VIENNA UNIVERSITY OF TECHNOLOGY
Gußhausstraße 27-29 | 376. 1040 Wien 
Tel.: +43 (0)1 - 58801 - 77663 
Fax.: +43 (0)1 - 58801 - 37699 
rm at acin.tuwien.ac.at | www.acin.tuwien.ac.at
 


      __________________________________________________________
Unglücklich mit Ihrer Mail-Adresse?

Millionen neuer Mail-Adressen - jetzt bei Yahoo!

http://de.docs.yahoo.com/mail/wunschmailadresse/index.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080701/2e831d72/attachment.htm>


More information about the vtkusers mailing list