JunkBox_Lib 1.10.1
Loading...
Searching...
No Matches
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
27typedef struct {
28 int xs;
29 int ys;
30 int zs;
31 int state;
33} BSGraph;
34
35
42typedef struct {
43 int xs;
44 int ys;
45 int zs;
46 int state;
48} WSGraph;
49
50
56typedef struct {
57 int xs;
58 int ys;
59 int zs;
60 int state;
61 int* gp;
62} ISGraph;
63
64
70typedef struct {
71 int xs;
72 int ys;
73 int zs;
74 int state;
75 double* gp;
76} FSGraph;
77
78
84typedef struct {
85 int xs;
86 int ys;
87 int zs;
88 int state;
90} VSGraph;
91
92
98typedef struct {
99 int xs;
100 int ys;
101 int zs;
102 int depth;
103 int state;
104 unsigned char *gp;
105} MSGraph;
106
107
113typedef 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
124typedef 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
135extern int ZeroBase;
136extern double RZxy;
137extern int ChkRZxy;
138
139
147
148BSGraph make_BSGraph(int xs, int ys, int zs);
149WSGraph make_WSGraph(int xs, int ys, int zs);
150FSGraph make_FSGraph(int xs, int ys, int zs);
151ISGraph make_ISGraph(int xs, int ys, int zs);
152VSGraph make_VSGraph(int xs, int ys, int zs);
153MSGraph make_MSGraph(int xs, int ys, int zs, int depth);
154
155BSGraph* new_BSGraph(int xs, int ys, int zs);
156WSGraph* new_WSGraph(int xs, int ys, int zs);
157FSGraph* new_FSGraph(int xs, int ys, int zs);
158ISGraph* new_ISGraph(int xs, int ys, int zs);
159VSGraph* new_VSGraph(int xs, int ys, int zs);
160MSGraph* new_MSGraph(int xs, int ys, int zs, int depth);
161
162WSGraph zoom_WSGraph(WSGraph vp, int zm, int mode);
163WSGraph grab_WSGraph(WSGraph vp, int x1, int y1, int x2, int y2);
164void copy_WSGraph(WSGraph src, WSGraph dst);
165
166int chk_RZxy(void);
167void set_RZxy(double rzm);
168void init_IRBound(IRBound* rb);
169void init_DRBound(DRBound* rb);
170#define unset_RZxy() {ChkRZxy=OFF;}
171
172void free_CmnHead(CmnHead* hd); // 共通ヘッダのメモリ領域を開放する
173void 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
WSGraph * new_WSGraph(int xs, int ys, int zs)
Definition gdata.c:364
WSGraph zoom_WSGraph(WSGraph vp, int zm, int mode)
Definition graph.c:1245
VSGraph * new_VSGraph(int xs, int ys, int zs)
Definition gdata.c:499
int ChkRZxy
Definition gdata.c:16
void set_RZxy(double rzm)
Definition gdata.c:818
BSGraph * new_BSGraph(int xs, int ys, int zs)
Definition gdata.c:319
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
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
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
MSGraph * new_MSGraph(int xs, int ys, int zs, int depth)
Definition gdata.c:545
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
ISGraph * new_ISGraph(int xs, int ys, int zs)
Definition gdata.c:454
グラフィックデータヘッダ定義
マトリックス&ベクトルライブラリ ヘッダ
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
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
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
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
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
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
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
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