Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > 8c86774a3e53d77cc119f53a2b94a57a > files > 637

root-tutorial-5.34.14-2.fc18.noarch.rpm

## Translated from 'lineset.C'.
## Run as: python -i lineset.py

import ROOT
ROOT.PyConfig.GUIThreadScheduleOnce += [ ROOT.TEveManager.Create ]

def lineset(nlines = 40, nmarkers = 4):
    r = ROOT.TRandom(0)
    s = 100

    ls = ROOT.TEveStraightLineSet()

    for i in range(nlines):
        ls.AddLine( r.Uniform(-s,s), r.Uniform(-s,s), r.Uniform(-s,s) ,
                    r.Uniform(-s,s), r.Uniform(-s,s), r.Uniform(-s,s))
        nm = int(nmarkers*r.Rndm())
        for m in range(nm):
            ls.AddMarker( i, r.Rndm() )
    ls.SetMarkerSize(1.5)
    ls.SetMarkerStyle(4)

    ROOT.gEve.AddElement(ls)
    ROOT.gEve.Redraw3D()
    return ls

if __name__=='__main__':
    ROOT.PyGUIThread.finishSchedule()
    lineset()