// @(#)root/eve:$Id$
// Author: Matevz Tadel, 2010

/*************************************************************************
 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TEveBox
#define ROOT_TEveBox

#include "TEveShape.h"

//------------------------------------------------------------------------------
// TEveBox
//------------------------------------------------------------------------------

class TEveBox : public TEveShape
{
   friend class TEveBoxGL;

private:
   TEveBox(const TEveBox&);            // Not implemented
   TEveBox& operator=(const TEveBox&); // Not implemented

protected:
   Float_t fVertices[8][3];

public:
   TEveBox(const char* n="TEveBox", const char* t="");
   virtual ~TEveBox();

   void SetVertex(Int_t i, Float_t x, Float_t y, Float_t z);
   void SetVertex(Int_t i, const Float_t* v);
   void SetVertices(const Float_t* vs);

   const Float_t* GetVertex(Int_t i) const { return fVertices[i]; }

   // For TAttBBox:
   virtual void ComputeBBox();

   // Projectable:
   virtual TClass* ProjectedClass(const TEveProjection* p) const;

   ClassDef(TEveBox, 0); // 3D box with arbitrary vertices.
};


//------------------------------------------------------------------------------
// TEveBoxProjected
//------------------------------------------------------------------------------

class TEveBoxProjected : public TEveShape,
                         public TEveProjected
{
   friend class TEveBoxProjectedGL;

private:
   TEveBoxProjected(const TEveBoxProjected&);            // Not implemented
   TEveBoxProjected& operator=(const TEveBoxProjected&); // Not implemented

protected:
   vVector2_t   fPoints;
   Int_t        fBreakIdx;
   vVector2_t   fDebugPoints;

   virtual void SetDepthLocal(Float_t d);

   static Bool_t fgDebugCornerPoints;

public:
   TEveBoxProjected(const char* n="TEveBoxProjected", const char* t="");
   virtual ~TEveBoxProjected();

   // For TAttBBox:
   virtual void ComputeBBox();

   // Projected:
   virtual void SetProjection(TEveProjectionManager* mng, TEveProjectable* model);
   virtual void UpdateProjection();

   virtual TEveElement* GetProjectedAsElement() { return this; }

   static Bool_t GetDebugCornerPoints();
   static void   SetDebugCornerPoints(Bool_t d);

   ClassDef(TEveBoxProjected, 0); // Projection of TEveBox.
};

#endif
 TEveBox.h:1
 TEveBox.h:2
 TEveBox.h:3
 TEveBox.h:4
 TEveBox.h:5
 TEveBox.h:6
 TEveBox.h:7
 TEveBox.h:8
 TEveBox.h:9
 TEveBox.h:10
 TEveBox.h:11
 TEveBox.h:12
 TEveBox.h:13
 TEveBox.h:14
 TEveBox.h:15
 TEveBox.h:16
 TEveBox.h:17
 TEveBox.h:18
 TEveBox.h:19
 TEveBox.h:20
 TEveBox.h:21
 TEveBox.h:22
 TEveBox.h:23
 TEveBox.h:24
 TEveBox.h:25
 TEveBox.h:26
 TEveBox.h:27
 TEveBox.h:28
 TEveBox.h:29
 TEveBox.h:30
 TEveBox.h:31
 TEveBox.h:32
 TEveBox.h:33
 TEveBox.h:34
 TEveBox.h:35
 TEveBox.h:36
 TEveBox.h:37
 TEveBox.h:38
 TEveBox.h:39
 TEveBox.h:40
 TEveBox.h:41
 TEveBox.h:42
 TEveBox.h:43
 TEveBox.h:44
 TEveBox.h:45
 TEveBox.h:46
 TEveBox.h:47
 TEveBox.h:48
 TEveBox.h:49
 TEveBox.h:50
 TEveBox.h:51
 TEveBox.h:52
 TEveBox.h:53
 TEveBox.h:54
 TEveBox.h:55
 TEveBox.h:56
 TEveBox.h:57
 TEveBox.h:58
 TEveBox.h:59
 TEveBox.h:60
 TEveBox.h:61
 TEveBox.h:62
 TEveBox.h:63
 TEveBox.h:64
 TEveBox.h:65
 TEveBox.h:66
 TEveBox.h:67
 TEveBox.h:68
 TEveBox.h:69
 TEveBox.h:70
 TEveBox.h:71
 TEveBox.h:72
 TEveBox.h:73
 TEveBox.h:74
 TEveBox.h:75
 TEveBox.h:76
 TEveBox.h:77
 TEveBox.h:78
 TEveBox.h:79
 TEveBox.h:80
 TEveBox.h:81
 TEveBox.h:82
 TEveBox.h:83
 TEveBox.h:84
 TEveBox.h:85
 TEveBox.h:86
 TEveBox.h:87
 TEveBox.h:88
 TEveBox.h:89
 TEveBox.h:90
 TEveBox.h:91
 TEveBox.h:92
 TEveBox.h:93