Go to the documentation of this file.00001 #ifndef vsol_cylinder_h_
00002 #define vsol_cylinder_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <vgl/vgl_cylinder.h>
00021 #include <vsol/vsol_spatial_object_3d.h>
00022 #include <vsol/vsol_cylinder_sptr.h>
00023 #include <vsl/vsl_binary_io.h>
00024 #include <vcl_string.h>
00025 #include <vcl_iosfwd.h>
00026
00027 class vsol_cylinder : public vsol_spatial_object_3d
00028 {
00029 vgl_cylinder<double> cyl_;
00030
00031 public:
00032 vsol_cylinder() {}
00033
00034 vsol_cylinder(vgl_point_3d<double> centre, double radius, double length)
00035 : cyl_(centre, radius, length) {}
00036
00037 vsol_cylinder(vgl_point_3d<double> centre, double radius, double length,
00038 vgl_vector_3d<double> orient)
00039 : cyl_(centre, radius, length){ cyl_.set_orientation(orient); }
00040
00041
00042 vsol_cylinder(vsol_cylinder const& cyl)
00043 : vsol_spatial_object_3d(cyl), cyl_(cyl.cyl_) {}
00044
00045
00046 bool contains(vgl_point_3d<double> const& p);
00047
00048
00049 vgl_point_3d<double> center() { return cyl_.center(); }
00050 double radius() {return cyl_.radius(); }
00051 double length() {return cyl_.length(); }
00052 vgl_vector_3d<double> orientation() { return cyl_.orientation(); }
00053
00054
00055 void set_orientation(vgl_vector_3d<double> orient) {cyl_.set_orientation(orient);
00056 }
00057
00058 void set_center(vgl_point_3d<double> const & c) {cyl_.set_center(c);}
00059
00060 void set_length(double l) {cyl_.set_length(l);}
00061
00062 void set_radius(double r) {cyl_.set_radius(r);}
00063
00064
00065
00066 void b_write(vsl_b_ostream &os) const;
00067
00068
00069 void b_read(vsl_b_istream &is);
00070
00071
00072 short version() const;
00073
00074
00075 void print_summary(vcl_ostream &os) const;
00076
00077 void describe(vcl_ostream &strm, int blanking) const;
00078
00079
00080 vcl_string is_a() const { return vcl_string("vsol_cylinder"); }
00081
00082
00083 bool is_class(const vcl_string& cls) const { return cls == is_a(); }
00084
00085
00086 vsol_spatial_object_3d_type spatial_type() const { return vsol_spatial_object_3d::VOLUME; }
00087
00088 vsol_spatial_object_3d* clone() const { return new vsol_cylinder(*this); }
00089
00090 virtual ~vsol_cylinder(void) {}
00091 };
00092
00093
00094 void vsl_b_write(vsl_b_ostream &os, const vsol_cylinder* p);
00095
00096
00097 void vsl_b_write(vsl_b_istream &is, vsol_cylinder_sptr &p);
00098
00099
00100 void vsl_b_read(vsl_b_istream &is, vsol_cylinder* &p);
00101
00102
00103 void vsl_b_read(vsl_b_istream &is, vsol_cylinder_sptr &p);
00104
00105 #endif // vsol_cylinder_h_