ICOORDELT Class Reference

#include <points.h>

Inheritance diagram for ICOORDELT:

ELIST_LINK ICOORD List of all members.

Detailed Description

Class for dealing with embedded list of ICOORD, coordinates.

Definition at line 151 of file points.h.

Public Member Functions

Protected Attributes

Friends


Constructor & Destructor Documentation

ICOORDELT::ICOORDELT (  )  [inline]

Definition at line 154 of file points.h.

00154                 {  //empty constructor
00155     }

ICOORDELT::ICOORDELT ( ICOORD  icoord  )  [inline]

Definition at line 156 of file points.h.

00158                   :ICOORD (icoord) {
00159     }

ICOORDELT::ICOORDELT ( INT16  xin,
INT16  yin 
) [inline]

Definition at line 160 of file points.h.

00162                          {  //y value
00163       xcoord = xin;
00164       ycoord = yin;
00165     }


Member Function Documentation

float ICOORD::angle (  )  const [inline, inherited]

Definition at line 91 of file points.h.

00091                         {  //find angle
00092       return (float) atan2 ((double) ycoord, (double) xcoord);
00093     }

void ICOORDELT::de_dump ( FILE *   )  [inline]

Definition at line 179 of file points.h.

00180                          {
00181     }

void ICOORDELT::de_serialise_asc ( FILE *  f  ) 

Convert from ascii

Reimplemented from ICOORD.

Definition at line 75 of file points.cpp.

00077                                   {
00078   ((ICOORD *) this)->de_serialise_asc (f);
00079 }

void ICOORDELT::dump ( FILE *   )  const [inline]

Definition at line 175 of file points.h.

00176                             {
00177     }

float ICOORD::length (  )  const [inline, inherited]

Definition at line 73 of file points.h.

00073                          {  //find length
00074       return (float) sqrt (sqlength ());
00075     }

ICOORDELT::make_serialise ( ICOORDELT   ) 

ICOORD::NEWDELETE2 ( ICOORD   )  const [inline, inherited]

Definition at line 52 of file points.h.

00053     {
00054       return xcoord;
00055     }

BOOL8 ICOORD::operator!= ( const ICOORD other  )  [inline, inherited]

Definition at line 99 of file points.h.

References ICOORD::xcoord, and ICOORD::ycoord.

00100                           {
00101       return xcoord != other.xcoord || ycoord != other.ycoord;
00102     }

BOOL8 ICOORD::operator== ( const ICOORD other  )  [inline, inherited]

Definition at line 95 of file points.h.

References ICOORD::xcoord, and ICOORD::ycoord.

00096                           {
00097       return xcoord == other.xcoord && ycoord == other.ycoord;
00098     }

void ICOORDELT::prep_serialise (  )  const [inline]

Note that prep_serialise() dump() and de_dump() dont need to do anything more than terminate recursion.

Definition at line 172 of file points.h.

00172                                 {  //set ptrs to counts
00173     }

float ICOORD::pt_to_pt_dist ( const ICOORD pt  )  const [inline, inherited]

Definition at line 86 of file points.h.

00087                                                 {
00088       return (float) sqrt (pt_to_pt_sqdist (pt));
00089     }

float ICOORD::pt_to_pt_sqdist ( const ICOORD pt  )  const [inline, inherited]

Definition at line 77 of file points.h.

References ICOORD::sqlength(), ICOORD::xcoord, and ICOORD::ycoord.

00078                                                   {
00079       ICOORD gap;
00080 
00081       gap.xcoord = xcoord - pt.xcoord;
00082       gap.ycoord = ycoord - pt.ycoord;
00083       return gap.sqlength ();
00084     }

void ICOORD::rotate ( const FCOORD vec  )  [inline, inherited]

Rotate an ICOORD by the given (normalized) (cos,sin) vector.

Definition at line 202 of file ipoints.h.

References ICOORD::xcoord, and ICOORD::ycoord.

Referenced by find_cblob_limits().

00203                                               {
00204   INT16 tmp;
00205 
00206   tmp = (INT16) floor (xcoord * vec.x () - ycoord * vec.y () + 0.5);
00207   ycoord = (INT16) floor (ycoord * vec.x () + xcoord * vec.y () + 0.5);
00208   xcoord = tmp;
00209 }

void ICOORD::serialise_asc ( FILE *  f  )  [inherited]

Convert to ascii

Definition at line 43 of file points.cpp.

References serialise_INT32(), ICOORD::xcoord, and ICOORD::ycoord.

Referenced by BOX::serialise_asc().

00045                             {
00046   serialise_INT32(f, xcoord); 
00047   serialise_INT32(f, ycoord); 
00048 }

void ELIST_LINK::serialise_asc ( FILE *  f  )  [inherited]

Generates an error, as it should never be called.

Definition at line 32 of file elst.cpp.

References ABORT, ERRCODE::error(), and SERIALISE_LINKS.

00033                                         {
00034   SERIALISE_LINKS.error ("ELIST_LINK::serialise_asc", ABORT,
00035     "Don't call this, override!");
00036 }

void ICOORD::set_x ( INT16  xin  )  [inline, inherited]

Definition at line 60 of file points.h.

Referenced by BOX::bounding_union(), compute_pitch_sd(), h_edge(), BOX::intersection(), loop_bounding_box(), BOX::move(), operator+=(), operator-=(), process_image_event(), POLY_BLOCK::rotate(), and v_edge().

00061                           {
00062       xcoord = xin;              //write new value
00063     }

void ICOORD::set_y ( INT16  yin  )  [inline, inherited]

Definition at line 64 of file points.h.

Referenced by BOX::bounding_union(), PB_LINE_IT::get_line(), h_edge(), BOX::intersection(), loop_bounding_box(), operator+=(), operator-=(), process_image_event(), POLY_BLOCK::rotate(), and v_edge().

00065                           {  //value to set
00066       ycoord = yin;
00067     }

float ICOORD::sqlength (  )  const [inline, inherited]

Definition at line 69 of file points.h.

Referenced by ICOORD::pt_to_pt_sqdist().

00069                            {  //find sq length
00070       return (float) (xcoord * xcoord + ycoord * ycoord);
00071     }

INT16 ICOORD::y (  )  const [inline, inherited]

Definition at line 56 of file points.h.

Referenced by PDLSQ::add(), block_edges(), BOX::bounding_union(), BOX::BOX(), POLY_BLOCK::compute_bb(), BOX::contains(), convert_vec_block(), OL_BUCKETS::count_children(), create_edges_window(), create_to_win(), dot_of_i(), draw_raw_edge(), edgesteps_to_edgepts(), OL_BUCKETS::extract_children(), find_cblob_hlimits(), find_cblob_limits(), find_cblob_vlimits(), PB_LINE_IT::get_line(), BLOCK_LINE_IT::get_line(), h_edge(), horizontal_coutline_projection(), BOX::intersection(), join_edges(), loop_bounding_box(), BOX::major_overlap(), QUAD_COEFFS::move(), OL_BUCKETS::OL_BUCKETS(), OL_BUCKETS::operator()(), operator+=(), operator-=(), BOX::overlap(), PDLSQ::remove(), POLY_BLOCK::rotate(), v_edge(), vertical_coutline_projection(), vertical_cunderline_projection(), and POLY_BLOCK::winding_number().

00056                     {  //access_function
00057       return ycoord;
00058     }


Friends And Related Function Documentation

ICOORD operator * ( INT16  scale,
const ICOORD op1 
) [friend, inherited]

Definition at line 145 of file ipoints.h.

00148                           {
00149   ICOORD result;                 //output
00150 
00151   result.xcoord = op1.xcoord * scale;
00152   result.ycoord = op1.ycoord * scale;
00153   return result;
00154 }

ICOORD operator * ( const ICOORD op1,
INT16  scale 
) [friend, inherited]

Scalar multiply of an ICOORD.

Definition at line 134 of file ipoints.h.

00136                                       {
00137   ICOORD result;                 //output
00138 
00139   result.xcoord = op1.xcoord * scale;
00140   result.ycoord = op1.ycoord * scale;
00141   return result;
00142 }

INT32 operator * ( const ICOORD op1,
const ICOORD op2 
) [friend, inherited]

Cross product of 2 ICOORDS.

Definition at line 124 of file ipoints.h.

00126                                            {
00127   return op1.xcoord * op2.ycoord - op1.ycoord * op2.xcoord;
00128 }

ICOORD& operator *= ( ICOORD op1,
INT16  scale 
) [friend, inherited]

Scalar multiply of an ICOORD.

Definition at line 161 of file ipoints.h.

00163              {
00164   op1.xcoord *= scale;
00165   op1.ycoord *= scale;
00166   return op1;
00167 }

ICOORD operator! ( const ICOORD src  )  [friend, inherited]

Rotate an ICOORD 90 degrees anticlockwise.

Definition at line 29 of file ipoints.h.

00031   {
00032   ICOORD result;                 //output
00033 
00034   result.xcoord = -src.ycoord;
00035   result.ycoord = src.xcoord;
00036   return result;
00037 }

INT32 operator% ( const ICOORD op1,
const ICOORD op2 
) [friend, inherited]

Scalar product of 2 ICOORDS.

Definition at line 114 of file ipoints.h.

00116                     {
00117   return op1.xcoord * op2.xcoord + op1.ycoord * op2.ycoord;
00118 }

ICOORD operator+ ( const ICOORD op1,
const ICOORD op2 
) [friend, inherited]

Add 2 ICOORDS.

Definition at line 58 of file ipoints.h.

00060                     {
00061   ICOORD sum;                    //result
00062 
00063   sum.xcoord = op1.xcoord + op2.xcoord;
00064   sum.ycoord = op1.ycoord + op2.ycoord;
00065   return sum;
00066 }

ICOORD& operator+= ( ICOORD op1,
const ICOORD op2 
) [friend, inherited]

Add 2 ICOORDS.

Definition at line 73 of file ipoints.h.

00075                     {
00076   op1.xcoord += op2.xcoord;
00077   op1.ycoord += op2.ycoord;
00078   return op1;
00079 }

ICOORD operator- ( const ICOORD op1,
const ICOORD op2 
) [friend, inherited]

Subtract 2 ICOORDS.

Definition at line 86 of file ipoints.h.

00088                     {
00089   ICOORD sum;                    //result
00090 
00091   sum.xcoord = op1.xcoord - op2.xcoord;
00092   sum.ycoord = op1.ycoord - op2.ycoord;
00093   return sum;
00094 }

ICOORD operator- ( const ICOORD src  )  [friend, inherited]

Unary minus of an ICOORD.

Definition at line 43 of file ipoints.h.

00045   {
00046   ICOORD result;                 //output
00047 
00048   result.xcoord = -src.xcoord;
00049   result.ycoord = -src.ycoord;
00050   return result;
00051 }

ICOORD& operator-= ( ICOORD op1,
const ICOORD op2 
) [friend, inherited]

Subtract 2 ICOORDS.

Definition at line 101 of file ipoints.h.

00103                     {
00104   op1.xcoord -= op2.xcoord;
00105   op1.ycoord -= op2.ycoord;
00106   return op1;
00107 }

ICOORD operator/ ( const ICOORD op1,
INT16  scale 
) [friend, inherited]

Scalar divide of an ICOORD.

Definition at line 175 of file ipoints.h.

00177              {
00178   ICOORD result;                 //output
00179 
00180   result.xcoord = op1.xcoord / scale;
00181   result.ycoord = op1.ycoord / scale;
00182   return result;
00183 }

ICOORD& operator/= ( ICOORD op1,
INT16  scale 
) [friend, inherited]

Scalar divide of an ICOORD.

Definition at line 190 of file ipoints.h.

00192              {
00193   op1.xcoord /= scale;
00194   op1.ycoord /= scale;
00195   return op1;
00196 }


Member Data Documentation

INT16 ICOORD::xcoord [protected, inherited]

x value

Definition at line 142 of file points.h.

Referenced by ICOORD::de_serialise_asc(), operator *(), operator *=(), operator!(), ICOORD::operator!=(), operator%(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), ICOORD::operator==(), ICOORD::pt_to_pt_sqdist(), ICOORD::rotate(), and ICOORD::serialise_asc().

INT16 ICOORD::ycoord [protected, inherited]

y value

Definition at line 144 of file points.h.

Referenced by ICOORD::de_serialise_asc(), operator *(), operator *=(), operator!(), ICOORD::operator!=(), operator%(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), ICOORD::operator==(), ICOORD::pt_to_pt_sqdist(), ICOORD::rotate(), and ICOORD::serialise_asc().


The documentation for this class was generated from the following files:
Generated on Wed Feb 28 19:49:32 2007 for Tesseract by  doxygen 1.5.1