00001
00002
00003
00004
00005
00021
00022 #ifndef GX_TRAFO_INCL
00023 #define GX_TRAFO_INCL
00024
00025 #include "gxsd.h"
00026 #include "gxerror.h"
00027 #include "gxvariant.h"
00028 #include <assert.h>
00029
00030 #ifdef __BORLANDC__
00031 #pragma warn -rch
00032 #endif
00033
00034 #ifdef GX_NAMESPACES
00035 namespace gx {
00036 #endif
00037
00038 #if defined(GX_DOTNET) && !defined(GX_MANUAL)
00039 #pragma unmanaged
00040 #define gxTRAFO _gxTRAFO
00041 #endif
00042
00043 #if !defined(GX_SWIGIF) && !defined(GX_MANUAL)
00044
00046 enum {
00047 GX_CALL_INITTRAFO = GX_CALL_GROUP_GX_TRAFO,
00048 GX_CALL_ALLOCTRAFO,
00049 GX_CALL_FREETRAFO,
00050 GX_CALL_REFTRAFO,
00051 GX_CALL_UNREFTRAFO,
00052 GX_CALL_CREATETRAFO,
00053 GX_CALL_LOADTRAFO,
00054 GX_CALL_LOADTRAFOA,
00055 GX_CALL_SAVETRAFO,
00056 GX_CALL_SAVETRAFOA,
00057 GX_CALL_COPYTRAFO,
00058 GX_CALL_TRAFO,
00059 GX_CALL_ISVALIDTRAFO,
00060 GX_CALL_ITRAFO,
00061 GX_CALL_TRAFOTOVARIANT,
00062 GX_CALL_TRAFOFROMVARIANT,
00063 GX_CALL_ALLOCTRAFO_DBG,
00064 };
00065 #endif
00066
00067 #ifndef GX_SWIGIF
00068 #ifndef GX_DOTNET
00069
00070 struct gxTRAFO {
00071 int gxid;
00072 int ref;
00073 gxRCT source_frame;
00074 int xsize;
00075 int ysize;
00076 gxPNTF *base;
00077 void *reserved;
00078 };
00079
00080 #ifndef __cplusplus
00081
00082 typedef struct gxTRAFO gxTRAFO;
00083 #endif
00084
00085 #ifndef GX_MANUAL
00086
00087 struct GX_PARM_CREATETRAFO {
00088 gxTRAFO *ptrafo;
00089 const gxPG2 *pairs;
00090 int npair;
00091 const gxRCT *frame;
00092 int resolution;
00093 };
00094 #endif
00095
00096 #else
00097
00098 struct gxTRAFO {
00099 int gxid;
00100 int ref;
00101 _gxRCT source_frame;
00102 int xsize;
00103 int ysize;
00104 _gxPNTF *base;
00105 void *reserved;
00106 };
00107
00109 struct GX_PARM_CREATETRAFO {
00110 gxTRAFO *ptrafo;
00111 const _gxPG2 *pairs;
00112 int npair;
00113 const _gxRCT *frame;
00114 int resolution;
00115 };
00116 #endif
00117 #endif
00118
00119 #if !defined(GX_SWIGIF) && !defined(GX_MANUAL)
00120
00122 struct GX_PARM_LOADTRAFO {
00123 gxTRAFO *ptrafo;
00124 const wchar_t *filename;
00125 };
00126
00128 struct GX_PARM_LOADTRAFOA {
00129 gxTRAFO *ptrafo;
00130 const char *filename;
00131 };
00132
00134 struct GX_PARM_SAVETRAFO {
00135 const gxTRAFO *ptrafo;
00136 const wchar_t *filename;
00137 };
00138
00140 struct GX_PARM_SAVETRAFOA {
00141 const gxTRAFO *ptrafo;
00142 const char *filename;
00143 };
00144
00146 struct GX_PARM_COPYTRAFO {
00147 gxTRAFO *target;
00148 const gxTRAFO *source;
00149 };
00150
00151 #ifndef GX_DOTNET
00152
00153 struct GX_PARM_TRAFO {
00154 gxTRAFO *ptrafo;
00155 const gxPNT *source;
00156 gxPNT *target;
00157 int npoints;
00158 };
00159
00161 struct GX_PARM_ITRAFO {
00162 gxTRAFO *ptrafo;
00163 const gxPNT *source;
00164 gxPNT *target;
00165 int npoints;
00166 };
00167 #else
00168
00169 struct GX_PARM_TRAFO {
00170 gxTRAFO *ptrafo;
00171 const _gxPNT *source;
00172 _gxPNT *target;
00173 int npoints;
00174 };
00175
00177 struct GX_PARM_ITRAFO {
00178 gxTRAFO *ptrafo;
00179 const _gxPNT *source;
00180 _gxPNT *target;
00181 int npoints;
00182 };
00183 #endif // !GX_DOTNET
00184
00186 struct GX_PARM_TRAFOTOVARIANT {
00187 gxTRAFO *ptrafo;
00188 int varid;
00189 gxVARIANT variant;
00190 };
00191
00193 struct GX_PARM_TRAFOFROMVARIANT {
00194 gxTRAFO *ptrafo;
00195 gxVARIANT variant;
00196 };
00197
00199 struct GX_PARM_ALLOCTRAFO_DBG {
00200 gxTRAFO *ptrafo;
00201 const char *file;
00202 int line;
00203 };
00204
00205 #endif
00206
00207
00208 #if !defined(NO_GX_FUNCTIONS) && !defined(GX_SWIGIF)
00209
00210
00211
00215
00216
00217
00224 inline int gx_inittrafo(gxHANDLE handle, gxTRAFO *ptrafo) {
00225 assert(ptrafo);
00226 return gx_call(handle, GX_CALL_INITTRAFO, (void *)ptrafo);
00227 }
00228
00229
00237 inline int gx_alloctrafo(gxHANDLE handle, gxTRAFO **ptrafo) {
00238 assert(ptrafo);
00239 return gx_call(handle, GX_CALL_ALLOCTRAFO, (void *)ptrafo);
00240 }
00241
00242
00252 inline int gx_alloctrafo_dbg(gxHANDLE handle, gxTRAFO **ptrafo, const char *file, int line) {
00253
00254 struct GX_PARM_ALLOCTRAFO_DBG atd;
00255 int ret;
00256 assert(ptrafo);
00257 atd.file = file;
00258 atd.line = line;
00259 ret = gx_call(handle, GX_CALL_ALLOCTRAFO_DBG, (void *)&atd);
00260 if(ret) *ptrafo = atd.ptrafo;
00261 return ret;
00262 }
00263
00264
00271 inline int gx_freetrafo(gxHANDLE handle, gxTRAFO *ptrafo) {
00272 assert(ptrafo);
00273 return gx_call(handle, GX_CALL_FREETRAFO, (void *)ptrafo);
00274 }
00275
00276
00278
00282
00283
00284
00294 inline int gx_reftrafo(gxHANDLE handle, gxTRAFO *ptrafo) {
00295 assert(ptrafo);
00296 return gx_call(handle, GX_CALL_REFTRAFO, (void *)ptrafo);
00297 }
00298
00299
00308 inline int gx_unreftrafo(gxHANDLE handle, gxTRAFO *ptrafo) {
00309 assert(ptrafo);
00310 return gx_call(handle, GX_CALL_UNREFTRAFO, (void *)ptrafo);
00311 }
00312
00313
00315
00319
00320
00321
00332 inline int gx_createtrafo(gxHANDLE handle, gxTRAFO *ptrafo,
00333 #ifndef __cplusplus
00334 const gxPG2 *pairs, int npair,
00335 const gxRCT frame, int resolution)
00336 #elif !defined GX_DOTNET
00337 const gxPG2 *pairs, int npair,
00338 const gxRCT GX_REF_STRUCT(frame), int resolution)
00339 #else
00340 const _gxPG2 *pairs, int npair,
00341 const _gxRCT GX_REF_UNMANAGED_STRUCT(frame), int resolution)
00342 #endif
00343 {
00344
00345 struct GX_PARM_CREATETRAFO ct;
00346 assert(ptrafo);
00347 assert(pairs);
00348 assert(npair > 0);
00349 ct.ptrafo = ptrafo;
00350 ct.pairs = pairs;
00351 ct.npair = npair;
00352 ct.frame = &frame;
00353 ct.resolution = resolution;
00354 return gx_call(handle, GX_CALL_CREATETRAFO, (void *)&ct);
00355 }
00356
00357
00365 inline int gx_loadtrafo(gxHANDLE handle, gxTRAFO *ptrafo,
00366 const wchar_t *filename) {
00367 struct GX_PARM_LOADTRAFO lt;
00368 assert(ptrafo);
00369 assert(filename);
00370 lt.ptrafo = ptrafo;
00371 lt.filename = filename;
00372 return gx_call(handle, GX_CALL_LOADTRAFO, (void *)<);
00373 }
00374
00375
00383 inline int gx_loadtrafoa(gxHANDLE handle, gxTRAFO *ptrafo, const char *filename) {
00384 struct GX_PARM_LOADTRAFOA lt;
00385 assert(ptrafo);
00386 assert(filename);
00387 lt.ptrafo = ptrafo;
00388 lt.filename = filename;
00389 return gx_call(handle, GX_CALL_LOADTRAFOA, (void *)<);
00390 }
00391
00392 #ifdef __cplusplus
00393
00401 inline int gx_loadtrafo(gxHANDLE handle, gxTRAFO *ptrafo, const char *filename) {
00402 return gx_loadtrafoa(handle, ptrafo, filename);
00403 }
00404 #endif
00405
00406
00414 inline int gx_savetrafo(gxHANDLE handle, gxTRAFO *ptrafo, const wchar_t *filename) {
00415 struct GX_PARM_SAVETRAFO st;
00416 assert(ptrafo);
00417 assert(filename);
00418 st.ptrafo = ptrafo;
00419 st.filename = filename;
00420 return gx_call(handle, GX_CALL_SAVETRAFO, (void *)&st);
00421 }
00422
00423
00431 inline int gx_savetrafoa(gxHANDLE handle, gxTRAFO *ptrafo, const char *filename) {
00432 struct GX_PARM_SAVETRAFOA st;
00433 assert(ptrafo);
00434 assert(filename);
00435 st.ptrafo = ptrafo;
00436 st.filename = filename;
00437 return gx_call(handle, GX_CALL_SAVETRAFOA, (void *)&st);
00438 }
00439
00440 #ifdef __cplusplus
00441
00449 inline int gx_savetrafo(gxHANDLE handle, gxTRAFO *ptrafo, const char *filename) {
00450 return gx_savetrafoa(handle, ptrafo, filename);
00451 }
00452 #endif
00453
00454
00465 inline int gx_copytrafo(gxHANDLE handle, gxTRAFO *ptrafo,
00466 const gxTRAFO *ptrafo_source) {
00467 struct GX_PARM_COPYTRAFO ct;
00468 assert(ptrafo);
00469 assert(ptrafo_source);
00470 ct.target = ptrafo;
00471 ct.source = ptrafo_source;
00472 return gx_call(handle, GX_CALL_COPYTRAFO, (void *)&ct);
00473 }
00474
00475
00486 inline int gx_trafo(gxHANDLE handle, gxTRAFO *ptrafo,
00487 #ifndef GX_DOTNET
00488 const gxPNT *source, gxPNT *target, int npoints)
00489 #else
00490 const _gxPNT *source, _gxPNT *target, int npoints)
00491 #endif
00492 {
00493 struct GX_PARM_TRAFO tp;
00494 assert(ptrafo);
00495 assert(source);
00496 assert(target);
00497 assert(npoints > 0);
00498 tp.ptrafo = ptrafo;
00499 tp.source = source;
00500 tp.target = target;
00501 tp.npoints = npoints;
00502 return gx_call(handle, GX_CALL_TRAFO, (void *)&tp);
00503 }
00504
00505
00515 inline int gx_trafo_pnt(gxHANDLE handle, gxTRAFO *ptrafo,
00516 #ifndef GX_DOTNET
00517 const gxPNT *source, gxPNT *target)
00518 #else
00519 const _gxPNT *source, _gxPNT *target)
00520 #endif
00521 {
00522 struct GX_PARM_TRAFO tp;
00523 assert(ptrafo);
00524 assert(source);
00525 assert(target);
00526 tp.ptrafo = ptrafo;
00527 tp.source = source;
00528 tp.target = target;
00529 tp.npoints = 1;
00530 return gx_call(handle, GX_CALL_TRAFO, (void *)&tp);
00531 }
00532
00533
00543 inline int gx_itrafo(gxHANDLE handle, gxTRAFO *ptrafo,
00544 #ifndef GX_DOTNET
00545 const gxPNT *source, gxPNT *target,
00546 #else
00547 const _gxPNT *source, _gxPNT *target,
00548 #endif
00549 int npoints) {
00550 struct GX_PARM_ITRAFO tp;
00551 assert(ptrafo);
00552 assert(source);
00553 assert(target);
00554 assert(npoints > 0);
00555 tp.ptrafo = ptrafo;
00556 tp.source = source;
00557 tp.target = target;
00558 tp.npoints = npoints;
00559 return gx_call(handle, GX_CALL_ITRAFO, (void *)&tp);
00560 }
00561
00562
00571 inline int gx_itrafo_pnt(gxHANDLE handle, gxTRAFO *ptrafo,
00572 #ifndef GX_DOTNET
00573 const gxPNT *source, gxPNT *target)
00574 #else
00575 const _gxPNT *source, _gxPNT *target)
00576 #endif
00577 {
00578 struct GX_PARM_ITRAFO tp;
00579 assert(ptrafo);
00580 assert(source);
00581 assert(target);
00582 tp.ptrafo = ptrafo;
00583 tp.source = source;
00584 tp.target = target;
00585 tp.npoints = 1;
00586 return gx_call(handle, GX_CALL_ITRAFO, (void *)&tp);
00587 }
00588
00589
00596 inline int gx_isvalidtrafo(gxHANDLE handle, const gxTRAFO *ptrafo) {
00597 assert(ptrafo);
00598 return gx_call(handle, GX_CALL_ISVALIDTRAFO, (void *)ptrafo);
00599 }
00600
00601
00610 inline int gx_trafotovariant(gxHANDLE handle, gxTRAFO *source, int varid, gxVARIANT *target) {
00611 struct GX_PARM_TRAFOTOVARIANT ttv;
00612 int ret;
00613 assert(target);
00614 assert(source);
00615 ttv.ptrafo = source;
00616 ttv.varid = varid;
00617 ret = gx_call(handle, GX_CALL_TRAFOTOVARIANT, &ttv);
00618 if(ret && target) *target = ttv.variant;
00619 return ret;
00620 }
00621
00622
00630 inline int gx_trafofromvariant(gxHANDLE handle, gxTRAFO **target, gxVARIANT source) {
00631 struct GX_PARM_TRAFOFROMVARIANT tfv;
00632 int ret;
00633 assert(target);
00634 tfv.variant = source;
00635 ret = gx_call(handle, GX_CALL_TRAFOFROMVARIANT, &tfv);
00636 if(ret && target) *target = tfv.ptrafo;
00637 return ret;
00638 }
00639
00640 #ifdef __cplusplus
00641
00647 inline int gx_inittrafo(gxTRAFO *ptrafo) {
00648 return gx_inittrafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo);
00649 }
00650
00651
00658 inline int gx_alloctrafo(gxTRAFO **ptrafo) {
00659 return gx_alloctrafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo);
00660 }
00661
00662
00671 inline int gx_alloctrafo_dbg(gxTRAFO **ptrafo, const char *file, int line) {
00672 return gx_alloctrafo_dbg(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo, file, line);
00673 }
00674
00675 #ifdef GX_TESTLEAKS
00676 #if defined(_MSC_VER) && _MSC_VER<1400
00677
00678 #define gx_alloctrafo(ptrafo) gx_alloctrafo_dbg(ptrafo, __FILE__, __LINE__)
00679 #else
00680
00681 #define gx_alloctrafo(...) gx_alloctrafo_dbg(__VA_ARGS__, __FILE__, __LINE__)
00682 #endif
00683 #endif
00684
00685
00691 inline int gx_freetrafo(gxTRAFO *ptrafo) {
00692 return gx_freetrafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo);
00693 }
00694
00695
00697
00701
00702
00703
00712 inline int gx_reftrafo(gxTRAFO *ptrafo) {
00713 return gx_reftrafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo);
00714 }
00715
00716
00724 inline int gx_unreftrafo(gxTRAFO *ptrafo) {
00725 return gx_unreftrafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo);
00726 }
00727
00728
00730
00734
00735
00736
00747 #ifndef GX_DOTNET
00748 inline int gx_createtrafo(gxTRAFO *ptrafo, const gxPG2 *pairs,
00749 int npair, const gxRCT GX_REF_STRUCT(frame), int resolution) {
00750 #else
00751 inline int gx_createtrafo(gxTRAFO *ptrafo, const _gxPG2 *pairs,
00752 int npair, const _gxRCT GX_REF_UNMANAGED_STRUCT(frame), int resolution) {
00753 #endif
00754
00755 return gx_createtrafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo, pairs,
00756 npair, frame, resolution);
00757 }
00758
00759
00766 inline int gx_loadtrafo(gxTRAFO *ptrafo, const wchar_t *filename) {
00767 return gx_loadtrafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo, filename);
00768 }
00769
00770
00777 inline int gx_loadtrafo(gxTRAFO *ptrafo, const char *filename) {
00778 return gx_loadtrafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo, filename);
00779 }
00780
00781
00788 inline int gx_savetrafo(gxTRAFO *ptrafo, const wchar_t *filename) {
00789 return gx_savetrafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo, filename);
00790 }
00791
00792
00799 inline int gx_savetrafo(gxTRAFO *ptrafo, const char *filename) {
00800 return gx_savetrafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo, filename);
00801 }
00802
00803
00813 inline int gx_copytrafo(gxTRAFO *ptrafo, const gxTRAFO *ptrafo_source) {
00814 return gx_copytrafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo, ptrafo_source);
00815 }
00816
00817
00827 #ifndef GX_DOTNET
00828 inline int gx_trafo(gxTRAFO *ptrafo, const gxPNT *source,
00829 gxPNT *target, int npoints) {
00830 #else
00831 inline int gx_trafo(gxTRAFO *ptrafo, const _gxPNT *source,
00832 _gxPNT *target, int npoints) {
00833 #endif
00834 return gx_trafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo, source, target, npoints);
00835 }
00836
00837
00846 #ifndef GX_DOTNET
00847 inline int gx_trafo_pnt(gxTRAFO *ptrafo, const gxPNT *source,
00848 gxPNT *target) {
00849 #else
00850 inline int gx_trafo_pnt(gxTRAFO *ptrafo, const _gxPNT *source,
00851 _gxPNT *target) {
00852 #endif
00853 return gx_trafo_pnt(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo, source, target);
00854 }
00855
00856
00865 #ifndef GX_DOTNET
00866 inline int gx_itrafo(gxTRAFO *ptrafo, const gxPNT *source,
00867 gxPNT *target, int npoints) {
00868 #else
00869 inline int gx_itrafo(gxTRAFO *ptrafo, const _gxPNT *source,
00870 _gxPNT *target, int npoints) {
00871 #endif
00872 return gx_itrafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo, source, target, npoints);
00873 }
00874
00875
00883 #ifndef GX_DOTNET
00884 inline int gx_itrafo_pnt(gxTRAFO *ptrafo, const gxPNT *source,
00885 gxPNT *target) {
00886 #else
00887 inline int gx_itrafo_pnt(gxTRAFO *ptrafo, const _gxPNT *source,
00888 _gxPNT *target) {
00889 #endif
00890 return gx_itrafo_pnt(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo, source, target);
00891 }
00892
00893
00898 inline int gx_isvalidtrafo(const gxTRAFO *ptrafo) {
00899 return gx_isvalidtrafo(gx_direct(GX_CALL_GROUP_GX_TRAFO), ptrafo);
00900 }
00901
00902
00910 inline int gx_trafotovariant(gxTRAFO *source, int varid, gxVARIANT *target) {
00911 return gx_trafotovariant(gx_direct(GX_CALL_GROUP_GX_TRAFO), source, varid, target);
00912 }
00913
00914
00921 inline int gx_trafofromvariant(gxTRAFO **target, gxVARIANT source) {
00922 return gx_trafofromvariant(gx_direct(GX_CALL_GROUP_GX_TRAFO), target, source);
00923 }
00924
00925 #endif // __cplusplus
00926
00927
00929
00930
00931 #endif // !NO_GX_FUNCTIONS && !GX_SWIGIF
00932
00933
00934
00935 #ifdef GX_DOTNET
00936 #pragma managed
00937 #endif
00938
00939
00940 #ifndef NO_GX_CLASSES
00941
00942 #ifndef GX_EXT_MODULE
00943
00945 #ifndef GX_DOTNET
00946 GX_CLASS gxTrafoData {
00947 #else
00948 GX_CLASS gxTrafoData : public System::IDisposable {
00949 #endif
00950
00951 #if !defined(GX_SWIGIF)
00952
00953 #if !defined(GX_DOTNET) && !defined(GX_MANUAL)
00954 public:
00955 gxTRAFO *_trafo;
00956 #endif
00957
00958 #if defined(GX_DOTNET)
00959 #if !defined(GX_MANUAL)
00960 private:
00961 GX_INDIRECTION_NOGC(gxTRAFO) _trafo;
00962 #endif
00963
00964 public:
00970 inline gxOutPtr _get_trafo(void) GX_CONST {
00971 return GX_PUTPTR(_trafo);
00972 }
00978 inline void _set_trafo(gxInPtr ptr) {
00979 _trafo = (GX_INDIRECTION_NOGC(gxTRAFO))ptr.ToPointer();
00980 }
00981 #endif
00982
00983 #endif
00984
00985 public:
00987 inline gxTrafoData() {
00988 _trafo = (gxTRAFO *)0;
00989 }
00991 inline ~gxTrafoData() gxFuncThrowsError {
00992 _Dispose();
00993 }
00994
00995 #ifdef GX_DOTNET_20
00996 inline !gxTrafoData() gxFuncThrowsError {
00997 _Dispose();
00998 }
00999 #else
01000
01001 inline void Dispose(void) {
01002 #ifdef GX_DOTNET
01003 System::GC::SuppressFinalize(this);
01004 #endif
01005 _Dispose();
01007 }
01008 #endif
01009
01010 private:
01011
01012 inline void _Dispose(void) {
01013 gxassert(!_trafo || (_trafo->ref == 0));
01014 }
01015
01016 public:
01017
01023 inline int ref(void) GX_CONST gxFuncThrowsError {
01024 gxassert(_trafo);
01025 return _trafo->ref;
01026 }
01027 #if !defined(GX_SWIG) && !defined(GX_DOTNET)
01028
01031 inline const gxRCT &source_frame(void) const gxFuncThrowsError {
01032 gxassert(_trafo);
01033 return _trafo->source_frame;
01034 }
01035 #endif
01036
01040 inline int xsize(void) GX_CONST gxFuncThrowsError {
01041 gxassert(_trafo);
01042 return _trafo->xsize;
01043 }
01047 inline int ysize(void) GX_CONST gxFuncThrowsError {
01048 gxassert(_trafo);
01049 return _trafo->ysize;
01050 }
01051
01052 #if !defined(GX_SWIG) && !defined(GX_DOTNET)
01053
01056 inline const gxPNTF *base(void) const gxFuncThrowsError {
01057 gxassert(_trafo);
01058 return _trafo->base;
01059 }
01063 inline const gxTRAFO *trafo(void) const gxFuncThrowsError {
01064 gxassert(_trafo);
01065 return _trafo;
01066 }
01067
01069 inline operator gxTRAFO *() const {
01070 return _trafo;
01071 }
01072
01074 inline operator gxTRAFO &() const gxFuncThrowsError {
01075 gxassert(_trafo);
01076 return *_trafo;
01077 }
01078 #endif
01079 };
01080
01081
01083 GX_CLASS gxTrafoHandler : public gxHandle {
01084 public:
01086 inline gxTrafoHandler() gxFuncThrowsError {
01087 #ifndef GX_DOTNET
01088 if(!gx_openmodule(this, L"gxtrafo", L"default")) gxthrow;
01089 #else
01090 GX_GETHANDLE(h);
01091 if(!gx_openmodule(&h, L"gxtrafo", L"default")) gxthrow;
01092 _set_handle(h.handle);
01093 #endif
01094 }
01095
01096 #if !defined(GX_SWIGIF) && !defined(GX_DOTNET)
01097
01101 inline gxTrafoHandler(const gxHANDLE *src) gxFuncThrowsError : gxHandle() {
01102 if(src) {
01103 handle = src->handle;
01104 if(!gx_refhandle(*this)) gxthrow;
01105 }
01106 }
01111 inline gxTrafoHandler(const gxHANDLE GX_REF_STRUCT(src)) gxFuncThrowsError : gxHandle() {
01112 handle = src.handle;
01113 if(!gx_refhandle(*this)) gxthrow;
01114 }
01119 inline gxTrafoHandler(const wchar_t *propname,
01120 const wchar_t *modname = (const wchar_t *)0) gxFuncThrowsError {
01121
01122 if(!gx_openmodule(this, modname ? modname : L"gxtrafo", propname)) gxthrow;
01123 }
01124
01129 inline gxTrafoHandler(const char *propname,
01130 const char *modname = (const char *)0) gxFuncThrowsError {
01131
01132 if(!gx_openmodulea(this, modname ? modname : "gxtrafo", propname)) gxthrow;
01133 }
01134 #endif // !GX_SWIGIF && !GX_DOTNET
01135
01136 #ifdef GX_UNICODE
01137
01141 inline gxTrafoHandler(gxInStr propname, gxInStr modname) gxFuncThrowsError {
01142 GX_GETSTRING(_propname, propname);
01143 GX_GETSTRING(_modname, modname);
01144 #ifndef GX_DOTNET
01145 if(!gx_openmodule(this, _modname, _propname)) gxthrow;
01146 #else
01147 GX_GETHANDLE(h);
01148 if(!gx_openmodule(&h, _modname, _propname)) gxthrow;
01149 _set_handle(h.handle);
01150 #endif
01151 }
01155 inline gxTrafoHandler(gxInStr propname) gxFuncThrowsError {
01156 GX_GETSTRING(_propname, propname);
01157 #ifndef GX_DOTNET
01158 if(!gx_openmodule(this, L"gxtrafo", _propname)) gxthrow;
01159 #else
01160 GX_GETHANDLE(h);
01161 if(!gx_openmodule(&h, L"gxtrafo", _propname)) gxthrow;
01162 _set_handle(h.handle);
01163 #endif
01164 }
01165 #endif // GX_UNICODE
01166
01167 #ifdef GX_ASCII
01168
01172 inline gxTrafoHandler(gxInAStr propname, gxInAStr modname) gxFuncThrowsError {
01173 GX_GETASTRING(_propname, propname);
01174 GX_GETASTRING(_modname, modname);
01175 if(!gx_openmodulea(this, _modname, _propname)) gxthrow;
01176 }
01180 inline gxTrafoHandler(gxInAStr propname) gxFuncThrowsError {
01181 GX_GETASTRING(_propname, propname);
01182 if(!gx_openmodulea(this, "gxtrafo", _propname)) gxthrow;
01183 }
01184 #endif
01185
01190 inline gxTrafoHandler(GX_CONST gxTrafoHandler GX_REF_CLASS(src)) gxFuncThrowsError : gxHandle() {
01191 #ifndef GX_DOTNET
01192 handle = src.handle;
01193 if(!gx_refhandle(*this)) gxthrow;
01194 #else
01195 gxHANDLE h = { src GX_M _get_handle() };
01196 if(!gx_refhandle(h)) gxthrow;
01197 _set_handle(h.handle);
01198 #endif
01199 }
01200
01201 };
01202
01203 #endif // GX_EXT_MODULE
01204
01205 #if !defined(GX_MANUAL)
01206
01207 #if !defined(GX_DOTNET)
01208 #define GX_GETTRAFO(name) gxTRAFO *name = _trafo
01209 #else
01210 #define GX_GETTRAFO(name) gxTRAFO *name = (gxTRAFO *)_get_trafo().ToPointer()
01211 #endif
01212
01213 #endif
01214
01215 #ifndef GX_EXT_MODULE
01216
01218 #if !defined(GX_SWIGIF) && !defined(GX_DOTNET)
01219 class gxTrafo : public gxTrafoHandler, public gxTrafoData {
01220
01221 #else
01222
01223 GX_CLASS gxTrafo : public gxTrafoHandler
01224 #ifdef GX_DOTNET
01225 , public System::IDisposable
01226 #endif
01227 {
01228
01229 #if !defined(GX_SWIGIF)
01230
01231 #if !defined(GX_DOTNET) && !defined(GX_MANUAL)
01232 public:
01233 gxTRAFO *_trafo;
01234 #endif
01235
01236 #if defined(GX_DOTNET)
01237 #if !defined(GX_MANUAL)
01238 private:
01239 GX_INDIRECTION_NOGC(gxTRAFO) _trafo;
01240 #endif
01241
01242 public:
01248 inline gxOutPtr _get_trafo(void) GX_CONST {
01249 return GX_PUTPTR(_trafo);
01250 }
01256 inline void _set_trafo(gxInPtr ptr) {
01257 _trafo = (GX_INDIRECTION_NOGC(gxTRAFO))GX_GETPTR(ptr);
01258 }
01259 private:
01262 inline void _set_trafo(GX_INDIRECTION_NOGC(gxTRAFO) ptr) {
01263 _trafo = ptr;
01264 }
01265 public:
01266 #endif
01267 #endif
01268
01269 public:
01275 inline int ref(void) GX_CONST gxFuncThrowsError {
01276 gxassert(_trafo);
01277 return _trafo->ref;
01278 }
01279
01283 inline int xsize(void) GX_CONST gxFuncThrowsError {
01284 gxassert(_trafo);
01285 return _trafo->xsize;
01286 }
01290 inline int ysize(void) GX_CONST gxFuncThrowsError {
01291 gxassert(_trafo);
01292 return _trafo->ysize;
01293 }
01294 #endif
01295
01296 public:
01297 #if defined(GX_DOTNET) || defined(GX_SWIG)
01298
01299 inline gxTrafo() gxFuncThrowsError : gxTrafoHandler() {
01300 #ifndef GX_DOTNET
01301 _trafo = 0;
01302 if(gxHandle::IsValid()) {
01303 if(!gx_alloctrafo(*this, &_trafo)) gxthrow;
01304 }
01305 #else
01306 _set_trafo(0);
01307 if(gxHandle::IsValid()) {
01308 GX_GETHANDLE(h);
01309 GX_GETTRAFO(t);
01310 if(!gx_alloctrafo(h, &t)) gxthrow;
01311 _set_trafo(t);
01312 }
01313 #endif
01314 }
01315 #endif
01316
01317 #if !defined(GX_DOTNET) && !defined(GX_SWIG)
01318
01319 inline gxTrafo() gxFuncThrowsError : gxTrafoHandler(), gxTrafoData() {
01320 if(gxHandle::IsValid()) {
01321 if(!gx_alloctrafo(*this, &_trafo)) gxthrow;
01322 }
01323 }
01324
01329 inline gxTrafo(const gxHANDLE GX_REF_STRUCT(h)) gxFuncThrowsError : gxTrafoHandler(h), gxTrafoData() {
01330 if(gxHandle::IsValid()) {
01331 if(!gx_alloctrafo(*this, &_trafo)) gxthrow;
01332 }
01333 }
01338 inline gxTrafo(const gxHANDLE *h) gxFuncThrowsError : gxTrafoHandler(h), gxTrafoData() {
01339 if(gxHandle::IsValid()) {
01340 if(!gx_alloctrafo(*this, &_trafo)) gxthrow;
01341 }
01342 }
01343
01348 inline gxTrafo(const wchar_t *propname,
01349 const wchar_t *modname = (const wchar_t *)0) gxFuncThrowsError
01350 : gxTrafoHandler(propname, modname), gxTrafoData() {
01351
01352 if(gxHandle::IsValid()) {
01353 if(!gx_alloctrafo(*this, &_trafo)) gxthrow;
01354 }
01355 }
01356
01361 inline gxTrafo(const char *propname,
01362 const char *modname = (const char *)0) gxFuncThrowsError
01363 : gxTrafoHandler(propname, modname), gxTrafoData() {
01364
01365 if(gxHandle::IsValid()) {
01366 if(!gx_alloctrafo(*this, &_trafo)) gxthrow;
01367 }
01368 }
01369
01373 inline gxTrafo(gxTRAFO GX_REF_STRUCT(src)) gxFuncThrowsError : gxTrafoHandler(), gxTrafoData() {
01374 if(gxHandle::IsValid()) {
01375 if(gx_alloctrafo(*this, &_trafo)) {
01376 Copy(src);
01377 } else {
01378 gxthrow;
01379 }
01380 }
01381 }
01382
01389 inline gxTrafo(gxTRAFO GX_REF_STRUCT(src), const wchar_t *propname,
01390 const wchar_t *modname = (const wchar_t *)0) gxFuncThrowsError
01391 : gxTrafoHandler(propname, modname), gxTrafoData() {
01392
01393 if(gxHandle::IsValid()) {
01394 if(gx_alloctrafo(*this, &_trafo)) {
01395 Copy(src);
01396 } else {
01397 gxthrow;
01398 }
01399 }
01400 }
01401
01408 inline gxTrafo(gxTRAFO GX_REF_STRUCT(src), const char *propname,
01409 const char *modname = (const char *)0) gxFuncThrowsError
01410 : gxTrafoHandler(propname, modname), gxTrafoData() {
01411
01412 if(gxHandle::IsValid()) {
01413 if(gx_alloctrafo(*this, &_trafo)) {
01414 Copy(src);
01415 } else {
01416 gxthrow;
01417 }
01418 }
01419 }
01420
01427 inline gxTrafo(gxTrafo GX_REF_STRUCT(src), const wchar_t *propname, const wchar_t *modname = (const wchar_t *)0)
01428 gxFuncThrowsError : gxTrafoHandler(propname, modname), gxTrafoData() {
01429
01430 if(gxHandle::IsValid()) {
01431 if(gx_alloctrafo(*this, &_trafo)) {
01432 Copy(src);
01433 } else {
01434 gxthrow;
01435 }
01436 }
01437 }
01438
01445 inline gxTrafo(gxTrafo GX_REF_STRUCT(src), const char *propname,
01446 const char *modname = (const char *)0) gxFuncThrowsError
01447 : gxTrafoHandler(propname, modname), gxTrafoData() {
01448
01449 if(gxHandle::IsValid()) {
01450 if(gx_alloctrafo(*this, &_trafo)) {
01451 Copy(src);
01452 } else {
01453 gxthrow;
01454 }
01455 }
01456 }
01457 #endif
01458
01459 #ifdef GX_UNICODE
01460 #ifndef GX_DOTNET
01461
01464 inline gxTrafo(gxInStr propname) gxFuncThrowsError
01465 : gxTrafoHandler(propname), gxTrafoData() {
01466
01467 if(gxHandle::IsValid()) {
01468 if(!gx_alloctrafo(*this, &_trafo)) gxthrow;
01469 }
01470 }
01471
01477 inline gxTrafo(gxInStr propname, gxInStr modname) gxFuncThrowsError
01478 : gxTrafoHandler(propname, modname), gxTrafoData() {
01479 if(gxHandle::IsValid()) {
01480 if(!gx_alloctrafo(*this, &_trafo)) gxthrow;
01481 }
01482 }
01483 #else
01484
01487 inline gxTrafo(gxInStr propname) gxFuncThrowsError
01488 : gxTrafoHandler(propname) {
01489 _set_trafo(0);
01490 if(gxHandle::IsValid()) {
01491 GX_GETHANDLE(h);
01492 GX_GETTRAFO(t);
01493 if(!gx_alloctrafo(h, &t)) gxthrow;
01494 _set_trafo(t);
01495 }
01496 }
01497
01503 inline gxTrafo(gxInStr propname, gxInStr modname) gxFuncThrowsError
01504 : gxTrafoHandler(propname, modname) {
01505 _set_trafo(0);
01506 if(gxHandle::IsValid()) {
01507 GX_GETHANDLE(h);
01508 GX_GETTRAFO(t);
01509 if(!gx_alloctrafo(h, &t)) gxthrow;
01510 _set_trafo(t);
01511 }
01512 }
01513 #endif // GX_DOTNET
01514 #endif // GX_UNICODE
01515
01516 #ifdef GX_ASCII
01517
01520 inline gxTrafo(gxInAStr propname) gxFuncThrowsError
01521 : gxTrafoHandler(propname), gxTrafoData() {
01522
01523 if(gxHandle::IsValid()) {
01524 if(!gx_alloctrafo(*this, &_trafo)) gxthrow;
01525 }
01526 }
01532 inline gxTrafo(gxInAStr propname, gxInAStr modname) gxFuncThrowsError
01533 : gxTrafoHandler(propname, modname), gxTrafoData() {
01534 if(gxHandle::IsValid()) {
01535 if(!gx_alloctrafo(*this, &_trafo)) gxthrow;
01536 }
01537 }
01538 #endif
01539
01540 #ifndef GX_DOTNET
01541
01544 inline gxTrafo(gxTrafoHandler GX_REF_CLASS(h)) gxFuncThrowsError : gxTrafoHandler(h), gxTrafoData() {
01545 if(gxHandle::IsValid()) {
01546 if(!gx_alloctrafo(*this, &_trafo)) gxthrow;
01547 }
01548 }
01552 inline gxTrafo(gxTrafo GX_REF_CLASS(src)) gxFuncThrowsError : gxTrafoHandler((const gxHANDLE &)src), gxTrafoData() {
01553 if(gxHandle::IsValid()) {
01554 if(gx_alloctrafo(*this, &_trafo)) {
01555 Copy(src);
01556 } else {
01557 gxthrow;
01558 }
01559 }
01560 }
01561 #else
01562
01565 inline gxTrafo(gxTrafoHandler GX_REF_CLASS(h)) gxFuncThrowsError : gxTrafoHandler(h) {
01566 _set_trafo(0);
01567 if(gxHandle::IsValid()) {
01568 GX_GETHANDLE(h);
01569 GX_GETTRAFO(t);
01570 if(!gx_alloctrafo(h, &t)) gxthrow;
01571 _set_trafo(t);
01572 }
01573 }
01577 inline gxTrafo(gxTrafo GX_REF_CLASS(src)) gxFuncThrowsError : gxTrafoHandler(src) {
01578 _set_trafo(0);
01579 if(gxHandle::IsValid()) {
01580 GX_GETHANDLE(h);
01581 GX_GETTRAFO(t);
01582 if(gx_alloctrafo(h, &t)) {
01583 _set_trafo(t);
01584 Copy(src);
01585 } else {
01586 gxthrow;
01587 }
01588 }
01589 }
01590 #endif
01591
01593 inline ~gxTrafo() gxFuncThrowsError {
01594 _Dispose();
01595 }
01596
01597 #ifdef GX_DOTNET_20
01598 inline !gxTrafo() gxFuncThrowsError {
01599 _Dispose();
01600 }
01601 #else
01602
01603 inline void Dispose(void) gxFuncThrowsError {
01604 #ifdef GX_DOTNET
01605 System::GC::SuppressFinalize(this);
01606 #endif
01607 _Dispose();
01609 gxHandle::Dispose();
01610 }
01611 #endif
01612
01613 private:
01614
01615 inline void _Dispose(void) gxFuncThrowsError {
01616 #ifndef GX_DOTNET
01617 if(_trafo) {
01618 if(!gx_unreftrafo(*this, _trafo)) gxthrow;
01619 }
01620 #else
01621 GX_GETHANDLE(h);
01622 GX_GETTRAFO(t);
01623 if(t) {
01624 if(!gx_unreftrafo(h, t)) gxthrow;
01625 }
01626 #endif
01627 _trafo=0;
01628 }
01629
01630 public:
01631
01632 #if !defined(GX_SWIGIF) && !defined(GX_DOTNET)
01633
01636 inline gxTrafo &operator = (gxTRAFO GX_REF_STRUCT(src)) gxFuncThrowsError {
01637 Copy(src);
01638 return *this;
01639 }
01640
01644 inline gxTrafo &operator = (gxTrafo GX_REF_CLASS(src)) gxFuncThrowsError {
01645 Copy(src);
01646 return *this;
01647 }
01648
01652 inline operator gxTRAFO & () gxFuncThrowsError {
01653 gxassert(_trafo);
01654 return *_trafo;
01655 }
01659 inline operator gxTRAFO * () gxFuncThrowsError {
01660 gxassert(_trafo);
01661 return _trafo;
01662 }
01666 inline operator const gxTRAFO * () const gxFuncThrowsError {
01667 gxassert(_trafo);
01668 return _trafo;
01669 }
01670
01675 inline bool Attach(gxTRAFO *src) gxFuncThrowsError {
01676 gxassert(_trafo && src);
01677 if(src->ref >= 0) {
01678 gx_seterror(GX_EINVAL, L"(src->ref < 0)");
01679 gxthrow;
01680 return false;
01681 }
01682 if(!gx_reftrafo(*this, src)) {
01683 gxthrow;
01684 return false;
01685 }
01686 if(!gx_unreftrafo(*this, _trafo)) {
01687 gx_unreftrafo(*this, src);
01688 gxthrow;
01689 return false;
01690 }
01691 _trafo = src;
01692 return true;
01693 }
01694
01698 inline bool Detach(void) gxFuncThrowsError {
01699 if(!gx_unreftrafo(*this, _trafo)) {
01700 gxthrow;
01701 return false;
01702 }
01703 if(!gx_alloctrafo(*this, &_trafo)) {
01704 gxthrow;
01705 return false;
01706 }
01707 return true;
01708 }
01709
01717 inline bool Create(const gxPG2 *pairs, int npair,
01718 const gxRCT GX_REF_STRUCT(frame), int resolution) gxFuncThrowsError {
01719 gxassert(_trafo);
01720 bool st = gx_createtrafo(*this, _trafo, pairs, npair, frame, resolution) ? true : false;
01721 gxcondthrow(!st);
01722 return st;
01723 }
01724
01729 inline bool Load(const wchar_t *filename) gxFuncThrowsError {
01730 gxassert(_trafo);
01731 bool st = gx_loadtrafo(*this, _trafo, filename) ? true : false;
01732 gxcondthrow(!st);
01733 return st;
01734 }
01739 inline bool Load(const char *filename) gxFuncThrowsError {
01740 gxassert(_trafo);
01741 bool st = gx_loadtrafoa(*this, _trafo, filename) ? true : false;
01742 gxcondthrow(!st);
01743 return st;
01744 }
01745
01750 inline bool Save(const wchar_t *filename) gxFuncThrowsError {
01751 gxassert(_trafo);
01752 bool st = gx_savetrafo(*this, _trafo, filename) ? true : false;
01753 gxcondthrow(!st);
01754 return st;
01755 }
01760 inline bool Save(const char *filename) gxFuncThrowsError {
01761 gxassert(_trafo);
01762 bool st = gx_savetrafoa(*this, _trafo, filename) ? true : false;
01763 gxcondthrow(!st);
01764 return st;
01765 }
01766 #endif // !GX_SWIGIF && !GX_DOTNET
01767
01768 #ifdef GX_UNICODE
01769
01773 inline bool Load(gxInStr filename) gxFuncThrowsError {
01774 GX_GETSTRING(_filename, filename);
01775 gxassert(_trafo);
01776 GX_GETHANDLE(h);
01777 GX_GETTRAFO(t);
01778 bool st = gx_loadtrafo(h, t, _filename) ? true : false;
01779 gxcondthrow(!st);
01780 return st;
01781 }
01786 inline bool Save(gxInStr filename) gxFuncThrowsError {
01787 GX_GETSTRING(_filename, filename);
01788 gxassert(_trafo);
01789 GX_GETHANDLE(h);
01790 GX_GETTRAFO(t);
01791 bool st = gx_savetrafo(h, t, _filename) ? true : false;
01792 gxcondthrow(!st);
01793 return st;
01794 }
01795 #endif
01796 #ifdef GX_ASCII
01797
01801 inline bool Load(gxInAStr filename) gxFuncThrowsError {
01802 GX_GETASTRING(_filename, filename);
01803 gxassert(_trafo);
01804 bool st = gx_loadtrafo(*this, _trafo, _filename) ? true : false;
01805 gxcondthrow(!st);
01806 return st;
01807 }
01812 inline bool Save(gxInAStr filename) gxFuncThrowsError {
01813 GX_GETASTRING(_filename, filename);
01814 gxassert(_trafo);
01815 bool st = gx_savetrafo(*this, _trafo, _filename) ? true : false;
01816 gxcondthrow(!st);
01817 return st;
01818 }
01819 #endif
01820
01821 #if !defined(GX_SWIGIF) && !defined(GX_DOTNET)
01822
01829 inline bool Copy(const gxTRAFO *source) gxFuncThrowsError {
01830 gxassert(_trafo);
01831 bool st = gx_copytrafo(*this, _trafo, source) ? true : false;
01832 gxcondthrow(!st);
01833 return st;
01834 }
01835
01843 inline bool Copy(const gxTrafo *source) gxFuncThrowsError {
01844 gxassert(_trafo);
01845 bool st = gx_copytrafo(*this, _trafo, (const gxTRAFO *)*source) ? true : false;
01846 gxcondthrow(!st);
01847 return st;
01848 }
01849
01857 inline bool Copy(const gxTRAFO GX_REF_STRUCT(source)) gxFuncThrowsError {
01858 gxassert(_trafo);
01859 bool st = gx_copytrafo(*this, _trafo, &source) ? true : false;
01860 gxcondthrow(!st);
01861 return st;
01862 }
01863 #endif
01864
01872 inline bool Copy(GX_CONST gxTrafo GX_REF_CLASS(source)) gxFuncThrowsError {
01873 gxassert(_trafo);
01874 #ifndef GX_DOTNET
01875 bool st = gx_copytrafo(*this, _trafo, (const gxTRAFO *)source) ? true : false;
01876 #else
01877 GX_GETHANDLE(h);
01878 GX_GETTRAFO(t);
01879 bool st = gx_copytrafo(h, t, (gxTRAFO *)source GX_M _get_trafo().ToPointer()) ? true : false;
01880 #endif
01881 gxcondthrow(!st);
01882 return st;
01883 }
01884
01885 #ifdef GX_DOTNET
01886
01892 inline bool Trafo(gxPNT_ARRAY source, gxPNT_ARRAY target) gxFuncThrowsError {
01893 gxassert(_trafo);
01894 GX_GETHANDLE(h);
01895 GX_PIN_PTR(gxPNT, _source) = &source[0];
01896 GX_PIN_PTR(gxPNT, _target) = &target[0];
01897 const _gxPNT* ps = (const _gxPNT*)_source;
01898 _gxPNT* pt = (_gxPNT*)_target;
01899 bool st = gx_trafo(h, _trafo, ps, pt, source->Length) ? true : false;
01900 gxcondthrow(!st);
01901 return st;
01902 }
01903 #elif !defined(GX_SWIGIF)
01904
01911 inline bool Trafo(const gxPNT *source, gxPNT *target, int npoints GX_DEFARG(1)) gxFuncThrowsError {
01912 gxassert(_trafo);
01913 bool st = gx_trafo(*this, _trafo, source, target, npoints) ? true : false;
01914 gxcondthrow(!st);
01915 return st;
01916 }
01917 #endif
01918
01919 #if !defined(GX_SWIGIF) && !defined(GX_DOTNET)
01920
01926 inline bool Trafo(const gxPG2 *source, gxPNT *target) gxFuncThrowsError {
01927 gxassert(_trafo);
01928 bool st = gx_trafo(*this, _trafo, (const gxPNT *)source, target, 2) ? true : false;
01929 gxcondthrow(!st);
01930 return st;
01931 }
01932
01939 inline bool Trafo(const gxPG4 *source, gxPNT *target) gxFuncThrowsError {
01940 gxassert(_trafo);
01941 bool st = gx_trafo(*this, _trafo, (const gxPNT *)source, target, 4) ? true : false;
01942 gxcondthrow(!st);
01943 return st;
01944 }
01945
01952 inline bool ITrafo(const gxPNT *source, gxPNT *target, int npoints = 1) gxFuncThrowsError {
01953 gxassert(_trafo);
01954 bool st = gx_itrafo(*this, _trafo, source, target, npoints) ? true : false;
01955 gxcondthrow(!st);
01956 return st;
01957 }
01958
01964 inline bool ITrafo(const gxPG2 *source, gxPNT *target) gxFuncThrowsError {
01965 gxassert(_trafo);
01966 bool st = gx_itrafo(*this, _trafo, (const gxPNT *)source, target, 2) ? true : false;
01967 gxcondthrow(!st);
01968 return st;
01969 }
01970
01976 inline bool ITrafo(const gxPG4 *source, gxPNT *target) gxFuncThrowsError {
01977 gxassert(_trafo);
01978 bool st = gx_itrafo(*this, _trafo, (const gxPNT *)source, target, 4) ? true : false;
01979 gxcondthrow(!st);
01980 return st;
01981 }
01982 #endif
01983
01987 inline bool IsValid(void) GX_CONST {
01988 if(!gxHandle::IsValid()) return false;
01989 GX_GETHANDLE(h);
01990 GX_GETTRAFO(t);
01991 return gx_isvalidtrafo(h, t) ? true : false;
01992 }
01993
01998 inline bool FromVariant(
01999 gxVariant GX_REF_CLASS(variant)
02000 ) gxFuncThrowsError {
02001
02002 GX_GETTRAFO(t);
02003 #ifndef GX_DOTNET
02004 bool st = gx_trafofromvariant(&t, variant._variant) ? true : false;
02005 if(st) {
02006 gx_unreftrafo(_trafo);
02007 _trafo=t;
02008 }
02009 #else
02010 bool st = gx_trafofromvariant(&t,
02011 variant ? variant->_variant : 0 ) ? true : false;
02012 if(st) {
02013 gx_unreftrafo(_trafo);
02014 _set_trafo(t);
02015 }
02016 #endif
02017 gxcondthrow(!st);
02018 return st;
02019 }
02020
02025 inline GX_INDIRECTION1(gxVariant) ToVariant(int varid) gxFuncThrowsError {
02026
02027 GX_GETTRAFO(t);
02028 gxVARIANT vari;
02029 bool st = gx_trafotovariant(t, varid, &vari) != 0;
02030 gxcondthrow(!st);
02031 if(!st) return GX_NULLPTR;
02032 GX_INDIRECTION(gxVariant,vr) = gxnew gxVariant(vari);
02033 gx_unrefvariant(vari);
02034 if(!vr){gxSystem::SetError((int)GX_ENUM_PATH(GX_ERROR_CODES) GX_ENOMEM);gxthrow;}
02035 return vr;
02036 }
02037 };
02038
02039 #endif // GX_EXT_MODULE
02040
02041 #endif//NO_GX_CLASSES
02042
02043 #ifdef GX_NAMESPACES
02044 }
02045 #endif
02046 #ifdef __BORLANDC__
02047 #pragma warn .rch
02048 #endif
02049
02050 #endif//GX_TRAFO_INCL
02051