Logo ROOT  
Reference Guide
TEveTriangleSet.h
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TEveTriangleSet
13#define ROOT_TEveTriangleSet
14
15#include "TEveElement.h"
16#include "TNamed.h"
17#include "TAttBBox.h"
18#include "TAtt3D.h"
19
20#include "TEveTrans.h"
21
22class TGeoMatrix;
23
25 public TAtt3D,
26 public TAttBBox
27{
29 friend class TEveTriangleSetGL;
30
31 TEveTriangleSet(const TEveTriangleSet&); // Not implemented
32 TEveTriangleSet& operator=(const TEveTriangleSet&); // Not implemented
33
34protected:
35 // Vertex data
37 Float_t* fVerts; //[3*fNVerts]
38
39 // Triangle data
41 Int_t* fTrings; //[3*fNTrings]
42 Float_t* fTringNorms; //[3*fNTrings]
43 UChar_t* fTringCols; //[3*fNTrings]
44
45public:
48
49 virtual Bool_t CanEditMainTransparency() const { return kTRUE; }
50
51 Int_t GetNVerts() const { return fNVerts; }
52 Int_t GetNTrings() const { return fNTrings; }
53
54 Float_t* Vertex(Int_t i) { return &(fVerts[3*i]); }
55 Int_t* Triangle(Int_t i) { return &(fTrings[3*i]); }
56 Float_t* TriangleNormal(Int_t i) { return &(fTringNorms[3*i]); }
57 UChar_t* TriangleColor(Int_t i) { return &(fTringCols[3*i]); }
58
60 { Float_t* v = Vertex(i); v[0] = x; v[1] = y; v[2] = z; }
62 { Int_t* t = Triangle(i); t[0] = v0; t[1] = v1; t[2] = v2; }
64 { UChar_t* c = TriangleColor(i); c[0] = r; c[1] = g; c[2] = b; c[3] = a; }
65
68 void GenerateZNormalColors(Float_t fac=20, Int_t min=-20, Int_t max=20,
70
71 virtual void ComputeBBox();
72 virtual void Paint(Option_t* option="");
73
74 void SetTransparency(Char_t tr) { SetMainTransparency(tr); } // *MENU*
75
76 static TEveTriangleSet* ReadTrivialFile(const char* file);
77
78 ClassDef(TEveTriangleSet, 0); // Generic mesh or soup of triangles with per-triangle normals and colors.
79};
80
81#endif
ROOT::R::TRInterface & r
Definition: Object.C:4
#define b(i)
Definition: RSha256.hxx:100
#define c(i)
Definition: RSha256.hxx:101
#define g(i)
Definition: RSha256.hxx:105
int Int_t
Definition: RtypesCore.h:43
unsigned char UChar_t
Definition: RtypesCore.h:36
char Char_t
Definition: RtypesCore.h:31
const Bool_t kFALSE
Definition: RtypesCore.h:90
bool Bool_t
Definition: RtypesCore.h:61
float Float_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassDef(name, id)
Definition: Rtypes.h:322
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
Helper for management of bounding-box information.
Definition: TAttBBox.h:18
A list of TEveElements.
Definition: TEveElement.h:431
virtual void SetMainTransparency(Char_t t)
Set main-transparency.
Editor for TEveTriangleSet class.
GL-renderer for TEveTriangleSet class.
Made from a list of vertices and a list of triangles (triplets of vertex indices).
Float_t * fTringNorms
~TEveTriangleSet()
Destructor.
void SetTransparency(Char_t tr)
void GenerateZNormalColors(Float_t fac=20, Int_t min=-20, Int_t max=20, Bool_t interp=kFALSE, Bool_t wrap=kFALSE)
Generate triangle colors by the z-component of the normal.
void GenerateRandomColors()
Assign random colors to all triangles.
Float_t * Vertex(Int_t i)
virtual Bool_t CanEditMainTransparency() const
Float_t * TriangleNormal(Int_t i)
void SetTriangle(Int_t i, Int_t v0, Int_t v1, Int_t v2)
virtual void ComputeBBox()
Compute bounding box.
Int_t GetNTrings() const
UChar_t * TriangleColor(Int_t i)
static TEveTriangleSet * ReadTrivialFile(const char *file)
Read a simple ascii input file describing vertices and triangles.
TEveTriangleSet(const TEveTriangleSet &)
void SetTriangleColor(Int_t i, UChar_t r, UChar_t g, UChar_t b, UChar_t a=255)
void SetVertex(Int_t i, Float_t x, Float_t y, Float_t z)
Int_t GetNVerts() const
virtual void Paint(Option_t *option="")
Paint this object. Only direct rendering is supported.
UChar_t * fTringCols
TEveTriangleSet & operator=(const TEveTriangleSet &)
void GenerateTriangleNormals()
Generate triangle normals via cross product of triangle edges.
Int_t * Triangle(Int_t i)
Geometrical transformation package.
Definition: TGeoMatrix.h:41
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
SEXP wrap(const TString &s)
Definition: RExports.h:67
Definition: file.py:1
auto * a
Definition: textangle.C:12