00001 // **************************************************************************** 00002 // Filename: FeatureEntry.h 00003 // Author: Pedram Azad 00004 // Date: 2005 00005 // **************************************************************************** 00006 00007 00008 #ifndef _TEXTURED_FEATURE_SET_H_ 00009 #define _TEXTURED_FEATURE_SET_H_ 00010 00011 00012 // **************************************************************************** 00013 // Necessary includes 00014 // **************************************************************************** 00015 00016 #include "Features/FeatureEntry.h" 00017 #include "Math/Math2d.h" 00018 #include "Math/Math3d.h" 00019 #include <string> 00020 00021 00022 // **************************************************************************** 00023 // Forward declarations 00024 // **************************************************************************** 00025 00026 class CDynamicArray; 00027 class CByteImage; 00028 00029 00030 00031 // **************************************************************************** 00032 // CTexturedFeatureSet 00033 // **************************************************************************** 00034 00039 class CTexturedFeatureSet : public CDynamicArrayElement 00040 { 00041 public: 00042 // constructor 00043 CTexturedFeatureSet(const char *pName); 00044 00045 // CTexturedFeatureSet 00046 ~CTexturedFeatureSet(); 00047 00048 00049 // public methods 00050 bool AddFeature(CFeatureEntry *pFeatureEntry, bool bAddUniqueOnly = true); 00051 const CFeatureEntry* GetFeature(int nIndex) const; 00052 const CFeatureEntry* FindBestMatch(const CFeatureEntry *pFeature, float &error) const; 00053 void Clear(); 00054 bool DeleteElement(int nElement); 00055 int DeleteAllMatches(const CFeatureEntry *pElement); 00056 void SetCornerPoints(Vec2d &point1, Vec2d &point2, Vec2d &point3, Vec2d &point4); 00057 void SetCornerPoints3D(Vec3d &point1, Vec3d &point2, Vec3d &point3, Vec3d &point4); 00058 00059 int GetSize() const; 00060 const char* GetName() const { return m_sName.c_str(); } 00061 const char* GetModelFilePath() const { return m_sOivFilePath.c_str(); } 00062 00063 bool SaveToFile(const char *pFileName); 00064 bool LoadFromFile(const char *pFileName); 00065 void SetModelFilePath(const char *pFilePath); 00066 00067 00068 private: 00069 // private attribute 00070 CDynamicArray *m_pFeatureArray; 00071 00072 std::string m_sName; 00073 std::string m_sOivFilePath; 00074 00075 public: 00076 Vec2d m_point1; 00077 Vec2d m_point2; 00078 Vec2d m_point3; 00079 Vec2d m_point4; 00080 Vec2d m_center; 00081 00082 Vec3d m_3dPoint1; 00083 Vec3d m_3dPoint2; 00084 Vec3d m_3dPoint3; 00085 Vec3d m_3dPoint4; 00086 }; 00087 00088 00089 00090 #endif /* _TEXTURED_FEATURE_SET_H_ */