Public Types | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
vsol_rectangle_2d Class Reference

#include <vsol_rectangle_2d.h>

Inheritance diagram for vsol_rectangle_2d:
Inheritance graph
[legend]

List of all members.

Public Types

enum  vsol_spatial_object_2d_type {
  SPATIAL_NO_TYPE = 0, TOPOLOGYOBJECT, POINT, CURVE,
  REGION, SPATIALGROUP, VOLUME, NUM_SPATIALOBJECT_TYPES
}

Public Member Functions

 vsol_rectangle_2d ()
 Default Constructor - needed for binary I/O.
 vsol_rectangle_2d (const vsol_point_2d_sptr &new_p0, const vsol_point_2d_sptr &new_p1, const vsol_point_2d_sptr &new_p2, const vsol_point_2d_sptr &new_p3)
 Constructor from 4 points, the corners of the rectangle.
 vsol_rectangle_2d (const vsol_point_2d_sptr &new_pc, const vsol_point_2d_sptr &new_pabs, const vsol_point_2d_sptr &new_pord)
 Constructor from 3 points.
 vsol_rectangle_2d (const vsol_point_2d_sptr &center, const double half_width, const double half_height, const double angle, const bool deg=true)
 Constructor from center, half_width, half_height, angle(ccw from x axis, in deg/rad).
 vsol_rectangle_2d (const vsol_rectangle_2d &other)
 Copy constructor.
virtual ~vsol_rectangle_2d ()
 Destructor.
virtual vsol_spatial_object_2dclone (void) const
 Clone `this': creation of a new object and initialization.
vsol_point_2d_sptr p0 (void) const
 Return the first vertex.
vsol_point_2d_sptr p1 (void) const
 Return the second vertex.
vsol_point_2d_sptr p2 (void) const
 Return the third vertex.
vsol_point_2d_sptr p3 (void) const
 Return the last vertex.
virtual bool operator== (const vsol_rectangle_2d &other) const
 Has `this' the same points than `other' in the same order ?.
bool operator!= (const vsol_rectangle_2d &other) const
virtual bool operator== (const vsol_polygon_2d &other) const
 Has `this' the same points than `other' in the same order ?.
virtual bool operator== (const vsol_spatial_object_2d &obj) const
 spatial object equality.
double width (void) const
 Return the width.
double height (void) const
 Return the height.
virtual double area (void) const
 Return the area of `this'.
virtual vsol_rectangle_2dcast_to_rectangle (void)
virtual vsol_rectangle_2d const * cast_to_rectangle (void) const
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 (const vcl_string &cls) const
 Return true if the argument matches the string identifying the class or any parent class.
virtual bool valid_vertices (const vcl_vector< vsol_point_2d_sptr > new_vertices) const
 Are `new_vertices' valid to build a rectangle ?.
void describe (vcl_ostream &strm, int blanking=0) const
 output description to stream.
virtual vsol_polygon_2dcast_to_polygon (void)
 Safe casting.
virtual const vsol_polygon_2dcast_to_polygon (void) const
virtual vsol_triangle_2dcast_to_triangle (void)
virtual const vsol_triangle_2dcast_to_triangle (void) const
vsol_point_2d_sptr vertex (const int i) const
 Return vertex `i'.
bool operator!= (const vsol_polygon_2d &o) const
 Has `this' not the same points than `other' in the same order ?.
bool operator!= (vsol_spatial_object_2d const &obj)
vsol_region_2d_type region_type (void) const
 Return the region type of a polygon. Its spatial type is a REGION.
virtual void compute_bounding_box (void) const
 Compute the bounding box of `this'.
unsigned int size (void) const
 Return the number of vertices.
virtual vsol_point_2d_sptr centroid (void) const
 Return the centroid of `this'.
virtual bool is_convex (void) const
 Is `this' convex ?.
bool valid_index (unsigned int i) const
 Is `i' a valid index for the list of vertices ?.
vsol_spatial_object_2d_type spatial_type (void) const
 Return the spatial type.
virtual vsol_region_2dcast_to_region (void)
virtual vsol_region_2d const * cast_to_region (void) const
virtual vsol_poly_set_2dcast_to_poly_set (void)
virtual vsol_poly_set_2d const * cast_to_poly_set (void) const
const char * get_name () const
void un_protect ()
 unprotect the object.
virtual void print (vcl_ostream &strm=vcl_cout) const
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_2dcast_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_2dcast_to_vsol_spatial_object ()
virtual vsol_spatial_object_2d
const * 
cast_to_vsol_spatial_object () const
virtual vsol_point_2dcast_to_point ()
virtual vsol_point_2d const * cast_to_point () const
virtual vsol_curve_2dcast_to_curve ()
virtual vsol_curve_2d const * cast_to_curve () const
virtual vsol_group_2dcast_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)

Static Public Attributes

static const char * SpatialTypes []
static const float eps = 1.0e-3f

Protected Types

enum  vsol_region_2d_type { REGION_NO_TYPE = 0, POLYGON, POLYGON_SET, NUM_REGION_TYPES }

Protected Member Functions

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.
void check_update_bounding_box () const
 Test consistency of bound.

Protected Attributes

vcl_vector< vsol_point_2d_sptr > * storage_
unsigned long timestamp_
unsigned int tag_
int id_

Static Protected Attributes

static int tagcount_ = 0

Friends

vcl_ostream & operator<< (vcl_ostream &, vsol_spatial_object_2d const &)
vcl_ostream & operator<< (vcl_ostream &, vsol_spatial_object_2d const *)

Detailed Description

Definition at line 48 of file vsol_rectangle_2d.h.


Member Enumeration Documentation

enum vsol_region_2d::vsol_region_2d_type [protected, inherited]
Enumerator:
REGION_NO_TYPE 
POLYGON 
POLYGON_SET 
NUM_REGION_TYPES 

Definition at line 28 of file vsol_region_2d.h.

Enumerator:
SPATIAL_NO_TYPE 
TOPOLOGYOBJECT 
POINT 
CURVE 
REGION 
SPATIALGROUP 
VOLUME 
NUM_SPATIALOBJECT_TYPES 

Definition at line 66 of file vsol_spatial_object_2d.h.


Constructor & Destructor Documentation

vsol_rectangle_2d::vsol_rectangle_2d ( )

Default Constructor - needed for binary I/O.

Definition at line 19 of file vsol_rectangle_2d.cxx.

vsol_rectangle_2d::vsol_rectangle_2d ( const vsol_point_2d_sptr new_p0,
const vsol_point_2d_sptr new_p1,
const vsol_point_2d_sptr new_p2,
const vsol_point_2d_sptr new_p3 
)

Constructor from 4 points, the corners of the rectangle.

Definition at line 31 of file vsol_rectangle_2d.cxx.

vsol_rectangle_2d::vsol_rectangle_2d ( const vsol_point_2d_sptr new_pc,
const vsol_point_2d_sptr new_pabs,
const vsol_point_2d_sptr new_pord 
)

Constructor from 3 points.

`new_pc' is the origin of the rectangle. `new_pabs' defines the abscissa axis and the width/2. `new_pord' defines the ordinate axis and the height/2. REQUIRE: valid_vertices(new_pc,new_pabs,new_pord)

Description: `new_pc' is the origin of the rectangle. `new_pabs' defines the abscissa axis and the width/2. `new_pord' defines the ordinate axis and the height/2. Require: valid_vertices(new_pc,new_pabs,new_pord)

Definition at line 50 of file vsol_rectangle_2d.cxx.

vsol_rectangle_2d::vsol_rectangle_2d ( const vsol_point_2d_sptr center,
const double  half_width,
const double  half_height,
const double  angle,
const bool  deg = true 
)

Constructor from center, half_width, half_height, angle(ccw from x axis, in deg/rad).

Definition at line 73 of file vsol_rectangle_2d.cxx.

vsol_rectangle_2d::vsol_rectangle_2d ( const vsol_rectangle_2d other)

Copy constructor.

Definition at line 101 of file vsol_rectangle_2d.cxx.

vsol_rectangle_2d::~vsol_rectangle_2d ( ) [virtual]

Destructor.

Definition at line 109 of file vsol_rectangle_2d.cxx.


Member Function Documentation

void vsol_spatial_object_2d::add_to_bounding_box ( double  x,
double  y 
) const [protected, inherited]

add a point to the bounding box and take the convex union.

This is a "const" method since the bounding box is a "mutable" data member: calculating the bounding box does not change the object.

Definition at line 79 of file vsol_spatial_object_2d.cxx.

void vsol_spatial_object_2d::add_to_bounding_box ( vsol_box_2d_sptr const &  box) const [protected, inherited]

set the existing bounding box to the convex union of it with the given box.

Definition at line 84 of file vsol_spatial_object_2d.cxx.

double vsol_rectangle_2d::area ( void  ) const [virtual]

Return the area of `this'.

Reimplemented from vsol_polygon_2d.

Definition at line 198 of file vsol_rectangle_2d.cxx.

void vsol_rectangle_2d::b_read ( vsl_b_istream is) [virtual]

Binary load self from stream.

Binary load self from stream (not typically used).

Reimplemented from vsol_polygon_2d.

Definition at line 229 of file vsol_rectangle_2d.cxx.

void vsol_rectangle_2d::b_write ( vsl_b_ostream os) const [virtual]

Binary save self to stream.

Reimplemented from vsol_polygon_2d.

Definition at line 222 of file vsol_rectangle_2d.cxx.

virtual vsol_curve_2d* vsol_spatial_object_2d::cast_to_curve ( ) [inline, virtual, inherited]

Reimplemented in vsol_curve_2d.

Definition at line 180 of file vsol_spatial_object_2d.h.

virtual vsol_curve_2d const* vsol_spatial_object_2d::cast_to_curve ( ) const [inline, virtual, inherited]

Reimplemented in vsol_curve_2d.

Definition at line 181 of file vsol_spatial_object_2d.h.

virtual vsol_group_2d* vsol_spatial_object_2d::cast_to_group ( void  ) [inline, virtual, inherited]

Reimplemented in vsol_group_2d, and vsol_group_2d.

Definition at line 184 of file vsol_spatial_object_2d.h.

virtual vsol_group_2d const* vsol_spatial_object_2d::cast_to_group ( void  ) const [inline, virtual, inherited]

Reimplemented in vsol_group_2d.

Definition at line 185 of file vsol_spatial_object_2d.h.

virtual vsol_point_2d* vsol_spatial_object_2d::cast_to_point ( void  ) [inline, virtual, inherited]

Reimplemented in vsol_point_2d.

Definition at line 178 of file vsol_spatial_object_2d.h.

virtual vsol_point_2d const* vsol_spatial_object_2d::cast_to_point ( void  ) const [inline, virtual, inherited]

Reimplemented in vsol_point_2d, and vsol_point_2d.

Definition at line 179 of file vsol_spatial_object_2d.h.

virtual vsol_poly_set_2d* vsol_region_2d::cast_to_poly_set ( void  ) [inline, virtual, inherited]

Reimplemented in vsol_poly_set_2d, and vsol_poly_set_2d.

Definition at line 63 of file vsol_region_2d.h.

virtual vsol_poly_set_2d const* vsol_region_2d::cast_to_poly_set ( void  ) const [inline, virtual, inherited]

Reimplemented in vsol_poly_set_2d.

Definition at line 64 of file vsol_region_2d.h.

vsol_polygon_2d * vsol_polygon_2d::cast_to_polygon ( void  ) [virtual, inherited]

Safe casting.

Reimplemented from vsol_region_2d.

Definition at line 62 of file vsol_polygon_2d.cxx.

const vsol_polygon_2d * vsol_polygon_2d::cast_to_polygon ( void  ) const [virtual, inherited]

Reimplemented from vsol_region_2d.

Definition at line 70 of file vsol_polygon_2d.cxx.

virtual vsol_rectangle_2d* vsol_rectangle_2d::cast_to_rectangle ( void  ) [inline, virtual]

Reimplemented from vsol_polygon_2d.

Definition at line 145 of file vsol_rectangle_2d.h.

virtual vsol_rectangle_2d const* vsol_rectangle_2d::cast_to_rectangle ( void  ) const [inline, virtual]

Reimplemented from vsol_polygon_2d.

Definition at line 146 of file vsol_rectangle_2d.h.

virtual vsol_region_2d* vsol_region_2d::cast_to_region ( void  ) [inline, virtual, inherited]

Reimplemented from vsol_spatial_object_2d.

Definition at line 57 of file vsol_region_2d.h.

virtual vsol_region_2d const* vsol_region_2d::cast_to_region ( void  ) const [inline, virtual, inherited]

Reimplemented from vsol_spatial_object_2d.

Definition at line 58 of file vsol_region_2d.h.

virtual vsol_spatial_object_2d* vsol_spatial_object_2d::cast_to_spatial_object ( ) [inline, virtual, inherited]

The same behavior than dynamic_cast<>.

Needed because VXL is not necessarily compiled with -frtti

Definition at line 170 of file vsol_spatial_object_2d.h.

virtual vsol_spatial_object_2d const* vsol_spatial_object_2d::cast_to_spatial_object ( ) const [inline, virtual, inherited]

Definition at line 171 of file vsol_spatial_object_2d.h.

virtual vtol_topology_object* vsol_spatial_object_2d::cast_to_topology_object ( ) [inline, virtual, inherited]

Definition at line 173 of file vsol_spatial_object_2d.h.

virtual vtol_topology_object const* vsol_spatial_object_2d::cast_to_topology_object ( ) const [inline, virtual, inherited]

Definition at line 174 of file vsol_spatial_object_2d.h.

vsol_triangle_2d * vsol_polygon_2d::cast_to_triangle ( void  ) [virtual, inherited]

Reimplemented in vsol_triangle_2d.

Definition at line 78 of file vsol_polygon_2d.cxx.

const vsol_triangle_2d * vsol_polygon_2d::cast_to_triangle ( void  ) const [virtual, inherited]

Reimplemented in vsol_triangle_2d.

Definition at line 79 of file vsol_polygon_2d.cxx.

virtual vsol_spatial_object_2d* vsol_spatial_object_2d::cast_to_vsol_spatial_object ( ) [inline, virtual, inherited]

Definition at line 176 of file vsol_spatial_object_2d.h.

virtual vsol_spatial_object_2d const* vsol_spatial_object_2d::cast_to_vsol_spatial_object ( ) const [inline, virtual, inherited]

Definition at line 177 of file vsol_spatial_object_2d.h.

vsol_point_2d_sptr vsol_polygon_2d::centroid ( void  ) const [virtual, inherited]

Return the centroid of `this'.

The centroid is computed by using Green's theorem to compute the area-weighted 1st moments of the polygon. Green's theorem relates the surface integral to the line integral around the boundary as: Int(surface) x dxdy = 0.5 * Int(boundary) x*x dy Int(surface) y dxdy = 0.5 * Int(boundary) y*y dx The centroid is given by xc = Int(surface) x dxdy / Int(surface) dxdy = Int(surface) x dxdy/area yc = Int(surface) y dxdy / Int(surface) dxdy = Int(surface) y dxdy/area

For a polygon: with vertices x[i], y[i] 0.5 * Int(boundary) x*x dy = 1/6 * Sum(i)( x[i+1] + x[i] ) * ( x[i] * y[i+1] - x[i+1] * y[i] )

0.5 * Int(boundary) y*y dx = 1/6 * Sum(i)( y[i+1] + y[i] ) * ( x[i] * y[i+1] - x[i+1] * y[i] )

In the case of degenerate polygons, where area == 0, return the average of the vertex locations.

Implements vsol_region_2d.

Definition at line 196 of file vsol_polygon_2d.cxx.

void vsol_spatial_object_2d::check_update_bounding_box ( ) const [protected, inherited]

Test consistency of bound.

Bounds Accessors:.

min_ and max_ are provided as methods on vsol_spatial_object_2d to be consistent with the previous interface Additional bounds accessors are available directly on vsol_box_2d. - JLM

Definition at line 97 of file vsol_spatial_object_2d.cxx.

vsol_spatial_object_2d * vsol_rectangle_2d::clone ( void  ) const [virtual]

Clone `this': creation of a new object and initialization.

See Prototype pattern

Reimplemented from vsol_polygon_2d.

Definition at line 116 of file vsol_rectangle_2d.cxx.

void vsol_polygon_2d::compute_bounding_box ( void  ) const [virtual, inherited]

Compute the bounding box of `this'.

Reimplemented from vsol_spatial_object_2d.

Definition at line 150 of file vsol_polygon_2d.cxx.

void vsol_rectangle_2d::describe ( vcl_ostream &  strm,
int  blanking = 0 
) const [inline, virtual]

output description to stream.

Reimplemented from vsol_polygon_2d.

Definition at line 296 of file vsol_rectangle_2d.cxx.

void vsol_spatial_object_2d::empty_bounding_box ( ) const [protected, inherited]

make the bounding box empty; often first step in bounding box calculation.

Definition at line 64 of file vsol_spatial_object_2d.cxx.

vsol_box_2d_sptr vsol_spatial_object_2d::get_bounding_box ( ) const [inline, inherited]

Definition at line 137 of file vsol_spatial_object_2d.h.

int vsol_flags_id::get_id ( ) const [inline, inherited]

get id of object.

Definition at line 52 of file vsol_flags_id.h.

double vsol_spatial_object_2d::get_max_x ( ) const [inherited]

Definition at line 118 of file vsol_spatial_object_2d.cxx.

double vsol_spatial_object_2d::get_max_y ( ) const [inherited]

Definition at line 128 of file vsol_spatial_object_2d.cxx.

double vsol_spatial_object_2d::get_min_x ( ) const [inherited]

Definition at line 113 of file vsol_spatial_object_2d.cxx.

double vsol_spatial_object_2d::get_min_y ( ) const [inherited]

Definition at line 123 of file vsol_spatial_object_2d.cxx.

const char * vsol_spatial_object_2d::get_name ( ) const [inherited]

Definition at line 40 of file vsol_spatial_object_2d.cxx.

int vsol_flags_id::get_tag_id ( ) [inline, inherited]

Definition at line 106 of file vsol_flags_id.h.

bool vsol_flags_id::get_tagged_union_flag ( ) [inline, inherited]

check if the flag used by TAGGED_UNION is set.

Definition at line 95 of file vsol_flags_id.h.

bool vsol_flags_id::get_user_flag ( unsigned int  flag) [inline, inherited]

check if a flag is set for a spatial object; flag can be VSOL_FLAG[1-6].

Definition at line 77 of file vsol_flags_id.h.

void vsol_spatial_object_2d::grow_minmax_bounds ( vsol_box_2d_sptr const &  b) const [inline, protected, inherited]

grow to the largest dim. of this and box, i.e., take the convex union.

Definition at line 160 of file vsol_spatial_object_2d.h.

double vsol_rectangle_2d::height ( void  ) const

Return the height.

Definition at line 191 of file vsol_rectangle_2d.cxx.

virtual vcl_string vsol_rectangle_2d::is_a ( ) const [inline, virtual]

Return a platform independent string identifying the class.

Reimplemented from vsol_polygon_2d.

Definition at line 162 of file vsol_rectangle_2d.h.

virtual bool vsol_rectangle_2d::is_class ( const vcl_string &  cls) const [inline, virtual]

Return true if the argument matches the string identifying the class or any parent class.

Reimplemented from vsol_polygon_2d.

Definition at line 165 of file vsol_rectangle_2d.h.

bool vsol_polygon_2d::is_convex ( void  ) const [virtual, inherited]

Is `this' convex ?.

A polygon is convex if the direction of "turning" at every vertex is the same. This is checked by calculating the cross product of two consecutive edges and verifying that these all have the same sign.

Implements vsol_region_2d.

Definition at line 241 of file vsol_polygon_2d.cxx.

void vsol_spatial_object_2d::not_applicable ( vcl_string const &  message) const [inline, protected, inherited]

Definition at line 89 of file vsol_spatial_object_2d.h.

bool vsol_polygon_2d::operator!= ( const vsol_polygon_2d o) const [inline, inherited]

Has `this' not the same points than `other' in the same order ?.

Definition at line 106 of file vsol_polygon_2d.h.

bool vsol_rectangle_2d::operator!= ( const vsol_rectangle_2d other) const [inline]

Definition at line 125 of file vsol_rectangle_2d.h.

bool vsol_spatial_object_2d::operator!= ( vsol_spatial_object_2d const &  obj) [inline, inherited]

Definition at line 133 of file vsol_spatial_object_2d.h.

bool vsol_rectangle_2d::operator== ( const vsol_rectangle_2d other) const [virtual]

Has `this' the same points than `other' in the same order ?.

Definition at line 159 of file vsol_rectangle_2d.cxx.

bool vsol_rectangle_2d::operator== ( const vsol_polygon_2d other) const [virtual]

Has `this' the same points than `other' in the same order ?.

Reimplemented from vsol_polygon_2d.

Definition at line 164 of file vsol_rectangle_2d.cxx.

bool vsol_rectangle_2d::operator== ( const vsol_spatial_object_2d obj) const [virtual]

spatial object equality.

Reimplemented from vsol_polygon_2d.

Definition at line 171 of file vsol_rectangle_2d.cxx.

vsol_point_2d_sptr vsol_rectangle_2d::p0 ( void  ) const

Return the first vertex.

Definition at line 127 of file vsol_rectangle_2d.cxx.

vsol_point_2d_sptr vsol_rectangle_2d::p1 ( void  ) const

Return the second vertex.

Definition at line 134 of file vsol_rectangle_2d.cxx.

vsol_point_2d_sptr vsol_rectangle_2d::p2 ( void  ) const

Return the third vertex.

Definition at line 141 of file vsol_rectangle_2d.cxx.

vsol_point_2d_sptr vsol_rectangle_2d::p3 ( void  ) const

Return the last vertex.

Definition at line 148 of file vsol_rectangle_2d.cxx.

virtual void vsol_spatial_object_2d::print ( vcl_ostream &  strm = vcl_cout) const [inline, virtual, inherited]

Definition at line 125 of file vsol_spatial_object_2d.h.

void vsol_rectangle_2d::print_summary ( vcl_ostream &  os) const

Print an ascii summary to the stream.

Reimplemented from vsol_polygon_2d.

Definition at line 261 of file vsol_rectangle_2d.cxx.

vsol_region_2d_type vsol_polygon_2d::region_type ( void  ) const [inline, virtual, inherited]

Return the region type of a polygon. Its spatial type is a REGION.

Reimplemented from vsol_region_2d.

Definition at line 114 of file vsol_polygon_2d.h.

void vsol_spatial_object_2d::set_bounding_box ( vsol_box_2d_sptr const &  box) const [protected, inherited]

set the bounding box; to be used in bounding box calculation.

Definition at line 74 of file vsol_spatial_object_2d.cxx.

void vsol_spatial_object_2d::set_bounding_box ( double  x,
double  y 
) const [protected, inherited]

set the bounding box to a single point, discarding the old bounding box.

This is a "const" method since the bounding box is a "mutable" data member: calculating the bounding box does not change the object.

Definition at line 69 of file vsol_spatial_object_2d.cxx.

void vsol_flags_id::set_id ( int  i) [inline, inherited]

set id of object.

Definition at line 54 of file vsol_flags_id.h.

void vsol_flags_id::set_tag_id ( int  id) [inline, inherited]

Definition at line 111 of file vsol_flags_id.h.

void vsol_flags_id::set_tagged_union_flag ( ) [inline, inherited]

set the flag used by TAGGED_UNION.

Definition at line 89 of file vsol_flags_id.h.

void vsol_flags_id::set_user_flag ( unsigned int  flag) [inline, inherited]

set a flag for a spatial object; flag can be VSOL_FLAG[1-6].

Definition at line 71 of file vsol_flags_id.h.

unsigned int vsol_polygon_2d::size ( void  ) const [inline, inherited]

Return the number of vertices.

Definition at line 122 of file vsol_polygon_2d.h.

vsol_spatial_object_2d_type vsol_region_2d::spatial_type ( void  ) const [inline, virtual, inherited]

Return the spatial type.

Implements vsol_spatial_object_2d.

Definition at line 42 of file vsol_region_2d.h.

void vsol_spatial_object_2d::un_protect ( ) [inline, inherited]

unprotect the object.

Definition at line 104 of file vsol_spatial_object_2d.h.

void vsol_flags_id::unset_tagged_union_flag ( ) [inline, inherited]

un-set the flag used by TAGGED_UNION.

Definition at line 101 of file vsol_flags_id.h.

void vsol_flags_id::unset_user_flag ( unsigned int  flag) [inline, inherited]

un-set a flag for a spatial object; flag can be VSOL_FLAG[1-6].

Definition at line 83 of file vsol_flags_id.h.

bool vsol_polygon_2d::valid_index ( unsigned int  i) const [inline, inherited]

Is `i' a valid index for the list of vertices ?.

Definition at line 138 of file vsol_polygon_2d.h.

bool vsol_rectangle_2d::valid_vertices ( const vcl_vector< vsol_point_2d_sptr new_vertices) const [virtual]

Are `new_vertices' valid to build a rectangle ?.

Reimplemented from vsol_polygon_2d.

Definition at line 207 of file vsol_rectangle_2d.cxx.

short vsol_rectangle_2d::version ( ) const

Return IO version number;.

Reimplemented from vsol_polygon_2d.

Definition at line 255 of file vsol_rectangle_2d.cxx.

vsol_point_2d_sptr vsol_polygon_2d::vertex ( const int  i) const [inherited]

Return vertex `i'.

REQUIRE: valid_index(i)

Require: valid_index(i)

Definition at line 97 of file vsol_polygon_2d.cxx.

double vsol_rectangle_2d::width ( void  ) const

Return the width.

Definition at line 184 of file vsol_rectangle_2d.cxx.


Friends And Related Function Documentation

vcl_ostream& operator<< ( vcl_ostream &  strm,
vsol_spatial_object_2d const &  so 
) [friend, inherited]

Definition at line 190 of file vsol_spatial_object_2d.h.

vcl_ostream& operator<< ( vcl_ostream &  strm,
vsol_spatial_object_2d const *  so 
) [friend, inherited]

Definition at line 196 of file vsol_spatial_object_2d.h.


Member Data Documentation

const float vsol_spatial_object_2d::eps = 1.0e-3f [static, inherited]

Definition at line 79 of file vsol_spatial_object_2d.h.

int vsol_flags_id::id_ [protected, inherited]

Definition at line 39 of file vsol_flags_id.h.

const char * vsol_spatial_object_2d::SpatialTypes [static, inherited]
Initial value:
{
  "NO_TYPE             ",
  "TOPOLOGYOBJECT      ",
  "POINT               ",
  "CURVE               ",
  "REGION              ",
  "SPATIALGROUP        ",
  "NUM_SPATIALOBJECT_TYPES"
}

Definition at line 78 of file vsol_spatial_object_2d.h.

vcl_vector<vsol_point_2d_sptr>* vsol_polygon_2d::storage_ [protected, inherited]

Definition at line 46 of file vsol_polygon_2d.h.

unsigned int vsol_flags_id::tag_ [protected, inherited]

Definition at line 38 of file vsol_flags_id.h.

int vsol_flags_id::tagcount_ = 0 [static, protected, inherited]

Definition at line 40 of file vsol_flags_id.h.


The documentation for this class was generated from the following files: