Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION3D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION3D_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : // the solaris compiler defines 'sun' as '1'. To avoid that (and to allow
35 : : // pre-declarations of com/sun/star namespace), include sal/config.h here
36 : : // where sun is redefined as 'sun' (so i guess the problem is known).
37 : : #include <sal/config.h>
38 : : #include <com/sun/star/uno/Sequence.h>
39 : : #include <com/sun/star/beans/PropertyValue.hpp>
40 : :
41 : : //////////////////////////////////////////////////////////////////////////////
42 : : // predefines
43 : :
44 : : namespace drawinglayer { namespace geometry {
45 : : class ImpViewInformation3D;
46 : : }}
47 : :
48 : : namespace basegfx {
49 : : class B3DHomMatrix;
50 : : }
51 : :
52 : : //////////////////////////////////////////////////////////////////////////////
53 : :
54 : : namespace drawinglayer
55 : : {
56 : : namespace geometry
57 : : {
58 : : /** ViewInformation3D class
59 : :
60 : : This class holds all view-relevant information for a 3d geometry. It works
61 : : together with UNO API definitions and supports holding a sequence of PropertyValues.
62 : : The most used data is for convenience offered directly using basegfx tooling classes.
63 : : It is an implementation to support the sequence of PropertyValues used in a
64 : : ::com::sun::star::graphic::XPrimitive3D for C++ implementations working with those
65 : : */
66 : : class DRAWINGLAYER_DLLPUBLIC ViewInformation3D
67 : : {
68 : : private:
69 : : /// pointer to private implementation class
70 : : ImpViewInformation3D* mpViewInformation3D;
71 : :
72 : : public:
73 : : /** Constructor: Create a ViewInformation3D
74 : :
75 : : @param rObjectTransformation
76 : : The Transformation from Object to World coordinates (normally logic coordinates).
77 : :
78 : : @param rOrientation
79 : : A part of the 3D ViewTransformation, the World to Camera coordinates transformation
80 : : which holds the camera coordinate system.
81 : :
82 : : @param rProjection
83 : : A part of the 3D ViewTransformation, the Camera to Device transformation which
84 : : transforms coordinates to a [0.0 .. 1.0] device range in X,Y and Z. Z may be used
85 : : as source for for Z-Buffers. This transformation may be e.g. a parallell projection,
86 : : but also a perspective one and thus may use the last line of the matrix.
87 : :
88 : : @param rDeviceToView
89 : : A part of the 3D ViewTransformation, the Device to View transformation which normally
90 : : translates and scales from [0.0 .. 1.0] range in X,Y and Z to discrete position and
91 : : size.
92 : :
93 : : rOrientation, rProjection and rDeviceToView define the 3D transformation pipeline
94 : : and are normally used multiplied together to have a direct transformation from
95 : : World to View coordinates
96 : :
97 : : @param fViewTime
98 : : The time the view is defined for. Default is 0.0. This parameter is used e.g. for
99 : : animated objects
100 : :
101 : : @param rExtendedParameters
102 : : A sequence of property values which allows holding various other parameters besides
103 : : the obvious and needed ones above. For this constructor none of the other parameters
104 : : should be added as data. The constructor will parse the given parameters and if
105 : : data for the other parameters is given, the value in rExtendedParameters will
106 : : be preferred and overwrite the given parameter
107 : : */
108 : : ViewInformation3D(
109 : : const basegfx::B3DHomMatrix& rObjectTransformation,
110 : : const basegfx::B3DHomMatrix& rOrientation,
111 : : const basegfx::B3DHomMatrix& rProjection,
112 : : const basegfx::B3DHomMatrix& rDeviceToView,
113 : : double fViewTime,
114 : : const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rExtendedParameters);
115 : :
116 : : /** Constructor: Create a ViewInformation3D
117 : :
118 : : @param rViewParameters
119 : : A sequence of property values which allows holding any combination of local and various
120 : : other parameters. This constructor is feeded completely with a sequence of PropertyValues
121 : : which will be parsed to be able to offer the most used ones in a convenient way.
122 : : */
123 : : explicit ViewInformation3D(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters);
124 : :
125 : : /// default (empty) constructor
126 : : ViewInformation3D();
127 : :
128 : : /// copy constructor
129 : : ViewInformation3D(const ViewInformation3D& rCandidate);
130 : :
131 : : /// destructor
132 : : ~ViewInformation3D();
133 : :
134 : : // checks if the incarnation is default constructed
135 : : bool isDefault() const;
136 : :
137 : : /// assignment operator
138 : : ViewInformation3D& operator=(const ViewInformation3D& rCandidate);
139 : :
140 : : /// compare operators
141 : : bool operator==(const ViewInformation3D& rCandidate) const;
142 : 0 : bool operator!=(const ViewInformation3D& rCandidate) const { return !operator==(rCandidate); }
143 : :
144 : : /// data access
145 : : const basegfx::B3DHomMatrix& getObjectTransformation() const;
146 : : const basegfx::B3DHomMatrix& getOrientation() const;
147 : : const basegfx::B3DHomMatrix& getProjection() const;
148 : : const basegfx::B3DHomMatrix& getDeviceToView() const;
149 : : double getViewTime() const;
150 : :
151 : : /// for convenience, the linear combination of the above four transformations is offered
152 : : const basegfx::B3DHomMatrix& getObjectToView() const;
153 : :
154 : : /** Get the uno::Sequence< beans::PropertyValue > which contains all ViewInformation
155 : :
156 : : Use this call if You need to extract all contained ViewInformation. The ones
157 : : directly supported for convenience will be added to the ones only available
158 : : as PropertyValues. This set completely describes this ViewInformation3D and
159 : : can be used for complete information transport over UNO API.
160 : : */
161 : : const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& getViewInformationSequence() const;
162 : :
163 : : /** Get the uno::Sequence< beans::PropertyValue > which contains only ViewInformation
164 : : not offered directly
165 : :
166 : : Use this call if You only need ViewInformation which is not offered conveniently,
167 : : but only exists as PropertyValue. This is e.g. used to create partially updated
168 : : incarnations of ViewInformation3D without losing the only with PropertyValues
169 : : defined data. It does not contain a complete description.
170 : : */
171 : : const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& getExtendedInformationSequence() const;
172 : : };
173 : : } // end of namespace geometry
174 : : } // end of namespace drawinglayer
175 : :
176 : : //////////////////////////////////////////////////////////////////////////////
177 : :
178 : : #endif //INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION3D_HXX
179 : :
180 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|