44 fXOZSlice(
"XOZ", (
TH3 *)hist, fun, coord, &fBackBox,
TGLTH3Slice::kXOZ),
45 fYOZSlice(
"YOZ", (
TH3 *)hist, fun, coord, &fBackBox,
TGLTH3Slice::kYOZ),
46 fXOYSlice(
"XOY", (
TH3 *)hist, fun, coord, &fBackBox,
TGLTH3Slice::kXOY)
55 static char mess[] = {
"fun3" };
169 Info(
"ProcessEvent",
"Cut box does not work in high color, please, switch to true color");
184 gROOT->ProcessLineFast(
Form(
"((TGLPlotPainter *)0x%lx)->Paint()", (
ULong_t)
this));
195 glEnable(GL_LIGHTING);
197 glEnable(GL_DEPTH_TEST);
198 glDisable(GL_CULL_FACE);
199 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
207 glDisable(GL_LIGHTING);
208 glDisable(GL_LIGHT0);
209 glDisable(GL_DEPTH_TEST);
210 glDisable(GL_CULL_FACE);
211 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
234 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
235 glDepthMask(GL_FALSE);
248 glDepthMask(GL_TRUE);
262 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
263 glDepthMask(GL_FALSE);
267 glEnable(GL_POLYGON_OFFSET_FILL);
268 glPolygonOffset(1.f, 1.f);
270 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
279 glDisable(GL_POLYGON_OFFSET_FILL);
280 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
281 glColor4d(0., 0., 0., 0.25);
288 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
290 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
294 glDepthMask(GL_TRUE);
326 Float_t diffColor[] = {0.8f, 0.8f, 0.8f, 0.15f};
330 c->GetRGB(diffColor[0], diffColor[1], diffColor[2]);
332 glMaterialfv(GL_BACK, GL_DIFFUSE, diffColor);
333 diffColor[0] /= 2, diffColor[1] /= 2, diffColor[2] /= 2;
334 glMaterialfv(GL_FRONT, GL_DIFFUSE, diffColor);
335 const Float_t specColor[] = {1.f, 1.f, 1.f, 1.f};
336 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specColor);
337 glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 70.f);
393 fXOZSlice(
"XOZ", (
TH3 *)hist, coord, &fBackBox,
TGLTH3Slice::kXOZ),
394 fYOZSlice(
"YOZ", (
TH3 *)hist, coord, &fBackBox,
TGLTH3Slice::kYOZ),
395 fXOYSlice(
"XOY", (
TH3 *)hist, coord, &fBackBox,
TGLTH3Slice::kXOY),
399 Error(
"TGLIsoPainter::TGLIsoPainter",
"Wrong type of histogramm, must have 3 dimensions");
407 static char mess[] = {
"iso" };
417 Error(
"TGLIsoPainter::TGLIsoPainter",
"Wrong type of histogramm, must have 3 dimensions");
445 for (
UInt_t i = 0; i < nContours; ++i)
450 for (
UInt_t i = 0; i < nContours; ++i)
464 for (
UInt_t i = 0; i < nContours; ++i) {
465 if (firstMesh !=
fCache.end()) {
480 fIsos.back().Swap(newMesh);
573 Info(
"ProcessEvent",
"Cut box does not work in high color, please, switch to true color");
588 gROOT->ProcessLineFast(
Form(
"((TGLPlotPainter *)0x%lx)->Paint()", (
ULong_t)
this));
599 glEnable(GL_LIGHTING);
601 glEnable(GL_DEPTH_TEST);
602 glDisable(GL_CULL_FACE);
603 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
611 glDisable(GL_LIGHTING);
612 glDisable(GL_LIGHT0);
613 glDisable(GL_DEPTH_TEST);
614 glDisable(GL_CULL_FACE);
615 glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
631 Error(
"TGLIsoPainter::DrawPlot",
"Non-equal number of levels and isos");
641 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
642 glDepthMask(GL_FALSE);
648 for (; iso !=
fIsos.end(); ++iso, ++colorInd)
653 glDepthMask(GL_TRUE);
704 Float_t diffColor[] = {0.8f, 0.8f, 0.8f, 0.25f};
709 c->GetRGB(diffColor[0], diffColor[1], diffColor[2]);
712 diffColor[0] = color[0] / 255.;
713 diffColor[1] = color[1] / 255.;
714 diffColor[2] = color[2] / 255.;
717 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffColor);
718 const Float_t specColor[] = {1.f, 1.f, 1.f, 1.f};
719 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specColor);
720 diffColor[0] /= 3.5, diffColor[1] /= 3.5, diffColor[2] /= 3.5;
721 glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, diffColor);
722 glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 30.f);
738 }
else if (
typeid(*
fHist) ==
typeid(
TH3S)) {
741 }
else if (
typeid(*
fHist) ==
typeid(
TH3I)) {
744 }
else if (
typeid(*
fHist) ==
typeid(
TH3F)) {
747 }
else if (
typeid(*
fHist) ==
typeid(
TH3D)) {
void Info(const char *location, const char *msgfmt,...)
void Error(const char *location, const char *msgfmt,...)
char * Form(const char *fmt,...)
std::vector< UInt_t > fTris
void BuildMesh(const DataSource *src, const TGridGeometry< ValueType > &geom, MeshType_t *mesh, ValueType iso)
Build iso-mesh using marching cubes.
virtual Color_t GetFillColor() const
Return the fill area color.
Int_t GetLast() const
Return last bin on the axis i.e.
Int_t GetFirst() const
Return first bin on the axis i.e.
The color creation and management class.
A 3-Dim function with parameters.
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.
Bool_t HasSections() const
Any section exists.
Bool_t InitGeometry()
Initializes meshes for 3d iso contours.
void DrawSectionYOZ() const
Draw YOZ parallel section.
void DrawPlot() const
Draw mesh.
void StartPan(Int_t px, Int_t py)
User clicks right mouse button (in a pad).
void AddOption(const TString &option)
No additional options for TGLIsoPainter.
TGLIsoPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord)
Constructor.
void DeInitGL() const
Initialize OpenGL state variables.
void DrawMesh(const Mesh_t &mesh, Int_t level) const
Draw TF3 surface.
void ProcessEvent(Int_t event, Int_t px, Int_t py)
Change color scheme.
void InitGL() const
Initialize OpenGL state variables.
std::list< Mesh_t >::iterator MeshIter_t
void FindMinMax()
Find max/min bin contents for TH3.
std::vector< Double_t > fColorLevels
void SetMesh(Mesh_t &mesh, Double_t isoValue)
Grid geometry.
void DrawSectionXOY() const
Draw XOY parallel section.
void DrawSectionXOZ() const
Draw XOZ parallel section.
void SetSurfaceColor(Int_t ind) const
Set color for surface.
void Pan(Int_t px, Int_t py)
User's moving mouse cursor, with middle mouse button pressed (for pad).
std::list< Mesh_t >::const_iterator ConstMeshIter_t
char * GetPlotInfo(Int_t px, Int_t py)
Return info for plot part under cursor.
const UChar_t * GetColour(Double_t z) const
Get color.
Bool_t GeneratePalette(UInt_t paletteSize, const Rgl::Range_t &zRange, Bool_t checkSize=kTRUE)
Try to find colors for palette.
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.
void ResetModified()
Reset modified.
Bool_t Modified() const
Modified.
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,...
void DrawSections() const
Draw sections (if any).
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
Plot-painter for TF3 functions.
void InitGL() const
Initialize OpenGL state variables.
void DrawPlot() const
Draw mesh.
Rgl::Mc::TIsoMesh< Double_t > fMesh
void AddOption(const TString &stringOption)
No options for tf3.
TGLTF3Painter(TF3 *fun, TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord)
Constructor.
char * GetPlotInfo(Int_t px, Int_t py)
Coords for point on surface under cursor.
void DrawDefaultPlot() const
Surface with material properties and lighting.
void ProcessEvent(Int_t event, Int_t px, Int_t py)
Change color scheme.
void StartPan(Int_t px, Int_t py)
User clicks right mouse button (in a pad).
void DrawToSelectionBuffer() const
Draw triangles, no normals, no lighting.
void DeInitGL() const
Initialize OpenGL state variables.
void SetSurfaceColor() const
Set color for surface.
void DrawSectionXOY() const
Draw XOY parallel section.
void Pan(Int_t px, Int_t py)
User's moving mouse cursor, with middle mouse button pressed (for pad).
void DrawSectionYOZ() const
Draw YOZ parallel section.
void DrawMaplePlot() const
Colored surface, without lighting and material properties.
void DrawSectionXOZ() const
Draw XOZ parallel section.
Bool_t InitGeometry()
Create mesh.
Bool_t HasSections() const
Any section exists.
void DrawSlice(Double_t pos) const
Draw slice.
3 component (x/y/z) vertex class.
virtual Int_t GetNbinsY() const
virtual Int_t GetNbinsZ() const
virtual Double_t GetContourLevelPad(Int_t level) const
Return the value of contour number "level" in Pad coordinates.
virtual Int_t GetDimension() const
@ kUserContour
user specified contour levels
virtual Int_t GetNbinsX() const
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual Double_t GetSumOfWeights() const
Return the sum of weights excluding under/overflows.
virtual Int_t GetContour(Double_t *levels=0)
Return contour values into array levels if pointer levels is non zero.
3-D histogram with a byte per channel (see TH1 documentation)
3-D histogram with a double per channel (see TH1 documentation)}
3-D histogram with a float per channel (see TH1 documentation)}
3-D histogram with an int per channel (see TH1 documentation)}
3-D histogram with a short per channel (see TH1 documentation)
The 3-D histogram classes derived from the 1-D histogram classes.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
void DrawMapleMesh(const std::vector< Double_t > &vs, const std::vector< Double_t > &ns, const std::vector< UInt_t > &ts)
Colored mesh with lighting disabled.
void ObjectIDToColor(Int_t objectID, Bool_t highColor)
Object id encoded as rgb triplet.
void DrawMesh(const std::vector< Float_t > &vs, const std::vector< Float_t > &ns, const std::vector< UInt_t > &ts)
Call function-template.
Short_t Max(Short_t a, Short_t b)
Short_t Min(Short_t a, Short_t b)