fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Window / Base / OSGViewport.inl
blobfb5322110383a05a15438d4b24d818227706e9bb
1 /*---------------------------------------------------------------------------*\
2  *                                OpenSG                                     *
3  *                                                                           *
4  *                                                                           *
5  *                     Copyright 2000-2002 by OpenSG Forum                   *
6  *                                                                           *
7  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
8  *                                                                           *
9 \*---------------------------------------------------------------------------*/
10 /*---------------------------------------------------------------------------*\
11  *                                License                                    *
12  *                                                                           *
13  * This library is free software; you can redistribute it and/or modify it   *
14  * under the terms of the GNU Library General Public License as published    *
15  * by the Free Software Foundation, version 2.                               *
16  *                                                                           *
17  * This library is distributed in the hope that it will be useful, but       *
18  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
20  * Library General Public License for more details.                          *
21  *                                                                           *
22  * You should have received a copy of the GNU Library General Public         *
23  * License along with this library; if not, write to the Free Software       *
24  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
25  *                                                                           *
26 \*---------------------------------------------------------------------------*/
27 /*---------------------------------------------------------------------------*\
28  *                                Changes                                    *
29  *                                                                           *
30  *                                                                           *
31  *                                                                           *
32  *                                                                           *
33  *                                                                           *
34  *                                                                           *
35 \*---------------------------------------------------------------------------*/
37 OSG_BEGIN_NAMESPACE
39 /*------------------------------- size ----------------------------------*/
41 /*! Calculate the width of the viewport in Pixel.
42  */ 
44 inline 
45 Int32 Viewport::calcPixelWidth(void) const
47     return calcPixelRight() - calcPixelLeft() + 1;
50 /*! Calculate the height of the viewport in Pixel.
51  */ 
53 inline 
54 Int32 Viewport::calcPixelHeight(void) const
56     return calcPixelTop() - calcPixelBottom() + 1;
59 #ifdef OSG_1_COMPAT
60 inline 
61 Int32 Viewport::getPixelLeft(void) const
63     return calcPixelLeft();
66 inline 
67 Int32 Viewport::getPixelRight(void) const
69     return calcPixelRight();
72 inline 
73 Int32 Viewport::getPixelBottom(void) const
75     return calcPixelBottom();
78 inline 
79 Int32 Viewport::getPixelTop(void) const
81     return calcPixelTop();
84 inline 
85 Int32 Viewport::getPixelWidth(void) const
87     return calcPixelWidth();
90 inline 
91 Int32 Viewport::getPixelHeight(void) const
93     return calcPixelHeight();
96 inline 
97 bool Viewport::isFullWindow(void) const
99     return calcIsFullWindow();
103 inline 
104 void Viewport::getNormalizedCoordinates(      Real32 &normX,
105                                               Real32 &normY,
106                                         const Int32   vpX  ,
107                                         const Int32   vpY  ) const
109     return calcNormalizedCoordinates(normX, normY, vpX, vpY);
111 #endif
113 /*---------------------------- properties ---------------------------------*/
116 OSG_END_NAMESPACE