38 fNVerts (nv), fVerts(0),
39 fNTrings (nt), fTrings(0), fTringNorms(0), fTringCols(0)
75 e1.
SetXYZ(v1[0]-v0[0], v1[1]-v0[1], v1[2]-v0[2]);
76 e2.
SetXYZ(v2[0]-v0[0], v2[1]-v0[1], v2[2]-v0[2]);
152 static const TEveException kEH(
"TEveTriangleSet::ReadTrivialFile ");
154 FILE*
f = fopen(file,
"r");
156 ::Error(kEH,
"file '%s' not found.", file);
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) {
A generic, speed-optimised mapping from value to RGBA color supporting different wrapping and range t...
~TEveTriangleSet()
Destructor.
Int_t * Triangle(Int_t i)
void GenerateTriangleNormals()
Generate triangle normals via cross product of triangle edges.
virtual void PaintStandard(TObject *id)
Paint object – a generic implementation for EVE elements.
void Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
virtual void Paint(Option_t *option="")
Paint this object. Only direct rendering is supported.
void BBoxCheckPoint(Float_t x, Float_t y, Float_t z)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
This is the base class for the ROOT Random number generators.
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
void SetXYZ(Double_t x, Double_t y, Double_t z)
void GetXYZ(Double_t *carray) const
const UChar_t * ColorFromValue(Int_t val) const
TVector3 is a general three vector class, which can be used for the description of different vectors ...
TVector3 Cross(const TVector3 &) const
virtual void InitMainTrans(Bool_t can_edit=kTRUE)
Initialize the main transformation to identity matrix.
R__EXTERN TEveManager * gEve
virtual void ComputeBBox()
Compute bounding box.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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).
Made from a list of vertices and a list of triangles (triplets of vertex indices).
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
Float_t * Vertex(Int_t i)
static TEveTriangleSet * ReadTrivialFile(const char *file)
Read a simple ascii input file describing vertices and triangles.
Exception class thrown by TEve classes and macros.
void GenerateRandomColors()
Assign random colors to all triangles.
TEveTriangleSet(const TEveTriangleSet &)
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.
double norm(double *x, double *p)
void BBoxInit(Float_t infinity=1e6)
Dynamic Float_t[6] X(min,max), Y(min,max), Z(min,max)