TEveBox.h

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEveBox.h 35790 2010-09-27 12:52:01Z matevz $
00002 // Author: Matevz Tadel, 2010
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TEveBox
00013 #define ROOT_TEveBox
00014 
00015 #include "TEveShape.h"
00016 
00017 //------------------------------------------------------------------------------
00018 // TEveBox
00019 //------------------------------------------------------------------------------
00020 
00021 class TEveBox : public TEveShape
00022 {
00023    friend class TEveBoxGL;
00024 
00025 private:
00026    TEveBox(const TEveBox&);            // Not implemented
00027    TEveBox& operator=(const TEveBox&); // Not implemented
00028 
00029 protected:
00030    Float_t fVertices[8][3];
00031 
00032 public:
00033    TEveBox(const char* n="TEveBox", const char* t="");
00034    virtual ~TEveBox();
00035 
00036    void SetVertex(Int_t i, Float_t x, Float_t y, Float_t z);
00037    void SetVertex(Int_t i, const Float_t* v);
00038    void SetVertices(const Float_t* vs);
00039 
00040    const Float_t* GetVertex(Int_t i) const { return fVertices[i]; }
00041 
00042    // For TAttBBox:
00043    virtual void ComputeBBox();
00044 
00045    // Projectable:
00046    virtual TClass* ProjectedClass(const TEveProjection* p) const;
00047 
00048    ClassDef(TEveBox, 0); // 3D box with arbitrary vertices.
00049 };
00050 
00051 
00052 //------------------------------------------------------------------------------
00053 // TEveBoxProjected
00054 //------------------------------------------------------------------------------
00055 
00056 class TEveBoxProjected : public TEveShape,
00057                          public TEveProjected
00058 {
00059    friend class TEveBoxProjectedGL;
00060 
00061 private:
00062    TEveBoxProjected(const TEveBoxProjected&);            // Not implemented
00063    TEveBoxProjected& operator=(const TEveBoxProjected&); // Not implemented
00064 
00065 protected:
00066    vVector2_t   fPoints;
00067    Int_t        fBreakIdx;
00068    vVector2_t   fDebugPoints;
00069 
00070    virtual void SetDepthLocal(Float_t d);
00071 
00072    static Bool_t fgDebugCornerPoints;
00073 
00074 public:
00075    TEveBoxProjected(const char* n="TEveBoxProjected", const char* t="");
00076    virtual ~TEveBoxProjected();
00077 
00078    // For TAttBBox:
00079    virtual void ComputeBBox();
00080 
00081    // Projected:
00082    virtual void SetProjection(TEveProjectionManager* mng, TEveProjectable* model);
00083    virtual void UpdateProjection();
00084 
00085    virtual TEveElement* GetProjectedAsElement() { return this; }
00086 
00087    static Bool_t GetDebugCornerPoints();
00088    static void   SetDebugCornerPoints(Bool_t d);
00089 
00090    ClassDef(TEveBoxProjected, 0); // Projection of TEveBox.
00091 };
00092 
00093 #endif

Generated on Tue Jul 5 14:14:47 2011 for ROOT_528-00b_version by  doxygen 1.5.1