00001 /*!@file Beobot/Node.H basic node in a graph class */ 00002 00003 // //////////////////////////////////////////////////////////////////// // 00004 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2001 by the // 00005 // University of Southern California (USC) and the iLab at USC. // 00006 // See http://iLab.usc.edu for information about this project. // 00007 // //////////////////////////////////////////////////////////////////// // 00008 // Major portions of the iLab Neuromorphic Vision Toolkit are protected // 00009 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency // 00010 // in Visual Environments, and Applications'' by Christof Koch and // 00011 // Laurent Itti, California Institute of Technology, 2001 (patent // 00012 // pending; application number 09/912,225 filed July 23, 2001; see // 00013 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status). // 00014 // //////////////////////////////////////////////////////////////////// // 00015 // This file is part of the iLab Neuromorphic Vision C++ Toolkit. // 00016 // // 00017 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can // 00018 // redistribute it and/or modify it under the terms of the GNU General // 00019 // Public License as published by the Free Software Foundation; either // 00020 // version 2 of the License, or (at your option) any later version. // 00021 // // 00022 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope // 00023 // that it will be useful, but WITHOUT ANY WARRANTY; without even the // 00024 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // 00025 // PURPOSE. See the GNU General Public License for more details. // 00026 // // 00027 // You should have received a copy of the GNU General Public License // 00028 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write // 00029 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, // 00030 // Boston, MA 02111-1307 USA. // 00031 // //////////////////////////////////////////////////////////////////// // 00032 // 00033 // Primary maintainer for this file: Christian Siagian <siagian@usc.edu> 00034 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Beobot/Node.H $ 00035 // $Id $ 00036 // 00037 00038 #ifndef BEOBOT_NODE_H_DEFINED 00039 #define BEOBOT_NODE_H_DEFINED 00040 00041 #include "Image/Point2D.H" 00042 //#include "Beobot/Edge.H" 00043 #include "rutz/shared_ptr.h" 00044 #include <string> 00045 #include <vector> 00046 00047 class Node; 00048 class Edge; 00049 00050 //! basic node in a graph class 00051 //! the Point2D<int> location is only for display purposes, it is not necessary 00052 //! to enter it (unless we want to draw the graph image) 00053 class Node 00054 { 00055 public: 00056 // ###################################################################### 00057 //! @name Constructor, assigment and destructor 00058 //@{ 00059 00060 //! Constructor: generate a node with coordinates and label 00061 Node(uint index, 00062 const Point2D<int> point = Point2D<int>(-1,-1), 00063 const std::string label = std::string("")); 00064 00065 //! Destructor 00066 ~Node(); 00067 00068 //! inline get the index 00069 inline uint getIndex(); 00070 00071 //! inline get the index 00072 inline void setIndex(int index); 00073 00074 //! get the Point2D<int> location for printing/display 00075 inline Point2D<int> getCoordinate(); 00076 00077 //! set the Point2D<int> location for printing/display 00078 inline void setCoordinate(Point2D<int> coor); 00079 00080 //! get the label for printing/display 00081 inline std::string getLabel(); 00082 00083 //! set the label for printing/display 00084 inline void setLabel(std::string label); 00085 00086 // //! set edge in 00087 // inline void setEdgeIn(std::vector<rutz::shared_ptr<Edge> > edgeIn); 00088 00089 // //! set edge out 00090 // inline void setEdgeOut(std::vector<rutz::shared_ptr<Edge> > edgeOut); 00091 00092 //@} 00093 00094 private: 00095 00096 //! its index - the one thing that matter 00097 uint itsIndex; 00098 00099 //! points and label for display 00100 Point2D<int> itsCoor; 00101 std::string itsLabel; 00102 00103 // std::vector<rutz::shared_ptr<Edge> > itsEdgeIn; 00104 //std::vector<rutz::shared_ptr<Edge> > itsEdgeOut; 00105 }; 00106 00107 // ###################################################################### 00108 // Implementation for Node inline functions 00109 // ###################################################################### 00110 inline uint Node::getIndex() 00111 { 00112 return itsIndex; 00113 } 00114 00115 inline void Node::setIndex(int index) 00116 { 00117 itsIndex = index; 00118 } 00119 00120 inline Point2D<int> Node::getCoordinate() 00121 { 00122 return itsCoor; 00123 } 00124 00125 inline void Node::setCoordinate(Point2D<int> coor) 00126 { 00127 itsCoor = coor; 00128 } 00129 00130 inline std::string Node::getLabel() 00131 { 00132 return itsLabel; 00133 } 00134 00135 inline void Node::setLabel(std::string label) 00136 { 00137 itsLabel = label; 00138 } 00139 00140 // inline void Node::setEdgeIn(std::vector<rutz::shared_ptr<Edge> > edgeIn) 00141 // { 00142 // itsEdgeIn.clear(); 00143 // for(uint i = 0; i < edgeIn.size(); i++) 00144 // itsEdgeIn.push_back(edgeIn[i]); 00145 // } 00146 00147 // inline void Node::setEdgeOut(std::vector<rutz::shared_ptr<Edge> > edgeOut) 00148 // { 00149 // itsEdgeOut.clear(); 00150 // for(uint i = 0; i < edgeOut.size(); i++) 00151 // itsEdgeOut.push_back(edgeOut[i]); 00152 // } 00153 #endif 00154 00155 // ###################################################################### 00156 /* So things look consistent in everyone's emacs... */ 00157 /* Local Variables: */ 00158 /* indent-tabs-mode: nil */ 00159 /* End: */