94 col[0] = (
UChar_t)
r.Uniform(60, 255);
95 col[1] = (
UChar_t)
r.Uniform(60, 255);
96 col[2] = (
UChar_t)
r.Uniform(60, 255);
151 static const TEveException kEH(
"TEveTriangleSet::ReadTrivialFile ");
153 FILE*
f = fopen(file,
"r");
155 ::Error(kEH,
"file '%s' not found.", file);
160 if (fscanf(
f,
"%d %d", &nv, &nt) != 2) {
162 throw kEH +
"Reading nv, nt failed.";
165 if (nv < 0 || nt < 0) {
167 throw kEH +
"Negative number of vertices / triangles specified.";
173 for (
Int_t i=0; i<nv; ++i, vtx+=3) {
174 if (fscanf(
f,
"%f %f %f", &vtx[0], &vtx[1], &vtx[2]) != 3) {
181 for (
Int_t i=0; i<nt; ++i, tngl+=3) {
182 if (fscanf(
f,
"%d %d %d", &tngl[0], &tngl[1], &tngl[2]) != 3) {
int Int_t
Signed integer 4 bytes (int).
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
bool Bool_t
Boolean (0=false, 1=true) (bool).
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
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)
Allocate and prepare for incremental filling.
TEveElementList(const char *n="TEveElementList", const char *t="", Bool_t doColor=kFALSE, Bool_t doTransparency=kFALSE)
Constructor.
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.
A generic, speed-optimised mapping from value to RGBA color supporting different wrapping and range t...
const UChar_t * ColorFromValue(Int_t val) const
void ComputeBBox() override
Compute bounding box.
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)
~TEveTriangleSet() override
Destructor.
static TEveTriangleSet * ReadTrivialFile(const char *file)
Read a simple ascii input file describing vertices and triangles.
TEveTriangleSet(const TEveTriangleSet &)
void GenerateTriangleNormals()
Generate triangle normals via cross product of triangle edges.
void Paint(Option_t *option="") override
Paint this object. Only direct rendering is supported.
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.
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.