00001
00027 #ifndef INC_MI32_ZVIEW_H
00028 #define INC_MI32_ZVIEW_H
00029
00030 #ifndef INC_MI32_SIMPLEAR_H
00031 #include <mi32/simplear.h>
00032 #endif
00033
00034 #ifndef INC_MI32_POINT_H
00035 #include <mi32/point.h>
00036 #endif
00037
00038 #ifndef INC_MI32_STEREOSHIFT_H
00039 #include <mi32/stereoshift.h>
00040 #endif
00041
00042
00043 #ifndef GENERATING_DOXYGEN_OUTPUT
00044
00045 class POLYLINE;
00046 class SUBREGION2D;
00047 class TRANS2D_MAPGEN;
00048 namespace RVC {
00049 class OBJITEM;
00050 }
00051 namespace SPATMOD {
00052 namespace IMAGE {
00053 class STAGE;
00054 }
00055 }
00056 #endif
00057
00058
00060 class ZVIEW {
00061 public:
00062
00064 ZVIEW ();
00065
00067 ~ZVIEW ();
00068
00070 void CalcDisplacedPointDual (
00071 const DPOINT3D& ptBase,
00072 DPOINT2D& ptLeft,
00073 DPOINT2D& ptRight
00074 ) const { m_StereoShift.CalcPointDual(ptBase,ptLeft,ptRight); }
00075
00077 void CalcDisplacedPointDualOnSurface (
00078 DPOINT3D& ptBase,
00079 DPOINT2D& ptLeft,
00080 DPOINT2D& ptRight
00081 ) const;
00082
00084 void CalcDisplacedPointLeft (
00085 const DPOINT3D& ptBase,
00086 DPOINT2D& ptDisplaced
00087 ) const { m_StereoShift.CalcPointLeft(ptBase,ptDisplaced); }
00088
00090 void CalcDisplacedPointRight (
00091 const DPOINT3D& ptBase,
00092 DPOINT2D& ptDisplaced
00093 ) const { m_StereoShift.CalcPointRight(ptBase,ptDisplaced); }
00094
00097 void CalcDisplacedPointSingleOnSurface (
00098 DPOINT3D& ptBase,
00099 DPOINT2D& ptDisplaced
00100 ) const;
00101
00104 void CalcDisplacedPolylineDual (
00105 const POLYLINE& plBase,
00106 POLYLINE& plLeft,
00107 POLYLINE& plRight,
00108 bool UseSurfaceZ
00109 ) const;
00110
00113 void CalcDisplacedPolylineSingle (
00114 const POLYLINE& plBase,
00115 POLYLINE& plDisplaced,
00116 bool UseSurfaceZ
00117 ) const;
00118
00121 void CalcDisplacedSubRegionDual (
00122 const SUBREGION2D& srBase,
00123 SUBREGION2D& srLeft,
00124 SUBREGION2D& srRight,
00125 bool UseSurfaceZ
00126 ) const;
00127
00130 void CalcDisplacedSubRegionSingle (
00131 const SUBREGION2D& srBase,
00132 SUBREGION2D& srDisplaced,
00133 bool UseSurfaceZ
00134 ) const;
00135
00138 bool CalcPointZ (
00139 DPOINT3D& ptDevice
00140 ) const;
00141
00143 void CloseSurface ();
00144
00146 const STEREOSHIFT& GetStereoShift () const
00147 { return (m_StereoShift); }
00148
00150 bool HasStereoShift () const
00151 { return (m_StereoShift.IsValid()); }
00152
00154 bool HasSurface () const
00155 { return (!m_SurfaceData.IsEmpty()); }
00156
00158 void InvalidateStereoShift ()
00159 { m_StereoShift.Invalidate(); }
00160
00162 void SetStereoShift (
00163 const STEREOSHIFT& StereoShift
00164 );
00165
00168 ERRVALUE SetupSurface (
00169 const RVC::OBJITEM& ObjItemSurface,
00170 const TRANS2D_MAPGEN& TransSurfaceToDevice,
00171 const LRECT2D& DeviceRect
00172 );
00173
00176 ERRVALUE SetupSurface (
00177 SPATMOD::IMAGE::STAGE& StageSurface,
00178 const TRANS2D_MAPGEN& TransSurfaceToDevice,
00179 const LRECT2D& DeviceRect
00180 );
00181
00182 private:
00183 #ifndef GENERATING_DOXYGEN_OUTPUT
00184 double m_SurfaceDensifyIncrement;
00185 STEREOSHIFT m_StereoShift;
00186 LPOINT2D m_Origin;
00187 LPOINT2D m_Size;
00188 SIMPLE_ARRAY<float> m_SurfaceData;
00189
00190 bool GetSurfaceZ (INT32 x, INT32 y, double& z) const;
00191
00192 ZVIEW (const ZVIEW&);
00193 ZVIEW& operator= (const ZVIEW&);
00194 #endif
00195 };
00196
00197
00198
00199 #endif // INC_MI32_ZVIEW_H