ROOT logo
// @(#)root/eve:$Id: TEveGeoShapeExtract.cxx 28343 2009-04-23 21:34:31Z matevz $
// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007

/*************************************************************************
 * 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.             *
 *************************************************************************/

#include "TEveGeoShapeExtract.h"
#include "TEveGeoNode.h"
#include "TEveGeoShape.h"

#include "TList.h"
#include "TGeoManager.h"
#include "TGeoShape.h"

//==============================================================================
// TEveGeoShapeExtract
//==============================================================================

//______________________________________________________________________________
//
// Globally positioned TGeoShape with rendering attributes and an
// optional list of daughter shape-extracts.
//
// Vessel to carry hand-picked geometry from gled to reve.
// This class exists in both frameworks.

ClassImp(TEveGeoShapeExtract);

//______________________________________________________________________________
TEveGeoShapeExtract::TEveGeoShapeExtract(const char* n, const char* t) :
   TNamed       (n,t),

   fRnrSelf     (kTRUE),
   fRnrElements (kTRUE),
   fShape       (0),
   fElements    (0)
{
   // Constructor.

   memset(fTrans, 0, sizeof(fTrans));
   fTrans[0] = fTrans[5] = fTrans[10] = fTrans[15] = 1;
   fRGBA [0] = fRGBA [1] = fRGBA [2]  = fRGBA [3]  = 1;
   gGeoManager = TEveGeoShape::GetGeoMangeur(); // To inforce phony geo-manager on load time.
}

//______________________________________________________________________________
TEveGeoShapeExtract::~TEveGeoShapeExtract()
{
   // Destructor. Delete shape and elements.

   delete fShape;
   delete fElements;
}

/******************************************************************************/

//______________________________________________________________________________
Bool_t TEveGeoShapeExtract::HasElements()
{
   // True if has at least one element.

   return fElements != 0 && fElements->GetSize() > 0;
}

//______________________________________________________________________________
void TEveGeoShapeExtract::AddElement(TEveGeoShapeExtract* gse)
{
   // Add a child element.

   if (fElements == 0)
      fElements = new TList;

   fElements->Add(gse);
}

/******************************************************************************/

//______________________________________________________________________________
void TEveGeoShapeExtract::SetTrans(const Double_t arr[16])
{
   // Set transformation matrix.

   for(Int_t i=0; i<16; ++i)
      fTrans[i] = arr[i];
}

//______________________________________________________________________________
void TEveGeoShapeExtract::SetRGBA (const Float_t  arr[4])
{
   // Set RGBA color.

   for(Int_t i=0; i<4; ++i)
      fRGBA[i] = arr[i];
}
 TEveGeoShapeExtract.cxx:1
 TEveGeoShapeExtract.cxx:2
 TEveGeoShapeExtract.cxx:3
 TEveGeoShapeExtract.cxx:4
 TEveGeoShapeExtract.cxx:5
 TEveGeoShapeExtract.cxx:6
 TEveGeoShapeExtract.cxx:7
 TEveGeoShapeExtract.cxx:8
 TEveGeoShapeExtract.cxx:9
 TEveGeoShapeExtract.cxx:10
 TEveGeoShapeExtract.cxx:11
 TEveGeoShapeExtract.cxx:12
 TEveGeoShapeExtract.cxx:13
 TEveGeoShapeExtract.cxx:14
 TEveGeoShapeExtract.cxx:15
 TEveGeoShapeExtract.cxx:16
 TEveGeoShapeExtract.cxx:17
 TEveGeoShapeExtract.cxx:18
 TEveGeoShapeExtract.cxx:19
 TEveGeoShapeExtract.cxx:20
 TEveGeoShapeExtract.cxx:21
 TEveGeoShapeExtract.cxx:22
 TEveGeoShapeExtract.cxx:23
 TEveGeoShapeExtract.cxx:24
 TEveGeoShapeExtract.cxx:25
 TEveGeoShapeExtract.cxx:26
 TEveGeoShapeExtract.cxx:27
 TEveGeoShapeExtract.cxx:28
 TEveGeoShapeExtract.cxx:29
 TEveGeoShapeExtract.cxx:30
 TEveGeoShapeExtract.cxx:31
 TEveGeoShapeExtract.cxx:32
 TEveGeoShapeExtract.cxx:33
 TEveGeoShapeExtract.cxx:34
 TEveGeoShapeExtract.cxx:35
 TEveGeoShapeExtract.cxx:36
 TEveGeoShapeExtract.cxx:37
 TEveGeoShapeExtract.cxx:38
 TEveGeoShapeExtract.cxx:39
 TEveGeoShapeExtract.cxx:40
 TEveGeoShapeExtract.cxx:41
 TEveGeoShapeExtract.cxx:42
 TEveGeoShapeExtract.cxx:43
 TEveGeoShapeExtract.cxx:44
 TEveGeoShapeExtract.cxx:45
 TEveGeoShapeExtract.cxx:46
 TEveGeoShapeExtract.cxx:47
 TEveGeoShapeExtract.cxx:48
 TEveGeoShapeExtract.cxx:49
 TEveGeoShapeExtract.cxx:50
 TEveGeoShapeExtract.cxx:51
 TEveGeoShapeExtract.cxx:52
 TEveGeoShapeExtract.cxx:53
 TEveGeoShapeExtract.cxx:54
 TEveGeoShapeExtract.cxx:55
 TEveGeoShapeExtract.cxx:56
 TEveGeoShapeExtract.cxx:57
 TEveGeoShapeExtract.cxx:58
 TEveGeoShapeExtract.cxx:59
 TEveGeoShapeExtract.cxx:60
 TEveGeoShapeExtract.cxx:61
 TEveGeoShapeExtract.cxx:62
 TEveGeoShapeExtract.cxx:63
 TEveGeoShapeExtract.cxx:64
 TEveGeoShapeExtract.cxx:65
 TEveGeoShapeExtract.cxx:66
 TEveGeoShapeExtract.cxx:67
 TEveGeoShapeExtract.cxx:68
 TEveGeoShapeExtract.cxx:69
 TEveGeoShapeExtract.cxx:70
 TEveGeoShapeExtract.cxx:71
 TEveGeoShapeExtract.cxx:72
 TEveGeoShapeExtract.cxx:73
 TEveGeoShapeExtract.cxx:74
 TEveGeoShapeExtract.cxx:75
 TEveGeoShapeExtract.cxx:76
 TEveGeoShapeExtract.cxx:77
 TEveGeoShapeExtract.cxx:78
 TEveGeoShapeExtract.cxx:79
 TEveGeoShapeExtract.cxx:80
 TEveGeoShapeExtract.cxx:81
 TEveGeoShapeExtract.cxx:82
 TEveGeoShapeExtract.cxx:83
 TEveGeoShapeExtract.cxx:84
 TEveGeoShapeExtract.cxx:85
 TEveGeoShapeExtract.cxx:86
 TEveGeoShapeExtract.cxx:87
 TEveGeoShapeExtract.cxx:88
 TEveGeoShapeExtract.cxx:89
 TEveGeoShapeExtract.cxx:90
 TEveGeoShapeExtract.cxx:91
 TEveGeoShapeExtract.cxx:92
 TEveGeoShapeExtract.cxx:93
 TEveGeoShapeExtract.cxx:94
 TEveGeoShapeExtract.cxx:95
 TEveGeoShapeExtract.cxx:96
 TEveGeoShapeExtract.cxx:97
 TEveGeoShapeExtract.cxx:98
 TEveGeoShapeExtract.cxx:99