#ifndef IView_HPP_INCLUDED
#define IView_HPP_INCLUDED
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (c) 2018-2021 3Dconnexion.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see .
*/
/**
* @file IView.hpp
* @brief View callback interface.
*/
#include
namespace TDx {
namespace SpaceMouse {
namespace Navigation3D {
///
/// View callback interface.
///
class IView {
public:
///
/// Gets the camera matrix of the view.
///
/// The camera/view .
/// 0 = no error, otherwise <0.
virtual long GetCameraMatrix(navlib::matrix_t &matrix) const = 0;
///
/// Gets the camera's target point.
///
/// The position of the camera target in world coordinates.
/// 0 = no error, otherwise <0.
/// Free cameras do not have a target.
virtual long GetCameraTarget(navlib::point_t &target) const = 0;
///
/// Gets the position of the pointer on the near clipping plane.
///
/// The in world coordinates of the
/// pointer. 0 = no error, otherwise <0.
virtual long GetPointerPosition(navlib::point_t &position) const = 0;
///
/// Gets the view's construction plane.
///
/// The plane equation of the construction plane.
/// 0 = no error, otherwise <0.
virtual long GetViewConstructionPlane(navlib::plane_t &plane) const = 0;
///
/// Gets the extents of the view.
///
/// A representing the extents of the
/// view.
/// 0 = no error, otherwise <0.
virtual long GetViewExtents(navlib::box_t &extents) const = 0;
///
/// Gets the camera's/view's field of view.
///
/// The field of view in radians.
/// 0 = no error, otherwise <0.
virtual long GetViewFOV(double &fov) const = 0;
///
/// Gets the camera/view frustum.
///
/// The camera/view .
/// 0 = no error, otherwise <0.
virtual long GetViewFrustum(navlib::frustum_t &frustum) const = 0;
///
/// Get's the view's projection type
///
/// true for a perspective view, false for an orthographic view.
/// 0 = no error, otherwise <0.
virtual long GetIsViewPerspective(navlib::bool_t &perspective) const = 0;
///
/// Gets a value indicating whether the view can be rotated.
///
/// true if the view can be rotated, false otherwise.
/// 0 = no error, otherwise <0.
virtual long GetIsViewRotatable(navlib::bool_t &isRotatable) const = 0;
///
/// Sets the camera affine matrix.
///
/// The camera/view .
/// 0 = no error, otherwise <0.
virtual long SetCameraMatrix(const navlib::matrix_t& matrix) = 0;
///
/// Sets the camera's target position.
///
/// The position of the camera target in world coordinates.
/// 0 = no error, otherwise <0.
/// Free cameras do not have a target.
virtual long SetCameraTarget(const navlib::point_t &target) = 0;
///
/// Sets the position of the pointer on the near clipping plane.
///
/// The in world coordinates of the
/// pointer.
/// 0 = no error, otherwise <0.
virtual long SetPointerPosition(const navlib::point_t& position) = 0;
///
/// Sets the extents of the view.
///
/// A representing the extents of the
/// view.
/// 0 = no error, otherwise <0.
virtual long SetViewExtents(const navlib::box_t& extents) = 0;
///
/// Sets the camera's/view's field of view.
///
/// The field of view in radians.
/// 0 = no error, otherwise <0.
virtual long SetViewFOV(double fov) = 0;
///
/// Sets the camera/view frustum.
///
/// The camera/view .
/// 0 = no error, otherwise <0.
virtual long SetViewFrustum(const navlib::frustum_t& frustum) = 0;
};
} // namespace Navigation3D
} // namespace SpaceMouse
} // namespace TDx
#endif // IView_HPP_INCLUDED