23 #if !defined(OPENNURBS_VIEWPORT_INC_)
24 #define OPENNURBS_VIEWPORT_INC_
44 bool IsValidCamera()
const;
45 bool IsValidFrustum()
const;
174 ON::view_projection Projection()
const;
186 bool SetProjection( ON::view_projection projection );
202 bool ChangeToParallelProjection(
bool bSymmetricFrustum );
228 bool ChangeToPerspectiveProjection(
229 double target_distance,
230 bool bSymmetricFrustum,
261 bool ChangeToTwoPointPerspectiveProjection(
262 double target_distance,
271 bool IsPerspectiveProjection()
const;
280 bool IsTwoPointPerspectiveProjection()
const;
286 bool IsParallelProjection()
const;
298 bool CameraLocationIsLocked()
const;
299 bool CameraDirectionIsLocked()
const;
300 bool CameraUpIsLocked()
const;
301 bool FrustumIsLeftRightSymmetric()
const;
302 bool FrustumIsTopBottomSymmetric()
const;
304 void SetCameraLocationLock(
bool bLockCameraLocation );
305 void SetCameraDirectionLock(
bool bLockCameraDirection ) ;
306 void SetCameraUpLock(
bool bLockCameraUp );
307 void SetFrustumLeftRightSymmetry(
bool bForceLeftRightSymmetry );
308 void SetFrustumTopBottomSymmetry(
bool bForceTopBottomSymmetry );
310 void UnlockFrustumSymmetry();
326 bool IsCameraFrameWorldPlan(
339 bool GetCameraExtents(
349 bool GetCameraExtents(
357 bool GetCameraExtents(
385 double* near_dist = NULL,
386 double* far_dist = NULL
395 bool SetFrustumAspect(
double );
398 bool GetFrustumAspect(
double& )
const;
401 bool GetFrustumCenter(
double* )
const;
407 double FrustumLeft()
const;
408 double FrustumRight()
const;
409 double FrustumBottom()
const;
410 double FrustumTop()
const;
411 double FrustumNear()
const;
412 double FrustumFar()
const;
418 double FrustumWidth()
const;
424 double FrustumHeight()
const;
430 double FrustumMinimumDiameter()
const;
436 double FrustumMaximumDiameter()
const;
439 bool SetFrustumNearFar(
440 const double* bboxmin,
441 const double* bboxmax
443 bool SetFrustumNearFar(
444 const double* center,
447 bool SetFrustumNearFar(
473 bool ChangeToSymmetricFrustum(
474 bool bLeftRightSymmetric,
475 bool bTopBottomSymmetric,
476 double target_distance
502 bool bGrowNearFar=
false
525 double* view_plane_depth
560 bool GetBoundingBoxDepth(
564 bool bGrowNearFar=
false
590 bool bGrowNearFar=
false
627 bool SetFrustumNearFar(
630 double min_near_dist,
631 double min_near_over_far,
635 bool SetFrustumNearFar(
638 double min_near_dist,
639 double min_near_over_far,
641 double relative_depth_bias
660 bool GetNearPlaneEquation(
679 bool GetFarPlaneEquation(
704 double view_plane_depth,
708 bool GetViewPlaneEquation(
709 double view_plane_depth,
726 bool GetFrustumLeftPlane(
730 bool GetFrustumLeftPlaneEquation(
747 bool GetFrustumRightPlane(
751 bool GetFrustumRightPlaneEquation(
768 bool GetFrustumBottomPlane(
772 bool GetFrustumBottomPlaneEquation(
788 bool GetFrustumTopPlane(
792 bool GetFrustumTopPlaneEquation(
853 bool GetViewPlaneRect(
854 double view_plane_depth,
917 int ScreenPortWidth()
const;
923 int ScreenPortHeight()
const;
925 bool GetScreenPortAspect(
double& )
const;
928 double* half_diagonal_angle,
929 double* half_vertical_angle,
930 double* half_horizontal_angle
933 double* half_smallest_angle
936 double half_smallest_angle
946 bool GetCamera35mmLensLength(
949 bool SetCamera35mmLensLength(
954 bool GetCamera35mmLenseLength(
959 bool SetCamera35mmLenseLength(
964 ON::coordinate_system srcCS,
965 ON::coordinate_system destCS,
990 bool GetWorldToScreenScale(
992 double* pixels_per_unit
995 bool GetCoordinateSprite(
1006 double half_view_angle,
1011 double half_view_angle,
1024 bool ZoomToScreenRect(
1044 bool GetDollyCameraVector(
1049 double proj_plane_dist,
1057 double dolly_distance
1074 bool SetViewScale(
double x,
double y );
1075 void GetViewScale(
double* x,
double* y )
const;
1091 ON_Xform ClipModInverseXform()
const;
1097 bool ClipModXformIsIdentity()
const;
1117 ON_3dPoint FrustumCenterPoint(
double target_distance )
const;
1144 bool SetTargetPoint(
ON_3dPoint target_point );
1164 double TargetDistance(
bool bUseFrustumCenterFallback )
const;
1180 static void GetPerspectiveClippingPlaneConstraints(
1182 unsigned int depth_buffer_bit_depth,
1183 double* min_near_dist,
1184 double* min_near_over_far
1215 double ClipCoordDepthBias(
1216 double relative_depth_bias,
1253 bool GetClipCoordDepthBiasXform(
1254 double relative_depth_bias,
1268 void SetPerspectiveClippingPlaneConstraints(
1269 unsigned int depth_buffer_bit_depth
1282 void SetPerspectiveMinNearOverFar(
double min_near_over_far);
1295 double PerspectiveMinNearOverFar()
const;
1307 void SetPerspectiveMinNearDist(
double min_near_dist);
1320 double PerspectiveMinNearDist()
const;
1338 bool SetViewportId(
const ON_UUID& viewport_id );
1340 ON_UUID ViewportId(
void)
const;
1350 void ChangeViewportId(
const ON_UUID& viewport_id);
1433 bool SetCameraFrame();
1447 bool SetClipModXform(
ON_Xform clip_mod_xform );
1453 double m__MIN_NEAR_DIST;
1454 double m__MIN_NEAR_OVER_FAR;
1465 ON_GetViewportRotationAngles(
1476 ON_ViewportFromRhinoView(
1477 ON::view_projection,
1507 ON_IntersectViewFrustumPlane(
unsigned char m_frustum_symmetry_flags
virtual ON_BOOL32 IsValid(ON_TextLog *text_log=NULL) const =0
static const double DefaultFarDist
virtual ON_BOOL32 Transform(const ON_Xform &xform)
static const double DefaultMinNearOverFar
static const ON_3dVector Default3dCameraDirection
virtual ON_BOOL32 Read(ON_BinaryArchive &binary_archive)
static const double DefaultMinNearDist
unsigned char m_reserved1
virtual ON_BOOL32 Write(ON_BinaryArchive &binary_archive) const
virtual void Dump(ON_TextLog &) const
virtual ON_BOOL32 GetBBox(double *boxmin, double *boxmax, int bGrowBox=false) const =0
ON_Geometry & operator=(const ON_Geometry &)
static const double DefaultNearDist
ON_3dPoint m_target_point
virtual int Dimension() const =0
ON::view_projection m_projection