CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FrameChanger.h
Go to the documentation of this file.
1 #ifndef FrameChanger_H
2 #define FrameChanger_H
3 
6 
7 class FrameChanger {
8 public:
12  template <typename T>
13  static
14  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 
22 
26  template <typename T, typename U>
27  static
29  const GloballyPositioned<U>& frame) {
31  typedef GloballyPositioned<U> Frame;
32 
33  typename Plane::RotationType rot = plane.rotation() * frame.rotation().transposed();
34  typename Frame::LocalPoint lpos = frame.toLocal(plane.position());
35  typename Plane::PositionType pos( lpos.basicVector()); // cheat!
36  return Plane( pos, rot);
37 
38  }
39 
40 };
41 
42 #endif
Definition: Plane.h:17
LocalPoint toLocal(const GlobalPoint &gp) const
static GloballyPositioned< T > toFrame(const GloballyPositioned< T > &plane, const GloballyPositioned< U > &frame)
Definition: FrameChanger.h:28
static Plane transformPlane(const Plane &plane, const GloballyPositioned< T > &frame)
Definition: FrameChanger.h:14
TkRotation transposed() const
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
const RotationType & rotation() const
const PositionType & position() const