OpenVideo Documentation

   Main Page       Modules       Class Hierarchy       Alphabetical List       Compound List       File List       Compound Members       Related Pages   

Node.cxx

Go to the documentation of this file.
00001 /* ========================================================================
00002  * Copyright (C) 2005  Graz University of Technology
00003  *
00004  * This framework is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This framework is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this framework; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  *
00018  * For further information please contact Denis Kalkofen under
00019  * <kalkofen@icg.tu-graz.ac.at> or write to Denis Kalkofen,
00020  * Graz University of Technology, Inffeldgasse 16a, A8010 Graz,
00021  * Austria.
00022  * ========================================================================
00023  * PROJECT: OpenVideo
00024  * ======================================================================== */
00033 #include <openvideo/Node.h>
00034 #include <openvideo/State.h>
00035 
00036 using namespace openvideo;
00037 
00038 // constructor
00039 Node::Node()
00040 {
00041     name="";
00042     curInDegree=0;
00043     curOutDegree=0;
00044     state=NULL;
00045     curPixelFormat=PIXEL_FORMAT(FORMAT_UNKNOWN);
00046 }
00047 
00048 // destructor
00049 
00050 Node::~Node()
00051 {
00052     if(state)
00053         delete state;
00054 }
00055 
00056 State* 
00057 Node::getState()
00058 {
00059     return state;
00060 }
00061 
00062 bool 
00063 Node::setParameter(std::string key, std::string value)
00064 {
00065     if(key=="name"){
00066         name=value;
00067         return true;
00068     }
00069     else if(key=="DEF"){
00070         defName=value;
00071         return true;
00072     }
00073     else if(key=="pixelformat"){
00074         curPixelFormat= PixelFormat::StringToFormat(value);
00075         return true;
00076     }
00077 
00078     
00079     return false;
00080 }
00081 
00082 bool 
00083 Node::validateCurrentPixelFormat()
00084 {
00085     for(int i=0;i<(int)pixelFormats.size();i++)
00086     {
00087         if(pixelFormats.at(i)==curPixelFormat)
00088             return true;
00089     }
00090 
00091     return false;
00092 }
00093 
00094 const char* 
00095 Node::getName()
00096 {
00097     return this->name.c_str();
00098 }
00099 
00100 void 
00101 Node::init()
00102 {
00103 }
00104 
00105 void 
00106 Node::start()
00107 {
00108 }
00109 
00110 void 
00111 Node::stop()
00112 {
00113 }
00114 
00115 void 
00116 Node::process()
00117 {
00118 }
00119 
00120 void 
00121 Node::postProcess( )
00122 {
00123 }
00124 
00125 void 
00126 Node::preProcess( )
00127 {
00128 }
00129 
00130 const char* 
00131 Node::getDefName()
00132 {
00133     return defName.c_str();
00134 }
00135 
00136 std::vector<Node*>* 
00137 Node::getOutputs()
00138 {
00139     return &(this->outputs);
00140 }
00141 
00142 std::vector<Node*>* 
00143 Node::getInputs()
00144 {
00145     return &(this->inputs);     
00146 }
00147 void 
00148 Node::addOutput( Node * output)
00149 {
00150     this->outputs.push_back(output);
00151     this->curOutDegree++;
00152 }
00153 
00154 void 
00155 Node::addInput( Node * inputs)
00156 {
00157     this->inputs.push_back(inputs);
00158     curInDegree++;
00159 }
00160 int 
00161 Node::getCurInDegree()
00162 {
00163     return curInDegree;
00164 }
00165 
00166 int 
00167 Node::getInDegree()
00168 {
00169     return (int)inputs.size();
00170 }
00171 
00172 int 
00173 Node::getOutDegree()
00174 {
00175     return (int)outputs.size();
00176 }
00177 
00178 int 
00179 Node::getCurOutDegree()
00180 {
00181     return this->curOutDegree;
00182 }
00183 
00184 void 
00185 Node::resetCurInOutDegree()
00186 {
00187     this->curInDegree=(int)inputs.size();
00188     this->curOutDegree=(int)outputs.size();
00189 }
00190 
00191 void 
00192 Node::decCurOutDegree()
00193 {
00194     this->curOutDegree--;
00195 }
00196 
00197 void
00198 Node::decCurInDegree()
00199 {
00200     this->curInDegree--;
00201 }
 This page was generated at Wed May 31 13:04:16 2006 for OpenVideo by Doxygen.
 If you have any comments, please send a message to schmalstieg@icg.tu-graz.ac.at.
www.studierstube.org