triangleset.C

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: triangleset.C 26876 2008-12-12 14:45:40Z matevz $
00002 // Author: Matevz Tadel
00003 
00004 // Demonstrates usage of class TEveTriangleSet.
00005 
00006 #include "TCanvas.h"
00007 #include "TStyle.h"
00008 #include "TFile.h"
00009 #include "TStopwatch.h"
00010 #include "TError.h"
00011 
00012 class TEveTriangleSet;
00013 
00014 TEveTriangleSet *ts1=0, *ts2=0, *ts3=0;
00015 
00016 void triangleset()
00017 {
00018    TEveManager::Create();
00019 
00020    {
00021       ts1 = TEveTriangleSet::ReadTrivialFile("broken_torus.tring");
00022       ts1->SetName("RandomColors");
00023       ts1->GenerateTriangleNormals();
00024       ts1->GenerateRandomColors();
00025       ts1->SetMainColor(0);
00026       TGeoHMatrix m;
00027       Double_t scale[3] = { 0.5, 0.5, 0.5 };
00028       m.SetScale(scale);
00029       ts1->SetTransMatrix(m);
00030       gEve->AddElement(ts1);
00031    }
00032    {
00033       ts2 = TEveTriangleSet::ReadTrivialFile("broken_torus.tring");
00034       ts2->SetName("SmallBlue");
00035       ts2->GenerateTriangleNormals();
00036       ts2->SetMainColor(4);
00037       TGeoHMatrix m;
00038       m.RotateY(90);
00039       Double_t scale[3] = { 0.8, 0.8, 1.2 };
00040       m.SetScale(scale);
00041       ts2->SetTransMatrix(m);
00042       gEve->AddElement(ts2);
00043    }
00044    {
00045       ts3 = TEveTriangleSet::ReadTrivialFile("broken_torus.tring");
00046       ts3->SetName("Spectrum");
00047       ts3->GenerateTriangleNormals();
00048       gStyle->SetPalette(1, 0);
00049       ts3->GenerateZNormalColors(50, -50, 50, kTRUE, kTRUE);
00050       ts3->SetMainColor(0);
00051       TGeoHMatrix m;
00052       m.RotateZ(90);
00053       Double_t scale[3] = { 1.3, 1.0, 1.6 };
00054       m.SetScale(scale);
00055       ts3->SetTransMatrix(m);
00056       gEve->AddElement(ts3);
00057    }
00058 
00059    gEve->Redraw3D(kTRUE);
00060 }

Generated on Tue Jul 5 15:44:06 2011 for ROOT_528-00b_version by  doxygen 1.5.1