]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New files: class TGeoShapeExtract that allows import of exact image of geometry as...
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Mar 2007 14:42:49 +0000 (14:42 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Mar 2007 14:42:49 +0000 (14:42 +0000)
EVE/Reve/TGeoShapeExtract.cxx [new file with mode: 0644]
EVE/Reve/TGeoShapeExtract.h [new file with mode: 0644]

diff --git a/EVE/Reve/TGeoShapeExtract.cxx b/EVE/Reve/TGeoShapeExtract.cxx
new file mode 100644 (file)
index 0000000..c2aead6
--- /dev/null
@@ -0,0 +1,56 @@
+// $Header$
+
+// Copyright (C) 1999-2005, Matevz Tadel. All rights reserved.
+// This file is part of GLED, released under GNU General Public License version 2.
+// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.
+
+//__________________________________________________________________________
+// TGeoShapeExtract
+//
+// Vessel to carry hand-picked geometry from gled to reve.
+// This class exists in both frameworks.
+
+#include "TGeoShapeExtract.h"
+
+#include <TList.h>
+#include <TGeoShape.h>
+
+ClassImp(TGeoShapeExtract)
+
+/**************************************************************************/
+
+TGeoShapeExtract::TGeoShapeExtract(const Text_t* n, const Text_t* t) :
+  TNamed(n,t),
+  mRnrSelf     (true),
+  mRnrElements (true),
+  mShape       (0),
+  mElements    (0)
+{
+}
+
+TGeoShapeExtract::~TGeoShapeExtract()
+{
+  delete mShape;
+  delete mElements;
+}
+
+/**************************************************************************/
+
+Bool_t TGeoShapeExtract::HasElements()
+{
+  return mElements != 0 && mElements->GetSize() > 0;
+}
+
+/**************************************************************************/
+
+void TGeoShapeExtract::SetTrans(const Double_t arr[16])
+{
+  for(Int_t i=0; i<16; ++i)
+    mTrans[i] = arr[i];
+}
+
+void TGeoShapeExtract::SetRGBA (const Float_t  arr[4])
+{
+  for(Int_t i=0; i<4; ++i)
+    mRGBA[i] = arr[i];
+}
diff --git a/EVE/Reve/TGeoShapeExtract.h b/EVE/Reve/TGeoShapeExtract.h
new file mode 100644 (file)
index 0000000..62fd321
--- /dev/null
@@ -0,0 +1,49 @@
+// $Header$
+
+// Copyright (C) 1999-2005, Matevz Tadel. All rights reserved.
+// This file is part of GLED, released under GNU General Public License version 2.
+// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.
+
+#ifndef RootGeo_TGeoShapeExtract_H
+#define RootGeo_TGeoShapeExtract_H
+
+#include <TNamed.h>
+
+class TList;
+class TGeoShape;
+
+class TGeoShapeExtract : public TNamed
+{
+  friend class ZGeoRepacker;
+
+  TGeoShapeExtract(const TGeoShapeExtract&);            // Not implemented
+  TGeoShapeExtract& operator=(const TGeoShapeExtract&); // Not implemented
+
+protected:
+  Double_t    mTrans[16];
+  Float_t     mRGBA[4];
+  Bool_t      mRnrSelf;
+  Bool_t      mRnrElements;
+  TGeoShape*  mShape;
+  TList*      mElements;
+
+public:
+  TGeoShapeExtract(const Text_t* n="TGeoShapeExtract", const Text_t* t=0);
+  ~TGeoShapeExtract();
+
+  Bool_t HasElements();
+
+  void SetTrans(const Double_t arr[16]);
+  void SetRGBA (const Float_t  arr[4]);
+
+  Double_t*  GetTrans()       { return mTrans; }
+  Float_t*   GetRGBA()        { return mRGBA;  }
+  Bool_t     GetRnrSelf()     { return mRnrSelf;     }
+  Bool_t     GetRnrElements() { return mRnrElements; }
+  TGeoShape* GetShape()       { return mShape;    }
+  TList*     GetElements()    { return mElements; }
+
+  ClassDef(TGeoShapeExtract, 1)
+}; // endclass TGeoShapeExtract
+
+#endif