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 : : #include <sfx2/dispatch.hxx>
30 : : #include <sfx2/module.hxx>
31 : : #include <sfx2/viewfrm.hxx>
32 : : #include <svl/eitem.hxx>
33 : : #include <svtools/colrdlg.hxx>
34 : : #include <vcl/msgbox.hxx>
35 : : #include <sfx2/viewsh.hxx>
36 : : #include <tools/shl.hxx>
37 : : #include <svx/xflclit.hxx>
38 : : #include <svx/svdmodel.hxx>
39 : : #include <svx/globl3d.hxx>
40 : : #include <svx/view3d.hxx>
41 : : #include <svx/obj3d.hxx>
42 : : #include <svx/sphere3d.hxx>
43 : : #include <svx/scene3d.hxx>
44 : : #include <svx/camera3d.hxx>
45 : : #include <svx/fmmodel.hxx>
46 : : #include <svx/fmpage.hxx>
47 : : #include <svx/polysc3d.hxx>
48 : : #include <editeng/eeitem.hxx>
49 : : #include <svl/style.hxx>
50 : : #include <svx/dlgutil.hxx>
51 : :
52 : : #include <svx/dialmgr.hxx>
53 : : #include <svx/viewpt3d.hxx> // Projection Type
54 : :
55 : : #include <svx/svxids.hrc>
56 : : #include <svx/dialogs.hrc>
57 : :
58 : : #include <editeng/colritem.hxx>
59 : : #include <svx/e3ditem.hxx>
60 : : #include <svx/gallery.hxx>
61 : : #include <svl/whiter.hxx>
62 : :
63 : : #include <svx/float3d.hxx>
64 : : #include "float3d.hrc"
65 : :
66 [ # # ][ + - ]: 741 : SFX_IMPL_DOCKINGWINDOW_WITHID( Svx3DChildWindow, SID_3D_WIN )
[ # # ]
67 : :
68 : : struct Svx3DWinImpl
69 : : {
70 : : SfxItemPool* pPool;
71 : : };
72 : :
73 : : namespace {
74 : : /** Get the dispatcher from the current view frame, or, if that is not
75 : : available, from the given bindings.
76 : : @param pBindings
77 : : May be NULL.
78 : : @returns NULL when both the current view frame is NULL and the given
79 : : bindings are NULL.
80 : : */
81 : 0 : SfxDispatcher* LocalGetDispatcher (const SfxBindings* pBindings)
82 : : {
83 : 0 : SfxDispatcher* pDispatcher = NULL;
84 : :
85 [ # # ]: 0 : if (SfxViewFrame::Current() != NULL)
86 : 0 : pDispatcher = SfxViewFrame::Current()->GetDispatcher();
87 [ # # ]: 0 : else if (pBindings != NULL)
88 : 0 : pDispatcher = pBindings->GetDispatcher();
89 : :
90 : 0 : return pDispatcher;
91 : : }
92 : : }
93 : :
94 : :
95 : : /*************************************************************************
96 : : |* Svx3DWin - FloatingWindow
97 : : \************************************************************************/
98 : 0 : Svx3DWin::Svx3DWin( SfxBindings* pInBindings,
99 : : SfxChildWindow *pCW, Window* pParent ) :
100 : : SfxDockingWindow ( pInBindings, pCW, pParent,
101 : 0 : SVX_RES( RID_SVXFLOAT_3D ) ),
102 [ # # ]: 0 : aBtnGeo ( this, SVX_RES( BTN_GEO ) ),
103 [ # # ]: 0 : aBtnRepresentation ( this, SVX_RES( BTN_REPRESENTATION ) ),
104 [ # # ]: 0 : aBtnLight ( this, SVX_RES( BTN_LIGHT ) ),
105 [ # # ]: 0 : aBtnTexture ( this, SVX_RES( BTN_TEXTURE ) ),
106 [ # # ]: 0 : aBtnMaterial ( this, SVX_RES( BTN_MATERIAL ) ),
107 [ # # ]: 0 : aBtnUpdate ( this, SVX_RES( BTN_UPDATE ) ),
108 [ # # ]: 0 : aBtnAssign ( this, SVX_RES( BTN_ASSIGN ) ),
109 [ # # ]: 0 : aFLGeometrie ( this, SVX_RES( FL_GEOMETRIE ) ),
110 : :
111 : : // Geometry
112 [ # # ]: 0 : aFtPercentDiagonal ( this, SVX_RES( FT_PERCENT_DIAGONAL ) ),
113 [ # # ]: 0 : aMtrPercentDiagonal ( this, SVX_RES( MTR_PERCENT_DIAGONAL ) ),
114 [ # # ]: 0 : aFtBackscale ( this, SVX_RES( FT_BACKSCALE ) ),
115 [ # # ]: 0 : aMtrBackscale ( this, SVX_RES( MTR_BACKSCALE ) ),
116 [ # # ]: 0 : aFtEndAngle ( this, SVX_RES( FT_END_ANGLE ) ),
117 [ # # ]: 0 : aMtrEndAngle ( this, SVX_RES( MTR_END_ANGLE ) ),
118 [ # # ]: 0 : aFtDepth ( this, SVX_RES( FT_DEPTH ) ),
119 [ # # ]: 0 : aMtrDepth ( this, SVX_RES( MTR_DEPTH ) ),
120 [ # # ]: 0 : aFLSegments ( this, SVX_RES( FL_SEGMENTS ) ),
121 : :
122 [ # # ]: 0 : aFtHorizontal ( this, SVX_RES( FT_HORIZONTAL ) ),
123 [ # # ]: 0 : aNumHorizontal ( this, SVX_RES( NUM_HORIZONTAL ) ),
124 [ # # ]: 0 : aFtVertical ( this, SVX_RES( FT_VERTICAL ) ),
125 [ # # ]: 0 : aNumVertical ( this, SVX_RES( NUM_VERTICAL ) ),
126 : :
127 [ # # ]: 0 : aFLNormals ( this, SVX_RES( FL_NORMALS ) ),
128 [ # # ]: 0 : aBtnNormalsObj ( this, SVX_RES( BTN_NORMALS_OBJ ) ),
129 [ # # ]: 0 : aBtnNormalsFlat ( this, SVX_RES( BTN_NORMALS_FLAT ) ),
130 [ # # ]: 0 : aBtnNormalsSphere ( this, SVX_RES( BTN_NORMALS_SPHERE ) ),
131 [ # # ]: 0 : aBtnNormalsInvert ( this, SVX_RES( BTN_NORMALS_INVERT ) ),
132 [ # # ]: 0 : aBtnTwoSidedLighting( this, SVX_RES( BTN_TWO_SIDED_LIGHTING ) ),
133 : :
134 [ # # ]: 0 : aBtnDoubleSided ( this, SVX_RES( BTN_DOUBLE_SIDED ) ),
135 : :
136 : : // Representation
137 [ # # ]: 0 : aFLRepresentation ( this, SVX_RES( FL_REPRESENTATION ) ),
138 [ # # ]: 0 : aFtShademode ( this, SVX_RES( FT_SHADEMODE ) ),
139 [ # # ]: 0 : aLbShademode ( this, SVX_RES( LB_SHADEMODE ) ),
140 [ # # ]: 0 : aFLShadow ( this, SVX_RES( FL_SHADOW ) ),
141 [ # # ]: 0 : aBtnShadow3d ( this, SVX_RES( BTN_SHADOW_3D ) ),
142 [ # # ]: 0 : aFtSlant ( this, SVX_RES( FT_SLANT ) ),
143 [ # # ]: 0 : aMtrSlant ( this, SVX_RES( MTR_SLANT ) ),
144 [ # # ]: 0 : aFtDistance ( this, SVX_RES( FT_DISTANCE ) ),
145 [ # # ]: 0 : aMtrDistance ( this, SVX_RES( MTR_DISTANCE ) ),
146 [ # # ]: 0 : aFtFocalLeng ( this, SVX_RES( FT_FOCAL_LENGTH ) ),
147 [ # # ]: 0 : aMtrFocalLength ( this, SVX_RES( MTR_FOCAL_LENGTH ) ),
148 [ # # ]: 0 : aFLCamera ( this, SVX_RES( FL_CAMERA ) ),
149 [ # # ]: 0 : aFLLight ( this, SVX_RES( FL_LIGHT ) ),
150 : :
151 : : // Lighting
152 [ # # ]: 0 : aBtnLight1 ( this, SVX_RES( BTN_LIGHT_1 ) ),
153 [ # # ]: 0 : aBtnLight2 ( this, SVX_RES( BTN_LIGHT_2 ) ),
154 [ # # ]: 0 : aBtnLight3 ( this, SVX_RES( BTN_LIGHT_3 ) ),
155 [ # # ]: 0 : aBtnLight4 ( this, SVX_RES( BTN_LIGHT_4 ) ),
156 [ # # ]: 0 : aBtnLight5 ( this, SVX_RES( BTN_LIGHT_5 ) ),
157 [ # # ]: 0 : aBtnLight6 ( this, SVX_RES( BTN_LIGHT_6 ) ),
158 [ # # ]: 0 : aBtnLight7 ( this, SVX_RES( BTN_LIGHT_7 ) ),
159 [ # # ]: 0 : aBtnLight8 ( this, SVX_RES( BTN_LIGHT_8 ) ),
160 [ # # ]: 0 : aFTLightsource ( this, SVX_RES( FT_LIGHTSOURCE ) ),
161 [ # # ]: 0 : aLbLight1 ( this, SVX_RES( LB_LIGHT_1 ) ),
162 [ # # ]: 0 : aLbLight2 ( this, SVX_RES( LB_LIGHT_2 ) ),
163 [ # # ]: 0 : aLbLight3 ( this, SVX_RES( LB_LIGHT_3 ) ),
164 [ # # ]: 0 : aLbLight4 ( this, SVX_RES( LB_LIGHT_4 ) ),
165 [ # # ]: 0 : aLbLight5 ( this, SVX_RES( LB_LIGHT_5 ) ),
166 [ # # ]: 0 : aLbLight6 ( this, SVX_RES( LB_LIGHT_6 ) ),
167 [ # # ]: 0 : aLbLight7 ( this, SVX_RES( LB_LIGHT_7 ) ),
168 [ # # ]: 0 : aLbLight8 ( this, SVX_RES( LB_LIGHT_8 ) ),
169 : :
170 [ # # ]: 0 : aBtnLightColor ( this, SVX_RES( BTN_LIGHT_COLOR ) ),
171 : :
172 : : // Keyboard shortcuts activate the next control, so the
173 : : // order needed to be changed here
174 [ # # ]: 0 : aFTAmbientlight ( this, SVX_RES( FT_AMBIENTLIGHT ) ), // Text label
175 [ # # ]: 0 : aLbAmbientlight ( this, SVX_RES( LB_AMBIENTLIGHT ) ), // ListBox
176 [ # # ]: 0 : aBtnAmbientColor ( this, SVX_RES( BTN_AMBIENT_COLOR ) ), // color button
177 [ # # ]: 0 : aFLTexture ( this, SVX_RES( FL_TEXTURE ) ),
178 : :
179 : : // Textures
180 [ # # ]: 0 : aFtTexKind ( this, SVX_RES( FT_TEX_KIND ) ),
181 [ # # ]: 0 : aBtnTexLuminance ( this, SVX_RES( BTN_TEX_LUMINANCE ) ),
182 [ # # ]: 0 : aBtnTexColor ( this, SVX_RES( BTN_TEX_COLOR ) ),
183 [ # # ]: 0 : aFtTexMode ( this, SVX_RES( FT_TEX_MODE ) ),
184 [ # # ]: 0 : aBtnTexReplace ( this, SVX_RES( BTN_TEX_REPLACE ) ),
185 [ # # ]: 0 : aBtnTexModulate ( this, SVX_RES( BTN_TEX_MODULATE ) ),
186 [ # # ]: 0 : aBtnTexBlend ( this, SVX_RES( BTN_TEX_BLEND ) ),
187 [ # # ]: 0 : aFtTexProjectionX ( this, SVX_RES( FT_TEX_PROJECTION_X ) ),
188 [ # # ]: 0 : aBtnTexObjectX ( this, SVX_RES( BTN_TEX_OBJECT_X ) ),
189 [ # # ]: 0 : aBtnTexParallelX ( this, SVX_RES( BTN_TEX_PARALLEL_X ) ),
190 [ # # ]: 0 : aBtnTexCircleX ( this, SVX_RES( BTN_TEX_CIRCLE_X ) ),
191 [ # # ]: 0 : aFtTexProjectionY ( this, SVX_RES( FT_TEX_PROJECTION_Y ) ),
192 [ # # ]: 0 : aBtnTexObjectY ( this, SVX_RES( BTN_TEX_OBJECT_Y ) ),
193 [ # # ]: 0 : aBtnTexParallelY ( this, SVX_RES( BTN_TEX_PARALLEL_Y ) ),
194 [ # # ]: 0 : aBtnTexCircleY ( this, SVX_RES( BTN_TEX_CIRCLE_Y ) ),
195 [ # # ]: 0 : aFtTexFilter ( this, SVX_RES( FT_TEX_FILTER ) ),
196 [ # # ]: 0 : aBtnTexFilter ( this, SVX_RES( BTN_TEX_FILTER ) ),
197 [ # # ]: 0 : aFLMaterial ( this, SVX_RES( FL_MATERIAL ) ),
198 : :
199 : : // Material
200 [ # # ]: 0 : aFtMatFavorites ( this, SVX_RES( FT_MAT_FAVORITES ) ),
201 [ # # ]: 0 : aLbMatFavorites ( this, SVX_RES( LB_MAT_FAVORITES ) ),
202 [ # # ]: 0 : aFtMatColor ( this, SVX_RES( FT_MAT_COLOR ) ),
203 [ # # ]: 0 : aLbMatColor ( this, SVX_RES( LB_MAT_COLOR ) ),
204 [ # # ]: 0 : aBtnMatColor ( this, SVX_RES( BTN_MAT_COLOR ) ),
205 [ # # ]: 0 : aFtMatEmission ( this, SVX_RES( FT_MAT_EMISSION ) ),
206 [ # # ]: 0 : aLbMatEmission ( this, SVX_RES( LB_MAT_EMISSION ) ),
207 [ # # ]: 0 : aBtnEmissionColor ( this, SVX_RES( BTN_EMISSION_COLOR ) ),
208 [ # # ]: 0 : aFLMatSpecular ( this, SVX_RES( FL_MAT_SPECULAR ) ),
209 [ # # ]: 0 : aFtMatSpecular ( this, SVX_RES( FT_MAT_SPECULAR ) ),
210 [ # # ]: 0 : aLbMatSpecular ( this, SVX_RES( LB_MAT_SPECULAR ) ),
211 [ # # ]: 0 : aBtnSpecularColor ( this, SVX_RES( BTN_SPECULAR_COLOR ) ),
212 [ # # ]: 0 : aFtMatSpecularIntensity( this, SVX_RES( FT_MAT_SPECULAR_INTENSITY ) ),
213 [ # # ]: 0 : aMtrMatSpecularIntensity( this, SVX_RES( MTR_MAT_SPECULAR_INTENSITY ) ),
214 [ # # ]: 0 : aCtlPreview ( this, SVX_RES( CTL_PREVIEW ) ),
215 [ # # ]: 0 : aCtlLightPreview ( this, SVX_RES( CTL_LIGHT_PREVIEW ) ),
216 : :
217 : : // Lower Range
218 [ # # ]: 0 : aBtnConvertTo3D ( this, SVX_RES( BTN_CHANGE_TO_3D ) ),
219 [ # # ]: 0 : aBtnLatheObject ( this, SVX_RES( BTN_LATHE_OBJ ) ),
220 [ # # ]: 0 : aBtnPerspective ( this, SVX_RES( BTN_PERSPECTIVE ) ),
221 : :
222 [ # # ]: 0 : aImgLightOn ( SVX_RES( RID_SVXIMAGE_LIGHT_ON ) ),
223 [ # # ]: 0 : aImgLightOff ( SVX_RES( RID_SVXIMAGE_LIGHT_OFF ) ),
224 : :
225 : : bUpdate ( sal_False ),
226 : : eViewType ( VIEWTYPE_GEO ),
227 : :
228 : : pModel ( NULL ),
229 : : pVDev ( NULL ),
230 : : p3DView ( NULL ),
231 : :
232 : : pBindings ( pInBindings ),
233 : : pControllerItem(0L),
234 : : pConvertTo3DItem(0L),
235 : : pConvertTo3DLatheItem(0L),
236 : : mpImpl ( new Svx3DWinImpl() ),
237 : : mpRemember2DAttributes(NULL),
238 [ # # ][ # # ]: 0 : bOnly3DChanged ( sal_False )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
239 : : {
240 [ # # ][ # # ]: 0 : String accname(SVX_RES(RID_SVXFLOAT3D_COLOR_LIGHT_PRE));
241 [ # # ]: 0 : aCtlLightPreview.SetAccessibleName(accname);
242 [ # # ]: 0 : aCtlPreview.SetAccessibleName(accname);
243 [ # # ][ # # ]: 0 : aLbAmbientlight.SetAccessibleName(aFTAmbientlight.GetDisplayText());
[ # # ]
244 : :
245 : 0 : mpImpl->pPool = NULL;
246 [ # # ]: 0 : FreeResource();
247 : :
248 : : // Set Metric
249 [ # # ][ # # ]: 0 : eFUnit = pInBindings->GetDispatcher()->GetModule()->GetFieldUnit();
250 : :
251 [ # # ]: 0 : aMtrDepth.SetUnit( eFUnit );
252 [ # # ]: 0 : aMtrDistance.SetUnit( eFUnit );
253 [ # # ]: 0 : aMtrFocalLength.SetUnit( eFUnit );
254 : :
255 [ # # ][ # # ]: 0 : pControllerItem = new Svx3DCtrlItem(SID_3D_STATE, pBindings);
256 [ # # ][ # # ]: 0 : pConvertTo3DItem = new SvxConvertTo3DItem(SID_CONVERT_TO_3D, pBindings);
257 [ # # ][ # # ]: 0 : pConvertTo3DLatheItem = new SvxConvertTo3DItem(SID_CONVERT_TO_3D_LATHE_FAST, pBindings);
258 : :
259 [ # # ]: 0 : aBtnAssign.SetClickHdl( LINK( this, Svx3DWin, ClickAssignHdl ) );
260 [ # # ]: 0 : aBtnUpdate.SetClickHdl( LINK( this, Svx3DWin, ClickUpdateHdl ) );
261 : :
262 [ # # ]: 0 : Link aLink( LINK( this, Svx3DWin, ClickViewTypeHdl ) );
263 : 0 : aBtnGeo.SetClickHdl( aLink );
264 : 0 : aBtnRepresentation.SetClickHdl( aLink );
265 : 0 : aBtnLight.SetClickHdl( aLink );
266 : 0 : aBtnTexture.SetClickHdl( aLink );
267 : 0 : aBtnMaterial.SetClickHdl( aLink );
268 : :
269 [ # # ]: 0 : aLink = LINK( this, Svx3DWin, ClickHdl );
270 : 0 : aBtnPerspective.SetClickHdl( aLink );
271 : 0 : aBtnConvertTo3D.SetClickHdl( aLink );
272 : 0 : aBtnLatheObject.SetClickHdl( aLink );
273 : :
274 : : // Geometry
275 : 0 : aBtnNormalsObj.SetClickHdl( aLink );
276 : 0 : aBtnNormalsFlat.SetClickHdl( aLink );
277 : 0 : aBtnNormalsSphere.SetClickHdl( aLink );
278 : 0 : aBtnTwoSidedLighting.SetClickHdl( aLink );
279 : 0 : aBtnNormalsInvert.SetClickHdl( aLink );
280 : 0 : aBtnDoubleSided.SetClickHdl( aLink );
281 : :
282 : : // Representation
283 : 0 : aBtnShadow3d.SetClickHdl( aLink );
284 : :
285 : : // Lighting
286 : 0 : aBtnLight1.SetClickHdl( aLink );
287 : 0 : aBtnLight2.SetClickHdl( aLink );
288 : 0 : aBtnLight3.SetClickHdl( aLink );
289 : 0 : aBtnLight4.SetClickHdl( aLink );
290 : 0 : aBtnLight5.SetClickHdl( aLink );
291 : 0 : aBtnLight6.SetClickHdl( aLink );
292 : 0 : aBtnLight7.SetClickHdl( aLink );
293 : 0 : aBtnLight8.SetClickHdl( aLink );
294 : :
295 : : // Textures
296 : 0 : aBtnTexLuminance.SetClickHdl( aLink );
297 : 0 : aBtnTexColor.SetClickHdl( aLink );
298 : 0 : aBtnTexReplace.SetClickHdl( aLink );
299 : 0 : aBtnTexModulate.SetClickHdl( aLink );
300 : 0 : aBtnTexParallelX.SetClickHdl( aLink );
301 : 0 : aBtnTexCircleX.SetClickHdl( aLink );
302 : 0 : aBtnTexObjectX.SetClickHdl( aLink );
303 : 0 : aBtnTexParallelY.SetClickHdl( aLink );
304 : 0 : aBtnTexCircleY.SetClickHdl( aLink );
305 : 0 : aBtnTexObjectY.SetClickHdl( aLink );
306 : 0 : aBtnTexFilter.SetClickHdl( aLink );
307 : :
308 : : // Material
309 [ # # ]: 0 : aLink = LINK( this, Svx3DWin, ClickColorHdl );
310 : 0 : aBtnLightColor.SetClickHdl( aLink );
311 : 0 : aBtnAmbientColor.SetClickHdl( aLink );
312 : 0 : aBtnMatColor.SetClickHdl( aLink );
313 : 0 : aBtnEmissionColor.SetClickHdl( aLink );
314 : 0 : aBtnSpecularColor.SetClickHdl( aLink );
315 : :
316 : :
317 [ # # ]: 0 : aLink = LINK( this, Svx3DWin, SelectHdl );
318 : 0 : aLbMatFavorites.SetSelectHdl( aLink );
319 : 0 : aLbMatColor.SetSelectHdl( aLink );
320 : 0 : aLbMatEmission.SetSelectHdl( aLink );
321 : 0 : aLbMatSpecular.SetSelectHdl( aLink );
322 : 0 : aLbLight1.SetSelectHdl( aLink );
323 : 0 : aLbLight2.SetSelectHdl( aLink );
324 : 0 : aLbLight3.SetSelectHdl( aLink );
325 : 0 : aLbLight4.SetSelectHdl( aLink );
326 : 0 : aLbLight5.SetSelectHdl( aLink );
327 : 0 : aLbLight6.SetSelectHdl( aLink );
328 : 0 : aLbLight7.SetSelectHdl( aLink );
329 : 0 : aLbLight8.SetSelectHdl( aLink );
330 : 0 : aLbAmbientlight.SetSelectHdl( aLink );
331 : 0 : aLbShademode.SetSelectHdl( aLink );
332 : :
333 [ # # ]: 0 : aLink = LINK( this, Svx3DWin, ModifyHdl );
334 : 0 : aMtrMatSpecularIntensity.SetModifyHdl( aLink );
335 : 0 : aNumHorizontal.SetModifyHdl( aLink );
336 : 0 : aNumVertical.SetModifyHdl( aLink );
337 : 0 : aMtrSlant.SetModifyHdl( aLink );
338 : :
339 : : // Preview callback
340 [ # # ]: 0 : aLink = LINK( this, Svx3DWin, ChangeLightCallbackHdl );
341 : 0 : aCtlLightPreview.SetUserInteractiveChangeCallback(aLink);
342 [ # # ]: 0 : aLink = LINK( this, Svx3DWin, ChangeSelectionCallbackHdl );
343 : 0 : aCtlLightPreview.SetUserSelectionChangeCallback(aLink);
344 : :
345 [ # # ]: 0 : aSize = GetOutputSizePixel();
346 [ # # ]: 0 : SetMinOutputSizePixel( aSize );
347 : :
348 [ # # ]: 0 : Construct();
349 : :
350 : : // Initiation of the initialization of the ColorLBs
351 [ # # ]: 0 : SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
352 [ # # ]: 0 : if (pDispatcher != NULL)
353 : : {
354 [ # # ]: 0 : SfxBoolItem aItem( SID_3D_INIT, sal_True );
355 : : pDispatcher->Execute(
356 [ # # ][ # # ]: 0 : SID_3D_INIT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
357 : : }
358 : :
359 [ # # ]: 0 : Reset();
360 : :
361 [ # # ]: 0 : aBtnNormalsObj.SetAccessibleRelationMemberOf( &aFLNormals );
362 [ # # ]: 0 : aBtnNormalsFlat.SetAccessibleRelationMemberOf( &aFLNormals );
363 [ # # ]: 0 : aBtnNormalsSphere.SetAccessibleRelationMemberOf( &aFLNormals );
364 [ # # ]: 0 : aBtnNormalsInvert.SetAccessibleRelationMemberOf( &aFLNormals );
365 [ # # ]: 0 : aBtnTwoSidedLighting.SetAccessibleRelationMemberOf( &aFLNormals );
366 [ # # ]: 0 : aBtnDoubleSided.SetAccessibleRelationMemberOf( &aFLNormals );
367 : :
368 [ # # ]: 0 : aBtnLight1.SetAccessibleRelationMemberOf( &aFLLight );
369 [ # # ]: 0 : aBtnLight2.SetAccessibleRelationMemberOf( &aFLLight );
370 [ # # ]: 0 : aBtnLight3.SetAccessibleRelationMemberOf( &aFLLight );
371 [ # # ]: 0 : aBtnLight4.SetAccessibleRelationMemberOf( &aFLLight );
372 [ # # ]: 0 : aBtnLight5.SetAccessibleRelationMemberOf( &aFLLight );
373 [ # # ]: 0 : aBtnLight6.SetAccessibleRelationMemberOf( &aFLLight );
374 [ # # ]: 0 : aBtnLight7.SetAccessibleRelationMemberOf( &aFLLight );
375 [ # # ]: 0 : aBtnLight8.SetAccessibleRelationMemberOf( &aFLLight );
376 : :
377 [ # # ]: 0 : aBtnLight1.SetAccessibleRelationLabeledBy( &aFTLightsource );
378 [ # # ]: 0 : aBtnLight2.SetAccessibleRelationLabeledBy( &aFTLightsource );
379 [ # # ]: 0 : aBtnLight3.SetAccessibleRelationLabeledBy( &aFTLightsource );
380 [ # # ]: 0 : aBtnLight4.SetAccessibleRelationLabeledBy( &aFTLightsource );
381 [ # # ]: 0 : aBtnLight5.SetAccessibleRelationLabeledBy( &aFTLightsource );
382 [ # # ]: 0 : aBtnLight6.SetAccessibleRelationLabeledBy( &aFTLightsource );
383 [ # # ]: 0 : aBtnLight7.SetAccessibleRelationLabeledBy( &aFTLightsource );
384 [ # # ]: 0 : aBtnLight8.SetAccessibleRelationLabeledBy( &aFTLightsource );
385 [ # # ]: 0 : aBtnLightColor.SetAccessibleRelationMemberOf( &aFLLight );
386 [ # # ]: 0 : aBtnLightColor.SetAccessibleRelationLabeledBy( &aFTLightsource );
387 [ # # ]: 0 : aBtnAmbientColor.SetAccessibleRelationMemberOf( &aFLLight );
388 [ # # ]: 0 : aBtnAmbientColor.SetAccessibleRelationLabeledBy( &aFTAmbientlight );
389 : :
390 [ # # ]: 0 : aBtnSpecularColor.SetAccessibleRelationLabeledBy( &aFtMatSpecular );
391 [ # # ]: 0 : aBtnMatColor.SetAccessibleRelationLabeledBy( &aFtMatColor );
392 [ # # ]: 0 : aBtnEmissionColor.SetAccessibleRelationLabeledBy( &aFtMatEmission );
393 [ # # ]: 0 : aBtnTexLuminance.SetAccessibleRelationLabeledBy( &aFtTexKind );
394 [ # # ]: 0 : aBtnTexColor.SetAccessibleRelationLabeledBy( &aFtTexKind );
395 [ # # ]: 0 : aBtnTexReplace.SetAccessibleRelationLabeledBy( &aFtTexMode );
396 [ # # ]: 0 : aBtnTexModulate.SetAccessibleRelationLabeledBy( &aFtTexMode );
397 [ # # ]: 0 : aBtnTexBlend.SetAccessibleRelationLabeledBy( &aFtTexMode );
398 [ # # ]: 0 : aBtnTexObjectX.SetAccessibleRelationLabeledBy( &aFtTexProjectionX );
399 [ # # ]: 0 : aBtnTexParallelX.SetAccessibleRelationLabeledBy( &aFtTexProjectionX );
400 [ # # ]: 0 : aBtnTexCircleX.SetAccessibleRelationLabeledBy( &aFtTexProjectionX );
401 [ # # ]: 0 : aBtnTexObjectY.SetAccessibleRelationLabeledBy( &aFtTexProjectionY );
402 [ # # ]: 0 : aBtnTexParallelY.SetAccessibleRelationLabeledBy( &aFtTexProjectionY );
403 [ # # ]: 0 : aBtnTexCircleY.SetAccessibleRelationLabeledBy( &aFtTexProjectionY );
404 [ # # ]: 0 : aBtnTexFilter.SetAccessibleRelationLabeledBy( &aFtTexFilter );
405 [ # # ]: 0 : aCtlLightPreview.SetAccessibleRelationLabeledBy( &aCtlLightPreview );
406 [ # # ]: 0 : aBtnNormalsObj.SetAccessibleRelationMemberOf(&aFLNormals);
407 [ # # ]: 0 : aBtnNormalsFlat.SetAccessibleRelationMemberOf(&aFLNormals);
408 [ # # ]: 0 : aBtnNormalsSphere.SetAccessibleRelationMemberOf(&aFLNormals);
409 [ # # ]: 0 : aBtnNormalsInvert.SetAccessibleRelationMemberOf(&aFLNormals);
410 [ # # ]: 0 : aBtnTwoSidedLighting.SetAccessibleRelationMemberOf(&aFLNormals);
411 : :
412 [ # # ]: 0 : aBtnShadow3d.SetAccessibleRelationMemberOf(&aFLShadow);
413 : :
414 [ # # ]: 0 : aBtnLight1.SetAccessibleRelationMemberOf(&aFLLight);
415 [ # # ]: 0 : aBtnLight2.SetAccessibleRelationMemberOf(&aFLLight);
416 [ # # ]: 0 : aBtnLight3.SetAccessibleRelationMemberOf(&aFLLight);
417 [ # # ]: 0 : aBtnLight4.SetAccessibleRelationMemberOf(&aFLLight);
418 [ # # ]: 0 : aBtnLight5.SetAccessibleRelationMemberOf(&aFLLight);
419 [ # # ]: 0 : aBtnLight6.SetAccessibleRelationMemberOf(&aFLLight);
420 [ # # ]: 0 : aBtnLight7.SetAccessibleRelationMemberOf(&aFLLight);
421 [ # # ]: 0 : aBtnLight8.SetAccessibleRelationMemberOf(&aFLLight);
422 : :
423 [ # # ]: 0 : aBtnTexLuminance.SetAccessibleRelationMemberOf(&aFLTexture);
424 [ # # ]: 0 : aBtnTexColor.SetAccessibleRelationMemberOf(&aFLTexture);
425 [ # # ]: 0 : aBtnTexReplace.SetAccessibleRelationMemberOf(&aFLTexture);
426 [ # # ]: 0 : aBtnTexModulate.SetAccessibleRelationMemberOf(&aFLTexture);
427 [ # # ]: 0 : aBtnTexBlend.SetAccessibleRelationMemberOf(&aFLTexture);
428 [ # # ]: 0 : aBtnTexObjectX.SetAccessibleRelationMemberOf(&aFLTexture);
429 [ # # ]: 0 : aBtnTexParallelX.SetAccessibleRelationMemberOf(&aFLTexture);
430 [ # # ]: 0 : aBtnTexCircleX.SetAccessibleRelationMemberOf(&aFLTexture);
431 [ # # ]: 0 : aBtnTexObjectY.SetAccessibleRelationMemberOf(&aFLTexture);
432 [ # # ]: 0 : aBtnTexParallelY.SetAccessibleRelationMemberOf(&aFLTexture);
433 [ # # ]: 0 : aBtnTexCircleY.SetAccessibleRelationMemberOf(&aFLTexture);
434 [ # # ]: 0 : aBtnTexFilter.SetAccessibleRelationMemberOf(&aFLTexture);
435 : :
436 [ # # ]: 0 : aBtnMatColor.SetAccessibleRelationMemberOf(&aFLMaterial);
437 [ # # ]: 0 : aBtnEmissionColor.SetAccessibleRelationMemberOf(&aFLMaterial);
438 : :
439 [ # # ][ # # ]: 0 : aBtnSpecularColor.SetAccessibleRelationMemberOf(&aFLMatSpecular);
440 : 0 : }
441 : :
442 : : // -----------------------------------------------------------------------
443 [ # # ][ # # ]: 0 : Svx3DWin::~Svx3DWin()
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
444 : : {
445 [ # # ][ # # ]: 0 : delete p3DView;
446 [ # # ][ # # ]: 0 : delete pVDev;
447 [ # # ][ # # ]: 0 : delete pModel;
448 : :
449 [ # # ][ # # ]: 0 : delete pControllerItem;
450 [ # # ][ # # ]: 0 : delete pConvertTo3DItem;
451 [ # # ][ # # ]: 0 : delete pConvertTo3DLatheItem;
452 : :
453 [ # # ][ # # ]: 0 : delete mpRemember2DAttributes;
454 : :
455 : 0 : delete mpImpl;
456 [ # # ]: 0 : }
457 : :
458 : : // -----------------------------------------------------------------------
459 : 0 : void Svx3DWin::Construct()
460 : : {
461 [ # # ]: 0 : aBtnGeo.Check();
462 [ # # ]: 0 : Link aLink( LINK( this, Svx3DWin, ClickViewTypeHdl ) );
463 [ # # ]: 0 : aLink.Call( &aBtnGeo );
464 [ # # ]: 0 : aCtlLightPreview.Hide();
465 : 0 : }
466 : :
467 : : // -----------------------------------------------------------------------
468 : 0 : void Svx3DWin::Reset()
469 : : {
470 : : // Various initializations, default is AllAttributes
471 : 0 : aLbShademode.SelectEntryPos( 0 );
472 : 0 : aMtrMatSpecularIntensity.SetValue( 50 );
473 : :
474 : 0 : aBtnLight1.Check();
475 : 0 : ClickUpdateHdl( NULL );
476 : :
477 : : // Select nothing, to avoid errors when selecting the first
478 : 0 : aCtlLightPreview.GetSvx3DLightControl().SelectLight(0);
479 : 0 : }
480 : :
481 : 0 : bool Svx3DWin::GetUILightState( const ImageButton& rBtn ) const
482 : : {
483 [ # # ]: 0 : return (rBtn.GetModeImage() == aImgLightOn);
484 : : }
485 : :
486 : 0 : void Svx3DWin::SetUILightState( ImageButton& aBtn, bool bState )
487 : : {
488 [ # # ]: 0 : aBtn.SetModeImage( bState ? aImgLightOn : aImgLightOff );
489 : 0 : }
490 : :
491 : : // -----------------------------------------------------------------------
492 : 0 : void Svx3DWin::Update( SfxItemSet& rAttrs )
493 : : {
494 : : // remember 2d attributes
495 [ # # ]: 0 : if(mpRemember2DAttributes)
496 [ # # ]: 0 : mpRemember2DAttributes->ClearItem();
497 : : else
498 : : mpRemember2DAttributes = new SfxItemSet(*rAttrs.GetPool(),
499 : : SDRATTR_START, SDRATTR_SHADOW_LAST,
500 : : SDRATTR_3D_FIRST, SDRATTR_3D_LAST,
501 [ # # ][ # # ]: 0 : 0, 0);
502 : :
503 [ # # ]: 0 : SfxWhichIter aIter(*mpRemember2DAttributes);
504 [ # # ]: 0 : sal_uInt16 nWhich(aIter.FirstWhich());
505 : :
506 [ # # ]: 0 : while(nWhich)
507 : : {
508 [ # # ]: 0 : SfxItemState eState = rAttrs.GetItemState(nWhich, sal_False);
509 [ # # ]: 0 : if(SFX_ITEM_DONTCARE == eState)
510 [ # # ]: 0 : mpRemember2DAttributes->InvalidateItem(nWhich);
511 [ # # ]: 0 : else if(SFX_ITEM_SET == eState)
512 [ # # ][ # # ]: 0 : mpRemember2DAttributes->Put(rAttrs.Get(nWhich, sal_False));
513 : :
514 [ # # ]: 0 : nWhich = aIter.NextWhich();
515 : : }
516 : :
517 : : // construct field values
518 : : const SfxPoolItem* pItem;
519 : :
520 : : // Possible determine PoolUnit
521 [ # # ]: 0 : if( !mpImpl->pPool )
522 : : {
523 : 0 : mpImpl->pPool = rAttrs.GetPool();
524 : : DBG_ASSERT( mpImpl->pPool, "Where is the Pool? ");
525 [ # # ]: 0 : ePoolUnit = mpImpl->pPool->GetMetric( SID_ATTR_LINE_WIDTH );
526 : : }
527 [ # # ]: 0 : eFUnit = GetModuleFieldUnit( rAttrs );
528 : :
529 : :
530 : : // Segment Number Can be changed? and other states
531 [ # # ]: 0 : SfxItemState eState = rAttrs.GetItemState( SID_ATTR_3D_INTERN, sal_False, &pItem );
532 [ # # ]: 0 : if( SFX_ITEM_SET == eState )
533 : : {
534 : 0 : sal_uInt32 nState = ( ( const SfxUInt32Item* )pItem )->GetValue();
535 : 0 : sal_Bool bExtrude = (sal_Bool) ( nState & 2 );
536 : 0 : sal_Bool bSphere = (sal_Bool) ( nState & 4 );
537 : 0 : sal_Bool bCube = (sal_Bool) ( nState & 8 );
538 : :
539 : 0 : sal_Bool bChart = (sal_Bool) ( nState & 32 ); // Chart
540 : :
541 [ # # ]: 0 : if( !bChart )
542 : : {
543 : : // For cube objects are no segments set
544 [ # # ]: 0 : aFtHorizontal.Enable( !bCube );
545 [ # # ]: 0 : aNumHorizontal.Enable( !bCube );
546 [ # # ]: 0 : aFtVertical.Enable( !bCube );
547 [ # # ]: 0 : aNumVertical.Enable( !bCube );
548 [ # # ]: 0 : aFLSegments.Enable( !bCube );
549 : :
550 [ # # ][ # # ]: 0 : aFtPercentDiagonal.Enable( !bCube && !bSphere );
[ # # ]
551 [ # # ][ # # ]: 0 : aMtrPercentDiagonal.Enable( !bCube && !bSphere );
[ # # ]
552 [ # # ][ # # ]: 0 : aFtBackscale.Enable( !bCube && !bSphere );
[ # # ]
553 [ # # ][ # # ]: 0 : aMtrBackscale.Enable( !bCube && !bSphere );
[ # # ]
554 [ # # ][ # # ]: 0 : aFtDepth.Enable( !bCube && !bSphere );
[ # # ]
555 [ # # ][ # # ]: 0 : aMtrDepth.Enable( !bCube && !bSphere );
[ # # ]
556 [ # # ]: 0 : if( bCube )
557 : : {
558 [ # # ]: 0 : aNumHorizontal.SetEmptyFieldValue();
559 [ # # ]: 0 : aNumVertical.SetEmptyFieldValue();
560 : : }
561 [ # # ][ # # ]: 0 : if( bCube || bSphere )
562 : : {
563 [ # # ]: 0 : aMtrPercentDiagonal.SetEmptyFieldValue();
564 [ # # ]: 0 : aMtrBackscale.SetEmptyFieldValue();
565 [ # # ]: 0 : aMtrDepth.SetEmptyFieldValue();
566 : : }
567 : :
568 : : // There is a final angle only for Lathe objects.
569 [ # # ][ # # ]: 0 : aFtEndAngle.Enable( !bExtrude && !bCube && !bSphere );
[ # # ][ # # ]
570 [ # # ][ # # ]: 0 : aMtrEndAngle.Enable( !bExtrude && !bCube && !bSphere );
[ # # ][ # # ]
571 [ # # ][ # # ]: 0 : if( bExtrude || bCube || bSphere )
[ # # ]
572 [ # # ]: 0 : aMtrEndAngle.SetEmptyFieldValue();
573 : : }
574 : : else
575 : : {
576 : : // Geometry
577 [ # # ]: 0 : aFtHorizontal.Enable( sal_False );
578 [ # # ]: 0 : aNumHorizontal.Enable( sal_False );
579 [ # # ]: 0 : aNumHorizontal.SetEmptyFieldValue();
580 [ # # ]: 0 : aFtVertical.Enable( sal_False );
581 [ # # ]: 0 : aNumVertical.Enable( sal_False );
582 [ # # ]: 0 : aNumVertical.SetEmptyFieldValue();
583 [ # # ]: 0 : aFLSegments.Enable( sal_False );
584 [ # # ]: 0 : aFtEndAngle.Enable( sal_False );
585 [ # # ]: 0 : aMtrEndAngle.Enable( sal_False );
586 [ # # ]: 0 : aMtrEndAngle.SetEmptyFieldValue();
587 [ # # ]: 0 : aFtDepth.Enable( sal_False );
588 [ # # ]: 0 : aMtrDepth.Enable( sal_False );
589 [ # # ]: 0 : aMtrDepth.SetEmptyFieldValue();
590 : :
591 : : // Representation
592 [ # # ]: 0 : aBtnShadow3d.Enable( sal_False );
593 [ # # ]: 0 : aFtSlant.Enable( sal_False );
594 [ # # ]: 0 : aMtrSlant.Enable( sal_False );
595 [ # # ]: 0 : aFLShadow.Enable( sal_False );
596 : :
597 [ # # ]: 0 : aFtDistance.Enable( sal_False );
598 [ # # ]: 0 : aMtrDistance.Enable( sal_False );
599 [ # # ]: 0 : aMtrDistance.SetEmptyFieldValue();
600 [ # # ]: 0 : aFtFocalLeng.Enable( sal_False );
601 [ # # ]: 0 : aMtrFocalLength.Enable( sal_False );
602 [ # # ]: 0 : aMtrFocalLength.SetEmptyFieldValue();
603 [ # # ]: 0 : aFLCamera.Enable( sal_False );
604 : :
605 : : //Lower Range
606 [ # # ]: 0 : aBtnConvertTo3D.Enable( sal_False );
607 [ # # ]: 0 : aBtnLatheObject.Enable( sal_False );
608 : : }
609 : : }
610 : : // Bitmap fill ? -> Status
611 : 0 : sal_Bool bBitmap(sal_False);
612 [ # # ]: 0 : eState = rAttrs.GetItemState(XATTR_FILLSTYLE);
613 [ # # ]: 0 : if(eState != SFX_ITEM_DONTCARE)
614 : : {
615 [ # # ]: 0 : XFillStyle eXFS = (XFillStyle)((const XFillStyleItem&)rAttrs.Get(XATTR_FILLSTYLE)).GetValue();
616 [ # # ][ # # ]: 0 : bBitmap = (eXFS == XFILL_BITMAP || eXFS == XFILL_GRADIENT || eXFS == XFILL_HATCH);
[ # # ]
617 : : }
618 : :
619 [ # # ]: 0 : aFtTexKind.Enable( bBitmap );
620 [ # # ]: 0 : aBtnTexLuminance.Enable( bBitmap );
621 [ # # ]: 0 : aBtnTexColor.Enable( bBitmap );
622 [ # # ]: 0 : aFtTexMode.Enable( bBitmap );
623 [ # # ]: 0 : aBtnTexReplace.Enable( bBitmap );
624 [ # # ]: 0 : aBtnTexModulate.Enable( bBitmap );
625 [ # # ]: 0 : aBtnTexBlend.Enable( bBitmap );
626 [ # # ]: 0 : aFtTexProjectionX.Enable( bBitmap );
627 [ # # ]: 0 : aBtnTexParallelX.Enable( bBitmap );
628 [ # # ]: 0 : aBtnTexCircleX.Enable( bBitmap );
629 [ # # ]: 0 : aBtnTexObjectX.Enable( bBitmap );
630 [ # # ]: 0 : aFtTexProjectionY.Enable( bBitmap );
631 [ # # ]: 0 : aBtnTexParallelY.Enable( bBitmap );
632 [ # # ]: 0 : aBtnTexCircleY.Enable( bBitmap );
633 [ # # ]: 0 : aBtnTexObjectY.Enable( bBitmap );
634 [ # # ]: 0 : aFtTexFilter.Enable( bBitmap );
635 [ # # ]: 0 : aBtnTexFilter.Enable( bBitmap );
636 [ # # ]: 0 : aFLTexture.Enable( bBitmap );
637 : :
638 : :
639 : : // Geometry
640 : : // Number of segments (horizontal)
641 [ # # ][ # # ]: 0 : if( aNumHorizontal.IsEnabled() )
642 : : {
643 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_HORZ_SEGS);
644 [ # # ]: 0 : if(eState != SFX_ITEM_DONTCARE)
645 : : {
646 [ # # ]: 0 : sal_uInt32 nValue = ((const Svx3DHorizontalSegmentsItem&)rAttrs.Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue();
647 [ # # ][ # # ]: 0 : if(nValue != (sal_uInt32 )aNumHorizontal.GetValue())
648 : : {
649 [ # # ]: 0 : aNumHorizontal.SetValue( nValue );
650 : 0 : bUpdate = sal_True;
651 : : }
652 [ # # ][ # # ]: 0 : else if( aNumHorizontal.IsEmptyFieldValue() )
653 [ # # ]: 0 : aNumHorizontal.SetValue( nValue );
654 : : }
655 : : else
656 : : {
657 [ # # ][ # # ]: 0 : if( !aNumHorizontal.IsEmptyFieldValue() )
658 : : {
659 [ # # ]: 0 : aNumHorizontal.SetEmptyFieldValue();
660 : 0 : bUpdate = sal_True;
661 : : }
662 : : }
663 : : }
664 : :
665 : : //Number of segments (vertical)
666 [ # # ][ # # ]: 0 : if( aNumVertical.IsEnabled() )
667 : : {
668 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_VERT_SEGS);
669 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
670 : : {
671 [ # # ]: 0 : sal_uInt32 nValue = ((const Svx3DVerticalSegmentsItem&)rAttrs.Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue();
672 [ # # ][ # # ]: 0 : if( nValue != (sal_uInt32) aNumVertical.GetValue() )
673 : : {
674 [ # # ]: 0 : aNumVertical.SetValue( nValue );
675 : 0 : bUpdate = sal_True;
676 : : }
677 [ # # ][ # # ]: 0 : else if( aNumVertical.IsEmptyFieldValue() )
678 [ # # ]: 0 : aNumVertical.SetValue( nValue );
679 : : }
680 : : else
681 : : {
682 [ # # ][ # # ]: 0 : if( !aNumVertical.IsEmptyFieldValue() )
683 : : {
684 [ # # ]: 0 : aNumVertical.SetEmptyFieldValue();
685 : 0 : bUpdate = sal_True;
686 : : }
687 : : }
688 : : }
689 : :
690 : : // Depth
691 [ # # ][ # # ]: 0 : if( aMtrDepth.IsEnabled() )
692 : : {
693 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_DEPTH);
694 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
695 : : {
696 [ # # ]: 0 : sal_uInt32 nValue = ((const Svx3DDepthItem&)rAttrs.Get(SDRATTR_3DOBJ_DEPTH)).GetValue();
697 [ # # ]: 0 : sal_uInt32 nValue2 = GetCoreValue( aMtrDepth, ePoolUnit );
698 [ # # ]: 0 : if( nValue != nValue2 )
699 : : {
700 [ # # ]: 0 : if( eFUnit != aMtrDepth.GetUnit() )
701 [ # # ]: 0 : SetFieldUnit( aMtrDepth, eFUnit );
702 : :
703 [ # # ]: 0 : SetMetricValue( aMtrDepth, nValue, ePoolUnit );
704 : 0 : bUpdate = sal_True;
705 : : }
706 [ # # ][ # # ]: 0 : else if( aMtrDepth.IsEmptyFieldValue() )
707 [ # # ][ # # ]: 0 : aMtrDepth.SetValue( aMtrDepth.GetValue() );
708 : : }
709 : : else
710 : : {
711 [ # # ][ # # ]: 0 : if( !aMtrDepth.IsEmptyFieldValue() )
712 : : {
713 [ # # ]: 0 : aMtrDepth.SetEmptyFieldValue();
714 : 0 : bUpdate = sal_True;
715 : : }
716 : : }
717 : : }
718 : :
719 : : // Double walled / Double sided
720 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_DOUBLE_SIDED);
721 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
722 : : {
723 [ # # ]: 0 : sal_Bool bValue = ((const Svx3DDoubleSidedItem&)rAttrs.Get(SDRATTR_3DOBJ_DOUBLE_SIDED)).GetValue();
724 [ # # ][ # # ]: 0 : if( bValue != aBtnDoubleSided.IsChecked() )
725 : : {
726 [ # # ]: 0 : aBtnDoubleSided.Check( bValue );
727 : 0 : bUpdate = sal_True;
728 : : }
729 [ # # ]: 0 : else if( aBtnDoubleSided.GetState() == STATE_DONTKNOW )
730 [ # # ]: 0 : aBtnDoubleSided.Check( bValue );
731 : : }
732 : : else
733 : : {
734 [ # # ]: 0 : if( aBtnDoubleSided.GetState() != STATE_DONTKNOW )
735 : : {
736 [ # # ]: 0 : aBtnDoubleSided.SetState( STATE_DONTKNOW );
737 : 0 : bUpdate = sal_True;
738 : : }
739 : : }
740 : :
741 : : // Edge rounding
742 [ # # ][ # # ]: 0 : if( aMtrPercentDiagonal.IsEnabled() )
743 : : {
744 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_PERCENT_DIAGONAL);
745 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
746 : : {
747 [ # # ]: 0 : sal_uInt16 nValue = ((const Svx3DPercentDiagonalItem&)rAttrs.Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue();
748 [ # # ][ # # ]: 0 : if( nValue != aMtrPercentDiagonal.GetValue() )
749 : : {
750 [ # # ]: 0 : aMtrPercentDiagonal.SetValue( nValue );
751 : 0 : bUpdate = sal_True;
752 : : }
753 [ # # ][ # # ]: 0 : else if( aMtrPercentDiagonal.IsEmptyFieldValue() )
754 [ # # ]: 0 : aMtrPercentDiagonal.SetValue( nValue );
755 : : }
756 : : else
757 : : {
758 [ # # ][ # # ]: 0 : if( !aMtrPercentDiagonal.IsEmptyFieldValue() )
759 : : {
760 [ # # ]: 0 : aMtrPercentDiagonal.SetEmptyFieldValue();
761 : 0 : bUpdate = sal_True;
762 : : }
763 : : }
764 : : }
765 : :
766 : : // Depth scaling
767 [ # # ][ # # ]: 0 : if( aMtrBackscale.IsEnabled() )
768 : : {
769 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_BACKSCALE);
770 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
771 : : {
772 [ # # ]: 0 : sal_uInt16 nValue = ((const Svx3DBackscaleItem&)rAttrs.Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue();
773 [ # # ][ # # ]: 0 : if( nValue != aMtrBackscale.GetValue() )
774 : : {
775 [ # # ]: 0 : aMtrBackscale.SetValue( nValue );
776 : 0 : bUpdate = sal_True;
777 : : }
778 [ # # ][ # # ]: 0 : else if( aMtrBackscale.IsEmptyFieldValue() )
779 [ # # ]: 0 : aMtrBackscale.SetValue( nValue );
780 : : }
781 : : else
782 : : {
783 [ # # ][ # # ]: 0 : if( !aMtrBackscale.IsEmptyFieldValue() )
784 : : {
785 [ # # ]: 0 : aMtrBackscale.SetEmptyFieldValue();
786 : 0 : bUpdate = sal_True;
787 : : }
788 : : }
789 : : }
790 : :
791 : : // End angle
792 [ # # ][ # # ]: 0 : if( aMtrEndAngle.IsEnabled() )
793 : : {
794 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_END_ANGLE);
795 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
796 : : {
797 [ # # ]: 0 : sal_Int32 nValue = ((const Svx3DEndAngleItem&)rAttrs.Get(SDRATTR_3DOBJ_END_ANGLE)).GetValue();
798 [ # # ][ # # ]: 0 : if( nValue != aMtrEndAngle.GetValue() )
799 : : {
800 [ # # ]: 0 : aMtrEndAngle.SetValue( nValue );
801 : 0 : bUpdate = sal_True;
802 : : }
803 : : }
804 : : else
805 : : {
806 [ # # ][ # # ]: 0 : if( !aMtrEndAngle.IsEmptyFieldValue() )
807 : : {
808 [ # # ]: 0 : aMtrEndAngle.SetEmptyFieldValue();
809 : 0 : bUpdate = sal_True;
810 : : }
811 : : }
812 : : }
813 : :
814 : : // Normal type
815 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_NORMALS_KIND);
816 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
817 : : {
818 [ # # ]: 0 : sal_uInt16 nValue = ((const Svx3DNormalsKindItem&)rAttrs.Get(SDRATTR_3DOBJ_NORMALS_KIND)).GetValue();
819 : :
820 [ # # ][ # # ]: 0 : if( ( !aBtnNormalsObj.IsChecked() && nValue == 0 ) ||
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
821 [ # # ]: 0 : ( !aBtnNormalsFlat.IsChecked() && nValue == 1 ) ||
822 [ # # ]: 0 : ( !aBtnNormalsSphere.IsChecked() && nValue == 2 ) )
823 : : {
824 [ # # ]: 0 : aBtnNormalsObj.Check( nValue == 0 );
825 [ # # ]: 0 : aBtnNormalsFlat.Check( nValue == 1 );
826 [ # # ]: 0 : aBtnNormalsSphere.Check( nValue == 2 );
827 : 0 : bUpdate = sal_True;
828 : : }
829 : : }
830 : : else
831 : : {
832 [ # # ][ # # ]: 0 : if( aBtnNormalsObj.IsChecked() ||
[ # # ][ # # ]
[ # # ]
833 [ # # ]: 0 : aBtnNormalsFlat.IsChecked() ||
834 [ # # ]: 0 : aBtnNormalsSphere.IsChecked() )
835 : : {
836 [ # # ]: 0 : aBtnNormalsObj.Check( sal_False );
837 [ # # ]: 0 : aBtnNormalsFlat.Check( sal_False );
838 [ # # ]: 0 : aBtnNormalsSphere.Check( sal_False );
839 : 0 : bUpdate = sal_True;
840 : : }
841 : : }
842 : :
843 : : // Normal inverted
844 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_NORMALS_INVERT);
845 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
846 : : {
847 [ # # ]: 0 : sal_Bool bValue = ((const Svx3DNormalsInvertItem&)rAttrs.Get(SDRATTR_3DOBJ_NORMALS_INVERT)).GetValue();
848 [ # # ][ # # ]: 0 : if( bValue != aBtnNormalsInvert.IsChecked() )
849 : : {
850 [ # # ]: 0 : aBtnNormalsInvert.Check( bValue );
851 : 0 : bUpdate = sal_True;
852 : : }
853 [ # # ]: 0 : else if( aBtnNormalsInvert.GetState() == STATE_DONTKNOW )
854 [ # # ]: 0 : aBtnNormalsInvert.Check( bValue );
855 : : }
856 : : else
857 : : {
858 [ # # ]: 0 : if( aBtnNormalsInvert.GetState() != STATE_DONTKNOW )
859 : : {
860 [ # # ]: 0 : aBtnNormalsInvert.SetState( STATE_DONTKNOW );
861 : 0 : bUpdate = sal_True;
862 : : }
863 : : }
864 : :
865 : : // 2-sided lighting
866 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING);
867 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
868 : : {
869 [ # # ]: 0 : sal_Bool bValue = ((const Svx3DTwoSidedLightingItem&)rAttrs.Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING)).GetValue();
870 [ # # ][ # # ]: 0 : if( bValue != aBtnTwoSidedLighting.IsChecked() )
871 : : {
872 [ # # ]: 0 : aBtnTwoSidedLighting.Check( bValue );
873 : 0 : bUpdate = sal_True;
874 : : }
875 [ # # ]: 0 : else if( aBtnTwoSidedLighting.GetState() == STATE_DONTKNOW )
876 [ # # ]: 0 : aBtnTwoSidedLighting.Check( bValue );
877 : : }
878 : : else
879 : : {
880 [ # # ]: 0 : if( aBtnTwoSidedLighting.GetState() != STATE_DONTKNOW )
881 : : {
882 [ # # ]: 0 : aBtnTwoSidedLighting.SetState( STATE_DONTKNOW );
883 : 0 : bUpdate = sal_True;
884 : : }
885 : : }
886 : :
887 : : // Representation
888 : : // Shademode
889 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_SHADE_MODE);
890 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
891 : : {
892 [ # # ]: 0 : sal_uInt16 nValue = ((const Svx3DShadeModeItem&)rAttrs.Get(SDRATTR_3DSCENE_SHADE_MODE)).GetValue();
893 [ # # ][ # # ]: 0 : if( nValue != aLbShademode.GetSelectEntryPos() )
894 : : {
895 [ # # ]: 0 : aLbShademode.SelectEntryPos( nValue );
896 : 0 : bUpdate = sal_True;
897 : : }
898 : : }
899 : : else
900 : : {
901 [ # # ][ # # ]: 0 : if( aLbShademode.GetSelectEntryCount() != 0 )
902 : : {
903 [ # # ]: 0 : aLbShademode.SetNoSelection();
904 : 0 : bUpdate = sal_True;
905 : : }
906 : : }
907 : :
908 : : // 3D-Shadow
909 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_SHADOW_3D);
910 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
911 : : {
912 [ # # ]: 0 : sal_Bool bValue = ((const Svx3DShadow3DItem&)rAttrs.Get(SDRATTR_3DOBJ_SHADOW_3D)).GetValue();
913 [ # # ][ # # ]: 0 : if( bValue != aBtnShadow3d.IsChecked() )
914 : : {
915 [ # # ]: 0 : aBtnShadow3d.Check( bValue );
916 [ # # ]: 0 : aFtSlant.Enable( bValue );
917 [ # # ]: 0 : aMtrSlant.Enable( bValue );
918 : 0 : bUpdate = sal_True;
919 : : }
920 [ # # ]: 0 : else if( aBtnShadow3d.GetState() == STATE_DONTKNOW )
921 [ # # ]: 0 : aBtnShadow3d.Check( bValue );
922 : : }
923 : : else
924 : : {
925 [ # # ]: 0 : if( aBtnShadow3d.GetState() != STATE_DONTKNOW )
926 : : {
927 [ # # ]: 0 : aBtnShadow3d.SetState( STATE_DONTKNOW );
928 : 0 : bUpdate = sal_True;
929 : : }
930 : : }
931 : :
932 : : // Inclination (Shadow)
933 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_SHADOW_SLANT);
934 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
935 : : {
936 [ # # ]: 0 : sal_uInt16 nValue = ((const Svx3DShadowSlantItem&)rAttrs.Get(SDRATTR_3DSCENE_SHADOW_SLANT)).GetValue();
937 [ # # ][ # # ]: 0 : if( nValue != aMtrSlant.GetValue() )
938 : : {
939 [ # # ]: 0 : aMtrSlant.SetValue( nValue );
940 : 0 : bUpdate = sal_True;
941 : : }
942 : : }
943 : : else
944 : : {
945 [ # # ][ # # ]: 0 : if( !aMtrSlant.IsEmptyFieldValue() )
946 : : {
947 [ # # ]: 0 : aMtrSlant.SetEmptyFieldValue();
948 : 0 : bUpdate = sal_True;
949 : : }
950 : : }
951 : :
952 : : // Distance
953 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_DISTANCE);
954 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
955 : : {
956 [ # # ]: 0 : sal_uInt32 nValue = ((const Svx3DDistanceItem&)rAttrs.Get(SDRATTR_3DSCENE_DISTANCE)).GetValue();
957 [ # # ]: 0 : sal_uInt32 nValue2 = GetCoreValue( aMtrDistance, ePoolUnit );
958 [ # # ]: 0 : if( nValue != nValue2 )
959 : : {
960 [ # # ]: 0 : if( eFUnit != aMtrDistance.GetUnit() )
961 [ # # ]: 0 : SetFieldUnit( aMtrDistance, eFUnit );
962 : :
963 [ # # ]: 0 : SetMetricValue( aMtrDistance, nValue, ePoolUnit );
964 : 0 : bUpdate = sal_True;
965 : : }
966 : : }
967 : : else
968 : : {
969 [ # # ][ # # ]: 0 : if( !aMtrDepth.IsEmptyFieldValue() )
970 : : {
971 [ # # ]: 0 : aMtrDepth.SetEmptyFieldValue();
972 : 0 : bUpdate = sal_True;
973 : : }
974 : : }
975 : :
976 : : // Focal length
977 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_FOCAL_LENGTH);
978 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
979 : : {
980 [ # # ]: 0 : sal_uInt32 nValue = ((const Svx3DFocalLengthItem&)rAttrs.Get(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue();
981 [ # # ]: 0 : sal_uInt32 nValue2 = GetCoreValue( aMtrFocalLength, ePoolUnit );
982 [ # # ]: 0 : if( nValue != nValue2 )
983 : : {
984 [ # # ]: 0 : if( eFUnit != aMtrFocalLength.GetUnit() )
985 [ # # ]: 0 : SetFieldUnit( aMtrFocalLength, eFUnit );
986 : :
987 [ # # ]: 0 : SetMetricValue( aMtrFocalLength, nValue, ePoolUnit );
988 : 0 : bUpdate = sal_True;
989 : : }
990 : : }
991 : : else
992 : : {
993 [ # # ][ # # ]: 0 : if( !aMtrFocalLength.IsEmptyFieldValue() )
994 : : {
995 [ # # ]: 0 : aMtrFocalLength.SetEmptyFieldValue();
996 : 0 : bUpdate = sal_True;
997 : : }
998 : : }
999 : :
1000 : : // Lighting
1001 : 0 : Color aColor;
1002 : 0 : basegfx::B3DVector aVector;
1003 : : // Light 1 (Color)
1004 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_1);
1005 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1006 : : {
1007 [ # # ]: 0 : aColor = ((const Svx3DLightcolor1Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue();
1008 : 0 : ColorLB* pLb = &aLbLight1;
1009 [ # # ][ # # ]: 0 : if( aColor != pLb->GetSelectEntryColor() )
1010 : : {
1011 [ # # ]: 0 : LBSelectColor( pLb, aColor );
1012 : 0 : bUpdate = sal_True;
1013 : : }
1014 : : }
1015 : : else
1016 : : {
1017 [ # # ][ # # ]: 0 : if( aLbLight1.GetSelectEntryCount() != 0 )
1018 : : {
1019 [ # # ]: 0 : aLbLight1.SetNoSelection();
1020 : 0 : bUpdate = sal_True;
1021 : : }
1022 : : }
1023 : : // Light 1 (on/off)
1024 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_1);
1025 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1026 : : {
1027 [ # # ]: 0 : bool bOn = ((const Svx3DLightOnOff1Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue() != 0;
1028 [ # # ][ # # ]: 0 : if( ( bOn && !GetUILightState( aBtnLight1 )) ||
[ # # ][ # # ]
[ # # ][ # # ]
1029 [ # # ]: 0 : ( !bOn && GetUILightState( aBtnLight1 )) )
1030 : : {
1031 [ # # ]: 0 : SetUILightState( aBtnLight1, bOn );
1032 : 0 : bUpdate = sal_True;
1033 : : }
1034 [ # # ]: 0 : if( aBtnLight1.GetState() == STATE_DONTKNOW )
1035 [ # # ][ # # ]: 0 : aBtnLight1.Check( aBtnLight1.IsChecked() );
1036 : : }
1037 : : else
1038 : : {
1039 [ # # ]: 0 : if( aBtnLight1.GetState() != STATE_DONTKNOW )
1040 : : {
1041 [ # # ]: 0 : aBtnLight1.SetState( STATE_DONTKNOW );
1042 : 0 : bUpdate = sal_True;
1043 : : }
1044 : : }
1045 : : // Light 1 (direction)
1046 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_1);
1047 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1048 : : {
1049 : 0 : bUpdate = sal_True;
1050 : : }
1051 : :
1052 : : //Light 2 (color)
1053 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_2);
1054 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1055 : : {
1056 [ # # ]: 0 : aColor = ((const Svx3DLightcolor2Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue();
1057 : 0 : ColorLB* pLb = &aLbLight2;
1058 [ # # ][ # # ]: 0 : if( aColor != pLb->GetSelectEntryColor() )
1059 : : {
1060 [ # # ]: 0 : LBSelectColor( pLb, aColor );
1061 : 0 : bUpdate = sal_True;
1062 : : }
1063 : : }
1064 : : else
1065 : : {
1066 [ # # ][ # # ]: 0 : if( aLbLight2.GetSelectEntryCount() != 0 )
1067 : : {
1068 [ # # ]: 0 : aLbLight2.SetNoSelection();
1069 : 0 : bUpdate = sal_True;
1070 : : }
1071 : : }
1072 : : // Light 2 (on/off)
1073 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_2);
1074 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1075 : : {
1076 [ # # ]: 0 : bool bOn = ((const Svx3DLightOnOff2Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue() != 0;
1077 [ # # ][ # # ]: 0 : if( ( bOn && !GetUILightState( aBtnLight2 )) ||
[ # # ][ # # ]
[ # # ][ # # ]
1078 [ # # ]: 0 : ( !bOn && GetUILightState( aBtnLight2 )) )
1079 : : {
1080 [ # # ]: 0 : SetUILightState( aBtnLight2, bOn );
1081 : 0 : bUpdate = sal_True;
1082 : : }
1083 [ # # ]: 0 : if( aBtnLight2.GetState() == STATE_DONTKNOW )
1084 [ # # ][ # # ]: 0 : aBtnLight2.Check( aBtnLight2.IsChecked() );
1085 : : }
1086 : : else
1087 : : {
1088 [ # # ]: 0 : if( aBtnLight2.GetState() != STATE_DONTKNOW )
1089 : : {
1090 [ # # ]: 0 : aBtnLight2.SetState( STATE_DONTKNOW );
1091 : 0 : bUpdate = sal_True;
1092 : : }
1093 : : }
1094 : : //Light 2 (Direction)
1095 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_2);
1096 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1097 : : {
1098 : 0 : bUpdate = sal_True;
1099 : : }
1100 : :
1101 : : //Light 3 (color)
1102 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_3);
1103 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1104 : : {
1105 [ # # ]: 0 : aColor = ((const Svx3DLightcolor3Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue();
1106 : 0 : ColorLB* pLb = &aLbLight3;
1107 [ # # ][ # # ]: 0 : if( aColor != pLb->GetSelectEntryColor() )
1108 : : {
1109 [ # # ]: 0 : LBSelectColor( pLb, aColor );
1110 : 0 : bUpdate = sal_True;
1111 : : }
1112 : : }
1113 : : else
1114 : : {
1115 [ # # ][ # # ]: 0 : if( aLbLight3.GetSelectEntryCount() != 0 )
1116 : : {
1117 [ # # ]: 0 : aLbLight3.SetNoSelection();
1118 : 0 : bUpdate = sal_True;
1119 : : }
1120 : : }
1121 : : // Ligh 3 (on/off)
1122 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_3);
1123 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1124 : : {
1125 [ # # ]: 0 : bool bOn = ((const Svx3DLightOnOff3Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue() != 0;
1126 [ # # ][ # # ]: 0 : if( ( bOn && !GetUILightState( aBtnLight3)) ||
[ # # ][ # # ]
[ # # ][ # # ]
1127 [ # # ]: 0 : ( !bOn && GetUILightState( aBtnLight3)) )
1128 : : {
1129 [ # # ]: 0 : SetUILightState( aBtnLight3, bOn );
1130 : 0 : bUpdate = sal_True;
1131 : : }
1132 [ # # ]: 0 : if( aBtnLight3.GetState() == STATE_DONTKNOW )
1133 [ # # ][ # # ]: 0 : aBtnLight3.Check( aBtnLight3.IsChecked() );
1134 : : }
1135 : : else
1136 : : {
1137 [ # # ]: 0 : if( aBtnLight3.GetState() != STATE_DONTKNOW )
1138 : : {
1139 [ # # ]: 0 : aBtnLight3.SetState( STATE_DONTKNOW );
1140 : 0 : bUpdate = sal_True;
1141 : : }
1142 : : }
1143 : : // Light 3 (Direction)
1144 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_3);
1145 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1146 : : {
1147 : 0 : bUpdate = sal_True;
1148 : : }
1149 : :
1150 : : // Light 4 (Color)
1151 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_4);
1152 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1153 : : {
1154 [ # # ]: 0 : aColor = ((const Svx3DLightcolor4Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue();
1155 : 0 : ColorLB* pLb = &aLbLight4;
1156 [ # # ][ # # ]: 0 : if( aColor != pLb->GetSelectEntryColor() )
1157 : : {
1158 [ # # ]: 0 : LBSelectColor( pLb, aColor );
1159 : 0 : bUpdate = sal_True;
1160 : : }
1161 : : }
1162 : : else
1163 : : {
1164 [ # # ][ # # ]: 0 : if( aLbLight4.GetSelectEntryCount() != 0 )
1165 : : {
1166 [ # # ]: 0 : aLbLight4.SetNoSelection();
1167 : 0 : bUpdate = sal_True;
1168 : : }
1169 : : }
1170 : : // Light 4 (on/off)
1171 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_4);
1172 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1173 : : {
1174 [ # # ]: 0 : bool bOn = ((const Svx3DLightOnOff4Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue() != 0;
1175 [ # # ][ # # ]: 0 : if( ( bOn && !GetUILightState( aBtnLight4 )) ||
[ # # ][ # # ]
[ # # ][ # # ]
1176 [ # # ]: 0 : ( !bOn && GetUILightState( aBtnLight4 )) )
1177 : : {
1178 [ # # ]: 0 : SetUILightState( aBtnLight4, bOn );
1179 : 0 : bUpdate = sal_True;
1180 : : }
1181 [ # # ]: 0 : if( aBtnLight4.GetState() == STATE_DONTKNOW )
1182 [ # # ][ # # ]: 0 : aBtnLight4.Check( aBtnLight4.IsChecked() );
1183 : : }
1184 : : else
1185 : : {
1186 [ # # ]: 0 : if( aBtnLight4.GetState() != STATE_DONTKNOW )
1187 : : {
1188 [ # # ]: 0 : aBtnLight4.SetState( STATE_DONTKNOW );
1189 : 0 : bUpdate = sal_True;
1190 : : }
1191 : : }
1192 : : // Light 4 (direction)
1193 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_4);
1194 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1195 : : {
1196 : 0 : bUpdate = sal_True;
1197 : : }
1198 : :
1199 : : // Light 5 (color)
1200 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_5);
1201 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1202 : : {
1203 [ # # ]: 0 : aColor = ((const Svx3DLightcolor5Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue();
1204 : 0 : ColorLB* pLb = &aLbLight5;
1205 [ # # ][ # # ]: 0 : if( aColor != pLb->GetSelectEntryColor() )
1206 : : {
1207 [ # # ]: 0 : LBSelectColor( pLb, aColor );
1208 : 0 : bUpdate = sal_True;
1209 : : }
1210 : : }
1211 : : else
1212 : : {
1213 [ # # ][ # # ]: 0 : if( aLbLight5.GetSelectEntryCount() != 0 )
1214 : : {
1215 [ # # ]: 0 : aLbLight5.SetNoSelection();
1216 : 0 : bUpdate = sal_True;
1217 : : }
1218 : : }
1219 : : // Light 5 (on/off)
1220 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_5);
1221 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1222 : : {
1223 [ # # ]: 0 : bool bOn = ((const Svx3DLightOnOff5Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue() != 0;
1224 [ # # ][ # # ]: 0 : if( ( bOn && !GetUILightState( aBtnLight5 )) ||
[ # # ][ # # ]
[ # # ][ # # ]
1225 [ # # ]: 0 : ( !bOn && GetUILightState( aBtnLight5 )) )
1226 : : {
1227 [ # # ]: 0 : SetUILightState( aBtnLight5, bOn );
1228 : 0 : bUpdate = sal_True;
1229 : : }
1230 [ # # ]: 0 : if( aBtnLight5.GetState() == STATE_DONTKNOW )
1231 [ # # ][ # # ]: 0 : aBtnLight5.Check( aBtnLight5.IsChecked() );
1232 : : }
1233 : : else
1234 : : {
1235 [ # # ]: 0 : if( aBtnLight5.GetState() != STATE_DONTKNOW )
1236 : : {
1237 [ # # ]: 0 : aBtnLight5.SetState( STATE_DONTKNOW );
1238 : 0 : bUpdate = sal_True;
1239 : : }
1240 : : }
1241 : : // Light 5 (direction)
1242 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_5);
1243 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1244 : : {
1245 : 0 : bUpdate = sal_True;
1246 : : }
1247 : :
1248 : : // Light 6 (color)
1249 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_6);
1250 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1251 : : {
1252 [ # # ]: 0 : aColor = ((const Svx3DLightcolor6Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue();
1253 : 0 : ColorLB* pLb = &aLbLight6;
1254 [ # # ][ # # ]: 0 : if( aColor != pLb->GetSelectEntryColor() )
1255 : : {
1256 [ # # ]: 0 : LBSelectColor( pLb, aColor );
1257 : 0 : bUpdate = sal_True;
1258 : : }
1259 : : }
1260 : : else
1261 : : {
1262 [ # # ][ # # ]: 0 : if( aLbLight6.GetSelectEntryCount() != 0 )
1263 : : {
1264 [ # # ]: 0 : aLbLight6.SetNoSelection();
1265 : 0 : bUpdate = sal_True;
1266 : : }
1267 : : }
1268 : : // Light 6 (on/off)
1269 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_6);
1270 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1271 : : {
1272 [ # # ]: 0 : bool bOn = ((const Svx3DLightOnOff6Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue() != 0;
1273 [ # # ][ # # ]: 0 : if( ( bOn && !GetUILightState( aBtnLight6 )) ||
[ # # ][ # # ]
[ # # ][ # # ]
1274 [ # # ]: 0 : ( !bOn && GetUILightState( aBtnLight6 )) )
1275 : : {
1276 [ # # ]: 0 : SetUILightState( aBtnLight6, bOn );
1277 : 0 : bUpdate = sal_True;
1278 : : }
1279 [ # # ]: 0 : if( aBtnLight6.GetState() == STATE_DONTKNOW )
1280 [ # # ][ # # ]: 0 : aBtnLight6.Check( aBtnLight6.IsChecked() );
1281 : : }
1282 : : else
1283 : : {
1284 [ # # ]: 0 : if( aBtnLight6.GetState() != STATE_DONTKNOW )
1285 : : {
1286 [ # # ]: 0 : aBtnLight6.SetState( STATE_DONTKNOW );
1287 : 0 : bUpdate = sal_True;
1288 : : }
1289 : : }
1290 : : // Light 6 (direction)
1291 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_6);
1292 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1293 : : {
1294 : 0 : bUpdate = sal_True;
1295 : : }
1296 : :
1297 : : // Light 7 (color)
1298 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_7);
1299 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1300 : : {
1301 [ # # ]: 0 : aColor = ((const Svx3DLightcolor7Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue();
1302 : 0 : ColorLB* pLb = &aLbLight7;
1303 [ # # ][ # # ]: 0 : if( aColor != pLb->GetSelectEntryColor() )
1304 : : {
1305 [ # # ]: 0 : LBSelectColor( pLb, aColor );
1306 : 0 : bUpdate = sal_True;
1307 : : }
1308 : : }
1309 : : else
1310 : : {
1311 [ # # ][ # # ]: 0 : if( aLbLight7.GetSelectEntryCount() != 0 )
1312 : : {
1313 [ # # ]: 0 : aLbLight7.SetNoSelection();
1314 : 0 : bUpdate = sal_True;
1315 : : }
1316 : : }
1317 : : // Light 7 (on/off)
1318 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_7);
1319 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1320 : : {
1321 [ # # ]: 0 : bool bOn = ((const Svx3DLightOnOff7Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue() != 0;
1322 [ # # ][ # # ]: 0 : if( ( bOn && !GetUILightState( aBtnLight7 )) ||
[ # # ][ # # ]
[ # # ][ # # ]
1323 [ # # ]: 0 : ( !bOn && GetUILightState( aBtnLight7 )) )
1324 : : {
1325 [ # # ]: 0 : SetUILightState( aBtnLight7 , bOn );
1326 : 0 : bUpdate = sal_True;
1327 : : }
1328 [ # # ]: 0 : if( aBtnLight7.GetState() == STATE_DONTKNOW )
1329 [ # # ][ # # ]: 0 : aBtnLight7.Check( aBtnLight7.IsChecked() );
1330 : : }
1331 : : else
1332 : : {
1333 [ # # ]: 0 : if( aBtnLight7.GetState() != STATE_DONTKNOW )
1334 : : {
1335 [ # # ]: 0 : aBtnLight7.SetState( STATE_DONTKNOW );
1336 : 0 : bUpdate = sal_True;
1337 : : }
1338 : : }
1339 : : // Light 7 (direction)
1340 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_7);
1341 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1342 : : {
1343 : 0 : bUpdate = sal_True;
1344 : : }
1345 : :
1346 : : // Light 8 (color)
1347 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_8);
1348 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1349 : : {
1350 [ # # ]: 0 : aColor = ((const Svx3DLightcolor8Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue();
1351 : 0 : ColorLB* pLb = &aLbLight8;
1352 [ # # ][ # # ]: 0 : if( aColor != pLb->GetSelectEntryColor() )
1353 : : {
1354 [ # # ]: 0 : LBSelectColor( pLb, aColor );
1355 : 0 : bUpdate = sal_True;
1356 : : }
1357 : : }
1358 : : else
1359 : : {
1360 [ # # ][ # # ]: 0 : if( aLbLight8.GetSelectEntryCount() != 0 )
1361 : : {
1362 [ # # ]: 0 : aLbLight8.SetNoSelection();
1363 : 0 : bUpdate = sal_True;
1364 : : }
1365 : : }
1366 : : // Light 8 (on/off)
1367 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_8);
1368 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1369 : : {
1370 [ # # ]: 0 : bool bOn = ((const Svx3DLightOnOff8Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue() != 0;
1371 [ # # ][ # # ]: 0 : if( ( bOn && !GetUILightState( aBtnLight8 )) ||
[ # # ][ # # ]
[ # # ][ # # ]
1372 [ # # ]: 0 : ( !bOn && GetUILightState( aBtnLight8 )) )
1373 : : {
1374 [ # # ]: 0 : SetUILightState( aBtnLight8, bOn );
1375 : 0 : bUpdate = sal_True;
1376 : : }
1377 [ # # ]: 0 : if( aBtnLight8.GetState() == STATE_DONTKNOW )
1378 [ # # ][ # # ]: 0 : aBtnLight8.Check( aBtnLight8.IsChecked() );
1379 : : }
1380 : : else
1381 : : {
1382 [ # # ]: 0 : if( aBtnLight8.GetState() != STATE_DONTKNOW )
1383 : : {
1384 [ # # ]: 0 : aBtnLight8.SetState( STATE_DONTKNOW );
1385 : 0 : bUpdate = sal_True;
1386 : : }
1387 : : }
1388 : : // Light 8 (direction)
1389 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_8);
1390 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1391 : : {
1392 : 0 : bUpdate = sal_True;
1393 : : }
1394 : :
1395 : : // Ambient light
1396 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_AMBIENTCOLOR);
1397 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1398 : : {
1399 [ # # ]: 0 : aColor = ((const Svx3DAmbientcolorItem&)rAttrs.Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue();
1400 : 0 : ColorLB* pLb = &aLbAmbientlight;
1401 [ # # ][ # # ]: 0 : if( aColor != pLb->GetSelectEntryColor() )
1402 : : {
1403 [ # # ]: 0 : LBSelectColor( pLb, aColor );
1404 : 0 : bUpdate = sal_True;
1405 : : }
1406 : : }
1407 : : else
1408 : : {
1409 [ # # ][ # # ]: 0 : if( aLbAmbientlight.GetSelectEntryCount() != 0 )
1410 : : {
1411 [ # # ]: 0 : aLbAmbientlight.SetNoSelection();
1412 : 0 : bUpdate = sal_True;
1413 : : }
1414 : : }
1415 : :
1416 : :
1417 : : // Textures
1418 : : // Art
1419 [ # # ]: 0 : if( bBitmap )
1420 : : {
1421 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_KIND);
1422 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1423 : : {
1424 [ # # ]: 0 : sal_uInt16 nValue = ((const Svx3DTextureKindItem&)rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_KIND)).GetValue();
1425 : :
1426 [ # # ][ # # ]: 0 : if( ( !aBtnTexLuminance.IsChecked() && nValue == 1 ) ||
[ # # ][ # # ]
[ # # ][ # # ]
1427 [ # # ]: 0 : ( !aBtnTexColor.IsChecked() && nValue == 3 ) )
1428 : : {
1429 [ # # ]: 0 : aBtnTexLuminance.Check( nValue == 1 );
1430 [ # # ]: 0 : aBtnTexColor.Check( nValue == 3 );
1431 : 0 : bUpdate = sal_True;
1432 : : }
1433 : : }
1434 : : else
1435 : : {
1436 [ # # ][ # # ]: 0 : if( aBtnTexLuminance.IsChecked() ||
[ # # ][ # # ]
1437 [ # # ]: 0 : aBtnTexColor.IsChecked() )
1438 : : {
1439 [ # # ]: 0 : aBtnTexLuminance.Check( sal_False );
1440 [ # # ]: 0 : aBtnTexColor.Check( sal_False );
1441 : 0 : bUpdate = sal_True;
1442 : : }
1443 : : }
1444 : :
1445 : : // Mode
1446 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_MODE);
1447 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1448 : : {
1449 [ # # ]: 0 : sal_uInt16 nValue = ((const Svx3DTextureModeItem&)rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_MODE)).GetValue();
1450 : :
1451 [ # # ][ # # ]: 0 : if( ( !aBtnTexReplace.IsChecked() && nValue == 1 ) ||
[ # # ][ # # ]
[ # # ][ # # ]
1452 [ # # ]: 0 : ( !aBtnTexModulate.IsChecked() && nValue == 2 ) )
1453 : : {
1454 [ # # ]: 0 : aBtnTexReplace.Check( nValue == 1 );
1455 [ # # ]: 0 : aBtnTexModulate.Check( nValue == 2 );
1456 : 0 : bUpdate = sal_True;
1457 : : }
1458 : : }
1459 : : else
1460 : : {
1461 [ # # ][ # # ]: 0 : if( aBtnTexReplace.IsChecked() ||
[ # # ][ # # ]
1462 [ # # ]: 0 : aBtnTexModulate.IsChecked() )
1463 : : {
1464 [ # # ]: 0 : aBtnTexReplace.Check( sal_False );
1465 [ # # ]: 0 : aBtnTexModulate.Check( sal_False );
1466 : 0 : bUpdate = sal_True;
1467 : : }
1468 : : }
1469 : :
1470 : : // Projection X
1471 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_PROJ_X);
1472 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1473 : : {
1474 [ # # ]: 0 : sal_uInt16 nValue = ((const Svx3DTextureProjectionXItem&)rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_PROJ_X)).GetValue();
1475 : :
1476 [ # # ][ # # ]: 0 : if( ( !aBtnTexObjectX.IsChecked() && nValue == 0 ) ||
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
1477 [ # # ]: 0 : ( !aBtnTexParallelX.IsChecked() && nValue == 1 ) ||
1478 [ # # ]: 0 : ( !aBtnTexCircleX.IsChecked() && nValue == 2 ) )
1479 : : {
1480 [ # # ]: 0 : aBtnTexObjectX.Check( nValue == 0 );
1481 [ # # ]: 0 : aBtnTexParallelX.Check( nValue == 1 );
1482 [ # # ]: 0 : aBtnTexCircleX.Check( nValue == 2 );
1483 : 0 : bUpdate = sal_True;
1484 : : }
1485 : : }
1486 : : else
1487 : : {
1488 [ # # ][ # # ]: 0 : if( aBtnTexObjectX.IsChecked() ||
[ # # ][ # # ]
[ # # ]
1489 [ # # ]: 0 : aBtnTexParallelX.IsChecked() ||
1490 [ # # ]: 0 : aBtnTexCircleX.IsChecked() )
1491 : : {
1492 [ # # ]: 0 : aBtnTexObjectX.Check( sal_False );
1493 [ # # ]: 0 : aBtnTexParallelX.Check( sal_False );
1494 [ # # ]: 0 : aBtnTexCircleX.Check( sal_False );
1495 : 0 : bUpdate = sal_True;
1496 : : }
1497 : : }
1498 : :
1499 : : // Projection Y
1500 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_PROJ_Y);
1501 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1502 : : {
1503 [ # # ]: 0 : sal_uInt16 nValue = ((const Svx3DTextureProjectionYItem&)rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_PROJ_Y)).GetValue();
1504 : :
1505 [ # # ][ # # ]: 0 : if( ( !aBtnTexObjectY.IsChecked() && nValue == 0 ) ||
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
1506 [ # # ]: 0 : ( !aBtnTexParallelY.IsChecked() && nValue == 1 ) ||
1507 [ # # ]: 0 : ( !aBtnTexCircleY.IsChecked() && nValue == 2 ) )
1508 : : {
1509 [ # # ]: 0 : aBtnTexObjectY.Check( nValue == 0 );
1510 [ # # ]: 0 : aBtnTexParallelY.Check( nValue == 1 );
1511 [ # # ]: 0 : aBtnTexCircleY.Check( nValue == 2 );
1512 : 0 : bUpdate = sal_True;
1513 : : }
1514 : : }
1515 : : else
1516 : : {
1517 [ # # ][ # # ]: 0 : if( aBtnTexObjectY.IsChecked() ||
[ # # ][ # # ]
[ # # ]
1518 [ # # ]: 0 : aBtnTexParallelY.IsChecked() ||
1519 [ # # ]: 0 : aBtnTexCircleY.IsChecked() )
1520 : : {
1521 [ # # ]: 0 : aBtnTexObjectY.Check( sal_False );
1522 [ # # ]: 0 : aBtnTexParallelY.Check( sal_False );
1523 [ # # ]: 0 : aBtnTexCircleY.Check( sal_False );
1524 : 0 : bUpdate = sal_True;
1525 : : }
1526 : : }
1527 : :
1528 : : // Filter
1529 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_FILTER);
1530 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1531 : : {
1532 [ # # ]: 0 : sal_Bool bValue = ((const Svx3DTextureFilterItem&)rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_FILTER)).GetValue();
1533 [ # # ][ # # ]: 0 : if( bValue != aBtnTexFilter.IsChecked() )
1534 : : {
1535 [ # # ]: 0 : aBtnTexFilter.Check( bValue );
1536 : 0 : bUpdate = sal_True;
1537 : : }
1538 [ # # ]: 0 : if( aBtnTexFilter.GetState() == STATE_DONTKNOW )
1539 [ # # ]: 0 : aBtnTexFilter.Check( bValue );
1540 : : }
1541 : : else
1542 : : {
1543 [ # # ]: 0 : if( aBtnTexFilter.GetState() != STATE_DONTKNOW )
1544 : : {
1545 [ # # ]: 0 : aBtnTexFilter.SetState( STATE_DONTKNOW );
1546 : 0 : bUpdate = sal_True;
1547 : : }
1548 : : }
1549 : : }
1550 : :
1551 : :
1552 : : // Material Favorites
1553 [ # # ]: 0 : aLbMatFavorites.SelectEntryPos( 0 );
1554 : :
1555 : : // Object color
1556 [ # # ]: 0 : eState = rAttrs.GetItemState(XATTR_FILLCOLOR);
1557 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1558 : : {
1559 [ # # ][ # # ]: 0 : aColor = ((const XFillColorItem&)rAttrs.Get(XATTR_FILLCOLOR)).GetColorValue();
1560 : 0 : ColorLB* pLb = &aLbMatColor;
1561 [ # # ][ # # ]: 0 : if( aColor != pLb->GetSelectEntryColor() )
1562 : : {
1563 [ # # ]: 0 : LBSelectColor( pLb, aColor );
1564 : 0 : bUpdate = sal_True;
1565 : : }
1566 : : }
1567 : : else
1568 : : {
1569 [ # # ][ # # ]: 0 : if( aLbMatColor.GetSelectEntryCount() != 0 )
1570 : : {
1571 [ # # ]: 0 : aLbMatColor.SetNoSelection();
1572 : 0 : bUpdate = sal_True;
1573 : : }
1574 : : }
1575 : :
1576 : : // Self-luminous color
1577 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_MAT_EMISSION);
1578 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1579 : : {
1580 [ # # ]: 0 : aColor = ((const Svx3DMaterialEmissionItem&)rAttrs.Get(SDRATTR_3DOBJ_MAT_EMISSION)).GetValue();
1581 : 0 : ColorLB* pLb = &aLbMatEmission;
1582 [ # # ][ # # ]: 0 : if( aColor != pLb->GetSelectEntryColor() )
1583 : : {
1584 [ # # ]: 0 : LBSelectColor( pLb, aColor );
1585 : 0 : bUpdate = sal_True;
1586 : : }
1587 : : }
1588 : : else
1589 : : {
1590 [ # # ][ # # ]: 0 : if( aLbMatEmission.GetSelectEntryCount() != 0 )
1591 : : {
1592 [ # # ]: 0 : aLbMatEmission.SetNoSelection();
1593 : 0 : bUpdate = sal_True;
1594 : : }
1595 : : }
1596 : :
1597 : : // Specular
1598 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_MAT_SPECULAR);
1599 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1600 : : {
1601 [ # # ]: 0 : aColor = ((const Svx3DMaterialSpecularItem&)rAttrs.Get(SDRATTR_3DOBJ_MAT_SPECULAR)).GetValue();
1602 : 0 : ColorLB* pLb = &aLbMatSpecular;
1603 [ # # ][ # # ]: 0 : if( aColor != pLb->GetSelectEntryColor() )
1604 : : {
1605 [ # # ]: 0 : LBSelectColor( pLb, aColor );
1606 : 0 : bUpdate = sal_True;
1607 : : }
1608 : : }
1609 : : else
1610 : : {
1611 [ # # ][ # # ]: 0 : if( aLbMatSpecular.GetSelectEntryCount() != 0 )
1612 : : {
1613 [ # # ]: 0 : aLbMatSpecular.SetNoSelection();
1614 : 0 : bUpdate = sal_True;
1615 : : }
1616 : : }
1617 : :
1618 : : // Specular Intensity
1619 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY);
1620 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1621 : : {
1622 [ # # ]: 0 : sal_uInt16 nValue = ((const Svx3DMaterialSpecularIntensityItem&)rAttrs.Get(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY)).GetValue();
1623 [ # # ][ # # ]: 0 : if( nValue != aMtrMatSpecularIntensity.GetValue() )
1624 : : {
1625 [ # # ]: 0 : aMtrMatSpecularIntensity.SetValue( nValue );
1626 : 0 : bUpdate = sal_True;
1627 : : }
1628 : : }
1629 : : else
1630 : : {
1631 [ # # ][ # # ]: 0 : if( !aMtrMatSpecularIntensity.IsEmptyFieldValue() )
1632 : : {
1633 [ # # ]: 0 : aMtrMatSpecularIntensity.SetEmptyFieldValue();
1634 : 0 : bUpdate = sal_True;
1635 : : }
1636 : : }
1637 : :
1638 : :
1639 : : // Other
1640 : : // Perspective
1641 [ # # ]: 0 : eState = rAttrs.GetItemState(SDRATTR_3DSCENE_PERSPECTIVE);
1642 [ # # ]: 0 : if( eState != SFX_ITEM_DONTCARE )
1643 : : {
1644 [ # # ]: 0 : ProjectionType ePT = (ProjectionType)((const Svx3DPerspectiveItem&)rAttrs.Get(SDRATTR_3DSCENE_PERSPECTIVE)).GetValue();
1645 [ # # ][ # # ]: 0 : if( ( !aBtnPerspective.IsChecked() && ePT == PR_PERSPECTIVE ) ||
[ # # ][ # # ]
[ # # ][ # # ]
1646 [ # # ]: 0 : ( aBtnPerspective.IsChecked() && ePT == PR_PARALLEL ) )
1647 : : {
1648 [ # # ]: 0 : aBtnPerspective.Check( ePT == PR_PERSPECTIVE );
1649 : 0 : bUpdate = sal_True;
1650 : : }
1651 [ # # ]: 0 : if( aBtnPerspective.GetState() == STATE_DONTKNOW )
1652 [ # # ]: 0 : aBtnPerspective.Check( ePT == PR_PERSPECTIVE );
1653 : : }
1654 : : else
1655 : : {
1656 [ # # ]: 0 : if( aBtnPerspective.GetState() != STATE_DONTKNOW )
1657 : : {
1658 [ # # ]: 0 : aBtnPerspective.SetState( STATE_DONTKNOW );
1659 : 0 : bUpdate = sal_True;
1660 : : }
1661 : : }
1662 : :
1663 [ # # ][ # # ]: 0 : if( !bUpdate && !bOnly3DChanged )
1664 : : {
1665 : : // however the 2D attributes may be different. Compare these and decide
1666 : :
1667 : 0 : bUpdate = sal_True;
1668 : : }
1669 : :
1670 [ # # ][ # # ]: 0 : if( bUpdate || bOnly3DChanged )
1671 : : {
1672 : : // Update preview
1673 [ # # ]: 0 : SfxItemSet aSet(rAttrs);
1674 : :
1675 : : // set LineStyle hard to XLINE_NONE when it's not set so that
1676 : : // the default (XLINE_SOLID) is not used for 3d preview
1677 [ # # ][ # # ]: 0 : if(SFX_ITEM_SET != aSet.GetItemState(XATTR_LINESTYLE, sal_False))
1678 [ # # ][ # # ]: 0 : aSet.Put(XLineStyleItem(XLINE_NONE));
[ # # ]
1679 : :
1680 : : // set FillColor hard to WHITE when it's SFX_ITEM_DONTCARE so that
1681 : : // the default (Blue7) is not used for 3d preview
1682 [ # # ][ # # ]: 0 : if(SFX_ITEM_DONTCARE == aSet.GetItemState(XATTR_FILLCOLOR, sal_False))
1683 [ # # ][ # # ]: 0 : aSet.Put(XFillColorItem(String(), Color(COL_WHITE)));
[ # # ][ # # ]
[ # # ]
1684 : :
1685 [ # # ]: 0 : aCtlPreview.Set3DAttributes(aSet);
1686 [ # # ]: 0 : aCtlLightPreview.GetSvx3DLightControl().Set3DAttributes(aSet);
1687 : :
1688 : : // try to select light corresponding to active button
1689 : 0 : sal_uInt32 nNumber(0xffffffff);
1690 : :
1691 [ # # ][ # # ]: 0 : if(aBtnLight1.IsChecked())
1692 : 0 : nNumber = 0;
1693 [ # # ][ # # ]: 0 : else if(aBtnLight2.IsChecked())
1694 : 0 : nNumber = 1;
1695 [ # # ][ # # ]: 0 : else if(aBtnLight3.IsChecked())
1696 : 0 : nNumber = 2;
1697 [ # # ][ # # ]: 0 : else if(aBtnLight4.IsChecked())
1698 : 0 : nNumber = 3;
1699 [ # # ][ # # ]: 0 : else if(aBtnLight5.IsChecked())
1700 : 0 : nNumber = 4;
1701 [ # # ][ # # ]: 0 : else if(aBtnLight6.IsChecked())
1702 : 0 : nNumber = 5;
1703 [ # # ][ # # ]: 0 : else if(aBtnLight7.IsChecked())
1704 : 0 : nNumber = 6;
1705 [ # # ][ # # ]: 0 : else if(aBtnLight8.IsChecked())
1706 : 0 : nNumber = 7;
1707 : :
1708 [ # # ]: 0 : if(nNumber != 0xffffffff)
1709 : : {
1710 [ # # ]: 0 : aCtlLightPreview.GetSvx3DLightControl().SelectLight(nNumber);
1711 [ # # ]: 0 : }
1712 : : }
1713 : :
1714 : : // handle state of converts possible
1715 [ # # ]: 0 : aBtnConvertTo3D.Enable(pConvertTo3DItem->GetState());
1716 [ # # ][ # # ]: 0 : aBtnLatheObject.Enable(pConvertTo3DLatheItem->GetState());
1717 : 0 : }
1718 : :
1719 : : // -----------------------------------------------------------------------
1720 : 0 : void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
1721 : : {
1722 : : // get remembered 2d attributes from the dialog
1723 [ # # ]: 0 : if(mpRemember2DAttributes)
1724 : : {
1725 [ # # ]: 0 : SfxWhichIter aIter(*mpRemember2DAttributes);
1726 [ # # ]: 0 : sal_uInt16 nWhich(aIter.FirstWhich());
1727 : :
1728 [ # # ]: 0 : while(nWhich)
1729 : : {
1730 [ # # ]: 0 : SfxItemState eState = mpRemember2DAttributes->GetItemState(nWhich, sal_False);
1731 [ # # ]: 0 : if(SFX_ITEM_DONTCARE == eState)
1732 [ # # ]: 0 : rAttrs.InvalidateItem(nWhich);
1733 [ # # ]: 0 : else if(SFX_ITEM_SET == eState)
1734 [ # # ][ # # ]: 0 : rAttrs.Put(mpRemember2DAttributes->Get(nWhich, sal_False));
1735 : :
1736 [ # # ]: 0 : nWhich = aIter.NextWhich();
1737 [ # # ]: 0 : }
1738 : : }
1739 : :
1740 : : //Others must stand as the front on all sides
1741 : : // Perspective
1742 [ # # ]: 0 : if( aBtnPerspective.GetState() != STATE_DONTKNOW )
1743 : : {
1744 : : sal_uInt16 nValue;
1745 [ # # ][ # # ]: 0 : if( aBtnPerspective.IsChecked() )
1746 : 0 : nValue = PR_PERSPECTIVE;
1747 : : else
1748 : 0 : nValue = PR_PARALLEL;
1749 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DPerspectiveItem(nValue));
[ # # ]
1750 : : }
1751 : : else
1752 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_PERSPECTIVE);
1753 : :
1754 : : // Geometry
1755 : : // Possible determine PoolUnit (in this case this haas not happend in Update() )
1756 [ # # ]: 0 : if( !mpImpl->pPool )
1757 : : {
1758 : : OSL_FAIL( "No Pool in GetAttr()! May be incompatible to drviewsi.cxx ?" );
1759 : 0 : mpImpl->pPool = rAttrs.GetPool();
1760 : : DBG_ASSERT( mpImpl->pPool, "Where is the Pool?" );
1761 [ # # ]: 0 : ePoolUnit = mpImpl->pPool->GetMetric( SID_ATTR_LINE_WIDTH );
1762 : :
1763 [ # # ]: 0 : eFUnit = GetModuleFieldUnit( rAttrs );
1764 : : }
1765 : :
1766 : : // Number of segments (horizontal)
1767 [ # # ][ # # ]: 0 : if( !aNumHorizontal.IsEmptyFieldValue() )
1768 : : {
1769 [ # # ]: 0 : sal_uInt32 nValue = static_cast<sal_uInt32>(aNumHorizontal.GetValue());
1770 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DHorizontalSegmentsItem(nValue));
[ # # ]
1771 : : }
1772 : : else
1773 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_HORZ_SEGS);
1774 : :
1775 : : // Number of segments (vertical)
1776 [ # # ][ # # ]: 0 : if( !aNumVertical.IsEmptyFieldValue() )
1777 : : {
1778 [ # # ]: 0 : sal_uInt32 nValue = static_cast<sal_uInt32>(aNumVertical.GetValue());
1779 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DVerticalSegmentsItem(nValue));
[ # # ]
1780 : : }
1781 : : else
1782 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_VERT_SEGS);
1783 : :
1784 : : // Depth
1785 [ # # ][ # # ]: 0 : if( !aMtrDepth.IsEmptyFieldValue() )
1786 : : {
1787 [ # # ]: 0 : sal_uInt32 nValue = GetCoreValue( aMtrDepth, ePoolUnit );
1788 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DDepthItem(nValue));
[ # # ]
1789 : : }
1790 : : else
1791 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_DEPTH);
1792 : :
1793 : : // Double-sided
1794 : 0 : TriState eState = aBtnDoubleSided.GetState();
1795 [ # # ]: 0 : if( eState != STATE_DONTKNOW )
1796 : : {
1797 : 0 : sal_Bool bValue = STATE_CHECK == eState;
1798 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DDoubleSidedItem(bValue));
[ # # ]
1799 : : }
1800 : : else
1801 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_DOUBLE_SIDED);
1802 : :
1803 : : // Edge rounding
1804 [ # # ][ # # ]: 0 : if( !aMtrPercentDiagonal.IsEmptyFieldValue() )
1805 : : {
1806 [ # # ]: 0 : sal_uInt16 nValue = (sal_uInt16) aMtrPercentDiagonal.GetValue();
1807 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DPercentDiagonalItem(nValue));
[ # # ]
1808 : : }
1809 : : else
1810 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_PERCENT_DIAGONAL);
1811 : :
1812 : : // Depth scale
1813 [ # # ][ # # ]: 0 : if( !aMtrBackscale.IsEmptyFieldValue() )
1814 : : {
1815 [ # # ]: 0 : sal_uInt16 nValue = (sal_uInt16)aMtrBackscale.GetValue();
1816 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DBackscaleItem(nValue));
[ # # ]
1817 : : }
1818 : : else
1819 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_BACKSCALE);
1820 : :
1821 : : // End angle
1822 [ # # ][ # # ]: 0 : if( !aMtrEndAngle.IsEmptyFieldValue() )
1823 : : {
1824 [ # # ]: 0 : sal_uInt16 nValue = (sal_uInt16)aMtrEndAngle.GetValue();
1825 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DEndAngleItem(nValue));
[ # # ]
1826 : : }
1827 : : else
1828 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_END_ANGLE);
1829 : :
1830 : : // Normal type
1831 : 0 : sal_uInt16 nValue = 99;
1832 [ # # ][ # # ]: 0 : if( aBtnNormalsObj.IsChecked() )
1833 : 0 : nValue = 0;
1834 [ # # ][ # # ]: 0 : else if( aBtnNormalsFlat.IsChecked() )
1835 : 0 : nValue = 1;
1836 [ # # ][ # # ]: 0 : else if( aBtnNormalsSphere.IsChecked() )
1837 : 0 : nValue = 2;
1838 : :
1839 [ # # ]: 0 : if( nValue <= 2 )
1840 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DNormalsKindItem(nValue));
[ # # ]
1841 : : else
1842 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_NORMALS_KIND);
1843 : :
1844 : : // Normal inverted
1845 : 0 : eState = aBtnNormalsInvert.GetState();
1846 [ # # ]: 0 : if( eState != STATE_DONTKNOW )
1847 : : {
1848 : 0 : sal_Bool bValue = STATE_CHECK == eState;
1849 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DNormalsInvertItem(bValue));
[ # # ]
1850 : : }
1851 : : else
1852 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_NORMALS_INVERT);
1853 : :
1854 : : // 2-sided lighting
1855 : 0 : eState = aBtnTwoSidedLighting.GetState();
1856 [ # # ]: 0 : if( eState != STATE_DONTKNOW )
1857 : : {
1858 : 0 : sal_Bool bValue = STATE_CHECK == eState;
1859 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DTwoSidedLightingItem(bValue));
[ # # ]
1860 : : }
1861 : : else
1862 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING);
1863 : :
1864 : : // Representation
1865 : : // Shade mode
1866 [ # # ][ # # ]: 0 : if( aLbShademode.GetSelectEntryCount() )
1867 : : {
1868 [ # # ]: 0 : nValue = aLbShademode.GetSelectEntryPos();
1869 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DShadeModeItem(nValue));
[ # # ]
1870 : : }
1871 : : else
1872 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_SHADE_MODE);
1873 : :
1874 : : // 3D-Shadow
1875 : 0 : eState = aBtnShadow3d.GetState();
1876 [ # # ]: 0 : if( eState != STATE_DONTKNOW )
1877 : : {
1878 : 0 : sal_Bool bValue = STATE_CHECK == eState;
1879 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DShadow3DItem(bValue));
[ # # ]
1880 [ # # ][ # # ]: 0 : rAttrs.Put(SdrShadowItem(bValue));
[ # # ]
1881 : : }
1882 : : else
1883 : : {
1884 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_SHADOW_3D);
1885 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_SHADOW);
1886 : : }
1887 : :
1888 : : // Slant (Shadow)
1889 [ # # ][ # # ]: 0 : if( !aMtrSlant.IsEmptyFieldValue() )
1890 : : {
1891 [ # # ]: 0 : sal_uInt16 nValue2 = (sal_uInt16) aMtrSlant.GetValue();
1892 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DShadowSlantItem(nValue2));
[ # # ]
1893 : : }
1894 : : else
1895 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_SHADOW_SLANT);
1896 : :
1897 : : // Distance
1898 [ # # ][ # # ]: 0 : if( !aMtrDistance.IsEmptyFieldValue() )
1899 : : {
1900 [ # # ]: 0 : sal_uInt32 nValue2 = GetCoreValue( aMtrDistance, ePoolUnit );
1901 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DDistanceItem(nValue2));
[ # # ]
1902 : : }
1903 : : else
1904 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_DISTANCE);
1905 : :
1906 : : // Focal length
1907 [ # # ][ # # ]: 0 : if( !aMtrFocalLength.IsEmptyFieldValue() )
1908 : : {
1909 [ # # ]: 0 : sal_uInt32 nValue2 = GetCoreValue( aMtrFocalLength, ePoolUnit );
1910 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DFocalLengthItem(nValue2));
[ # # ]
1911 : : }
1912 : : else
1913 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_FOCAL_LENGTH);
1914 : :
1915 : : // Lighting
1916 [ # # ]: 0 : Image aImg;
1917 : 0 : basegfx::B3DVector aVector;
1918 : 0 : Color aColor;
1919 [ # # ]: 0 : const SfxItemSet aLightItemSet(aCtlLightPreview.GetSvx3DLightControl().Get3DAttributes());
1920 : :
1921 : : // Light 1 color
1922 [ # # ][ # # ]: 0 : if( aLbLight1.GetSelectEntryCount() )
1923 : : {
1924 [ # # ]: 0 : aColor = aLbLight1.GetSelectEntryColor();
1925 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightcolor1Item(aColor));
[ # # ]
1926 : : }
1927 : : else
1928 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_1);
1929 : : // Light 1 (on/off)
1930 : 0 : eState = aBtnLight1.GetState();
1931 [ # # ]: 0 : if( eState != STATE_DONTKNOW )
1932 : : {
1933 [ # # ]: 0 : sal_Bool bValue = GetUILightState( aBtnLight1 );
1934 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightOnOff1Item(bValue));
[ # # ]
1935 : :
1936 : : // Light 1 (direction)
1937 [ # # ]: 0 : if( bValue )
1938 : : {
1939 [ # # ][ # # ]: 0 : rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1));
1940 : : }
1941 : : }
1942 : : else
1943 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_1);
1944 : :
1945 : :
1946 : : // Light 2 color
1947 [ # # ][ # # ]: 0 : if( aLbLight2.GetSelectEntryCount() )
1948 : : {
1949 [ # # ]: 0 : aColor = aLbLight2.GetSelectEntryColor();
1950 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightcolor2Item(aColor));
[ # # ]
1951 : : }
1952 : : else
1953 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_2);
1954 : : // Light 2 (on/off)
1955 : 0 : eState = aBtnLight2.GetState();
1956 [ # # ]: 0 : if( eState != STATE_DONTKNOW )
1957 : : {
1958 [ # # ]: 0 : sal_Bool bValue = GetUILightState( aBtnLight2 );
1959 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightOnOff2Item(bValue));
[ # # ]
1960 : :
1961 : : // Light 2 (direction)
1962 [ # # ]: 0 : if( bValue )
1963 : : {
1964 [ # # ][ # # ]: 0 : rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2));
1965 : : }
1966 : : }
1967 : : else
1968 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_2);
1969 : :
1970 : : // Light 3 color
1971 [ # # ][ # # ]: 0 : if( aLbLight3.GetSelectEntryCount() )
1972 : : {
1973 [ # # ]: 0 : aColor = aLbLight3.GetSelectEntryColor();
1974 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightcolor3Item(aColor));
[ # # ]
1975 : : }
1976 : : else
1977 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_3);
1978 : : // Light 3 (on/off)
1979 : 0 : eState = aBtnLight3.GetState();
1980 [ # # ]: 0 : if( eState != STATE_DONTKNOW )
1981 : : {
1982 [ # # ]: 0 : sal_Bool bValue = GetUILightState( aBtnLight3 );
1983 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightOnOff3Item(bValue));
[ # # ]
1984 : :
1985 : : // Light 3 (direction)
1986 [ # # ]: 0 : if( bValue )
1987 : : {
1988 [ # # ][ # # ]: 0 : rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3));
1989 : : }
1990 : : }
1991 : : else
1992 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_3);
1993 : :
1994 : : // Light 4 color
1995 [ # # ][ # # ]: 0 : if( aLbLight4.GetSelectEntryCount() )
1996 : : {
1997 [ # # ]: 0 : aColor = aLbLight4.GetSelectEntryColor();
1998 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightcolor4Item(aColor));
[ # # ]
1999 : : }
2000 : : else
2001 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_4);
2002 : : // Light 4 (on/off)
2003 : 0 : eState = aBtnLight4.GetState();
2004 [ # # ]: 0 : if( eState != STATE_DONTKNOW )
2005 : : {
2006 [ # # ]: 0 : sal_Bool bValue = GetUILightState( aBtnLight4 );
2007 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightOnOff4Item(bValue));
[ # # ]
2008 : :
2009 : : // Light 4 (direction)
2010 [ # # ]: 0 : if( bValue )
2011 : : {
2012 [ # # ][ # # ]: 0 : rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4));
2013 : : }
2014 : : }
2015 : : else
2016 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_4);
2017 : :
2018 : : // Light 5 color
2019 [ # # ][ # # ]: 0 : if( aLbLight5.GetSelectEntryCount() )
2020 : : {
2021 [ # # ]: 0 : aColor = aLbLight5.GetSelectEntryColor();
2022 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightcolor5Item(aColor));
[ # # ]
2023 : : }
2024 : : else
2025 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_5);
2026 : : // Light 5 (on/off)
2027 : 0 : eState = aBtnLight5.GetState();
2028 [ # # ]: 0 : if( eState != STATE_DONTKNOW )
2029 : : {
2030 [ # # ]: 0 : sal_Bool bValue = GetUILightState( aBtnLight5 );
2031 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightOnOff5Item(bValue));
[ # # ]
2032 : :
2033 : : // Light 5 (direction)
2034 [ # # ]: 0 : if( bValue )
2035 : : {
2036 [ # # ][ # # ]: 0 : rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5));
2037 : : }
2038 : : }
2039 : : else
2040 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_5);
2041 : :
2042 : : // Light 6 color
2043 [ # # ][ # # ]: 0 : if( aLbLight6.GetSelectEntryCount() )
2044 : : {
2045 [ # # ]: 0 : aColor = aLbLight6.GetSelectEntryColor();
2046 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightcolor6Item(aColor));
[ # # ]
2047 : : }
2048 : : else
2049 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_6);
2050 : : // Light 6 (on/off)
2051 : 0 : eState = aBtnLight6.GetState();
2052 [ # # ]: 0 : if( eState != STATE_DONTKNOW )
2053 : : {
2054 [ # # ]: 0 : sal_Bool bValue = GetUILightState( aBtnLight6 );
2055 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightOnOff6Item(bValue));
[ # # ]
2056 : :
2057 : : // Light 6 (direction)
2058 [ # # ]: 0 : if( bValue )
2059 : : {
2060 [ # # ][ # # ]: 0 : rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6));
2061 : : }
2062 : : }
2063 : : else
2064 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_6);
2065 : :
2066 : : // Light 7 color
2067 [ # # ][ # # ]: 0 : if( aLbLight7.GetSelectEntryCount() )
2068 : : {
2069 [ # # ]: 0 : aColor = aLbLight7.GetSelectEntryColor();
2070 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightcolor7Item(aColor));
[ # # ]
2071 : : }
2072 : : else
2073 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_7);
2074 : : // Light 7 (on/off)
2075 : 0 : eState = aBtnLight7.GetState();
2076 [ # # ]: 0 : if( eState != STATE_DONTKNOW )
2077 : : {
2078 [ # # ]: 0 : sal_Bool bValue = GetUILightState( aBtnLight7 );
2079 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightOnOff7Item(bValue));
[ # # ]
2080 : :
2081 : : // Light 7 (direction)
2082 [ # # ]: 0 : if( bValue )
2083 : : {
2084 [ # # ][ # # ]: 0 : rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7));
2085 : : }
2086 : : }
2087 : : else
2088 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_7);
2089 : :
2090 : : // Light 8 color
2091 [ # # ][ # # ]: 0 : if( aLbLight8.GetSelectEntryCount() )
2092 : : {
2093 [ # # ]: 0 : aColor = aLbLight8.GetSelectEntryColor();
2094 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightcolor8Item(aColor));
[ # # ]
2095 : : }
2096 : : else
2097 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_8);
2098 : : // Light 8 (on/off)
2099 : 0 : eState = aBtnLight8.GetState();
2100 [ # # ]: 0 : if( eState != STATE_DONTKNOW )
2101 : : {
2102 [ # # ]: 0 : sal_Bool bValue = GetUILightState( aBtnLight8 );
2103 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DLightOnOff8Item(bValue));
[ # # ]
2104 : :
2105 : : // Light 8 (direction)
2106 [ # # ]: 0 : if( bValue )
2107 : : {
2108 [ # # ][ # # ]: 0 : rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8));
2109 : : }
2110 : : }
2111 : : else
2112 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_8);
2113 : :
2114 : : // Ambient light
2115 [ # # ][ # # ]: 0 : if( aLbAmbientlight.GetSelectEntryCount() )
2116 : : {
2117 [ # # ]: 0 : aColor = aLbAmbientlight.GetSelectEntryColor();
2118 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DAmbientcolorItem(aColor));
[ # # ]
2119 : : }
2120 : : else
2121 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DSCENE_AMBIENTCOLOR);
2122 : :
2123 : : // Textures
2124 : : // Art
2125 : 0 : nValue = 3;
2126 [ # # ][ # # ]: 0 : if( aBtnTexLuminance.IsChecked() )
2127 : 0 : nValue = 1;
2128 [ # # ][ # # ]: 0 : else if( aBtnTexColor.IsChecked() )
2129 : 0 : nValue = 3;
2130 : :
2131 [ # # ][ # # ]: 0 : if( nValue == 1 || nValue == 3 )
2132 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DTextureKindItem(nValue));
[ # # ]
2133 : : else
2134 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_KIND);
2135 : :
2136 : :
2137 : : // Mode
2138 : 0 : nValue = 99;
2139 [ # # ][ # # ]: 0 : if( aBtnTexReplace.IsChecked() )
2140 : 0 : nValue = 1;
2141 [ # # ][ # # ]: 0 : else if( aBtnTexModulate.IsChecked() )
2142 : 0 : nValue = 2;
2143 : :
2144 [ # # ][ # # ]: 0 : if( nValue == 1 || nValue == 2 )
2145 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DTextureModeItem(nValue));
[ # # ]
2146 : : else
2147 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_MODE);
2148 : :
2149 : : // X projection
2150 : 0 : nValue = 99;
2151 [ # # ][ # # ]: 0 : if( aBtnTexObjectX.IsChecked() )
2152 : 0 : nValue = 0;
2153 [ # # ][ # # ]: 0 : else if( aBtnTexParallelX.IsChecked() )
2154 : 0 : nValue = 1;
2155 [ # # ][ # # ]: 0 : else if( aBtnTexCircleX.IsChecked() )
2156 : 0 : nValue = 2;
2157 : :
2158 [ # # ]: 0 : if( nValue <= 2 )
2159 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DTextureProjectionXItem(nValue));
[ # # ]
2160 : : else
2161 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_PROJ_X);
2162 : :
2163 : : // Y projection
2164 : 0 : nValue = 99;
2165 [ # # ][ # # ]: 0 : if( aBtnTexObjectY.IsChecked() )
2166 : 0 : nValue = 0;
2167 [ # # ][ # # ]: 0 : else if( aBtnTexParallelY.IsChecked() )
2168 : 0 : nValue = 1;
2169 [ # # ][ # # ]: 0 : else if( aBtnTexCircleY.IsChecked() )
2170 : 0 : nValue = 2;
2171 : :
2172 [ # # ]: 0 : if( nValue <= 2 )
2173 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DTextureProjectionYItem(nValue));
[ # # ]
2174 : : else
2175 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_PROJ_Y);
2176 : :
2177 : :
2178 : : // Filter
2179 : 0 : eState = aBtnTexFilter.GetState();
2180 [ # # ]: 0 : if( eState != STATE_DONTKNOW )
2181 : : {
2182 : 0 : sal_Bool bValue = STATE_CHECK == eState;
2183 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DTextureFilterItem(bValue));
[ # # ]
2184 : : }
2185 : : else
2186 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_FILTER);
2187 : :
2188 : :
2189 : : // Material
2190 : : // Object color
2191 [ # # ][ # # ]: 0 : if( aLbMatColor.GetSelectEntryCount() )
2192 : : {
2193 [ # # ]: 0 : aColor = aLbMatColor.GetSelectEntryColor();
2194 [ # # ][ # # ]: 0 : rAttrs.Put( XFillColorItem( String(), aColor) );
[ # # ][ # # ]
[ # # ]
2195 : : }
2196 : : else
2197 : : {
2198 [ # # ]: 0 : rAttrs.InvalidateItem( XATTR_FILLCOLOR );
2199 : : }
2200 : :
2201 : : // luminous color
2202 [ # # ][ # # ]: 0 : if( aLbMatEmission.GetSelectEntryCount() )
2203 : : {
2204 [ # # ]: 0 : aColor = aLbMatEmission.GetSelectEntryColor();
2205 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DMaterialEmissionItem(aColor));
[ # # ]
2206 : : }
2207 : : else
2208 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_MAT_EMISSION);
2209 : :
2210 : : // Specular
2211 [ # # ][ # # ]: 0 : if( aLbMatSpecular.GetSelectEntryCount() )
2212 : : {
2213 [ # # ]: 0 : aColor = aLbMatSpecular.GetSelectEntryColor();
2214 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DMaterialSpecularItem(aColor));
[ # # ]
2215 : : }
2216 : : else
2217 [ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_MAT_SPECULAR);
2218 : :
2219 : : // Specular intensity
2220 [ # # ][ # # ]: 0 : if( !aMtrMatSpecularIntensity.IsEmptyFieldValue() )
2221 : : {
2222 [ # # ]: 0 : sal_uInt16 nValue2 = (sal_uInt16) aMtrMatSpecularIntensity.GetValue();
2223 [ # # ][ # # ]: 0 : rAttrs.Put(Svx3DMaterialSpecularIntensityItem(nValue2));
[ # # ]
2224 : : }
2225 : : else
2226 [ # # ][ # # ]: 0 : rAttrs.InvalidateItem(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY);
[ # # ]
2227 : 0 : }
2228 : :
2229 : : // -----------------------------------------------------------------------
2230 : 0 : void Svx3DWin::Resize()
2231 : : {
2232 [ # # # # ]: 0 : if ( !IsFloatingMode() ||
[ # # ]
2233 : 0 : !GetFloatingWindow()->IsRollUp() )
2234 : : {
2235 [ # # ]: 0 : Size aWinSize( GetOutputSizePixel() ); // why rSize in Resizing()?
2236 : :
2237 [ # # ]: 0 : if( aWinSize.Height() >= GetMinOutputSizePixel().Height() &&
[ # # # # ]
[ # # ]
[ # # # # ]
2238 [ # # ][ # # ]: 0 : aWinSize.Width() >= GetMinOutputSizePixel().Width() )
[ # # ]
2239 : : {
2240 : 0 : Size aDiffSize;
2241 : 0 : aDiffSize.Width() = aWinSize.Width() - aSize.Width();
2242 : 0 : aDiffSize.Height() = aWinSize.Height() - aSize.Height();
2243 : :
2244 : 0 : Point aXPt;
2245 : 0 : Point aYPt;
2246 : 0 : aXPt.X() = aDiffSize.Width();
2247 : 0 : aYPt.Y() = aDiffSize.Height();
2248 : :
2249 : 0 : Size aObjSize;
2250 : :
2251 : : // Hide
2252 [ # # ]: 0 : aBtnUpdate.Hide();
2253 [ # # ]: 0 : aBtnAssign.Hide();
2254 : :
2255 [ # # ]: 0 : aBtnConvertTo3D.Hide();
2256 [ # # ]: 0 : aBtnLatheObject.Hide();
2257 [ # # ]: 0 : aBtnPerspective.Hide();
2258 : :
2259 [ # # ]: 0 : aCtlPreview.Hide();
2260 [ # # ]: 0 : aCtlLightPreview.Hide();
2261 : :
2262 [ # # ]: 0 : aFLGeometrie.Hide();
2263 [ # # ]: 0 : aFLRepresentation.Hide();
2264 [ # # ]: 0 : aFLLight.Hide();
2265 [ # # ]: 0 : aFLTexture.Hide();
2266 [ # # ]: 0 : aFLMaterial.Hide();
2267 : :
2268 : : // Moving / resizing
2269 [ # # ][ # # ]: 0 : aBtnUpdate.SetPosPixel( aBtnUpdate.GetPosPixel() + aXPt );
2270 [ # # ][ # # ]: 0 : aBtnAssign.SetPosPixel( aBtnAssign.GetPosPixel() + aXPt );
2271 : :
2272 : : // Preview controls
2273 : 0 : aObjSize = aCtlPreview.GetOutputSizePixel();
2274 : 0 : aObjSize.Width() += aDiffSize.Width();
2275 : 0 : aObjSize.Height() += aDiffSize.Height();
2276 [ # # ]: 0 : aCtlPreview.SetOutputSizePixel( aObjSize );
2277 [ # # ]: 0 : aCtlLightPreview.SetOutputSizePixel( aObjSize );
2278 : :
2279 : : // Groups
2280 : 0 : aObjSize = aFLGeometrie.GetOutputSizePixel();
2281 : 0 : aObjSize.Width() += aDiffSize.Width();
2282 [ # # ]: 0 : aFLGeometrie.SetOutputSizePixel( aObjSize );
2283 [ # # ]: 0 : aFLSegments.SetOutputSizePixel( aObjSize );
2284 [ # # ]: 0 : aFLShadow.SetOutputSizePixel( aObjSize );
2285 [ # # ]: 0 : aFLCamera.SetOutputSizePixel( aObjSize );
2286 [ # # ]: 0 : aFLRepresentation.SetOutputSizePixel( aObjSize );
2287 [ # # ]: 0 : aFLLight.SetOutputSizePixel( aObjSize );
2288 [ # # ]: 0 : aFLTexture.SetOutputSizePixel( aObjSize );
2289 [ # # ]: 0 : aFLMaterial.SetOutputSizePixel( aObjSize );
2290 : :
2291 : : // Y-position of the lower buttons
2292 [ # # ][ # # ]: 0 : aBtnConvertTo3D.SetPosPixel( aBtnConvertTo3D.GetPosPixel() + aYPt );
2293 [ # # ][ # # ]: 0 : aBtnLatheObject.SetPosPixel( aBtnLatheObject.GetPosPixel() + aYPt );
2294 [ # # ][ # # ]: 0 : aBtnPerspective.SetPosPixel( aBtnPerspective.GetPosPixel() + aYPt );
2295 : :
2296 : : // Show
2297 [ # # ]: 0 : aBtnUpdate.Show();
2298 [ # # ]: 0 : aBtnAssign.Show();
2299 : :
2300 [ # # ]: 0 : aBtnConvertTo3D.Show();
2301 [ # # ]: 0 : aBtnLatheObject.Show();
2302 [ # # ]: 0 : aBtnPerspective.Show();
2303 : :
2304 [ # # ][ # # ]: 0 : if( aBtnGeo.IsChecked() )
2305 [ # # ]: 0 : ClickViewTypeHdl( &aBtnGeo );
2306 [ # # ][ # # ]: 0 : if( aBtnRepresentation.IsChecked() )
2307 [ # # ]: 0 : ClickViewTypeHdl( &aBtnRepresentation );
2308 [ # # ][ # # ]: 0 : if( aBtnLight.IsChecked() )
2309 [ # # ]: 0 : ClickViewTypeHdl( &aBtnLight );
2310 [ # # ][ # # ]: 0 : if( aBtnTexture.IsChecked() )
2311 [ # # ]: 0 : ClickViewTypeHdl( &aBtnTexture );
2312 [ # # ][ # # ]: 0 : if( aBtnMaterial.IsChecked() )
2313 [ # # ]: 0 : ClickViewTypeHdl( &aBtnMaterial );
2314 : :
2315 : 0 : aSize = aWinSize;
2316 : : }
2317 : : }
2318 : :
2319 : 0 : SfxDockingWindow::Resize();
2320 : 0 : }
2321 : :
2322 : : // -----------------------------------------------------------------------
2323 : 0 : IMPL_LINK_NOARG(Svx3DWin, ClickUpdateHdl)
2324 : : {
2325 : 0 : bUpdate = !aBtnUpdate.IsChecked();
2326 : 0 : aBtnUpdate.Check( bUpdate );
2327 : :
2328 [ # # ]: 0 : if( bUpdate )
2329 : : {
2330 : 0 : SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
2331 [ # # ]: 0 : if (pDispatcher != NULL)
2332 : : {
2333 [ # # ]: 0 : SfxBoolItem aItem( SID_3D_STATE, sal_True );
2334 : : pDispatcher->Execute(
2335 [ # # ][ # # ]: 0 : SID_3D_STATE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
2336 : : }
2337 : : }
2338 : : else
2339 : : {
2340 : : // Controls can be disabled during certain circumstances
2341 : : }
2342 : :
2343 : 0 : return( 0L );
2344 : : }
2345 : :
2346 : : // -----------------------------------------------------------------------
2347 : 0 : IMPL_LINK_NOARG(Svx3DWin, ClickAssignHdl)
2348 : : {
2349 : 0 : SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
2350 [ # # ]: 0 : if (pDispatcher != NULL)
2351 : : {
2352 [ # # ]: 0 : SfxBoolItem aItem( SID_3D_ASSIGN, sal_True );
2353 : : pDispatcher->Execute(
2354 [ # # ][ # # ]: 0 : SID_3D_ASSIGN, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
2355 : : }
2356 : :
2357 : 0 : return( 0L );
2358 : : }
2359 : :
2360 : : // -----------------------------------------------------------------------
2361 : :
2362 : 0 : IMPL_LINK( Svx3DWin, ClickViewTypeHdl, void *, pBtn )
2363 : : {
2364 : :
2365 [ # # ]: 0 : if( pBtn )
2366 : : {
2367 : : // Since the permanent updating of the preview would be too expensive
2368 : 0 : sal_Bool bUpdatePreview = aBtnLight.IsChecked();
2369 : :
2370 : 0 : aBtnGeo.Check( &aBtnGeo == pBtn );
2371 : 0 : aBtnRepresentation.Check( &aBtnRepresentation == pBtn );
2372 : 0 : aBtnLight.Check( &aBtnLight == pBtn );
2373 : 0 : aBtnTexture.Check( &aBtnTexture == pBtn );
2374 : 0 : aBtnMaterial.Check( &aBtnMaterial == pBtn );
2375 : :
2376 [ # # ]: 0 : if( aBtnGeo.IsChecked() )
2377 : 0 : eViewType = VIEWTYPE_GEO;
2378 [ # # ]: 0 : if( aBtnRepresentation.IsChecked() )
2379 : 0 : eViewType = VIEWTYPE_REPRESENTATION;
2380 [ # # ]: 0 : if( aBtnLight.IsChecked() )
2381 : 0 : eViewType = VIEWTYPE_LIGHT;
2382 [ # # ]: 0 : if( aBtnTexture.IsChecked() )
2383 : 0 : eViewType = VIEWTYPE_TEXTURE;
2384 [ # # ]: 0 : if( aBtnMaterial.IsChecked() )
2385 : 0 : eViewType = VIEWTYPE_MATERIAL;
2386 : :
2387 : : // Geometry
2388 [ # # ]: 0 : if( eViewType == VIEWTYPE_GEO )
2389 : : {
2390 : 0 : aFtHorizontal.Show();
2391 : 0 : aNumHorizontal.Show();
2392 : 0 : aFtVertical.Show();
2393 : 0 : aNumVertical.Show();
2394 : 0 : aFLSegments.Show();
2395 : 0 : aFtPercentDiagonal.Show();
2396 : 0 : aMtrPercentDiagonal.Show();
2397 : 0 : aFtBackscale.Show();
2398 : 0 : aMtrBackscale.Show();
2399 : 0 : aFtEndAngle.Show();
2400 : 0 : aMtrEndAngle.Show();
2401 : 0 : aFtDepth.Show();
2402 : 0 : aMtrDepth.Show();
2403 : 0 : aFLGeometrie.Show();
2404 : :
2405 : 0 : aBtnNormalsObj.Show();
2406 : 0 : aBtnNormalsFlat.Show();
2407 : 0 : aBtnNormalsSphere.Show();
2408 : 0 : aBtnTwoSidedLighting.Show();
2409 : 0 : aBtnNormalsInvert.Show();
2410 : 0 : aFLNormals.Show();
2411 : 0 : aBtnDoubleSided.Show();
2412 : : }
2413 : : else
2414 : : {
2415 : 0 : aFtHorizontal.Hide();
2416 : 0 : aNumHorizontal.Hide();
2417 : 0 : aFtVertical.Hide();
2418 : 0 : aNumVertical.Hide();
2419 : 0 : aFLSegments.Hide();
2420 : 0 : aFtPercentDiagonal.Hide();
2421 : 0 : aMtrPercentDiagonal.Hide();
2422 : 0 : aFtBackscale.Hide();
2423 : 0 : aMtrBackscale.Hide();
2424 : 0 : aFtEndAngle.Hide();
2425 : 0 : aMtrEndAngle.Hide();
2426 : 0 : aFtDepth.Hide();
2427 : 0 : aMtrDepth.Hide();
2428 : 0 : aFLGeometrie.Hide();
2429 : :
2430 : 0 : aBtnNormalsObj.Hide();
2431 : 0 : aBtnNormalsFlat.Hide();
2432 : 0 : aBtnNormalsSphere.Hide();
2433 : 0 : aBtnTwoSidedLighting.Hide();
2434 : 0 : aBtnNormalsInvert.Hide();
2435 : 0 : aFLNormals.Hide();
2436 : 0 : aBtnDoubleSided.Hide();
2437 : : }
2438 : :
2439 : : // Representation
2440 [ # # ]: 0 : if( eViewType == VIEWTYPE_REPRESENTATION )
2441 : : {
2442 : 0 : aFtShademode.Show();
2443 : 0 : aLbShademode.Show();
2444 : 0 : aBtnShadow3d.Show();
2445 : 0 : aFtSlant.Show();
2446 : 0 : aMtrSlant.Show();
2447 : 0 : aFLShadow.Show();
2448 : 0 : aFtDistance.Show();
2449 : 0 : aMtrDistance.Show();
2450 : 0 : aFtFocalLeng.Show();
2451 : 0 : aMtrFocalLength.Show();
2452 : 0 : aFLCamera.Show();
2453 : 0 : aFLRepresentation.Show();
2454 : : }
2455 : : else
2456 : : {
2457 : 0 : aFtShademode.Hide();
2458 : 0 : aLbShademode.Hide();
2459 : 0 : aBtnShadow3d.Hide();
2460 : 0 : aFtSlant.Hide();
2461 : 0 : aMtrSlant.Hide();
2462 : 0 : aFLShadow.Hide();
2463 : 0 : aFtDistance.Hide();
2464 : 0 : aMtrDistance.Hide();
2465 : 0 : aFtFocalLeng.Hide();
2466 : 0 : aMtrFocalLength.Hide();
2467 : 0 : aFLCamera.Hide();
2468 : 0 : aFLRepresentation.Hide();
2469 : : }
2470 : :
2471 : : // Lighting
2472 [ # # ]: 0 : if( eViewType == VIEWTYPE_LIGHT )
2473 : : {
2474 : 0 : aBtnLight1.Show();
2475 : 0 : aBtnLight2.Show();
2476 : 0 : aBtnLight3.Show();
2477 : 0 : aBtnLight4.Show();
2478 : 0 : aBtnLight5.Show();
2479 : 0 : aBtnLight6.Show();
2480 : 0 : aBtnLight7.Show();
2481 : 0 : aBtnLight8.Show();
2482 : 0 : aBtnLightColor.Show();
2483 : 0 : aFTLightsource.Show();
2484 : 0 : aLbAmbientlight.Show();
2485 : 0 : aBtnAmbientColor.Show();
2486 : 0 : aFTAmbientlight.Show();
2487 : 0 : aFLLight.Show();
2488 : :
2489 : 0 : ColorLB* pLb = GetLbByButton();
2490 [ # # ]: 0 : if( pLb )
2491 : 0 : pLb->Show();
2492 : :
2493 : 0 : aCtlLightPreview.Show();
2494 : 0 : aCtlPreview.Hide();
2495 : : }
2496 : : else
2497 : : {
2498 : 0 : aBtnLight1.Hide();
2499 : 0 : aBtnLight2.Hide();
2500 : 0 : aBtnLight3.Hide();
2501 : 0 : aBtnLight4.Hide();
2502 : 0 : aBtnLight5.Hide();
2503 : 0 : aBtnLight6.Hide();
2504 : 0 : aBtnLight7.Hide();
2505 : 0 : aBtnLight8.Hide();
2506 : 0 : aLbLight1.Hide();
2507 : 0 : aLbLight2.Hide();
2508 : 0 : aLbLight3.Hide();
2509 : 0 : aLbLight4.Hide();
2510 : 0 : aLbLight5.Hide();
2511 : 0 : aLbLight6.Hide();
2512 : 0 : aLbLight7.Hide();
2513 : 0 : aLbLight8.Hide();
2514 : 0 : aBtnLightColor.Hide();
2515 : 0 : aFTLightsource.Hide();
2516 : 0 : aLbAmbientlight.Hide();
2517 : 0 : aBtnAmbientColor.Hide();
2518 : 0 : aFTAmbientlight.Hide();
2519 : 0 : aFLLight.Hide();
2520 : :
2521 [ # # ]: 0 : if( !aCtlPreview.IsVisible() )
2522 : : {
2523 : 0 : aCtlPreview.Show();
2524 : 0 : aCtlLightPreview.Hide();
2525 : : }
2526 : : }
2527 : :
2528 : : // Textures
2529 [ # # ]: 0 : if( eViewType == VIEWTYPE_TEXTURE )
2530 : : {
2531 : 0 : aFtTexKind.Show();
2532 : 0 : aBtnTexLuminance.Show();
2533 : 0 : aBtnTexColor.Show();
2534 : 0 : aFtTexMode.Show();
2535 : 0 : aBtnTexReplace.Show();
2536 : 0 : aBtnTexModulate.Show();
2537 : 0 : aFtTexProjectionX.Show();
2538 : 0 : aBtnTexParallelX.Show();
2539 : 0 : aBtnTexCircleX.Show();
2540 : 0 : aBtnTexObjectX.Show();
2541 : 0 : aFtTexProjectionY.Show();
2542 : 0 : aBtnTexParallelY.Show();
2543 : 0 : aBtnTexCircleY.Show();
2544 : 0 : aBtnTexObjectY.Show();
2545 : 0 : aFtTexFilter.Show();
2546 : 0 : aBtnTexFilter.Show();
2547 : 0 : aFLTexture.Show();
2548 : : }
2549 : : else
2550 : : {
2551 : 0 : aFtTexKind.Hide();
2552 : 0 : aBtnTexLuminance.Hide();
2553 : 0 : aBtnTexColor.Hide();
2554 : 0 : aFtTexMode.Hide();
2555 : 0 : aBtnTexReplace.Hide();
2556 : 0 : aBtnTexModulate.Hide();
2557 : 0 : aBtnTexBlend.Hide();
2558 : 0 : aFtTexProjectionX.Hide();
2559 : 0 : aBtnTexParallelX.Hide();
2560 : 0 : aBtnTexCircleX.Hide();
2561 : 0 : aBtnTexObjectX.Hide();
2562 : 0 : aFtTexProjectionY.Hide();
2563 : 0 : aBtnTexParallelY.Hide();
2564 : 0 : aBtnTexCircleY.Hide();
2565 : 0 : aBtnTexObjectY.Hide();
2566 : 0 : aFtTexFilter.Hide();
2567 : 0 : aBtnTexFilter.Hide();
2568 : 0 : aFLTexture.Hide();
2569 : : }
2570 : :
2571 : : // Material
2572 [ # # ]: 0 : if( eViewType == VIEWTYPE_MATERIAL )
2573 : : {
2574 : 0 : aFtMatFavorites.Show();
2575 : 0 : aLbMatFavorites.Show();
2576 : 0 : aFtMatColor.Show();
2577 : 0 : aLbMatColor.Show();
2578 : 0 : aBtnMatColor.Show();
2579 : 0 : aFtMatEmission.Show();
2580 : 0 : aLbMatEmission.Show();
2581 : 0 : aBtnEmissionColor.Show();
2582 : 0 : aFtMatSpecular.Show();
2583 : 0 : aLbMatSpecular.Show();
2584 : 0 : aBtnSpecularColor.Show();
2585 : 0 : aFtMatSpecularIntensity.Show();
2586 : 0 : aMtrMatSpecularIntensity.Show();
2587 : 0 : aFLMatSpecular.Show();
2588 : 0 : aFLMaterial.Show();
2589 : : }
2590 : : else
2591 : : {
2592 : 0 : aFtMatFavorites.Hide();
2593 : 0 : aLbMatFavorites.Hide();
2594 : 0 : aFtMatColor.Hide();
2595 : 0 : aLbMatColor.Hide();
2596 : 0 : aBtnMatColor.Hide();
2597 : 0 : aFtMatEmission.Hide();
2598 : 0 : aLbMatEmission.Hide();
2599 : 0 : aBtnEmissionColor.Hide();
2600 : 0 : aFtMatSpecular.Hide();
2601 : 0 : aLbMatSpecular.Hide();
2602 : 0 : aBtnSpecularColor.Hide();
2603 : 0 : aFtMatSpecularIntensity.Hide();
2604 : 0 : aMtrMatSpecularIntensity.Hide();
2605 : 0 : aFLMatSpecular.Hide();
2606 : 0 : aFLMaterial.Hide();
2607 : : }
2608 [ # # ][ # # ]: 0 : if( bUpdatePreview && !aBtnLight.IsChecked() )
[ # # ]
2609 : 0 : UpdatePreview();
2610 : :
2611 : : }
2612 : : else
2613 : : {
2614 : 0 : aBtnGeo.Check( eViewType == VIEWTYPE_GEO );
2615 : 0 : aBtnRepresentation.Check( eViewType == VIEWTYPE_REPRESENTATION );
2616 : 0 : aBtnLight.Check( eViewType == VIEWTYPE_LIGHT );
2617 : 0 : aBtnTexture.Check( eViewType == VIEWTYPE_TEXTURE );
2618 : 0 : aBtnMaterial.Check( eViewType == VIEWTYPE_MATERIAL );
2619 : : }
2620 : 0 : return( 0L );
2621 : : }
2622 : :
2623 : : // -----------------------------------------------------------------------
2624 : 0 : IMPL_LINK( Svx3DWin, ClickHdl, PushButton *, pBtn )
2625 : : {
2626 : 0 : sal_Bool bUpdatePreview = sal_False;
2627 : :
2628 [ # # ]: 0 : if( pBtn )
2629 : : {
2630 : 0 : sal_uInt16 nSId = 0;
2631 : :
2632 [ # # ]: 0 : if( pBtn == &aBtnConvertTo3D )
2633 : : {
2634 : 0 : nSId = SID_CONVERT_TO_3D;
2635 : : }
2636 [ # # ]: 0 : else if( pBtn == &aBtnLatheObject )
2637 : : {
2638 : 0 : nSId = SID_CONVERT_TO_3D_LATHE_FAST;
2639 : : }
2640 : : // Geometry
2641 [ # # ][ # # ]: 0 : else if( pBtn == &aBtnNormalsObj ||
[ # # ]
2642 : : pBtn == &aBtnNormalsFlat ||
2643 : : pBtn == &aBtnNormalsSphere )
2644 : : {
2645 : 0 : aBtnNormalsObj.Check( pBtn == &aBtnNormalsObj );
2646 : 0 : aBtnNormalsFlat.Check( pBtn == &aBtnNormalsFlat );
2647 : 0 : aBtnNormalsSphere.Check( pBtn == &aBtnNormalsSphere );
2648 : 0 : bUpdatePreview = sal_True;
2649 : : }
2650 [ # # ][ # # ]: 0 : else if( pBtn == &aBtnLight1 ||
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
2651 : : pBtn == &aBtnLight2 ||
2652 : : pBtn == &aBtnLight3 ||
2653 : : pBtn == &aBtnLight4 ||
2654 : : pBtn == &aBtnLight5 ||
2655 : : pBtn == &aBtnLight6 ||
2656 : : pBtn == &aBtnLight7 ||
2657 : : pBtn == &aBtnLight8 )
2658 : : {
2659 : : // Lighting
2660 : 0 : ColorLB* pLb = GetLbByButton( pBtn );
2661 : 0 : pLb->Show();
2662 : :
2663 [ # # ]: 0 : if( pBtn->IsChecked() )
2664 : : {
2665 : 0 : SetUILightState( *(ImageButton*)pBtn, !GetUILightState( *(ImageButton*)pBtn ) );
2666 : : }
2667 : : else
2668 : : {
2669 : 0 : pBtn->Check();
2670 : :
2671 [ # # ][ # # ]: 0 : if( pBtn != &aBtnLight1 && aBtnLight1.IsChecked() )
[ # # ]
2672 : : {
2673 : 0 : aBtnLight1.Check( sal_False );
2674 : 0 : aLbLight1.Hide();
2675 : : }
2676 [ # # ][ # # ]: 0 : if( pBtn != &aBtnLight2 && aBtnLight2.IsChecked() )
[ # # ]
2677 : : {
2678 : 0 : aBtnLight2.Check( sal_False );
2679 : 0 : aLbLight2.Hide();
2680 : : }
2681 [ # # ][ # # ]: 0 : if( pBtn != &aBtnLight3 && aBtnLight3.IsChecked() )
[ # # ]
2682 : : {
2683 : 0 : aBtnLight3.Check( sal_False );
2684 : 0 : aLbLight3.Hide();
2685 : : }
2686 [ # # ][ # # ]: 0 : if( pBtn != &aBtnLight4 && aBtnLight4.IsChecked() )
[ # # ]
2687 : : {
2688 : 0 : aBtnLight4.Check( sal_False );
2689 : 0 : aLbLight4.Hide();
2690 : : }
2691 [ # # ][ # # ]: 0 : if( pBtn != &aBtnLight5 && aBtnLight5.IsChecked() )
[ # # ]
2692 : : {
2693 : 0 : aBtnLight5.Check( sal_False );
2694 : 0 : aLbLight5.Hide();
2695 : : }
2696 [ # # ][ # # ]: 0 : if( pBtn != &aBtnLight6 && aBtnLight6.IsChecked() )
[ # # ]
2697 : : {
2698 : 0 : aBtnLight6.Check( sal_False );
2699 : 0 : aLbLight6.Hide();
2700 : : }
2701 [ # # ][ # # ]: 0 : if( pBtn != &aBtnLight7 && aBtnLight7.IsChecked() )
[ # # ]
2702 : : {
2703 : 0 : aBtnLight7.Check( sal_False );
2704 : 0 : aLbLight7.Hide();
2705 : : }
2706 [ # # ][ # # ]: 0 : if( pBtn != &aBtnLight8 && aBtnLight8.IsChecked() )
[ # # ]
2707 : : {
2708 : 0 : aBtnLight8.Check( sal_False );
2709 : 0 : aLbLight8.Hide();
2710 : : }
2711 : : }
2712 : 0 : sal_Bool bEnable = GetUILightState( *(ImageButton*)pBtn );
2713 : 0 : aBtnLightColor.Enable( bEnable );
2714 : 0 : pLb->Enable( bEnable );
2715 : :
2716 : 0 : ClickLight(*pBtn);
2717 : 0 : bUpdatePreview = sal_True;
2718 : : }
2719 : : // Textures
2720 [ # # ][ # # ]: 0 : else if( pBtn == &aBtnTexLuminance ||
2721 : : pBtn == &aBtnTexColor )
2722 : : {
2723 : 0 : aBtnTexLuminance.Check( pBtn == &aBtnTexLuminance );
2724 : 0 : aBtnTexColor.Check( pBtn == &aBtnTexColor );
2725 : 0 : bUpdatePreview = sal_True;
2726 : : }
2727 [ # # ][ # # ]: 0 : else if( pBtn == &aBtnTexReplace ||
2728 : : pBtn == &aBtnTexModulate )
2729 : : {
2730 : 0 : aBtnTexReplace.Check( pBtn == &aBtnTexReplace );
2731 : 0 : aBtnTexModulate.Check( pBtn == &aBtnTexModulate );
2732 : 0 : bUpdatePreview = sal_True;
2733 : : }
2734 [ # # ][ # # ]: 0 : else if( pBtn == &aBtnTexParallelX ||
[ # # ]
2735 : : pBtn == &aBtnTexCircleX ||
2736 : : pBtn == &aBtnTexObjectX )
2737 : : {
2738 : 0 : aBtnTexParallelX.Check( pBtn == &aBtnTexParallelX );
2739 : 0 : aBtnTexCircleX.Check( pBtn == &aBtnTexCircleX );
2740 : 0 : aBtnTexObjectX.Check( pBtn == &aBtnTexObjectX );
2741 : 0 : bUpdatePreview = sal_True;
2742 : : }
2743 [ # # ][ # # ]: 0 : else if( pBtn == &aBtnTexParallelY ||
[ # # ]
2744 : : pBtn == &aBtnTexCircleY ||
2745 : : pBtn == &aBtnTexObjectY )
2746 : : {
2747 : 0 : aBtnTexParallelY.Check( pBtn == &aBtnTexParallelY );
2748 : 0 : aBtnTexCircleY.Check( pBtn == &aBtnTexCircleY );
2749 : 0 : aBtnTexObjectY.Check( pBtn == &aBtnTexObjectY );
2750 : 0 : bUpdatePreview = sal_True;
2751 : : }
2752 [ # # ]: 0 : else if( pBtn == &aBtnShadow3d )
2753 : : {
2754 : 0 : pBtn->Check( !pBtn->IsChecked() );
2755 : 0 : aFtSlant.Enable( pBtn->IsChecked() );
2756 : 0 : aMtrSlant.Enable( pBtn->IsChecked() );
2757 : 0 : bUpdatePreview = sal_True;
2758 : : }
2759 : : // Other (no groups)
2760 [ # # ]: 0 : else if( pBtn != NULL )
2761 : : {
2762 : 0 : pBtn->Check( !pBtn->IsChecked() );
2763 : 0 : bUpdatePreview = sal_True;
2764 : : }
2765 : :
2766 [ # # ]: 0 : if( nSId > 0 )
2767 : : {
2768 : 0 : SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
2769 [ # # ]: 0 : if (pDispatcher != NULL)
2770 : : {
2771 [ # # ]: 0 : SfxBoolItem aItem( nSId, sal_True );
2772 : : pDispatcher->Execute(
2773 [ # # ][ # # ]: 0 : nSId, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
2774 : : }
2775 : : }
2776 [ # # ]: 0 : else if( bUpdatePreview == sal_True )
2777 : 0 : UpdatePreview();
2778 : : }
2779 : 0 : return( 0L );
2780 : : }
2781 : :
2782 : : //------------------------------------------------------------------------
2783 : :
2784 : 0 : IMPL_LINK( Svx3DWin, ClickColorHdl, PushButton *, pBtn )
2785 : : {
2786 [ # # ]: 0 : SvColorDialog aColorDlg( this );
2787 : : ColorLB* pLb;
2788 : :
2789 [ # # ]: 0 : if( pBtn == &aBtnLightColor )
2790 [ # # ]: 0 : pLb = GetLbByButton();
2791 [ # # ]: 0 : else if( pBtn == &aBtnAmbientColor )
2792 : 0 : pLb = &aLbAmbientlight;
2793 [ # # ]: 0 : else if( pBtn == &aBtnMatColor )
2794 : 0 : pLb = &aLbMatColor;
2795 [ # # ]: 0 : else if( pBtn == &aBtnEmissionColor )
2796 : 0 : pLb = &aLbMatEmission;
2797 : : else // if( pBtn == &aBtnSpecularColor )
2798 : 0 : pLb = &aLbMatSpecular;
2799 : :
2800 [ # # ]: 0 : Color aColor = pLb->GetSelectEntryColor();
2801 : :
2802 [ # # ]: 0 : aColorDlg.SetColor( aColor );
2803 [ # # ][ # # ]: 0 : if( aColorDlg.Execute() == RET_OK )
2804 : : {
2805 [ # # ]: 0 : aColor = aColorDlg.GetColor();
2806 [ # # ][ # # ]: 0 : if( LBSelectColor( pLb, aColor ) )
2807 [ # # ]: 0 : SelectHdl( pLb );
2808 : : }
2809 [ # # ]: 0 : return( 0L );
2810 : : }
2811 : :
2812 : : // -----------------------------------------------------------------------
2813 : 0 : IMPL_LINK( Svx3DWin, SelectHdl, void *, p )
2814 : : {
2815 [ # # ]: 0 : if( p )
2816 : : {
2817 : 0 : Color aColor;
2818 : 0 : sal_Bool bUpdatePreview = sal_False;
2819 : :
2820 : : // Material
2821 [ # # ]: 0 : if( p == &aLbMatFavorites )
2822 : : {
2823 : 0 : Color aColObj( COL_WHITE );
2824 : 0 : Color aColEmis( COL_BLACK );
2825 : 0 : Color aColSpec( COL_WHITE );
2826 : 0 : sal_uInt16 nSpecIntens = 20;
2827 : :
2828 [ # # ]: 0 : sal_uInt16 nPos = aLbMatFavorites.GetSelectEntryPos();
2829 [ # # # # : 0 : switch( nPos )
# # ]
2830 : : {
2831 : : case 1: // Metall
2832 : : {
2833 : 0 : aColObj = Color(230,230,255);
2834 : 0 : aColEmis = Color(10,10,30);
2835 : 0 : aColSpec = Color(200,200,200);
2836 : 0 : nSpecIntens = 20;
2837 : : }
2838 : 0 : break;
2839 : :
2840 : : case 2: // Gold
2841 : : {
2842 : 0 : aColObj = Color(230,255,0);
2843 : 0 : aColEmis = Color(51,0,0);
2844 : 0 : aColSpec = Color(255,255,240);
2845 : 0 : nSpecIntens = 20;
2846 : : }
2847 : 0 : break;
2848 : :
2849 : : case 3: // Chrome
2850 : : {
2851 : 0 : aColObj = Color(36,117,153);
2852 : 0 : aColEmis = Color(18,30,51);
2853 : 0 : aColSpec = Color(230,230,255);
2854 : 0 : nSpecIntens = 2;
2855 : : }
2856 : 0 : break;
2857 : :
2858 : : case 4: // Plastic
2859 : : {
2860 : 0 : aColObj = Color(255,48,57);
2861 : 0 : aColEmis = Color(35,0,0);
2862 : 0 : aColSpec = Color(179,202,204);
2863 : 0 : nSpecIntens = 60;
2864 : : }
2865 : 0 : break;
2866 : :
2867 : : case 5: // Wood
2868 : : {
2869 : 0 : aColObj = Color(153,71,1);
2870 : 0 : aColEmis = Color(21,22,0);
2871 : 0 : aColSpec = Color(255,255,153);
2872 : 0 : nSpecIntens = 75;
2873 : : }
2874 : 0 : break;
2875 : : }
2876 [ # # ]: 0 : LBSelectColor( &aLbMatColor, aColObj );
2877 [ # # ]: 0 : LBSelectColor( &aLbMatEmission, aColEmis );
2878 [ # # ]: 0 : LBSelectColor( &aLbMatSpecular, aColSpec );
2879 [ # # ]: 0 : aMtrMatSpecularIntensity.SetValue( nSpecIntens );
2880 : :
2881 : 0 : bUpdatePreview = sal_True;
2882 : : }
2883 [ # # ][ # # ]: 0 : else if( p == &aLbMatColor ||
[ # # ]
2884 : : p == &aLbMatEmission ||
2885 : : p == &aLbMatSpecular )
2886 : : {
2887 [ # # ]: 0 : aLbMatFavorites.SelectEntryPos( 0 );
2888 : 0 : bUpdatePreview = sal_True;
2889 : : }
2890 : : // Lighting
2891 [ # # ]: 0 : else if( p == &aLbAmbientlight )
2892 : : {
2893 : 0 : bUpdatePreview = sal_True;
2894 : : }
2895 [ # # ][ # # ]: 0 : else if( p == &aLbLight1 ||
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
2896 : : p == &aLbLight2 ||
2897 : : p == &aLbLight3 ||
2898 : : p == &aLbLight4 ||
2899 : : p == &aLbLight5 ||
2900 : : p == &aLbLight6 ||
2901 : : p == &aLbLight7 ||
2902 : : p == &aLbLight8 )
2903 : : {
2904 : 0 : bUpdatePreview = sal_True;
2905 : : }
2906 [ # # ]: 0 : else if( p == &aLbShademode )
2907 : 0 : bUpdatePreview = sal_True;
2908 : :
2909 [ # # ]: 0 : if( bUpdatePreview == sal_True )
2910 [ # # ]: 0 : UpdatePreview();
2911 : : }
2912 : 0 : return( 0L );
2913 : : }
2914 : :
2915 : : // -----------------------------------------------------------------------
2916 : 0 : IMPL_LINK( Svx3DWin, ModifyHdl, void*, pField )
2917 : : {
2918 [ # # ]: 0 : if( pField )
2919 : : {
2920 : 0 : sal_Bool bUpdatePreview = sal_False;
2921 : :
2922 : : // Material
2923 [ # # ]: 0 : if( pField == &aMtrMatSpecularIntensity )
2924 : : {
2925 : 0 : bUpdatePreview = sal_True;
2926 : : }
2927 [ # # ]: 0 : else if( pField == &aNumHorizontal )
2928 : : {
2929 : 0 : bUpdatePreview = sal_True;
2930 : : }
2931 [ # # ]: 0 : else if( pField == &aNumVertical )
2932 : : {
2933 : 0 : bUpdatePreview = sal_True;
2934 : : }
2935 [ # # ]: 0 : else if( pField == &aMtrSlant )
2936 : : {
2937 : 0 : bUpdatePreview = sal_True;
2938 : : }
2939 : :
2940 [ # # ]: 0 : if( bUpdatePreview == sal_True )
2941 : 0 : UpdatePreview();
2942 : : }
2943 : 0 : return( 0L );
2944 : : }
2945 : :
2946 : : // -----------------------------------------------------------------------
2947 : :
2948 : 0 : void Svx3DWin::ClickLight(PushButton& rBtn)
2949 : : {
2950 [ # # ]: 0 : sal_uInt16 nLightSource = GetLightSource( &rBtn );
2951 [ # # ]: 0 : ColorLB* pLb = GetLbByButton( &rBtn );
2952 [ # # ]: 0 : Color aColor( pLb->GetSelectEntryColor() );
2953 [ # # ]: 0 : SfxItemSet aLightItemSet(aCtlLightPreview.GetSvx3DLightControl().Get3DAttributes());
2954 [ # # ]: 0 : const bool bOnOff(GetUILightState( (const ImageButton&)rBtn ));
2955 : :
2956 [ # # # # : 0 : switch(nLightSource)
# # # # ]
2957 : : {
2958 [ # # ][ # # ]: 0 : case 0: aLightItemSet.Put(Svx3DLightcolor1Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff1Item(bOnOff)); break;
[ # # ][ # # ]
[ # # ][ # # ]
2959 [ # # ][ # # ]: 0 : case 1: aLightItemSet.Put(Svx3DLightcolor2Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff2Item(bOnOff)); break;
[ # # ][ # # ]
[ # # ][ # # ]
2960 [ # # ][ # # ]: 0 : case 2: aLightItemSet.Put(Svx3DLightcolor3Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff3Item(bOnOff)); break;
[ # # ][ # # ]
[ # # ][ # # ]
2961 [ # # ][ # # ]: 0 : case 3: aLightItemSet.Put(Svx3DLightcolor4Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff4Item(bOnOff)); break;
[ # # ][ # # ]
[ # # ][ # # ]
2962 [ # # ][ # # ]: 0 : case 4: aLightItemSet.Put(Svx3DLightcolor5Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff5Item(bOnOff)); break;
[ # # ][ # # ]
[ # # ][ # # ]
2963 [ # # ][ # # ]: 0 : case 5: aLightItemSet.Put(Svx3DLightcolor6Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff6Item(bOnOff)); break;
[ # # ][ # # ]
[ # # ][ # # ]
2964 [ # # ][ # # ]: 0 : case 6: aLightItemSet.Put(Svx3DLightcolor7Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff7Item(bOnOff)); break;
[ # # ][ # # ]
[ # # ][ # # ]
2965 : : default:
2966 [ # # ][ # # ]: 0 : case 7: aLightItemSet.Put(Svx3DLightcolor8Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff8Item(bOnOff)); break;
[ # # ][ # # ]
[ # # ][ # # ]
2967 : : }
2968 : :
2969 [ # # ]: 0 : aCtlLightPreview.GetSvx3DLightControl().Set3DAttributes(aLightItemSet);
2970 [ # # ]: 0 : aCtlLightPreview.GetSvx3DLightControl().SelectLight(nLightSource);
2971 [ # # ][ # # ]: 0 : aCtlLightPreview.CheckSelection();
2972 : 0 : }
2973 : :
2974 : : // -----------------------------------------------------------------------
2975 : :
2976 : 0 : IMPL_LINK_NOARG(Svx3DWin, ChangeLightCallbackHdl)
2977 : : {
2978 : 0 : return( 0L );
2979 : : }
2980 : :
2981 : :
2982 : : // -----------------------------------------------------------------------
2983 : :
2984 : 0 : IMPL_LINK_NOARG(Svx3DWin, ChangeSelectionCallbackHdl)
2985 : : {
2986 : 0 : const sal_uInt32 nLight(aCtlLightPreview.GetSvx3DLightControl().GetSelectedLight());
2987 : 0 : PushButton* pBtn = 0;
2988 : :
2989 [ # # # # : 0 : switch( nLight )
# # # #
# ]
2990 : : {
2991 : 0 : case 0: pBtn = &aBtnLight1; break;
2992 : 0 : case 1: pBtn = &aBtnLight2; break;
2993 : 0 : case 2: pBtn = &aBtnLight3; break;
2994 : 0 : case 3: pBtn = &aBtnLight4; break;
2995 : 0 : case 4: pBtn = &aBtnLight5; break;
2996 : 0 : case 5: pBtn = &aBtnLight6; break;
2997 : 0 : case 6: pBtn = &aBtnLight7; break;
2998 : 0 : case 7: pBtn = &aBtnLight8; break;
2999 : 0 : default: break;
3000 : : }
3001 : :
3002 [ # # ]: 0 : if( pBtn )
3003 : 0 : ClickHdl( pBtn );
3004 : : else
3005 : : {
3006 : : // Status: No lamp selected
3007 [ # # ]: 0 : if( aBtnLight1.IsChecked() )
3008 : : {
3009 : 0 : aBtnLight1.Check( sal_False );
3010 : 0 : aLbLight1.Enable( sal_False );
3011 : : }
3012 [ # # ]: 0 : else if( aBtnLight2.IsChecked() )
3013 : : {
3014 : 0 : aBtnLight2.Check( sal_False );
3015 : 0 : aLbLight2.Enable( sal_False );
3016 : : }
3017 [ # # ]: 0 : else if( aBtnLight3.IsChecked() )
3018 : : {
3019 : 0 : aBtnLight3.Check( sal_False );
3020 : 0 : aLbLight3.Enable( sal_False );
3021 : : }
3022 [ # # ]: 0 : else if( aBtnLight4.IsChecked() )
3023 : : {
3024 : 0 : aBtnLight4.Check( sal_False );
3025 : 0 : aLbLight4.Enable( sal_False );
3026 : : }
3027 [ # # ]: 0 : else if( aBtnLight5.IsChecked() )
3028 : : {
3029 : 0 : aBtnLight5.Check( sal_False );
3030 : 0 : aLbLight5.Enable( sal_False );
3031 : : }
3032 [ # # ]: 0 : else if( aBtnLight6.IsChecked() )
3033 : : {
3034 : 0 : aBtnLight6.Check( sal_False );
3035 : 0 : aLbLight6.Enable( sal_False );
3036 : : }
3037 [ # # ]: 0 : else if( aBtnLight7.IsChecked() )
3038 : : {
3039 : 0 : aBtnLight7.Check( sal_False );
3040 : 0 : aLbLight7.Enable( sal_False );
3041 : : }
3042 [ # # ]: 0 : else if( aBtnLight8.IsChecked() )
3043 : : {
3044 : 0 : aBtnLight8.Check( sal_False );
3045 : 0 : aLbLight8.Enable( sal_False );
3046 : : }
3047 : 0 : aBtnLightColor.Enable( sal_False );
3048 : : }
3049 : :
3050 : 0 : return( 0L );
3051 : : }
3052 : :
3053 : : // -----------------------------------------------------------------------
3054 : : // Method to ensure that the LB is also associated with a color
3055 : : // returns true if color was added
3056 : : // -----------------------------------------------------------------------
3057 : 0 : sal_Bool Svx3DWin::LBSelectColor( ColorLB* pLb, const Color& rColor )
3058 : : {
3059 : 0 : sal_Bool bRet = sal_False;
3060 : :
3061 : 0 : pLb->SetNoSelection();
3062 : 0 : pLb->SelectEntry( rColor );
3063 [ # # ]: 0 : if( pLb->GetSelectEntryCount() == 0 )
3064 : : {
3065 [ # # ][ # # ]: 0 : String aStr(SVX_RES(RID_SVXFLOAT3D_FIX_R));
3066 : :
3067 [ # # ][ # # ]: 0 : aStr += String::CreateFromInt32((sal_Int32)rColor.GetRed());
[ # # ]
3068 [ # # ]: 0 : aStr += sal_Unicode(' ');
3069 [ # # ][ # # ]: 0 : aStr += String(SVX_RES(RID_SVXFLOAT3D_FIX_G));
[ # # ][ # # ]
3070 [ # # ][ # # ]: 0 : aStr += String::CreateFromInt32((sal_Int32)rColor.GetGreen());
[ # # ]
3071 [ # # ]: 0 : aStr += sal_Unicode(' ');
3072 [ # # ][ # # ]: 0 : aStr += String(SVX_RES(RID_SVXFLOAT3D_FIX_B));
[ # # ][ # # ]
3073 [ # # ][ # # ]: 0 : aStr += String::CreateFromInt32((sal_Int32)rColor.GetBlue());
[ # # ]
3074 : :
3075 [ # # ]: 0 : sal_uInt16 nPos = pLb->InsertEntry( rColor, aStr );
3076 [ # # ]: 0 : pLb->SelectEntryPos( nPos );
3077 [ # # ]: 0 : bRet = sal_True;
3078 : : }
3079 : 0 : return( bRet );
3080 : : }
3081 : :
3082 : : // -----------------------------------------------------------------------
3083 : 0 : void Svx3DWin::UpdatePreview()
3084 : : {
3085 [ # # ]: 0 : if( pModel == NULL )
3086 [ # # ][ # # ]: 0 : pModel = new FmFormModel();
3087 : :
3088 [ # # ]: 0 : if(bOnly3DChanged)
3089 : : {
3090 : : // Execute slot
3091 [ # # ]: 0 : SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
3092 [ # # ]: 0 : if (pDispatcher != NULL)
3093 : : {
3094 [ # # ]: 0 : SfxBoolItem aItem( SID_3D_STATE, sal_True );
3095 : : pDispatcher->Execute(
3096 [ # # ][ # # ]: 0 : SID_3D_STATE, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
3097 : : }
3098 : : // Reset Flag
3099 : 0 : bOnly3DChanged = sal_False;
3100 : : }
3101 : :
3102 : : // Get Itemset
3103 [ # # ]: 0 : SfxItemSet aSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END);
3104 : :
3105 : : // Get Attributes and set the preview
3106 [ # # ]: 0 : GetAttr( aSet );
3107 [ # # ]: 0 : aCtlPreview.Set3DAttributes( aSet );
3108 [ # # ][ # # ]: 0 : aCtlLightPreview.GetSvx3DLightControl().Set3DAttributes( aSet );
3109 : 0 : }
3110 : :
3111 : : //////////////////////////////////////////////////////////////////////////////
3112 : : // document is to be reloaded, destroy remembered ItemSet
3113 : 0 : void Svx3DWin::DocumentReload()
3114 : : {
3115 [ # # ]: 0 : delete mpRemember2DAttributes;
3116 : 0 : mpRemember2DAttributes = 0L;
3117 : 0 : }
3118 : :
3119 : : // -----------------------------------------------------------------------
3120 : 0 : void Svx3DWin::InitColorLB( const SdrModel* pDoc )
3121 : : {
3122 [ # # ][ # # ]: 0 : aLbLight1.Fill( pDoc->GetColorList() );
3123 [ # # ]: 0 : aLbLight2.CopyEntries( aLbLight1 );
3124 [ # # ]: 0 : aLbLight3.CopyEntries( aLbLight1 );
3125 [ # # ]: 0 : aLbLight4.CopyEntries( aLbLight1 );
3126 [ # # ]: 0 : aLbLight5.CopyEntries( aLbLight1 );
3127 [ # # ]: 0 : aLbLight6.CopyEntries( aLbLight1 );
3128 [ # # ]: 0 : aLbLight7.CopyEntries( aLbLight1 );
3129 [ # # ]: 0 : aLbLight8.CopyEntries( aLbLight1 );
3130 [ # # ]: 0 : aLbAmbientlight.CopyEntries( aLbLight1 );
3131 [ # # ]: 0 : aLbMatColor.CopyEntries( aLbLight1 );
3132 [ # # ]: 0 : aLbMatEmission.CopyEntries( aLbLight1 );
3133 [ # # ]: 0 : aLbMatSpecular.CopyEntries( aLbLight1 );
3134 : :
3135 : : // First...
3136 : 0 : Color aColWhite( COL_WHITE );
3137 : 0 : Color aColBlack( COL_BLACK );
3138 [ # # ]: 0 : aLbLight1.SelectEntry( aColWhite );
3139 [ # # ]: 0 : aLbLight2.SelectEntry( aColWhite );
3140 [ # # ]: 0 : aLbLight3.SelectEntry( aColWhite );
3141 [ # # ]: 0 : aLbLight4.SelectEntry( aColWhite );
3142 [ # # ]: 0 : aLbLight5.SelectEntry( aColWhite );
3143 [ # # ]: 0 : aLbLight6.SelectEntry( aColWhite );
3144 [ # # ]: 0 : aLbLight7.SelectEntry( aColWhite );
3145 [ # # ]: 0 : aLbLight8.SelectEntry( aColWhite );
3146 [ # # ]: 0 : aLbAmbientlight.SelectEntry( aColBlack );
3147 [ # # ]: 0 : aLbMatColor.SelectEntry( aColWhite );
3148 [ # # ]: 0 : aLbMatEmission.SelectEntry( aColBlack );
3149 [ # # ]: 0 : aLbMatSpecular.SelectEntry( aColWhite );
3150 : 0 : }
3151 : :
3152 : : // -----------------------------------------------------------------------
3153 : 0 : sal_uInt16 Svx3DWin::GetLightSource( const PushButton* pBtn )
3154 : : {
3155 : 0 : sal_uInt16 nLight = 8;
3156 : :
3157 [ # # ]: 0 : if( pBtn == NULL )
3158 : : {
3159 [ # # ]: 0 : if( aBtnLight1.IsChecked() )
3160 : 0 : nLight = 0;
3161 [ # # ]: 0 : else if( aBtnLight2.IsChecked() )
3162 : 0 : nLight = 1;
3163 [ # # ]: 0 : else if( aBtnLight3.IsChecked() )
3164 : 0 : nLight = 2;
3165 [ # # ]: 0 : else if( aBtnLight4.IsChecked() )
3166 : 0 : nLight = 3;
3167 [ # # ]: 0 : else if( aBtnLight5.IsChecked() )
3168 : 0 : nLight = 4;
3169 [ # # ]: 0 : else if( aBtnLight6.IsChecked() )
3170 : 0 : nLight = 5;
3171 [ # # ]: 0 : else if( aBtnLight7.IsChecked() )
3172 : 0 : nLight = 6;
3173 [ # # ]: 0 : else if( aBtnLight8.IsChecked() )
3174 : 0 : nLight = 7;
3175 : : }
3176 : : else
3177 : : {
3178 [ # # ]: 0 : if( pBtn == &aBtnLight1 )
3179 : 0 : nLight = 0;
3180 [ # # ]: 0 : else if( pBtn == &aBtnLight2 )
3181 : 0 : nLight = 1;
3182 [ # # ]: 0 : else if( pBtn == &aBtnLight3 )
3183 : 0 : nLight = 2;
3184 [ # # ]: 0 : else if( pBtn == &aBtnLight4 )
3185 : 0 : nLight = 3;
3186 [ # # ]: 0 : else if( pBtn == &aBtnLight5 )
3187 : 0 : nLight = 4;
3188 [ # # ]: 0 : else if( pBtn == &aBtnLight6 )
3189 : 0 : nLight = 5;
3190 [ # # ]: 0 : else if( pBtn == &aBtnLight7 )
3191 : 0 : nLight = 6;
3192 [ # # ]: 0 : else if( pBtn == &aBtnLight8 )
3193 : 0 : nLight = 7;
3194 : : }
3195 : 0 : return( nLight );
3196 : : };
3197 : :
3198 : : // -----------------------------------------------------------------------
3199 : 0 : ColorLB* Svx3DWin::GetLbByButton( const PushButton* pBtn )
3200 : : {
3201 : 0 : ColorLB* pLb = NULL;
3202 : :
3203 [ # # ]: 0 : if( pBtn == NULL )
3204 : : {
3205 [ # # ]: 0 : if( aBtnLight1.IsChecked() )
3206 : 0 : pLb = &aLbLight1;
3207 [ # # ]: 0 : else if( aBtnLight2.IsChecked() )
3208 : 0 : pLb = &aLbLight2;
3209 [ # # ]: 0 : else if( aBtnLight3.IsChecked() )
3210 : 0 : pLb = &aLbLight3;
3211 [ # # ]: 0 : else if( aBtnLight4.IsChecked() )
3212 : 0 : pLb = &aLbLight4;
3213 [ # # ]: 0 : else if( aBtnLight5.IsChecked() )
3214 : 0 : pLb = &aLbLight5;
3215 [ # # ]: 0 : else if( aBtnLight6.IsChecked() )
3216 : 0 : pLb = &aLbLight6;
3217 [ # # ]: 0 : else if( aBtnLight7.IsChecked() )
3218 : 0 : pLb = &aLbLight7;
3219 [ # # ]: 0 : else if( aBtnLight8.IsChecked() )
3220 : 0 : pLb = &aLbLight8;
3221 : : }
3222 : : else
3223 : : {
3224 [ # # ]: 0 : if( pBtn == &aBtnLight1 )
3225 : 0 : pLb = &aLbLight1;
3226 [ # # ]: 0 : else if( pBtn == &aBtnLight2 )
3227 : 0 : pLb = &aLbLight2;
3228 [ # # ]: 0 : else if( pBtn == &aBtnLight3 )
3229 : 0 : pLb = &aLbLight3;
3230 [ # # ]: 0 : else if( pBtn == &aBtnLight4 )
3231 : 0 : pLb = &aLbLight4;
3232 [ # # ]: 0 : else if( pBtn == &aBtnLight5 )
3233 : 0 : pLb = &aLbLight5;
3234 [ # # ]: 0 : else if( pBtn == &aBtnLight6 )
3235 : 0 : pLb = &aLbLight6;
3236 [ # # ]: 0 : else if( pBtn == &aBtnLight7 )
3237 : 0 : pLb = &aLbLight7;
3238 [ # # ]: 0 : else if( pBtn == &aBtnLight8 )
3239 : 0 : pLb = &aLbLight8;
3240 : : }
3241 : 0 : return( pLb );
3242 : : };
3243 : :
3244 : : // Derivation from SfxChildWindow as "containers" for effects
3245 : :
3246 : 0 : Svx3DChildWindow::Svx3DChildWindow( Window* _pParent,
3247 : : sal_uInt16 nId,
3248 : : SfxBindings* pBindings,
3249 : : SfxChildWinInfo* pInfo ) :
3250 : 0 : SfxChildWindow( _pParent, nId )
3251 : : {
3252 [ # # ][ # # ]: 0 : Svx3DWin* pWin = new Svx3DWin( pBindings, this, _pParent );
3253 : 0 : pWindow = pWin;
3254 : :
3255 : 0 : eChildAlignment = SFX_ALIGN_NOALIGNMENT;
3256 : :
3257 [ # # ]: 0 : pWin->Initialize( pInfo );
3258 : 0 : }
3259 : :
3260 : 0 : Svx3DCtrlItem::Svx3DCtrlItem( sal_uInt16 _nId,
3261 : : SfxBindings* _pBindings) :
3262 : 0 : SfxControllerItem( _nId, *_pBindings )
3263 : : {
3264 : 0 : }
3265 : :
3266 : : // -----------------------------------------------------------------------
3267 : 0 : void Svx3DCtrlItem::StateChanged( sal_uInt16 /*nSId*/,
3268 : : SfxItemState /*eState*/, const SfxPoolItem* /*pItem*/ )
3269 : : {
3270 : 0 : }
3271 : :
3272 : : // ControllerItem for Status Slot SID_CONVERT_TO_3D
3273 : :
3274 : 0 : SvxConvertTo3DItem::SvxConvertTo3DItem(sal_uInt16 _nId, SfxBindings* _pBindings)
3275 : : : SfxControllerItem(_nId, *_pBindings),
3276 : 0 : bState(sal_False)
3277 : : {
3278 : 0 : }
3279 : :
3280 : 0 : void SvxConvertTo3DItem::StateChanged(sal_uInt16 /*_nId*/, SfxItemState eState, const SfxPoolItem* /*pState*/)
3281 : : {
3282 : 0 : sal_Bool bNewState = (eState != SFX_ITEM_DISABLED);
3283 [ # # ]: 0 : if(bNewState != bState)
3284 : : {
3285 : 0 : bState = bNewState;
3286 : 0 : SfxDispatcher* pDispatcher = LocalGetDispatcher(&GetBindings());
3287 [ # # ]: 0 : if (pDispatcher != NULL)
3288 : : {
3289 [ # # ]: 0 : SfxBoolItem aItem( SID_3D_STATE, sal_True );
3290 : : pDispatcher->Execute(
3291 [ # # ][ # # ]: 0 : SID_3D_STATE, SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD, &aItem, 0L);
3292 : : }
3293 : : }
3294 : 0 : }
3295 : :
3296 : :
3297 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|