00001 /* 00002 This file is part of geometria. 00003 00004 geometria is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published 00006 by the Free Software Foundation; either version 2 of the License, 00007 or (at your option) any later version. 00008 00009 geometria is distributed in the hope that it will be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00011 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 00012 License for more details. 00013 00014 You should have received a copy of the GNU General Public 00015 License along with geometria; if not, write to the Free Software 00016 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 00017 00018 (c) Philipp Moritz, 2006 00019 */ 00020 00021 #ifndef KERNEL_FASSADE_HPP 00022 #define KERNEL_FASSADE_HPP 00023 00024 #include <list> 00025 #include "geo_line.hpp" 00026 #include "geo_point.hpp" 00027 #include <boost/shared_ptr.hpp> 00028 #include "../ui/drawing_context.hpp" 00029 00030 typedef boost::shared_ptr<geo_point> geo_point_ref; 00031 typedef boost::shared_ptr<geo_line> geo_line_ref; 00032 00036 class kernel_fassade 00037 { 00038 private: 00039 std::list<boost::shared_ptr<geo_point> > m_points; 00040 std::list<boost::shared_ptr<geo_line> > m_lines; 00041 public: 00042 kernel_fassade(); 00043 ~kernel_fassade(); 00044 void add_point(geo_point_ref point); 00045 void add_line(geo_line_ref line); 00046 00047 void draw_all(boost::shared_ptr<drawing_context> context); 00048 00049 static kernel_fassade& get_instance(); 00050 00051 geo_point_ref get_point_at(double x, double y); 00052 }; 00053 00054 #endif