17#include "TGLIncludes.h"
48 fM = SetModelDynCast<TEveProjectionAxes>(obj);
68 if (orig.size() == 0)
return;
78 for (TGLAxisPainter::LabVec_t::iterator it = orig.begin(); it != orig.end(); ++it)
91 filtered.push_back(orig[minIdx]);
99 pos = orig[minIdx].first;
100 for (
Int_t i=minIdx-1; i>=0; --i)
104 filtered.push_back(orig[i]);
111 if (minIdx < (
size -1))
113 pos = orig[minIdx].first;
118 filtered.push_back(orig[i]);
125 if (filtered.size() >= 2)
174 Double_t bl1=0, bh1=0, bl2=0, bh2=0;
194 for (
Int_t i=1; i<bn2; i++)
196 if (pMinor > p2)
break;
204 pMinor = n1*bw1 -bw2;
226 Double_t bl1=0, bh1=0, bl2=0, bh2=0;
250 for (
Int_t k=1; k<bn2; k++)
253 if (pSecond > p2)
break;
264 if (pSecond < p1)
break;
279 Float_t off = ( bb[ax*2 + 1] - bb[ax*2]) * 0.5;
285 if (frustMin > bbMin) {
287 min += (frustMax - frustMin) * 0.1;
294 if (frustMax < bbMax) {
296 max -= (frustMax - frustMin) * 0.1;
322 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
324 glDisable(GL_LIGHTING);
325 glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
326 glEnable(GL_COLOR_MATERIAL);
327 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
328 glDisable(GL_CULL_FACE);
332 glGetFloatv(GL_DEPTH_RANGE, old_depth_range);
333 glDepthRange(0, 0.001);
349 glDisable(GL_LIGHTING);
359 glVertex3f(
c[0] +
d,
c[1],
c[2]); glVertex3f(
c[0] -
d,
c[1],
c[2]);
360 glVertex3f(
c[0],
c[1] +
d,
c[2]); glVertex3f(
c[0],
c[1] -
d,
c[2]);
361 glVertex3f(
c[0],
c[1],
c[2] +
d); glVertex3f(
c[0],
c[1],
c[2] -
d);
370 glVertex3f(zero[0] +
d, zero[1], zero[2]); glVertex3f(zero[0] -
d, zero[1], zero[2]);
371 glVertex3f(zero[0], zero[1] +
d, zero[2]); glVertex3f(zero[0], zero[1] -
d, zero[2]);
372 glVertex3f(zero[0], zero[1], zero[2] +
d); glVertex3f(zero[0], zero[1], zero[2] -
d);
380 using namespace TMath;
382 glGetIntegerv(GL_VIEWPORT, vp);
404 glTranslatef( 0,
b, 0);
412 glTranslatef( 0, t, 0);
435 glTranslatef(
l, 0, 0);
443 glTranslatef(
r, 0, 0);
453 Warning(
"TEveProjectionAxesGL::DirectDraw",
"caught exception: '%s'.", exc.
Data());
456 glDepthRange(old_depth_range[0], old_depth_range[1]);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
virtual Int_t GetNdivisions() const
virtual Style_t GetLabelFont() const
virtual Float_t GetLabelSize() const
Exception class thrown by TEve classes and macros.
OpenGL renderer class for TEveProjectionAxes.
TEveProjectionAxesGL()
Constructor.
void Draw(TGLRnrCtx &rnrCtx) const override
Draw function for TEveProjectionAxesGL. Skips line-pass of outline mode.
void SplitIntervalByVal(Float_t min, Float_t max, Int_t axis) const
Add tick-marks on fixed value step.
void SplitIntervalByPos(Float_t min, Float_t max, Int_t axis) const
Add tick-marks at equidistant position.
TEveProjection * fProjection
TGLAxisPainter fAxisPainter
void FilterOverlappingLabels(Int_t idx, Float_t ref) const
Filter overlapping labels.
void GetRange(Int_t ax, Float_t frustMin, Float_t frustMax, Float_t &start, Float_t &en) const
Get range from bounding box of projection manager and frustum size.
void DirectDraw(TGLRnrCtx &rnrCtx) const override
Actual rendering code.
void SetBBox() override
Fill the bounding-box data of the logical-shape.
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model object.
void SplitInterval(Float_t x1, Float_t x2, Int_t axis) const
Build an array of tick-mark position-value pairs.
Axes for non-linear projections.
Bool_t GetDrawOrigin() const
TEveProjectionManager * fManager
TEveProjectionManager * GetManager()
Bool_t GetDrawCenter() const
ELabMode GetLabMode() const
TEveProjection * GetProjection()
virtual Float_t GetValForScreenPos(Int_t ax, Float_t value)
Inverse projection.
virtual Float_t GetScreenVal(Int_t ax, Float_t value)
Project point on given axis and return projected value.
virtual void SetDirectionalVector(Int_t screenAxis, TEveVector &vec)
Get vector for axis in a projected space.
TEveVector GetOrthogonalCenter(int idx, TEveVector &out)
Get center ortogonal to given axis index.
void ProjectVector(TEveVector &v, Float_t d)
Project TEveVector.
virtual Float_t * GetProjectedCenter()
Get projected center.
void RnrLabels() const
Render label reading prepared list ov value-pos pairs.
void SetLabelFont(TGLRnrCtx &rnrCtx, const char *fontName, Int_t pixelSize=64, Double_t font3DSize=-1)
Set label font derived from TAttAxis.
void RnrLines() const
Render axis main line and tick-marks.
std::pair< Float_t, Int_t > TM_t
void SetLabelAlign(TGLFont::ETextAlignH_e, TGLFont::ETextAlignV_e)
Set label align.
std::vector< Lab_t > LabVec_t
std::vector< TM_t > TMVec_t
void SetTextFormat(Double_t min, Double_t max, Double_t binWidth)
Construct print format from given primary bin width.
void SetUseAxisColors(Bool_t x)
void SetAttAxis(TAttAxis *a)
std::pair< Float_t, Float_t > Lab_t
TGLVector3 & RefTMOff(Int_t i)
void SetFontMode(TGLFont::EMode m)
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
const TGLPlane & FrustumPlane(EFrustumPlane plane) const
static const char * GetFontNameFromId(Int_t)
Get font name from TAttAxis font id.
virtual void Draw(TGLRnrCtx &rnrCtx) const
Draw the GL drawable, using draw flags.
TObject * fExternalObj
first replica
Bool_t fDLCache
display-list validity bit-field
Base-class for direct OpenGL renderers.
void SetAxisAlignedBBox(Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax, Float_t zmin, Float_t zmax)
Set axis-aligned bounding-box.
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
TGLColorSet & ColorSet()
Return reference to current color-set (top of the stack).
Bool_t IsDrawPassOutlineLine() const
static void Color(const TGLColor &color)
Set color from TGLColor.
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
void Set(Double_t x, Double_t y, Double_t z)
static void Optimize(Double_t A1, Double_t A2, Int_t nold, Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="")
Static function to compute reasonable axis limits.
Mother of all ROOT objects.
const char * Data() const
Int_t FloorNint(Double_t x)
Returns the nearest integer of TMath::Floor(x).
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Int_t CeilNint(Double_t x)
Returns the nearest integer of TMath::Ceil(x).
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.