fixed: stay with old cmake qt link setup (policy CMP0020)
[opensg.git] / Source / System / Window / Utilities / OSGCameraUtils.h
blobcd27b990c134ea3f3b6c0e3bf78be03624b3dd14
1 /*---------------------------------------------------------------------------*\
2 * OpenSG Toolbox *
3 * *
4 * *
5 * Authors: David Kabala *
6 * *
7 \*---------------------------------------------------------------------------*/
8 /*---------------------------------------------------------------------------*\
9 * License *
10 * *
11 * This library is free software; you can redistribute it and/or modify it *
12 * under the terms of the GNU Library General Public License as published *
13 * by the Free Software Foundation, version 2. *
14 * *
15 * This library is distributed in the hope that it will be useful, but *
16 * WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
18 * Library General Public License for more details. *
19 * *
20 * You should have received a copy of the GNU Library General Public *
21 * License along with this library; if not, write to the Free Software *
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
23 * *
24 \*---------------------------------------------------------------------------*/
26 #ifndef _OSGCAMERAUTILS_H_
27 #define _OSGCAMERAUTILS_H_
29 #include "OSGConfig.h"
30 #include "OSGUtilDef.h"
32 #include "OSGCamera.h"
33 #include "OSGPerspectiveCamera.h"
34 #include "OSGNode.h"
36 OSG_BEGIN_NAMESPACE
38 /**
39 * \brief Set position and direction of camera to show all of a node.
41 * Sets the position and direction of a perspective camera such that the
42 * volume bounding the node is contained in the view of the camera. The near
43 * clipping plane is set to 0.1 times of the maximum axis of the volume of the
44 * node. The far clipping plane is set to 10 times of the maximum axis of the
45 * volume of the node. The Up direction is used when calculating the camera's
46 * orientation.
47 * @param[in,out] TheCamera The camera
48 * @param[in] Scene The node to view
49 * @param[in] Up The direction to use as the up direction when calculating the
50 * camera orientation
53 OSG_UTIL_DLLMAPPING
54 void showAll(PerspectiveCamera *pCamera,
55 Node *pScene,
56 Vec3f vUp = Vec3f(0.0f, 1.0f, 0.0f));
58 /**
59 * \brief Set position and direction of camera to show all of a node.
61 * Sets the position and direction of a perspective camera such that the
62 * volume bounding the node is contained in the view of the camera. The near
63 * clipping plane is set to 0.1 times of the maximum axis of the volume of the
64 * node. The far clipping plane is set to 10 times of the maximum axis of the
65 * volume of the node. The Up direction is used when calculating the camera's
66 * orientation. Currently this only works for perspective cameras.
67 * @param[in,out] TheCamera The camera
68 * @param[in] Scene The node to view
69 * @param[in] Up The direction to use as the up direction when calculating the
70 * camera orientation
73 OSG_UTIL_DLLMAPPING
74 void showAll(Camera *pCamera,
75 Node *pScene,
76 Vec3f vUp = Vec3f(0.0f, 1.0f, 0.0f));
78 OSG_END_NAMESPACE
80 #endif //_OSGCAMERAUTILS_H_