00001 /* Copyright (C) 2005 Pierre Moisan (Pierre.Moisan@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 00018 #ifndef _PFGENERICPARTICLE_H_ 00019 #define _PFGENERICPARTICLE_H_ 00020 00021 #include "PFParticle.h" 00022 #include <iostream> 00023 00024 namespace RobotFlow { 00025 00026 class PFGenericParticle : public PFParticle 00027 { 00028 public: 00029 PFGenericParticle(); 00030 00031 PFGenericParticle(unsigned int i_stateSize); 00032 00033 PFGenericParticle(const PFGenericParticle &i_ref); 00034 00035 virtual ~PFGenericParticle(); 00036 00037 virtual PFGenericParticle & operator =(const PFGenericParticle &i_ref); 00038 00039 virtual PFGenericParticle* clone() const; 00040 00041 // Default routine to print a PFGenericParticle object to an output stream 00042 virtual void printOn(std::ostream &out) const; 00043 00044 // Default routine to read a PFGenericParticle object from an input stream 00045 virtual void readFrom(std::istream &in); 00046 00047 virtual unsigned int GetStateSize() const; 00048 00049 virtual float *GetState(); 00050 00051 virtual float GetStateIdx(int i_idx) const; 00052 00053 virtual const float *GetCstState() const; 00054 00055 virtual float GetWeight() const; 00056 00057 virtual void SetStateSize(unsigned int i_size); 00058 00059 virtual void SetState(const float *i_state); 00060 00061 virtual void SetStateIdx(int i_idx, float i_val); 00062 00063 virtual void SetWeight(float i_weight); 00064 00065 private: 00066 int m_stateSize; 00067 float *m_state; 00068 float m_weight; 00069 }; 00070 00071 } 00072 00073 #endif