cartesian_objects.h
Go to the documentation of this file.00001 #ifndef CARTESIAN_OBJECTS_GROUP
00002 #define CARTESIAN_OBJECTS_GROUP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "angle.h"
00019 #include "line.h"
00020 #include "point.h"
00021 #include "rectangle.h"
00022
00023 namespace geometric {
00024
00026
00027 class cartesian_point : public point<double>
00028 {
00029 public:
00030 cartesian_point(double x = 0, double y = 0) : point<double>(x, y) {}
00031 cartesian_point(double r, double_angle theta) : point<double>(r, theta) {}
00032 cartesian_point(const point<double> &to_copy) : point<double>(to_copy) {}
00033 DEFINE_CLASS_NAME("cartesian_point");
00034
00035 static cartesian_point origin() { return cartesian_point(0.0, 0.0); }
00037 };
00038
00040
00042
00043 class cartesian_line : public line<double>
00044 {
00045 public:
00046 cartesian_line(const cartesian_point &endpoint_1,
00047 const cartesian_point &endpoint_2)
00048 : line<double>(endpoint_1, endpoint_2) {}
00049 cartesian_line(double x_1 = 0, double y_1 = 0,
00050 double x_2 = 0, double y_2 = 0)
00051 : line<double>(x_1, y_1, x_2, y_2) {}
00052 };
00053
00055
00057
00058 class cartesian_rectangle : public rectangle<double>
00059 {
00060 public:
00061 cartesian_rectangle(const cartesian_point &vertex_1,
00062 const cartesian_point &vertex_2)
00063 : rectangle<double>(vertex_1, vertex_2) {}
00064 cartesian_rectangle(double x_1 = 0, double y_1 = 0,
00065 double x_2 = 0, double y_2 = 0)
00066 : rectangle<double>(x_1, y_1, x_2, y_2) {}
00067 cartesian_rectangle(const rectangle<double> &rect)
00068 : rectangle<double>(rect) {}
00069 };
00070
00071 }
00072
00073 #endif
00074