55 if (std::fabs(
v) < 1
e-12)
59 if (step > 0.0 && step < 1.0)
64 if (
a >= 1e5 ||
a < 1
e-4)
129 if (pmax_t <= pmin_t)
135 Float_t center = 0.5f * (pmin_t + pmax_t);
145 Double_t bl1 = 0, bh1 = 0, bl2 = 0, bh2 = 0;
175 major.
fLabel = FormatTickLabel(
v, bw1);
177 fTicks[ax].push_back(major);
179 for (
Int_t k = 1; k < bn2; ++k) {
183 fTicks[ax].push_back(minor);
204 fTicks[ax].push_back(major);
206 for (
Int_t k = 1; k < bn2; ++k) {
213 fTicks[ax].push_back(minor);
233 for (
int ax = 0; ax < 2; ++ax) {
234 nlohmann::json pos = nlohmann::json::array();
235 nlohmann::json lab = nlohmann::json::array();
236 nlohmann::json maj = nlohmann::json::array();
237 for (
auto &t :
fTicks[ax]) {
238 pos.push_back(t.fPos);
239 lab.push_back(t.fLabel);
240 maj.push_back(t.fMajor);
242 std::string key = (ax == 0) ?
"H" :
"V";
243 j[
"fTickPos" + key] = pos;
244 j[
"fTickLab" + key] = lab;
245 j[
"fTickMaj" + key] = maj;
257 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.
const REveVector & GetBBoxMax() const
EBBoxState AssertBBox()
Compute the bounding box if it is invalid, and return its state.
const REveVector & GetBBoxMin() const
virtual void BuildRenderData()
Build fRenderData, what the client draws.
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.
void AuntChanged(REveAunt *au) override
Follow the projection manager: its box and distortion set the ticks and the distortion read-out.
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