00001 /***************************** License ********************************** 00002 00003 Copyright (C) 2008 by Communicative Machines 00004 http://www.cmlabs.com All rights reserved. 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either 00009 version 2.1 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public 00017 License along with this library; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 00020 ************************************************************************/ 00021 00022 00023 // ObjectTrack.h: interface for the ObjectTrack class. 00024 // 00025 ////////////////////////////////////////////////////////////////////// 00026 00027 #if !defined(__OBJECTTRACK_H__) 00028 #define __OBJECTTRACK_H__ 00029 00030 #include "Bitmap.h" 00031 #include "XMLParser.h" 00032 #include "Collections.h" 00033 00034 namespace cmlabs { 00035 00036 class ObjectTrack; 00037 class ObjectObservation : public Object 00038 { 00039 public: 00040 ObjectObservation(); 00041 ObjectObservation(const JString& xml); 00042 ObjectObservation(XMLNode* node); 00043 virtual ~ObjectObservation(); 00044 00045 Object* clone() const; 00046 00047 JString print() ; 00048 JString toXML() ; 00049 bool fromXML(const JString& xml); 00050 bool fromXML(XMLNode* node); 00051 00052 JString get(const JString& key); 00053 bool set(const JString& key, const JString& value); 00054 Object* getObject(const JString& key); 00055 bool setObject(const JString& key, Object* value); 00056 00057 bool associateWithTrack(const JString& trackID); 00058 bool disassociateWithTrack(const JString& trackID); 00059 00060 unsigned long long frame; 00061 JString id; 00062 JString scene; 00063 JTime timestamp; 00064 Box box; 00065 Bitmap* image; 00066 ObjectDictionary properties; 00067 Collection tracks; 00068 }; 00069 00070 class ObjectTrackEntry : public Object 00071 { 00072 public: 00073 ObjectTrackEntry(); 00074 ObjectTrackEntry(const JString& xml); 00075 ObjectTrackEntry(XMLNode* node); 00076 ObjectTrackEntry(ObjectObservation* obs); 00077 virtual ~ObjectTrackEntry(); 00078 00079 Object* clone() const; 00080 00081 JString print() ; 00082 JString toXML() ; 00083 bool fromXML(const JString& xml); 00084 bool fromXML(XMLNode* node); 00085 00086 bool associateObservation(ObjectObservation* obs); 00087 bool disassociateObservation(ObjectObservation* obs); 00088 00089 Box getBoundingBox(); 00090 00091 JTime timestamp; 00092 unsigned long long frame; 00093 JString scene; 00094 ObjectDictionary observations; 00095 }; 00096 00097 class ObjectTrack : public Object 00098 { 00099 public: 00100 ObjectTrack(); 00101 ObjectTrack(const JString& xml); 00102 ObjectTrack(XMLNode* node); 00103 virtual ~ObjectTrack(); 00104 00105 Object* clone() const; 00106 00107 JString print() ; 00108 JString toXML() ; 00109 bool fromXML(const JString& xml); 00110 bool fromXML(XMLNode* node); 00111 00112 ObjectTrackEntry* get(unsigned long long frame); 00113 ObjectTrackEntry* getFirst(); 00114 ObjectTrackEntry* getLast(); 00115 00116 JTime getFirstActivityTime(); 00117 unsigned long long getFirstActivityFrame(); 00118 JTime getLastActivityTime(); 00119 unsigned long long getLastActivityFrame(); 00120 00121 bool associateObservation(ObjectObservation* obs); 00122 bool disassociateObservation(ObjectObservation* obs); 00123 00124 JString id; 00125 ObjectDictionary entries; 00126 }; 00127 00128 } // namespace cmlabs 00129 00130 #endif // !defined(__OBJECTTRACK_H__)