00001
00045 #ifndef INC_MI32_COORDOP_H
00046 #define INC_MI32_COORDOP_H
00047
00048 #ifndef INC_MI32_SPATREF_H
00049 #include <mi32/spatref.h>
00050 #endif
00051
00052 #ifndef INC_MI32_POINT_H
00053 #include <mi32/point.h>
00054 #endif
00055
00056 #ifndef INC_MI32_INTERLOCKEDINT32_H
00057 #include <mi32/interlockedint32.h>
00058 #endif
00059
00060 #ifdef GEOMDLL
00061 #define CLASSLIBEXPORT MI_DLLCLASSEXPORT
00062 #else
00063 #define CLASSLIBEXPORT MI_DLLCLASSIMPORT
00064 #endif
00065
00066
00067 #ifndef GENERATING_DOXYGEN_OUTPUT
00068 class REGION2D;
00069 struct CTRLPOINT;
00070 struct CTRLPOINT3;
00071 namespace SPATREF {
00072 class COORDOP;
00073 class COORDOP_SINGLE;
00074 class COORDOP_LIST;
00075 class COORDOP_IMPL_LINEAR;
00076 class COORDOP_IMPL_LIST;
00077 }
00078 #endif
00079
00080
00081 namespace SPATREF {
00082
00083 enum COORDOP_DIRECTION {
00084 COORDOP_DIRECTION_Reverse = -1,
00085 COORDOP_DIRECTION_Forward = 1
00086 };
00087
00088
00090
00091 class CLASSLIBEXPORT COORDOP_TARGET {
00092 public:
00093
00095 ERRVALUE OnBegin (
00096 ) { return (v_OnBegin()); }
00097
00099 ERRVALUE OnEnd (
00100 ) { return (v_OnEnd()); }
00101
00103 ERRVALUE OnPoint (
00104 const double* pPoint,
00105 INT32 InVertexNum,
00106 INT32 SubVertexNum
00107 ) { return (v_OnPoint(pPoint,InVertexNum,SubVertexNum)); }
00108
00109 private:
00110
00111
00113 virtual ERRVALUE v_OnBegin (
00114 );
00115
00117 virtual ERRVALUE v_OnEnd (
00118 );
00119
00121 virtual ERRVALUE v_OnPoint (
00122 const double* pPoint,
00123 INT32 InVertexNum,
00124 INT32 SubVertexNum
00125 ) = 0;
00126 };
00127
00128
00129
00131 class CLASSLIBEXPORT COORDOP_ONEWAY {
00132 public:
00133
00134 enum TYPE {
00135 TYPE_Undefined,
00136 TYPE_Identity,
00137 TYPE_Linear,
00138 TYPE_Single,
00139 TYPE_List
00140 };
00141
00145 static COORDOP_ONEWAY* Combine (
00146 const COORDOP_ONEWAY& first,
00147 const COORDOP_ONEWAY& second
00148 );
00149
00151 COORDOP_ONEWAY (
00152 );
00153
00154
00155 void AddRef (
00156 ) const { ++m_RefCount; }
00157
00164 int Convert (
00165 DPOINT2D *points,
00166 INT32 NumPoints,
00167 UINT8 *validity = 0
00168 ) const { return (v_Convert(points,NumPoints,validity)); }
00169
00176 int Convert (
00177 DPOINT3D *points,
00178 INT32 NumPoints,
00179 UINT8 *validity = 0
00180 ) const { return (v_Convert(points,NumPoints,validity)); }
00181
00188 int Convert (
00189 DPOINT3DH *points,
00190 INT32 NumPoints,
00191 UINT8 *validity = 0
00192 ) const { return (v_Convert(points,NumPoints,validity)); }
00193
00195 ERRVALUE ConvertDense (
00196 const DPOINT2D *ipoints,
00197 INT32 NumPoints,
00198 double tolerance,
00199 COORDOP_TARGET& target
00200 ) const;
00201
00203 ERRVALUE ConvertDense (
00204 const DPOINT3D *ipoints,
00205 INT32 NumPoints,
00206 double tolerance,
00207 COORDOP_TARGET& target
00208 ) const;
00209
00211 const COORDREFSYS& GetSourceCRS (
00212 ) const { return (m_SourceCRS); }
00213
00215 const COORDREFSYS& GetTargetCRS (
00216 ) const { return (m_TargetCRS); }
00217
00219 TYPE GetType (
00220 ) const { return (m_Type); }
00221
00224 bool GetValidExtents2D (
00225 DRECT2D& extents
00226 ) const { return (v_GetValidExtents2D(extents)); }
00227
00230 bool GetValidExtents3D (
00231 DRECT3D& extents
00232 ) const { return (v_GetValidExtents3D(extents)); }
00233
00235 bool IsLocked (
00236 ) const { return (m_IsLocked); }
00237
00239 void Release ();
00240
00241 protected:
00242
00244 explicit COORDOP_ONEWAY (
00245 TYPE type
00246 );
00247
00249 virtual ~COORDOP_ONEWAY (
00250 );
00251
00253 COORDOP_ONEWAY (
00254 const COORDOP_ONEWAY& rhs
00255 );
00256
00258 bool GetDisableRangeCheck (
00259 ) const { return (m_DisableRangeCheck); }
00260
00262 void SetDisableRangeCheck (
00263 bool DisableRangeCheck
00264 ) { m_DisableRangeCheck = DisableRangeCheck; }
00265
00268 void SetLocked (
00269 bool IsLocked
00270 ) { m_IsLocked = IsLocked; }
00271
00273 void SetSourceCRS (
00274 const COORDREFSYS& SourceCRS
00275 ) { m_SourceCRS = SourceCRS; }
00276
00278 void SetTargetCRS (
00279 const COORDREFSYS& TargetCRS
00280 ) { m_TargetCRS = TargetCRS; }
00281
00282 private:
00283 #ifndef GENERATING_DOXYGEN_OUTPUT
00284
00285
00286 mutable MITHREAD::INTERLOCKEDINT32 m_RefCount;
00287 TYPE m_Type;
00288 bool m_IsLocked;
00289 bool m_DisableRangeCheck;
00290
00291 COORDREFSYS m_SourceCRS;
00292 COORDREFSYS m_TargetCRS;
00293
00294
00295 COORDOP_ONEWAY& operator= (const COORDOP_ONEWAY&);
00296
00297 #endif // GENERATING_DOXYGEN_OUTPUT
00298
00299
00300
00306 virtual COORDOP_ONEWAY* v_CombineWithNext (
00307 const COORDOP_ONEWAY& next
00308 ) const;
00309
00315 virtual COORDOP_ONEWAY* v_CombineWithPrevious (
00316 const COORDOP_ONEWAY& previous
00317 ) const;
00318
00321 virtual ERRVALUE v_Convert (DPOINT2D *points, INT32 NumPoints, UINT8 *validity) const;
00322
00325 virtual ERRVALUE v_Convert (DPOINT3D *points, INT32 NumPoints, UINT8 *validity) const;
00326
00329 virtual ERRVALUE v_Convert (DPOINT3DH *points, INT32 NumPoints, UINT8 *validity) const;
00330
00334 virtual bool v_GetValidExtents2D (DRECT2D& extents) const;
00335
00339 virtual bool v_GetValidExtents3D (DRECT3D& extents) const;
00340
00341 };
00342
00343
00344
00345
00347 class CLASSLIBEXPORT COORDOP_IMPL {
00348 public:
00349
00350 class CLASSLIBEXPORT LINEAR {
00351 public:
00352
00354 LINEAR () { SetIdentity(); }
00355
00357 LINEAR (const LINEAR&);
00358
00360 LINEAR (const LINEAR& lhs, const LINEAR& rhs);
00361
00363 ~LINEAR () { }
00364
00366 LINEAR& operator= (const LINEAR&);
00367
00369 void ApplyScale (
00370 double scaleX,
00371 double scaleY,
00372 double scaleZ = 1,
00373 bool reverse = false
00374 );
00375
00377 void ApplyScale (
00378 const DPOINT2D& scale,
00379 bool reverse = false
00380 ) { ApplyScale(scale.x,scale.y,1.0,reverse); }
00381
00383 void ApplyScale (
00384 const DPOINT3D& scale,
00385 bool reverse = false
00386 ) { ApplyScale(scale.x,scale.y,scale.z,reverse); }
00387
00389 void ApplyTranslation (
00390 double transX,
00391 double transY,
00392 double transZ = 0,
00393 bool reverse = false
00394 );
00395
00397 void ApplyTranslation (
00398 const DPOINT2D& trans,
00399 bool reverse = false
00400 ) { ApplyTranslation(trans.x,trans.y,0,reverse); }
00401
00403 void ApplyTranslation (
00404 const DPOINT3D& trans,
00405 bool reverse = false
00406 ) { ApplyTranslation(trans.x,trans.y,trans.z,reverse); }
00407
00409 ERRVALUE Compute (
00410 const CTRLPOINT *CtrlPoints,
00411 int NumPoints
00412 );
00413
00415 ERRVALUE Compute (
00416 const CTRLPOINT3 *CtrlPoints,
00417 int NumPoints
00418 );
00419
00422 void ConvertForward (
00423 const DPOINT2D& ipoint,
00424 DPOINT2D& opoint
00425 ) const {
00426 opoint.x = m_Fwd[0][0] * ipoint.x + m_Fwd[0][1] * ipoint.y + m_Fwd[0][3];
00427 opoint.y = m_Fwd[1][0] * ipoint.x + m_Fwd[1][1] * ipoint.y + m_Fwd[1][3];
00428 }
00429
00432 DPOINT2D ConvertForward (
00433 const DPOINT2D& ipoint
00434 ) const {
00435 return (DPOINT2D(
00436 (m_Fwd[0][0] * ipoint.x + m_Fwd[0][1] * ipoint.y + m_Fwd[0][3]),
00437 (m_Fwd[1][0] * ipoint.x + m_Fwd[1][1] * ipoint.y + m_Fwd[1][3])
00438 ));
00439 }
00440
00443 void ConvertForward (
00444 const DPOINT3D& ipoint,
00445 DPOINT3D& opoint
00446 ) const {
00447 opoint.x = m_Fwd[0][0] * ipoint.x + m_Fwd[0][1] * ipoint.y + m_Fwd[0][2] * ipoint.z + m_Fwd[0][3];
00448 opoint.y = m_Fwd[1][0] * ipoint.x + m_Fwd[1][1] * ipoint.y + m_Fwd[1][2] * ipoint.z + m_Fwd[1][3];
00449 opoint.z = m_Fwd[2][0] * ipoint.x + m_Fwd[2][1] * ipoint.y + m_Fwd[2][2] * ipoint.z + m_Fwd[2][3];
00450 }
00451
00454 DPOINT3D ConvertForward (
00455 const DPOINT3D& ipoint
00456 ) const {
00457 return (DPOINT3D(
00458 (m_Fwd[0][0] * ipoint.x + m_Fwd[0][1] * ipoint.y + m_Fwd[0][2] * ipoint.z + m_Fwd[0][3]),
00459 (m_Fwd[1][0] * ipoint.x + m_Fwd[1][1] * ipoint.y + m_Fwd[1][2] * ipoint.z + m_Fwd[1][3]),
00460 (m_Fwd[2][0] * ipoint.x + m_Fwd[2][1] * ipoint.y + m_Fwd[2][2] * ipoint.z + m_Fwd[2][3])
00461 ));
00462 }
00463
00466 void ConvertForward (
00467 const DPOINT3DH& ipoint,
00468 DPOINT3DH& opoint
00469 ) const {
00470 opoint.x = m_Fwd[0][0] * ipoint.x + m_Fwd[0][1] * ipoint.y + m_Fwd[0][2] * ipoint.z + m_Fwd[0][3] * ipoint.w;
00471 opoint.y = m_Fwd[1][0] * ipoint.x + m_Fwd[1][1] * ipoint.y + m_Fwd[1][2] * ipoint.z + m_Fwd[1][3] * ipoint.w;
00472 opoint.z = m_Fwd[2][0] * ipoint.x + m_Fwd[2][1] * ipoint.y + m_Fwd[2][2] * ipoint.z + m_Fwd[2][3] * ipoint.w;
00473 opoint.w = m_Fwd[3][0] * ipoint.x + m_Fwd[3][1] * ipoint.y + m_Fwd[3][2] * ipoint.z + m_Fwd[3][3] * ipoint.w;
00474 }
00475
00478 DPOINT3DH ConvertForward (
00479 const DPOINT3DH& ipoint
00480 ) const {
00481 return (DPOINT3DH(
00482 (m_Fwd[0][0] * ipoint.x + m_Fwd[0][1] * ipoint.y + m_Fwd[0][2] * ipoint.z + m_Fwd[0][3] * ipoint.w),
00483 (m_Fwd[1][0] * ipoint.x + m_Fwd[1][1] * ipoint.y + m_Fwd[1][2] * ipoint.z + m_Fwd[1][3] * ipoint.w),
00484 (m_Fwd[2][0] * ipoint.x + m_Fwd[2][1] * ipoint.y + m_Fwd[2][2] * ipoint.z + m_Fwd[2][3] * ipoint.w),
00485 (m_Fwd[3][0] * ipoint.x + m_Fwd[3][1] * ipoint.y + m_Fwd[3][2] * ipoint.z + m_Fwd[3][3] * ipoint.w)
00486 ));
00487 }
00488
00491 void ConvertReverse (
00492 const DPOINT2D& ipoint,
00493 DPOINT2D& opoint
00494 ) const {
00495 opoint.x = m_Rev[0][0] * ipoint.x + m_Rev[0][1] * ipoint.y + m_Rev[0][3];
00496 opoint.y = m_Rev[1][0] * ipoint.x + m_Rev[1][1] * ipoint.y + m_Rev[1][3];
00497 }
00498
00501 DPOINT2D ConvertReverse (
00502 const DPOINT2D& ipoint
00503 ) const {
00504 return (DPOINT2D(
00505 (m_Rev[0][0] * ipoint.x + m_Rev[0][1] * ipoint.y + m_Rev[0][3]),
00506 (m_Rev[1][0] * ipoint.x + m_Rev[1][1] * ipoint.y + m_Rev[1][3])
00507 ));
00508 }
00509
00512 void ConvertReverse (
00513 const DPOINT3D& ipoint,
00514 DPOINT3D& opoint
00515 ) const {
00516 opoint.x = m_Rev[0][0] * ipoint.x + m_Rev[0][1] * ipoint.y + m_Rev[0][2] * ipoint.z + m_Rev[0][3];
00517 opoint.y = m_Rev[1][0] * ipoint.x + m_Rev[1][1] * ipoint.y + m_Rev[1][2] * ipoint.z + m_Rev[1][3];
00518 opoint.z = m_Rev[2][0] * ipoint.x + m_Rev[2][1] * ipoint.y + m_Rev[2][2] * ipoint.z + m_Rev[2][3];
00519 }
00520
00523 DPOINT3D ConvertReverse (
00524 const DPOINT3D& ipoint
00525 ) const {
00526 return (DPOINT3D(
00527 (m_Rev[0][0] * ipoint.x + m_Rev[0][1] * ipoint.y + m_Rev[0][2] * ipoint.z + m_Rev[0][3]),
00528 (m_Rev[1][0] * ipoint.x + m_Rev[1][1] * ipoint.y + m_Rev[1][2] * ipoint.z + m_Rev[1][3]),
00529 (m_Rev[2][0] * ipoint.x + m_Rev[2][1] * ipoint.y + m_Rev[2][2] * ipoint.z + m_Rev[2][3])
00530 ));
00531 }
00532
00535 void ConvertReverse (
00536 const DPOINT3DH& ipoint,
00537 DPOINT3DH& opoint
00538 ) const {
00539 opoint.x = m_Rev[0][0] * ipoint.x + m_Rev[0][1] * ipoint.y + m_Rev[0][2] * ipoint.z + m_Rev[0][3] * ipoint.w;
00540 opoint.y = m_Rev[1][0] * ipoint.x + m_Rev[1][1] * ipoint.y + m_Rev[1][2] * ipoint.z + m_Rev[1][3] * ipoint.w;
00541 opoint.z = m_Rev[2][0] * ipoint.x + m_Rev[2][1] * ipoint.y + m_Rev[2][2] * ipoint.z + m_Rev[2][3] * ipoint.w;
00542 opoint.w = m_Rev[3][0] * ipoint.x + m_Rev[3][1] * ipoint.y + m_Rev[3][2] * ipoint.z + m_Rev[3][3] * ipoint.w;
00543 }
00544
00547 DPOINT3DH ConvertReverse (
00548 const DPOINT3DH& ipoint
00549 ) const {
00550 return (DPOINT3DH(
00551 (m_Rev[0][0] * ipoint.x + m_Rev[0][1] * ipoint.y + m_Rev[0][2] * ipoint.z + m_Rev[0][3] * ipoint.w),
00552 (m_Rev[1][0] * ipoint.x + m_Rev[1][1] * ipoint.y + m_Rev[1][2] * ipoint.z + m_Rev[1][3] * ipoint.w),
00553 (m_Rev[2][0] * ipoint.x + m_Rev[2][1] * ipoint.y + m_Rev[2][2] * ipoint.z + m_Rev[2][3] * ipoint.w),
00554 (m_Rev[3][0] * ipoint.x + m_Rev[3][1] * ipoint.y + m_Rev[3][2] * ipoint.z + m_Rev[3][3] * ipoint.w)
00555 ));
00556 }
00557
00559 void Reverse (
00560 );
00561
00563 void SetIdentity (
00564 );
00565
00566 private:
00567 #ifndef GENERATING_DOXYGEN_OUTPUT
00568 void ApplyMatrix(const MAT4X4 mat, bool reverse);
00569 MAT4X4 m_Fwd;
00570 MAT4X4 m_Rev;
00571 #endif
00572 };
00573
00575 virtual ~COORDOP_IMPL (
00576 );
00577
00578
00579 void AddRef (
00580 ) { ++m_RefCount; }
00581
00586 int ComputeLinearApproximation (
00587 COORDOP_DIRECTION direction,
00588 const REGION2D& region,
00589 double tolerance,
00590 LINEAR& Linear
00591 ) const;
00592
00594 ERRVALUE ConvertForward (
00595 const DPOINT2D* ipoints,
00596 DPOINT2D* opoints,
00597 INT32 NumPoints
00598 ) const {
00599 if (IsLinear()) {
00600 for (INT32 p = 0; (p < NumPoints); ++p)
00601 *opoints++ = m_Linear.ConvertForward(*ipoints++);
00602 return (0);
00603 }
00604 else return (v_ConvertForward(ipoints,opoints,NumPoints));
00605 }
00606
00608 ERRVALUE ConvertForward (
00609 const DPOINT3D* ipoints,
00610 DPOINT3D* opoints,
00611 INT32 NumPoints
00612 ) const {
00613 if (IsLinear()) {
00614 for (INT32 p = 0; (p < NumPoints); ++p)
00615 *opoints++ = m_Linear.ConvertForward(*ipoints++);
00616 return (0);
00617 }
00618 else return (v_ConvertForward(ipoints,opoints,NumPoints));
00619 }
00620
00622 ERRVALUE ConvertForward (
00623 const DPOINT3DH* ipoints,
00624 DPOINT3DH* opoints,
00625 INT32 NumPoints
00626 ) const {
00627 if (IsLinear()) {
00628 for (INT32 p = 0; (p < NumPoints); ++p)
00629 *opoints++ = m_Linear.ConvertForward(*ipoints++);
00630 return (0);
00631 }
00632 else return (v_ConvertForward(ipoints,opoints,NumPoints));
00633 }
00634
00636 ERRVALUE ConvertForwardDense (
00637 INT32 NumPoints,
00638 int NumDim,
00639 const double *ipoint,
00640 double tolerance,
00641 COORDOP_TARGET& target
00642 ) const;
00643
00645 ERRVALUE ConvertReverse (
00646 const DPOINT2D* ipoints,
00647 DPOINT2D* opoints,
00648 INT32 NumPoints
00649 ) const {
00650 if (IsLinear()) {
00651 for (INT32 p = 0; (p < NumPoints); ++p)
00652 *opoints++ = m_Linear.ConvertReverse(*ipoints++);
00653 return (0);
00654 }
00655 else return (v_ConvertReverse(ipoints,opoints,NumPoints));
00656 }
00657
00659 ERRVALUE ConvertReverse (
00660 const DPOINT3D* ipoints,
00661 DPOINT3D* opoints,
00662 INT32 NumPoints
00663 ) const {
00664 if (IsLinear()) {
00665 for (INT32 p = 0; (p < NumPoints); ++p)
00666 *opoints++ = m_Linear.ConvertReverse(*ipoints++);
00667 return (0);
00668 }
00669 else return (v_ConvertReverse(ipoints,opoints,NumPoints));
00670 }
00671
00673 ERRVALUE ConvertReverse (
00674 const DPOINT3DH* ipoints,
00675 DPOINT3DH* opoints,
00676 INT32 NumPoints
00677 ) const {
00678 if (IsLinear()) {
00679 for (INT32 p = 0; (p < NumPoints); ++p)
00680 *opoints++ = m_Linear.ConvertReverse(*ipoints++);
00681 return (0);
00682 }
00683 else return (v_ConvertReverse(ipoints,opoints,NumPoints));
00684 }
00685
00687 ERRVALUE ConvertReverseDense (
00688 INT32 NumPoints,
00689 int NumDim,
00690 const double *ipoint,
00691 double tolerance,
00692 COORDOP_TARGET& target
00693 ) const;
00694
00696 const LINEAR& GetLinear (
00697 ) const { return (m_Linear); }
00698
00700 const COORDREFSYS& GetSourceCRS (
00701 ) const { return (m_SourceCRS); }
00702
00704 const COORDREFSYS& GetTargetCRS (
00705 ) const { return (m_TargetCRS); }
00706
00708 bool HasForward (
00709 ) const { return (m_HasForward); }
00710
00712 bool HasReverse (
00713 ) const { return (m_HasReverse); }
00714
00716 bool IsBidirectional (
00717 ) const { return (m_HasForward && m_HasReverse); }
00718
00720 bool IsLinear (
00721 ) const { return (m_IsLinear); }
00722
00723
00724 void Release ();
00725
00726 protected:
00727
00728 enum TYPE {
00729 TYPE_Identity,
00730 TYPE_Single,
00731 TYPE_List
00732 };
00733
00735 explicit COORDOP_IMPL (
00736 TYPE type,
00737 bool IsLinear = false
00738 );
00739
00741 COORDOP_IMPL (
00742 const COORDOP_IMPL& rhs
00743 );
00744
00745 bool GetDisableRangeCheck (
00746 ) const { return (m_DisableRangeCheck); }
00747
00749 TYPE GetType (
00750 ) const { return (m_Type); }
00751
00752 void SetDisableRangeCheck (
00753 bool DisableRangeCheck
00754 ) { m_DisableRangeCheck = DisableRangeCheck; }
00755
00757 void SetLinear (
00758 const LINEAR& Linear
00759 ) { m_IsLinear = true; m_Linear = Linear; }
00760
00762 void SetNonLinear (
00763 ) { m_IsLinear = false; }
00764
00766 void SetSourceCRS (
00767 const COORDREFSYS& SourceCRS
00768 ) { m_SourceCRS = SourceCRS; }
00769
00771 void SetTargetCRS (
00772 const COORDREFSYS& TargetCRS
00773 ) { m_TargetCRS = TargetCRS; }
00774
00776 void SetValidDirections (
00777 bool hasForward,
00778 bool hasReverse
00779 ) { m_HasForward = hasForward; m_HasReverse = hasReverse; }
00780
00781 private:
00782 #ifndef GENERATING_DOXYGEN_OUTPUT
00783
00784
00785 int m_RefCount;
00786 TYPE m_Type;
00787 bool m_IsLinear;
00788 bool m_HasForward;
00789 bool m_HasReverse;
00790 bool m_DisableRangeCheck;
00791
00792 COORDREFSYS m_SourceCRS;
00793 COORDREFSYS m_TargetCRS;
00794 LINEAR m_Linear;
00795
00796
00797 ERRVALUE ConvertDense (
00798 INT32 NumPoints,
00799 int NumDim,
00800 const double *ipoint,
00801 COORDOP_DIRECTION direction,
00802 double tolerance,
00803 COORDOP_TARGET& target
00804 ) const;
00805
00806
00807 COORDOP_IMPL* Copy (
00808 ) const { return (v_Copy()); }
00809
00810
00811 int GetRefCount () const { return (m_RefCount); }
00812
00813
00814 void Reverse ();
00815
00816
00817 COORDOP_IMPL& operator= (const COORDOP_IMPL&);
00818
00819 friend class SPATREF::COORDOP;
00820 friend class SPATREF::COORDOP_SINGLE;
00821 friend class SPATREF::COORDOP_LIST;
00822 friend class SPATREF::COORDOP_IMPL_LINEAR;
00823 friend class SPATREF::COORDOP_IMPL_LIST;
00824
00825 #endif // GENERATING_DOXYGEN_OUTPUT
00826
00827
00828
00830 virtual ERRVALUE v_ConvertForward (const DPOINT2D* ipoints, DPOINT2D* opoints, INT32 NumPoints) const = 0;
00831
00833 virtual ERRVALUE v_ConvertForward (const DPOINT3D* ipoints, DPOINT3D* opoints, INT32 NumPoints) const = 0;
00834
00836 virtual ERRVALUE v_ConvertForward (const DPOINT3DH* ipoints, DPOINT3DH* opoints, INT32 NumPoints) const = 0;
00837
00839 virtual ERRVALUE v_ConvertReverse (const DPOINT2D* ipoints, DPOINT2D* opoints, INT32 NumPoints) const = 0;
00840
00842 virtual ERRVALUE v_ConvertReverse (const DPOINT3D* ipoints, DPOINT3D* opoints, INT32 NumPoints) const = 0;
00843
00845 virtual ERRVALUE v_ConvertReverse (const DPOINT3DH* ipoints, DPOINT3DH* opoints, INT32 NumPoints) const = 0;
00846
00848 virtual COORDOP_IMPL* v_Copy () const = 0;
00849
00851 virtual void v_Reverse () = 0;
00852
00853 };
00854
00855
00856
00860 class CLASSLIBEXPORT COORDOP {
00861 public:
00862
00864 COORDOP (
00865 const COORDOP& rhs
00866 );
00867
00869 ~COORDOP (
00870 );
00871
00873 COORDOP& operator= (
00874 const COORDOP& rhs
00875 );
00876
00878 ERRVALUE ConvertForward (
00879 const DPOINT2D& ipoint,
00880 DPOINT2D& opoint
00881 ) const { return (m_pImpl->ConvertForward(&ipoint,&opoint,1)); }
00882
00884 ERRVALUE ConvertForward (
00885 const DPOINT3D& ipoint,
00886 DPOINT3D& opoint
00887 ) const { return (m_pImpl->ConvertForward(&ipoint,&opoint,1)); }
00888
00890 ERRVALUE ConvertForward (
00891 const DPOINT3DH& ipoint,
00892 DPOINT3DH& opoint
00893 ) const { return (m_pImpl->ConvertForward(&ipoint,&opoint,1)); }
00894
00896 ERRVALUE ConvertForward (
00897 const DPOINT2D* ipoints,
00898 DPOINT2D* opoints,
00899 INT32 NumPoints
00900 ) const { return (m_pImpl->ConvertForward(ipoints,opoints,NumPoints)); }
00901
00903 ERRVALUE ConvertForward (
00904 const DPOINT3D* ipoints,
00905 DPOINT3D* opoints,
00906 INT32 NumPoints
00907 ) const { return (m_pImpl->ConvertForward(ipoints,opoints,NumPoints)); }
00908
00910 ERRVALUE ConvertForward (
00911 const DPOINT3DH* ipoints,
00912 DPOINT3DH* opoints,
00913 INT32 NumPoints
00914 ) const { return (m_pImpl->ConvertForward(ipoints,opoints,NumPoints)); }
00915
00917 ERRVALUE ConvertForwardDense (
00918 INT32 NumPoints,
00919 int NumDim,
00920 const double *ipoint,
00921 double tolerance,
00922 COORDOP_TARGET& target
00923 ) const { return (m_pImpl->ConvertForwardDense(NumPoints,NumDim,ipoint,tolerance,target)); }
00924
00926 ERRVALUE ConvertReverse (
00927 const DPOINT2D& ipoint,
00928 DPOINT2D& opoint
00929 ) const { return (m_pImpl->ConvertReverse(&ipoint,&opoint,1)); }
00930
00932 ERRVALUE ConvertReverse (
00933 const DPOINT3D& ipoint,
00934 DPOINT3D& opoint
00935 ) const { return (m_pImpl->ConvertReverse(&ipoint,&opoint,1)); }
00936
00938 ERRVALUE ConvertReverse (
00939 const DPOINT3DH& ipoint,
00940 DPOINT3DH& opoint
00941 ) const { return (m_pImpl->ConvertReverse(&ipoint,&opoint,1)); }
00942
00944 ERRVALUE ConvertReverse (
00945 const DPOINT2D* ipoints,
00946 DPOINT2D* opoints,
00947 INT32 NumPoints
00948 ) const { return (m_pImpl->ConvertReverse(ipoints,opoints,NumPoints)); }
00949
00951 ERRVALUE ConvertReverse (
00952 const DPOINT3D* ipoints,
00953 DPOINT3D* opoints,
00954 INT32 NumPoints
00955 ) const { return (m_pImpl->ConvertReverse(ipoints,opoints,NumPoints)); }
00956
00958 ERRVALUE ConvertReverse (
00959 const DPOINT3DH* ipoints,
00960 DPOINT3DH* opoints,
00961 INT32 NumPoints
00962 ) const { return (m_pImpl->ConvertReverse(ipoints,opoints,NumPoints)); }
00963
00965 ERRVALUE ConvertReverseDense (
00966 INT32 NumPoints,
00967 int NumDim,
00968 const double *ipoint,
00969 double tolerance,
00970 COORDOP_TARGET& target
00971 ) const { return (m_pImpl->ConvertReverseDense(NumPoints,NumDim,ipoint,tolerance,target)); }
00972
00975 const COORDOP_IMPL::LINEAR& GetLinear (
00976 ) const { return (m_pImpl->GetLinear()); }
00977
00982 int GetLinearApproximation (
00983 COORDOP& CoordOp,
00984 COORDOP_DIRECTION direction,
00985 const REGION2D& region,
00986 double tolerance
00987 ) const;
00988
00990 const COORDREFSYS& GetSourceCRS (
00991 ) const { return (m_pImpl->GetSourceCRS()); }
00992
00994 const COORDREFSYS& GetTargetCRS (
00995 ) const { return (m_pImpl->GetTargetCRS()); }
00996
00998 bool HasForward (
00999 ) const { return (m_pImpl->HasForward()); }
01000
01002 bool HasReverse (
01003 ) const { return (m_pImpl->HasReverse()); }
01004
01006 bool IsBidirectional (
01007 ) const { return (m_pImpl->IsBidirectional()); }
01008
01009 bool IsIdentity (
01010 ) const { return (m_pImpl->m_Type == COORDOP_IMPL::TYPE_Identity); }
01011
01013 bool IsLinear (
01014 ) const { return (m_pImpl->IsLinear()); }
01015
01017 bool IsList (
01018 ) const { return (m_pImpl->m_Type == COORDOP_IMPL::TYPE_List); }
01019
01021 void ReverseDirection (
01022 );
01023
01024 protected:
01025 #ifndef GENERATING_DOXYGEN_OUTPUT
01026 COORDOP_IMPL *m_pImpl;
01027 COORDOP ();
01028 void GetExclusive ();
01029 #endif // GENERATING_DOXYGEN_OUTPUT
01030 };
01031
01032
01033
01036 class CLASSLIBEXPORT COORDOP_SINGLE : public COORDOP {
01037 public:
01038
01041 COORDOP_SINGLE (
01042 );
01043
01048 COORDOP_SINGLE (
01049 COORDOP_IMPL *& pImpl
01050 );
01051
01056 void Attach (
01057 COORDOP_IMPL *& pImpl
01058 );
01059
01062 ERRVALUE Create (
01063 const COORDOPDEF& CoordOpDef,
01064 const COORDREFSYS& SourceCRS,
01065 const COORDREFSYS& TargetCRS,
01066 bool DisableRangeCheck = false
01067 );
01068
01072 COORDOP_IMPL* Detach (
01073 );
01074
01076 void ReleaseAttached (
01077 );
01078
01079 };
01080
01081
01082
01084 class CLASSLIBEXPORT COORDOP_LIST : public COORDOP {
01085 public:
01086
01088 COORDOP_LIST (
01089 );
01090
01092 COORDOP_LIST (
01093 const COORDOP_LIST& rhs
01094 );
01095
01097 COORDOP_LIST (
01098 const COORDOP& rhs
01099 );
01100
01102 COORDOP_LIST& operator= (
01103 const COORDOP_LIST& rhs
01104 );
01105
01107 COORDOP_LIST& operator= (
01108 const COORDOP& rhs
01109 );
01110
01113 ERRVALUE AddEnd (
01114 const COORDOP& operation
01115 );
01116
01119 ERRVALUE AddEnd (
01120 const COORDOP_LIST& oplist
01121 );
01122
01127 int AddEnd (
01128 const COORDREFSYS& TargetCRS
01129 );
01130
01133 ERRVALUE AddStart (
01134 const COORDOP& operation
01135 );
01136
01139 ERRVALUE AddStart (
01140 const COORDOP_LIST& oplist
01141 );
01142
01147 int AddStart (
01148 const COORDREFSYS& SourceCRS
01149 );
01150
01152 void Clear (
01153 );
01154
01158 ERRVALUE Create (
01159 const COORDOPDEF& CoordOpDef,
01160 bool DisableRangeCheck = false
01161 );
01162
01164 ERRVALUE Create (
01165 const COORDREFSYS& SourceCRS,
01166 const COORDREFSYS& TargetCRS,
01167 bool DisableRangeCheck = false
01168 );
01169
01172 void RemoveEnd (
01173 );
01174
01177 void RemoveStart (
01178 );
01179
01180 private:
01181 #ifndef GENERATING_DOXYGEN_OUTPUT
01182 ERRVALUE Create (const COORDREFSYS& CoordRefSys, bool DisableRangeCheck);
01183 const MILIST<COORDOP>& GetOpListMin () const;
01184
01185 friend class COORDOP_IMPL_LIST;
01186 #endif // GENERATING_DOXYGEN_OUTPUT
01187 };
01188
01189
01190
01191 class COORDOPZONED_IMPL;
01192
01194 class CLASSLIBEXPORT COORDOP_ZONED {
01195 public:
01196
01198 COORDOP_ZONED (
01199 );
01200
01202 COORDOP_ZONED (
01203 const COORDOP_ZONED& rhs
01204 );
01205
01207 ~COORDOP_ZONED (
01208 );
01209
01211 COORDOP_ZONED& operator= (
01212 const COORDOP_ZONED& rhs
01213 );
01214
01216 ERRVALUE ConvertFromZoned (
01217 const MISTRING& zonestr,
01218 const DPOINT2D& ipoint,
01219 const COORDREFSYS& PointCoordRefSys,
01220 DPOINT2D& opoint
01221 ) const;
01222
01224 ERRVALUE ConvertFromZoned (
01225 const MISTRING& zonestr,
01226 const DPOINT3D& ipoint,
01227 const COORDREFSYS& PointCoordRefSys,
01228 DPOINT3D& opoint
01229 ) const;
01230
01232 ERRVALUE ConvertFromZoned (
01233 const MISTRING& string,
01234 const COORDREFSYS& PointCoordRefSys,
01235 DPOINT2D& opoint
01236 ) const;
01237
01239 ERRVALUE ConvertToZoned (
01240 const COORDREFSYS& PointCoordRefSys,
01241 const DPOINT2D& ipoint,
01242 MISTRING& zonestr,
01243 DPOINT2D& opoint
01244 ) const;
01245
01247 ERRVALUE ConvertToZoned (
01248 const COORDREFSYS& PointCoordRefSys,
01249 const DPOINT3D& ipoint,
01250 MISTRING& zonestr,
01251 DPOINT3D& opoint
01252 ) const;
01253
01255 ERRVALUE SetCoordRefSys (
01256 const COORDREFSYS& ZonedCRS
01257 );
01258
01259 private:
01260 #ifndef GENERATING_DOXYGEN_OUTPUT
01261 COORDOPZONED_IMPL *m_pImpl;
01262 #endif // GENERATING_DOXYGEN_OUTPUT
01263 };
01264
01265
01266
01267 }
01268
01269 #undef CLASSLIBEXPORT
01270
01271 #endif // INC_MI32_COORDOP_H