xref: /aoo42x/main/svx/inc/svx/e3dsceneupdater.hxx (revision 3334a7e6)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _E3D_SCENEUPDATER_HXX
25 #define _E3D_SCENEUPDATER_HXX
26 
27 #include <svx/svxdllapi.h>
28 
29 //////////////////////////////////////////////////////////////////////////////
30 // predeclarations
31 
32 class SdrObject;
33 class E3dScene;
34 namespace drawinglayer { namespace geometry {
35     class ViewInformation3D;
36 }}
37 
38 //////////////////////////////////////////////////////////////////////////////
39 // This class is a helper to encapsulate 3D object changes which shall change the
40 // scene's 2D geometry. E.g. when moving one 3D object in a scene, the visualisation
41 // would not change since the scene's 2D attributes are defined by it's 2D object
42 // transformation and the changed content would be projected to the same 2D bounds
43 // as before. To reflect the fact that the 2D positions may 'change' for the user's
44 // imagination, it is necessary to calculate a new 2D object transformation of the scene
45 // (the SnapRect) using the old 3D transformation stack and the eventually changed
46 // 3D content and tu use it. This is only wanted if changes to the scene's
47 // content are intended to change the scene's 2D geometry attributes
48 
49 class SVX_DLLPUBLIC E3DModifySceneSnapRectUpdater
50 {
51 	// the scene which may be changed. This gets set to the outmost scene
52 	// of the to-be-changed 3D object when the scene has a 3d transformation
53 	// stack at construction time. In all other cases it's set to zero and
54 	// no action needs to be taken
55 	E3dScene*									mpScene;
56 
57 	// the 3d transformation stack at the time of construction, valid when
58 	// mpScene is not zero
59 	drawinglayer::geometry::ViewInformation3D*	mpViewInformation3D;
60 
61 public:
62 	// the constructor evaluates and sets the members at construction time
63 	E3DModifySceneSnapRectUpdater(const SdrObject* pObject);
64 
65 	// the destructor will take action if mpScene is not zero and modify the
66 	// 2D geomeztry of the target scene
67 	~E3DModifySceneSnapRectUpdater();
68 };
69 
70 #endif			// _E3D_SCENEUPDATER_HXX
71