ROOT logo
#ifndef HGEOMVOLUME_H
#define HGEOMVOLUME_H

#include "hgeomtransform.h"
#include "TNamed.h"
#include "TObjArray.h"

class HGeomVolume : public TNamed {
protected:
  TString shape;            // Geant shape of the volume
  TString mother;           // name of the mother volume
  TObjArray* points;        // array of points (type HGeomVector)
  HGeomTransform transform; // transformation relative to the mother system
  Int_t nPoints;              // number of points
public:
  inline HGeomVolume();
  HGeomVolume(HGeomVolume&);
  inline virtual ~HGeomVolume();
  const TString& getName() const { return fName; }
  const TString& getShape() const { return shape; }
  const TString& getMother() const { return mother; }
  HGeomTransform& getTransform() { return transform; }
  Int_t getNumPoints() { return nPoints;}
  inline HGeomVector* getPoint(const Int_t n);
  inline void setName(const Text_t* s);
  void setVolumePar(HGeomVolume&);
  inline void setShape(const Text_t* s);
  inline void setMother(const Text_t* s);
  void createPoints(const Int_t);
  void setPoint(const Int_t,const Double_t,const Double_t,const Double_t);
  void setPoint(const Int_t,const HGeomVector&);
  virtual void clear();
  virtual void print();
  ClassDef(HGeomVolume,1) // basic geometry parameters of a volume
};

// -------------------- inlines --------------------------

inline HGeomVolume::HGeomVolume() {
  nPoints=0;
  points=0;
}

inline HGeomVolume::~HGeomVolume() {
  if (points) {
    points->Delete();
    delete points;
    points=0;
  }
}

inline HGeomVector* HGeomVolume::getPoint(const Int_t n) {
   if (points && n<nPoints) return (HGeomVector*)points->At(n);
   else return 0;
}

inline void HGeomVolume::setName(const Text_t* s) {
  fName=s;
  fName.ToUpper();
}

inline void HGeomVolume::setShape(const Text_t* s) {
  shape=s;
  shape.ToUpper();
}

inline void HGeomVolume::setMother(const Text_t* s) {
  mother=s;
  mother.ToUpper();
}

#endif /* !HGEOMVOLUME_H */
 hgeomvolume.h:1
 hgeomvolume.h:2
 hgeomvolume.h:3
 hgeomvolume.h:4
 hgeomvolume.h:5
 hgeomvolume.h:6
 hgeomvolume.h:7
 hgeomvolume.h:8
 hgeomvolume.h:9
 hgeomvolume.h:10
 hgeomvolume.h:11
 hgeomvolume.h:12
 hgeomvolume.h:13
 hgeomvolume.h:14
 hgeomvolume.h:15
 hgeomvolume.h:16
 hgeomvolume.h:17
 hgeomvolume.h:18
 hgeomvolume.h:19
 hgeomvolume.h:20
 hgeomvolume.h:21
 hgeomvolume.h:22
 hgeomvolume.h:23
 hgeomvolume.h:24
 hgeomvolume.h:25
 hgeomvolume.h:26
 hgeomvolume.h:27
 hgeomvolume.h:28
 hgeomvolume.h:29
 hgeomvolume.h:30
 hgeomvolume.h:31
 hgeomvolume.h:32
 hgeomvolume.h:33
 hgeomvolume.h:34
 hgeomvolume.h:35
 hgeomvolume.h:36
 hgeomvolume.h:37
 hgeomvolume.h:38
 hgeomvolume.h:39
 hgeomvolume.h:40
 hgeomvolume.h:41
 hgeomvolume.h:42
 hgeomvolume.h:43
 hgeomvolume.h:44
 hgeomvolume.h:45
 hgeomvolume.h:46
 hgeomvolume.h:47
 hgeomvolume.h:48
 hgeomvolume.h:49
 hgeomvolume.h:50
 hgeomvolume.h:51
 hgeomvolume.h:52
 hgeomvolume.h:53
 hgeomvolume.h:54
 hgeomvolume.h:55
 hgeomvolume.h:56
 hgeomvolume.h:57
 hgeomvolume.h:58
 hgeomvolume.h:59
 hgeomvolume.h:60
 hgeomvolume.h:61
 hgeomvolume.h:62
 hgeomvolume.h:63
 hgeomvolume.h:64
 hgeomvolume.h:65
 hgeomvolume.h:66
 hgeomvolume.h:67
 hgeomvolume.h:68
 hgeomvolume.h:69
 hgeomvolume.h:70
 hgeomvolume.h:71
 hgeomvolume.h:72