New macro: example usage of StraightLineSet set.
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Apr 2007 16:37:21 +0000 (16:37 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Apr 2007 16:37:21 +0000 (16:37 +0000)
EVE/macros/reve_lineset_test.C [new file with mode: 0644]

diff --git a/EVE/macros/reve_lineset_test.C b/EVE/macros/reve_lineset_test.C
new file mode 100644 (file)
index 0000000..78a2bee
--- /dev/null
@@ -0,0 +1,25 @@
+// $Header$
+
+Reve::StraightLineSet* reve_lineset_test(Int_t nlines = 40, Int_t nmarkers = 4) 
+{
+  Reve::StraightLineSet* ls = new Reve::StraightLineSet();
+
+  TRandom r(0);
+  Float_t s = 100;
+
+  for(Int_t i = 0; i<nlines; i++)
+  {
+    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));
+    // add random number of markers
+    Int_t nm = Int_t(nmarkers* r.Rndm());
+    for(Int_t m = 0; m < nm; m++) {
+      ls->AddMarker(i, r.Rndm());
+    }
+  }
+  
+  gReve->AddRenderElement(ls);
+  gReve->Redraw3D();
+  return ls;  
+}