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]);
92 Int_t size = orig.size();
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;
114 for (
Int_t i=minIdx+1; i<size; ++i)
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]);
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
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.
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
virtual void SetDirectionalVector(Int_t screenAxis, TEveVector &vec)
Get vector for axis in a projected space.
void SetUseAxisColors(Bool_t x)
static void Color(const TGLColor &color)
Set color from TGLColor.
TEveProjectionManager * fManager
static const char * GetFontNameFromId(Int_t)
Get font name from TAttAxis font id.
virtual void SetBBox()
Fill the bounding-box data of the logical-shape.
std::vector< TM_t > TMVec_t
virtual void Draw(TGLRnrCtx &rnrCtx) const
Draw function for TEveProjectionAxesGL. Skips line-pass of outline mode.
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
void SetFontMode(TGLFont::EMode m)
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.
virtual Float_t GetScreenVal(Int_t ax, Float_t value)
Project point on given axis and return projected value.
std::pair< Float_t, Int_t > TM_t
Int_t FloorNint(Double_t x)
Axes for non-linear projections.
void Set(Double_t x, Double_t y, Double_t z)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
TGLViewer::ECameraType camera
TGLVector3 & RefTMOff(Int_t i)
const char * Data() const
std::pair< Float_t, Float_t > Lab_t
std::vector< Lab_t > LabVec_t
TEveProjection * fProjection
void SplitInterval(Float_t x1, Float_t x2, Int_t axis) const
Build an array of tick-mark position-value pairs.
static double p2(double t, double a, double b, double c)
Base-class for direct OpenGL renderers.
void ProjectVector(TEveVector &v, Float_t d)
Project TEveVector.
void FilterOverlappingLabels(Int_t idx, Float_t ref) const
Filter overlapping labels.
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
Actual rendering code.
TObject * fExternalObj
first replica
virtual Bool_t SetModel(TObject *obj, const Option_t *opt=0)
Set model object.
void SplitIntervalByPos(Float_t min, Float_t max, Int_t axis) const
Add tick-marks at equidistant position.
Bool_t GetDrawCenter() const
void RnrLabels() const
Render label reading prepared list ov value-pos pairs.
void RnrLines() const
Render axis main line and tick-marks.
virtual Float_t GetValForScreenPos(Int_t ax, Float_t value)
Inverse projection.
ClassImp(TEveProjectionAxesGL)
virtual void Draw(TGLRnrCtx &rnrCtx) const
Draw the GL drawable, using draw flags.
Bool_t IsDrawPassOutlineLine() const
static double p1(double t, double a, double b)
void Warning(const char *location, const char *msgfmt,...)
void SetLabelAlign(TGLFont::ETextAlignH_e, TGLFont::ETextAlignV_e)
Set label align.
TEveProjection * GetProjection()
virtual Float_t * GetProjectedCenter()
Get projected center.
Bool_t GetDrawOrigin() const
virtual Style_t GetLabelFont() const
virtual Int_t GetNdivisions() const
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
TEveVector GetOrthogonalCenter(int idx, TEveVector &out)
Get center ortogonal to given axis index.
Mother of all ROOT objects.
virtual Float_t GetLabelSize() const
TEveProjectionManager * GetManager()
TEveProjectionAxesGL()
Constructor.
Exception class thrown by TEve classes and macros.
const TGLPlane & FrustumPlane(EFrustumPlane plane) const
void SetLabelFont(TGLRnrCtx &rnrCtx, const char *fontName, Int_t pixelSize=64, Double_t font3DSize=-1)
Set label font derived from TAttAxis.
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
Bool_t fDLCache
display-list validity bit-field
Double_t Sqrt(Double_t x)
void SetTextFormat(Double_t min, Double_t max, Double_t binWidth)
Construct print format from given primary bin width.
TGLAxisPainter fAxisPainter
TGLColorSet & ColorSet()
Return reference to current color-set (top of the stack).
void SplitIntervalByVal(Float_t min, Float_t max, Int_t axis) const
Add tick-marks on fixed value step.
ELabMode GetLabMode() const
OpenGL renderer class for TEveProjectionAxes.
Int_t CeilNint(Double_t x)
void SetAttAxis(TAttAxis *a)