Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
REveEllipsoid.hxx
Go to the documentation of this file.
1 // @(#)root/eve7:$Id$
2 // Author: Matevz Tadel, Alja Tadel
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT7_REveEllipsoid
13 #define ROOT7_REveEllipsoid
14 
15 #include <ROOT/REveShape.hxx>
16 #include <ROOT/REveVector.hxx>
19 
20 namespace ROOT {
21 namespace Experimental {
22 
23 //------------------------------------------------------------------------------
24 // REveEllipsoid
25 //------------------------------------------------------------------------------
26 
27 class REveEllipsoid : public REveStraightLineSet
28 {
29  friend class REveEllipsoidProjected;
30 
31 private:
32  REveEllipsoid(const REveEllipsoid &); // Not implemented
33  REveEllipsoid &operator=(const REveEllipsoid &); // Not implemented
34 
35 protected:
36  REveVector fV0;
37  REveVector fV1;
38  REveVector fV2;
39 
40  float fPhiStep;
41  void DrawArch(float phiStart, float phiEnd, float phiStep, REveVector& v0, REveVector& v1, REveVector& v2);
42 
43 public:
44  REveEllipsoid(const std::string &n = "REveJetConeProjected", const std::string& t = "");
45  virtual ~REveEllipsoid() {};
46 
47  virtual void Outline();
48  void SetBaseVectors(REveVector& v0, REveVector& v1, REveVector& v3);
49  void SetPhiStep(float ps);
50 
51  Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
52 
53  TClass *ProjectedClass(const REveProjection *p) const override;
54 };
55 
56 //------------------------------------------------------------------------------
57 // REveEllipsoidProjected
58 //------------------------------------------------------------------------------
59 
60 class REveEllipsoidProjected : public REveStraightLineSetProjected
61 {
62 private:
63  REveEllipsoidProjected(const REveEllipsoidProjected &); // Not implemented
64  REveEllipsoidProjected &operator=(const REveEllipsoidProjected &); // Not implemented
65 
66  void DrawArchProjected(float phiStart, float phiEnd, float phiStep, REveVector& v0, REveVector& v1, REveVector& v2);
67  void GetSurfaceSize(REveVector& p1, REveVector& p2);
68 
69  REveVector fMV0;
70  REveVector fMV1;
71 
72  std::vector <REveVector> fArchPnts;
73  float GetEllipseSurface (const REveVector& v1, const REveVector& v2);
74 
75 public:
76  REveEllipsoidProjected(const std::string &n = "REveEllipsoidProjected", const std::string& t = "");
77  virtual ~REveEllipsoidProjected();
78 
79  void BuildRenderData() override;
80 
81  Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
82 
83  virtual void OutlineProjected();
84  virtual void SetProjection(REveProjectionManager *mng, REveProjectable *model) override;
85  void UpdateProjection() override;
86  REveElement *GetProjectedAsElement() override { return this; }
87 };
88 
89 } // namespace Experimental
90 } // namespace ROOT
91 
92 #endif