ITK Function Reference

(V10000.1.0.60_20160308.00)
ugmath_datatypes.h
Go to the documentation of this file.
1 /*HEAD UGMATH_DATATYPES HHH UGMATH */
2 /*
3 *===============================================================================
4 *
5 * Copyright (c) 1999 Unigraphics Solutions Inc.
6 * Unpublished - All rights reserved
7 *
8 *===============================================================================
9 *
10 * Header file defining the data types used by the vector math package.
11 *
12 *===============================================================================
13 * Date Name
14 * 17-Aug-1999 Dennis Lavarini
15 27-Aug-2001 Allan Hansen Add 2D and 3D Boxes to package
16 12-Sep-2003 Radhika Vurputoor Added INT3
17 *$HISTORY$
18 *===============================================================================
19 */
20 
21 #ifndef UGMATH_DATATYPES_H_INCLUDED
22 #define UGMATH_DATATYPES_H_INCLUDED
23 
24 /*
25  * Definition for array of 3 integers
26  */
27 typedef struct INT3_s
28 {
29  int i3[3];
30 } INT3_t, *INT3_p_t;
31 
32 typedef const INT3_t INT3_c_t, *INT3_pc_t;
33 
34 #define INT3_0(p) ((p)->i3[0])
35 #define INT3_1(p) ((p)->i3[1])
36 #define INT3_2(p) ((p)->i3[2])
37 
38 /*
39 * Definition for 2-D vector
40 */
41 typedef struct VEC2_s
42 {
43  double v2[2];
44 } VEC2_t, *VEC2_p_t;
45 
46 typedef const VEC2_t VEC2_c_t, *VEC2_pc_t;
47 
48 #define VEC2_X(u) ((u)->v2[0])
49 #define VEC2_Y(u) ((u)->v2[1])
50 
51 /*
52 * Definition for 3-D vector
53 */
54 typedef struct VEC3_s
55 {
56  double v3[3];
57 } VEC3_t, *VEC3_p_t;
58 
59 typedef const VEC3_t VEC3_c_t, *VEC3_pc_t;
60 
61 #define VEC3_X(u) ((u)->v3[0])
62 #define VEC3_Y(u) ((u)->v3[1])
63 #define VEC3_Z(u) ((u)->v3[2])
64 
65 /*
66 * Definition for 2-D point
67 */
68 typedef struct PNT2_s
69 {
70  double p2[2];
71 } PNT2_t, *PNT2_p_t;
72 
73 typedef const PNT2_t PNT2_c_t, *PNT2_pc_t;
74 
75 #define PNT2_X(p) ((p)->p2[0])
76 #define PNT2_Y(p) ((p)->p2[1])
77 
78 /*
79 * Definition for 3-D point
80 */
81 typedef struct PNT3_s
82 {
83  double p3[3];
84 } PNT3_t, *PNT3_p_t;
85 
86 typedef const PNT3_t PNT3_c_t, *PNT3_pc_t;
87 
88 #define PNT3_X(p) ((p)->p3[0])
89 #define PNT3_Y(p) ((p)->p3[1])
90 #define PNT3_Z(p) ((p)->p3[2])
91 
92 /*
93 * Definition for 4-D point
94 */
95 typedef struct PNT4_s
96 {
97  double p4[4];
98 } PNT4_t, *PNT4_p_t;
99 
100 typedef const PNT4_t PNT4_c_t, *PNT4_pc_t;
101 
102 #define PNT4_X(p) ((p)->p4[0])
103 #define PNT4_Y(p) ((p)->p4[1])
104 #define PNT4_Z(p) ((p)->p4[2])
105 #define PNT4_W(p) ((p)->p4[3])
106 
107 /*
108 * Definition for 2 X 2 matrix
109 */
110 typedef struct MTX2_s
111 {
112  double m2[4];
113 } MTX2_t, *MTX2_p_t;
114 
115 typedef const MTX2_t MTX2_c_t, *MTX2_pc_t;
116 
117 /*
118 * Definition for 3 X 3 matrix
119 */
120 typedef struct MTX3_s
121 {
122  double m3[9];
123 } MTX3_t, *MTX3_p_t;
124 
125 typedef const MTX3_t MTX3_c_t, *MTX3_pc_t;
126 
127 /*
128 * Definition for 4 X 4 matrix
129 */
130 typedef struct MTX4_s
131 {
132  double m4[16];
133 } MTX4_t, *MTX4_p_t;
134 
135 typedef const MTX4_t MTX4_c_t, *MTX4_pc_t;
136 
137 /*
138 * Definition for 3-D plane
139 */
140 typedef struct PLN3_s
141 {
144 } PLN3_t, *PLN3_p_t;
145 
146 typedef const PLN3_t PLN3_c_t, *PLN3_pc_t;
147 
148 /*
149 * Definition for 3-D coordinate system
150 */
151 typedef struct CSYS_s
152 {
155 } CSYS_t, *CSYS_p_t;
156 
157 typedef const CSYS_t CSYS_c_t, *CSYS_pc_t;
158 
159 /*
160 * Definition for 2-d box
161 */
162 typedef union
163 {
164  double a[4];
165  struct
166  {
167  double xmin;
168  double xmax;
169  double ymin;
170  double ymax;
171  } n;
172 } BOX2_t, *BOX2_p_t;
173 
174 typedef const BOX2_t BOX2_c_t, *BOX2_pc_t;
175 
176 #define BOX2_XMIN(p) ((p)->n.xmin)
177 #define BOX2_XMAX(p) ((p)->n.xmax)
178 #define BOX2_YMIN(p) ((p)->n.ymin)
179 #define BOX2_YMAX(p) ((p)->n.ymax)
180 
181 /*
182 * Definition for 3-d box
183 */
184 typedef union BOX3_s
185 {
186  double a[6];
187  struct
188  {
189  double xmin;
190  double xmax;
191  double ymin;
192  double ymax;
193  double zmin;
194  double zmax;
195  } n;
196 } BOX3_t, *BOX3_p_t;
197 
198 typedef const BOX3_t BOX3_c_t, *BOX3_pc_t;
199 
200 #define BOX3_XMIN(p) ((p)->n.xmin)
201 #define BOX3_XMAX(p) ((p)->n.xmax)
202 #define BOX3_YMIN(p) ((p)->n.ymin)
203 #define BOX3_YMAX(p) ((p)->n.ymax)
204 #define BOX3_ZMIN(p) ((p)->n.zmin)
205 #define BOX3_ZMAX(p) ((p)->n.zmax)
206 
207 #endif /* UGMATH_DATATYPES_H_INCLUDED */