#ifndef ROOT_TVolumePosition
#define ROOT_TVolumePosition
#include "TVolume.h"
class TBrowser;
class TRotMatrix;
class TVolumePosition : public TObject {
protected:
Double_t fX[3];
TRotMatrix *fMatrix;
TVolume *fNode;
UInt_t fId;
protected:
void DeleteOwnMatrix();
public:
enum EPositionBits {
kIsOwn = BIT(23)
};
TVolumePosition(TVolume *node=0,Double_t x=0, Double_t y=0, Double_t z=0, TRotMatrix *matrix=0);
TVolumePosition(TVolume *node,Double_t x, Double_t y, Double_t z, const Text_t *matrixname);
TVolumePosition(const TVolumePosition* oldPosition, const TVolumePosition* curPosition);
TVolumePosition(const TVolumePosition&pos);
virtual ~TVolumePosition();
virtual void Browse(TBrowser *b);
virtual Float_t *Errmx2Local (const Float_t *masterError, Float_t *localError ) const;
virtual Double_t *Errmx2Local (const Double_t *masterError, Double_t *localError) const;
virtual Float_t *Errmx2Master(const Float_t *localError, Float_t *masterError ) const;
virtual Double_t *Errmx2Master(const Double_t *localError, Double_t *masterError) const;
virtual Double_t *Cormx2Local (const Double_t *masterCorr, Double_t *localCorr ) const;
virtual Float_t *Cormx2Local (const Float_t *masterCorr, Float_t *localCorr ) const;
virtual Double_t *Cormx2Master(const Double_t *localCorr, Double_t *masterCorr ) const;
virtual Float_t *Cormx2Master(const Float_t *localCorr, Float_t *masterCorr ) const;
virtual Double_t *Master2Local(const Double_t *master, Double_t *local,Int_t nPoints=1) const;
virtual Float_t *Master2Local(const Float_t *master, Float_t *local,Int_t nPoints=1) const;
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
virtual TDataSet *DefineSet();
virtual void Draw(Option_t *depth="3");
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
virtual TVolume *GetNode() const {return fNode;}
virtual Text_t *GetObjectInfo(Int_t px, Int_t py) const;
const Option_t *GetOption() const { return GetNode()?GetNode()->GetOption():0;}
virtual const Char_t *GetName() const;
const TRotMatrix *GetMatrix() const;
TRotMatrix *GetMatrix();
Int_t GetVisibility() const {return GetNode()?GetNode()->GetVisibility():0;}
virtual Double_t GetX(Int_t indx=0) const {return fX[indx];}
virtual const Double_t *GetXYZ() const {return fX;}
virtual Double_t GetY() const {return fX[1];}
virtual Double_t GetZ() const {return fX[2];}
virtual UInt_t GetId() const {return fId;}
Bool_t IsMatrixOwner() const;
Bool_t SetMatrixOwner(Bool_t ownerShips=kTRUE);
Bool_t IsFolder() const {return GetNode()?kTRUE:kFALSE;}
virtual Bool_t Is3D() const {return kTRUE;}
virtual Double_t *Local2Master(const Double_t *local, Double_t *master,Int_t nPoints=1) const;
virtual Float_t *Local2Master(const Float_t *local, Float_t *master,Int_t nPoints=1) const;
virtual TVolumePosition &Mult(const TVolumePosition &position);
virtual void Paint(Option_t *option="");
virtual void Print(Option_t *option="") const;
virtual void UpdatePosition(Option_t *option="");
virtual TVolumePosition *Reset(TVolume *node=0,Double_t x=0, Double_t y=0, Double_t z=0, TRotMatrix *matrix=0);
virtual void SavePrimitive(ostream &out, Option_t *option = "");
virtual void SetLineAttributes();
virtual void SetMatrix(TRotMatrix *matrix=0);
virtual void SetNode(TVolume *node){ fNode = node;}
virtual void SetPosition( Double_t x=0, Double_t y=0, Double_t z=0) {fX[0]=x; fX[1]=y; fX[2]=z;}
virtual void SetVisibility(Int_t vis=1);
virtual void SetX(Double_t x){ fX[0] = x;}
virtual void SetY(Double_t y){ fX[1] = y;}
virtual void SetZ(Double_t z){ fX[2] = z;}
virtual void SetXYZ(Double_t *xyz = 0);
virtual void SetId(UInt_t id){fId = id;}
TVolumePosition &operator=(const TVolumePosition &rhs);
ClassDef(TVolumePosition,2)
};
inline TDataSet *TVolumePosition::DefineSet(){ return GetNode(); }
inline void TVolumePosition::DeleteOwnMatrix()
{
if (IsMatrixOwner()) {
TRotMatrix *erasing = fMatrix;
fMatrix = 0;
delete erasing;
}
}
inline TRotMatrix *TVolumePosition::GetMatrix()
{ return fMatrix; }
inline const TRotMatrix *TVolumePosition::GetMatrix() const
{ return fMatrix; }
inline Bool_t TVolumePosition::SetMatrixOwner(Bool_t ownerShips)
{
Bool_t currentOwner = IsMatrixOwner();
SetBit(kIsOwn,ownerShips);
return currentOwner;
}
inline Bool_t TVolumePosition::IsMatrixOwner() const
{
return TestBit(kIsOwn);
}
inline TVolumePosition &TVolumePosition::operator=(const TVolumePosition &rhs) {
if (this != &rhs) {
for (int i = 0; i < 3; i++) fX[i] = rhs.fX[i];
fMatrix = rhs.fMatrix;
fNode = rhs.fNode;
fId = rhs.fId;
}
return *this;
}
ostream& operator<<(ostream& s,const TVolumePosition &target);
#endif
Last change: Wed Jun 25 08:55:04 2008
Last generated: 2008-06-25 08:55
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.