ROOT logo
// @(#)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_TEveShape
#define ROOT_TEveShape

#include "TEveElement.h"
#include "TEveVector.h"

#include "TAtt3D.h"
#include "TAttBBox.h"
#include "TColor.h"

class TEveShape : public TEveElementList,
                  public TAtt3D,
                  public TAttBBox
{
   friend class TEveShapeEditor;

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

public:
   typedef std::vector<TEveVector2>           vVector2_t;
   typedef std::vector<TEveVector2>::iterator vVector2_i;

protected:
   Color_t      fFillColor; // fill color of polygons
   Color_t      fLineColor; // outline color of polygons
   Float_t      fLineWidth; // outline width of polygons

   Bool_t       fDrawFrame;      // draw frame
   Bool_t       fHighlightFrame; // highlight frame / all shape
   Bool_t       fMiniFrame;      // draw minimal frame

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

   // Rendering parameters.
   virtual void    SetMainColor(Color_t color);

   virtual Color_t GetFillColor() const { return fFillColor; }
   virtual Color_t GetLineColor() const { return fLineColor; }
   virtual Float_t GetLineWidth() const { return fLineWidth;}
   virtual Bool_t  GetDrawFrame()      const { return fDrawFrame; }
   virtual Bool_t  GetHighlightFrame() const { return fHighlightFrame; }
   virtual Bool_t  GetMiniFrame()      const { return fMiniFrame; }

   virtual void    SetFillColor(Color_t c)  { fFillColor = c; }
   virtual void    SetLineColor(Color_t c)  { fLineColor = c; }
   virtual void    SetLineWidth(Float_t lw) { fLineWidth = lw;}
   virtual void    SetDrawFrame(Bool_t f)      { fDrawFrame = f; }
   virtual void    SetHighlightFrame(Bool_t f) { fHighlightFrame = f; }
   virtual void    SetMiniFrame(Bool_t r)      { fMiniFrame = r; }

   // ----------------------------------------------------------------

   virtual void CopyVizParams(const TEveElement* el);
   virtual void WriteVizParams(ostream& out, const TString& var);

   // ----------------------------------------------------------------

   // Virtual from TObject
   virtual void Paint(Option_t* option="");

   // Abstract function from TAttBBox:
   // virtual void ComputeBBox();

   // Abstract from TEveProjectable, overriden in TEveElementList:
   // virtual TClass* ProjectedClass(const TEveProjection* p) const;

   // ----------------------------------------------------------------

   static Int_t  FindConvexHull(const vVector2_t& pin, vVector2_t& pout, TEveElement* caller=0);

   static Bool_t IsBoxOrientationConsistentEv(const TEveVector box[8]);
   static Bool_t IsBoxOrientationConsistentFv(const Float_t    box[8][3]);

   static void   CheckAndFixBoxOrientationEv(TEveVector box[8]);
   static void   CheckAndFixBoxOrientationFv(Float_t    box[8][3]);

   ClassDef(TEveShape, 0); // Abstract base-class for 2D/3D shapes.
};

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