38 fNVerts (nv), fVerts(0),
39 fNTrings (nt), fTrings(0), fTringNorms(0), fTringCols(0)
95 col[0] = (
UChar_t)
r.Uniform(60, 255);
96 col[1] = (
UChar_t)
r.Uniform(60, 255);
97 col[2] = (
UChar_t)
r.Uniform(60, 255);
152 static const TEveException kEH(
"TEveTriangleSet::ReadTrivialFile ");
154 FILE*
f = fopen(
file,
"r");
161 if (fscanf(
f,
"%d %d", &nv, &nt) != 2) {
163 throw kEH +
"Reading nv, nt failed.";
166 if (nv < 0 || nt < 0) {
168 throw kEH +
"Negative number of vertices / triangles specified.";
174 for (
Int_t i=0; i<nv; ++i, vtx+=3) {
175 if (fscanf(
f,
"%f %f %f", &vtx[0], &vtx[1], &vtx[2]) != 3) {
182 for (
Int_t i=0; i<nt; ++i, tngl+=3) {
183 if (fscanf(
f,
"%d %d %d", &tngl[0], &tngl[1], &tngl[2]) != 3) {
R__EXTERN TEveManager * gEve
void BBoxCheckPoint(Float_t x, Float_t y, Float_t z)
void BBoxZero(Float_t epsilon=0, Float_t x=0, Float_t y=0, Float_t z=0)
Create cube of volume (2*epsilon)^3 at (x,y,z).
void BBoxInit(Float_t infinity=1e6)
Dynamic Float_t[6] X(min,max), Y(min,max), Z(min,max)
virtual void InitMainTrans(Bool_t can_edit=kTRUE)
Initialize the main transformation to identity matrix.
virtual void PaintStandard(TObject *id)
Paint object – a generic implementation for EVE elements.
Exception class thrown by TEve classes and macros.
void Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
A generic, speed-optimised mapping from value to RGBA color supporting different wrapping and range t...
const UChar_t * ColorFromValue(Int_t val) const
Made from a list of vertices and a list of triangles (triplets of vertex indices).
~TEveTriangleSet()
Destructor.
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 void ComputeBBox()
Compute bounding box.
static TEveTriangleSet * ReadTrivialFile(const char *file)
Read a simple ascii input file describing vertices and triangles.
TEveTriangleSet(const TEveTriangleSet &)
virtual void Paint(Option_t *option="")
Paint this object. Only direct rendering is supported.
void GenerateTriangleNormals()
Generate triangle normals via cross product of triangle edges.
Int_t * Triangle(Int_t i)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
This is the base class for the ROOT Random number generators.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
TVector3 is a general three vector class, which can be used for the description of different vectors ...
void SetXYZ(Double_t x, Double_t y, Double_t z)
TVector3 Cross(const TVector3 &) const
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.