Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TEveBox.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/eve:$Id$
0002 // Author: Matevz Tadel, 2010
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2007, 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 ROOT_TEveBox
0013 #define ROOT_TEveBox
0014 
0015 #include "TEveShape.h"
0016 
0017 //------------------------------------------------------------------------------
0018 // TEveBox
0019 //------------------------------------------------------------------------------
0020 
0021 class TEveBox : public TEveShape
0022 {
0023    friend class TEveBoxGL;
0024 
0025 private:
0026    TEveBox(const TEveBox&);            // Not implemented
0027    TEveBox& operator=(const TEveBox&); // Not implemented
0028 
0029 protected:
0030    Float_t fVertices[8][3];
0031 
0032 public:
0033    TEveBox(const char* n="TEveBox", const char* t="");
0034    ~TEveBox() override;
0035 
0036    void SetVertex(Int_t i, Float_t x, Float_t y, Float_t z);
0037    void SetVertex(Int_t i, const Float_t* v);
0038    void SetVertices(const Float_t* vs);
0039 
0040    const Float_t* GetVertex(Int_t i) const { return fVertices[i]; }
0041 
0042    // For TAttBBox:
0043    void ComputeBBox() override;
0044 
0045    // Projectable:
0046    TClass* ProjectedClass(const TEveProjection* p) const override;
0047 
0048    ClassDefOverride(TEveBox, 0); // 3D box with arbitrary vertices.
0049 };
0050 
0051 
0052 //------------------------------------------------------------------------------
0053 // TEveBoxProjected
0054 //------------------------------------------------------------------------------
0055 
0056 class TEveBoxProjected : public TEveShape,
0057                          public TEveProjected
0058 {
0059    friend class TEveBoxProjectedGL;
0060 
0061 private:
0062    TEveBoxProjected(const TEveBoxProjected&);            // Not implemented
0063    TEveBoxProjected& operator=(const TEveBoxProjected&); // Not implemented
0064 
0065 protected:
0066    vVector2_t   fPoints;
0067    Int_t        fBreakIdx;
0068    vVector2_t   fDebugPoints;
0069 
0070    void SetDepthLocal(Float_t d) override;
0071 
0072    static Bool_t fgDebugCornerPoints;
0073 
0074 public:
0075    TEveBoxProjected(const char* n="TEveBoxProjected", const char* t="");
0076    ~TEveBoxProjected() override;
0077 
0078    // For TAttBBox:
0079    void ComputeBBox() override;
0080 
0081    // Projected:
0082    void SetProjection(TEveProjectionManager* mng, TEveProjectable* model) override;
0083    void UpdateProjection() override;
0084 
0085    TEveElement* GetProjectedAsElement() override { return this; }
0086 
0087    static Bool_t GetDebugCornerPoints();
0088    static void   SetDebugCornerPoints(Bool_t d);
0089 
0090    ClassDefOverride(TEveBoxProjected, 0); // Projection of TEveBox.
0091 };
0092 
0093 #endif