Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

pandatool/src/flt/fltTransformPut.h

Go to the documentation of this file.
00001 // Filename: fltTransformPut.h
00002 // Created by:  drose (29Aug00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef FLTTRANSFORMPUT_H
00020 #define FLTTRANSFORMPUT_H
00021 
00022 #include <pandatoolbase.h>
00023 
00024 #include "fltTransformRecord.h"
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //       Class : FltTransformPut
00028 // Description : A "put", which is a MultiGen concept of defining a
00029 //               transformation by mapping three arbitrary points to
00030 //               three new arbitrary points.
00031 ////////////////////////////////////////////////////////////////////
00032 class FltTransformPut : public FltTransformRecord {
00033 public:
00034   FltTransformPut(FltHeader *header);
00035 
00036   void set(const LPoint3d &from_origin,
00037            const LPoint3d &from_align,
00038            const LPoint3d &from_track,
00039            const LPoint3d &to_origin,
00040            const LPoint3d &to_align,
00041            const LPoint3d &to_track);
00042 
00043   const LPoint3d &get_from_origin() const;
00044   const LPoint3d &get_from_align() const;
00045   const LPoint3d &get_from_track() const;
00046   const LPoint3d &get_to_origin() const;
00047   const LPoint3d &get_to_align() const;
00048   const LPoint3d &get_to_track() const;
00049 
00050 private:
00051   void recompute_matrix();
00052 
00053   LPoint3d _from_origin;
00054   LPoint3d _from_align;
00055   LPoint3d _from_track;
00056   LPoint3d _to_origin;
00057   LPoint3d _to_align;
00058   LPoint3d _to_track;
00059 
00060 protected:
00061   virtual bool extract_record(FltRecordReader &reader);
00062   virtual bool build_record(FltRecordWriter &writer) const;
00063 
00064 public:
00065   virtual TypeHandle get_type() const {
00066     return get_class_type();
00067   }
00068   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00069   static TypeHandle get_class_type() {
00070     return _type_handle;
00071   }
00072   static void init_type() {
00073     FltTransformRecord::init_type();
00074     register_type(_type_handle, "FltTransformPut",
00075                   FltTransformRecord::get_class_type());
00076   }
00077 
00078 private:
00079   static TypeHandle _type_handle;
00080 };
00081 
00082 #endif
00083 
00084 

Generated on Fri May 2 03:19:39 2003 for Panda-Tool by doxygen1.3