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 #if !defined(_IMAGESPACES_H_) 00024 #define _IMAGESPACES_H_ 00025 00026 #include "ImageFeatures.h" 00027 00028 namespace cmlabs { 00029 00030 //! One Plane of ImageFeatures in one image 00031 class FeaturePlane : public Object { 00032 public: 00033 FeaturePlane(JString creator, JTime t, double depth); 00034 ~FeaturePlane(); 00035 FeaturePlane(JString xml); 00036 FeaturePlane(XMLNode* node); 00037 00038 Object* clone() const; 00039 00040 JString creator; 00041 JTime frameTime; 00042 double planeDepth; 00043 ObjectCollection features; 00044 00045 JString print(); 00046 JString toXML(); 00047 bool fromXML(XMLNode* node); 00048 }; 00049 00050 //! Many Planes of ImageFeatures in one image 00051 class FeatureSpace : public Object { 00052 public: 00053 FeatureSpace(JString creator, JTime t, Bitmap* img = NULL); 00054 ~FeatureSpace(); 00055 FeatureSpace(JString xml); 00056 FeatureSpace(XMLNode* node); 00057 00058 Object* clone() const; 00059 00060 JString creator; 00061 JTime frameTime; 00062 Bitmap* image; 00063 ObjectDictionary planes; 00064 FeaturePlane* defaultPlane; 00065 00066 //! Creating/adding new PointFeature 00067 ImagePointFeature* addPointFeature(); 00068 //! Creating/adding new LineFeature 00069 ImageLineFeature* addLineFeature(); 00070 //! Creating/adding new PolyLineFeature 00071 ImagePolyLineFeature* addPolyLineFeature(); 00072 00073 //! Create a new frame at depth btw -1.0 and +1.0 00074 bool addPlane(double depth); 00075 00076 JString print(); 00077 JString toXML(); 00078 bool fromXML(XMLNode* node); 00079 }; 00080 00081 //! Combined ImageFeatures in one image 00082 class FeatureCombiSpace : public Object { 00083 public: 00084 FeatureCombiSpace(); 00085 ~FeatureCombiSpace(); 00086 FeatureCombiSpace(JString xml); 00087 FeatureCombiSpace(XMLNode* node); 00088 00089 Object* clone() const; 00090 00091 //! Dictionary "owner" = FeatureSpace 00092 ObjectDictionary spaces; 00093 //! Dictionary "plane" = CombinedPlane 00094 ObjectDictionary planes; 00095 00096 //! Add another FeatureSpace to be combined with current CombiSpace 00097 bool addFeatureSpace(FeatureSpace* space); 00098 00099 JString print(); 00100 JString toXML(); 00101 bool fromXML(XMLNode* node); 00102 }; 00103 00104 //! Feature Space of ImageFeatures from many image 00105 class FeatureSpaceTime : public Object { 00106 public: 00107 FeatureSpaceTime(); 00108 ~FeatureSpaceTime(); 00109 FeatureSpaceTime(JString xml); 00110 FeatureSpaceTime(XMLNode* node); 00111 00112 Object* clone() const; 00113 00114 JString print(); 00115 JString toXML(); 00116 bool fromXML(XMLNode* node); 00117 }; 00118 00119 } // namespace cmlabs 00120 00121 00122 #endif // _IMAGESPACES_H_ 00123