Go to the documentation of this file.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_poly_set_2d_sptr.h>
00032 #include <vsol/vsol_digital_curve_2d_sptr.h>
00033
00034 #include <vgui/vgui_soview2D.h>
00035
00036
00037 class bgui_vsol_soview2D : public vgui_soview2D
00038 {
00039 public:
00040
00041 bgui_vsol_soview2D( vsol_spatial_object_2d_sptr const & pt);
00042
00043
00044 ~bgui_vsol_soview2D() {}
00045
00046
00047 vcl_ostream& print(vcl_ostream&) const;
00048
00049
00050 virtual vcl_string type_name() const=0;
00051
00052
00053 virtual void draw() const=0;
00054
00055 vsol_spatial_object_2d_sptr base_sptr() const { return sptr_; }
00056
00057
00058 virtual void translate(float x, float y)=0;
00059
00060 protected:
00061
00062 vsol_spatial_object_2d_sptr sptr_;
00063 };
00064
00065
00066 class bgui_vsol_soview2D_point : public bgui_vsol_soview2D
00067 {
00068 public:
00069
00070 bgui_vsol_soview2D_point( vsol_point_2d_sptr const & pt);
00071
00072 ~bgui_vsol_soview2D_point() {}
00073
00074
00075 static vcl_string type_name_() { return "bgui_vsol_soview2D_point"; }
00076 vcl_string type_name() const { return type_name_(); }
00077
00078
00079 void draw() const;
00080
00081
00082 vsol_point_2d_sptr sptr() const;
00083
00084
00085 virtual float distance_squared(float x, float y) const;
00086
00087
00088 void get_centroid(float* x, float* y) const;
00089
00090
00091 void translate(float x, float y);
00092 };
00093
00094
00095
00096 class bgui_vsol_soview2D_line_seg : public bgui_vsol_soview2D
00097 {
00098 public:
00099
00100 bgui_vsol_soview2D_line_seg( vsol_line_2d_sptr const & line);
00101
00102
00103 ~bgui_vsol_soview2D_line_seg() {}
00104
00105
00106 static vcl_string type_name_() { return "bgui_vsol_soview2D_line_seg"; }
00107 vcl_string type_name() const { return type_name_(); }
00108
00109
00110 virtual void draw() const;
00111
00112
00113
00114 vsol_line_2d_sptr sptr() const;
00115
00116
00117 virtual float distance_squared(float x, float y) const;
00118
00119
00120 void get_centroid(float* x, float* y) const;
00121
00122
00123 virtual void translate(float x, float y);
00124 };
00125
00126
00127
00128
00129 class bgui_vsol_soview2D_conic_seg : public bgui_vsol_soview2D
00130 {
00131 public:
00132
00133 bgui_vsol_soview2D_conic_seg( vsol_conic_2d_sptr const & conic);
00134
00135
00136 ~bgui_vsol_soview2D_conic_seg() {}
00137
00138
00139 static vcl_string type_name_() { return "bgui_vsol_soview2D_conic_seg"; }
00140 vcl_string type_name() const { return type_name_(); }
00141
00142
00143 virtual void draw() const;
00144
00145
00146
00147 vsol_conic_2d_sptr sptr() const;
00148
00149
00150 virtual float distance_squared(float x, float y) const;
00151
00152
00153 void get_centroid(float* x, float* y) const;
00154
00155
00156 virtual void translate(float x, float y);
00157
00158 protected:
00159
00160 double xc_, yc_;
00161
00162 double major_axis_;
00163
00164 double minor_axis_;
00165
00166 double angle_;
00167
00168 double start_angle_;
00169
00170 double end_angle_;
00171 };
00172
00173
00174
00175 class bgui_vsol_soview2D_polyline : public bgui_vsol_soview2D
00176 {
00177 public:
00178
00179 bgui_vsol_soview2D_polyline(vsol_polyline_2d_sptr const& pline);
00180
00181
00182 ~bgui_vsol_soview2D_polyline() {}
00183
00184
00185 static vcl_string type_name_() { return "bgui_vsol_soview2D_polyline"; }
00186 vcl_string type_name() const { return type_name_(); }
00187
00188
00189 void draw() const;
00190
00191
00192
00193 vsol_polyline_2d_sptr sptr() const;
00194
00195
00196 virtual float distance_squared(float x, float y) const;
00197
00198
00199 void get_centroid(float* x, float* y) const;
00200
00201
00202 void translate(float x, float y);
00203 };
00204
00205
00206
00207 class bgui_vsol_soview2D_polygon : public bgui_vsol_soview2D
00208 {
00209 public:
00210
00211 bgui_vsol_soview2D_polygon(vsol_polygon_2d_sptr const& e);
00212
00213
00214 ~bgui_vsol_soview2D_polygon() {}
00215
00216
00217 static vcl_string type_name_() { return "bgui_vsol_soview2D_polygon"; }
00218 vcl_string type_name() const { return type_name_(); }
00219
00220
00221
00222 vsol_polygon_2d_sptr sptr() const;
00223
00224
00225 void draw() const;
00226
00227
00228 virtual float distance_squared(float x, float y) const;
00229
00230
00231 void get_centroid(float* x, float* y) const;
00232
00233
00234 void translate(float x, float y);
00235 };
00236
00237
00238 class bgui_vsol_soview2D_polygon_set : public bgui_vsol_soview2D
00239 {
00240 public:
00241
00242 bgui_vsol_soview2D_polygon_set(vsol_poly_set_2d_sptr const& e);
00243
00244
00245 ~bgui_vsol_soview2D_polygon_set() {}
00246
00247
00248 static vcl_string type_name_() { return "bgui_vsol_soview2D_polygon_set"; }
00249 vcl_string type_name() const { return type_name_(); }
00250
00251
00252
00253 vsol_poly_set_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
00268
00269 class bgui_vsol_soview2D_digital_curve : public bgui_vsol_soview2D
00270 {
00271 public:
00272
00273 bgui_vsol_soview2D_digital_curve(vsol_digital_curve_2d_sptr const& dc, bool dotted = false);
00274
00275
00276 ~bgui_vsol_soview2D_digital_curve() {}
00277
00278
00279 static vcl_string type_name_() { return "bgui_vsol_soview2D_digital_curve"; }
00280 vcl_string type_name() const { return type_name_(); }
00281
00282
00283
00284 vsol_digital_curve_2d_sptr sptr() const;
00285
00286
00287 void draw() const;
00288
00289
00290 virtual float distance_squared(float x, float y) const;
00291
00292
00293 void get_centroid(float* x, float* y) const;
00294
00295
00296 void translate(float x, float y);
00297
00298 protected:
00299
00300 bool draw_dotted_;
00301 };
00302
00303
00304
00305 class bgui_vsol_soview2D_edgel_curve : public bgui_vsol_soview2D
00306 {
00307 public:
00308
00309 bgui_vsol_soview2D_edgel_curve(vdgl_digital_curve_sptr const& e, bool dotted = false);
00310
00311
00312 ~bgui_vsol_soview2D_edgel_curve() {}
00313
00314
00315 static vcl_string type_name_() { return "bgui_vsol_soview2D_edgel_curve"; }
00316 vcl_string type_name() const { return type_name_(); }
00317
00318
00319
00320 vdgl_digital_curve_sptr sptr() const;
00321
00322
00323 void draw() const;
00324
00325
00326 virtual float distance_squared(float x, float y) const;
00327
00328
00329 void get_centroid(float* x, float* y) const;
00330
00331
00332 void translate(float x, float y);
00333
00334 protected:
00335 bool draw_dotted_;
00336 };
00337
00338
00339 #endif // bgui_vsol_soview2D_h_