annotate old/simple_render/polygon.h @ 1740:5a294d8e5643 draft

fix
author Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
date Tue, 12 Nov 2013 16:56:43 +0900
parents 3bc98f6d31ff
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
1 #include <libxml/parser.h>
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
2
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
3 #ifndef INCLUDED_POLYGON
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
4 #define INCLUDED_POLYGON
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
5
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
6 #ifndef INCLUDED_VIEWER
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
7 #include "viewer.h"
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
8 #endif
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
9
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
10 #ifndef INCLUDED_SCENE_GRAPH_PACK
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
11 #include "scene_graph_pack.h"
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
12 #endif
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
13
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
14 #ifndef INCLUDED_POLYGON_PACK
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
15 #include "polygon_pack.h"
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
16 #endif
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
17
85
9b96b190cb73 *** empty log message ***
gongo
parents: 26
diff changeset
18
9b96b190cb73 *** empty log message ***
gongo
parents: 26
diff changeset
19 #ifndef INCLUDED_SPAN_PACK
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
20 #include "SpanPack.h"
85
9b96b190cb73 *** empty log message ***
gongo
parents: 26
diff changeset
21 #endif
9b96b190cb73 *** empty log message ***
gongo
parents: 26
diff changeset
22
9b96b190cb73 *** empty log message ***
gongo
parents: 26
diff changeset
23
26
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
24 class Polygon{
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
25 public:
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
26 int size;
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
27 char *name;
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
28 char *parent_name;
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
29 float *data; //"vertex" and "normal" and "texture"
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
30 float xyz[4]; // position
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
31 float angle[4]; // angle
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
32 float c_xyz[4]; // center of rotation
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
33 float matrix[16];
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
34 float *anim;
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
35 int frame; // anime frame num
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
36 //int *texture; // pointer of this surface's texture
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
37 static SDL_Surface* texture_image; // pointer of this surface's texture
26
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
38 //SDL_Surface *screen;
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
39 //char image_name[20]; // texture image name
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
40 Polygon *next;
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
41 Polygon *child;
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
42 Polygon *parent;
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
43 Polygon *brother;
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
44 Viewer *viewer;
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
45 //SceneGraphPack *sgp;
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
46
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
47 Polygon();
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
48 void tree_check();
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
49 void print_member();
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
50 void parameter_change(char *name, float x, float y, float z, float ax, float ay, float az);
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
51 //void load_texture(char *image_name);
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
52 void draw(float *stack);
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
53 void draw(SceneGraphPack *sgp);
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
54 void draw(PolygonPack *pp);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
55 void draw(SpanPack *sp);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
56 void draw(SpanPackList *sp);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
57 void delete_data();
26
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
58 void tree_draw();
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
59 void get_data(xmlNodePtr cur);
26
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
60 void pickup_coordinate(char *cont);
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
61 void pickup_normal(char *cont);
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
62 void pickup_model(char *cont);
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
63 void pickup_texture(char *cont);
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
64 Uint32 get_rgb(int tx, int ty);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
65 //void sgp_update();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
66 //void sgp_draw();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
67 //void create_scene_graph_pack();
26
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
68 void create_data(xmlNodePtr doc);
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
69 void set_data(char *file_name);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
70 void add_next();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
71 void create_tree();
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
72
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
73 /* added by kent. */
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
74 Polygon(xmlNodePtr);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
75 Polygon *addChild(Polygon *);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
76 Polygon *children;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
77 Polygon *lastChild;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
78 Polygon *searchPolygon(char *);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 89
diff changeset
79 static Polygon *createFromXMLfile(char *);
26
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
80 };
3f68b2ef4fb0 *** empty log message ***
gongo
parents:
diff changeset
81 #endif