//pattern.h #if !defined(PATTERN_H__INCLUDED_) #define PATTERN_H__INCLUDED_ #include "Messaging.h" struct pattern_config { int format; double scale; void clear(void); }; struct stitch { int flags; // uses codes defined below double xx; // absolute position (not relative) double yy; double a; // angle into this node double da; // angle out - angle in double l; // length into this node // double a(void); // calculate angle into this node // double da(void); // calculate angle out - angle in // double l(void); // calculate length into this node }; struct color { COLORREF rgb; char *description; char *catalog_number; }; class pattern { public: int stitches; int colors; int num_variables; struct stitch *stitchlist; struct color *colorlist; char **variable_name; char **variable_value; struct pattern_config config; class messages messages; private: int allocated_stitches; int allocated_colors; int allocated_variables; public: pattern(); // constructor ~pattern(); // destructor void clear(); void set_variable(const char *name, const char *value); char *get_variable(const char *name); int get_variable_int(const char *name); double get_variable_double(const char *name); void delete_variable(const char *name); int add_color (COLORREF rgb, const char *description, const char *catalog_number); int add_stitch_abs(double x, double y, int flags); int add_stitch_rel(double dx, double dy, int flags); int add_stitch_copy (struct stitch src); int delete_stitch (int number); int move_last_stitch (int number); // void print_stitchlist(char *filename); BOOL read_dst(const char *filename); BOOL write_dst(const char *filename); BOOL read_csv(const char *filename); BOOL write_csv(const char *filename); // void read_dst(CFile *dstin); // void write_dst(CFile *dstout); // void read_csv(CFile *csvin); // void write_csv(CFile *csvout); void scale_pattern (double scale); void statistics (void); void create_test(void); struct lfRECT get_dimensions(void); void calculate_angles(void); // int load(CFile *fp); // int save(CFile *fp); }; // Codes for stitch types (in struct stitch.flags) #define NORMAL 0 #define UNKNOWN 1 #define JUMP 2 #define STOP 3 #define END 4 #define LINE 10 #define SATINLINE 11 #define ZIGZAGLINE 12 #define REGION 13 #define TRIANGLE 14 #endif