Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

Frame.H

Go to the documentation of this file.
00001 
00014 #ifndef _FRAME_H
00015 #define _FRAME_H
00016 
00017 #include <Transform.H>
00018 
00019 namespace xchen
00020 {
00022   struct Frame 
00023     {
00024     public:
00025         Frame(const dPoint3D&  p=dPoint3D(0.0), 
00026               const dVector3D& x=dVector3D(1,0,0), 
00027               const dVector3D& y=dVector3D(0,1,0), 
00028               const dVector3D& z=dVector3D(0,0,1))  : pos(p), f1(x), f2(y), f3(z)
00029         {
00030           Transform tran;
00031           tran.Translate(pos);
00032           tran.Rotate2Frame(*this);
00033           matrix = tran.GetMatrix()();
00034         }
00035 
00036         dPoint3D  pos;
00037         dVector3D f1;
00038         dVector3D f2;
00039         dVector3D f3;
00040 
00041         dVecOfVec44 matrix;                                   // transform matrix to this frame from canonical one.
00042 
00043         friend ostream& operator <<(ostream& os, const Frame& frm)
00044         {
00045           return
00046             os << "Frame at " << frm.pos << " with frame vectors: " << frm.f1 << '\t' << frm.f2 << '\t' << frm.f3;
00047         }
00048     };
00049 
00050 }//end namespace xchen
00051 
00052 
00053 #endif

Generated on Wed Apr 7 21:40:49 2004 by doxygen1.2.18