JunkBox_Lib  1.10.2
gdata.h
Go to the documentation of this file.
1 
2 #ifndef __JBXL_GRAPHIC_DATA_H_
3 #define __JBXL_GRAPHIC_DATA_H_
4 
5 
15 #include "gheader.h"
16 #include "matrix.h"
17 
18 
20 // グラフィックデータの構造 (C)
21 
27 typedef struct {
28  int xs;
29  int ys;
30  int zs;
31  int state;
32  uByte* gp;
33 } BSGraph;
34 
35 
42 typedef struct {
43  int xs;
44  int ys;
45  int zs;
46  int state;
47  sWord* gp;
48 } WSGraph;
49 
50 
56 typedef struct {
57  int xs;
58  int ys;
59  int zs;
60  int state;
61  int* gp;
62 } ISGraph;
63 
64 
70 typedef struct {
71  int xs;
72  int ys;
73  int zs;
74  int state;
75  double* gp;
76 } FSGraph;
77 
78 
84 typedef struct {
85  int xs;
86  int ys;
87  int zs;
88  int state;
90 } VSGraph;
91 
92 
98 typedef struct {
99  int xs;
100  int ys;
101  int zs;
102  int depth;
103  int state;
104  unsigned char *gp;
105 } MSGraph;
106 
107 
113 typedef struct {
114  int xmin;
115  int xmax;
116  int ymin;
117  int ymax;
118  int zmin;
119  int zmax;
120  int misc;
121 } IRBound;
122 
123 
124 typedef struct {
125  double xmin;
126  double xmax;
127  double ymin;
128  double ymax;
129  double zmin;
130  double zmax;
131  int misc;
132 } DRBound;
133 
134 
135 extern int ZeroBase;
136 extern double RZxy;
137 extern int ChkRZxy;
138 
139 
147 
148 BSGraph make_BSGraph(int xs, int ys, int zs);
149 WSGraph make_WSGraph(int xs, int ys, int zs);
150 FSGraph make_FSGraph(int xs, int ys, int zs);
151 ISGraph make_ISGraph(int xs, int ys, int zs);
152 VSGraph make_VSGraph(int xs, int ys, int zs);
153 MSGraph make_MSGraph(int xs, int ys, int zs, int depth);
154 
155 BSGraph* new_BSGraph(int xs, int ys, int zs);
156 WSGraph* new_WSGraph(int xs, int ys, int zs);
157 FSGraph* new_FSGraph(int xs, int ys, int zs);
158 ISGraph* new_ISGraph(int xs, int ys, int zs);
159 VSGraph* new_VSGraph(int xs, int ys, int zs);
160 MSGraph* new_MSGraph(int xs, int ys, int zs, int depth);
161 
162 WSGraph zoom_WSGraph(WSGraph vp, int zm, int mode);
163 WSGraph grab_WSGraph(WSGraph vp, int x1, int y1, int x2, int y2);
164 void copy_WSGraph(WSGraph src, WSGraph dst);
165 
166 int chk_RZxy(void);
167 void set_RZxy(double rzm);
168 void init_IRBound(IRBound* rb);
169 void init_DRBound(DRBound* rb);
170 #define unset_RZxy() {ChkRZxy=OFF;}
171 
172 void free_CmnHead(CmnHead* hd); // 共通ヘッダのメモリ領域を開放する
173 void init_CmnHead(CmnHead* hd);
174 
175 #define free_Graph(v) {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}
176 #define free_WSGraph(v) {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}
177 #define free_BSGraph(v) {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}
178 #define free_FSGraph(v) {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}
179 #define free_ISGraph(v) {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}
180 #define free_VSGraph(v) {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=0; (v)->state=JBXL_NORMAL;}}
181 #define free_MSGraph(v) {if((v)!=NULL){if((v)->gp)free((v)->gp); (v)->gp=NULL; (v)->xs=(v)->ys=(v)->zs=(v)->depth=0; (v)->state=JBXL_NORMAL;}}
182 
183 #define del_Graph(v) {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
184 #define del_WSGraph(v) {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
185 #define del_BSGraph(v) {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
186 #define del_FSGraph(v) {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
187 #define del_ISGraph(v) {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
188 #define del_VSGraph(v) {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
189 #define del_MSGraph(v) {if((v)!=NULL && *(v)!=NULL) {if((*(v))->gp)free((*(v))->gp); free((*(v)); *(v)=NULL}}
190 
191 #define Lx(v, i) ((v).gp[(i)])
192 #define Px(v, i, j) ((v).gp[(i)+(v).xs*(j)])
193 #define Vx(v, i, j, k) ((v).gp[(i)+(v).xs*(j)+(v).xs*(v).ys*(k)])
194 
195 #define pLx(v, i) ((v)->gp[(i)])
196 #define pPx(v, i, j) ((v)->gp[(i)+(v)->xs*(j)])
197 #define pVx(v, i, j, k) ((v)->gp[(i)+(v)->xs*(j)+(v)->xs*(v)->ys*(k)])
198 
199 #define Lxt(v, i) ((v).gp[((i)-1)])
200 #define Pxt(v, i, j) ((v).gp[((i)-1)+(v).xs*((j)-1)])
201 #define Vxt(v, i, j, k) ((v).gp[((i)-1)+(v).xs*((j)-1)+(v).xs*(v).ys*((k)-1)])
202 
203 #define pLxt(v, i) ((v)->gp[((i)-1)])
204 #define pPxt(v, i, j) ((v)->gp[((i)-1)+(v)->xs*((j)-1)])
205 #define pVxt(v, i, j, k) ((v)->gp[((i)-1)+(v)->xs*((j)-1)+(v)->xs*(v).ys->((k)-1)])
206 
207 
208 #endif // __JBXL_GRAPHIC_DATA_H_
209 
short sWord
2Byte
Definition: common.h:335
unsigned char uByte
1Byte
Definition: common.h:332
FSGraph V2FSGraph(VSGraph vp)
Definition: gdata.c:742
BSGraph make_BSGraph(int xs, int ys, int zs)
Definition: gdata.c:66
FSGraph * new_FSGraph(int xs, int ys, int zs)
Definition: gdata.c:409
WSGraph I2WSGraph(ISGraph vp)
Definition: gdata.c:680
MSGraph make_MSGraph(int xs, int ys, int zs, int depth)
Definition: gdata.c:277
WSGraph make_WSGraph(int xs, int ys, int zs)
Definition: gdata.c:108
WSGraph grab_WSGraph(WSGraph vp, int x1, int y1, int x2, int y2)
Definition: graph.c:1311
FSGraph W2FSGraph(WSGraph vp)
Definition: gdata.c:618
ISGraph * new_ISGraph(int xs, int ys, int zs)
Definition: gdata.c:454
WSGraph zoom_WSGraph(WSGraph vp, int zm, int mode)
Definition: graph.c:1245
int ChkRZxy
Definition: gdata.c:16
void set_RZxy(double rzm)
Definition: gdata.c:818
VSGraph * new_VSGraph(int xs, int ys, int zs)
Definition: gdata.c:499
MSGraph * new_MSGraph(int xs, int ys, int zs, int depth)
Definition: gdata.c:545
void init_CmnHead(CmnHead *hd)
Definition: gdata.c:44
void free_CmnHead(CmnHead *hd)
Definition: gdata.c:27
VSGraph make_VSGraph(int xs, int ys, int zs)
Definition: gdata.c:234
BSGraph * new_BSGraph(int xs, int ys, int zs)
Definition: gdata.c:319
FSGraph make_FSGraph(int xs, int ys, int zs)
Definition: gdata.c:150
ISGraph make_ISGraph(int xs, int ys, int zs)
Definition: gdata.c:192
WSGraph * new_WSGraph(int xs, int ys, int zs)
Definition: gdata.c:364
double RZxy
Definition: gdata.c:15
void copy_WSGraph(WSGraph src, WSGraph dst)
Definition: graph.c:1352
void init_DRBound(DRBound *rb)
Definition: gdata.c:802
int chk_RZxy(void)
Definition: gdata.c:832
WSGraph F2WSGraph(FSGraph vp)
Definition: gdata.c:711
WSGraph V2WSGraph(VSGraph vp)
Definition: gdata.c:765
ISGraph W2ISGraph(WSGraph vp)
Definition: gdata.c:587
WSGraph B2WSGraph(BSGraph vp)
Definition: gdata.c:649
void init_IRBound(IRBound *rb)
Definition: gdata.c:787
int ZeroBase
Definition: gdata.c:14
グラフィックデータヘッダ定義
マトリックス&ベクトルライブラリ ヘッダ
Definition: gdata.h:27
int zs
zサイズ. 4Byte. 2Dの場合は 1.
Definition: gdata.h:30
int xs
xサイズ. 4Byte.
Definition: gdata.h:28
int state
状態
Definition: gdata.h:31
uByte * gp
グラフィックデータへのポインタ. xs*ys*zs*1Byte.
Definition: gdata.h:32
int ys
yサイズ. 4Byte.
Definition: gdata.h:29
Definition: gdata.h:124
double xmax
Definition: gdata.h:126
int misc
Definition: gdata.h:131
double ymin
Definition: gdata.h:127
double zmin
Definition: gdata.h:129
double xmin
Definition: gdata.h:125
double zmax
Definition: gdata.h:130
double ymax
Definition: gdata.h:128
Definition: gdata.h:70
int zs
zサイズ. 4Byte. 2Dの場合は 1.
Definition: gdata.h:73
int xs
xサイズ. 4Byte.
Definition: gdata.h:71
int state
状態
Definition: gdata.h:74
double * gp
グラフィックデータへのポインタ. xs*ys*zs*sizeof(double)
Definition: gdata.h:75
int ys
yサイズ. 4Byte.
Definition: gdata.h:72
Definition: gdata.h:113
int xmax
x軸境界の最大値.
Definition: gdata.h:115
int misc
多目的用.
Definition: gdata.h:120
int ymax
y軸境界の最大値.
Definition: gdata.h:117
int xmin
x軸境界の最小値.
Definition: gdata.h:114
int ymin
y軸境界の最小値.
Definition: gdata.h:116
int zmax
z軸境界の最大値.
Definition: gdata.h:119
int zmin
z軸境界の最小値.
Definition: gdata.h:118
Definition: gdata.h:56
int zs
zサイズ. 4Byte. 2Dの場合は 1.
Definition: gdata.h:59
int xs
xサイズ. 4Byte.
Definition: gdata.h:57
int state
状態
Definition: gdata.h:60
int ys
yサイズ. 4Byte.
Definition: gdata.h:58
int * gp
グラフィックデータへのポインタ. xs*ys*zs*4Byte
Definition: gdata.h:61
Definition: gdata.h:98
int zs
zサイズ. 4Byte. 2Dの場合は 1.
Definition: gdata.h:101
int xs
xサイズ. 4Byte.
Definition: gdata.h:99
int state
状態
Definition: gdata.h:103
unsigned char * gp
グラフィックデータへのポインタ. xs*ys*zs*depth.
Definition: gdata.h:104
int depth
Color Depth.
Definition: gdata.h:102
int ys
yサイズ. 4Byte.
Definition: gdata.h:100
Definition: gdata.h:84
int zs
zサイズ. 4Byte. 2Dの場合は 1.
Definition: gdata.h:87
int xs
xサイズ. 4Byte.
Definition: gdata.h:85
int state
状態
Definition: gdata.h:88
vector * gp
グラフィックデータへのポインタ. xs*ys*zs*sizeof(vector).
Definition: gdata.h:89
int ys
yサイズ. 4Byte.
Definition: gdata.h:86
Definition: gdata.h:42
int zs
zサイズ. 4Byte. 2Dの場合は 1.
Definition: gdata.h:45
int xs
xサイズ. 4Byte.
Definition: gdata.h:43
int state
状態
Definition: gdata.h:46
sWord * gp
グラフィックデータへのポインタ. xs*ys*zs*2Byte.
Definition: gdata.h:47
int ys
yサイズ. 4Byte.
Definition: gdata.h:44
Definition: matrix.h:29