0026511: Build fails with VTK 6.3rc1
[occt.git] / src / IVtkVTK / IVtkVTK_View.hxx
CommitLineData
913a4c4a 1// Created on: 2011-10-14
2// Created by: Roman KOZLOV
3// Copyright (c) 2011-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef __IVTKVTK_VIEW_H__
17#define __IVTKVTK_VIEW_H__
18
19#include <IVtk_IView.hxx>
20
21class vtkRenderer;
22
c04c30b3 23class IVtkVTK_View;
913a4c4a 24DEFINE_STANDARD_HANDLE( IVtkVTK_View, IVtk_IView )
25
26//! @class IVtkVTK_View
27//! @brief ICamera implementation for VTK.
28//!
29//! This class is used for obtaining view transformation parameters.
30//! These parameters are used by selection algorithm to compute
31//! projections of selectable (active) 3D shapes.
32class IVtkVTK_View : public IVtk_IView
33{
34
35public:
36 typedef Handle(IVtkVTK_View) Handle;
37
38 Standard_EXPORT IVtkVTK_View (vtkRenderer* theRenderer);
39
40 //! Destructor
41 Standard_EXPORT virtual ~IVtkVTK_View();
42
43 //! @return true if this is a perspective view, and false otherwise.
c7854818 44 Standard_EXPORT virtual bool IsPerspective() const Standard_OVERRIDE;
913a4c4a 45
46 //! @return The focal distance of the view
c7854818 47 Standard_EXPORT virtual double GetDistance() const Standard_OVERRIDE;
913a4c4a 48
49 //! @return The world coordinates of the view position
c7854818 50 Standard_EXPORT virtual void GetPosition (double& theX, double& theY, double& theZ) const Standard_OVERRIDE;
913a4c4a 51
52 //! @return The "view up" direction of the view
c7854818 53 Standard_EXPORT virtual void GetViewUp (double& theDx, double& theDy, double& theDz) const Standard_OVERRIDE;
913a4c4a 54
55 //! @return The projection direction vector of this view
56 Standard_EXPORT virtual void GetDirectionOfProjection (double& theDx,
57 double& theDy,
c7854818 58 double& theDz) const Standard_OVERRIDE;
913a4c4a 59
60 //! @return Three doubles containing scale components of the view transformation
c7854818 61 Standard_EXPORT virtual void GetScale (double& theX, double& theY, double& theZ) const Standard_OVERRIDE;
913a4c4a 62
63 //! @return The current view's zoom factor (for parallel projection)
c7854818 64 Standard_EXPORT virtual double GetParallelScale() const Standard_OVERRIDE;
913a4c4a 65
66 //! @return The current view angle (for perspective projection)
c7854818 67 Standard_EXPORT virtual double GetViewAngle() const Standard_OVERRIDE;
913a4c4a 68
69 //! @return Two doubles containing the display coordinates of the view window center
c7854818 70 Standard_EXPORT virtual void GetViewCenter (double& theX, double& theY) const Standard_OVERRIDE;
913a4c4a 71
f751596e 72 //! Gets window size in screen coordinates in pixels
73 Standard_EXPORT virtual void GetWindowSize (int& theX, int& theY) const Standard_OVERRIDE;
74
75 //! Gets camera projection and orientation matrices
76 Standard_EXPORT virtual void GetCamera (Graphic3d_Mat4d& theProj,
77 Graphic3d_Mat4d& theOrient,
78 Standard_Boolean& theIsOrtho) const Standard_OVERRIDE;
79
80 //! Gets viewport coordinates
81 Standard_EXPORT virtual void GetViewport (Standard_Real& theX,
82 Standard_Real& theY,
83 Standard_Real& theWidth,
84 Standard_Real& theHeight) const Standard_OVERRIDE;
85
913a4c4a 86 //! Converts 3D display coordinates into 3D world coordinates.
87 //! @param [in] theDisplayPnt 2d point of display coordinates
88 //! @param [out] theWorldPnt 3d point of world coordinates
89 //! @return true if conversion was successful, false otherwise
c7854818 90 Standard_EXPORT virtual bool DisplayToWorld (const gp_XY& theDisplayPnt, gp_XYZ& theWorldPnt) const Standard_OVERRIDE;
913a4c4a 91
92efcf78 92 DEFINE_STANDARD_RTTIEXT(IVtkVTK_View,IVtk_IView)
913a4c4a 93
94private:
95 vtkRenderer* myRenderer;
96};
97
98#endif // __IVTKVTK_VIEW_H__