#include "Location.hh" #include "qatos.hh" using namespace asap::atos; Location::Location () { } Location::Location (const Location& loc) { _pos = loc._pos; _ori = loc._ori; } Location::Location (const Hep3Vector& pos, const Hep3Vector& ori) { set(pos, ori); } Location::~Location () { } Location* Location::clone() const { return new Location(*this); } void Location::set (const Hep3Vector& pos, const Hep3Vector& ori) { _pos = pos; _ori = ori; } Hep3Vector Location::position () const { return _pos; } Hep3Vector Location::orientation () const { return _ori; } HepRotation Location::rot () const { HepRotation rot; Hep3Vector ori = orientation (); rot.Rotate (ori.x(), ori.y(), ori.z()); return rot; } void Location::glTranslate () const { Hep3Vector pos = position (); Hep3Vector ori = orientation (); // Move to origin of box to be drawn glTranslatef (pos.x() * scale_t, pos.y() * scale_t, pos.z() * scale_t); // glRotatef multiplies a matrix on the right side of the present rotation matrix glRotatef (ori.z() * scale_r, 0, 0, 1); glRotatef (ori.y() * scale_r, 0, 1, 0); glRotatef (ori.x() * scale_r, 1, 0, 0); }