00001 /* Copyright (C) 2002 Dominic Letourneau (dominic.letourneau@usherbrooke.ca) 00002 00003 This library is free software; you can redistribute it and/or 00004 modify it under the terms of the GNU Lesser General Public 00005 License as published by the Free Software Foundation; either 00006 version 2.1 of the License, or (at your option) any later version. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Lesser General Public License for more details. 00012 00013 You should have received a copy of the GNU Lesser General Public 00014 License along with this library; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 */ 00017 #ifndef _COMPONENTS_DATA_H_ 00018 #define _COMPONENTS_DATA_H_ 00019 00020 #include "Object.h" 00021 #include "CRect.h" 00022 #include "Components.h" 00023 00024 namespace RobotFlow { 00025 00026 class ComponentsData : public FD::Object { 00027 00028 public: 00029 00030 ComponentsData(); 00031 00032 ComponentsData(int imageWidth, int imageHeight); 00033 00034 ComponentsData(Components &comp, int imageWidth, int imageHeight); 00035 00036 virtual ~ComponentsData(); 00037 00038 void printOn(std::ostream &out = std::cout) const; 00039 00040 void reset(); 00041 00042 void readFrom(std::istream &in); 00043 00044 int get_component_count(); 00045 00046 std::list<CRect*> & get_color_components(int color); 00047 00048 std::list<CRect*> & operator[] (int pos); 00049 00050 int getWidth(){return m_imageWidth;} 00051 00052 int getHeight(){return m_imageHeight;} 00053 00054 void setWidth(int width){m_imageWidth = width;} 00055 00056 void setHeight(int height){m_imageHeight = height;} 00057 00058 private: 00059 00060 std::list<CRect*> m_components[MAX_COLOR]; 00061 00062 bool m_initialized; 00063 00064 int m_imageWidth; 00065 00066 int m_imageHeight; 00067 00068 }; 00069 00070 }//namespace RobotFlow 00071 00072 #endif