Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

CSymbol.h

Go to the documentation of this file.
00001 /* Copyright (C) 2004 Catherine Proulx
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 _CSYMBOL_
00018 #define _CSYMBOL_
00019 
00020 #include <list>
00021 #include "Object.h"
00022 #include "CRect.h"
00023 #include <vector>
00024 
00025 namespace RobotFlow {
00026 
00027 /** CSymbol.
00028 
00029     A CSymbol is an object describing a letter extracted from an image.
00030 
00031     @author  Catherine Proulx
00032     @version $Revision: 1.4 $
00033 */
00034 class CSymbol : public FD::Object {
00035 
00036    public:
00037 
00038    CSymbol();
00039    CSymbol(int symbolDescriptor, int centerX, int centerY, int width, int height);
00040    CSymbol(int symbolDescriptor, int centerX, int centerY, int width, int height, std::vector<float> &nnet_output);
00041    CSymbol(const CSymbol & initSymbol);
00042    virtual ~CSymbol();
00043 
00044    void SetSymbol(int symbolDescriptor, int centerX, int centerY, int width, int height);
00045    void GetSymbolName(std::string & resultString) const;
00046 
00047    void printOn(std::ostream &out = std::cout) const;
00048 
00049    // Inline get functions
00050    int GetCenterX() const {return mCenterX;}
00051    int GetCenterY() const {return mCenterY;}
00052    int GetHeight()  const {return mHeight;}
00053    int GetWidth()   const {return mWidth;}
00054    int GetSymbol()  const {return mSymbolDescriptor;}
00055    std::vector<float> GetNetVector() const {return mNetOutput;}
00056 
00057  private:
00058   // numerical ID of the symbol
00059   int mSymbolDescriptor;
00060 
00061   // Coordinates of the geometrical center of the letter (not center of gravity)
00062   int mCenterX;
00063   int mCenterY;
00064 
00065   // Height and width of the symbol (in pixels)
00066   int mHeight;
00067   int mWidth;
00068 
00069   std::vector<float> mNetOutput;
00070  
00071 };
00072 
00073 }//namespace RobotFlow
00074 #endif

Generated on Wed Oct 5 14:36:12 2005 for RobotFlow by  doxygen 1.4.4