Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / svx / camera3d.hxx
blobe263acc32120502ec3ee39b35ebb8be2998bfb0c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVX_CAMERA3D_HXX
21 #define INCLUDED_SVX_CAMERA3D_HXX
23 #include <basegfx/point/b3dpoint.hxx>
24 #include <sal/types.h>
25 #include <svx/viewpt3d.hxx>
26 #include <svx/svxdllapi.h>
28 /*************************************************************************
30 |* Camera derivative
32 \************************************************************************/
34 class SAL_WARN_UNUSED SVX_DLLPUBLIC Camera3D : public Viewport3D
36 protected:
37 basegfx::B3DPoint aResetPos;
38 basegfx::B3DPoint aResetLookAt;
39 double fResetFocalLength;
40 double fResetBankAngle;
42 basegfx::B3DPoint aPosition;
43 basegfx::B3DPoint aLookAt;
44 double fFocalLength;
45 double fBankAngle;
47 bool bAutoAdjustProjection;
49 public:
50 Camera3D(const basegfx::B3DPoint& rPos, const basegfx::B3DPoint& rLookAt,
51 double fFocalLen = 35.0);
52 Camera3D();
54 void SetDefaults(const basegfx::B3DPoint& rPos, const basegfx::B3DPoint& rLookAt,
55 double fFocalLen);
57 void SetViewWindow(double fX, double fY, double fW, double fH);
59 void SetPosition(const basegfx::B3DPoint& rNewPos);
60 const basegfx::B3DPoint& GetPosition() const { return aPosition; }
61 void SetLookAt(const basegfx::B3DPoint& rNewLookAt);
62 void SetPosAndLookAt(const basegfx::B3DPoint& rNewPos, const basegfx::B3DPoint& rNewLookAt);
64 // Focal length in mm
65 void SetFocalLength(double fLen);
66 double GetFocalLength() const { return fFocalLength; }
68 // Bank angle links/rechts
69 void SetBankAngle(double fAngle);
71 void SetAutoAdjustProjection(bool bAdjust)
72 { bAutoAdjustProjection = bAdjust; }
75 #endif // INCLUDED_SVX_CAMERA3D_HXX
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */