Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
triangleset.C File Reference

Detailed Description

Demonstrates usage of class TEveTriangleSet.

#include "TCanvas.h"
#include "TStyle.h"
#include "TFile.h"
#include "TStopwatch.h"
#include "TError.h"
TEveTriangleSet *ts1=0, *ts2=0, *ts3=0;
void triangleset()
{
{
ts1 = TEveTriangleSet::ReadTrivialFile("broken_torus.tring");
ts1->SetName("RandomColors");
ts1->SetMainColor(0);
Double_t scale[3] = { 0.5, 0.5, 0.5 };
m.SetScale(scale);
}
{
ts2 = TEveTriangleSet::ReadTrivialFile("broken_torus.tring");
ts2->SetName("SmallBlue");
ts2->GenerateTriangleNormals();
ts2->SetMainColor(4);
m.RotateY(90);
Double_t scale[3] = { 0.8, 0.8, 1.2 };
m.SetScale(scale);
ts2->SetTransMatrix(m);
}
{
ts3 = TEveTriangleSet::ReadTrivialFile("broken_torus.tring");
ts3->SetName("Spectrum");
ts3->GenerateTriangleNormals();
ts3->GenerateZNormalColors(50, -50, 50, kTRUE, kTRUE);
ts3->SetMainColor(0);
m.RotateZ(90);
Double_t scale[3] = { 1.3, 1.0, 1.6 };
m.SetScale(scale);
ts3->SetTransMatrix(m);
}
}
double Double_t
Definition RtypesCore.h:59
const Bool_t kTRUE
Definition RtypesCore.h:100
R__EXTERN TEveManager * gEve
virtual void SetMainColor(Color_t color)
Set main color of the element.
virtual void SetTransMatrix(Double_t *carr)
Set transformation matrix from column-major array.
void AddElement(TEveElement *element, TEveElement *parent=0)
Add an element.
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
void Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
Made from a list of vertices and a list of triangles (triplets of vertex indices).
void GenerateRandomColors()
Assign random colors to all triangles.
static TEveTriangleSet * ReadTrivialFile(const char *file)
Read a simple ascii input file describing vertices and triangles.
void GenerateTriangleNormals()
Generate triangle normals via cross product of triangle edges.
Matrix class used for computing global transformations Should NOT be used for node definition.
Definition TGeoMatrix.h:421
virtual void RotateZ(Double_t angle)
Rotate about Z axis with angle expressed in degrees.
void SetScale(const Double_t *scale)
Definition TGeoMatrix.h:464
virtual void RotateY(Double_t angle)
Rotate about Y axis with angle expressed in degrees.
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:140
auto * m
Definition textangle.C:8
Author
Matevz Tadel

Definition in file triangleset.C.