00001
00002 #ifndef bgui_vsol_soview2D_h_
00003 #define bgui_vsol_soview2D_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <vcl_iosfwd.h>
00024 #include <vdgl/vdgl_digital_curve_sptr.h>
00025 #include <vsol/vsol_spatial_object_2d_sptr.h>
00026 #include <vsol/vsol_line_2d_sptr.h>
00027 #include <vsol/vsol_conic_2d_sptr.h>
00028 #include <vsol/vsol_point_2d_sptr.h>
00029 #include <vsol/vsol_polyline_2d_sptr.h>
00030 #include <vsol/vsol_polygon_2d_sptr.h>
00031 #include <vsol/vsol_digital_curve_2d_sptr.h>
00032
00033 #include <vgui/vgui_soview2D.h>
00034
00035
00036 class bgui_vsol_soview2D : public vgui_soview2D
00037 {
00038 public:
00039
00040 bgui_vsol_soview2D( vsol_spatial_object_2d_sptr const & pt);
00041
00042
00043 ~bgui_vsol_soview2D() {}
00044
00045
00046 vcl_ostream& print(vcl_ostream&) const;
00047
00048
00049 virtual vcl_string type_name() const=0;
00050
00051
00052 virtual void draw() const=0;
00053
00054 vsol_spatial_object_2d_sptr base_sptr() const { return sptr_; }
00055
00056
00057 virtual void translate(float x, float y)=0;
00058
00059 protected:
00060
00061 vsol_spatial_object_2d_sptr sptr_;
00062 };
00063
00064
00065 class bgui_vsol_soview2D_point : public bgui_vsol_soview2D
00066 {
00067 public:
00068
00069 bgui_vsol_soview2D_point( vsol_point_2d_sptr const & pt);
00070
00071 ~bgui_vsol_soview2D_point() {}
00072
00073
00074 static vcl_string type_name_() { return "bgui_vsol_soview2D_point"; }
00075 vcl_string type_name() const { return type_name_(); }
00076
00077
00078 void draw() const;
00079
00080
00081 vsol_point_2d_sptr sptr() const;
00082
00083
00084 virtual float distance_squared(float x, float y) const;
00085
00086
00087 void get_centroid(float* x, float* y) const;
00088
00089
00090 void translate(float x, float y);
00091 };
00092
00093
00094
00095 class bgui_vsol_soview2D_line_seg : public bgui_vsol_soview2D
00096 {
00097 public:
00098
00099 bgui_vsol_soview2D_line_seg( vsol_line_2d_sptr const & line);
00100
00101
00102 ~bgui_vsol_soview2D_line_seg() {}
00103
00104
00105 static vcl_string type_name_() { return "bgui_vsol_soview2D_line_seg"; }
00106 vcl_string type_name() const { return type_name_(); }
00107
00108
00109 virtual void draw() const;
00110
00111
00112
00113 vsol_line_2d_sptr sptr() const;
00114
00115
00116 virtual float distance_squared(float x, float y) const;
00117
00118
00119 void get_centroid(float* x, float* y) const;
00120
00121
00122 virtual void translate(float x, float y);
00123 };
00124
00125
00126
00127
00128 class bgui_vsol_soview2D_conic_seg : public bgui_vsol_soview2D
00129 {
00130 public:
00131
00132 bgui_vsol_soview2D_conic_seg( vsol_conic_2d_sptr const & conic);
00133
00134
00135 ~bgui_vsol_soview2D_conic_seg() {}
00136
00137
00138 static vcl_string type_name_() { return "bgui_vsol_soview2D_conic_seg"; }
00139 vcl_string type_name() const { return type_name_(); }
00140
00141
00142 virtual void draw() const;
00143
00144
00145
00146 vsol_conic_2d_sptr sptr() const;
00147
00148
00149 virtual float distance_squared(float x, float y) const;
00150
00151
00152 void get_centroid(float* x, float* y) const;
00153
00154
00155 virtual void translate(float x, float y);
00156
00157 protected:
00158
00159 double xc_, yc_;
00160
00161 double major_axis_;
00162
00163 double minor_axis_;
00164
00165 double angle_;
00166
00167 double start_angle_;
00168
00169 double end_angle_;
00170 };
00171
00172
00173
00174 class bgui_vsol_soview2D_polyline : public bgui_vsol_soview2D
00175 {
00176 public:
00177
00178 bgui_vsol_soview2D_polyline(vsol_polyline_2d_sptr const& pline);
00179
00180
00181 ~bgui_vsol_soview2D_polyline() {}
00182
00183
00184 static vcl_string type_name_() { return "bgui_vsol_soview2D_polyline"; }
00185 vcl_string type_name() const { return type_name_(); }
00186
00187
00188 void draw() const;
00189
00190
00191
00192 vsol_polyline_2d_sptr sptr() const;
00193
00194
00195 virtual float distance_squared(float x, float y) const;
00196
00197
00198 void get_centroid(float* x, float* y) const;
00199
00200
00201 void translate(float x, float y);
00202 };
00203
00204
00205
00206 class bgui_vsol_soview2D_polygon : public bgui_vsol_soview2D
00207 {
00208 public:
00209
00210 bgui_vsol_soview2D_polygon(vsol_polygon_2d_sptr const& e);
00211
00212
00213 ~bgui_vsol_soview2D_polygon() {}
00214
00215
00216 static vcl_string type_name_() { return "bgui_vsol_soview2D_polygon"; }
00217 vcl_string type_name() const { return type_name_(); }
00218
00219
00220
00221 vsol_polygon_2d_sptr sptr() const;
00222
00223
00224 void draw() const;
00225
00226
00227 virtual float distance_squared(float x, float y) const;
00228
00229
00230 void get_centroid(float* x, float* y) const;
00231
00232
00233 void translate(float x, float y);
00234 };
00235
00236
00237
00238 class bgui_vsol_soview2D_digital_curve : public bgui_vsol_soview2D
00239 {
00240 public:
00241
00242 bgui_vsol_soview2D_digital_curve(vsol_digital_curve_2d_sptr const& dc, bool dotted = false);
00243
00244
00245 ~bgui_vsol_soview2D_digital_curve() {}
00246
00247
00248 static vcl_string type_name_() { return "bgui_vsol_soview2D_digital_curve"; }
00249 vcl_string type_name() const { return type_name_(); }
00250
00251
00252
00253 vsol_digital_curve_2d_sptr sptr() const;
00254
00255
00256 void draw() const;
00257
00258
00259 virtual float distance_squared(float x, float y) const;
00260
00261
00262 void get_centroid(float* x, float* y) const;
00263
00264
00265 void translate(float x, float y);
00266
00267 protected:
00268
00269 bool draw_dotted_;
00270 };
00271
00272
00273
00274 class bgui_vsol_soview2D_edgel_curve : public bgui_vsol_soview2D
00275 {
00276 public:
00277
00278 bgui_vsol_soview2D_edgel_curve(vdgl_digital_curve_sptr const& e, bool dotted = false);
00279
00280
00281 ~bgui_vsol_soview2D_edgel_curve() {}
00282
00283
00284 static vcl_string type_name_() { return "bgui_vsol_soview2D_edgel_curve"; }
00285 vcl_string type_name() const { return type_name_(); }
00286
00287
00288
00289 vdgl_digital_curve_sptr sptr() const;
00290
00291
00292 void draw() const;
00293
00294
00295 virtual float distance_squared(float x, float y) const;
00296
00297
00298 void get_centroid(float* x, float* y) const;
00299
00300
00301 void translate(float x, float y);
00302
00303 protected:
00304 bool draw_dotted_;
00305 };
00306
00307
00308
00309 #endif // bgui_vsol_soview2D_h_