KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
kjb::Corner Class Reference

Class to manipulate a 2D corner. The corener is defined in terms of a set of line segments all intersecting at a point in the image, which is the corner position. No consistency controls are performed here. More...

#include <corner.h>

Inheritance diagram for kjb::Corner:
kjb::Readable kjb::Writeable

Public Member Functions

 Corner ()
 Constructor without initializations. More...
 
 Corner (const kjb::Vector &iposition)
 Constructor without initializations. More...
 
 Corner (const Corner &src)
 
 Corner (const char *filename)
 
 Corner (std::istream &in)
 
Corneroperator= (const Corner &src)
 
const kjb::Vectorget_position () const
 
const std::vector
< kjb::Line_segment > & 
get_segments () const
 
void set_position (const kjb::Vector &iposition)
 
void add_segment (const kjb::Line_segment &isegment)
 
const kjb::Line_segmentget_segment (unsigned int i) const
 
void set_segment (unsigned int i, const kjb::Line_segment isegment)
 
unsigned int get_num_segments () const
 
void read (std::istream &in)
 Reads this Line segment from an input stream. More...
 
void write (std::ostream &out) const
 Writes this Line segment to an output stream. More...
 
virtual void draw (kjb::Image &img, double ir, double ig, double ib, double width=1.0) const
 Draws this line segment. More...
 
virtual void randomly_color (kjb::Image &img, double width=1.0) const
 Randomly colors this line segment on an image. More...
 
- Public Member Functions inherited from kjb::Readable
virtual ~Readable ()
 Deletes this Readable. More...
 
virtual void read (const char *fname)
 Reads this Readable from a file. More...
 
- Public Member Functions inherited from kjb::Writeable
virtual ~Writeable ()
 Deletes this Writeable. More...
 
virtual void write (const char *fname) const
 Writes this Writeable to a file. More...
 

Protected Attributes

kjb::Vector position
 position of this 2D corner More...
 
std::vector< kjb::Line_segmentsegments
 

Additional Inherited Members

- Static Public Member Functions inherited from kjb::Readable
static const char * read_field_value (std::istream &in, const char *field_name, char *field_buf, size_t buf_len, char separator=':')
 Reads a line off in into a buffer and returns a pointer to the field value in the buffer. More...
 
static const char * read_field_value (std::istream &in, const char *field_name, char separator=':')
 Reads a line off in into an internal buffer and returns a pointer to the field value in the buffer. More...
 

Detailed Description

Class to manipulate a 2D corner. The corener is defined in terms of a set of line segments all intersecting at a point in the image, which is the corner position. No consistency controls are performed here.

Constructor & Destructor Documentation

kjb::Corner::Corner ( )
inline

Constructor without initializations.

kjb::Corner::Corner ( const kjb::Vector iposition)
inline

Constructor without initializations.

kjb::Corner::Corner ( const Corner src)
inline
kjb::Corner::Corner ( const char *  filename)
inline
kjb::Corner::Corner ( std::istream &  in)
inline

Member Function Documentation

void kjb::Corner::add_segment ( const kjb::Line_segment isegment)
inline
void Corner::draw ( kjb::Image img,
double  ir,
double  ig,
double  ib,
double  width = 1.0 
) const
virtual

Draws this line segment.

unsigned int kjb::Corner::get_num_segments ( ) const
inline
const kjb::Vector& kjb::Corner::get_position ( ) const
inline
const kjb::Line_segment& kjb::Corner::get_segment ( unsigned int  i) const
inline
const std::vector<kjb::Line_segment>& kjb::Corner::get_segments ( ) const
inline
Corner& kjb::Corner::operator= ( const Corner src)
inline
void Corner::randomly_color ( kjb::Image img,
double  width = 1.0 
) const
virtual

Randomly colors this line segment on an image.

void Corner::read ( std::istream &  in)
virtual

Reads this Line segment from an input stream.

Implements kjb::Readable.

void kjb::Corner::set_position ( const kjb::Vector iposition)
inline
void kjb::Corner::set_segment ( unsigned int  i,
const kjb::Line_segment  isegment 
)
inline
void Corner::write ( std::ostream &  out) const
virtual

Writes this Line segment to an output stream.

Implements kjb::Writeable.

Member Data Documentation

kjb::Vector kjb::Corner::position
protected

position of this 2D corner

std::vector<kjb::Line_segment> kjb::Corner::segments
protected

The segments forming this corner


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