00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef INC_GRE_VIEWPOINT3D_H
00055 #define INC_GRE_VIEWPOINT3D_H
00056
00057 #ifndef INC_GRE_3DSCENE_H
00058 #include <gre/3dscene.h>
00059 #endif
00060
00061 #ifndef INC_MI32_SERIALIZERITEM_H
00062 #include <mi32/serializeritem.h>
00063 #endif
00064
00065
00066 #ifndef GENERATING_DOXYGEN_OUTPUT
00067 namespace SML {
00068 class CONTEXT;
00069 class CLASSMEMBER;
00070 }
00071 #endif
00072
00073 namespace GRE {
00074
00075
00076 class VIEWPOINT3D {
00077 public:
00078
00079 static ERRVALUE SerializerCB (
00080 SERIALIZER& serializer,
00081 const SERIALIZERITEM *item,
00082 void *pvvp,
00083 SERIALIZERITEM::ACTION action
00084 );
00085
00087 static void SMLClassInstall (
00088 SML::CONTEXT *context
00089 );
00090
00092 explicit VIEWPOINT3D (
00093 GRE::GROUP *group,
00094 GRE::VIEW *view = 0
00095 );
00096
00098 VIEWPOINT3D (
00099 const VIEWPOINT3D& rhs
00100 );
00101
00103 ~VIEWPOINT3D (
00104 );
00105
00107 VIEWPOINT3D& operator= (
00108 const VIEWPOINT3D& rhs
00109 );
00110
00111 bool Calculate (
00112 );
00113
00114 void CalculateAutoCenter (
00115 );
00116
00117 void CalculateCenterPoint (
00118 );
00119
00120 void CalculateCenterFromViewPoint (
00121 );
00122
00123 void CalculateParameters (
00124 );
00125
00126 void CalculatePoint (
00127 const bool center
00128 );
00129
00130 void CalculateTransVD (
00131 MAT3X3,
00132 MAT3X3
00133 ) const;
00134
00135 void CalculateViewDirFromAzimAngle (
00136 double angle
00137 );
00138
00139 void CalculateTransVRCToWorld (
00140 TRANS3D& trans
00141 ) const;
00142
00143 void CalculateUsedRect (
00144 const DRECT2D&,
00145 const DPOINT2D&
00146 );
00147
00148 void CalculateUsedRect (
00149 double aspect
00150 );
00151
00153 double GetAutoCenterDistance (
00154 ) const;
00155
00157 double GetBackClipDistance (
00158 ) const;
00159
00161 double GetBaseElevation (
00162 ) const;
00163
00165 const DPOINT3D& GetCenterPoint (
00166 ) const;
00167
00169 const DRECT2D& GetDestRect (
00170 ) const;
00171
00173 double GetFrontClipDistance (
00174 ) const;
00175
00177 GRE::GROUP* GetGroup (
00178 ) const;
00179
00181 double GetHeading (
00182 bool FromNorth = true
00183 ) const;
00184
00185 double GetParallelProjDistance (
00186 ) const;
00187
00189 double GetPitch (
00190 ) const;
00191
00193
00194
00195
00196 double GetStereoDepthScale (
00197 ) const;
00198
00199 double GetStereoDistance0 (
00200 ) const;
00201
00202 double GetSunAzimuthAngle (
00203 );
00204
00205 double GetSunElevationAngle (
00206 );
00207
00208 GRE::VIEW* GetView (
00209 ) const;
00210
00211 double GetViewAngle (
00212 ) const;
00213
00214 const DPOINT3D& GetViewDirection (
00215 ) const;
00216
00217 double GetViewPlaneDistance (
00218 ) const;
00219
00220 const DPOINT3D& GetViewPosition (
00221 ) const;
00222
00223 const DRECT2D& GetViewRectUsed (
00224 ) const;
00225
00226 GRE::SCENE3D& GetScene3D (
00227 );
00228
00229 const GRE::SCENE3D& GetScene3D (
00230 ) const;
00231
00232 const DPOINT3D& GetViewUp (
00233 ) const;
00234
00235 const double GetZScale (
00236 ) const;
00237
00238 void IniRead (
00239 INIHANDLE handle,
00240 const char *inigroup
00241 );
00242
00243 void IniWrite (
00244 INIHANDLE handle,
00245 const char *inigroup
00246 );
00247
00248 bool IsAutoCentered (
00249 ) const;
00250
00251 bool IsCalculated (
00252 ) const;
00253
00254 bool IsClipBackPlane (
00255 ) const;
00256
00257 bool IsPerspective (
00258 ) const;
00259
00260 bool IsStereo (
00261 ) const;
00262
00263 void SetAutoCenter (
00264 bool AutoCenter
00265 );
00266
00267 void SetAutoCenterAzimAngle (
00268 double AzimAngle
00269 );
00270
00271 void SetAutoCenterDistance (
00272 double Distance
00273 );
00274
00275 void SetAutoCenterElevAngle (
00276 double ElevAngle
00277 );
00278
00279 void SetAutoCenterPoint (
00280 const DPOINT2D& point
00281 );
00282
00283 void SetAutoCenterPoint (
00284 const DPOINT3D& point
00285 );
00286
00287 void SetBackClipDistance (
00288 double BackClipDist
00289 );
00290
00291 void SetBaseElevation (
00292 double BaseElevation
00293 );
00294
00295 void SetClipBackPlane (
00296 bool ClipBackPlane
00297 );
00298
00299 void SetDestRect (
00300 const DRECT2D& DestRect
00301 );
00302
00303 void SetFrontClipDistance (
00304 double FrontClipDist
00305 );
00306
00307 void SetHeading (
00308 double Heading,
00309 bool FromNorth = true
00310 );
00311
00312 void SetParallelProjDistance (
00313 double ParallelProjDist
00314 );
00315
00316 void SetPerspective (
00317 bool isPerspective = true
00318 );
00319
00320 void SetPitch (
00321 double Pitch
00322 );
00323
00324
00325
00326
00327
00328 void SetStereo (
00329 bool isStereo
00330 );
00331
00332 void SetStereoDepthScale (
00333 double StereoDepthScale
00334 );
00335
00336 void SetStereoDistance0 (
00337 double StereoDistance0
00338 );
00339
00340 void SetSunAzimuthAngle (
00341 double SunAzimAngle
00342 );
00343
00344 void SetSunElevationAngle (
00345 double SunElevAngle
00346 );
00347
00348 void SetViewDirection (
00349 const DPOINT3D& ViewDir
00350 );
00351
00352 void SetViewNeedsRedraw();
00353
00354 void SetViewPosition (
00355 const DPOINT2D& ViewPos
00356 );
00357
00358 void SetViewPosition (
00359 const DPOINT3D& ViewPos
00360 );
00361
00362 void SetViewPositionZ (
00363 double z
00364 );
00365
00366 void SetViewRectUsed (
00367 const DRECT2D& ViewRectUsed
00368 );
00369
00370 void SetViewPlaneDistance (
00371 double ViewPlaneDistance
00372 );
00373
00374 void SetViewUp (
00375 const DPOINT3D& ViewUp
00376 );
00377
00378 void SetZScale (
00379 double ZScale
00380 );
00381
00382
00383 #ifndef GENERATING_DOXYGEN_OUTPUT
00384 protected:
00385
00386 static const SML::CLASSMEMBER* GetSMLClassMembers (
00387 );
00388
00389 private:
00390
00391 GRE::GROUP *m_group;
00392 GRE::VIEW *m_view;
00393 DPOINT3D m_ViewPos;
00394 DPOINT3D m_ViewDir;
00395 DPOINT3D m_ViewUp;
00396 DRECT2D m_ViewRectUsed;
00397 double m_ViewPlaneDist;
00398 double m_FrontClipDist;
00399 double m_BackClipDist;
00400 double m_ParallelProjDist;
00401 double m_StereoDistance0;
00402 double m_StereoDepthScale;
00403 DPOINT3D m_CenterPoint;
00404 double m_AzimAngle;
00405 double m_ElevAngle;
00406
00407 double m_AutoCenterDist;
00408 double m_ZScale;
00409 double m_BaseElevation;
00410 DRECT2D m_DestRect;
00411
00412 bool m_IsPerspective;
00413 bool m_ClipBackPlane;
00414 bool m_IsStereo;
00415 bool m_AutoCenter;
00416 bool m_CenterSet;
00417 UINT32 m_oldflags;
00418 double m_SunAzimAngle;
00419 double m_SunElevAngle;
00420
00421 GRE::SCENE3D m_Scene3D;
00422
00423 static ERRVALUE SerializerCB_OldFlags (
00424 SERIALIZER& serializer,
00425 const SERIALIZERITEM *item,
00426 void *vgroup,
00427 SERIALIZERITEM::ACTION action
00428 );
00429
00430 void CalcCVPtoD ();
00431 const TRANS3D& GetNormTrans (
00432 int vindex = 0
00433 ) const;
00434 void CalcNormTrans ();
00435
00436 #endif // GENERATING_DOXYGEN_OUTPUT
00437 };
00438
00439
00440
00441 }
00442
00443 #endif // INC_GRE_VIEWPOINT3D_H