xref: /aoo42x/main/svx/source/engine3d/e3dundo.cxx (revision f6e50924)
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 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_svx.hxx"
26 #include <svx/e3dundo.hxx>
27 #include <svx/svdmodel.hxx>
28 #include <editeng/outlobj.hxx>
29 #include <svx/view3d.hxx>
30 #include <svx/scene3d.hxx>
31 #include <svx/e3dsceneupdater.hxx>
32 
33 /************************************************************************/
34 
35 TYPEINIT1(E3dUndoAction, SfxUndoAction);
36 
37 /************************************************************************\
38 |*
39 |* Destruktor der Basisklasse
40 |*
41 \************************************************************************/
~E3dUndoAction()42 E3dUndoAction::~E3dUndoAction ()
43 {
44 }
45 
46 /************************************************************************\
47 |*
48 |* Repeat gibt es nicht
49 |*
50 \************************************************************************/
CanRepeat(SfxRepeatTarget &) const51 sal_Bool E3dUndoAction::CanRepeat(SfxRepeatTarget&) const
52 {
53 	return sal_False;
54 }
55 
56 /************************************************************************/
57 
58 TYPEINIT1(E3dRotateUndoAction, E3dUndoAction);
59 
60 /************************************************************************
61 
62 						E3dRotateUndoAction
63 
64 ************************************************************************/
65 
66 /************************************************************************\
67 |*
68 |* Undodestruktor fuer 3D-Rotation
69 |*
70 \************************************************************************/
~E3dRotateUndoAction()71 E3dRotateUndoAction::~E3dRotateUndoAction ()
72 {
73 }
74 
75 /************************************************************************\
76 |*
77 |* Undo fuer 3D-Rotation ueber die Rotationsmatrizen
78 |*
79 \************************************************************************/
Undo()80 void E3dRotateUndoAction::Undo ()
81 {
82 	E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj);
83 	pMy3DObj->SetTransform(aMyOldRotation);
84 }
85 
86 /************************************************************************\
87 |*
88 |* Undo fuer 3D-Rotation ueber die Rotationsmatrizen
89 |*
90 \************************************************************************/
Redo()91 void E3dRotateUndoAction::Redo ()
92 {
93 	E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj);
94 	pMy3DObj->SetTransform(aMyNewRotation);
95 }
96 
97 /*************************************************************************
98 |*
99 |* E3dAttributesUndoAction
100 |*
101 \************************************************************************/
102 
103 TYPEINIT1(E3dAttributesUndoAction, SdrUndoAction);
104 
105 /*************************************************************************
106 |*
107 |* Konstruktor
108 |*
109 \************************************************************************/
E3dAttributesUndoAction(SdrModel & rModel,E3dView * p3dView,E3dObject * pInObject,const SfxItemSet & rNewSet,const SfxItemSet & rOldSet,sal_Bool bUseSubObj)110 E3dAttributesUndoAction::E3dAttributesUndoAction( SdrModel &rModel,
111 	E3dView*	p3dView,
112 	E3dObject*	pInObject,
113 	const SfxItemSet& rNewSet,
114 	const SfxItemSet& rOldSet,
115 	sal_Bool bUseSubObj)
116 :	SdrUndoAction( rModel ),
117 	pObject	 	 ( pInObject ),
118 	pView		 ( p3dView ),
119 	bUseSubObjects(bUseSubObj),
120 	aNewSet		 ( rNewSet ),
121 	aOldSet		 ( rOldSet )
122 {
123 }
124 
125 /*************************************************************************
126 |*
127 |* Destruktor
128 |*
129 \************************************************************************/
~E3dAttributesUndoAction()130 E3dAttributesUndoAction::~E3dAttributesUndoAction()
131 {
132 }
133 
134 /*************************************************************************
135 |*
136 |* Undo()
137 |* Implementiert ueber Set3DAttributes(), um die Attribute nur an einer
138 |* Stelle pflegen zu muessen!
139 |*
140 \************************************************************************/
Undo()141 void E3dAttributesUndoAction::Undo()
142 {
143 	E3DModifySceneSnapRectUpdater aUpdater(pObject);
144 	pObject->SetMergedItemSetAndBroadcast(aOldSet);
145 }
146 
147 /*************************************************************************
148 |*
149 |* Redo()
150 |*
151 \************************************************************************/
Redo()152 void E3dAttributesUndoAction::Redo()
153 {
154 	E3DModifySceneSnapRectUpdater aUpdater(pObject);
155 	pObject->SetMergedItemSetAndBroadcast(aNewSet);
156 }
157 
158 /*************************************************************************
159 |*
160 |* Mehrfaches Undo nicht moeglich
161 |*
162 \************************************************************************/
CanRepeat(SfxRepeatTarget &) const163 sal_Bool E3dAttributesUndoAction::CanRepeat(SfxRepeatTarget& /*rView*/) const
164 {
165 	return sal_False;
166 }
167 
168 /*************************************************************************
169 |*
170 |* Mehrfaches Undo nicht moeglich
171 |*
172 \************************************************************************/
Repeat()173 void E3dAttributesUndoAction::Repeat()
174 {
175 }
176 
177