Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:22:29

0001 // @(#)root/eve7:$Id$
0002 // Author: Matevz Tadel, Alja Tadel
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT7_REveEllipsoid
0013 #define ROOT7_REveEllipsoid
0014 
0015 #include <ROOT/REveShape.hxx>
0016 #include <ROOT/REveVector.hxx>
0017 #include <ROOT/REveProjectionBases.hxx>
0018 #include <ROOT/REveStraightLineSet.hxx>
0019 
0020 namespace ROOT {
0021 namespace Experimental {
0022 
0023 //------------------------------------------------------------------------------
0024 // REveEllipsoid
0025 //------------------------------------------------------------------------------
0026 
0027 class REveEllipsoid : public REveStraightLineSet
0028 {
0029    friend class REveEllipsoidProjected;
0030 
0031 private:
0032    REveEllipsoid(const REveEllipsoid &) = delete;
0033    REveEllipsoid &operator=(const REveEllipsoid &) = delete;
0034 
0035 protected:
0036    REveVector fV0;
0037    REveVector fV1;
0038    REveVector fV2;
0039 
0040    float      fPhiStep;
0041    void DrawArch(float phiStart, float phiEnd, float phiStep, REveVector& v0,  REveVector& v1, REveVector& v2);
0042 
0043 public:
0044    REveEllipsoid(const std::string &n = "REveJetConeProjected", const std::string& t = "");
0045    ~REveEllipsoid() override {};
0046 
0047    virtual void Outline();
0048    void SetBaseVectors(REveVector& v0, REveVector& v1, REveVector& v3);
0049    void SetPhiStep(float ps);
0050 
0051    Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
0052 
0053    TClass *ProjectedClass(const REveProjection *p) const override;
0054 };
0055 
0056 //------------------------------------------------------------------------------
0057 // REveEllipsoidProjected
0058 //------------------------------------------------------------------------------
0059 
0060 class REveEllipsoidProjected :  public REveStraightLineSetProjected
0061 {
0062 private:
0063    REveEllipsoidProjected(const REveEllipsoidProjected &) = delete;
0064    REveEllipsoidProjected &operator=(const REveEllipsoidProjected &) = delete;
0065 
0066    void DrawArchProjected(float phiStart, float phiEnd, float phiStep, REveVector& v0,  REveVector& v1, REveVector& v2);
0067    void GetSurfaceSize(REveVector& p1, REveVector& p2);
0068 
0069    REveVector fMV0;
0070    REveVector fMV1;
0071 
0072    std::vector <REveVector> fArchPnts;
0073    float GetEllipseSurface (const REveVector& v1, const REveVector& v2);
0074 
0075 public:
0076    REveEllipsoidProjected(const std::string &n = "REveEllipsoidProjected", const std::string& t = "");
0077    ~REveEllipsoidProjected() override;
0078 
0079    void BuildRenderData() override;
0080 
0081    Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
0082 
0083    virtual void OutlineProjected();
0084    void SetProjection(REveProjectionManager *mng, REveProjectable *model) override;
0085    void UpdateProjection() override;
0086    REveElement *GetProjectedAsElement() override { return this; }
0087 };
0088 
0089 } // namespace Experimental
0090 } // namespace ROOT
0091 
0092 #endif