00001
00020 #ifndef POUTLINE_H
00021 #define POUTLINE_H
00022
00023 #include "grphics.h"
00024 #include "polyvert.h"
00025 #include "rect.h"
00026 #include "blckerr.h"
00027
00028 #define INTERSECTING MAX_INT16//no winding number
00029
00030 class OUTLINE;
00031
00032 ELISTIZEH_S (OUTLINE)
00037 class OUTLINE:public ELIST_LINK
00038 {
00039 public:
00040 OUTLINE() {
00041 }
00042 OUTLINE(
00043 const ICOORD &startpt,
00044 INT8 *compactloop,
00045 BOOL8 reverse,
00046 ICOORD bot_left,
00047 ICOORD top_right);
00048 OUTLINE(
00049 POLYPT_IT *poly_it);
00050
00051 OUTLINE_LIST *child() {
00052 return &children;
00053 }
00054
00055
00056 const BOX &bounding_box() const {
00057 return box;
00058 }
00059 void compute_bb();
00060
00061
00062 const ICOORD &start_pos() const {
00063 return start;
00064 }
00065 float area();
00066 POLYPT_LIST *polypts() {
00067 return &outline;
00068 }
00069
00070 BOOL8 operator< (
00071 OUTLINE & other);
00072 BOOL8 operator> (
00073 OUTLINE & other) {
00074 return other < *this;
00075 }
00076 INT16 winding_number(
00077 const FCOORD &testpt);
00078 void reverse();
00079
00080 void move(
00081 const FCOORD vec);
00082
00083 void scale(
00084 const float f);
00085 void scale(
00086 const FCOORD vec);
00087
00088 void plot(
00089 WINDOW window,
00090 COLOUR colour);
00091
00092 void prep_serialise() {
00093 outline.prep_serialise ();
00094 children.prep_serialise ();
00095 }
00096
00097 void dump(
00098 FILE *f) {
00099 outline.dump (f);
00100 children.dump (f);
00101 }
00102
00103 void de_dump(
00104 FILE *f) {
00105 outline.de_dump (f);
00106 children.de_dump (f);
00107 }
00108
00109
00110 make_serialise (OUTLINE) OUTLINE & operator= (
00111 const OUTLINE & source);
00112
00113 private:
00115 BOX box;
00117 ICOORD start;
00119 POLYPT_LIST outline;
00121 OUTLINE_LIST children;
00122 };
00123 #endif