bump product version to 4.2.0.1
[LibreOffice.git] / include / drawinglayer / geometry / viewinformation3d.hxx
blob8ad8c3ec8882df0d52a3118a73b338c76b22bbd4
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_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION3D_HXX
21 #define INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION3D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <sal/config.h>
26 #include <com/sun/star/uno/Sequence.h>
27 #include <com/sun/star/beans/PropertyValue.hpp>
28 #include <o3tl/cow_wrapper.hxx>
30 //////////////////////////////////////////////////////////////////////////////
31 // predefines
33 namespace drawinglayer { namespace geometry {
34 class ImpViewInformation3D;
37 namespace basegfx {
38 class B3DHomMatrix;
41 //////////////////////////////////////////////////////////////////////////////
43 namespace drawinglayer
45 namespace geometry
47 /** ViewInformation3D class
49 This class holds all view-relevant information for a 3d geometry. It works
50 together with UNO API definitions and supports holding a sequence of PropertyValues.
51 The most used data is for convenience offered directly using basegfx tooling classes.
52 It is an implementation to support the sequence of PropertyValues used in a
53 ::com::sun::star::graphic::XPrimitive3D for C++ implementations working with those
55 class DRAWINGLAYER_DLLPUBLIC ViewInformation3D
57 public:
58 typedef o3tl::cow_wrapper< ImpViewInformation3D, o3tl::ThreadSafeRefCountingPolicy > ImplType;
60 private:
61 /// pointer to private implementation class
62 ImplType mpViewInformation3D;
64 public:
65 /** Constructor: Create a ViewInformation3D
67 @param rObjectTransformation
68 The Transformation from Object to World coordinates (normally logic coordinates).
70 @param rOrientation
71 A part of the 3D ViewTransformation, the World to Camera coordinates transformation
72 which holds the camera coordinate system.
74 @param rProjection
75 A part of the 3D ViewTransformation, the Camera to Device transformation which
76 transforms coordinates to a [0.0 .. 1.0] device range in X,Y and Z. Z may be used
77 as source for for Z-Buffers. This transformation may be e.g. a parallell projection,
78 but also a perspective one and thus may use the last line of the matrix.
80 @param rDeviceToView
81 A part of the 3D ViewTransformation, the Device to View transformation which normally
82 translates and scales from [0.0 .. 1.0] range in X,Y and Z to discrete position and
83 size.
85 rOrientation, rProjection and rDeviceToView define the 3D transformation pipeline
86 and are normally used multiplied together to have a direct transformation from
87 World to View coordinates
89 @param fViewTime
90 The time the view is defined for. Default is 0.0. This parameter is used e.g. for
91 animated objects
93 @param rExtendedParameters
94 A sequence of property values which allows holding various other parameters besides
95 the obvious and needed ones above. For this constructor none of the other parameters
96 should be added as data. The constructor will parse the given parameters and if
97 data for the other parameters is given, the value in rExtendedParameters will
98 be preferred and overwrite the given parameter
100 ViewInformation3D(
101 const basegfx::B3DHomMatrix& rObjectTransformation,
102 const basegfx::B3DHomMatrix& rOrientation,
103 const basegfx::B3DHomMatrix& rProjection,
104 const basegfx::B3DHomMatrix& rDeviceToView,
105 double fViewTime,
106 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rExtendedParameters);
108 /** Constructor: Create a ViewInformation3D
110 @param rViewParameters
111 A sequence of property values which allows holding any combination of local and various
112 other parameters. This constructor is feeded completely with a sequence of PropertyValues
113 which will be parsed to be able to offer the most used ones in a convenient way.
115 explicit ViewInformation3D(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters);
117 /// default (empty) constructor
118 ViewInformation3D();
120 /// copy constructor
121 ViewInformation3D(const ViewInformation3D& rCandidate);
123 /// destructor
124 ~ViewInformation3D();
126 // checks if the incarnation is default constructed
127 bool isDefault() const;
129 /// assignment operator
130 ViewInformation3D& operator=(const ViewInformation3D& rCandidate);
132 /// compare operators
133 bool operator==(const ViewInformation3D& rCandidate) const;
134 bool operator!=(const ViewInformation3D& rCandidate) const { return !operator==(rCandidate); }
136 /// data access
137 const basegfx::B3DHomMatrix& getObjectTransformation() const;
138 const basegfx::B3DHomMatrix& getOrientation() const;
139 const basegfx::B3DHomMatrix& getProjection() const;
140 const basegfx::B3DHomMatrix& getDeviceToView() const;
141 double getViewTime() const;
143 /// for convenience, the linear combination of the above four transformations is offered
144 const basegfx::B3DHomMatrix& getObjectToView() const;
146 /** Get the uno::Sequence< beans::PropertyValue > which contains all ViewInformation
148 Use this call if You need to extract all contained ViewInformation. The ones
149 directly supported for convenience will be added to the ones only available
150 as PropertyValues. This set completely describes this ViewInformation3D and
151 can be used for complete information transport over UNO API.
153 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& getViewInformationSequence() const;
155 /** Get the uno::Sequence< beans::PropertyValue > which contains only ViewInformation
156 not offered directly
158 Use this call if You only need ViewInformation which is not offered conveniently,
159 but only exists as PropertyValue. This is e.g. used to create partially updated
160 incarnations of ViewInformation3D without losing the only with PropertyValues
161 defined data. It does not contain a complete description.
163 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& getExtendedInformationSequence() const;
165 } // end of namespace geometry
166 } // end of namespace drawinglayer
168 //////////////////////////////////////////////////////////////////////////////
170 #endif //INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION3D_HXX
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */