55 if (std::fabs(
v) < 1
e-12)
59 if (step > 0.0 && step < 1.0)
64 if (
a >= 1e5 ||
a < 1
e-4)
130 Float_t pmin_t = bb[ax * 2], pmax_t = bb[ax * 2 + 1];
131 if (pmax_t <= pmin_t)
137 Float_t center = 0.5f * (pmin_t + pmax_t);
147 Double_t bl1 = 0, bh1 = 0, bl2 = 0, bh2 = 0;
177 major.
fLabel = FormatTickLabel(
v, bw1);
179 fTicks[ax].push_back(major);
181 for (
Int_t k = 1; k < bn2; ++k) {
185 fTicks[ax].push_back(minor);
206 fTicks[ax].push_back(major);
208 for (
Int_t k = 1; k < bn2; ++k) {
215 fTicks[ax].push_back(minor);
235 for (
int ax = 0; ax < 2; ++ax) {
236 nlohmann::json pos = nlohmann::json::array();
237 nlohmann::json lab = nlohmann::json::array();
238 nlohmann::json maj = nlohmann::json::array();
239 for (
auto &t :
fTicks[ax]) {
240 pos.push_back(t.fPos);
241 lab.push_back(t.fLabel);
242 maj.push_back(t.fMajor);
244 std::string key = (ax == 0) ?
"H" :
"V";
245 j[
"fTickPos" + key] = pos;
246 j[
"fTickLab" + key] = lab;
247 j[
"fTickMaj" + key] = maj;
259 fRenderData = std::make_unique<REveRenderData>(
"makeProjectionAxis");
char Text_t
General string (char)
winID h TVirtualViewer3D TVirtualGLPainter p
virtual void AddNiece(REveElement *el)
std::unique_ptr< REveRenderData > fRenderData
! Vertex / normal / triangle index information for rendering.
virtual void BuildRenderData()
Write transformation Matrix to render data.
void RemoveAunt(REveAunt *au) override
Forget the projection manager when it is destroyed, then clear any click target as REveText does.
std::vector< Tick_t > fTicks[2]
! computed ticks, [0] horizontal, [1] vertical
void BuildRenderData() override
Render data.
~REveProjectionAxis() override
Destructor.
REveText * fDistLabel
! optional read-out of the distortion, not owned
REveProjectionManager * fManager
! held as an aunt, not owned
Float_t fRangeFactor
tick range as a multiple of the manager's bbox extent, about its centre
void UpdateDistortionLabel()
Rewrite the read-out.
Bool_t fUseFgColor
Take the viewer's foreground colour instead of fTextColor/fLineColor, so the axis stays legible when ...
void SetDistortionLabel(REveText *t)
Attach a text element that shows the current distortion.
Int_t fNdivisions
Primary divisions * 100 + secondary divisions, decoded as TEveProjectionAxes does,...
void UpdateTicks()
Recompute both tick sets.
void BuildTicks(Int_t ax)
Build the tick set for one screen axis, 0 horizontal and 1 vertical.
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Stream style, mode and the tick sets.
REveProjectionManager Manager class for steering of projections and managing projected objects.
REveProjection * GetProjection()
REveProjection Base for specific classes that implement non-linear projections.
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.
REveVector GetOrthogonalCenter(int idx, REveVector &out)
Get center ortogonal to given axis index.
virtual void SetDirectionalVector(Int_t screenAxis, REveVector &vec)
Get vector for axis in a projected space.
Float_t GetDistortion() const
void SetDrawFrame(Bool_t f)
void SetTextAlign(Int_t h, Int_t v)
void SetFontWeight(Float_t w)
void SetText(const std::string &text)
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
void RemoveAunt(REveAunt *au) override
Clear the click action when the click target is destroyed, so the button does not keep an id that may...
void SetFontSize(float size)
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.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Namespace for ROOT features in testing.
Int_t FloorNint(Double_t x)
Returns the nearest integer of TMath::Floor(x).
Int_t CeilNint(Double_t x)
Returns the nearest integer of TMath::Ceil(x).
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
One tick: where it lands in projected space, what to write, and whether it is a labelled (major) tick...
std::string fLabel
empty for a minor tick
Float_t fPos
position along the axis, in projected coordinates