00001 #include <libxml/parser.h>
00002
00003 #ifndef INCLUDED_POLYGON
00004 #define INCLUDED_POLYGON
00005
00006 #ifndef INCLUDED_VIEWER
00007 #include "viewer.h"
00008 #endif
00009
00010 #ifndef INCLUDED_SCENE_GRAPH_PACK
00011 #include "scene_graph_pack.h"
00012 #endif
00013
00014 #ifndef INCLUDED_POLYGON_PACK
00015 #include "polygon_pack.h"
00016 #endif
00017
00018
00019 #ifndef INCLUDED_SPAN_PACK
00020 #include "span_pack.h"
00021 #endif
00022
00023
00024 class Polygon{
00025 public:
00026 int size;
00027 char *name;
00028 char *parent_name;
00029 float *data;
00030 float xyz[4];
00031 float angle[4];
00032 float c_xyz[4];
00033 float matrix[16];
00034 float *anim;
00035 int frame;
00036
00037 SDL_Surface *texture_image;
00038
00039
00040 Polygon *next;
00041 Polygon *child;
00042 Polygon *parent;
00043 Polygon *brother;
00044 Viewer *viewer;
00045
00046
00047 Polygon();
00048 void tree_check();
00049 void print_member();
00050 void parameter_change(char *name, float x, float y, float z, float ax, float ay, float az);
00051
00052 void draw(float *stack);
00053 void draw(SceneGraphPack *sgp);
00054 void draw(PolygonPack *pp);
00055 void draw(SPANPACK *sp);
00056 void tree_draw();
00057
00058
00059 void add_next();
00060 void create_tree();
00061
00062 void pickup_coordinate(char *cont);
00063 void pickup_normal(char *cont);
00064 void pickup_model(char *cont);
00065 void pickup_texture(char *cont);
00066 Uint32 get_rgb(int tx, int ty);
00067 void get_data(xmlNodePtr cur);
00068 void create_data(xmlNodePtr doc);
00069 void set_data(char *file_name);
00070 void delete_data();
00071 };
00072
00073 #endif