/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef __NW_SAVEDANIMKEYFRAME_H__ #define __NW_SAVEDANIMKEYFRAME_H__ #include "NwSavedAnimKeyFrameBase.h" #include "NwViewType.h" class OdGeQuaternion; class OdGePoint3d; /** This class represents animation camera key frame. */ class NWDBEXPORT OdNwSavedAnimKeyFrame : public OdNwSavedAnimKeyFrameBase { //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdNwSavedAnimKeyFrame); //DOM-IGNORE-END public: /** \details Default constructor. */ OdNwSavedAnimKeyFrame(); /** \details Virtual destructor. Frees allocated resources. */ virtual ~OdNwSavedAnimKeyFrame(); /** \details Gets current position in the playback. \returns The value of the playback positions in double. The method is deprecated since version 25.3 and will be removed soon. Use the inherited method getTime() instead. */ double getTime() const; /** \details Determines whether values are automatically interpolated between the current and the last keyframes. \returns The true value if values are automatically interpolated successfully between the current and the last keyframes, otherwise false. The method is deprecated since version 25.3 and will be removed soon. Use the inherited method isInterpolation() instead. */ bool isInterpolation() const; /** \details Gets focal length of the camera. \returns A value of focal length of the camera lens. */ double getFocalDistance() const; /** \details Gets the projection type of the camera. \returns Projection type of the camera that can be one of the following: Name Value Description NwViewType::PERSPECTIVE 0 Perspective viewpoint. NwViewType::ORTHOGRAPHIC 1 Orthographic viewpoint.
*/ NwViewType::Enum getCameraProjection() const; /** \details Gets the position of the camera. \returns Position of the camera as an OdGePoint3d value. */ const OdGePoint3d& getCameraPosition() const; /** \details Gets the rotation of the camera from the base orientation. \returns Rotation of the camera from the base orientation as an OdGeQuaternion value. */ const OdGeQuaternion& getCameraRotation() const; /** \details Receives the aspect ratio of the camera (width/height). \returns Aspect ratio as a double value. */ double getCameraViewAspect() const; /** \details Receives the defined camera's field of view in a combination with the aspect ratio. \returns Defined camera's field of view in a combination with the aspect ratio as a double value. \remarks For perspective, returns the vertical field of the view (the angle in radians between the top and bottom planes of the camera view frustum). For orthographic, returns the distance between the top and bottom planes of the camera view frustum. */ double getCameraHeightField() const; /** \details Gets the distance from the eye point to the near plane along the view direction. \returns Distance from the eye point to the near plane as a double value. \remarks Must be greater than zero. */ double getCameraNearDistance() const; /** \details Gets the distance from the eye point to the far plane along the view direction. \returns Distance from the eye point to the far plane as a double value. \remarks Must be greater than the near distance. */ double getCameraFarDistance() const; /** \details Gets the required vertical scaling of an image when adapting the camera view to the display window. \returns Required vertical scaling of an image as a double value. */ double getCameraVerticalScale() const; /** \details Gets the required horizontal scaling of an image when adapting the camera view to the display window. \returns Required horizontal scaling of an image as a double value. */ double getCameraHorizontalScale() const; /** \details Sets focal length of the camera. \param focalDist [in] double value of focal length of the camera lens. */ void setFocalDistance(double focalDist); /** \details Sets the projection type of the camera. \param projection [in] NwViewType::Enum value of camera projection type. */ void setCameraProjection(NwViewType::Enum projection); /** \details Sets the position of the camera. \param position [in] OdGePoint3d value of camera position. */ void setCameraPosition(const OdGePoint3d& position); /** \details Sets the rotation of the camera from the base orientation. \param rotation [in] OdGeQuaternion value of rotation of the camera from the base orientation. */ void setCameraRotation(const OdGeQuaternion& rotation); /** \details Sets the aspect ratio of the camera. \param aspect [in] double value of aspect ratio. \remarks Aspect Ration is the ratio of width divided by height */ void setCameraViewAspect(double aspect); /** \details Sets the height field of the camera. \param height [in] double value of height of the camera. \remarks For perspective, returns the vertical field of the view (the angle in radians between the top and bottom planes of the camera view frustum). For orthographic, returns the distance between the top and bottom planes of the camera view frustum. */ void setCameraHeightField(double height); /** \details Sets the camera near distance. \param nearDist [in] double value of camera near distance. \returns The true value if the value of v is correct and can be assigned, otherwise false. \remarks It is the distance from the eye point to the near plane along the view direction. Value must be greater than zero. */ bool setCameraNear(double nearDist); /** \details Sets the camera far distance. \param farDist [in] double value of camera far distance. \returns The true value if the value of v is correct and can be assigned, otherwise false. \remarks It is distance from the eye point to the far plane along the view. Value must be greater than the near distance. */ bool setCameraFar(double farDist); }; /** \details This template class is a specialization of the OdSmartPtr class for OdNwSavedAnimKeyFrame object pointers. */ typedef OdSmartPtr OdNwSavedAnimKeyFramePtr; #endif /* __NW_SAVEDANIMKEYFRAME_H__ */