Public Member Functions | Static Public Member Functions | Private Attributes
mfpf_region_about_pt Class Reference

Region centred on a single point, pose defined by other pts. More...

#include <mfpf_region_about_pt.h>

Inheritance diagram for mfpf_region_about_pt:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 mfpf_region_about_pt ()
 Dflt ctor.
virtual ~mfpf_region_about_pt ()
 Destructor.
virtual bool is_centred_on_pt () const
 Returns true as the region is centred on an input point.
virtual unsigned ref_point_index () const
 Returns index of reference point on which the region is centred.
virtual unsigned orig_ref_point_index () const
 Returns original index of reference point on which the region is centred.
virtual bool replace_index (const vcl_vector< unsigned > &new_index)
 Replace each point index i with new_index[i].
unsigned i0 () const
 Index of point on which region is centred.
unsigned i1 () const
 Index of first point defining reference frame.
unsigned i2 () const
 Index of second point defining reference frame.
double rel_wi () const
 Width of ROI, relative to |p2-p1|.
double rel_wj () const
 Height of ROI, relative to |p2-p1|.
double wi () const
 Width of ROI in world coords.
double wj () const
 Height of ROI in world coords.
vcl_string form () const
 Name of form of shape ("box","ellipse").
virtual vgl_point_2d< double > get_ref_point (const vcl_vector< vgl_point_2d< double > > &pts) const
 Returns reference point for region, pts[i0()].
virtual mfpf_region_form set_up (const vcl_vector< vgl_point_2d< double > > &pts)
 Defines a region centred on a point.
virtual mfpf_region_form get_region (const vcl_vector< vgl_point_2d< double > > &pts) const
 Defines a region centred on a point.
virtual bool set_from_stream (vcl_istream &is)
 Initialise from a stream.
short version_no () const
 Version number for I/O.
virtual vcl_string is_a () const
 Name of the class.
virtual mfpf_region_definerclone () const
 Create a copy on the heap and return base class pointer.
virtual void print_summary (vcl_ostream &os) const
 Print class to os.
virtual void b_write (vsl_b_ostream &bfs) const
 Save class to binary file stream.
virtual void b_read (vsl_b_istream &bfs)
 Load class from binary file stream.

Static Public Member Functions

static vcl_auto_ptr
< mfpf_region_definer
create_from_stream (vcl_istream &is)
 Create a concrete object, from a text specification.

Private Attributes

unsigned i0_orig_
 Original index of point on which region is centred.
unsigned i0_
 Index of point on which region is centred.
unsigned i1_
 Index of first point defining reference frame.
unsigned i2_
 Index of second point defining reference frame.
double rel_wi_
 Width of ROI, relative to |p2-p1|.
double rel_wj_
 Height of ROI, relative to |p2-p1|.
double wi_
 Width of ROI in world coords.
double wj_
 Height of ROI in world coords.
vcl_string form_
 Name of form of shape ("box","ellipse").

Detailed Description

Region centred on a single point, pose defined by other pts.

Region defined by three points, p0=pts[i0], p1, p2. The region is centred on p0. Bounding box of region is aligned with the vector (p2-p1), and its width and height are defined relative to |p2-p1|

Parameters in text file:

    { i0: 5 i1: 31 i2: 37  rel_wi: 0.5 rel_wj: 0.2 form: box }
    

Definition at line 21 of file mfpf_region_about_pt.h.


Constructor & Destructor Documentation

mfpf_region_about_pt::mfpf_region_about_pt ( )

Dflt ctor.

Definition at line 20 of file mfpf_region_about_pt.cxx.

mfpf_region_about_pt::~mfpf_region_about_pt ( ) [virtual]

Destructor.

Definition at line 29 of file mfpf_region_about_pt.cxx.


Member Function Documentation

void mfpf_region_about_pt::b_read ( vsl_b_istream bfs) [virtual]

Load class from binary file stream.

Implements mfpf_region_definer.

Definition at line 199 of file mfpf_region_about_pt.cxx.

void mfpf_region_about_pt::b_write ( vsl_b_ostream bfs) const [virtual]

Save class to binary file stream.

Implements mfpf_region_definer.

Definition at line 182 of file mfpf_region_about_pt.cxx.

mfpf_region_definer * mfpf_region_about_pt::clone ( ) const [virtual]

Create a copy on the heap and return base class pointer.

Implements mfpf_region_definer.

Definition at line 162 of file mfpf_region_about_pt.cxx.

vcl_auto_ptr< mfpf_region_definer > mfpf_region_definer::create_from_stream ( vcl_istream &  is) [static, inherited]

Create a concrete object, from a text specification.

Definition at line 50 of file mfpf_region_definer.cxx.

vcl_string mfpf_region_about_pt::form ( ) const [inline]

Name of form of shape ("box","ellipse").

Definition at line 92 of file mfpf_region_about_pt.h.

vgl_point_2d< double > mfpf_region_about_pt::get_ref_point ( const vcl_vector< vgl_point_2d< double > > &  pts) const [virtual]

Returns reference point for region, pts[i0()].

Implements mfpf_region_definer.

Definition at line 70 of file mfpf_region_about_pt.cxx.

mfpf_region_form mfpf_region_about_pt::get_region ( const vcl_vector< vgl_point_2d< double > > &  pts) const [virtual]

Defines a region centred on a point.

The aspect ratio of the region will be the same as that from the last call to set_up.

Implements mfpf_region_definer.

Definition at line 97 of file mfpf_region_about_pt.cxx.

unsigned mfpf_region_about_pt::i0 ( ) const [inline]

Index of point on which region is centred.

Definition at line 71 of file mfpf_region_about_pt.h.

unsigned mfpf_region_about_pt::i1 ( ) const [inline]

Index of first point defining reference frame.

Definition at line 74 of file mfpf_region_about_pt.h.

unsigned mfpf_region_about_pt::i2 ( ) const [inline]

Index of second point defining reference frame.

Definition at line 77 of file mfpf_region_about_pt.h.

vcl_string mfpf_region_about_pt::is_a ( ) const [virtual]

Name of the class.

Reimplemented from mfpf_region_definer.

Definition at line 156 of file mfpf_region_about_pt.cxx.

bool mfpf_region_about_pt::is_centred_on_pt ( ) const [virtual]

Returns true as the region is centred on an input point.

Implements mfpf_region_definer.

Definition at line 34 of file mfpf_region_about_pt.cxx.

unsigned mfpf_region_about_pt::orig_ref_point_index ( ) const [virtual]

Returns original index of reference point on which the region is centred.

Implements mfpf_region_definer.

Definition at line 46 of file mfpf_region_about_pt.cxx.

void mfpf_region_about_pt::print_summary ( vcl_ostream &  os) const [virtual]

Print class to os.

Implements mfpf_region_definer.

Definition at line 171 of file mfpf_region_about_pt.cxx.

unsigned mfpf_region_about_pt::ref_point_index ( ) const [virtual]

Returns index of reference point on which the region is centred.

Implements mfpf_region_definer.

Definition at line 40 of file mfpf_region_about_pt.cxx.

double mfpf_region_about_pt::rel_wi ( ) const [inline]

Width of ROI, relative to |p2-p1|.

Definition at line 80 of file mfpf_region_about_pt.h.

double mfpf_region_about_pt::rel_wj ( ) const [inline]

Height of ROI, relative to |p2-p1|.

Definition at line 83 of file mfpf_region_about_pt.h.

bool mfpf_region_about_pt::replace_index ( const vcl_vector< unsigned > &  new_index) [virtual]

Replace each point index i with new_index[i].

Allows for re-numbering of the points used. Returns true if successful.

Implements mfpf_region_definer.

Definition at line 54 of file mfpf_region_about_pt.cxx.

bool mfpf_region_about_pt::set_from_stream ( vcl_istream &  is) [virtual]

Initialise from a stream.

Initialise from a string stream.

Reimplemented from mfpf_region_definer.

Definition at line 118 of file mfpf_region_about_pt.cxx.

mfpf_region_form mfpf_region_about_pt::set_up ( const vcl_vector< vgl_point_2d< double > > &  pts) [virtual]

Defines a region centred on a point.

Implements mfpf_region_definer.

Definition at line 78 of file mfpf_region_about_pt.cxx.

short mfpf_region_about_pt::version_no ( ) const

Version number for I/O.

Reimplemented from mfpf_region_definer.

Definition at line 147 of file mfpf_region_about_pt.cxx.

double mfpf_region_about_pt::wi ( ) const [inline]

Width of ROI in world coords.

Definition at line 86 of file mfpf_region_about_pt.h.

double mfpf_region_about_pt::wj ( ) const [inline]

Height of ROI in world coords.

Definition at line 89 of file mfpf_region_about_pt.h.


Member Data Documentation

vcl_string mfpf_region_about_pt::form_ [private]

Name of form of shape ("box","ellipse").

Definition at line 46 of file mfpf_region_about_pt.h.

unsigned mfpf_region_about_pt::i0_ [private]

Index of point on which region is centred.

Definition at line 27 of file mfpf_region_about_pt.h.

unsigned mfpf_region_about_pt::i0_orig_ [private]

Original index of point on which region is centred.

Definition at line 25 of file mfpf_region_about_pt.h.

unsigned mfpf_region_about_pt::i1_ [private]

Index of first point defining reference frame.

Definition at line 29 of file mfpf_region_about_pt.h.

unsigned mfpf_region_about_pt::i2_ [private]

Index of second point defining reference frame.

Definition at line 31 of file mfpf_region_about_pt.h.

Width of ROI, relative to |p2-p1|.

Definition at line 34 of file mfpf_region_about_pt.h.

Height of ROI, relative to |p2-p1|.

Definition at line 37 of file mfpf_region_about_pt.h.

double mfpf_region_about_pt::wi_ [private]

Width of ROI in world coords.

Definition at line 40 of file mfpf_region_about_pt.h.

double mfpf_region_about_pt::wj_ [private]

Height of ROI in world coords.

Definition at line 43 of file mfpf_region_about_pt.h.


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