Panda3D

arToolKit.h

00001 // Filename: arToolKit.h
00002 // Created by: jyelon (01Nov2007)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef ARTOOLKIT_H
00016 #define ARTOOLKIT_H
00017 
00018 #include "pandabase.h"
00019 
00020 #ifdef HAVE_ARTOOLKIT
00021 
00022 #include "nodePath.h"
00023 #include "texture.h"
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : ARToolKit
00027 // Description : ARToolKit is a software library for building
00028 //               Augmented Reality (AR) applications. These are
00029 //               applications that involve the overlay of virtual
00030 //               imagery on the real world.  It was developed by
00031 //               Dr. Hirokazu Kato.  Its ongoing development is
00032 //               being supported by the Human Interface Technology
00033 //               Laboratory (HIT Lab) at the University of
00034 //               Washington, HIT Lab NZ at the University of
00035 //               Canterbury, New Zealand, and ARToolworks, Inc,
00036 //               Seattle.  It is available under a GPL license.
00037 //               It is also possible to negotiate other licenses
00038 //               with the copyright holders.
00039 //
00040 //               This class is a wrapper around the ARToolKit
00041 //               library.
00042 ////////////////////////////////////////////////////////////////////
00043 class EXPCL_VISION ARToolKit {
00044   
00045 PUBLISHED:
00046   static ARToolKit *make(NodePath camera, const Filename &paramfile, double markersize);
00047   ~ARToolKit();
00048   
00049   INLINE void set_threshold(double n);
00050   void attach_pattern(const Filename &pattern, NodePath path);
00051   void detach_patterns();
00052   void analyze(Texture *tex, bool do_flip_texture = true);
00053   
00054 private:
00055   static int get_pattern(const Filename &pattern);
00056   ARToolKit();
00057   void cleanup();
00058   
00059   typedef pmap<Filename, int> PatternTable;
00060   static PatternTable _pattern_table;
00061   
00062   typedef pmap<int, NodePath> Controls;
00063   Controls _controls;
00064   
00065   NodePath _camera;
00066   void *_camera_param;
00067   double _threshold;
00068   double _marker_size;
00069   double _prev_conv[3][4];
00070   bool _have_prev_conv;
00071 };
00072 
00073 #include "arToolKit.I"
00074 
00075 #endif // HAVE_ARTOOLKIT
00076 #endif // ARTOOLKIT_H
 All Classes Functions Variables Enumerations