00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00043
00044
00070 #ifndef _ARTOOLKITMODULEPLUS_H
00071 #define _ARTOOLKITMODULEPLUS_H
00072
00073 #include "../dllinclude.h"
00074
00075 #include <vector>
00076 #include <map>
00077
00078 #include "../OpenTracker.h"
00079 #include "../core/VideoUser.h"
00080
00081
00082 #ifdef USE_ARTOOLKITPLUS
00083
00084
00085 namespace ARToolKitPlus
00086 {
00087 class TrackerSingleMarker;
00088 class Logger;
00089 }
00090
00091 class ARToolKitPlusModuleLogger;
00092
00093
00094
00095 namespace ot
00096 {
00097
00098 class ARToolKitPlusModule;
00099 typedef std::vector<Node::Ptr> NodeVector;
00100 typedef std::map<int,Node::Ptr> MarkerIdMap;
00101
00102
00110 class OPENTRACKER_API ARToolKitPlusModule : public ThreadModule, public NodeFactory, public VideoUser
00111 {
00112
00113 protected:
00115 MarkerIdMap sourcesMap;
00116
00118 NodeVector sources;
00119
00121 NodeVector visibleMarkers;
00122
00124 float *bestCFs;
00125 int maxMarkerId;
00126
00128 std::string cameradata;
00129
00131 int sizeX, sizeY;
00132
00134 std::string patternDirectory;
00135
00137 std::string cameraDeviceHint;
00138
00140 bool useMarkerDetectLite;
00141
00143 int stop;
00144
00145 void init(StringTable& attributes, ConfigNode * localTree);
00146
00147 void updateSingleMarkerSource(Node *source, float cf, float matrix[3][4]);
00148 void updateMultiMarkerSource(Node *source, float cf, float matrix[3][4]);
00149 void updateEvent(Event &event, float matrix[3][4]);
00150
00151 float trackerNear,trackerFar;
00152 ARToolKitPlus::TrackerSingleMarker* tracker;
00153 ARToolKitPlus::Logger* logger;
00154
00155
00156 public:
00157 enum {
00158 MAX_MARKERID = 511
00159 };
00160
00162 ARToolKitPlusModule();
00163
00165 virtual ~ARToolKitPlusModule();
00166
00174 virtual Node * createNode( const std::string& name, StringTable& attributes);
00179 virtual void pushEvent();
00180
00184 void update();
00185
00187 int getSizeX() const { return sizeX; }
00188
00190 int getSizeY() const { return sizeY; }
00191
00192 ARToolKitPlus::TrackerSingleMarker* getARToolKitPlus() { return tracker; }
00193
00194 const char* getARToolKitPlusDescription() const;
00195
00197
00205 void setCameraDeviceHint(const char* nDeviceName) { cameraDeviceHint = nDeviceName; }
00206
00207 NodeVector& getVisibleMarkers() { return visibleMarkers; }
00208
00209 void newVideoFrame(const unsigned char* image, int width, int height, PIXEL_FORMAT format);
00210
00211 bool doBench;
00212 };
00213
00214 OT_MODULE(ARToolKitPlusModule);
00215
00216 }
00217
00218
00219 #endif //#ifdef USE_ARTOOLKITPLUS
00220
00221 #endif // _ARTOOLKITMODULEPLUS_H
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237