67 v[0] =
x;
v[1] =
y;
v[2] = z;
84 v[0] = p[0];
v[1] = p[1];
v[2] = p[2];
103 x =
v[0];
y =
v[1]; z =
v[2];
107 x = p[0];
y = p[1]; z = p[2];
110 v[0] =
x;
v[1] =
y;
v[2] = z;
141 v = i->fOffset + (
v - i->fMin)*i->fScale;
181 static const TEveException eh(
"TEveProjection::AddPreScaleEntry ");
183 if (coord < 0 || coord > 2)
184 throw (eh +
"coordinate out of range.");
186 const Float_t infty = std::numeric_limits<Float_t>::infinity();
205 if (value <= prev.
fMin)
206 throw (eh +
"minimum value not larger than previous one.");
224 static const TEveException eh(
"TEveProjection::ChangePreScaleEntry ");
226 if (coord < 0 || coord > 2)
227 throw (eh +
"coordinate out of range.");
231 if (entry < 0 || entry >= vs)
232 throw (eh +
"entry out of range.");
234 vec[entry].fScale = new_scale;
235 Int_t i0 = entry, i1 = entry + 1;
342 Warning(
"BisectBreakPoint",
"call with eps_sqr argument is obsolete - please use the new signature.");
359 while (--n_loops >= 0)
361 vM.
Mult(vL + vR, 0.5f);
394 ::Warning(
"TEveProjection::GetLimits",
"method is obsolete");
404 for (
Int_t i=0; i<3; i++)
406 vec[i] = (i==screenAxis) ? 1.0f : 0.0f;
420 centerOO =
fCenter - dirCenter;
431 static const TEveException eH(
"TEveProjection::GetValForScreenPos ");
433 static const int kMaxSteps = 5000;
434 static const int kMaxVal = 10;
449 if (sv > zeroProjected[axisIdx])
455 while (cnt < kMaxSteps)
457 vec.Mult(dirVec, xR);
461 if (
vec[axisIdx] >= sv)
break;
464 if (++cnt >= kMaxSteps)
465 throw eH +
Form(
"positive projected %f, value %f,xL, xR ( %f, %f)\n",
vec[axisIdx], sv, xL, xR);
468 else if (sv < zeroProjected[axisIdx])
474 while (cnt < kMaxSteps)
476 vec.Mult(dirVec, xL);
480 if (
vec[axisIdx] <= sv)
break;
482 if (++cnt >= kMaxSteps)
483 throw eH +
Form(
"negative projected %f, value %f,xL, xR ( %f, %f)\n",
vec[axisIdx], sv, xL, xR);
496 xM = 0.5f * (xL + xR);
497 vec.Mult(dirVec, xM);
500 if (
vec[axisIdx] > sv)
504 if (++cnt >= kMaxSteps)
505 throw eH +
Form(
"can't converge %f %f, l/r %f/%f, idx=%d\n",
vec[axisIdx], sv, xL, xR, axisIdx);
563 using namespace TMath;
638 vec.Set(0.0f, 0.0f, 1.0f);
639 else if (screenAxis == 1)
640 vec.Set(0.0f, 1.0f, 0.0f);
655 if ((
v1.fY <
a &&
v2.fY >
a) || (
v1.fY >
a &&
v2.fY <
a))
663 if (a1 < tolerance) {
v1.fY =
a; val =
kTRUE; }
667 if (a2 < tolerance) {
v2.fY =
a; val =
kTRUE; }
715 using namespace TMath;
730 phi = (
x == 0.0f &&
y == 0.0f) ? 0.0f :
ATan2(
y,
x);
743 phi = (
x == 0.0f &&
y == 0.0f) ? 0.0f :
ATan2(
y,
x);
788 using namespace TMath;
809 phi = (
x == 0.0f &&
y == 0.0f) ? 0.0f :
ATan2(
y,
x);
822 phi = (
x == 0.0f &&
y == 0.0f) ? 0.0f :
ATan2(
y,
x);
869 vec.Set(1.0f, 0.0f, 0.0f);
870 else if (screenAxis == 1)
871 vec.Set(0.0f, 0.0f, 1.0f);
898 using namespace TMath;
920 phi = (
x == 0.0f &&
y == 0.0f) ? 0.0f :
ATan2(
y,
x);
933 phi = (
x == 0.0f &&
y == 0.0f) ? 0.0f :
ATan2(
y,
x);
980 vec.Set(0.0f, 1.0f, 0.0f);
981 else if (screenAxis == 1)
982 vec.Set(0.0f, 0.0f, 1.0f);
1009 using namespace TMath;
1031 phi = (
x == 0.0f &&
y == 0.0f) ? 0.0f :
ATan2(
y,
x);
1044 phi = (
x == 0.0f &&
y == 0.0f) ? 0.0f :
ATan2(
y,
x);
1090 if (screenAxis == 0)
1091 vec.Set(0.0f, 0.0f, 1.0f);
1092 else if (screenAxis == 1)
1093 vec.Set(1.0f, 0.0f, 0.0f);
1120 using namespace TMath;
1141 phi = (
x == 0.0f &&
y == 0.0f) ? 0.0f :
ATan2(
y,
x);
1154 phi = (
x == 0.0f &&
y == 0.0f) ? 0.0f :
ATan2(
y,
x);
1200 if (screenAxis == 0)
1201 vec.Set(0.0f, 0.0f, 1.0f);
1202 else if (screenAxis == 1)
1203 vec.Set(0.0f, 1.0f, 0.0f);
1230 using namespace TMath;
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
TEveVectorT< Float_t > TEveVector
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
void ProjectPoint(Float_t &x, Float_t &y, Float_t &z, Float_t d, EPProc_e proc=kPP_Full) override
Project point.
TEve3DProjection()
Constructor.
Exception class thrown by TEve classes and macros.
virtual void SetCenter(TEveVector &v)
virtual void ProjectPoint(Float_t &x, Float_t &y, Float_t &z, Float_t d, EPProc_e p=kPP_Full)=0
void SetDistortion(Float_t d)
Set distortion.
Float_t GetLimit(Int_t i, Bool_t pos)
Method previously used by TEveProjectionAxesGL. Now obsolete.
void AddPreScaleEntry(Int_t coord, Float_t max_val, Float_t scale)
Add new scaling range for given coordinate.
virtual Float_t GetValForScreenPos(Int_t ax, Float_t value)
Inverse projection.
void SetPastFixRFac(Float_t x)
Set 2's-exponent for relative scaling beyond FixR.
virtual Float_t GetScreenVal(Int_t ax, Float_t value)
Project point on given axis and return projected value.
vPreScale_t fPreScales[3]
virtual void SetDirectionalVector(Int_t screenAxis, TEveVector &vec)
Get vector for axis in a projected space.
virtual void BisectBreakPoint(TEveVector &vL, TEveVector &vR, Float_t eps_sqr)
Find break-point on both sides of the discontinuity.
void SetFixR(Float_t x)
Set fixed radius.
TEveVector GetOrthogonalCenter(int idx, TEveVector &out)
Get center ortogonal to given axis index.
void ProjectPointfv(Float_t *v, Float_t d)
Project float array.
void SetPastFixZFac(Float_t x)
Set 2's-exponent for relative scaling beyond FixZ.
void ChangePreScaleEntry(Int_t coord, Int_t entry, Float_t new_scale)
Change scale for given entry and coordinate.
void SetDisplaceOrigin(bool)
Set flag to displace for center.
std::vector< PreScaleEntry_t > vPreScale_t
void PreScalePoint(Float_t &x, Float_t &y)
Pre-scale point (x, y) in projected coordinates for 2D projections:
std::vector< PreScaleEntry_t >::iterator vPreScale_i
TEveProjection()
Constructor.
void ProjectVector(TEveVector &v, Float_t d)
Project TEveVector.
void ProjectPointdv(Double_t *v, Float_t d)
Project double array.
virtual Bool_t IsOnSubSpaceBoundrary(const TEveVector &) const
void SetFixZ(Float_t x)
Set fixed radius.
void ClearPreScales()
Clear all pre-scaling information.
void PreScaleVariable(Int_t dim, Float_t &v)
Pre-scale single variable with pre-scale entry dim.
virtual Bool_t AcceptSegment(TEveVector &, TEveVector &, Float_t) const
virtual Float_t * GetProjectedCenter()
Get projected center.
TEveRPhiProjection()
Constructor.
void ProjectPoint(Float_t &x, Float_t &y, Float_t &z, Float_t d, EPProc_e proc=kPP_Full) override
Project point.
Bool_t IsOnSubSpaceBoundrary(const TEveVector &v) const override
Checks if point is on sub-space boundary.
TEveVector fProjectedCenter
void SetDirectionalVector(Int_t screenAxis, TEveVector &vec) override
Get direction in the unprojected space for axis index in the projected space.
TEveRhoZProjection()
Constructor.
Int_t SubSpaceId(const TEveVector &v) const override
Return sub-space id for the point.
Bool_t AcceptSegment(TEveVector &v1, TEveVector &v2, Float_t tolerance) const override
Check if segment of two projected points is valid.
void SetCenter(TEveVector &v) override
Set center of distortion (virtual method).
void ProjectPoint(Float_t &x, Float_t &y, Float_t &z, Float_t d, EPProc_e proc=kPP_Full) override
Project point.
TEveTrans is a 4x4 transformation matrix for homogeneous coordinates stored internally in a column-ma...
TVector3 Multiply(const TVector3 &v, Double_t w=1) const
Multiply vector and return it.
void MultiplyIP(TVector3 &v, Double_t w=1) const
Multiply vector in-place.
TEveVectorT & Mult(const TEveVectorT &a, TT af)
void Set(const Float_t *v)
void SetCenter(TEveVector &v) override
Set center of distortion (virtual method).
void SetDirectionalVector(Int_t screenAxis, TEveVector &vec) override
Get direction in the unprojected space for axis index in the projected space.
void ProjectPoint(Float_t &x, Float_t &y, Float_t &z, Float_t d, EPProc_e proc=kPP_Full) override
Project point.
TEveXZProjection()
Constructor.
TEveVector fProjectedCenter
void SetCenter(TEveVector &v) override
Set center of distortion (virtual method).
TEveVector fProjectedCenter
void ProjectPoint(Float_t &x, Float_t &y, Float_t &z, Float_t d, EPProc_e proc=kPP_Full) override
Project point.
void SetDirectionalVector(Int_t screenAxis, TEveVector &vec) override
Get direction in the unprojected space for axis index in the projected space.
TEveYZProjection()
Constructor.
void SetDirectionalVector(Int_t screenAxis, TEveVector &vec) override
Get direction in the unprojected space for axis index in the projected space.
void SetCenter(TEveVector &v) override
Set center of distortion (virtual method).
TEveZXProjection()
Constructor.
TEveVector fProjectedCenter
void ProjectPoint(Float_t &x, Float_t &y, Float_t &z, Float_t d, EPProc_e proc=kPP_Full) override
Project point.
TEveZYProjection()
Constructor.
void SetCenter(TEveVector &v) override
Set center of distortion (virtual method).
void SetDirectionalVector(Int_t screenAxis, TEveVector &vec) override
Get direction in the unprojected space for axis index in the projected space.
void ProjectPoint(Float_t &x, Float_t &y, Float_t &z, Float_t d, EPProc_e proc=kPP_Full) override
Project point.
TEveVector fProjectedCenter
Double_t Log2(Double_t x)
Returns the binary (base-2) logarithm of x.
T1 Sign(T1 a, T2 b)
Returns a value with the magnitude of a and the sign of b.
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
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).
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.