[atlas] / groups / Asap / qatos / Location.cc Repository:
ViewVC logotype

Annotation of /groups/Asap/qatos/Location.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (view) (download)

1 : giraudpf 1.1 #include "Location.hh"
2 :     #include "qatos.hh"
3 :    
4 :     using namespace asap::atos;
5 :    
6 :     Location::Location () {
7 :     }
8 :     Location::Location (const Location& loc) {
9 :     _pos = loc._pos;
10 :     _ori = loc._ori;
11 :     }
12 :     Location::Location (const Hep3Vector& pos, const Hep3Vector& ori) {
13 :     set(pos, ori);
14 :     }
15 :     Location::~Location () {
16 :     }
17 :    
18 :     Location* Location::clone() const {
19 :     return new Location(*this);
20 :     }
21 :    
22 :     void Location::set (const Hep3Vector& pos, const Hep3Vector& ori) {
23 :     _pos = pos;
24 :     _ori = ori;
25 :     }
26 :    
27 :     Hep3Vector Location::position () const {
28 :     return _pos;
29 :     }
30 :     Hep3Vector Location::orientation () const {
31 :     return _ori;
32 :     }
33 :    
34 :     HepRotation Location::rot () const {
35 :     HepRotation rot;
36 :     Hep3Vector ori = orientation ();
37 :     rot.Rotate (ori.x(), ori.y(), ori.z());
38 :     return rot;
39 :     }
40 :    
41 :     void Location::glTranslate () const {
42 :     Hep3Vector pos = position ();
43 :     Hep3Vector ori = orientation ();
44 :    
45 :     // Move to origin of box to be drawn
46 :     glTranslatef (pos.x() * scale_t,
47 :     pos.y() * scale_t,
48 :     pos.z() * scale_t);
49 :     // glRotatef multiplies a matrix on the right side of the present rotation matrix
50 :     glRotatef (ori.z() * scale_r, 0, 0, 1);
51 :     glRotatef (ori.y() * scale_r, 0, 1, 0);
52 :     glRotatef (ori.x() * scale_r, 1, 0, 0);
53 :     }

CERN Central CVS service
ViewVC Help
Powered by ViewVC 1.0.9