CMS 3D CMS Logo

TEveEllipsoid.cc
Go to the documentation of this file.
2 #include "TEveTrans.h"
3 #include "TEveProjectionManager.h"
4 #include "TMath.h"
5 
6 //______________________________________________________________________________
7 TEveEllipsoid::TEveEllipsoid(const Text_t* n, const Text_t* t) : TEveShape(n, t) {
8  // Constructor.
9 }
10 
11 //______________________________________________________________________________
13  // Compute bounding-box of the data.
14 
15  BBoxInit();
16 
18 
19  fBBox[0] = -a + fPos[0];
20  fBBox[1] = a + fPos[0];
21 
22  fBBox[2] = -a + fPos[1];
23  fBBox[3] = a + fPos[1];
24 
25  fBBox[4] = -a + fPos[2];
26  fBBox[5] = a + fPos[2];
27 }
28 
29 //______________________________________________________________________________
30 TClass* TEveEllipsoid::ProjectedClass(const TEveProjection*) const {
31  // Virtual from TEveProjectable, returns TEveEllipsoidProjected class.
32 
34 }
35 
36 //==============================================================================
37 // TEveEllipsoidProjected
38 //==============================================================================
39 
40 //______________________________________________________________________________
41 //
42 // Projection of TEveEllipsoid.
43 
44 //______________________________________________________________________________
45 TEveEllipsoidProjected::TEveEllipsoidProjected(const char* n, const char* t) : TEveShape(n, t) {
46  // Constructor.
47 }
48 
49 //______________________________________________________________________________
51  // Destructor.
52 }
53 
54 //______________________________________________________________________________
56  // Compute bounding-box, virtual from TAttBBox.
57 
58  BBoxInit();
59 
60  TEveEllipsoid* e3d = dynamic_cast<TEveEllipsoid*>(fProjectable);
61 
62  //printf("project bbox %p\n", (void*)e3d->GetBBox());
63  if (e3d) {
64  TEveProjection* proj = GetManager()->GetProjection();
65  Float_t a = TMath::Max(TMath::Max(TMath::Abs(e3d->RefExtent3D()[0]), TMath::Abs(e3d->RefExtent3D()[1])),
66  TMath::Abs(e3d->RefExtent3D()[2]));
67  float* p = e3d->RefPos().Arr();
68  float b[] = {-a + p[0], a + p[0], -a + p[1], a + p[1], -a + p[2], a + p[2]};
69  TEveVector v;
70  v.Set(b[0], b[2], b[4]);
71  proj->ProjectVector(v, fDepth);
72  BBoxCheckPoint(v);
73  v.Set(b[1], b[2], b[4]);
74  proj->ProjectVector(v, fDepth);
75  BBoxCheckPoint(v);
76  v.Set(b[0], b[3], b[4]);
77  proj->ProjectVector(v, fDepth);
78  BBoxCheckPoint(v);
79  v.Set(b[1], b[3], b[4]);
80  proj->ProjectVector(v, fDepth);
81  BBoxCheckPoint(v);
82  v.Set(b[0], b[2], b[5]);
83  proj->ProjectVector(v, fDepth);
84  BBoxCheckPoint(v);
85  v.Set(b[1], b[2], b[5]);
86  proj->ProjectVector(v, fDepth);
87  BBoxCheckPoint(v);
88  v.Set(b[0], b[3], b[5]);
89  proj->ProjectVector(v, fDepth);
90  BBoxCheckPoint(v);
91  v.Set(b[1], b[3], b[5]);
92  proj->ProjectVector(v, fDepth);
93  BBoxCheckPoint(v);
94 
95  // for Z dimesion
96  fBBox[4] -= a;
97  fBBox[5] += a;
98  }
99  // printf("(%f, %f) (%f, %f) (%f, %f)\n",fBBox[0],fBBox[1],fBBox[2],fBBox[3],fBBox[4],fBBox[5] );
100 }
101 
102 //______________________________________________________________________________
104  // This is virtual method from base-class TEveProjected.
105 
106  SetDepthCommon(d, this, fBBox);
107 }
108 
109 //______________________________________________________________________________
110 void TEveEllipsoidProjected::SetProjection(TEveProjectionManager* mng, TEveProjectable* model) {
111  // This is virtual method from base-class TEveProjected.
112 
113  TEveProjected::SetProjection(mng, model);
114  CopyVizParams(dynamic_cast<TEveElement*>(model));
115 }
116 
117 //______________________________________________________________________________
119  // Override from abstract function.
120 }
TEveEllipsoidProjected::ComputeBBox
void ComputeBBox() override
Definition: TEveEllipsoid.cc:55
TEveEllipsoidProjected::TEveEllipsoidProjected
TEveEllipsoidProjected(const TEveEllipsoidProjected &)
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
TEveEllipsoid::RefPos
TEveVector & RefPos()
Definition: TEveEllipsoid.h:36
TEveEllipsoid::ProjectedClass
TClass * ProjectedClass(const TEveProjection *p) const override
Definition: TEveEllipsoid.cc:30
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HLT_2018_cff.Class
Class
Definition: HLT_2018_cff.py:7110
findQualityFiles.v
v
Definition: findQualityFiles.py:179
TEveEllipsoidProjected::UpdateProjection
void UpdateProjection() override
Definition: TEveEllipsoid.cc:118
ReggeGribovPartonMC_EposLHC_2760GeV_PbPb_cfi.model
model
Definition: ReggeGribovPartonMC_EposLHC_2760GeV_PbPb_cfi.py:11
TEveEllipsoid::fPos
TEveVector fPos
Definition: TEveEllipsoid.h:23
Abs
T Abs(T a)
Definition: MathUtil.h:49
TEveEllipsoidProjected::SetProjection
void SetProjection(TEveProjectionManager *mng, TEveProjectable *model) override
Definition: TEveEllipsoid.cc:110
TEveEllipsoid::TEveEllipsoid
TEveEllipsoid(const TEveEllipsoid &)
TEveEllipsoidProjected::~TEveEllipsoidProjected
~TEveEllipsoidProjected() override
Definition: TEveEllipsoid.cc:50
OrderedSet.t
t
Definition: OrderedSet.py:90
b
double b
Definition: hdecay.h:118
TEveEllipsoid::RefExtent3D
TEveVector & RefExtent3D()
Definition: TEveEllipsoid.h:37
amptDefault_cfi.proj
proj
Definition: amptDefault_cfi.py:13
a
double a
Definition: hdecay.h:119
TEveEllipsoidProjected::SetDepthLocal
void SetDepthLocal(Float_t d) override
Definition: TEveEllipsoid.cc:103
TEveEllipsoid
Definition: TEveEllipsoid.h:13
Max
T Max(T a, T b)
Definition: MathUtil.h:44
TEveEllipsoid::ComputeBBox
void ComputeBBox() override
Definition: TEveEllipsoid.cc:12
TEveEllipsoid::fExtent3D
TEveVector fExtent3D
Definition: TEveEllipsoid.h:24
ztail.d
d
Definition: ztail.py:151
TEveEllipsoid.h