CMS 3D CMS Logo

FrameChanger.h
Go to the documentation of this file.
1 #ifndef FrameChanger_H
2 #define FrameChanger_H
3 
7 
9 public:
13  template <typename T>
14  static Plane transformPlane(const Plane& plane, const GloballyPositioned<T>& frame) {
15  typedef GloballyPositioned<T> Frame;
16  typename Plane::RotationType rot = plane.rotation() * frame.rotation().transposed();
17  typename Frame::LocalPoint lpos = frame.toLocal(plane.position());
18  typename Plane::PositionType pos(lpos.basicVector()); // cheat!
19  return Plane(pos, rot);
20  }
21 
25  template <typename T, typename U>
28  typedef GloballyPositioned<U> Frame;
29 
30  typename Plane::RotationType rot = plane.rotation() * frame.rotation().transposed();
31  typename Frame::LocalPoint lpos = frame.toLocal(plane.position());
32  typename Plane::PositionType pos(lpos.basicVector()); // cheat!
33  return Plane(pos, rot);
34  }
35 };
36 
37 #endif
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
Definition: Plane.h:16
LocalPoint toLocal(const GlobalPoint &gp) const
static GloballyPositioned< T > toFrame(const GloballyPositioned< T > &plane, const GloballyPositioned< U > &frame)
Definition: FrameChanger.h:26
#define dso_internal
Definition: Visibility.h:13
static Plane transformPlane(const Plane &plane, const GloballyPositioned< T > &frame)
Definition: FrameChanger.h:14
TkRotation transposed() const
const RotationType & rotation() const
const PositionType & position() const