00001
00025 #ifndef INC_MI32_TRANS2D_H
00026 #define INC_MI32_TRANS2D_H
00027
00028 #ifndef INC_MI32_CTRLPT_H
00029 #include <mi32/ctrlpt.h>
00030 #endif
00031
00032 #ifndef INC_MI32_TRANS2DMODEL_H
00033 #include <mi32/trans2dmodel.h>
00034 #endif
00035
00036
00037 #ifdef GEOMDLL
00038 #define GEOMLIBEXPORT MI_DLLEXPORT
00039 #else
00040 #define GEOMLIBEXPORT MI_DLLIMPORT
00041 #endif
00042
00043
00044
00045
00046
00047
00048 #define trans2dm(ix,iy,mat,ox,oy) { double _trans2dm_tx_, _trans2dm_ty_; _trans2dm_tx_ = (ix) * mat[0][0] + (iy) * mat[0][1] + mat[0][2]; \
00049 _trans2dm_ty_ = (ix) * mat[1][0] + (iy) * mat[1][1] + mat[1][2]; *(ox) = _trans2dm_tx_; *(oy) = _trans2dm_ty_; }
00050
00051 #define trans2dms(ix,iy,mat) { double _trans2dms_tx_, _trans2dms_ty_; _trans2dms_tx_ = (ix) * mat[0][0] + (iy) * mat[0][1] + mat[0][2]; \
00052 _trans2dms_ty_ = (ix) * mat[1][0] + (iy) * mat[1][1] + mat[1][2]; (ix) = _trans2dms_tx_; (iy) = _trans2dms_ty_; }
00053
00054
00055 #define trans2dx(ix,iy,mat) ((ix) * mat[0][0] + (iy) * mat[0][1] + mat[0][2])
00056 #define trans2dy(ix,iy,mat) ((ix) * mat[1][0] + (iy) * mat[1][1] + mat[1][2])
00057
00058
00059
00060
00061
00062
00063 #if defined(__cplusplus)
00064 extern "C" {
00065 #endif
00066
00068 GEOMLIBEXPORT void DisectTrans2D (
00069 const MAT3X3 mat,
00070 double *xscale,
00071 double *yscale,
00072 double *rot,
00073 double *shear
00074 );
00075
00077 GEOMLIBEXPORT int FindBestTrans2D (
00078 int NumPoints,
00079 const CTRLPOINT *cp,
00080 MAT3X3 forward,
00081 MAT3X3 inverse
00082 );
00083
00085 GEOMLIBEXPORT int FindBestTrans2DA (
00086 int NumPoints,
00087 const CTRLPOINT *cp,
00088 MAT3X3 forward,
00089 MAT3X3 inverse,
00090 UINT32 flags
00091 );
00092
00094 GEOMLIBEXPORT int FindBestTrans2D3 (
00095 int NumPoints,
00096 const CTRLPOINT3 *cp3,
00097 MAT3X3 forward,
00098 MAT3X3 inverse
00099 );
00100
00102 GEOMLIBEXPORT int FindBestTrans2D3A (
00103 int NumPoints,
00104 const CTRLPOINT3 *cp3,
00105 MAT3X3 forward,
00106 MAT3X3 inverse,
00107 UINT32 flags
00108 );
00109
00111 GEOMLIBEXPORT void trans2d (
00112 double ix,
00113 double iy,
00114 const MAT3X3 ItoO,
00115 double *ox,
00116 double *oy
00117 );
00118
00120 GEOMLIBEXPORT void trans2dfindinverse (
00121 const MAT3X3 fwd,
00122 MAT3X3 inv
00123 );
00124
00128 GEOMLIBEXPORT void trans2dinit (
00129 MAT3X3 ItoO,
00130 MAT3X3 OtoI
00131 );
00132
00134 GEOMLIBEXPORT void trans2dmatch (
00135 MAT3X3 f,
00136 MAT3X3 i,
00137 double ix,
00138 double iy,
00139 double ox,
00140 double oy
00141 );
00142
00144 GEOMLIBEXPORT void trans2dmatrix (
00145 MAT3X3 m,
00146 const MAT3X3 mat
00147 );
00148
00150 GEOMLIBEXPORT void trans2dmatrix1 (
00151 const MAT3X3 m,
00152 const MAT3X3 mat,
00153 MAT3X3 out
00154 );
00155
00157 GEOMLIBEXPORT void trans2dmatrix2 (
00158 MAT3X3 atoc,
00159 MAT3X3 ctoa,
00160 const MAT3X3 atob,
00161 const MAT3X3 btoa,
00162 const MAT3X3 btoc,
00163 const MAT3X3 ctob
00164 );
00165
00167 GEOMLIBEXPORT void trans2drotpt (
00168 MAT3X3 fwd,
00169 MAT3X3 inv,
00170 double angle,
00171 double ptx,
00172 double pty
00173 );
00174
00176 GEOMLIBEXPORT void trans2drot (
00177 MAT3X3 m,
00178 MAT3X3 n,
00179 double angle
00180 );
00181
00183 GEOMLIBEXPORT void trans2dscale (
00184 MAT3X3 m,
00185 MAT3X3 n,
00186 double sx,
00187 double sy
00188 );
00189
00191 GEOMLIBEXPORT void trans2dshear (
00192 MAT3X3 m,
00193 MAT3X3 n,
00194 double shear,
00195 int axis
00196 );
00197
00199 GEOMLIBEXPORT void trans2dshift (
00200 MAT3X3 m,
00201 MAT3X3 n,
00202 double dx,
00203 double dy
00204 );
00205
00206 #define trans2dorient(m) SIGN(m[0][0]*m[1][1]-m[1][0]*m[0][1])
00207
00209 GEOMLIBEXPORT void Trans2DRect (
00210 const MAT3X3 trans,
00211 const DRECT2D *irect,
00212 DRECT2D *orect
00213 );
00214
00215 #if defined(__cplusplus)
00216 }
00217 #endif
00218
00219 #endif // #ifndef INC_MI32_TRANS2D_H