#include <vsol_conic_2d.h>
Inheritance diagram for vsol_conic_2d:

Definition at line 49 of file vsol_conic_2d.h.
Public Types | |
| enum | vsol_conic_type { invalid = 0, real_ellipse, real_circle, complex_ellipse, complex_circle, hyperbola, parabola, real_intersecting_lines, complex_intersecting_lines, real_parallel_lines, complex_parallel_lines, coincident_lines } |
| the different kinds of conic. More... | |
| enum | vsol_spatial_object_2d_type { SPATIAL_NO_TYPE = 0, TOPOLOGYOBJECT, POINT, CURVE, REGION, SPATIALGROUP, VOLUME, NUM_SPATIALOBJECT_TYPES } |
| enum | vgl_conic_type |
Public Member Functions | |
| vsol_conic_2d () | |
| Default Constructor. | |
| vsol_conic_2d (double a, double b, double c, double d, double e, double f) | |
| Constructor from coefficients of the cartesian equation. | |
| vsol_conic_2d (vsol_point_2d const &c, double rx, double ry, double theta) | |
| Ellipse/hyperbola constructor from centre, size and orientation. | |
| vsol_conic_2d (vgl_vector_2d< double > const &dir, vsol_point_2d const &top, double theta) | |
| Parabola constructor from direction, top and excentricity parameter. | |
| void | set_central_parameters (vsol_point_2d const &c, double rx, double ry, double theta) |
| Set ellipse/hyperbola from centre, size and orientation. | |
| void | set_parabola_parameters (vgl_vector_2d< double > const &dir, vsol_point_2d const &top, double theta) |
| Set parabola from direction, top and excentricity parameter. | |
| vsol_conic_2d (vgl_conic_segment_2d< double > &cs) | |
| Constructor from vgl_conic_segment_2d. | |
| vsol_conic_2d (vsol_conic_2d const &c) | |
| Copy constructor. | |
| virtual | ~vsol_conic_2d () |
| Destructor. | |
| virtual vsol_spatial_object_2d * | clone () const |
| Clone `this': creation of a new object and initialization. | |
| virtual vsol_point_2d_sptr | p0 () const |
| Return the first point of `this'; pure virtual of vsol_curve_2d. | |
| virtual vsol_point_2d_sptr | p1 () const |
| Return the last point of `this'; pure virtual of vsol_curve_2d. | |
| virtual bool | operator== (vsol_conic_2d const &other) const |
| Has `this' the same coefficients and the same end points than `other' ?. | |
| virtual bool | operator== (vsol_spatial_object_2d const &) const |
| spatial object equality. | |
| bool | operator!= (vsol_conic_2d const &o) const |
| Has `this' not the same coeffs than `other', or different end points ?. | |
| vsol_conic_type | real_type () const |
| Return the real type of the conic from its coefficients. | |
| bool | is_real_ellipse () const |
| Is `this' an real ellipse ?. | |
| bool | is_real_circle () const |
| Is `this' a real circle ?. | |
| bool | is_complex_ellipse () const |
| Is `this' a complex ellipse ?. | |
| bool | is_complex_circle () const |
| Is `this' a complex circle ?. | |
| bool | is_parabola () const |
| Is `this' a parabola ?. | |
| bool | is_hyperbola () const |
| Is `this' a hyperbola ?. | |
| bool | is_real_intersecting_lines () const |
| Is `this' an real intersecting lines ?. | |
| bool | is_complex_intersecting_lines () const |
| Is `this' an complex intersecting lines ?. | |
| bool | is_coincident_lines () const |
| Is `this' an coincident lines ?. | |
| void | ellipse_parameters (double &cx, double &cy, double &phi, double &width, double &height) const |
| Return 3 ellipse parameters:. | |
| double | ellipse_angular_position (vsol_point_2d_sptr const &pt) const |
| Return ellipse angular position. | |
| void | hyperbola_parameters (double &cx, double &cy, double &phi, double &main_axis, double &secondary_axis) const |
| Return 3 hyperbola parameters:. | |
| void | parabola_parameters (double &cx, double &cy, double &cosphi, double &sinphi) const |
| Return 2 parabola parameters:. | |
| virtual double | length () const |
| Return the length of `this'. | |
| vnl_double_3x3 | matrix () const |
| Return the matrix associated with the coefficients. | |
| virtual void | set_p0 (vsol_point_2d_sptr const &new_p0) |
| Set the first point of the curve. | |
| virtual void | set_p1 (vsol_point_2d_sptr const &new_p1) |
| Set the last point of the curve. | |
| vsol_point_2d_sptr | midpoint () const |
| Return the centre or symmetry point of a central conic. | |
| vsol_line_2d_sptr | axis () const |
| Return the main symmetry axis, if not degenerate. | |
| virtual bool | in (vsol_point_2d_sptr const &p) const |
| Is `p' in `this' ? (ie `p' verifies the equation, within some margin). | |
| virtual vgl_homg_line_2d< double > * | tangent_at_point (vsol_point_2d_sptr const &p) const |
| Returns the tangent to the conic in the point p, if p is on the conic. | |
| vcl_list< vsol_point_2d_sptr > | intersection (vsol_line_2d const &line) const |
| Return the set of (real) intersection points of this conic with a line. | |
| vcl_list< vsol_point_2d_sptr > | intersection (vsol_conic_2d const &c) const |
| Return the set of (real) intersection points of two conics. | |
| vsol_point_2d_sptr | closest_point_on_curve (vsol_point_2d_sptr const &pt) const |
| Return the point on the conic boundary which is closest to the given point. | |
| double | distance (vsol_point_2d_sptr const &pt) const |
| Return the shortest distance of the point to the conic boundary. | |
| void | describe (vcl_ostream &strm, int blanking=0) const |
| output description to stream. | |
| virtual vsol_conic_2d const * | cast_to_conic () const |
| Return `this' if `this' is an conic, 0 otherwise. | |
| virtual vsol_conic_2d * | cast_to_conic () |
| void | b_write (vsl_b_ostream &os) const |
| Binary save self to stream. | |
| void | b_read (vsl_b_istream &is) |
| Binary load self from stream. | |
| short | version () const |
| Return IO version number;. | |
| void | print_summary (vcl_ostream &os) const |
| Print an ascii summary to the stream. | |
| virtual vcl_string | is_a () const |
| Return a platform independent string identifying the class. | |
| virtual bool | is_class (vcl_string const &cls) const |
| Return true if the argument matches the string identifying the class or any parent class. | |
| vsol_spatial_object_2d_type | spatial_type () const |
| return the spatial type. | |
| virtual vsol_curve_2d * | cast_to_curve () |
| Return `this' if `this' is a curve, 0 otherwise. | |
| virtual const vsol_curve_2d * | cast_to_curve () const |
| virtual vsol_line_2d const * | cast_to_line () const |
| Return `this' if `this' is an line, 0 otherwise. | |
| virtual vsol_line_2d * | cast_to_line () |
| virtual dbsol_circ_arc_2d const * | cast_to_circ_arc () const |
| Return `this' if `this' is an conic, 0 otherwise. | |
| virtual dbsol_circ_arc_2d * | cast_to_circ_arc () |
| virtual vsol_polyline_2d const * | cast_to_polyline () const |
| Return `this' if `this' is an polyline, 0 otherwise. | |
| virtual vsol_polyline_2d * | cast_to_polyline () |
| virtual vsol_digital_curve_2d const * | cast_to_digital_curve () const |
| Return `this' if `this' is an digital_curve_2d, 0 otherwise. | |
| virtual vsol_digital_curve_2d * | cast_to_digital_curve () |
| virtual vdgl_digital_curve const * | cast_to_vdgl_digital_curve () const |
| Return `this' if `this' is a vdgl_digital_curve, 0 otherwise. | |
| virtual vdgl_digital_curve * | cast_to_vdgl_digital_curve () |
| const char * | get_name () const |
| void | un_protect () |
| unprotect the object. | |
| virtual void | print (vcl_ostream &strm=vcl_cout) const |
| bool | operator!= (vsol_spatial_object_2d const &obj) |
| vsol_box_2d_sptr | get_bounding_box () const |
| double | get_min_x () const |
| double | get_max_x () const |
| double | get_min_y () const |
| double | get_max_y () const |
| virtual vsol_spatial_object_2d * | cast_to_spatial_object () |
| The same behavior than dynamic_cast<>. | |
| virtual vsol_spatial_object_2d const * | cast_to_spatial_object () const |
| virtual vtol_topology_object * | cast_to_topology_object () |
| virtual vtol_topology_object const * | cast_to_topology_object () const |
| virtual vsol_spatial_object_2d * | cast_to_vsol_spatial_object () |
| virtual vsol_spatial_object_2d const * | cast_to_vsol_spatial_object () const |
| virtual vsol_point_2d * | cast_to_point () |
| virtual vsol_point_2d const * | cast_to_point () const |
| virtual vsol_region_2d * | cast_to_region () |
| virtual vsol_region_2d const * | cast_to_region () const |
| virtual vsol_group_2d * | cast_to_group () |
| virtual vsol_group_2d const * | cast_to_group () const |
| void | touch () |
| unsigned long | get_time_stamp () const |
| bool | older (vul_timestamp const &t) const |
| bool | older (vul_timestamp const *t) const |
| void | ref () |
| void | unref () |
| int | get_references () const |
| bool | is_referenced () const |
| int | get_id () const |
| get id of object. | |
| void | set_id (int i) |
| set id of object. | |
| void | set_user_flag (unsigned int flag) |
| set a flag for a spatial object; flag can be VSOL_FLAG[1-6]. | |
| bool | get_user_flag (unsigned int flag) |
| check if a flag is set for a spatial object; flag can be VSOL_FLAG[1-6]. | |
| void | unset_user_flag (unsigned int flag) |
| un-set a flag for a spatial object; flag can be VSOL_FLAG[1-6]. | |
| void | set_tagged_union_flag () |
| set the flag used by TAGGED_UNION. | |
| bool | get_tagged_union_flag () |
| check if the flag used by TAGGED_UNION is set. | |
| void | unset_tagged_union_flag () |
| un-set the flag used by TAGGED_UNION. | |
| int | get_tag_id () |
| void | set_tag_id (int id) |
| vgl_conic_type | type () const |
| double | a () const |
| double | b () const |
| double | c () const |
| double | d () const |
| double | e () const |
| double | f () const |
| void | set (doublea, doubleb, doublec, doubled, doublee, doublef) |
| bool | operator== (vgl_conic< double > const &c) const |
| bool | is_degenerate () const |
| bool | is_central () const |
| bool | contains (vgl_homg_point_2d< double > const &pt) const |
| vcl_list< vgl_homg_line_2d< double > > | components () const |
| vgl_homg_line_2d< double > | polar_line (vgl_homg_point_2d< double > const &p) const |
| vgl_homg_point_2d< double > | polar_point (vgl_homg_line_2d< double > const &l) const |
| vgl_homg_line_2d< double > | tangent_at (vgl_homg_point_2d< double > const &p) const |
| vgl_homg_point_2d< double > | centre () const |
| bool | ellipse_geometry (double &xc, double &yc, double &major_axis_length, double &minor_axis_length, double &angle_in_radians) |
| vgl_conic | dual_conic () const |
| vgl_conic | tangential_form () const |
| void | translate_by (doublex, doubley) |
| vcl_ostream & | operator<< (vcl_ostream &s, vgl_conic< double > const &c) |
| vcl_istream & | operator>> (vcl_istream &s, vgl_conic< double > &c) |
Static Public Member Functions | |
| static vgl_conic_type | type_by_name (vcl_string const &name) |
| static vcl_string | type_by_number (vgl_conic_type type) |
Public Attributes | |
| no_type | |
| imaginary_ellipse | |
| imaginary_circle | |
| num_conic_types | |
Static Public Attributes | |
| static const char * | SpatialTypes [] |
| static const float | eps |
Protected Types | |
| enum | vsol_curve_2d_type { CURVE_NO_TYPE = 0, LINE, CIRCULAR_ARC, CONIC, POLYLINE, DIGITAL_CURVE, NUM_CURVE_TYPES } |
Protected Member Functions | |
| bool | endpoints_equal (const vsol_curve_2d &other) const |
| Helper function to determine if curve endpoints are equal (in any order). | |
| void | not_applicable (vcl_string const &message) const |
| void | empty_bounding_box () const |
| make the bounding box empty; often first step in bounding box calculation. | |
| void | set_bounding_box (vsol_box_2d_sptr const &box) const |
| set the bounding box; to be used in bounding box calculation. | |
| void | set_bounding_box (double x, double y) const |
| set the bounding box to a single point, discarding the old bounding box. | |
| void | add_to_bounding_box (double x, double y) const |
| add a point to the bounding box and take the convex union. | |
| void | add_to_bounding_box (vsol_box_2d_sptr const &box) const |
| set the existing bounding box to the convex union of it with the given box. | |
| void | grow_minmax_bounds (vsol_box_2d_sptr const &b) const |
| grow to the largest dim. of this and box, i.e., take the convex union. | |
| virtual void | compute_bounding_box () const |
| compute bounding box, do nothing in this case except touching the box. | |
| void | check_update_bounding_box () const |
| Test consistency of bound. | |
Protected Attributes | |
| unsigned long | timestamp_ |
| unsigned int | tag_ |
| int | id_ |
Static Protected Attributes | |
| static int | tagcount_ |
Private Member Functions | |
| virtual vsol_curve_2d_type | curve_type () const |
| Return the curve type. | |
Private Attributes | |
| vsol_point_2d_sptr | p0_ |
| First point of the curve. | |
| vsol_point_2d_sptr | p1_ |
| Last point of the curve. | |
Friends | |
| vcl_ostream & | operator<< (vcl_ostream &, vsol_spatial_object_2d const &) |
| vcl_ostream & | operator<< (vcl_ostream &, vsol_spatial_object_2d const *) |
the different kinds of conic.
| invalid | |
| real_ellipse | |
| real_circle | |
| complex_ellipse | |
| complex_circle | |
| hyperbola | |
| parabola | |
| real_intersecting_lines | |
| complex_intersecting_lines | |
| real_parallel_lines | |
| complex_parallel_lines | |
| coincident_lines |
Definition at line 66 of file vsol_conic_2d.h.
enum vsol_curve_2d::vsol_curve_2d_type [protected, inherited] |
Definition at line 35 of file vsol_curve_2d.h.
enum vsol_spatial_object_2d::vsol_spatial_object_2d_type [inherited] |
| SPATIAL_NO_TYPE | |
| TOPOLOGYOBJECT | |
| POINT | |
| CURVE | |
| REGION | |
| SPATIALGROUP | |
| VOLUME | |
| NUM_SPATIALOBJECT_TYPES |
Definition at line 66 of file vsol_spatial_object_2d.h.
enum vgl_conic::vgl_conic_type [inherited] |
| vsol_conic_2d::vsol_conic_2d | ( | ) | [inline] |
Default Constructor.
produces and invalid conic (needed for binary I/O)
Definition at line 94 of file vsol_conic_2d.h.
| vsol_conic_2d::vsol_conic_2d | ( | double | a, | |
| double | b, | |||
| double | c, | |||
| double | d, | |||
| double | e, | |||
| double | f | |||
| ) | [inline] |
Constructor from coefficients of the cartesian equation.
`a'x^2+`b'xy+`c'y^2+`d'x+`e'y+`f'
Definition at line 99 of file vsol_conic_2d.h.
| vsol_conic_2d::vsol_conic_2d | ( | vsol_point_2d const & | c, | |
| double | rx, | |||
| double | ry, | |||
| double | theta | |||
| ) |
Ellipse/hyperbola constructor from centre, size and orientation.
This constructor can only be used for non-degenerate, real ellipses and hyperbolas: if rx and ry have the same sign, an ellipse is defined (and any ellipse can uniquely be specified this way); rx is the length of one main axis, ry of the other axis. Hyperbolas are obtained if rx and ry have opposite sign; the positive one determines the distance from bots tops to the centre, and the other one specified the 'minor' axis length.
Definition at line 47 of file vsol_conic_2d.cxx.
| vsol_conic_2d::vsol_conic_2d | ( | vgl_vector_2d< double > const & | dir, | |
| vsol_point_2d const & | top, | |||
| double | theta | |||
| ) |
Parabola constructor from direction, top and excentricity parameter.
This constructor can only be used for non-degenerate parabolas: specify the direction of the symmetry axis, the top, and an excentricity parameter theta.
Definition at line 72 of file vsol_conic_2d.cxx.
| vsol_conic_2d::vsol_conic_2d | ( | vgl_conic_segment_2d< double > & | cs | ) | [inline] |
| vsol_conic_2d::vsol_conic_2d | ( | vsol_conic_2d const & | c | ) | [inline] |
| virtual vsol_conic_2d::~vsol_conic_2d | ( | ) | [inline, virtual] |
| virtual vsol_curve_2d_type vsol_conic_2d::curve_type | ( | ) | const [inline, private, virtual] |
Return the curve type.
Reimplemented from vsol_curve_2d.
Definition at line 84 of file vsol_conic_2d.h.
| void vsol_conic_2d::set_central_parameters | ( | vsol_point_2d const & | c, | |
| double | rx, | |||
| double | ry, | |||
| double | theta | |||
| ) |
Set ellipse/hyperbola from centre, size and orientation.
Can only be used for non-degenerate, real ellipses and hyperbolas: if rx and ry have the same sign, an ellipse is defined (and any ellipse can uniquely be specified this way); rx is the length of one main axis, ry of the other axis. Hyperbolas are obtained if rx and ry have opposite sign; the positive one determines the distance from bots tops to the centre, and the other one specified the 'minor' axis length.
Definition at line 61 of file vsol_conic_2d.cxx.
| void vsol_conic_2d::set_parabola_parameters | ( | vgl_vector_2d< double > const & | dir, | |
| vsol_point_2d const & | top, | |||
| double | theta | |||
| ) |
Set parabola from direction, top and excentricity parameter.
This can only be used for non-degenerate parabolas: specify the direction of the symmetry axis, the top, and an excentricity parameter theta.
Definition at line 83 of file vsol_conic_2d.cxx.
| vsol_spatial_object_2d * vsol_conic_2d::clone | ( | ) | const [virtual] |
Clone `this': creation of a new object and initialization.
See Prototype pattern
Implements vsol_spatial_object_2d.
Definition at line 93 of file vsol_conic_2d.cxx.
| virtual vsol_point_2d_sptr vsol_conic_2d::p0 | ( | void | ) | const [inline, virtual] |
Return the first point of `this'; pure virtual of vsol_curve_2d.
Implements vsol_curve_2d.
Definition at line 163 of file vsol_conic_2d.h.
| virtual vsol_point_2d_sptr vsol_conic_2d::p1 | ( | void | ) | const [inline, virtual] |
Return the last point of `this'; pure virtual of vsol_curve_2d.
Implements vsol_curve_2d.
Definition at line 167 of file vsol_conic_2d.h.
| bool vsol_conic_2d::operator== | ( | vsol_conic_2d const & | other | ) | const [virtual] |
Has `this' the same coefficients and the same end points than `other' ?.
The test anticipates that the conic may have null endpoints
Definition at line 105 of file vsol_conic_2d.cxx.
| bool vsol_conic_2d::operator== | ( | vsol_spatial_object_2d const & | ) | const [virtual] |
spatial object equality.
Reimplemented from vsol_spatial_object_2d.
Definition at line 118 of file vsol_conic_2d.cxx.
| bool vsol_conic_2d::operator!= | ( | vsol_conic_2d const & | o | ) | const [inline] |
Has `this' not the same coeffs than `other', or different end points ?.
Definition at line 180 of file vsol_conic_2d.h.
| vsol_conic_2d::vsol_conic_type vsol_conic_2d::real_type | ( | ) | const |
Return the real type of the conic from its coefficients.
Reimplemented from vgl_conic< double >.
Definition at line 131 of file vsol_conic_2d.cxx.
| bool vsol_conic_2d::is_real_ellipse | ( | ) | const |
| bool vsol_conic_2d::is_real_circle | ( | ) | const |
| bool vsol_conic_2d::is_complex_ellipse | ( | ) | const |
| bool vsol_conic_2d::is_complex_circle | ( | ) | const |
| bool vsol_conic_2d::is_parabola | ( | ) | const |
| bool vsol_conic_2d::is_hyperbola | ( | ) | const |
| bool vsol_conic_2d::is_real_intersecting_lines | ( | ) | const |
| bool vsol_conic_2d::is_complex_intersecting_lines | ( | ) | const |
| bool vsol_conic_2d::is_coincident_lines | ( | ) | const |
| void vsol_conic_2d::ellipse_parameters | ( | double & | cx, | |
| double & | cy, | |||
| double & | phi, | |||
| double & | width, | |||
| double & | height | |||
| ) | const |
Return 3 ellipse parameters:.
Definition at line 226 of file vsol_conic_2d.cxx.
| double vsol_conic_2d::ellipse_angular_position | ( | vsol_point_2d_sptr const & | pt | ) | const |
Return ellipse angular position.
Definition at line 271 of file vsol_conic_2d.cxx.
| void vsol_conic_2d::hyperbola_parameters | ( | double & | cx, | |
| double & | cy, | |||
| double & | phi, | |||
| double & | main_axis, | |||
| double & | secondary_axis | |||
| ) | const |
Return 3 hyperbola parameters:.
Definition at line 299 of file vsol_conic_2d.cxx.
| void vsol_conic_2d::parabola_parameters | ( | double & | cx, | |
| double & | cy, | |||
| double & | cosphi, | |||
| double & | sinphi | |||
| ) | const |
Return 2 parabola parameters:.
Definition at line 341 of file vsol_conic_2d.cxx.
| double vsol_conic_2d::length | ( | void | ) | const [virtual] |
Return the length of `this'.
Currently only implemented for ellipse segment and accurate to 0.001 of the major axis length. Alternatively provide code for the incomplete elliptic integral of the second kind. However, that would be numerical integration anyway.
Implements vsol_curve_2d.
Definition at line 368 of file vsol_conic_2d.cxx.
| vnl_double_3x3 vsol_conic_2d::matrix | ( | ) | const |
Return the matrix associated with the coefficients.
Definition at line 400 of file vsol_conic_2d.cxx.
| void vsol_conic_2d::set_p0 | ( | vsol_point_2d_sptr const & | new_p0 | ) | [virtual] |
Set the first point of the curve.
REQUIRE: in(new_p0)
Implements vsol_curve_2d.
Definition at line 427 of file vsol_conic_2d.cxx.
| void vsol_conic_2d::set_p1 | ( | vsol_point_2d_sptr const & | new_p1 | ) | [virtual] |
Set the last point of the curve.
REQUIRE: in(new_p1)
Implements vsol_curve_2d.
Definition at line 438 of file vsol_conic_2d.cxx.
| vsol_point_2d_sptr vsol_conic_2d::midpoint | ( | ) | const |
Return the centre or symmetry point of a central conic.
Definition at line 452 of file vsol_conic_2d.cxx.
| vsol_line_2d_sptr vsol_conic_2d::axis | ( | ) | const |
| bool vsol_conic_2d::in | ( | vsol_point_2d_sptr const & | p | ) | const [virtual] |
Is `p' in `this' ? (ie `p' verifies the equation, within some margin).
Definition at line 460 of file vsol_conic_2d.cxx.
| vgl_homg_line_2d< double > * vsol_conic_2d::tangent_at_point | ( | vsol_point_2d_sptr const & | p | ) | const [virtual] |
Returns the tangent to the conic in the point p, if p is on the conic.
In general, returns the polar line of the point w.r.t. the conic.
Definition at line 471 of file vsol_conic_2d.cxx.
| vcl_list< vsol_point_2d_sptr > vsol_conic_2d::intersection | ( | vsol_line_2d const & | line | ) | const |
Return the set of (real) intersection points of this conic with a line.
Definition at line 480 of file vsol_conic_2d.cxx.
| vcl_list< vsol_point_2d_sptr > vsol_conic_2d::intersection | ( | vsol_conic_2d const & | c | ) | const |
Return the set of (real) intersection points of two conics.
Definition at line 498 of file vsol_conic_2d.cxx.
| vsol_point_2d_sptr vsol_conic_2d::closest_point_on_curve | ( |