arToolKit.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Filename: arToolKit.h
  2. // Created by: jyelon (01Nov2007)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) Carnegie Mellon University. All rights reserved.
  8. //
  9. // All use of this software is subject to the terms of the revised BSD
  10. // license. You should have received a copy of this license along
  11. // with this source code in a file named "LICENSE."
  12. //
  13. ////////////////////////////////////////////////////////////////////
  14. #ifndef ARTOOLKIT_H
  15. #define ARTOOLKIT_H
  16. #include "pandabase.h"
  17. #ifdef HAVE_ARTOOLKIT
  18. #include "nodePath.h"
  19. #include "texture.h"
  20. ////////////////////////////////////////////////////////////////////
  21. // Class : ARToolKit
  22. // Description : ARToolKit is a software library for building
  23. // Augmented Reality (AR) applications. These are
  24. // applications that involve the overlay of virtual
  25. // imagery on the real world. It was developed by
  26. // Dr. Hirokazu Kato. Its ongoing development is
  27. // being supported by the Human Interface Technology
  28. // Laboratory (HIT Lab) at the University of
  29. // Washington, HIT Lab NZ at the University of
  30. // Canterbury, New Zealand, and ARToolworks, Inc,
  31. // Seattle. It is available under a GPL license.
  32. // It is also possible to negotiate other licenses
  33. // with the copyright holders.
  34. //
  35. // This class is a wrapper around the ARToolKit
  36. // library.
  37. ////////////////////////////////////////////////////////////////////
  38. class EXPCL_PANDA_GRUTIL ARToolKit {
  39. PUBLISHED:
  40. static ARToolKit *make(NodePath camera, const Filename &paramfile, double markersize);
  41. ~ARToolKit();
  42. INLINE void set_threshold(double n);
  43. void attach_pattern(const Filename &pattern, NodePath path);
  44. void detach_patterns();
  45. void analyze(Texture *tex, bool do_flip_texture = true);
  46. private:
  47. static int get_pattern(const Filename &pattern);
  48. ARToolKit();
  49. void cleanup();
  50. typedef pmap<Filename, int> PatternTable;
  51. static PatternTable _pattern_table;
  52. typedef pmap<int, NodePath> Controls;
  53. Controls _controls;
  54. NodePath _camera;
  55. void *_camera_param;
  56. double _threshold;
  57. double _marker_size;
  58. double _prev_conv[3][4];
  59. bool _have_prev_conv;
  60. };
  61. #include "arToolKit.I"
  62. #endif // HAVE_ARTOOLKIT
  63. #endif // ARTOOLKIT_H