00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <iostream>
00022 #include "kernel/point.hpp"
00023 #include "kernel/line.hpp"
00024
00025 #include "kernel/geo_point.hpp"
00026 #include "kernel/point_algorithm.hpp"
00027 #include "kernel/free_point_algorithm.hpp"
00028
00029 #include "kernel/geo_line.hpp"
00030 #include "kernel/line_algorithm.hpp"
00031 #include "kernel/line_join_algorithm.hpp"
00032 #include "kernel/lines_meet_algorithm.hpp"
00033
00034 #include "kernel/kernel_fassade.hpp"
00035
00036 #include <boost/shared_ptr.hpp>
00037
00038
00039 #include <QtGui/QApplication>
00040 #include "ui/main_window.hpp"
00041
00042 int main(int argc, char** argv)
00043 {
00044 QApplication app(argc, argv);
00045 main_window window;
00046 window.show();
00047
00048 boost::shared_ptr<point_algorithm> algo(new free_point_algorithm(1.0, 4.5));
00049 geo_point_ref p(new geo_point("p", algo));
00050 kernel_fassade::get_instance().add_point(p);
00051
00052 boost::shared_ptr<point_algorithm> algo2(new free_point_algorithm(5.0, 6.5));
00053 geo_point_ref q(new geo_point("q", algo2));
00054 kernel_fassade::get_instance().add_point(q);
00055
00056 boost::shared_ptr<point_algorithm> algo3(new free_point_algorithm(5.0, 3.0));
00057 geo_point_ref p2(new geo_point("p2", algo3));
00058 kernel_fassade::get_instance().add_point(p2);
00059
00060 boost::shared_ptr<point_algorithm> algo4(new free_point_algorithm(1.0, 3.5));
00061 geo_point_ref q2(new geo_point("q2", algo4));
00062 kernel_fassade::get_instance().add_point(q2);
00063
00064 boost::shared_ptr<line_algorithm> line_algo( new
00065 line_join_algorithm(p, q));
00066 geo_line_ref l(new geo_line("l", line_algo));
00067 kernel_fassade::get_instance().add_line(l);
00068
00069 boost::shared_ptr<line_algorithm> line_algo2( new line_join_algorithm(p2, q2));
00070 geo_line_ref l2(new geo_line("l2", line_algo2));
00071 kernel_fassade::get_instance().add_line(l2);
00072
00073 boost::shared_ptr<point_algorithm> point_algo( new lines_meet_algorithm(l, l2));
00074 geo_point_ref p3(new geo_point("p3", point_algo));
00075 kernel_fassade::get_instance().add_point(p3);
00076
00077 std::cout << *p;
00078 std::cout << *l;
00079 std::cout << *p3;
00080
00081 boost::shared_ptr<point_algorithm> new_algo(new free_point_algorithm(10.0, 12.0));
00082
00083
00084 std::cout << *p;
00085 std::cout << *l;
00086 std::cout << *p3;
00087 std::cout << *p3;
00088
00089
00090 std::cin.get();
00091 return app.exec();
00092 }
00093
00102
00103
00104
00107
00110