#include "hgeomvolume.h"
ClassImp(HGeomVolume)
HGeomVolume::HGeomVolume(HGeomVolume& r) {
points=0;
nPoints = 0;
fName=r.GetName();
setVolumePar(r);
}
void HGeomVolume::setVolumePar(HGeomVolume& r) {
shape=r.getShape();
mother=r.getMother();
Int_t n=r.getNumPoints();
createPoints(n);
for (Int_t i=0;i<nPoints;i++) setPoint(i,*(r.getPoint(i)));
transform=r.getTransform();
}
void HGeomVolume::createPoints(const Int_t n) {
if (n!=nPoints) {
nPoints=n;
if (n>0) {
if (points!=0) {
points->Delete();
delete points;
}
points=new TObjArray(n);
for(Int_t i=0;i<n;i++) points->AddAt(new HGeomVector(),i);
}
else {
if (points) points->Delete();
delete points;
points=0;
}
}
}
void HGeomVolume::setPoint(const Int_t n,const Double_t x,
const Double_t y,const Double_t z) {
if (points && n<nPoints) {
HGeomVector* v=(HGeomVector*)points->At(n);
v->setX(x);
v->setY(y);
v->setZ(z);
}
}
void HGeomVolume::setPoint(const Int_t n,const HGeomVector& p) {
if (points && n<nPoints) {
HGeomVector& v=*((HGeomVector*)points->At(n));
v=p;
}
}
void HGeomVolume::clear() {
shape="";
mother="";
if (points) points->Delete();
delete points;
points=0;
nPoints=0;
transform.clear();
}
void HGeomVolume::print() {
cout<<((const Char_t*)fName)<<" "<<((const Char_t*)shape)<<" "
<<((const Char_t*)mother)<<'\n';
if (points) {
for (Int_t i=0;i<nPoints;i++)
cout<<(*((HGeomVector*)points->At(i)));
}
transform.print();
cout<<'\n';
}
Last change: Sat May 22 12:56:54 2010
Last generated: 2010-05-22 12:56
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.