913a4c4a |
1 | // Created on: 2011-10-11 |
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 __IVTK_IVIEW_H__ |
17 | #define __IVTK_IVIEW_H__ |
18 | |
19 | #include <IVtk_Interface.hxx> |
20 | #include <gp_XY.hxx> |
21 | #include <gp_XYZ.hxx> |
f751596e |
22 | #include <gp_Pnt.hxx> |
23 | #include <Graphic3d_Mat4d.hxx> |
913a4c4a |
24 | |
25 | DEFINE_STANDARD_HANDLE( IVtk_IView, IVtk_Interface ) |
26 | |
27 | //! @class IVtk_IView |
28 | //! @brief Interface for obtaining view transformation parameters. |
29 | //! |
30 | //! These parameters are used by selection algorithm to compute |
31 | //! projections of selectable (active) 3D shapes. |
32 | class IVtk_IView : public IVtk_Interface |
33 | { |
34 | |
35 | public: |
36 | typedef Handle(IVtk_IView) Handle; |
37 | |
38 | //! Destructor |
39 | virtual ~IVtk_IView() { } |
40 | |
41 | //! @return true if this is a perspective view, and false otherwise. |
42 | virtual bool IsPerspective() const = 0; |
43 | |
44 | //! @return The focal distance of the view |
45 | virtual double GetDistance() const = 0; |
46 | |
47 | //! @return The world coordinates of the view position |
48 | virtual void GetPosition (double& theX, double& theY, double& theZ) const = 0; |
49 | |
50 | //! @return The "view up" direction of the view |
51 | virtual void GetViewUp (double& theDx, double& theDy, double& theDz) const = 0; |
52 | |
53 | //! @return The projection direction vector of this view |
54 | virtual void GetDirectionOfProjection (double& theDx, |
55 | double& theDy, |
56 | double& theDz) const = 0; |
57 | |
58 | //! @return Three doubles contaning scale components of the view transformation |
59 | virtual void GetScale (double& theX, double& theY, double& theZ) const = 0; |
60 | |
61 | //! @return The current view's zoom factor (for parallel projection) |
62 | virtual double GetParallelScale() const = 0; |
63 | |
64 | //! @return The current view angle (for perspective projection) |
65 | virtual double GetViewAngle() const = 0; |
66 | |
67 | //! @return Two doubles containing the display coordinates of the view window center |
68 | virtual void GetViewCenter (double& theX, double& theY) const = 0; |
69 | |
f751596e |
70 | //! Gets window size in screen coordinates in pixels |
71 | virtual void GetWindowSize (int& theX, int& theY) const = 0; |
72 | |
73 | //! Gets camera projection and orientation matrices |
74 | virtual void GetCamera (Graphic3d_Mat4d& theProj, |
75 | Graphic3d_Mat4d& theOrient, |
76 | Standard_Boolean& theIsOrtho) const = 0; |
77 | |
913a4c4a |
78 | //! Converts 3D display coordinates into 3D world coordinates. |
79 | //! @param [in] theDisplayPnt 2d point of display coordinates |
80 | //! @param [out] theWorldPnt 3d point of world coordinates |
81 | //! @return true if conversion was successful, false otherwise |
82 | virtual bool DisplayToWorld (const gp_XY& theDisplayPnt, gp_XYZ& theWorldPnt) const = 0; |
83 | |
f751596e |
84 | //! Gets viewport coordinates |
85 | virtual void GetViewport (Standard_Real& theX, |
86 | Standard_Real& theY, |
87 | Standard_Real& theWidth, |
88 | Standard_Real& theHeight) const = 0; |
89 | |
913a4c4a |
90 | DEFINE_STANDARD_RTTI( IVtk_IView ) |
91 | }; |
92 | |
93 | #endif // __IVTK_IVIEW_H__ |