43 fNContours(kNContours)
69 Info(
"TGL5DPainter::AddSurface",
"Building the mesh ...");
80 Info(
"TGL5DPainter::AddSurface",
"Mesh has %d vertices",
Int_t(mesh.
fVerts.size() / 3));
87 fIsos.front().fMesh.Swap(mesh);
88 fIsos.front().f4D = v4;
89 fIsos.front().fRange = range;
92 fIsos.front().fColor = ci;
120 if (surf ==
fIsos.end()) {
121 Error(
"TGL5DPainter::RemoveSurface",
"Invalid iterator, surface does not exist.");
133 static char mess[] = {
"gl5d"};
167 const Double_t min = isString ? v4R.first : mean - 3 * rms;
173 Info(
"InitGeometry",
"min = %g, mean = %g, rms = %g, dx = %g", min, mean, rms,
d);
177 Info(
"TGL5DPainter::InitGeometry",
"Iso-level %g, range is %g ...", isoLevel, range);
178 const Color_t color = j * 6 + 1;
179 AddSurface(isoLevel, color, 0.125, 0.05, range);
253 Info(
"ProcessEvent",
"Cut box does not work in high color, please, switch to true color");
263 gROOT->ProcessLineFast(
Form(
"((TGLPlotPainter *)0x%lx)->Paint()", (
ULong_t)
this));
281 Warning(
"SetAlpha",
"Alpha is not required for string data (your 4-th dimension is string).");
290 Warning(
"SetNContours",
"Bad number of contours: %d",
n);
318 Info(
"TGL5DPainter::ResetGeometryRanges",
"Building the mesh ...");
325 Mesh_t &mesh = surf->fMesh;
332 Info(
"TGL5DPainter::AddSurface",
"Mesh has %d vertices",
Int_t(mesh.
fVerts.size() / 3));
343 return fIsos.begin();
359 glEnable(GL_LIGHTING);
361 glEnable(GL_DEPTH_TEST);
362 glDisable(GL_CULL_FACE);
363 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
371 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
372 glDisable(GL_CULL_FACE);
373 glDisable(GL_DEPTH_TEST);
374 glDisable(GL_LIGHT0);
375 glDisable(GL_LIGHTING);
397 if (it->fAlpha != 100) {
398 needSecondPass =
kTRUE;
403 glEnable(GL_POLYGON_OFFSET_FILL);
404 glPolygonOffset(1.f, 1.f);
406 glDisable(GL_POLYGON_OFFSET_FILL);
411 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
412 glColor4d(1., 0.4, 0., 0.5);
417 if (needSecondPass) {
419 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
420 glDepthMask(GL_FALSE);
423 if (it->fAlpha == 100)
428 glEnable(GL_POLYGON_OFFSET_FILL);
429 glPolygonOffset(1.f, 1.f);
431 glDisable(GL_POLYGON_OFFSET_FILL);
435 glColor4d(1., 0.4, 0., it->fAlpha / 150.);
439 glDepthMask(GL_TRUE);
453 Float_t rgba[] = {0.f, 0.f, 0.f,
static_cast<Float_t>(it->fAlpha / 100.)};
456 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, rgba);
457 const Float_t specColor[] = {1.f, 1.f, 1.f, 1.f};
458 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specColor);
459 glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 20.f);
470 glColor3d(0.4, 0., 1.);
void Info(const char *location, const char *msgfmt,...)
void Error(const char *location, const char *msgfmt,...)
void Warning(const char *location, const char *msgfmt,...)
char * Form(const char *fmt,...)
std::vector< UInt_t > fTris
void SelectPoints(Double_t v4Level, Double_t range)
"Select" sub-range from source data
UInt_t SelectedSize() const
Size of selected sub-range.
void StartPan(Int_t px, Int_t py)
User clicks right mouse button (in a pad).
void SetSurfaceColor(ConstSurfIter_t surf) const
Set the color for iso-surface.
void DrawMesh(ConstSurfIter_t surf) const
Draw one iso-surface.
void SetNContours(Int_t num)
Set the number of predefined contours.
void ResetGeometryRanges()
No need to create or delete meshes, number of meshes (iso-levels) are the same, but meshes must be re...
SurfList_t::iterator SurfIter_t
SurfIter_t SurfacesBegin()
std::list::begin.
void RemoveSurface(SurfIter_t surf)
Remove iso-surface.
Rgl::Mc::TMeshBuilder< TKDEFGT, Float_t > fMeshBuilder
SurfIter_t SurfacesEnd()
std::list::end.
char * GetPlotInfo(Int_t px, Int_t py)
Return info for plot part under cursor.
void DeInitGL() const
Return some gl states to original values.
void SetAlpha(Double_t newAlpha)
Set selection range parameter.
void DrawCloud() const
Draw full cloud of points.
SurfIter_t AddSurface(Double_t v4, Color_t ci, Double_t isoVal=1., Double_t sigma=1., Double_t range=1e-3, Int_t lowNumOfPoints=kNLowPts)
Try to add new iso-surface.
SurfList_t::const_iterator ConstSurfIter_t
void AddOption(const TString &option)
No additional options for TGL5DPainter.
void DrawSubCloud(Double_t v4, Double_t range, Color_t ci) const
Draw cloud for selected iso-surface.
void Pan(Int_t px, Int_t py)
Mouse events handler.
void DrawPlot() const
Draw a set of meshes.
TGL5DPainter(TGL5DDataSet *data, TGLPlotCamera *camera, TGLPlotCoordinates *coord)
Constructor.
std::vector< Double_t >::size_type size_type
void ProcessEvent(Int_t event, Int_t px, Int_t py)
void InitGL() const
Initialize OpenGL state variables.
Bool_t InitGeometry()
Create mesh.
void MoveBox(Int_t px, Int_t py, Int_t axisID)
Move box cut along selected direction.
void DrawBox(Bool_t selectionPass, Int_t selected) const
Draw cut as a semi-transparent box.
void TurnOnOff()
Turn the box cut on/off.
void StartMovement(Int_t px, Int_t py)
Start cut's movement.
void ResetBoxGeometry()
Set geometry using plot's back box.
void SetPlotBox(const Rgl::Range_t &xRange, const Rgl::Range_t &yRange, const Rgl::Range_t &zRange)
Set up a frame box.
const TGLVertex3 * Get3DBox() const
Get 3D box.
void DrawBox(Int_t selectedPart, Bool_t selectionPass, const std::vector< Double_t > &zLevels, Bool_t highColor) const
Draw back box for a plot.
Camera for TGLPlotPainter and sub-classes.
void StartPan(Int_t px, Int_t py)
User clicks somewhere (px, py).
void Apply(Double_t phi, Double_t theta) const
Applies rotations and translations before drawing.
void SetCamera() const
Viewport and projection.
void Pan(Int_t px, Int_t py)
Pan camera.
Int_t GetHeight() const
viewport[3]
void SetViewVolume(const TGLVertex3 *box)
'box' is the TGLPlotPainter's back box's coordinates.
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
Bool_t SetRanges(const TH1 *hist, Bool_t errors=kFALSE, Bool_t zBins=kFALSE)
Set bin ranges, ranges.
Double_t GetYScale() const
const Rgl::Range_t & GetXRangeScaled() const
Scaled range.
const Rgl::Range_t & GetYRangeScaled() const
Scaled range.
void SetCoordType(EGLCoordType type)
If coord type was changed, plot must reset sections (if any), set fModified.
Double_t GetXScale() const
Double_t GetZScale() const
const Rgl::Range_t & GetZRangeScaled() const
Scaled range.
Base class for plot-painters that provide GL rendering of various 2D and 3D histograms,...
std::vector< Double_t > fZLevels
void RestoreModelviewMatrix() const
virtual void Paint()
Draw lego/surf/whatever you can.
TGLPlotCoordinates * fCoord
void SaveProjectionMatrix() const
void SaveModelviewMatrix() const
void RestoreProjectionMatrix() const
void BuildModel(const std::vector< Double_t > &sources, Double_t sigma=1., UInt_t dim=3, UInt_t p=8, UInt_t k=0)
Calculate coefficients for FGT.
void ExtractRGBA(Color_t colorIndex, Float_t *rgba)
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
std::pair< Double_t, Double_t > Range_t
void DrawMesh(const std::vector< Float_t > &vs, const std::vector< Float_t > &ns, const std::vector< UInt_t > &ts)
Call function-template.
Double_t Mean(Long64_t n, const T *a, const Double_t *w=0)
Return the weighted mean of an array a with length n.
Double_t RMS(Long64_t n, const T *a, const Double_t *w=0)
Return the Standard Deviation of an array a with length n.