HepGeom Namespace Reference


Functions

std::ostream & operator<< (std::ostream &os, const BasicVector3D< float > &a)
std::istream & operator>> (std::istream &is, BasicVector3D< float > &a)
std::ostream & operator<< (std::ostream &os, const BasicVector3D< double > &a)
std::istream & operator>> (std::istream &is, BasicVector3D< double > &a)
Normal3D< float > operator * (const Transform3D &m, const Normal3D< float > &v)
Normal3D< double > operator * (const Transform3D &m, const Normal3D< double > &v)
std::ostream & operator<< (std::ostream &os, const Plane3D< float > &p)
std::ostream & operator<< (std::ostream &os, const Plane3D< double > &p)
Point3D< float > operator * (const Transform3D &m, const Point3D< float > &v)
Point3D< double > operator * (const Transform3D &m, const Point3D< double > &v)
Vector3D< float > operator * (const Transform3D &m, const Vector3D< float > &v)
Vector3D< double > operator * (const Transform3D &m, const Vector3D< double > &v)


Function Documentation

std::ostream& HepGeom::operator<< ( std::ostream &  os,
const BasicVector3D< float > &  a 
)

Definition at line 107 of file BasicVector3D.cc.

00108   {
00109     return os << "(" << a.x() << "," << a.y() << "," << a.z() << ")";
00110   }

std::istream& HepGeom::operator>> ( std::istream &  is,
BasicVector3D< float > &  a 
)

Definition at line 114 of file BasicVector3D.cc.

00115   {
00116     // Required format is ( a, b, c ) that is, three numbers, preceded by
00117     // (, followed by ), and separated by commas.  The three numbers are
00118     // taken as x, y, z.
00119 
00120     float x, y, z;
00121     char c;
00122 
00123     is >> std::ws >> c;
00124     // ws is defined to invoke eatwhite(istream & )
00125     // see (Stroustrup gray book) page 333 and 345.
00126     if (is.fail() || c != '(' ) {
00127       std::cerr
00128         << "Could not find required opening parenthesis "
00129         << "in input of a BasicVector3D<float>"
00130         << std::endl;
00131       return is;
00132     }
00133 
00134     is >> x >> std::ws >> c;
00135     if (is.fail() || c != ',' ) {
00136       std::cerr
00137         << "Could not find x value and required trailing comma "
00138         << "in input of a BasicVector3D<float>"
00139         << std::endl; 
00140       return is;
00141     }
00142 
00143     is >> y >> std::ws >> c;
00144     if (is.fail() || c != ',' ) {
00145       std::cerr
00146         << "Could not find y value and required trailing comma "
00147         <<  "in input of a BasicVector3D<float>"
00148         << std::endl;
00149       return is;
00150     }
00151 
00152     is >> z >> std::ws >> c;
00153     if (is.fail() || c != ')' ) {
00154       std::cerr
00155         << "Could not find z value and required close parenthesis "
00156         << "in input of a BasicVector3D<float>"
00157         << std::endl;
00158       return is;
00159     }
00160 
00161     a.setX(x);
00162     a.setY(y);
00163     a.setZ(z);
00164     return is;
00165   }

std::ostream& HepGeom::operator<< ( std::ostream &  os,
const BasicVector3D< double > &  a 
)

Definition at line 263 of file BasicVector3D.cc.

00264   {
00265     return os << "(" << a.x() << "," << a.y() << "," << a.z() << ")";
00266   }

std::istream& HepGeom::operator>> ( std::istream &  is,
BasicVector3D< double > &  a 
)

Definition at line 270 of file BasicVector3D.cc.

00271   {
00272     // Required format is ( a, b, c ) that is, three numbers, preceded by
00273     // (, followed by ), and separated by commas.  The three numbers are
00274     // taken as x, y, z.
00275     
00276     double x, y, z;
00277     char c;
00278     
00279     is >> std::ws >> c;
00280     // ws is defined to invoke eatwhite(istream & )
00281     // see (Stroustrup gray book) page 333 and 345.
00282     if (is.fail() || c != '(' ) {
00283       std::cerr
00284         << "Could not find required opening parenthesis "
00285         << "in input of a BasicVector3D<double>"
00286         << std::endl;
00287       return is;
00288     }
00289 
00290     is >> x >> std::ws >> c;
00291     if (is.fail() || c != ',' ) {
00292       std::cerr
00293         << "Could not find x value and required trailing comma "
00294         << "in input of a BasicVector3D<double>"
00295         << std::endl; 
00296       return is;
00297     }
00298 
00299     is >> y >> std::ws >> c;
00300     if (is.fail() || c != ',' ) {
00301       std::cerr
00302         << "Could not find y value and required trailing comma "
00303         <<  "in input of a BasicVector3D<double>"
00304         << std::endl;
00305       return is;
00306     }
00307 
00308     is >> z >> std::ws >> c;
00309     if (is.fail() || c != ')' ) {
00310       std::cerr
00311         << "Could not find z value and required close parenthesis "
00312         << "in input of a BasicVector3D<double>"
00313         << std::endl;
00314       return is;
00315     }
00316 
00317     a.setX(x);
00318     a.setY(y);
00319     a.setZ(z);
00320     return is;
00321   }

Normal3D<float> HepGeom::operator * ( const Transform3D &  m,
const Normal3D< float > &  v 
)

Definition at line 24 of file Normal3D.cc.

00024                                                               {
00025     double vx = v.x(),  vy = v.y(),  vz = v.z();
00026     double xx = m.xx(), xy = m.xy(), xz = m.xz();
00027     double yx = m.yx(), yy = m.yy(), yz = m.yz();
00028     double zx = m.zx(), zy = m.zy(), zz = m.zz();
00029     return Normal3D<float>
00030       ((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
00031        (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
00032        (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
00033   }

Normal3D<double> HepGeom::operator * ( const Transform3D &  m,
const Normal3D< double > &  v 
)

Definition at line 50 of file Normal3D.cc.

00050                                                                {
00051     double vx = v.x(),  vy = v.y(),  vz = v.z();
00052     double xx = m.xx(), xy = m.xy(), xz = m.xz();
00053     double yx = m.yx(), yy = m.yy(), yz = m.yz();
00054     double zx = m.zx(), zy = m.zy(), zz = m.zz();
00055     return Normal3D<double>
00056       ((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
00057        (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
00058        (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
00059   }

std::ostream& HepGeom::operator<< ( std::ostream &  os,
const Plane3D< float > &  p 
)

Definition at line 22 of file Plane3D.cc.

00022                                                         {
00023     return os
00024       << '(' << p.a() << ',' << p.b() << ',' << p.c() << ',' << p.d() << ')';
00025   }

std::ostream& HepGeom::operator<< ( std::ostream &  os,
const Plane3D< double > &  p 
)

Definition at line 29 of file Plane3D.cc.

00029                                                          {
00030     return os
00031       << '(' << p.a() << ',' << p.b() << ',' << p.c() << ',' << p.d() << ')';
00032   }

Point3D<float> HepGeom::operator * ( const Transform3D &  m,
const Point3D< float > &  v 
)

Definition at line 21 of file Point3D.cc.

00021                                                              {
00022     double vx = v.x(), vy = v.y(), vz = v.z();
00023     return Point3D<float>
00024       (m.xx()*vx + m.xy()*vy + m.xz()*vz + m.dx(),
00025        m.yx()*vx + m.yy()*vy + m.yz()*vz + m.dy(),
00026        m.zx()*vx + m.zy()*vy + m.zz()*vz + m.dz());
00027   }

Point3D<double> HepGeom::operator * ( const Transform3D &  m,
const Point3D< double > &  v 
)

Definition at line 41 of file Point3D.cc.

00041                                                               {
00042     double vx = v.x(), vy = v.y(), vz = v.z();
00043     return Point3D<double>
00044       (m.xx()*vx + m.xy()*vy + m.xz()*vz + m.dx(),
00045        m.yx()*vx + m.yy()*vy + m.yz()*vz + m.dy(),
00046        m.zx()*vx + m.zy()*vy + m.zz()*vz + m.dz());
00047   }

Vector3D<float> HepGeom::operator * ( const Transform3D &  m,
const Vector3D< float > &  v 
)

Definition at line 21 of file Vector3D.cc.

00021                                                               {
00022     double vx = v.x(), vy = v.y(), vz = v.z();
00023     return Vector3D<float>
00024       (m.xx()*vx + m.xy()*vy + m.xz()*vz,
00025        m.yx()*vx + m.yy()*vy + m.yz()*vz,
00026        m.zx()*vx + m.zy()*vy + m.zz()*vz);
00027   }

Vector3D<double> HepGeom::operator * ( const Transform3D &  m,
const Vector3D< double > &  v 
)

Definition at line 41 of file Vector3D.cc.

00041                                                                {
00042     double vx = v.x(), vy = v.y(), vz = v.z();
00043     return Vector3D<double>
00044       (m.xx()*vx + m.xy()*vy + m.xz()*vz,
00045        m.yx()*vx + m.yy()*vy + m.yz()*vz,
00046        m.zx()*vx + m.zy()*vy + m.zz()*vz);
00047   }


Generated on Mon May 27 17:54:09 2013 for Geant4 by  doxygen 1.4.7