Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | Related Functions
HepGeom::Plane3D< T > Class Template Reference

#include <Plane3D.h>

Inheritance diagram for HepGeom::Plane3D< T >:
G4ErrorPlaneSurfaceTarget

Public Member Functions

 Plane3D ()
 
 Plane3D (T a1, T b1, T c1, T d1)
 
 Plane3D (const Normal3D< T > &n, const Point3D< T > &p)
 
 Plane3D (const Point3D< T > &p1, const Point3D< T > &p2, const Point3D< T > &p3)
 
 Plane3D (const Plane3D< float > &p)
 
 ~Plane3D ()
 
Plane3D< T > & operator= (const Plane3D< T > &p)
 
a () const
 
b () const
 
c () const
 
d () const
 
Normal3D< T > normal () const
 
Plane3D< T > & normalize ()
 
distance (const Point3D< T > &p) const
 
Point3D< T > point (const Point3D< T > &p) const
 
Point3D< T > point () const
 
bool operator== (const Plane3D< T > &p) const
 
bool operator!= (const Plane3D< T > &p) const
 
Plane3D< T > & transform (const Transform3D &m)
 

Protected Attributes

a_
 
b_
 
c_
 
d_
 

Related Functions

(Note that these are not member functions.)

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

Detailed Description

template<class T>
class HepGeom::Plane3D< T >

Template class for geometrical plane in 3D.

Author
Evgeni Chernyaev Evgue.nosp@m.ni.T.nosp@m.chern.nosp@m.iaev.nosp@m.@cern.nosp@m..ch

Definition at line 29 of file Plane3D.h.

Constructor & Destructor Documentation

template<class T>
HepGeom::Plane3D< T >::Plane3D ( )
inline

Default constructor - creates plane z=0.

Definition at line 36 of file Plane3D.h.

36 : a_(0.), b_(0.), c_(1.), d_(0.) {}
template<class T>
HepGeom::Plane3D< T >::Plane3D ( a1,
b1,
c1,
d1 
)
inline

Constructor from four numbers - creates plane a*x+b*y+c*z+d=0.

Definition at line 40 of file Plane3D.h.

40 : a_(a1), b_(b1), c_(c1), d_(d1) {}
tuple c1
Definition: plottest35.py:14
template<class T>
HepGeom::Plane3D< T >::Plane3D ( const Normal3D< T > &  n,
const Point3D< T > &  p 
)
inline

Constructor from normal and point.

Definition at line 44 of file Plane3D.h.

45  : a_(n.x()), b_(n.y()), c_(n.z()), d_(-n*p) {}
const char * p
Definition: xmltok.h:285
const G4int n
template<class T>
HepGeom::Plane3D< T >::Plane3D ( const Point3D< T > &  p1,
const Point3D< T > &  p2,
const Point3D< T > &  p3 
)
inline

Constructor from three points.

Definition at line 49 of file Plane3D.h.

51  {
52  Normal3D<T> n = (p2-p1).cross(p3-p1);
53  a_ = n.x(); b_ = n.y(); c_ = n.z(); d_ = -n*p1;
54  }
const G4int n
template<class T>
HepGeom::Plane3D< T >::Plane3D ( const Plane3D< float > &  p)
inline

Copy constructor. Plane3D<double> has two constructors: from Plane3D<double> (provided by compiler) and from Plane3D<float> (defined in this file). Plane3D<float> has only the last one.

Definition at line 62 of file Plane3D.h.

63  : a_(p.a_), b_(p.b_), c_(p.c_), d_(p.d_) {}
const char * p
Definition: xmltok.h:285
template<class T>
HepGeom::Plane3D< T >::~Plane3D ( )
inline

Destructor.

Definition at line 67 of file Plane3D.h.

67 {};

Member Function Documentation

template<class T>
T HepGeom::Plane3D< T >::a ( ) const
inline
template<class T>
T HepGeom::Plane3D< T >::b ( ) const
inline
template<class T>
T HepGeom::Plane3D< T >::c ( ) const
inline
template<class T>
T HepGeom::Plane3D< T >::d ( ) const
inline

Returns the free member of the plane equation: a*x+b*y+c*z+d=0.

Definition at line 86 of file Plane3D.h.

Referenced by absorp(), ar3jet(), backdpm(), backrot(), berttp(), bsofpt(), checkf(), checkn(), G4VSceneHandler::CreateSectionSolid(), csharm(), csj1m(), csj2m(), damg(), dchanh(), ddecay(), decays(), dechkk(), dgamrn(), dhadri(), diadif(), diffch(), diffpt(), diseva(), dispt(), HepGeom::Plane3D< G4double >::distance(), distcm(), distr(), dminit(), dor94fs(), dor94fv(), dor94fw(), dphnpi(), dpmjet(), dpoli(), drandm(), dsige(), dsigin(), dsihae(), dthrep(), dtwopa(), dxlamb(), elhain(), energy(), enrg(), eva2he(), evtemc(), evtput(), fhad(), ficonf(), fozoca(), gen_delta(), gen_qel(), hadjase(), hadjet(), hadjse(), hadrdi(), hadri1(), hafdi1(), hafdis(), hamaxi(), hamult(), harini(), harkin(), harsca(), hatest(), hax1x2(), hijwds(), hisout(), hkkfil(), incini(), inucas(), jtpdis(), kkinc(), lepdcyp(), lortmo(), lortrp(), ltini(), ltrans(), lustrf(), lxsect(), lzp(), mashel(), mass_ini(), nclpot(), HepGeom::Plane3D< G4double >::operator!=(), HepGeom::Plane3D< G4double >::operator==(), parpt(), phnsch(), pinkla(), po_fint(), po_grv98lo(), HepGeom::Plane3D< G4double >::point(), prblm2(), prepola(), profb(), py3ent(), py4ent(), pyalem(), pyangl(), pyapps(), pyboei(), pycell(), pycjdc(), pycteq(), pydecy(), pydocu(), pyedit(), pyeig4(), pyevnt(), pyfint(), pygaus(), pygbeh(), pygfxx(), pyglui(), pygrvs(), pygrvv(), pygrvw(), pyhext(), pyhfth(), pyi3au(), pyindf(), pyinom(), pyjmas(), pyklim(), pykmap(), pymass(), pymaxi(), pymsin(), pymult(), pynjdc(), pyofsh(), pyoper(), pyp(), pypdel(), pypdga(), pypdpi(), pypile(), pyplot(), pyptdi(), pyradk(), pyrand(), pyreco(), pyremn(), pyresd(), pyrobo(), pyscat(), pysfdc(), pyshow(), pysigh(), pyspen(), pysphe(), pysspa(), pysspb(), pystrf(), pytabu(), pytbdy(), pytest(), pythrg(), pythru(), pyvacu(), pywidt(), pyxtot(), pyxxw5(), pyxxz2(), qinnuc(), qrblm2(), raco(), rdxsec(), resncl(), rm48(), rndm(), rndmte(), rotate(), samppt(), scn4ba(), sdiff(), sewew(), shmak(), shmak1(), sigshd(), sihnab(), sihnel(), sihnin(), sort(), sortin(), sttran(), tsamcs(), vahmsd(), var(), vegas(), wdsax(), xcheck(), xksamp(), and xsglau().

86 { return d_; }
template<class T>
T HepGeom::Plane3D< T >::distance ( const Point3D< T > &  p) const
inline

Returns distance to the point.

Definition at line 102 of file Plane3D.h.

Referenced by HepGeom::Plane3D< G4double >::point().

102  {
103  return a()*p.x() + b()*p.y() + c()*p.z() + d();
104  }
T c() const
Definition: Plane3D.h:83
const char * p
Definition: xmltok.h:285
T d() const
Definition: Plane3D.h:86
T a() const
Definition: Plane3D.h:77
T b() const
Definition: Plane3D.h:80
template<class T>
Normal3D<T> HepGeom::Plane3D< T >::normal ( ) const
inline
template<class T>
Plane3D<T>& HepGeom::Plane3D< T >::normalize ( )
inline

Normalization.

Definition at line 94 of file Plane3D.h.

94  {
95  double ll = std::sqrt(a_*a_ + b_*b_ + c_*c_);
96  if (ll > 0.) { a_ /= ll; b_ /= ll; c_ /= ll, d_ /= ll; }
97  return *this;
98  }
template<class T>
bool HepGeom::Plane3D< T >::operator!= ( const Plane3D< T > &  p) const
inline

Test for inequality.

Definition at line 128 of file Plane3D.h.

128  {
129  return a() != p.a() || b() != p.b() || c() != p.c() || d() != p.d();
130  }
T c() const
Definition: Plane3D.h:83
const char * p
Definition: xmltok.h:285
T d() const
Definition: Plane3D.h:86
T a() const
Definition: Plane3D.h:77
T b() const
Definition: Plane3D.h:80
template<class T>
Plane3D<T>& HepGeom::Plane3D< T >::operator= ( const Plane3D< T > &  p)
inline

Assignment.

Definition at line 71 of file Plane3D.h.

71  {
72  a_ = p.a_; b_ = p.b_; c_ = p.c_; d_ = p.d_; return *this;
73  }
const char * p
Definition: xmltok.h:285
template<class T>
bool HepGeom::Plane3D< T >::operator== ( const Plane3D< T > &  p) const
inline

Test for equality.

Definition at line 122 of file Plane3D.h.

122  {
123  return a() == p.a() && b() == p.b() && c() == p.c() && d() == p.d();
124  }
T c() const
Definition: Plane3D.h:83
const char * p
Definition: xmltok.h:285
T d() const
Definition: Plane3D.h:86
T a() const
Definition: Plane3D.h:77
T b() const
Definition: Plane3D.h:80
template<class T>
Point3D<T> HepGeom::Plane3D< T >::point ( const Point3D< T > &  p) const
inline

Returns projection of the point to the plane.

Definition at line 108 of file Plane3D.h.

Referenced by G4ViewParameters::SceneModifyingCommands().

108  {
109  T k = distance(p)/(a()*a()+b()*b()+c()*c());
110  return Point3D<T>(p.x()-a()*k, p.y()-b()*k, p.z()-c()*k);
111  }
T c() const
Definition: Plane3D.h:83
const char * p
Definition: xmltok.h:285
T a() const
Definition: Plane3D.h:77
T distance(const Point3D< T > &p) const
Definition: Plane3D.h:102
T b() const
Definition: Plane3D.h:80
template<class T>
Point3D<T> HepGeom::Plane3D< T >::point ( ) const
inline

Returns projection of the origin to the plane.

Definition at line 115 of file Plane3D.h.

Referenced by G4ErrorPlaneSurfaceTarget::Dump(), G4ErrorPlaneSurfaceTarget::GetDistanceFromPoint(), and HepGeom::Plane3D< G4double >::transform().

115  {
116  T k = -d()/(a()*a()+b()*b()+c()*c());
117  return Point3D<T>(a()*k, b()*k, c()*k);
118  }
T c() const
Definition: Plane3D.h:83
T d() const
Definition: Plane3D.h:86
T a() const
Definition: Plane3D.h:77
T b() const
Definition: Plane3D.h:80
template<class T>
Plane3D<T>& HepGeom::Plane3D< T >::transform ( const Transform3D m)
inline

Transformation by Transform3D.

Definition at line 134 of file Plane3D.h.

134  {
135  Normal3D<T> n = normal();
136  n.transform(m);
137  d_ = -n*point().transform(m); a_ = n.x(); b_ = n.y(); c_ = n.z();
138  return *this;
139  }
Normal3D< T > normal() const
Definition: Plane3D.h:90
const G4int n
Point3D< T > point() const
Definition: Plane3D.h:115

Friends And Related Function Documentation

template<class T>
std::ostream & operator<< ( std::ostream &  os,
const Plane3D< float > &  p 
)
related

Output to the stream.

Definition at line 22 of file Plane3D.cc.

22  {
23  return os
24  << '(' << p.a() << ',' << p.b() << ',' << p.c() << ',' << p.d() << ')';
25  }
const char * p
Definition: xmltok.h:285
template<class T>
std::ostream & operator<< ( std::ostream &  os,
const Plane3D< double > &  p 
)
related

Output to the stream.

Definition at line 29 of file Plane3D.cc.

29  {
30  return os
31  << '(' << p.a() << ',' << p.b() << ',' << p.c() << ',' << p.d() << ')';
32  }
const char * p
Definition: xmltok.h:285

Field Documentation

template<class T>
T HepGeom::Plane3D< T >::a_
protected
template<class T>
T HepGeom::Plane3D< T >::b_
protected
template<class T>
T HepGeom::Plane3D< T >::c_
protected
template<class T>
T HepGeom::Plane3D< T >::d_
protected

The documentation for this class was generated from the following file: