List of points making a curve - for defining boundaries. More...
#include <msm_curve.h>
Public Member Functions | |
msm_curve () | |
msm_curve (unsigned lo, unsigned hi, bool open=true, vcl_string name="") | |
Define as range of indices [lo,hi]. | |
~msm_curve () | |
vcl_size_t | size () const |
Number of points defining the curve. | |
void | set (const vcl_vector< unsigned > &index, bool open=true, vcl_string name="") |
void | set (unsigned lo, unsigned hi, bool open=true, vcl_string name="") |
Define as range of indices [lo,hi]. | |
const vcl_string & | name () const |
Name of this curve or boundary. | |
bool | open () const |
True if this is an open curve (else closed curve). | |
void | set_open (bool b) |
Indicate if this is an open curve. | |
vcl_vector< unsigned > & | index () |
List of point indices representing curve. | |
const vcl_vector< unsigned > & | index () const |
List of point indices representing curve. | |
unsigned | operator[] (unsigned i) const |
unsigned | max_index () const |
Return the largest index value. | |
void | add_index_offset (int offset) |
Adds offset to index of every point. | |
void | config_from_stream (vcl_istream &) |
Parse parameters in stream. | |
void | print_summary (vcl_ostream &os) const |
Print class to os. | |
void | b_write (vsl_b_ostream &bfs) const |
Save class to binary file stream. | |
void | b_read (vsl_b_istream &bfs) |
Load class from binary file stream. | |
bool | operator== (const msm_curve &curve) const |
Equality test. | |
Private Attributes | |
vcl_string | name_ |
Name of this curve or boundary. | |
bool | open_ |
True if this is an open curve (else closed curve). | |
vcl_vector< unsigned > | index_ |
List of point indices representing curve. |
List of points making a curve - for defining boundaries.
A curve is a sequence of point indices indicating how to joint the dots to form a boundary, for instance for display or in an Active Shape Model.
If closed, then last point assumed to be connected to the first.
Definition at line 22 of file msm_curve.h.
msm_curve::msm_curve | ( | ) |
Definition at line 21 of file msm_curve.cxx.
msm_curve::msm_curve | ( | unsigned | lo, |
unsigned | hi, | ||
bool | open = true , |
||
vcl_string | name = "" |
||
) |
Define as range of indices [lo,hi].
Definition at line 26 of file msm_curve.cxx.
msm_curve::~msm_curve | ( | ) | [inline] |
Definition at line 42 of file msm_curve.h.
void msm_curve::add_index_offset | ( | int | offset | ) |
Adds offset to index of every point.
Useful when concatenating models
Definition at line 64 of file msm_curve.cxx.
void msm_curve::b_read | ( | vsl_b_istream & | bfs | ) |
Load class from binary file stream.
Definition at line 130 of file msm_curve.cxx.
void msm_curve::b_write | ( | vsl_b_ostream & | bfs | ) | const |
Save class to binary file stream.
Definition at line 119 of file msm_curve.cxx.
void msm_curve::config_from_stream | ( | vcl_istream & | is | ) |
Parse parameters in stream.
Expects
{ name: Chin open: true indices: { 0 1 2 3 4 5 6 } } or equivalently { name: Chin open: true indices: { 0 : 6 } }
Expects
{ name: Chin open: true indices: { 0 1 2 3 4 5 6 } }
Definition at line 84 of file msm_curve.cxx.
vcl_vector<unsigned>& msm_curve::index | ( | ) | [inline] |
List of point indices representing curve.
Definition at line 64 of file msm_curve.h.
const vcl_vector<unsigned>& msm_curve::index | ( | ) | const [inline] |
List of point indices representing curve.
Definition at line 67 of file msm_curve.h.
unsigned msm_curve::max_index | ( | ) | const |
Return the largest index value.
Definition at line 52 of file msm_curve.cxx.
const vcl_string& msm_curve::name | ( | ) | const [inline] |
Name of this curve or boundary.
Definition at line 55 of file msm_curve.h.
bool msm_curve::open | ( | ) | const [inline] |
True if this is an open curve (else closed curve).
Definition at line 58 of file msm_curve.h.
bool msm_curve::operator== | ( | const msm_curve & | curve | ) | const |
Equality test.
Definition at line 71 of file msm_curve.cxx.
unsigned msm_curve::operator[] | ( | unsigned | i | ) | const [inline] |
Definition at line 69 of file msm_curve.h.
void msm_curve::print_summary | ( | vcl_ostream & | os | ) | const |
Print class to os.
Definition at line 107 of file msm_curve.cxx.
void msm_curve::set | ( | const vcl_vector< unsigned > & | index, |
bool | open = true , |
||
vcl_string | name = "" |
||
) |
Definition at line 32 of file msm_curve.cxx.
void msm_curve::set | ( | unsigned | lo, |
unsigned | hi, | ||
bool | open = true , |
||
vcl_string | name = "" |
||
) |
Define as range of indices [lo,hi].
Definition at line 41 of file msm_curve.cxx.
void msm_curve::set_open | ( | bool | b | ) | [inline] |
Indicate if this is an open curve.
Definition at line 61 of file msm_curve.h.
vcl_size_t msm_curve::size | ( | ) | const [inline] |
Number of points defining the curve.
Definition at line 45 of file msm_curve.h.
vcl_vector<unsigned> msm_curve::index_ [private] |
List of point indices representing curve.
Definition at line 32 of file msm_curve.h.
vcl_string msm_curve::name_ [private] |
Name of this curve or boundary.
Definition at line 26 of file msm_curve.h.
bool msm_curve::open_ [private] |
True if this is an open curve (else closed curve).
Definition at line 29 of file msm_curve.h.