estar/Sprite.hpp

Go to the documentation of this file.
00001 /* 
00002  * Copyright (C) 2006
00003  * Swiss Federal Institute of Technology, Zurich. All rights reserved.
00004  * 
00005  * Author: Roland Philippsen <roland dot philippsen at gmx net>
00006  *         Autonomous Systems Lab <http://www.asl.ethz.ch/>
00007  * 
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  * 
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  * 
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021  * USA
00022  */
00023 
00024 
00025 #ifndef ESTAR_SPRITE_HPP
00026 #define ESTAR_SPRITE_HPP
00027 
00028 
00029 #include <vector>
00030 #include <iosfwd>
00031 
00032 
00033 namespace estar {
00034   
00035   
00042   class Sprite
00043   {
00044   public:
00046     class sindex {
00047     public:
00048       sindex(ssize_t _x, ssize_t _y, double _r): x(_x), y(_y), r(_r) { }
00049       ssize_t x, y;
00050       double r;
00051     };
00052     
00053     typedef std::vector<sindex> indexlist_t;
00054     
00055     const double radius;
00056     const double scale;
00057     
00058     Sprite(double radius, double scale);
00059     
00060     void Dump(std::ostream & os) const;
00061     
00062     const indexlist_t & GetBorder() const { return m_border; }
00063     const indexlist_t & GetArea() const { return m_area; }
00064     
00065     void GetBBox(ssize_t & x0, ssize_t & y0, ssize_t & x1, ssize_t & y1) const;
00066     
00067   private:
00068     indexlist_t m_border;
00069     indexlist_t m_area;
00070     ssize_t m_x0, m_y0, m_x1, m_y1;
00071   };
00072   
00073 }
00074 
00075 #endif // ESTAR_SPRITE_HPP

doxygen SourceForge.net Logo
E* Interpolated Graph Replanner Wed Dec 12 18:55:40 2007