43 fNContours(kNContours)
69 Info(
"TGL5DPainter::AddSurface",
"Building the mesh ...");
80 Info(
"TGL5DPainter::AddSurface",
"Mesh has %d vertices",
Int_t(mesh.fVerts.size() / 3));
82 if (!mesh.fVerts.size())
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 ResetBoxGeometry()
Set geometry using plot's back box.
std::vector< UInt_t > fTris
Camera for TGLPlotPainter and sub-classes.
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
const Rgl::Range_t & GetZRangeScaled() const
Scaled range.
void MoveBox(Int_t px, Int_t py, Int_t axisID)
Move box cut along selected direction.
void SetSurfaceColor(ConstSurfIter_t surf) const
Set the color for iso-surface.
UInt_t SelectedSize() const
Size of selected sub-range.
std::pair< Double_t, Double_t > Range_t
void StartPan(Int_t px, Int_t py)
User clicks somewhere (px, py).
const Rgl::Range_t & GetYRangeScaled() const
Scaled range.
void TurnOnOff()
Turn the box cut on/off.
void DeInitGL() const
Return some gl states to original values.
Double_t GetZScale() const
void SetAlpha(Double_t newAlpha)
Set selection range parameter.
TGLViewer::ECameraType camera
SurfList_t::const_iterator ConstSurfIter_t
Double_t RMS(Long64_t n, const T *a, const Double_t *w=0)
Bool_t InitGeometry()
Create mesh.
void SaveProjectionMatrix() const
std::vector< Double_t >::size_type size_type
void ExtractRGBA(Color_t colorIndex, Float_t *rgba)
TGL5DPainter(TGL5DDataSet *data, TGLPlotCamera *camera, TGLPlotCoordinates *coord)
Constructor.
void InitGL() const
Initialize OpenGL state variables.
void Info(const char *location, const char *msgfmt,...)
void Error(const char *location, const char *msgfmt,...)
Double_t GetXScale() const
void Pan(Int_t px, Int_t py)
Mouse events handler.
void Apply(Double_t phi, Double_t theta) const
Applies rotations and translations before drawing.
void SetViewVolume(const TGLVertex3 *box)
'box' is the TGLPlotPainter's back box's coordinates.
void DrawPlot() const
Draw a set of meshes.
void SelectPoints(Double_t v4Level, Double_t range)
"Select" sub-range from source data
void RestoreProjectionMatrix() const
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
SurfList_t::iterator SurfIter_t
void DrawBox(Bool_t selectionPass, Int_t selected) const
Draw cut as a semi-transparent box.
char * GetPlotInfo(Int_t px, Int_t py)
Return info for plot part under cursor.
void DrawMesh(ConstSurfIter_t surf) const
Draw one iso-surface.
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
Double_t Mean(Long64_t n, const T *a, const Double_t *w=0)
void Pan(Int_t px, Int_t py)
Pan camera.
char * Form(const char *fmt,...)
void SaveModelviewMatrix() const
SurfIter_t SurfacesEnd()
std::list::end.
void ResetGeometryRanges()
No need to create or delete meshes, number of meshes (iso-levels) are the same, but meshes must be re...
void DrawSubCloud(Double_t v4, Double_t range, Color_t ci) const
Draw cloud for selected iso-surface.
void Warning(const char *location, const char *msgfmt,...)
Base class for plot-painters that provide GL rendering of various 2D and 3D histograms, functions and parametric surfaces.
std::vector< Double_t > fZLevels
void DrawCloud() const
Draw full cloud of points.
void RestoreModelviewMatrix() 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 AddOption(const TString &option)
No additional options for TGL5DPainter.
void DrawBox(Int_t selectedPart, Bool_t selectionPass, const std::vector< Double_t > &zLevels, Bool_t highColor) const
Draw back box for a plot.
Rgl::Mc::TMeshBuilder< TKDEFGT, Float_t > fMeshBuilder
void SetCoordType(EGLCoordType type)
If coord type was changed, plot must reset sections (if any), set fModified.
Bool_t SetRanges(const TH1 *hist, Bool_t errors=kFALSE, Bool_t zBins=kFALSE)
Set bin ranges, ranges.
const TGLVertex3 * Get3DBox() const
Get 3D box.
void StartPan(Int_t px, Int_t py)
User clicks right mouse button (in a pad).
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.
void BuildMesh(const DataSource *src, const TGridGeometry< ValueType > &geom, MeshType_t *mesh, ValueType iso)
Build iso-mesh using marching cubes.
void SetNContours(Int_t num)
Set the number of predefined contours.
const Rgl::Range_t & GetXRangeScaled() const
Scaled range.
Double_t GetYScale() const
void ProcessEvent(Int_t event, Int_t px, Int_t py)
void StartMovement(Int_t px, Int_t py)
Start cut's movement.
void SetPlotBox(const Rgl::Range_t &xRange, const Rgl::Range_t &yRange, const Rgl::Range_t &zRange)
Set up a frame box.
SurfIter_t SurfacesBegin()
std::list::begin.
void RemoveSurface(SurfIter_t surf)
Remove iso-surface.
TGLPlotCoordinates * fCoord
virtual void Paint()
Draw lego/surf/whatever you can.
void SetCamera() const
Viewport and projection.
void DrawMesh(const std::vector< Float_t > &vs, const std::vector< Float_t > &ns, const std::vector< UInt_t > &ts)
Call function-template.
Int_t GetHeight() const
viewport[3]