00001 00020 #ifndef POLYBLOB_H 00021 #define POLYBLOB_H 00022 00023 #include "poutline.h" 00024 #include "rect.h" 00025 #include "normalis.h" 00026 #include "stepblob.h" 00027 00032 class PBLOB:public ELIST_LINK 00033 { 00034 public: 00035 PBLOB() { 00036 } //empty constructor 00037 PBLOB( //constructor 00038 OUTLINE_LIST *outline_list); //in random order 00039 PBLOB( //constructor 00040 C_BLOB *cblob, //polygonal approx 00041 float xheight); 00042 00043 OUTLINE_LIST *out_list() { //get outline list 00044 return &outlines; 00045 } 00046 00047 BOX bounding_box(); //compute bounding box 00048 float area(); //get area of blob 00049 00050 PBLOB *baseline_normalise( //normalise single blob 00051 ROW *row, //row it came from 00052 DENORM *denorm); //inverse mapping out 00053 void baseline_denormalise( //denormalise 00054 const DENORM *denorm); //antidote 00055 00056 void plot( //draw one 00057 WINDOW window, //window to draw in 00058 COLOUR blob_colour, //for outer bits 00059 COLOUR child_colour); //for holes 00060 00061 void move( // reposition blob 00062 const FCOORD vec); // by FLOAT vector 00063 00064 void scale( // scale blob 00065 const float f); // by multiplier 00066 void scale( // scale blob 00067 const FCOORD vec); // by FLOAT vector 00068 00069 void prep_serialise() { //set ptrs to counts 00070 outlines.prep_serialise (); 00071 } 00072 00073 void dump( //write external bits 00074 FILE *f) { 00075 outlines.dump (f); 00076 } 00077 00078 void de_dump( //read external bits 00079 FILE *f) { 00080 outlines.de_dump (f); 00081 } 00082 00083 //assignment 00084 make_serialise (PBLOB) PBLOB & operator= ( 00085 const PBLOB & source) { //from this 00086 if (!outlines.empty ()) 00087 outlines.clear (); 00088 00089 outlines.deep_copy (&source.outlines); 00090 return *this; 00091 } 00092 00093 private: 00095 OUTLINE_LIST outlines; 00096 }; 00097 00098 ELISTIZEH_S (PBLOB) 00099 #endif