LibreOffice Module svx (master) 1
float3d.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <sfx2/dispatch.hxx>
23#include <sfx2/module.hxx>
24#include <sfx2/viewfrm.hxx>
25#include <svl/eitem.hxx>
26#include <svl/intitem.hxx>
27#include <svl/itempool.hxx>
28#include <svtools/colrdlg.hxx>
29#include <svx/colorbox.hxx>
30#include <svx/f3dchild.hxx>
31#include <svx/xfillit0.hxx>
32#include <svx/xflclit.hxx>
33#include <svx/xlineit0.hxx>
34#include <svx/fmmodel.hxx>
35#include <svx/dlgutil.hxx>
36#include <svx/obj3d.hxx>
37#include <svx/sdshitm.hxx>
38#include <svx/svx3ditems.hxx>
39
40#include <svx/dialmgr.hxx>
41#include <svx/viewpt3d.hxx>
42
43#include <svx/svxids.hrc>
44#include <svx/strings.hrc>
45
46#include <editeng/colritem.hxx>
47#include <osl/diagnose.h>
48#include <svx/e3ditem.hxx>
49#include <svl/whiter.hxx>
50#include <svtools/unitconv.hxx>
51
52#include <svx/float3d.hxx>
53
54#include <bitmaps.hlst>
55
56using namespace com::sun::star;
57
59
61{
63};
64
65namespace {
73 SfxDispatcher* LocalGetDispatcher (const SfxBindings* pBindings)
74 {
75 SfxDispatcher* pDispatcher = nullptr;
76
77 if (SfxViewFrame::Current() != nullptr)
78 pDispatcher = SfxViewFrame::Current()->GetDispatcher();
79 else if (pBindings != nullptr)
80 pDispatcher = pBindings->GetDispatcher();
81
82 return pDispatcher;
83 }
84}
85
87 : SfxDockingWindow(pInBindings, pCW, pParent,
88 "Docking3DEffects", "svx/ui/docking3deffects.ui")
89
90 , m_xBtnGeo(m_xBuilder->weld_toggle_button("geometry"))
91 , m_xBtnRepresentation(m_xBuilder->weld_toggle_button("representation"))
92 , m_xBtnLight(m_xBuilder->weld_toggle_button("light"))
93 , m_xBtnTexture(m_xBuilder->weld_toggle_button("texture"))
94 , m_xBtnMaterial(m_xBuilder->weld_toggle_button("material"))
95 , m_xBtnUpdate(m_xBuilder->weld_toggle_button("update"))
96 , m_xBtnAssign(m_xBuilder->weld_button("assign"))
97
98 , m_xFLGeometrie(m_xBuilder->weld_container("geoframe"))
99 , m_xFtPercentDiagonal(m_xBuilder->weld_label("diagonalft"))
100 , m_xMtrPercentDiagonal(m_xBuilder->weld_metric_spin_button("diagonal", FieldUnit::PERCENT))
101 , m_xFtBackscale(m_xBuilder->weld_label("scaleddepthft"))
102 , m_xMtrBackscale(m_xBuilder->weld_metric_spin_button("scaleddepth", FieldUnit::PERCENT))
103 , m_xFtEndAngle(m_xBuilder->weld_label("angleft"))
104 , m_xMtrEndAngle(m_xBuilder->weld_metric_spin_button("angle", FieldUnit::DEGREE))
105 , m_xFtDepth(m_xBuilder->weld_label("depthft"))
106 , m_xMtrDepth(m_xBuilder->weld_metric_spin_button("depth", FieldUnit::CM))
107
108 , m_xFLSegments(m_xBuilder->weld_container("segmentsframe"))
109 , m_xNumHorizontal(m_xBuilder->weld_spin_button("hori"))
110 , m_xNumVertical(m_xBuilder->weld_spin_button("veri"))
111
112 , m_xFLNormals(m_xBuilder->weld_container("normals"))
113 , m_xBtnNormalsObj(m_xBuilder->weld_toggle_button("objspecific"))
114 , m_xBtnNormalsFlat(m_xBuilder->weld_toggle_button("flat"))
115 , m_xBtnNormalsSphere(m_xBuilder->weld_toggle_button("spherical"))
116 , m_xBtnNormalsInvert(m_xBuilder->weld_toggle_button("invertnormals"))
117 , m_xBtnTwoSidedLighting(m_xBuilder->weld_toggle_button("doublesidedillum"))
118 , m_xBtnDoubleSided(m_xBuilder->weld_toggle_button("doublesided"))
119
120 , m_xFLRepresentation(m_xBuilder->weld_container("shadingframe"))
121 , m_xLbShademode(m_xBuilder->weld_combo_box("mode"))
122
123 , m_xFLShadow(m_xBuilder->weld_container("shadowframe"))
124 , m_xBtnShadow3d(m_xBuilder->weld_toggle_button("shadow"))
125 , m_xFtSlant(m_xBuilder->weld_label("slantft"))
126 , m_xMtrSlant(m_xBuilder->weld_metric_spin_button("slant", FieldUnit::DEGREE))
127
128 , m_xFLCamera(m_xBuilder->weld_container("cameraframe"))
129 , m_xMtrDistance(m_xBuilder->weld_metric_spin_button("distance", FieldUnit::CM))
130 , m_xMtrFocalLength(m_xBuilder->weld_metric_spin_button("focal", FieldUnit::CM))
131
132 , m_xFLLight(m_xBuilder->weld_container("illumframe"))
133 , m_xBtnLight1(new LightButton(m_xBuilder->weld_toggle_button("light1")))
134 , m_xBtnLight2(new LightButton(m_xBuilder->weld_toggle_button("light2")))
135 , m_xBtnLight3(new LightButton(m_xBuilder->weld_toggle_button("light3")))
136 , m_xBtnLight4(new LightButton(m_xBuilder->weld_toggle_button("light4")))
137 , m_xBtnLight5(new LightButton(m_xBuilder->weld_toggle_button("light5")))
138 , m_xBtnLight6(new LightButton(m_xBuilder->weld_toggle_button("light6")))
139 , m_xBtnLight7(new LightButton(m_xBuilder->weld_toggle_button("light7")))
140 , m_xBtnLight8(new LightButton(m_xBuilder->weld_toggle_button("light8")))
141 , m_xLbLight1(new ColorListBox(m_xBuilder->weld_menu_button("lightcolor1"), [this]{ return GetFrameWeld(); }))
142 , m_xLbLight2(new ColorListBox(m_xBuilder->weld_menu_button("lightcolor2"), [this]{ return GetFrameWeld(); }))
143 , m_xLbLight3(new ColorListBox(m_xBuilder->weld_menu_button("lightcolor3"), [this]{ return GetFrameWeld(); }))
144 , m_xLbLight4(new ColorListBox(m_xBuilder->weld_menu_button("lightcolor4"), [this]{ return GetFrameWeld(); }))
145 , m_xLbLight5(new ColorListBox(m_xBuilder->weld_menu_button("lightcolor5"), [this]{ return GetFrameWeld(); }))
146 , m_xLbLight6(new ColorListBox(m_xBuilder->weld_menu_button("lightcolor6"), [this]{ return GetFrameWeld(); }))
147 , m_xLbLight7(new ColorListBox(m_xBuilder->weld_menu_button("lightcolor7"), [this]{ return GetFrameWeld(); }))
148 , m_xLbLight8(new ColorListBox(m_xBuilder->weld_menu_button("lightcolor8"), [this]{ return GetFrameWeld(); }))
149 , m_xBtnLightColor(m_xBuilder->weld_button("colorbutton1"))
150 , m_xLbAmbientlight(new ColorListBox(m_xBuilder->weld_menu_button("ambientcolor"), [this]{ return GetFrameWeld(); }))
151 , m_xBtnAmbientColor(m_xBuilder->weld_button("colorbutton2"))
152
153 , m_xFLTexture(m_xBuilder->weld_container("textureframe"))
154 , m_xBtnTexLuminance(m_xBuilder->weld_toggle_button("textype"))
155 , m_xBtnTexColor(m_xBuilder->weld_toggle_button("texcolor"))
156 , m_xBtnTexReplace(m_xBuilder->weld_toggle_button("texreplace"))
157 , m_xBtnTexModulate(m_xBuilder->weld_toggle_button("texmodulate"))
158 , m_xBtnTexObjectX(m_xBuilder->weld_toggle_button("texobjx"))
159 , m_xBtnTexParallelX(m_xBuilder->weld_toggle_button("texparallelx"))
160 , m_xBtnTexCircleX(m_xBuilder->weld_toggle_button("texcirclex"))
161 , m_xBtnTexObjectY(m_xBuilder->weld_toggle_button("texobjy"))
162 , m_xBtnTexParallelY(m_xBuilder->weld_toggle_button("texparallely"))
163 , m_xBtnTexCircleY(m_xBuilder->weld_toggle_button("texcircley"))
164 , m_xBtnTexFilter(m_xBuilder->weld_toggle_button("texfilter"))
165
166 , m_xFLMaterial(m_xBuilder->weld_container("materialframe"))
167 , m_xLbMatFavorites(m_xBuilder->weld_combo_box("favorites"))
168 , m_xLbMatColor(new ColorListBox(m_xBuilder->weld_menu_button("objcolor"), [this]{ return GetFrameWeld(); }))
169 , m_xBtnMatColor(m_xBuilder->weld_button("colorbutton3"))
170 , m_xLbMatEmission(new ColorListBox(m_xBuilder->weld_menu_button("illumcolor"), [this]{ return GetFrameWeld(); }))
171 , m_xBtnEmissionColor(m_xBuilder->weld_button("colorbutton4"))
172
173 , m_xFLMatSpecular(m_xBuilder->weld_container("specframe"))
174 , m_xLbMatSpecular(new ColorListBox(m_xBuilder->weld_menu_button("speccolor"), [this]{ return GetFrameWeld(); }))
175 , m_xBtnSpecularColor(m_xBuilder->weld_button("colorbutton5"))
176 , m_xMtrMatSpecularIntensity(m_xBuilder->weld_metric_spin_button("intensity", FieldUnit::PERCENT))
177
178 , m_xCtlPreview(new Svx3DPreviewControl)
179 , m_xCtlPreviewWin(new weld::CustomWeld(*m_xBuilder, "preview", *m_xCtlPreview))
180
181 , m_xLightPreviewGrid(m_xBuilder->weld_container("lightpreviewgrid"))
182 , m_xHoriScale(m_xBuilder->weld_scale("horiscale"))
183 , m_xVertScale(m_xBuilder->weld_scale("vertscale"))
184 , m_xBtn_Corner(m_xBuilder->weld_button("corner"))
185 , m_xLightPreview(new Svx3DLightControl)
186 , m_xCtlLightPreviewWin(new weld::CustomWeld(*m_xBuilder, "lightpreview", *m_xLightPreview))
187 , m_xCtlLightPreview(new SvxLightCtl3D(*m_xLightPreview, *m_xHoriScale, *m_xVertScale, *m_xBtn_Corner)) // TODO might be other body widget as arg 1
188
189 , m_xBtnConvertTo3D(m_xBuilder->weld_button("to3d"))
190 , m_xBtnLatheObject(m_xBuilder->weld_button("tolathe"))
191 , m_xBtnPerspective(m_xBuilder->weld_toggle_button("perspective"))
192
193 , bUpdate(false)
194 , eViewType(ViewType3D::Geo)
195 , pBindings(pInBindings)
196 , mpImpl(new Svx3DWinImpl)
197 , ePoolUnit(MapUnit::MapMM)
198{
199 SetText(SvxResId(RID_SVXDLG_FLOAT3D_STR_TITLE));
200
201 weld::DrawingArea* pDrawingArea = m_xCtlPreview->GetDrawingArea();
202 Size aSize(pDrawingArea->get_ref_device().LogicToPixel(Size(83, 76), MapMode(MapUnit::MapAppFont)));
203 pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
204 m_xCtlPreview->SetOutputSizePixel(aSize);
205
206 m_xLightPreviewGrid->set_size_request(aSize.Width(), aSize.Height());
207 pDrawingArea = m_xLightPreview->GetDrawingArea();
208 pDrawingArea->set_size_request(42, 42); // small to fit to m_xLightPreviewGrid
209
210 mpImpl->pPool = nullptr;
211
212 // Set Metric
213 eFUnit = pInBindings->GetDispatcher()->GetModule()->GetFieldUnit();
214
215 m_xMtrDepth->set_unit( eFUnit );
216 m_xMtrDistance->set_unit( eFUnit );
217 m_xMtrFocalLength->set_unit( eFUnit );
218
219 pControllerItem.reset( new Svx3DCtrlItem(SID_3D_STATE, pBindings) );
220 pConvertTo3DItem.reset( new SvxConvertTo3DItem(SID_CONVERT_TO_3D, pBindings) );
221 pConvertTo3DLatheItem.reset( new SvxConvertTo3DItem(SID_CONVERT_TO_3D_LATHE_FAST, pBindings) );
222
223 m_xBtnAssign->connect_clicked( LINK( this, Svx3DWin, ClickAssignHdl ) );
224 m_xBtnUpdate->connect_toggled( LINK( this, Svx3DWin, ClickUpdateHdl ) );
225
226 Link<weld::Button&,void> aLink( LINK( this, Svx3DWin, ClickViewTypeHdl ) );
227 m_xBtnGeo->connect_clicked( aLink );
228 m_xBtnRepresentation->connect_clicked( aLink );
229 m_xBtnLight->connect_clicked( aLink );
230 m_xBtnTexture->connect_clicked( aLink );
231 m_xBtnMaterial->connect_clicked( aLink );
232
233 aLink = LINK( this, Svx3DWin, ClickHdl );
234 m_xBtnPerspective->connect_clicked( aLink );
235 m_xBtnConvertTo3D->connect_clicked( aLink );
236 m_xBtnLatheObject->connect_clicked( aLink );
237
238 // Geometry
239 m_xBtnNormalsObj->connect_clicked( aLink );
240 m_xBtnNormalsFlat->connect_clicked( aLink );
241 m_xBtnNormalsSphere->connect_clicked( aLink );
242 m_xBtnTwoSidedLighting->connect_clicked( aLink );
243 m_xBtnNormalsInvert->connect_clicked( aLink );
244 m_xBtnDoubleSided->connect_clicked( aLink );
245
246 // Representation
247 m_xBtnShadow3d->connect_clicked( aLink );
248
249 // Lighting
250 m_xBtnLight1->connect_clicked( aLink );
251 m_xBtnLight2->connect_clicked( aLink );
252 m_xBtnLight3->connect_clicked( aLink );
253 m_xBtnLight4->connect_clicked( aLink );
254 m_xBtnLight5->connect_clicked( aLink );
255 m_xBtnLight6->connect_clicked( aLink );
256 m_xBtnLight7->connect_clicked( aLink );
257 m_xBtnLight8->connect_clicked( aLink );
258
259 // Textures
260 m_xBtnTexLuminance->connect_clicked( aLink );
261 m_xBtnTexColor->connect_clicked( aLink );
262 m_xBtnTexReplace->connect_clicked( aLink );
263 m_xBtnTexModulate->connect_clicked( aLink );
264 m_xBtnTexParallelX->connect_clicked( aLink );
265 m_xBtnTexCircleX->connect_clicked( aLink );
266 m_xBtnTexObjectX->connect_clicked( aLink );
267 m_xBtnTexParallelY->connect_clicked( aLink );
268 m_xBtnTexCircleY->connect_clicked( aLink );
269 m_xBtnTexObjectY->connect_clicked( aLink );
270 m_xBtnTexFilter->connect_clicked( aLink );
271
272 // Material
273 aLink = LINK( this, Svx3DWin, ClickColorHdl );
274 m_xBtnLightColor->connect_clicked( aLink );
275 m_xBtnAmbientColor->connect_clicked( aLink );
276 m_xBtnMatColor->connect_clicked( aLink );
277 m_xBtnEmissionColor->connect_clicked( aLink );
278 m_xBtnSpecularColor->connect_clicked( aLink );
279
280
281 Link<weld::ComboBox&,void> aLink2 = LINK( this, Svx3DWin, SelectHdl );
282 Link<ColorListBox&,void> aLink4 = LINK( this, Svx3DWin, SelectColorHdl );
283 m_xLbMatFavorites->connect_changed( aLink2 );
284 m_xLbMatColor->SetSelectHdl( aLink4 );
285 m_xLbMatEmission->SetSelectHdl( aLink4 );
286 m_xLbMatSpecular->SetSelectHdl( aLink4 );
287 m_xLbLight1->SetSelectHdl( aLink4 );
288 m_xLbLight2->SetSelectHdl( aLink4 );
289 m_xLbLight3->SetSelectHdl( aLink4 );
290 m_xLbLight4->SetSelectHdl( aLink4 );
291 m_xLbLight5->SetSelectHdl( aLink4 );
292 m_xLbLight6->SetSelectHdl( aLink4 );
293 m_xLbLight7->SetSelectHdl( aLink4 );
294 m_xLbLight8->SetSelectHdl( aLink4 );
295 m_xLbAmbientlight->SetSelectHdl( aLink4 );
296 m_xLbShademode->connect_changed( aLink2 );
297
298 Link<weld::MetricSpinButton&,void> aLink3 = LINK( this, Svx3DWin, ModifyMetricHdl );
299 Link<weld::SpinButton&,void> aLink5 = LINK( this, Svx3DWin, ModifySpinHdl );
300 m_xMtrMatSpecularIntensity->connect_value_changed( aLink3 );
301 m_xNumHorizontal->connect_value_changed( aLink5 );
302 m_xNumVertical->connect_value_changed( aLink5 );
303 m_xMtrSlant->connect_value_changed( aLink3 );
304
305 // Preview callback
306 m_xCtlLightPreview->SetUserSelectionChangeCallback(LINK( this, Svx3DWin, ChangeSelectionCallbackHdl ));
307
308 aSize = GetOutputSizePixel();
309 SetMinOutputSizePixel( aSize );
310
311 Construct();
312
313 // Initiation of the initialization of the ColorLBs
314 SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
315 if (pDispatcher != nullptr)
316 {
317 SfxBoolItem aItem( SID_3D_INIT, true );
318 pDispatcher->ExecuteList(SID_3D_INIT,
319 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem });
320 }
321
322 Reset();
323
324 //lock down the size of the initial largest default mode as the permanent size
325 aSize = get_preferred_size();
326 set_width_request(aSize.Width());
327 set_height_request(aSize.Height());
328}
329
331{
332 disposeOnce();
333}
334
336{
337 pModel.reset();
338
339 pControllerItem.reset();
340 pConvertTo3DItem.reset();
341 pConvertTo3DLatheItem.reset();
342
343 mpImpl.reset();
344
345 m_xBtnGeo.reset();
346 m_xBtnRepresentation.reset();
347 m_xBtnLight.reset();
348 m_xBtnTexture.reset();
349 m_xBtnMaterial.reset();
350 m_xBtnUpdate.reset();
351 m_xBtnAssign.reset();
352 m_xFLGeometrie.reset();
353 m_xFtPercentDiagonal.reset();
354 m_xMtrPercentDiagonal.reset();
355 m_xFtBackscale.reset();
356 m_xMtrBackscale.reset();
357 m_xFtEndAngle.reset();
358 m_xMtrEndAngle.reset();
359 m_xFtDepth.reset();
360 m_xMtrDepth.reset();
361 m_xFLSegments.reset();
362 m_xNumHorizontal.reset();
363 m_xNumVertical.reset();
364 m_xFLNormals.reset();
365 m_xBtnNormalsObj.reset();
366 m_xBtnNormalsFlat.reset();
367 m_xBtnNormalsSphere.reset();
368 m_xBtnNormalsInvert.reset();
370 m_xBtnDoubleSided.reset();
371 m_xFLRepresentation.reset();
372 m_xLbShademode.reset();
373 m_xFLShadow.reset();
374 m_xBtnShadow3d.reset();
375 m_xFtSlant.reset();
376 m_xMtrSlant.reset();
377 m_xFLCamera.reset();
378 m_xMtrDistance.reset();
379 m_xMtrFocalLength.reset();
380 m_xFLLight.reset();
381 m_xBtnLight1.reset();
382 m_xBtnLight2.reset();
383 m_xBtnLight3.reset();
384 m_xBtnLight4.reset();
385 m_xBtnLight5.reset();
386 m_xBtnLight6.reset();
387 m_xBtnLight7.reset();
388 m_xBtnLight8.reset();
389 m_xLbLight1.reset();
390 m_xLbLight2.reset();
391 m_xLbLight3.reset();
392 m_xLbLight4.reset();
393 m_xLbLight5.reset();
394 m_xLbLight6.reset();
395 m_xLbLight7.reset();
396 m_xLbLight8.reset();
397 m_xBtnLightColor.reset();
398 m_xLbAmbientlight.reset();
399 m_xBtnAmbientColor.reset();
400 m_xFLTexture.reset();
401 m_xBtnTexLuminance.reset();
402 m_xBtnTexColor.reset();
403 m_xBtnTexReplace.reset();
404 m_xBtnTexModulate.reset();
405 m_xBtnTexObjectX.reset();
406 m_xBtnTexParallelX.reset();
407 m_xBtnTexCircleX.reset();
408 m_xBtnTexObjectY.reset();
409 m_xBtnTexParallelY.reset();
410 m_xBtnTexCircleY.reset();
411 m_xBtnTexFilter.reset();
412 m_xFLMaterial.reset();
413 m_xLbMatFavorites.reset();
414 m_xLbMatColor.reset();
415 m_xBtnMatColor.reset();
416 m_xLbMatEmission.reset();
417 m_xBtnEmissionColor.reset();
418 m_xFLMatSpecular.reset();
419 m_xLbMatSpecular.reset();
420 m_xBtnSpecularColor.reset();
422 m_xCtlPreviewWin.reset();
423 m_xCtlPreview.reset();
424
425 m_xCtlLightPreview.reset();
426 m_xCtlLightPreviewWin.reset();
427 m_xLightPreview.reset();
428 m_xBtn_Corner.reset();
429 m_xVertScale.reset();
430 m_xHoriScale.reset();
431 m_xLightPreviewGrid.reset();
432
433 m_xBtnConvertTo3D.reset();
434 m_xBtnLatheObject.reset();
435 m_xBtnPerspective.reset();
436
438}
439
441{
442 m_xBtnGeo->set_active(true);
443 ClickViewTypeHdl(*m_xBtnGeo);
444 m_xLightPreviewGrid->hide();
445}
446
448{
449 // Various initializations, default is AllAttributes
450 m_xLbShademode->set_active( 0 );
451 m_xMtrMatSpecularIntensity->set_value( 50, FieldUnit::PERCENT );
452
453 m_xBtnLight1->set_active(true);
454 m_xBtnUpdate->set_active(true);
455 ClickUpdateHdl(*m_xBtnUpdate);
456
457 // Select nothing, to avoid errors when selecting the first
458 m_xCtlLightPreview->GetSvx3DLightControl().SelectLight(0);
459 m_xCtlLightPreview->CheckSelection();
460}
461
462void Svx3DWin::Update( SfxItemSet const & rAttrs )
463{
464 // remember 2d attributes
466 mpRemember2DAttributes->ClearItem();
467 else
468 mpRemember2DAttributes = std::make_unique<SfxItemSetFixed
471
473 sal_uInt16 nWhich(aIter.FirstWhich());
474
475 while(nWhich)
476 {
477 SfxItemState eState = rAttrs.GetItemState(nWhich, false);
478 if(SfxItemState::DONTCARE == eState)
479 mpRemember2DAttributes->InvalidateItem(nWhich);
480 else if(SfxItemState::SET == eState)
481 mpRemember2DAttributes->Put(rAttrs.Get(nWhich, false));
482
483 nWhich = aIter.NextWhich();
484 }
485
486 // construct field values
487 const SfxPoolItem* pItem;
488
489 // Possible determine PoolUnit
490 if( !mpImpl->pPool )
491 {
492 mpImpl->pPool = rAttrs.GetPool();
493 DBG_ASSERT( mpImpl->pPool, "Where is the Pool? ");
494 ePoolUnit = mpImpl->pPool->GetMetric( SID_ATTR_LINE_WIDTH );
495 }
496 eFUnit = GetModuleFieldUnit( rAttrs );
497
498
499 // Segment Number Can be changed? and other states
500 SfxItemState eState = rAttrs.GetItemState( SID_ATTR_3D_INTERN, false, &pItem );
501 if( SfxItemState::SET == eState )
502 {
503 sal_uInt32 nState = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
504 bool bExtrude = ( nState & 2 );
505 bool bSphere = ( nState & 4 );
506 bool bCube = ( nState & 8 );
507
508 bool bChart = ( nState & 32 ); // Chart
509
510 if( !bChart )
511 {
512 // For cube objects are no segments set
513 m_xFLSegments->set_sensitive(!bCube);
514
515 m_xFtPercentDiagonal->set_sensitive( !bCube && !bSphere );
516 m_xMtrPercentDiagonal->set_sensitive( !bCube && !bSphere );
517 m_xFtBackscale->set_sensitive( !bCube && !bSphere );
518 m_xMtrBackscale->set_sensitive( !bCube && !bSphere );
519 m_xFtDepth->set_sensitive( !bCube && !bSphere );
520 m_xMtrDepth->set_sensitive( !bCube && !bSphere );
521 if( bCube )
522 {
523 m_xNumHorizontal->set_text("");
524 m_xNumVertical->set_text("");
525 }
526 if( bCube || bSphere )
527 {
528 m_xMtrPercentDiagonal->set_text("");
529 m_xMtrBackscale->set_text("");
530 m_xMtrDepth->set_text("");
531 }
532
533 // There is a final angle only for Lathe objects.
534 m_xFtEndAngle->set_sensitive( !bExtrude && !bCube && !bSphere );
535 m_xMtrEndAngle->set_sensitive( !bExtrude && !bCube && !bSphere );
536 if( bExtrude || bCube || bSphere )
537 m_xMtrEndAngle->set_text("");
538 }
539 else
540 {
541 // Geometry
542 m_xNumHorizontal->set_text("");
543 m_xNumVertical->set_text("");
544 m_xFLSegments->set_sensitive( false );
545 m_xFtEndAngle->set_sensitive( false );
546 m_xMtrEndAngle->set_sensitive( false );
547 m_xMtrEndAngle->set_text("");
548 m_xFtDepth->set_sensitive( false );
549 m_xMtrDepth->set_sensitive( false );
550 m_xMtrDepth->set_text("");
551
552 // Representation
553 m_xFLShadow->set_sensitive(false);
554
555 m_xMtrDistance->set_text("");
556 m_xMtrFocalLength->set_text("");
557 m_xFLCamera->set_sensitive( false );
558
559 //Lower Range
560 m_xBtnConvertTo3D->set_sensitive( false );
561 m_xBtnLatheObject->set_sensitive( false );
562 }
563 }
564 // Bitmap fill ? -> Status
565 bool bBitmap(false);
566 eState = rAttrs.GetItemState(XATTR_FILLSTYLE);
567 if(eState != SfxItemState::DONTCARE)
568 {
569 drawing::FillStyle eXFS = rAttrs.Get(XATTR_FILLSTYLE).GetValue();
570 bBitmap = (eXFS == drawing::FillStyle_BITMAP || eXFS == drawing::FillStyle_GRADIENT || eXFS == drawing::FillStyle_HATCH);
571 }
572
573 m_xFLTexture->set_sensitive(bBitmap);
574
575 // Geometry
576 // Number of segments (horizontal)
577 if( m_xNumHorizontal->get_sensitive() )
578 {
579 eState = rAttrs.GetItemState(SDRATTR_3DOBJ_HORZ_SEGS);
580 if(eState != SfxItemState::DONTCARE)
581 {
582 sal_uInt32 nValue = rAttrs.Get(SDRATTR_3DOBJ_HORZ_SEGS).GetValue();
583 if (nValue != static_cast<sal_uInt32>(m_xNumHorizontal->get_value()))
584 {
585 m_xNumHorizontal->set_value( nValue );
586 bUpdate = true;
587 }
588 else if( m_xNumHorizontal->get_text().isEmpty() )
589 m_xNumHorizontal->set_value( nValue );
590 }
591 else
592 {
593 if( !m_xNumHorizontal->get_text().isEmpty() )
594 {
595 m_xNumHorizontal->set_text("");
596 bUpdate = true;
597 }
598 }
599 }
600
601 //Number of segments (vertical)
602 if( m_xNumVertical->get_sensitive() )
603 {
604 eState = rAttrs.GetItemState(SDRATTR_3DOBJ_VERT_SEGS);
605 if( eState != SfxItemState::DONTCARE )
606 {
607 sal_uInt32 nValue = rAttrs.Get(SDRATTR_3DOBJ_VERT_SEGS).GetValue();
608 if( nValue != static_cast<sal_uInt32>(m_xNumVertical->get_value()) )
609 {
610 m_xNumVertical->set_value( nValue );
611 bUpdate = true;
612 }
613 else if( m_xNumVertical->get_text().isEmpty() )
614 m_xNumVertical->set_value( nValue );
615 }
616 else
617 {
618 if( !m_xNumVertical->get_text().isEmpty() )
619 {
620 m_xNumVertical->set_text("");
621 bUpdate = true;
622 }
623 }
624 }
625
626 // Depth
627 if( m_xMtrDepth->get_sensitive() )
628 {
629 eState = rAttrs.GetItemState(SDRATTR_3DOBJ_DEPTH);
630 if( eState != SfxItemState::DONTCARE )
631 {
632 sal_uInt32 nValue = rAttrs.Get(SDRATTR_3DOBJ_DEPTH).GetValue();
633 sal_uInt32 nValue2 = GetCoreValue(*m_xMtrDepth, ePoolUnit);
634 if( nValue != nValue2 )
635 {
636 if( eFUnit != m_xMtrDepth->get_unit() )
638
640 bUpdate = true;
641 }
642 else if( m_xMtrDepth->get_text().isEmpty() )
643 m_xMtrDepth->set_value(m_xMtrDepth->get_value(FieldUnit::NONE), FieldUnit::NONE);
644 }
645 else
646 {
647 if( !m_xMtrDepth->get_text().isEmpty() )
648 {
649 m_xMtrDepth->set_text("");
650 bUpdate = true;
651 }
652 }
653 }
654
655 // Double walled / Double sided
657 if( eState != SfxItemState::DONTCARE )
658 {
659 bool bValue = rAttrs.Get(SDRATTR_3DOBJ_DOUBLE_SIDED).GetValue();
660 if( bValue != m_xBtnDoubleSided->get_active() )
661 {
662 m_xBtnDoubleSided->set_active( bValue );
663 bUpdate = true;
664 }
665 else if( m_xBtnDoubleSided->get_state() == TRISTATE_INDET )
666 m_xBtnDoubleSided->set_active( bValue );
667 }
668 else
669 {
670 if( m_xBtnDoubleSided->get_state() != TRISTATE_INDET )
671 {
672 m_xBtnDoubleSided->set_state( TRISTATE_INDET );
673 bUpdate = true;
674 }
675 }
676
677 // Edge rounding
678 if( m_xMtrPercentDiagonal->get_sensitive() )
679 {
681 if( eState != SfxItemState::DONTCARE )
682 {
683 sal_uInt16 nValue = rAttrs.Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL).GetValue();
684 if( nValue != m_xMtrPercentDiagonal->get_value(FieldUnit::PERCENT) )
685 {
686 m_xMtrPercentDiagonal->set_value(nValue, FieldUnit::PERCENT);
687 bUpdate = true;
688 }
689 else if( m_xMtrPercentDiagonal->get_text().isEmpty() )
690 m_xMtrPercentDiagonal->set_value(nValue, FieldUnit::PERCENT);
691 }
692 else
693 {
694 if( !m_xMtrPercentDiagonal->get_text().isEmpty() )
695 {
696 m_xMtrPercentDiagonal->set_text("");
697 bUpdate = true;
698 }
699 }
700 }
701
702 // Depth scaling
703 if( m_xMtrBackscale->get_sensitive() )
704 {
705 eState = rAttrs.GetItemState(SDRATTR_3DOBJ_BACKSCALE);
706 if( eState != SfxItemState::DONTCARE )
707 {
708 sal_uInt16 nValue = rAttrs.Get(SDRATTR_3DOBJ_BACKSCALE).GetValue();
709 if( nValue != m_xMtrBackscale->get_value(FieldUnit::PERCENT) )
710 {
711 m_xMtrBackscale->set_value(nValue, FieldUnit::PERCENT);
712 bUpdate = true;
713 }
714 else if( m_xMtrBackscale->get_text().isEmpty() )
715 m_xMtrBackscale->set_value(nValue, FieldUnit::PERCENT);
716 }
717 else
718 {
719 if( !m_xMtrBackscale->get_text().isEmpty() )
720 {
721 m_xMtrBackscale->set_text("");
722 bUpdate = true;
723 }
724 }
725 }
726
727 // End angle
728 if( m_xMtrEndAngle->get_sensitive() )
729 {
730 eState = rAttrs.GetItemState(SDRATTR_3DOBJ_END_ANGLE);
731 if( eState != SfxItemState::DONTCARE )
732 {
733 sal_Int32 nValue = rAttrs.Get(SDRATTR_3DOBJ_END_ANGLE).GetValue();
734 if( nValue != m_xMtrEndAngle->get_value(FieldUnit::DEGREE) )
735 {
736 m_xMtrEndAngle->set_value(nValue, FieldUnit::DEGREE);
737 bUpdate = true;
738 }
739 }
740 else
741 {
742 if( !m_xMtrEndAngle->get_text().isEmpty() )
743 {
744 m_xMtrEndAngle->set_text("");
745 bUpdate = true;
746 }
747 }
748 }
749
750 // Normal type
752 if( eState != SfxItemState::DONTCARE )
753 {
754 sal_uInt16 nValue = rAttrs.Get(SDRATTR_3DOBJ_NORMALS_KIND).GetValue();
755
756 if( ( !m_xBtnNormalsObj->get_active() && nValue == 0 ) ||
757 ( !m_xBtnNormalsFlat->get_active() && nValue == 1 ) ||
758 ( !m_xBtnNormalsSphere->get_active() && nValue == 2 ) )
759 {
760 m_xBtnNormalsObj->set_active( nValue == 0 );
761 m_xBtnNormalsFlat->set_active( nValue == 1 );
762 m_xBtnNormalsSphere->set_active( nValue == 2 );
763 bUpdate = true;
764 }
765 }
766 else
767 {
768 if( m_xBtnNormalsObj->get_active() ||
769 m_xBtnNormalsFlat->get_active() ||
770 m_xBtnNormalsSphere->get_active() )
771 {
772 m_xBtnNormalsObj->set_active( false );
773 m_xBtnNormalsFlat->set_active( false );
774 m_xBtnNormalsSphere->set_active( false );
775 bUpdate = true;
776 }
777 }
778
779 // Normal inverted
781 if( eState != SfxItemState::DONTCARE )
782 {
783 bool bValue = rAttrs.Get(SDRATTR_3DOBJ_NORMALS_INVERT).GetValue();
784 if( bValue != m_xBtnNormalsInvert->get_active() )
785 {
786 m_xBtnNormalsInvert->set_active( bValue );
787 bUpdate = true;
788 }
789 else if( m_xBtnNormalsInvert->get_state() == TRISTATE_INDET )
790 m_xBtnNormalsInvert->set_active( bValue );
791 }
792 else
793 {
794 if( m_xBtnNormalsInvert->get_state() != TRISTATE_INDET )
795 {
797 bUpdate = true;
798 }
799 }
800
801 // 2-sided lighting
803 if( eState != SfxItemState::DONTCARE )
804 {
805 bool bValue = rAttrs.Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING).GetValue();
806 if( bValue != m_xBtnTwoSidedLighting->get_active() )
807 {
808 m_xBtnTwoSidedLighting->set_active( bValue );
809 bUpdate = true;
810 }
811 else if( m_xBtnTwoSidedLighting->get_state() == TRISTATE_INDET )
812 m_xBtnTwoSidedLighting->set_active( bValue );
813 }
814 else
815 {
816 if( m_xBtnTwoSidedLighting->get_state() != TRISTATE_INDET )
817 {
819 bUpdate = true;
820 }
821 }
822
823 // Representation
824 // Shademode
826 if( eState != SfxItemState::DONTCARE )
827 {
828 sal_uInt16 nValue = rAttrs.Get(SDRATTR_3DSCENE_SHADE_MODE).GetValue();
829 if( nValue != m_xLbShademode->get_active() )
830 {
831 m_xLbShademode->set_active( nValue );
832 bUpdate = true;
833 }
834 }
835 else
836 {
837 if( m_xLbShademode->get_active() != 0 )
838 {
839 m_xLbShademode->set_active(-1);
840 bUpdate = true;
841 }
842 }
843
844 // 3D-Shadow
845 eState = rAttrs.GetItemState(SDRATTR_3DOBJ_SHADOW_3D);
846 if( eState != SfxItemState::DONTCARE )
847 {
848 bool bValue = rAttrs.Get(SDRATTR_3DOBJ_SHADOW_3D).GetValue();
849 if( bValue != m_xBtnShadow3d->get_active() )
850 {
851 m_xBtnShadow3d->set_active( bValue );
852 m_xFtSlant->set_sensitive( bValue );
853 m_xMtrSlant->set_sensitive( bValue );
854 bUpdate = true;
855 }
856 else if( m_xBtnShadow3d->get_state() == TRISTATE_INDET )
857 m_xBtnShadow3d->set_active( bValue );
858 }
859 else
860 {
861 if( m_xBtnShadow3d->get_state() != TRISTATE_INDET )
862 {
863 m_xBtnShadow3d->set_state( TRISTATE_INDET );
864 bUpdate = true;
865 }
866 }
867
868 // Inclination (Shadow)
870 if( eState != SfxItemState::DONTCARE )
871 {
872 sal_uInt16 nValue = rAttrs.Get(SDRATTR_3DSCENE_SHADOW_SLANT).GetValue();
873 if( nValue != m_xMtrSlant->get_value(FieldUnit::DEGREE) )
874 {
875 m_xMtrSlant->set_value(nValue, FieldUnit::DEGREE);
876 bUpdate = true;
877 }
878 }
879 else
880 {
881 if( !m_xMtrSlant->get_text().isEmpty() )
882 {
883 m_xMtrSlant->set_text("");
884 bUpdate = true;
885 }
886 }
887
888 // Distance
889 eState = rAttrs.GetItemState(SDRATTR_3DSCENE_DISTANCE);
890 if( eState != SfxItemState::DONTCARE )
891 {
892 sal_uInt32 nValue = rAttrs.Get(SDRATTR_3DSCENE_DISTANCE).GetValue();
893 sal_uInt32 nValue2 = GetCoreValue(*m_xMtrDistance, ePoolUnit);
894 if( nValue != nValue2 )
895 {
896 if( eFUnit != m_xMtrDistance->get_unit() )
898
900 bUpdate = true;
901 }
902 }
903 else
904 {
905 if( !m_xMtrDepth->get_text().isEmpty() )
906 {
907 m_xMtrDepth->set_text("");
908 bUpdate = true;
909 }
910 }
911
912 // Focal length
914 if( eState != SfxItemState::DONTCARE )
915 {
916 sal_uInt32 nValue = rAttrs.Get(SDRATTR_3DSCENE_FOCAL_LENGTH).GetValue();
917 sal_uInt32 nValue2 = GetCoreValue(*m_xMtrFocalLength, ePoolUnit);
918 if( nValue != nValue2 )
919 {
920 if( eFUnit != m_xMtrFocalLength->get_unit() )
922
924 bUpdate = true;
925 }
926 }
927 else
928 {
929 if( !m_xMtrFocalLength->get_text().isEmpty() )
930 {
931 m_xMtrFocalLength->set_text("");
932 bUpdate = true;
933 }
934 }
935
936// Lighting
937 Color aColor;
938 // Light 1 (Color)
940 if( eState != SfxItemState::DONTCARE )
941 {
942 aColor = rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1).GetValue();
943 ColorListBox* pLb = m_xLbLight1.get();
944 if( aColor != pLb->GetSelectEntryColor() )
945 {
946 LBSelectColor( pLb, aColor );
947 bUpdate = true;
948 }
949 }
950 else
951 {
952 if (!m_xLbLight1->IsNoSelection())
953 {
954 m_xLbLight1->SetNoSelection();
955 bUpdate = true;
956 }
957 }
958 // Light 1 (on/off)
960 if( eState != SfxItemState::DONTCARE )
961 {
962 bool bOn = rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_1).GetValue();
963 if (bOn != m_xBtnLight1->isLightOn())
964 {
965 m_xBtnLight1->switchLightOn(bOn);
966 bUpdate = true;
967 }
968 if( m_xBtnLight1->get_state() == TRISTATE_INDET )
969 m_xBtnLight1->set_active( m_xBtnLight1->get_active() );
970 }
971 else
972 {
973 if( m_xBtnLight1->get_state() != TRISTATE_INDET )
974 {
975 m_xBtnLight1->set_state( TRISTATE_INDET );
976 bUpdate = true;
977 }
978 }
979 // Light 1 (direction)
981 if( eState != SfxItemState::DONTCARE )
982 {
983 bUpdate = true;
984 }
985
986 //Light 2 (color)
988 if( eState != SfxItemState::DONTCARE )
989 {
990 aColor = rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2).GetValue();
991 ColorListBox* pLb = m_xLbLight2.get();
992 if( aColor != pLb->GetSelectEntryColor() )
993 {
994 LBSelectColor( pLb, aColor );
995 bUpdate = true;
996 }
997 }
998 else
999 {
1000 if (!m_xLbLight2->IsNoSelection())
1001 {
1002 m_xLbLight2->SetNoSelection();
1003 bUpdate = true;
1004 }
1005 }
1006 // Light 2 (on/off)
1007 eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_2);
1008 if( eState != SfxItemState::DONTCARE )
1009 {
1010 bool bOn = rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_2).GetValue();
1011 if (bOn != m_xBtnLight2->isLightOn())
1012 {
1013 m_xBtnLight2->switchLightOn(bOn);
1014 bUpdate = true;
1015 }
1016 if( m_xBtnLight2->get_state() == TRISTATE_INDET )
1017 m_xBtnLight2->set_active( m_xBtnLight2->get_active() );
1018 }
1019 else
1020 {
1021 if( m_xBtnLight2->get_state() != TRISTATE_INDET )
1022 {
1023 m_xBtnLight2->set_state( TRISTATE_INDET );
1024 bUpdate = true;
1025 }
1026 }
1027 //Light 2 (Direction)
1029 if( eState != SfxItemState::DONTCARE )
1030 {
1031 bUpdate = true;
1032 }
1033
1034 //Light 3 (color)
1036 if( eState != SfxItemState::DONTCARE )
1037 {
1038 aColor = rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3).GetValue();
1039 ColorListBox* pLb = m_xLbLight3.get();
1040 if( aColor != pLb->GetSelectEntryColor() )
1041 {
1042 LBSelectColor( pLb, aColor );
1043 bUpdate = true;
1044 }
1045 }
1046 else
1047 {
1048 if (!m_xLbLight3->IsNoSelection())
1049 {
1050 m_xLbLight3->SetNoSelection();
1051 bUpdate = true;
1052 }
1053 }
1054 // Light 3 (on/off)
1055 eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_3);
1056 if( eState != SfxItemState::DONTCARE )
1057 {
1058 bool bOn = rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_3).GetValue();
1059 if (bOn != m_xBtnLight3->isLightOn())
1060 {
1061 m_xBtnLight3->switchLightOn(bOn);
1062 bUpdate = true;
1063 }
1064 if( m_xBtnLight3->get_state() == TRISTATE_INDET )
1065 m_xBtnLight3->set_active( m_xBtnLight3->get_active() );
1066 }
1067 else
1068 {
1069 if( m_xBtnLight3->get_state() != TRISTATE_INDET )
1070 {
1071 m_xBtnLight3->set_state( TRISTATE_INDET );
1072 bUpdate = true;
1073 }
1074 }
1075 // Light 3 (Direction)
1077 if( eState != SfxItemState::DONTCARE )
1078 {
1079 bUpdate = true;
1080 }
1081
1082 // Light 4 (Color)
1084 if( eState != SfxItemState::DONTCARE )
1085 {
1086 aColor = rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4).GetValue();
1087 ColorListBox* pLb = m_xLbLight4.get();
1088 if( aColor != pLb->GetSelectEntryColor() )
1089 {
1090 LBSelectColor( pLb, aColor );
1091 bUpdate = true;
1092 }
1093 }
1094 else
1095 {
1096 if (!m_xLbLight4->IsNoSelection())
1097 {
1098 m_xLbLight4->SetNoSelection();
1099 bUpdate = true;
1100 }
1101 }
1102 // Light 4 (on/off)
1103 eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_4);
1104 if( eState != SfxItemState::DONTCARE )
1105 {
1106 bool bOn = rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_4).GetValue();
1107 if (bOn != m_xBtnLight4->isLightOn())
1108 {
1109 m_xBtnLight4->switchLightOn(bOn);
1110 bUpdate = true;
1111 }
1112 if( m_xBtnLight4->get_state() == TRISTATE_INDET )
1113 m_xBtnLight4->set_active( m_xBtnLight4->get_active() );
1114 }
1115 else
1116 {
1117 if( m_xBtnLight4->get_state() != TRISTATE_INDET )
1118 {
1119 m_xBtnLight4->set_state( TRISTATE_INDET );
1120 bUpdate = true;
1121 }
1122 }
1123 // Light 4 (direction)
1125 if( eState != SfxItemState::DONTCARE )
1126 {
1127 bUpdate = true;
1128 }
1129
1130 // Light 5 (color)
1132 if( eState != SfxItemState::DONTCARE )
1133 {
1134 aColor = rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5).GetValue();
1135 ColorListBox* pLb = m_xLbLight5.get();
1136 if( aColor != pLb->GetSelectEntryColor() )
1137 {
1138 LBSelectColor( pLb, aColor );
1139 bUpdate = true;
1140 }
1141 }
1142 else
1143 {
1144 if (!m_xLbLight5->IsNoSelection())
1145 {
1146 m_xLbLight5->SetNoSelection();
1147 bUpdate = true;
1148 }
1149 }
1150 // Light 5 (on/off)
1151 eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_5);
1152 if( eState != SfxItemState::DONTCARE )
1153 {
1154 bool bOn = rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_5).GetValue();
1155 if (bOn != m_xBtnLight5->isLightOn())
1156 {
1157 m_xBtnLight5->switchLightOn(bOn);
1158 bUpdate = true;
1159 }
1160 if( m_xBtnLight5->get_state() == TRISTATE_INDET )
1161 m_xBtnLight5->set_active( m_xBtnLight5->get_active() );
1162 }
1163 else
1164 {
1165 if( m_xBtnLight5->get_state() != TRISTATE_INDET )
1166 {
1167 m_xBtnLight5->set_state( TRISTATE_INDET );
1168 bUpdate = true;
1169 }
1170 }
1171 // Light 5 (direction)
1173 if( eState != SfxItemState::DONTCARE )
1174 {
1175 bUpdate = true;
1176 }
1177
1178 // Light 6 (color)
1180 if( eState != SfxItemState::DONTCARE )
1181 {
1182 aColor = rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6).GetValue();
1183 ColorListBox* pLb = m_xLbLight6.get();
1184 if( aColor != pLb->GetSelectEntryColor() )
1185 {
1186 LBSelectColor( pLb, aColor );
1187 bUpdate = true;
1188 }
1189 }
1190 else
1191 {
1192 if (!m_xLbLight6->IsNoSelection())
1193 {
1194 m_xLbLight6->SetNoSelection();
1195 bUpdate = true;
1196 }
1197 }
1198 // Light 6 (on/off)
1199 eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_6);
1200 if( eState != SfxItemState::DONTCARE )
1201 {
1202 bool bOn = rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_6).GetValue();
1203 if (bOn != m_xBtnLight6->isLightOn())
1204 {
1205 m_xBtnLight6->switchLightOn(bOn);
1206 bUpdate = true;
1207 }
1208 if( m_xBtnLight6->get_state() == TRISTATE_INDET )
1209 m_xBtnLight6->set_active( m_xBtnLight6->get_active() );
1210 }
1211 else
1212 {
1213 if( m_xBtnLight6->get_state() != TRISTATE_INDET )
1214 {
1215 m_xBtnLight6->set_state( TRISTATE_INDET );
1216 bUpdate = true;
1217 }
1218 }
1219 // Light 6 (direction)
1221 if( eState != SfxItemState::DONTCARE )
1222 {
1223 bUpdate = true;
1224 }
1225
1226 // Light 7 (color)
1228 if( eState != SfxItemState::DONTCARE )
1229 {
1230 aColor = rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7).GetValue();
1231 ColorListBox* pLb = m_xLbLight7.get();
1232 if( aColor != pLb->GetSelectEntryColor() )
1233 {
1234 LBSelectColor( pLb, aColor );
1235 bUpdate = true;
1236 }
1237 }
1238 else
1239 {
1240 if (!m_xLbLight7->IsNoSelection())
1241 {
1242 m_xLbLight7->SetNoSelection();
1243 bUpdate = true;
1244 }
1245 }
1246 // Light 7 (on/off)
1247 eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_7);
1248 if( eState != SfxItemState::DONTCARE )
1249 {
1250 bool bOn = rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_7).GetValue();
1251 if (bOn != m_xBtnLight7->isLightOn())
1252 {
1253 m_xBtnLight7->switchLightOn(bOn);
1254 bUpdate = true;
1255 }
1256 if( m_xBtnLight7->get_state() == TRISTATE_INDET )
1257 m_xBtnLight7->set_active( m_xBtnLight7->get_active() );
1258 }
1259 else
1260 {
1261 if( m_xBtnLight7->get_state() != TRISTATE_INDET )
1262 {
1263 m_xBtnLight7->set_state( TRISTATE_INDET );
1264 bUpdate = true;
1265 }
1266 }
1267 // Light 7 (direction)
1269 if( eState != SfxItemState::DONTCARE )
1270 {
1271 bUpdate = true;
1272 }
1273
1274 // Light 8 (color)
1276 if( eState != SfxItemState::DONTCARE )
1277 {
1278 aColor = rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8).GetValue();
1279 ColorListBox* pLb = m_xLbLight8.get();
1280 if( aColor != pLb->GetSelectEntryColor() )
1281 {
1282 LBSelectColor( pLb, aColor );
1283 bUpdate = true;
1284 }
1285 }
1286 else
1287 {
1288 if (!m_xLbLight8->IsNoSelection())
1289 {
1290 m_xLbLight8->SetNoSelection();
1291 bUpdate = true;
1292 }
1293 }
1294 // Light 8 (on/off)
1295 eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_8);
1296 if( eState != SfxItemState::DONTCARE )
1297 {
1298 bool bOn = rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_8).GetValue();
1299 if (bOn != m_xBtnLight8->isLightOn())
1300 {
1301 m_xBtnLight8->switchLightOn(bOn);
1302 bUpdate = true;
1303 }
1304 if( m_xBtnLight8->get_state() == TRISTATE_INDET )
1305 m_xBtnLight8->set_active( m_xBtnLight8->get_active() );
1306 }
1307 else
1308 {
1309 if( m_xBtnLight8->get_state() != TRISTATE_INDET )
1310 {
1311 m_xBtnLight8->set_state( TRISTATE_INDET );
1312 bUpdate = true;
1313 }
1314 }
1315 // Light 8 (direction)
1317 if( eState != SfxItemState::DONTCARE )
1318 {
1319 bUpdate = true;
1320 }
1321
1322 // Ambient light
1324 if( eState != SfxItemState::DONTCARE )
1325 {
1326 aColor = rAttrs.Get(SDRATTR_3DSCENE_AMBIENTCOLOR).GetValue();
1327 ColorListBox* pLb = m_xLbAmbientlight.get();
1328 if( aColor != pLb->GetSelectEntryColor() )
1329 {
1330 LBSelectColor( pLb, aColor );
1331 bUpdate = true;
1332 }
1333 }
1334 else
1335 {
1336 if (!m_xLbAmbientlight->IsNoSelection())
1337 {
1338 m_xLbAmbientlight->SetNoSelection();
1339 bUpdate = true;
1340 }
1341 }
1342
1343
1344// Textures
1345 // Art
1346 if( bBitmap )
1347 {
1349 if( eState != SfxItemState::DONTCARE )
1350 {
1351 sal_uInt16 nValue = rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_KIND).GetValue();
1352
1353 if( ( !m_xBtnTexLuminance->get_active() && nValue == 1 ) ||
1354 ( !m_xBtnTexColor->get_active() && nValue == 3 ) )
1355 {
1356 m_xBtnTexLuminance->set_active( nValue == 1 );
1357 m_xBtnTexColor->set_active( nValue == 3 );
1358 bUpdate = true;
1359 }
1360 }
1361 else
1362 {
1363 if( m_xBtnTexLuminance->get_active() ||
1364 m_xBtnTexColor->get_active() )
1365 {
1366 m_xBtnTexLuminance->set_active( false );
1367 m_xBtnTexColor->set_active( false );
1368 bUpdate = true;
1369 }
1370 }
1371
1372 // Mode
1374 if( eState != SfxItemState::DONTCARE )
1375 {
1376 sal_uInt16 nValue = rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_MODE).GetValue();
1377
1378 if( ( !m_xBtnTexReplace->get_active() && nValue == 1 ) ||
1379 ( !m_xBtnTexModulate->get_active() && nValue == 2 ) )
1380 {
1381 m_xBtnTexReplace->set_active( nValue == 1 );
1382 m_xBtnTexModulate->set_active( nValue == 2 );
1383 bUpdate = true;
1384 }
1385 }
1386 else
1387 {
1388 if( m_xBtnTexReplace->get_active() ||
1389 m_xBtnTexModulate->get_active() )
1390 {
1391 m_xBtnTexReplace->set_active( false );
1392 m_xBtnTexModulate->set_active( false );
1393 bUpdate = true;
1394 }
1395 }
1396
1397 // Projection X
1399 if( eState != SfxItemState::DONTCARE )
1400 {
1401 sal_uInt16 nValue = rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_PROJ_X).GetValue();
1402
1403 if( ( !m_xBtnTexObjectX->get_active() && nValue == 0 ) ||
1404 ( !m_xBtnTexParallelX->get_active() && nValue == 1 ) ||
1405 ( !m_xBtnTexCircleX->get_active() && nValue == 2 ) )
1406 {
1407 m_xBtnTexObjectX->set_active( nValue == 0 );
1408 m_xBtnTexParallelX->set_active( nValue == 1 );
1409 m_xBtnTexCircleX->set_active( nValue == 2 );
1410 bUpdate = true;
1411 }
1412 }
1413 else
1414 {
1415 if( m_xBtnTexObjectX->get_active() ||
1416 m_xBtnTexParallelX->get_active() ||
1417 m_xBtnTexCircleX->get_active() )
1418 {
1419 m_xBtnTexObjectX->set_active( false );
1420 m_xBtnTexParallelX->set_active( false );
1421 m_xBtnTexCircleX->set_active( false );
1422 bUpdate = true;
1423 }
1424 }
1425
1426 // Projection Y
1428 if( eState != SfxItemState::DONTCARE )
1429 {
1430 sal_uInt16 nValue = rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_PROJ_Y).GetValue();
1431
1432 if( ( !m_xBtnTexObjectY->get_active() && nValue == 0 ) ||
1433 ( !m_xBtnTexParallelY->get_active() && nValue == 1 ) ||
1434 ( !m_xBtnTexCircleY->get_active() && nValue == 2 ) )
1435 {
1436 m_xBtnTexObjectY->set_active( nValue == 0 );
1437 m_xBtnTexParallelY->set_active( nValue == 1 );
1438 m_xBtnTexCircleY->set_active( nValue == 2 );
1439 bUpdate = true;
1440 }
1441 }
1442 else
1443 {
1444 if( m_xBtnTexObjectY->get_active() ||
1445 m_xBtnTexParallelY->get_active() ||
1446 m_xBtnTexCircleY->get_active() )
1447 {
1448 m_xBtnTexObjectY->set_active( false );
1449 m_xBtnTexParallelY->set_active( false );
1450 m_xBtnTexCircleY->set_active( false );
1451 bUpdate = true;
1452 }
1453 }
1454
1455 // Filter
1457 if( eState != SfxItemState::DONTCARE )
1458 {
1459 bool bValue = rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_FILTER).GetValue();
1460 if( bValue != m_xBtnTexFilter->get_active() )
1461 {
1462 m_xBtnTexFilter->set_active( bValue );
1463 bUpdate = true;
1464 }
1465 if( m_xBtnTexFilter->get_state() == TRISTATE_INDET )
1466 m_xBtnTexFilter->set_active( bValue );
1467 }
1468 else
1469 {
1470 if( m_xBtnTexFilter->get_state() != TRISTATE_INDET )
1471 {
1472 m_xBtnTexFilter->set_state( TRISTATE_INDET );
1473 bUpdate = true;
1474 }
1475 }
1476 }
1477
1478
1479 // Material Favorites
1480 m_xLbMatFavorites->set_active( 0 );
1481
1482 // Object color
1483 eState = rAttrs.GetItemState(XATTR_FILLCOLOR);
1484 if( eState != SfxItemState::DONTCARE )
1485 {
1486 aColor = rAttrs.Get(XATTR_FILLCOLOR).GetColorValue();
1487 ColorListBox* pLb = m_xLbMatColor.get();
1488 if( aColor != pLb->GetSelectEntryColor() )
1489 {
1490 LBSelectColor( pLb, aColor );
1491 bUpdate = true;
1492 }
1493 }
1494 else
1495 {
1496 if (!m_xLbMatColor->IsNoSelection())
1497 {
1498 m_xLbMatColor->SetNoSelection();
1499 bUpdate = true;
1500 }
1501 }
1502
1503 // Self-luminous color
1505 if( eState != SfxItemState::DONTCARE )
1506 {
1507 aColor = rAttrs.Get(SDRATTR_3DOBJ_MAT_EMISSION).GetValue();
1508 ColorListBox* pLb = m_xLbMatEmission.get();
1509 if( aColor != pLb->GetSelectEntryColor() )
1510 {
1511 LBSelectColor( pLb, aColor );
1512 bUpdate = true;
1513 }
1514 }
1515 else
1516 {
1517 if (!m_xLbMatEmission->IsNoSelection())
1518 {
1519 m_xLbMatEmission->SetNoSelection();
1520 bUpdate = true;
1521 }
1522 }
1523
1524 // Specular
1526 if( eState != SfxItemState::DONTCARE )
1527 {
1528 aColor = rAttrs.Get(SDRATTR_3DOBJ_MAT_SPECULAR).GetValue();
1529 ColorListBox* pLb = m_xLbMatSpecular.get();
1530 if( aColor != pLb->GetSelectEntryColor() )
1531 {
1532 LBSelectColor( pLb, aColor );
1533 bUpdate = true;
1534 }
1535 }
1536 else
1537 {
1538 if (!m_xLbMatSpecular->IsNoSelection())
1539 {
1540 m_xLbMatSpecular->SetNoSelection();
1541 bUpdate = true;
1542 }
1543 }
1544
1545 // Specular Intensity
1547 if( eState != SfxItemState::DONTCARE )
1548 {
1549 sal_uInt16 nValue = rAttrs.Get(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY).GetValue();
1550 if( nValue != m_xMtrMatSpecularIntensity->get_value(FieldUnit::PERCENT) )
1551 {
1552 m_xMtrMatSpecularIntensity->set_value(nValue, FieldUnit::PERCENT);
1553 bUpdate = true;
1554 }
1555 }
1556 else
1557 {
1558 if( !m_xMtrMatSpecularIntensity->get_text().isEmpty() )
1559 {
1560 m_xMtrMatSpecularIntensity->set_text("");
1561 bUpdate = true;
1562 }
1563 }
1564
1565
1566// Other
1567 // Perspective
1569 if( eState != SfxItemState::DONTCARE )
1570 {
1571 ProjectionType ePT = static_cast<ProjectionType>(rAttrs.Get(SDRATTR_3DSCENE_PERSPECTIVE).GetValue());
1572 if( ( !m_xBtnPerspective->get_active() && ePT == ProjectionType::Perspective ) ||
1573 ( m_xBtnPerspective->get_active() && ePT == ProjectionType::Parallel ) )
1574 {
1575 m_xBtnPerspective->set_active( ePT == ProjectionType::Perspective );
1576 bUpdate = true;
1577 }
1578 if( m_xBtnPerspective->get_state() == TRISTATE_INDET )
1579 m_xBtnPerspective->set_active( ePT == ProjectionType::Perspective );
1580 }
1581 else
1582 {
1583 if( m_xBtnPerspective->get_state() != TRISTATE_INDET )
1584 {
1585 m_xBtnPerspective->set_state( TRISTATE_INDET );
1586 bUpdate = true;
1587 }
1588 }
1589
1590 if( !bUpdate )
1591 {
1592 // however the 2D attributes may be different. Compare these and decide
1593
1594 bUpdate = true;
1595 }
1596
1597 // Update preview
1598 SfxItemSet aSet(rAttrs);
1599
1600 // set LineStyle hard to drawing::LineStyle_NONE when it's not set so that
1601 // the default (drawing::LineStyle_SOLID) is not used for 3d preview
1602 if(SfxItemState::SET != aSet.GetItemState(XATTR_LINESTYLE, false))
1603 aSet.Put(XLineStyleItem(drawing::LineStyle_NONE));
1604
1605 // set FillColor hard to WHITE when it's SfxItemState::DONTCARE so that
1606 // the default (Blue7) is not used for 3d preview
1607 if(SfxItemState::DONTCARE == aSet.GetItemState(XATTR_FILLCOLOR, false))
1608 aSet.Put(XFillColorItem(OUString(), COL_WHITE));
1609
1610 m_xCtlPreview->Set3DAttributes(aSet);
1611 m_xCtlLightPreview->GetSvx3DLightControl().Set3DAttributes(aSet);
1612
1613 // try to select light corresponding to active button
1614 sal_uInt32 nNumber(0xffffffff);
1615
1616 if(m_xBtnLight1->get_active())
1617 nNumber = 0;
1618 else if(m_xBtnLight2->get_active())
1619 nNumber = 1;
1620 else if(m_xBtnLight3->get_active())
1621 nNumber = 2;
1622 else if(m_xBtnLight4->get_active())
1623 nNumber = 3;
1624 else if(m_xBtnLight5->get_active())
1625 nNumber = 4;
1626 else if(m_xBtnLight6->get_active())
1627 nNumber = 5;
1628 else if(m_xBtnLight7->get_active())
1629 nNumber = 6;
1630 else if(m_xBtnLight8->get_active())
1631 nNumber = 7;
1632
1633 if(nNumber != 0xffffffff)
1634 {
1635 m_xCtlLightPreview->GetSvx3DLightControl().SelectLight(nNumber);
1636 }
1637
1638 // handle state of converts possible
1639 m_xBtnConvertTo3D->set_sensitive(pConvertTo3DItem->GetState());
1640 m_xBtnLatheObject->set_sensitive(pConvertTo3DLatheItem->GetState());
1641}
1642
1643
1645{
1646 // get remembered 2d attributes from the dialog
1648 {
1650 sal_uInt16 nWhich(aIter.FirstWhich());
1651
1652 while(nWhich)
1653 {
1654 SfxItemState eState = aIter.GetItemState(false);
1655 if(SfxItemState::DONTCARE == eState)
1656 rAttrs.InvalidateItem(nWhich);
1657 else if(SfxItemState::SET == eState)
1658 rAttrs.Put(mpRemember2DAttributes->Get(nWhich, false));
1659
1660 nWhich = aIter.NextWhich();
1661 }
1662 }
1663
1664//Others must stand as the front on all sides
1665 // Perspective
1666 if( m_xBtnPerspective->get_state() != TRISTATE_INDET )
1667 {
1669 if( m_xBtnPerspective->get_active() )
1671 else
1673 rAttrs.Put(Svx3DPerspectiveItem(nValue));
1674 }
1675 else
1677
1678// Geometry
1679 // Possible determine PoolUnit (in this case this has not happened in Update() )
1680 if( !mpImpl->pPool )
1681 {
1682 OSL_FAIL( "No Pool in GetAttr()! May be incompatible to drviewsi.cxx ?" );
1683 mpImpl->pPool = rAttrs.GetPool();
1684 DBG_ASSERT( mpImpl->pPool, "Where is the Pool?" );
1685 ePoolUnit = mpImpl->pPool->GetMetric( SID_ATTR_LINE_WIDTH );
1686
1687 eFUnit = GetModuleFieldUnit( rAttrs );
1688 }
1689
1690 // Number of segments (horizontal)
1691 if( !m_xNumHorizontal->get_text().isEmpty() )
1692 {
1693 sal_uInt32 nValue = static_cast<sal_uInt32>(m_xNumHorizontal->get_value());
1695 }
1696 else
1698
1699 // Number of segments (vertical)
1700 if( !m_xNumVertical->get_text().isEmpty() )
1701 {
1702 sal_uInt32 nValue = static_cast<sal_uInt32>(m_xNumVertical->get_value());
1704 }
1705 else
1707
1708 // Depth
1709 if( !m_xMtrDepth->get_text().isEmpty() )
1710 {
1711 sal_uInt32 nValue = GetCoreValue(*m_xMtrDepth, ePoolUnit);
1712 rAttrs.Put(makeSvx3DDepthItem(nValue));
1713 }
1714 else
1716
1717 // Double-sided
1718 TriState eState = m_xBtnDoubleSided->get_state();
1719 if( eState != TRISTATE_INDET )
1720 {
1721 bool bValue = TRISTATE_TRUE == eState;
1722 rAttrs.Put(makeSvx3DDoubleSidedItem(bValue));
1723 }
1724 else
1726
1727 // Edge rounding
1728 if( !m_xMtrPercentDiagonal->get_text().isEmpty() )
1729 {
1730 sal_uInt16 nValue = static_cast<sal_uInt16>(m_xMtrPercentDiagonal->get_value(FieldUnit::PERCENT));
1732 }
1733 else
1735
1736 // Depth scale
1737 if( !m_xMtrBackscale->get_text().isEmpty() )
1738 {
1739 sal_uInt16 nValue = static_cast<sal_uInt16>(m_xMtrBackscale->get_value(FieldUnit::PERCENT));
1741 }
1742 else
1744
1745 // End angle
1746 if( !m_xMtrEndAngle->get_text().isEmpty() )
1747 {
1748 sal_uInt16 nValue = static_cast<sal_uInt16>(m_xMtrEndAngle->get_value(FieldUnit::DEGREE));
1750 }
1751 else
1753
1754 // Normal type
1755 sal_uInt16 nValue = 99;
1756 if( m_xBtnNormalsObj->get_active() )
1757 nValue = 0;
1758 else if( m_xBtnNormalsFlat->get_active() )
1759 nValue = 1;
1760 else if( m_xBtnNormalsSphere->get_active() )
1761 nValue = 2;
1762
1763 if( nValue <= 2 )
1764 rAttrs.Put(Svx3DNormalsKindItem(nValue));
1765 else
1767
1768 // Normal inverted
1769 eState = m_xBtnNormalsInvert->get_state();
1770 if( eState != TRISTATE_INDET )
1771 {
1772 bool bValue = TRISTATE_TRUE == eState;
1773 rAttrs.Put(makeSvx3DNormalsInvertItem(bValue));
1774 }
1775 else
1777
1778 // 2-sided lighting
1779 eState = m_xBtnTwoSidedLighting->get_state();
1780 if( eState != TRISTATE_INDET )
1781 {
1782 bool bValue = TRISTATE_TRUE == eState;
1783 rAttrs.Put(makeSvx3DTwoSidedLightingItem(bValue));
1784 }
1785 else
1787
1788// Representation
1789 // Shade mode
1790 if( m_xLbShademode->get_active() != -1 )
1791 {
1792 nValue = m_xLbShademode->get_active();
1793 rAttrs.Put(Svx3DShadeModeItem(nValue));
1794 }
1795 else
1797
1798 // 3D-Shadow
1799 eState = m_xBtnShadow3d->get_state();
1800 if( eState != TRISTATE_INDET )
1801 {
1802 bool bValue = TRISTATE_TRUE == eState;
1803 rAttrs.Put(makeSvx3DShadow3DItem(bValue));
1804 rAttrs.Put(makeSdrShadowItem(bValue));
1805 }
1806 else
1807 {
1810 }
1811
1812 // Slant (Shadow)
1813 if( !m_xMtrSlant->get_text().isEmpty() )
1814 {
1815 sal_uInt16 nValue2 = static_cast<sal_uInt16>(m_xMtrSlant->get_value(FieldUnit::DEGREE));
1816 rAttrs.Put(makeSvx3DShadowSlantItem(nValue2));
1817 }
1818 else
1820
1821 // Distance
1822 if( !m_xMtrDistance->get_text().isEmpty() )
1823 {
1824 sal_uInt32 nValue2 = GetCoreValue(*m_xMtrDistance, ePoolUnit);
1825 rAttrs.Put(makeSvx3DDistanceItem(nValue2));
1826 }
1827 else
1829
1830 // Focal length
1831 if( !m_xMtrFocalLength->get_text().isEmpty() )
1832 {
1833 sal_uInt32 nValue2 = GetCoreValue(*m_xMtrFocalLength, ePoolUnit);
1834 rAttrs.Put(makeSvx3DFocalLengthItem(nValue2));
1835 }
1836 else
1838
1839 // Lighting
1840 Color aColor;
1841 const SfxItemSet aLightItemSet(m_xCtlLightPreview->GetSvx3DLightControl().Get3DAttributes());
1842
1843 // Light 1 color
1844 if (!m_xLbLight1->IsNoSelection())
1845 {
1846 aColor = m_xLbLight1->GetSelectEntryColor();
1847 rAttrs.Put(makeSvx3DLightcolor1Item(aColor));
1848 }
1849 else
1851 // Light 1 (on/off)
1852 eState = m_xBtnLight1->get_state();
1853 if( eState != TRISTATE_INDET )
1854 {
1855 bool bValue = m_xBtnLight1->isLightOn();
1856 rAttrs.Put(makeSvx3DLightOnOff1Item(bValue));
1857
1858 // Light 1 (direction)
1859 if( bValue )
1860 {
1861 rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1));
1862 }
1863 }
1864 else
1866
1867
1868 // Light 2 color
1869 if (!m_xLbLight2->IsNoSelection())
1870 {
1871 aColor = m_xLbLight2->GetSelectEntryColor();
1872 rAttrs.Put(makeSvx3DLightcolor2Item(aColor));
1873 }
1874 else
1876 // Light 2 (on/off)
1877 eState = m_xBtnLight2->get_state();
1878 if( eState != TRISTATE_INDET )
1879 {
1880 bool bValue = m_xBtnLight2->isLightOn();
1881 rAttrs.Put(makeSvx3DLightOnOff2Item(bValue));
1882
1883 // Light 2 (direction)
1884 if( bValue )
1885 {
1886 rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2));
1887 }
1888 }
1889 else
1891
1892 // Light 3 color
1893 if (!m_xLbLight3->IsNoSelection())
1894 {
1895 aColor = m_xLbLight3->GetSelectEntryColor();
1896 rAttrs.Put(makeSvx3DLightcolor3Item(aColor));
1897 }
1898 else
1900 // Light 3 (on/off)
1901 eState = m_xBtnLight3->get_state();
1902 if( eState != TRISTATE_INDET )
1903 {
1904 bool bValue = m_xBtnLight3->isLightOn();
1905 rAttrs.Put(makeSvx3DLightOnOff3Item(bValue));
1906
1907 // Light 3 (direction)
1908 if( bValue )
1909 {
1910 rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3));
1911 }
1912 }
1913 else
1915
1916 // Light 4 color
1917 if (!m_xLbLight4->IsNoSelection())
1918 {
1919 aColor = m_xLbLight4->GetSelectEntryColor();
1920 rAttrs.Put(makeSvx3DLightcolor4Item(aColor));
1921 }
1922 else
1924 // Light 4 (on/off)
1925 eState = m_xBtnLight4->get_state();
1926 if( eState != TRISTATE_INDET )
1927 {
1928 bool bValue = m_xBtnLight4->isLightOn();
1929 rAttrs.Put(makeSvx3DLightOnOff4Item(bValue));
1930
1931 // Light 4 (direction)
1932 if( bValue )
1933 {
1934 rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4));
1935 }
1936 }
1937 else
1939
1940 // Light 5 color
1941 if (!m_xLbLight5->IsNoSelection())
1942 {
1943 aColor = m_xLbLight5->GetSelectEntryColor();
1944 rAttrs.Put(makeSvx3DLightcolor5Item(aColor));
1945 }
1946 else
1948 // Light 5 (on/off)
1949 eState = m_xBtnLight5->get_state();
1950 if( eState != TRISTATE_INDET )
1951 {
1952 bool bValue = m_xBtnLight5->isLightOn();
1953 rAttrs.Put(makeSvx3DLightOnOff5Item(bValue));
1954
1955 // Light 5 (direction)
1956 if( bValue )
1957 {
1958 rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5));
1959 }
1960 }
1961 else
1963
1964 // Light 6 color
1965 if (!m_xLbLight6->IsNoSelection())
1966 {
1967 aColor = m_xLbLight6->GetSelectEntryColor();
1968 rAttrs.Put(makeSvx3DLightcolor6Item(aColor));
1969 }
1970 else
1972 // Light 6 (on/off)
1973 eState = m_xBtnLight6->get_state();
1974 if( eState != TRISTATE_INDET )
1975 {
1976 bool bValue = m_xBtnLight6->isLightOn();
1977 rAttrs.Put(makeSvx3DLightOnOff6Item(bValue));
1978
1979 // Light 6 (direction)
1980 if( bValue )
1981 {
1982 rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6));
1983 }
1984 }
1985 else
1987
1988 // Light 7 color
1989 if (!m_xLbLight7->IsNoSelection())
1990 {
1991 aColor = m_xLbLight7->GetSelectEntryColor();
1992 rAttrs.Put(makeSvx3DLightcolor7Item(aColor));
1993 }
1994 else
1996 // Light 7 (on/off)
1997 eState = m_xBtnLight7->get_state();
1998 if( eState != TRISTATE_INDET )
1999 {
2000 bool bValue = m_xBtnLight7->isLightOn();
2001 rAttrs.Put(makeSvx3DLightOnOff7Item(bValue));
2002
2003 // Light 7 (direction)
2004 if( bValue )
2005 {
2006 rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7));
2007 }
2008 }
2009 else
2011
2012 // Light 8 color
2013 if (!m_xLbLight8->IsNoSelection())
2014 {
2015 aColor = m_xLbLight8->GetSelectEntryColor();
2016 rAttrs.Put(makeSvx3DLightcolor8Item(aColor));
2017 }
2018 else
2020 // Light 8 (on/off)
2021 eState = m_xBtnLight8->get_state();
2022 if( eState != TRISTATE_INDET )
2023 {
2024 bool bValue = m_xBtnLight8->isLightOn();
2025 rAttrs.Put(makeSvx3DLightOnOff8Item(bValue));
2026
2027 // Light 8 (direction)
2028 if( bValue )
2029 {
2030 rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8));
2031 }
2032 }
2033 else
2035
2036 // Ambient light
2037 if (!m_xLbAmbientlight->IsNoSelection())
2038 {
2039 aColor = m_xLbAmbientlight->GetSelectEntryColor();
2040 rAttrs.Put(makeSvx3DAmbientcolorItem(aColor));
2041 }
2042 else
2044
2045// Textures
2046 // Art
2047 nValue = 99;
2048 if( m_xBtnTexLuminance->get_active() )
2049 nValue = 1;
2050 else if( m_xBtnTexColor->get_active() )
2051 nValue = 3;
2052
2053 if( nValue == 1 || nValue == 3 )
2054 rAttrs.Put(Svx3DTextureKindItem(nValue));
2055 else
2057
2058
2059 // Mode
2060 nValue = 99;
2061 if( m_xBtnTexReplace->get_active() )
2062 nValue = 1;
2063 else if( m_xBtnTexModulate->get_active() )
2064 nValue = 2;
2065
2066 if( nValue == 1 || nValue == 2 )
2067 rAttrs.Put(Svx3DTextureModeItem(nValue));
2068 else
2070
2071 // X projection
2072 nValue = 99;
2073 if( m_xBtnTexObjectX->get_active() )
2074 nValue = 0;
2075 else if( m_xBtnTexParallelX->get_active() )
2076 nValue = 1;
2077 else if( m_xBtnTexCircleX->get_active() )
2078 nValue = 2;
2079
2080 if( nValue <= 2 )
2081 rAttrs.Put(Svx3DTextureProjectionXItem(nValue));
2082 else
2084
2085 // Y projection
2086 nValue = 99;
2087 if( m_xBtnTexObjectY->get_active() )
2088 nValue = 0;
2089 else if( m_xBtnTexParallelY->get_active() )
2090 nValue = 1;
2091 else if( m_xBtnTexCircleY->get_active() )
2092 nValue = 2;
2093
2094 if( nValue <= 2 )
2095 rAttrs.Put(Svx3DTextureProjectionYItem(nValue));
2096 else
2098
2099
2100 // Filter
2101 eState = m_xBtnTexFilter->get_state();
2102 if( eState != TRISTATE_INDET )
2103 {
2104 bool bValue = TRISTATE_TRUE == eState;
2105 rAttrs.Put(makeSvx3DTextureFilterItem(bValue));
2106 }
2107 else
2109
2110
2111// Material
2112 // Object color
2113 if (!m_xLbMatColor->IsNoSelection())
2114 {
2115 aColor = m_xLbMatColor->GetSelectEntryColor();
2116 rAttrs.Put( XFillColorItem( "", aColor) );
2117 }
2118 else
2119 {
2121 }
2122
2123 // luminous color
2124 if (!m_xLbMatEmission->IsNoSelection())
2125 {
2126 aColor = m_xLbMatEmission->GetSelectEntryColor();
2127 rAttrs.Put(makeSvx3DMaterialEmissionItem(aColor));
2128 }
2129 else
2131
2132 // Specular
2133 if (!m_xLbMatSpecular->IsNoSelection())
2134 {
2135 aColor = m_xLbMatSpecular->GetSelectEntryColor();
2136 rAttrs.Put(makeSvx3DMaterialSpecularItem(aColor));
2137 }
2138 else
2140
2141 // Specular intensity
2142 if( !m_xMtrMatSpecularIntensity->get_text().isEmpty() )
2143 {
2144 sal_uInt16 nValue2 = static_cast<sal_uInt16>(m_xMtrMatSpecularIntensity->get_value(FieldUnit::PERCENT));
2146 }
2147 else
2149}
2150
2152{
2153 Size aWinSize( GetOutputSizePixel() ); // why rSize in Resizing()?
2154
2155 if( aWinSize.Height() >= GetMinOutputSizePixel().Height() &&
2156 aWinSize.Width() >= GetMinOutputSizePixel().Width() )
2157 {
2158 // Hide
2159 m_xBtnUpdate->hide();
2160 m_xBtnAssign->hide();
2161
2162 m_xBtnConvertTo3D->hide();
2163 m_xBtnLatheObject->hide();
2164 m_xBtnPerspective->hide();
2165
2166 m_xCtlPreview->Hide();
2167 m_xLightPreviewGrid->hide();
2168
2169 m_xFLGeometrie->hide();
2170 m_xFLRepresentation->hide();
2171 m_xFLLight->hide();
2172 m_xFLTexture->hide();
2173 m_xFLMaterial->hide();
2174
2175 // Show
2176 m_xBtnUpdate->show();
2177 m_xBtnAssign->show();
2178
2179 m_xBtnConvertTo3D->show();
2180 m_xBtnLatheObject->show();
2181 m_xBtnPerspective->show();
2182
2183 if( m_xBtnGeo->get_active() )
2184 ClickViewTypeHdl(*m_xBtnGeo);
2185 if( m_xBtnRepresentation->get_active() )
2186 ClickViewTypeHdl(*m_xBtnRepresentation);
2187 if( m_xBtnLight->get_active() )
2188 ClickViewTypeHdl(*m_xBtnLight);
2189 if( m_xBtnTexture->get_active() )
2190 ClickViewTypeHdl(*m_xBtnTexture);
2191 if( m_xBtnMaterial->get_active() )
2192 ClickViewTypeHdl(*m_xBtnMaterial);
2193 }
2194
2196}
2197
2199{
2200 bUpdate = m_xBtnUpdate->get_active();
2201
2202 if( bUpdate )
2203 {
2204 SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
2205 if (pDispatcher != nullptr)
2206 {
2207 SfxBoolItem aItem( SID_3D_STATE, true );
2208 pDispatcher->ExecuteList(SID_3D_STATE,
2209 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem });
2210 }
2211 }
2212 else
2213 {
2214 // Controls can be disabled during certain circumstances
2215 }
2216}
2217
2218IMPL_LINK_NOARG(Svx3DWin, ClickAssignHdl, weld::Button&, void)
2219{
2220 SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
2221 if (pDispatcher != nullptr)
2222 {
2223 SfxBoolItem aItem( SID_3D_ASSIGN, true );
2224 pDispatcher->ExecuteList(SID_3D_ASSIGN,
2225 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem });
2226 }
2227}
2228
2229IMPL_LINK( Svx3DWin, ClickViewTypeHdl, weld::Button&, rBtn, void )
2230{
2231 // Since the permanent updating of the preview would be too expensive
2232 bool bUpdatePreview = m_xBtnLight->get_active();
2233
2234 m_xBtnGeo->set_active(m_xBtnGeo.get() == &rBtn);
2235 m_xBtnRepresentation->set_active(m_xBtnRepresentation.get() == &rBtn);
2236 m_xBtnLight->set_active(m_xBtnLight.get() == &rBtn);
2237 m_xBtnTexture->set_active(m_xBtnTexture.get() == &rBtn);
2238 m_xBtnMaterial->set_active(m_xBtnMaterial.get() == &rBtn);
2239
2240 if( m_xBtnGeo->get_active() )
2241 eViewType = ViewType3D::Geo;
2242 if( m_xBtnRepresentation->get_active() )
2243 eViewType = ViewType3D::Representation;
2244 if( m_xBtnLight->get_active() )
2245 eViewType = ViewType3D::Light;
2246 if( m_xBtnTexture->get_active() )
2247 eViewType = ViewType3D::Texture;
2248 if( m_xBtnMaterial->get_active() )
2249 eViewType = ViewType3D::Material;
2250
2251 // Geometry
2252 if( eViewType == ViewType3D::Geo )
2253 {
2254 m_xFLSegments->show();
2255 m_xFLGeometrie->show();
2256 m_xFLNormals->show();
2257 }
2258 else
2259 {
2260 m_xFLSegments->hide();
2261 m_xFLGeometrie->hide();
2262 m_xFLNormals->hide();
2263 }
2264
2265 // Representation
2266 if( eViewType == ViewType3D::Representation )
2267 {
2268 m_xFLShadow->show();
2269 m_xFLCamera->show();
2270 m_xFLRepresentation->show();
2271 }
2272 else
2273 {
2274 m_xFLShadow->hide();
2275 m_xFLCamera->hide();
2276 m_xFLRepresentation->hide();
2277 }
2278
2279 // Lighting
2280 if( eViewType == ViewType3D::Light )
2281 {
2282 m_xFLLight->show();
2283
2284 ColorListBox* pLb = GetCLbByButton();
2285 if( pLb )
2286 pLb->show();
2287
2288 m_xLightPreviewGrid->show();
2289 m_xCtlPreview->Hide();
2290 }
2291 else
2292 {
2293 m_xFLLight->hide();
2294
2295 if( !m_xCtlPreview->IsVisible() )
2296 {
2297 m_xCtlPreview->Show();
2298 m_xLightPreviewGrid->hide();
2299 }
2300 }
2301
2302 // Textures
2303 if (eViewType == ViewType3D::Texture)
2304 m_xFLTexture->show();
2305 else
2306 m_xFLTexture->hide();
2307
2308 // Material
2309 if( eViewType == ViewType3D::Material )
2310 {
2311 m_xFLMatSpecular->show();
2312 m_xFLMaterial->show();
2313 }
2314 else
2315 {
2316 m_xFLMatSpecular->hide();
2317 m_xFLMaterial->hide();
2318 }
2319 if( bUpdatePreview && !m_xBtnLight->get_active() )
2320 UpdatePreview();
2321}
2322
2323IMPL_LINK( Svx3DWin, ClickHdl, weld::Button&, rBtn, void )
2324{
2325 bool bUpdatePreview = false;
2326 sal_uInt16 nSId = 0;
2327
2328 if( &rBtn == m_xBtnConvertTo3D.get() )
2329 {
2330 nSId = SID_CONVERT_TO_3D;
2331 }
2332 else if( &rBtn == m_xBtnLatheObject.get() )
2333 {
2334 nSId = SID_CONVERT_TO_3D_LATHE_FAST;
2335 }
2336 // Geometry
2337 else if( &rBtn == m_xBtnNormalsObj.get() ||
2338 &rBtn == m_xBtnNormalsFlat.get() ||
2339 &rBtn == m_xBtnNormalsSphere.get() )
2340 {
2341 m_xBtnNormalsObj->set_active( &rBtn == m_xBtnNormalsObj.get() );
2342 m_xBtnNormalsFlat->set_active( &rBtn == m_xBtnNormalsFlat.get() );
2343 m_xBtnNormalsSphere->set_active( &rBtn == m_xBtnNormalsSphere.get() );
2344 bUpdatePreview = true;
2345 }
2346 else if( &rBtn == m_xBtnLight1->get_widget() ||
2347 &rBtn == m_xBtnLight2->get_widget() ||
2348 &rBtn == m_xBtnLight3->get_widget() ||
2349 &rBtn == m_xBtnLight4->get_widget() ||
2350 &rBtn == m_xBtnLight5->get_widget() ||
2351 &rBtn == m_xBtnLight6->get_widget() ||
2352 &rBtn == m_xBtnLight7->get_widget() ||
2353 &rBtn == m_xBtnLight8->get_widget() )
2354 {
2355 // Lighting
2356 LightButton* pToggleBtn = GetLbByButton(&rBtn);
2357
2358 ColorListBox* pLb = GetCLbByButton(pToggleBtn);
2359 pLb->show();
2360
2361 bool bIsChecked = pToggleBtn->get_prev_active();
2362
2363 if (pToggleBtn != m_xBtnLight1.get() && m_xBtnLight1->get_active())
2364 {
2365 m_xBtnLight1->set_active( false );
2366 m_xBtnLight1->set_prev_active(false);
2367 m_xLbLight1->hide();
2368 }
2369 if (pToggleBtn != m_xBtnLight2.get() && m_xBtnLight2->get_active())
2370 {
2371 m_xBtnLight2->set_active( false );
2372 m_xBtnLight2->set_prev_active(false);
2373 m_xLbLight2->hide();
2374 }
2375 if( pToggleBtn != m_xBtnLight3.get() && m_xBtnLight3->get_active() )
2376 {
2377 m_xBtnLight3->set_active( false );
2378 m_xBtnLight3->set_prev_active(false);
2379 m_xLbLight3->hide();
2380 }
2381 if( pToggleBtn != m_xBtnLight4.get() && m_xBtnLight4->get_active() )
2382 {
2383 m_xBtnLight4->set_active( false );
2384 m_xBtnLight4->set_prev_active(false);
2385 m_xLbLight4->hide();
2386 }
2387 if( pToggleBtn != m_xBtnLight5.get() && m_xBtnLight5->get_active() )
2388 {
2389 m_xBtnLight5->set_active( false );
2390 m_xBtnLight5->set_prev_active(false);
2391 m_xLbLight5->hide();
2392 }
2393 if( pToggleBtn != m_xBtnLight6.get() && m_xBtnLight6->get_active() )
2394 {
2395 m_xBtnLight6->set_active( false );
2396 m_xBtnLight6->set_prev_active(false);
2397 m_xLbLight6->hide();
2398 }
2399 if( pToggleBtn != m_xBtnLight7.get() && m_xBtnLight7->get_active() )
2400 {
2401 m_xBtnLight7->set_active( false );
2402 m_xBtnLight7->set_prev_active(false);
2403 m_xLbLight7->hide();
2404 }
2405 if( pToggleBtn != m_xBtnLight8.get() && m_xBtnLight8->get_active() )
2406 {
2407 m_xBtnLight8->set_active( false );
2408 m_xBtnLight8->set_prev_active(false);
2409 m_xLbLight8->hide();
2410 }
2411
2412 //update light button
2413 pToggleBtn->set_active(true);
2414 pToggleBtn->set_prev_active(true);
2415 if (bIsChecked)
2416 pToggleBtn->switchLightOn(!pToggleBtn->isLightOn());
2417
2418 bool bEnable = pToggleBtn->isLightOn();
2419 m_xBtnLightColor->set_sensitive( bEnable );
2420 pLb->set_sensitive( bEnable );
2421
2422 ClickLight(*pToggleBtn);
2423 bUpdatePreview = true;
2424 }
2425 // Textures
2426 else if( &rBtn == m_xBtnTexLuminance.get() ||
2427 &rBtn == m_xBtnTexColor.get() )
2428 {
2429 m_xBtnTexLuminance->set_active( &rBtn == m_xBtnTexLuminance.get() );
2430 m_xBtnTexColor->set_active( &rBtn == m_xBtnTexColor.get() );
2431 bUpdatePreview = true;
2432 }
2433 else if( &rBtn == m_xBtnTexReplace.get() ||
2434 &rBtn == m_xBtnTexModulate.get() )
2435 {
2436 m_xBtnTexReplace->set_active( &rBtn == m_xBtnTexReplace.get() );
2437 m_xBtnTexModulate->set_active( &rBtn == m_xBtnTexModulate.get() );
2438 bUpdatePreview = true;
2439 }
2440 else if( &rBtn == m_xBtnTexParallelX.get() ||
2441 &rBtn == m_xBtnTexCircleX.get() ||
2442 &rBtn == m_xBtnTexObjectX.get() )
2443 {
2444 m_xBtnTexParallelX->set_active( &rBtn == m_xBtnTexParallelX.get() );
2445 m_xBtnTexCircleX->set_active( &rBtn == m_xBtnTexCircleX.get() );
2446 m_xBtnTexObjectX->set_active( &rBtn == m_xBtnTexObjectX.get() );
2447 bUpdatePreview = true;
2448 }
2449 else if( &rBtn == m_xBtnTexParallelY.get() ||
2450 &rBtn == m_xBtnTexCircleY.get() ||
2451 &rBtn == m_xBtnTexObjectY.get() )
2452 {
2453 m_xBtnTexParallelY->set_active( &rBtn == m_xBtnTexParallelY.get() );
2454 m_xBtnTexCircleY->set_active( &rBtn == m_xBtnTexCircleY.get() );
2455 m_xBtnTexObjectY->set_active( &rBtn == m_xBtnTexObjectY.get() );
2456 bUpdatePreview = true;
2457 }
2458 else if (&rBtn == m_xBtnShadow3d.get())
2459 {
2460 m_xFtSlant->set_sensitive( m_xBtnShadow3d->get_active() );
2461 m_xMtrSlant->set_sensitive( m_xBtnShadow3d->get_active() );
2462 bUpdatePreview = true;
2463 }
2464 // Other (no groups)
2465 else
2466 {
2467 bUpdatePreview = true;
2468 }
2469
2470 if( nSId > 0 )
2471 {
2472 SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
2473 if (pDispatcher != nullptr)
2474 {
2475 SfxBoolItem aItem( nSId, true );
2476 pDispatcher->ExecuteList(nSId,
2477 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem });
2478 }
2479 }
2480 else if( bUpdatePreview )
2481 UpdatePreview();
2482}
2483
2484IMPL_LINK( Svx3DWin, ClickColorHdl, weld::Button&, rBtn, void)
2485{
2486 SvColorDialog aColorDlg;
2487 ColorListBox* pLb;
2488
2489 if( &rBtn == m_xBtnLightColor.get() )
2490 pLb = GetCLbByButton();
2491 else if( &rBtn == m_xBtnAmbientColor.get() )
2492 pLb = m_xLbAmbientlight.get();
2493 else if( &rBtn == m_xBtnMatColor.get() )
2494 pLb = m_xLbMatColor.get();
2495 else if( &rBtn == m_xBtnEmissionColor.get() )
2496 pLb = m_xLbMatEmission.get();
2497 else // if( &rBtn == m_xBtnSpecularColor.get() )
2498 pLb = m_xLbMatSpecular.get();
2499
2500 Color aColor = pLb->GetSelectEntryColor();
2501
2502 aColorDlg.SetColor( aColor );
2503 if( aColorDlg.Execute(GetFrameWeld()) == RET_OK )
2504 {
2505 aColor = aColorDlg.GetColor();
2506 LBSelectColor(pLb, aColor);
2507 SelectColorHdl(*pLb);
2508 }
2509}
2510
2511IMPL_LINK( Svx3DWin, SelectHdl, weld::ComboBox&, rListBox, void )
2512{
2513 bool bUpdatePreview = false;
2514
2515 // Material
2516 if (&rListBox == m_xLbMatFavorites.get())
2517 {
2518 Color aColObj( COL_WHITE );
2519 Color aColEmis( COL_BLACK );
2520 Color aColSpec( COL_WHITE );
2521 sal_uInt16 nSpecIntens = 20;
2522
2523 switch( m_xLbMatFavorites->get_active() )
2524 {
2525 case 1: // Metall
2526 {
2527 aColObj = Color(230,230,255);
2528 aColEmis = Color(10,10,30);
2529 aColSpec = Color(200,200,200);
2530 nSpecIntens = 20;
2531 }
2532 break;
2533
2534 case 2: // Gold
2535 {
2536 aColObj = Color(230,255,0);
2537 aColEmis = Color(51,0,0);
2538 aColSpec = Color(255,255,240);
2539 nSpecIntens = 20;
2540 }
2541 break;
2542
2543 case 3: // Chrome
2544 {
2545 aColObj = Color(36,117,153);
2546 aColEmis = Color(18,30,51);
2547 aColSpec = Color(230,230,255);
2548 nSpecIntens = 2;
2549 }
2550 break;
2551
2552 case 4: // Plastic
2553 {
2554 aColObj = Color(255,48,57);
2555 aColEmis = Color(35,0,0);
2556 aColSpec = Color(179,202,204);
2557 nSpecIntens = 60;
2558 }
2559 break;
2560
2561 case 5: // Wood
2562 {
2563 aColObj = Color(153,71,1);
2564 aColEmis = Color(21,22,0);
2565 aColSpec = Color(255,255,153);
2566 nSpecIntens = 75;
2567 }
2568 break;
2569 }
2570 LBSelectColor( m_xLbMatColor.get(), aColObj );
2571 LBSelectColor( m_xLbMatEmission.get(), aColEmis );
2572 LBSelectColor( m_xLbMatSpecular.get(), aColSpec );
2573 m_xMtrMatSpecularIntensity->set_value(nSpecIntens, FieldUnit::PERCENT);
2574
2575 bUpdatePreview = true;
2576 }
2577 else if (&rListBox == m_xLbShademode.get())
2578 bUpdatePreview = true;
2579
2580 if( bUpdatePreview )
2581 UpdatePreview();
2582}
2583
2584IMPL_LINK( Svx3DWin, SelectColorHdl, ColorListBox&, rListBox, void )
2585{
2586 bool bUpdatePreview = false;
2587
2588 if( &rListBox == m_xLbMatColor.get() ||
2589 &rListBox == m_xLbMatEmission.get() ||
2590 &rListBox == m_xLbMatSpecular.get() )
2591 {
2592 m_xLbMatFavorites->set_active( 0 );
2593 bUpdatePreview = true;
2594 }
2595 // Lighting
2596 else if( &rListBox == m_xLbAmbientlight.get() )
2597 {
2598 bUpdatePreview = true;
2599 }
2600 else if( &rListBox == m_xLbLight1.get() ||
2601 &rListBox == m_xLbLight2.get() ||
2602 &rListBox == m_xLbLight3.get() ||
2603 &rListBox == m_xLbLight4.get() ||
2604 &rListBox == m_xLbLight5.get() ||
2605 &rListBox == m_xLbLight6.get() ||
2606 &rListBox == m_xLbLight7.get() ||
2607 &rListBox == m_xLbLight8.get() )
2608 {
2609 bUpdatePreview = true;
2610 }
2611
2612 if( bUpdatePreview )
2613 UpdatePreview();
2614}
2615
2617{
2618 UpdatePreview();
2619}
2620
2622{
2623 UpdatePreview();
2624}
2625
2627{
2628 sal_uInt16 nLightSource = GetLightSource( &rBtn );
2629 ColorListBox* pLb = GetCLbByButton( &rBtn );
2630 Color aColor( pLb->GetSelectEntryColor() );
2631 SfxItemSet aLightItemSet(m_xCtlLightPreview->GetSvx3DLightControl().Get3DAttributes());
2632 const bool bOnOff(rBtn.isLightOn());
2633
2634 switch(nLightSource)
2635 {
2636 case 0: aLightItemSet.Put(makeSvx3DLightcolor1Item(aColor)); aLightItemSet.Put(makeSvx3DLightOnOff1Item(bOnOff)); break;
2637 case 1: aLightItemSet.Put(makeSvx3DLightcolor2Item(aColor)); aLightItemSet.Put(makeSvx3DLightOnOff2Item(bOnOff)); break;
2638 case 2: aLightItemSet.Put(makeSvx3DLightcolor3Item(aColor)); aLightItemSet.Put(makeSvx3DLightOnOff3Item(bOnOff)); break;
2639 case 3: aLightItemSet.Put(makeSvx3DLightcolor4Item(aColor)); aLightItemSet.Put(makeSvx3DLightOnOff4Item(bOnOff)); break;
2640 case 4: aLightItemSet.Put(makeSvx3DLightcolor5Item(aColor)); aLightItemSet.Put(makeSvx3DLightOnOff5Item(bOnOff)); break;
2641 case 5: aLightItemSet.Put(makeSvx3DLightcolor6Item(aColor)); aLightItemSet.Put(makeSvx3DLightOnOff6Item(bOnOff)); break;
2642 case 6: aLightItemSet.Put(makeSvx3DLightcolor7Item(aColor)); aLightItemSet.Put(makeSvx3DLightOnOff7Item(bOnOff)); break;
2643 default:
2644 case 7: aLightItemSet.Put(makeSvx3DLightcolor8Item(aColor)); aLightItemSet.Put(makeSvx3DLightOnOff8Item(bOnOff)); break;
2645 }
2646
2647 m_xCtlLightPreview->GetSvx3DLightControl().Set3DAttributes(aLightItemSet);
2648 m_xCtlLightPreview->GetSvx3DLightControl().SelectLight(nLightSource);
2649 m_xCtlLightPreview->CheckSelection();
2650}
2651
2652IMPL_LINK_NOARG(Svx3DWin, ChangeSelectionCallbackHdl, SvxLightCtl3D*, void)
2653{
2654 const sal_uInt32 nLight(m_xCtlLightPreview->GetSvx3DLightControl().GetSelectedLight());
2655 weld::Button* pBtn = nullptr;
2656
2657 switch( nLight )
2658 {
2659 case 0: pBtn = m_xBtnLight1->get_widget(); break;
2660 case 1: pBtn = m_xBtnLight2->get_widget(); break;
2661 case 2: pBtn = m_xBtnLight3->get_widget(); break;
2662 case 3: pBtn = m_xBtnLight4->get_widget(); break;
2663 case 4: pBtn = m_xBtnLight5->get_widget(); break;
2664 case 5: pBtn = m_xBtnLight6->get_widget(); break;
2665 case 6: pBtn = m_xBtnLight7->get_widget(); break;
2666 case 7: pBtn = m_xBtnLight8->get_widget(); break;
2667 default: break;
2668 }
2669
2670 if (pBtn)
2671 ClickHdl(*pBtn);
2672 else
2673 {
2674 // Status: No lamp selected
2675 if( m_xBtnLight1->get_active() )
2676 {
2677 m_xBtnLight1->set_active( false );
2678 m_xLbLight1->set_sensitive( false );
2679 }
2680 else if( m_xBtnLight2->get_active() )
2681 {
2682 m_xBtnLight2->set_active( false );
2683 m_xLbLight2->set_sensitive( false );
2684 }
2685 else if( m_xBtnLight3->get_active() )
2686 {
2687 m_xBtnLight3->set_active( false );
2688 m_xLbLight3->set_sensitive( false );
2689 }
2690 else if( m_xBtnLight4->get_active() )
2691 {
2692 m_xBtnLight4->set_active( false );
2693 m_xLbLight4->set_sensitive( false );
2694 }
2695 else if( m_xBtnLight5->get_active() )
2696 {
2697 m_xBtnLight5->set_active( false );
2698 m_xLbLight5->set_sensitive( false );
2699 }
2700 else if( m_xBtnLight6->get_active() )
2701 {
2702 m_xBtnLight6->set_active( false );
2703 m_xLbLight6->set_sensitive( false );
2704 }
2705 else if( m_xBtnLight7->get_active() )
2706 {
2707 m_xBtnLight7->set_active( false );
2708 m_xLbLight7->set_sensitive( false );
2709 }
2710 else if( m_xBtnLight8->get_active() )
2711 {
2712 m_xBtnLight8->set_active( false );
2713 m_xLbLight8->set_sensitive( false );
2714 }
2715 m_xBtnLightColor->set_sensitive( false );
2716 }
2717}
2718
2719namespace
2720{
2721 OUString lcl_makeColorName(const Color& rColor)
2722 {
2723 OUString aStr = SvxResId(RID_SVXFLOAT3D_FIX_R) +
2724 OUString::number(rColor.GetRed()) +
2725 " " +
2726 SvxResId(RID_SVXFLOAT3D_FIX_G) +
2727 OUString::number(rColor.GetGreen()) +
2728 " " +
2729 SvxResId(RID_SVXFLOAT3D_FIX_B) +
2730 OUString::number(rColor.GetBlue());
2731 return aStr;
2732 }
2733}
2734
2735// Method to ensure that the LB is also associated with a color
2736void Svx3DWin::LBSelectColor( ColorListBox* pLb, const Color& rColor )
2737{
2738 pLb->SetNoSelection();
2739 pLb->SelectEntry(std::make_pair(rColor, lcl_makeColorName(rColor)));
2740}
2741
2743{
2744 if(!pModel)
2745 {
2746 pModel.reset(new FmFormModel());
2747 }
2748
2749 // Get Itemset
2751
2752 // Get Attributes and set the preview
2753 GetAttr( aSet );
2754 m_xCtlPreview->Set3DAttributes( aSet );
2755 m_xCtlLightPreview->GetSvx3DLightControl().Set3DAttributes( aSet );
2756}
2757
2758
2759// document is to be reloaded, destroy remembered ItemSet
2761{
2762 mpRemember2DAttributes.reset();
2763}
2764
2766{
2767 // First...
2768 Color aColWhite( COL_WHITE );
2769 Color aColBlack( COL_BLACK );
2770 m_xLbLight1->SelectEntry( aColWhite );
2771 m_xLbLight2->SelectEntry( aColWhite );
2772 m_xLbLight3->SelectEntry( aColWhite );
2773 m_xLbLight4->SelectEntry( aColWhite );
2774 m_xLbLight5->SelectEntry( aColWhite );
2775 m_xLbLight6->SelectEntry( aColWhite );
2776 m_xLbLight7->SelectEntry( aColWhite );
2777 m_xLbLight8->SelectEntry( aColWhite );
2778 m_xLbAmbientlight->SelectEntry( aColBlack );
2779 m_xLbMatColor->SelectEntry( aColWhite );
2780 m_xLbMatEmission->SelectEntry( aColBlack );
2781 m_xLbMatSpecular->SelectEntry( aColWhite );
2782}
2783
2784sal_uInt16 Svx3DWin::GetLightSource( const LightButton* pBtn ) const
2785{
2786 sal_uInt16 nLight = 8;
2787
2788 if (pBtn == m_xBtnLight1.get())
2789 nLight = 0;
2790 else if (pBtn == m_xBtnLight2.get())
2791 nLight = 1;
2792 else if( pBtn == m_xBtnLight3.get() )
2793 nLight = 2;
2794 else if( pBtn == m_xBtnLight4.get() )
2795 nLight = 3;
2796 else if( pBtn == m_xBtnLight5.get() )
2797 nLight = 4;
2798 else if( pBtn == m_xBtnLight6.get() )
2799 nLight = 5;
2800 else if( pBtn == m_xBtnLight7.get() )
2801 nLight = 6;
2802 else if( pBtn == m_xBtnLight8.get() )
2803 nLight = 7;
2804
2805 return nLight;
2806};
2807
2809{
2810 ColorListBox* pLb = nullptr;
2811
2812 if( pBtn == nullptr )
2813 {
2814 if( m_xBtnLight1->get_active() )
2815 pLb = m_xLbLight1.get();
2816 else if( m_xBtnLight2->get_active() )
2817 pLb = m_xLbLight2.get();
2818 else if( m_xBtnLight3->get_active() )
2819 pLb = m_xLbLight3.get();
2820 else if( m_xBtnLight4->get_active() )
2821 pLb = m_xLbLight4.get();
2822 else if( m_xBtnLight5->get_active() )
2823 pLb = m_xLbLight5.get();
2824 else if( m_xBtnLight6->get_active() )
2825 pLb = m_xLbLight6.get();
2826 else if( m_xBtnLight7->get_active() )
2827 pLb = m_xLbLight7.get();
2828 else if( m_xBtnLight8->get_active() )
2829 pLb = m_xLbLight8.get();
2830 }
2831 else
2832 {
2833 if( pBtn == m_xBtnLight1.get() )
2834 pLb = m_xLbLight1.get();
2835 else if (pBtn == m_xBtnLight2.get())
2836 pLb = m_xLbLight2.get();
2837 else if( pBtn == m_xBtnLight3.get() )
2838 pLb = m_xLbLight3.get();
2839 else if( pBtn == m_xBtnLight4.get() )
2840 pLb = m_xLbLight4.get();
2841 else if( pBtn == m_xBtnLight5.get() )
2842 pLb = m_xLbLight5.get();
2843 else if( pBtn == m_xBtnLight6.get() )
2844 pLb = m_xLbLight6.get();
2845 else if( pBtn == m_xBtnLight7.get() )
2846 pLb = m_xLbLight7.get();
2847 else if( pBtn == m_xBtnLight8.get() )
2848 pLb = m_xLbLight8.get();
2849 }
2850 return pLb;
2851};
2852
2854{
2855 LightButton* pLb = nullptr;
2856
2857 if( pBtn == m_xBtnLight1->get_widget() )
2858 pLb = m_xBtnLight1.get();
2859 else if (pBtn == m_xBtnLight2->get_widget() )
2860 pLb = m_xBtnLight2.get();
2861 else if( pBtn == m_xBtnLight3->get_widget() )
2862 pLb = m_xBtnLight3.get();
2863 else if( pBtn == m_xBtnLight4->get_widget() )
2864 pLb = m_xBtnLight4.get();
2865 else if( pBtn == m_xBtnLight5->get_widget() )
2866 pLb = m_xBtnLight5.get();
2867 else if( pBtn == m_xBtnLight6->get_widget() )
2868 pLb = m_xBtnLight6.get();
2869 else if( pBtn == m_xBtnLight7->get_widget() )
2870 pLb = m_xBtnLight7.get();
2871 else if( pBtn == m_xBtnLight8->get_widget() )
2872 pLb = m_xBtnLight8.get();
2873
2874 return pLb;
2875};
2876
2877// Derivation from SfxChildWindow as "containers" for effects
2879 sal_uInt16 nId,
2880 SfxBindings* pBindings,
2881 SfxChildWinInfo* pInfo ) :
2882 SfxChildWindow( _pParent, nId )
2883{
2884 VclPtr<Svx3DWin> pWin = VclPtr<Svx3DWin>::Create( pBindings, this, _pParent );
2885 SetWindow(pWin);
2886
2887 pWin->Initialize( pInfo );
2888}
2889
2891 SfxBindings* _pBindings) :
2892 SfxControllerItem( _nId, *_pBindings )
2893{
2894}
2895
2896
2898 SfxItemState /*eState*/, const SfxPoolItem* /*pItem*/ )
2899{
2900}
2901
2902// ControllerItem for Status Slot SID_CONVERT_TO_3D
2903
2905: SfxControllerItem(_nId, *_pBindings),
2906 bState(false)
2907{
2908}
2909
2910void SvxConvertTo3DItem::StateChangedAtToolBoxControl(sal_uInt16 /*_nId*/, SfxItemState eState, const SfxPoolItem* /*pState*/)
2911{
2912 bool bNewState = (eState != SfxItemState::DISABLED);
2913 if(bNewState != bState)
2914 {
2915 bState = bNewState;
2916 SfxDispatcher* pDispatcher = LocalGetDispatcher(&GetBindings());
2917 if (pDispatcher != nullptr)
2918 {
2919 SfxBoolItem aItem( SID_3D_STATE, true );
2920 pDispatcher->ExecuteList(SID_3D_STATE,
2921 SfxCallMode::ASYNCHRON|SfxCallMode::RECORD, { &aItem });
2922 }
2923 }
2924}
2925
2926LightButton::LightButton(std::unique_ptr<weld::ToggleButton> xButton)
2927 : m_xButton(std::move(xButton))
2928 , m_bLightOn(false)
2929 , m_bButtonPrevActive(false)
2930{
2931 m_xButton->set_from_icon_name(RID_SVXBMP_LAMP_OFF);
2932}
2933
2935{
2936 if (m_bLightOn == bOn)
2937 return;
2938 m_bLightOn = bOn;
2939 if (m_bLightOn)
2940 m_xButton->set_from_icon_name(RID_SVXBMP_LAMP_ON);
2941 else
2942 m_xButton->set_from_icon_name(RID_SVXBMP_LAMP_OFF);
2943}
2944
2945/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Color const & GetSelectEntryColor() const
Definition: colorbox.hxx:63
void show()
Definition: colorbox.hxx:83
void SelectEntry(const NamedColor &rColor)
Definition: tbcontrl.cxx:4290
void SetNoSelection()
Definition: colorbox.hxx:70
void set_sensitive(bool sensitive)
Definition: colorbox.hxx:81
sal_uInt8 GetBlue() const
sal_uInt8 GetRed() const
sal_uInt8 GetGreen() const
bool isLightOn() const
Definition: float3d.hxx:54
bool get_active() const
Definition: float3d.hxx:56
std::unique_ptr< weld::ToggleButton > m_xButton
Definition: float3d.hxx:73
LightButton(std::unique_ptr< weld::ToggleButton > xButton)
Definition: float3d.cxx:2926
bool get_prev_active() const
Definition: float3d.hxx:69
void set_prev_active(bool bPrevActive)
Definition: float3d.hxx:70
bool m_bLightOn
Definition: float3d.hxx:74
void switchLightOn(bool bOn)
Definition: float3d.cxx:2934
void set_active(bool bActive)
Definition: float3d.hxx:57
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
SfxDispatcher * GetDispatcher() const
void SetWindow(const VclPtr< vcl::Window > &p)
SfxBindings & GetBindings()
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
const Size & GetMinOutputSizePixel() const
virtual void Resize() override
virtual void dispose() override
SfxItemPool * GetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void InvalidateItem(sal_uInt16 nWhich)
static SfxViewFrame * Current()
SfxDispatcher * GetDispatcher()
sal_uInt16 FirstWhich()
SfxItemState GetItemState(bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
sal_uInt16 NextWhich()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const Color & GetColor() const
short Execute(weld::Window *pParent)
void SetColor(const Color &rColor)
Svx3DChildWindow(vcl::Window *, sal_uInt16, SfxBindings *, SfxChildWinInfo *)
Definition: float3d.cxx:2878
Svx3DCtrlItem(sal_uInt16, SfxBindings *)
Definition: float3d.cxx:2890
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem *pState) override
Definition: float3d.cxx:2897
std::unique_ptr< weld::Button > m_xBtnLightColor
Definition: float3d.hxx:146
void UpdatePreview()
Definition: float3d.cxx:2742
std::unique_ptr< weld::MetricSpinButton > m_xMtrSlant
Definition: float3d.hxx:122
std::unique_ptr< SvxLightCtl3D > m_xCtlLightPreview
Definition: float3d.hxx:187
std::unique_ptr< weld::ToggleButton > m_xBtnTexColor
Definition: float3d.hxx:153
std::unique_ptr< weld::MetricSpinButton > m_xMtrDepth
Definition: float3d.hxx:101
std::unique_ptr< LightButton > m_xBtnLight8
Definition: float3d.hxx:137
std::unique_ptr< ColorListBox > m_xLbMatColor
Definition: float3d.hxx:168
std::unique_ptr< weld::ToggleButton > m_xBtnTexParallelY
Definition: float3d.hxx:160
std::unique_ptr< ColorListBox > m_xLbLight1
Definition: float3d.hxx:138
std::unique_ptr< weld::ToggleButton > m_xBtnMaterial
Definition: float3d.hxx:88
SVX_DLLPRIVATE sal_uInt16 GetLightSource(const LightButton *pBtn) const
Definition: float3d.cxx:2784
std::unique_ptr< weld::CustomWeld > m_xCtlPreviewWin
Definition: float3d.hxx:179
std::unique_ptr< weld::CustomWeld > m_xCtlLightPreviewWin
Definition: float3d.hxx:186
std::unique_ptr< weld::ToggleButton > m_xBtnNormalsSphere
Definition: float3d.hxx:110
std::unique_ptr< weld::ToggleButton > m_xBtnTexture
Definition: float3d.hxx:87
std::unique_ptr< weld::Container > m_xFLSegments
Definition: float3d.hxx:103
void InitColorLB()
Definition: float3d.cxx:2765
std::unique_ptr< weld::Label > m_xFtSlant
Definition: float3d.hxx:121
std::unique_ptr< weld::Button > m_xBtnConvertTo3D
Definition: float3d.hxx:190
std::unique_ptr< weld::ToggleButton > m_xBtnTexParallelX
Definition: float3d.hxx:157
std::unique_ptr< weld::ToggleButton > m_xBtnPerspective
Definition: float3d.hxx:192
std::unique_ptr< weld::ToggleButton > m_xBtnTexModulate
Definition: float3d.hxx:155
std::unique_ptr< weld::Container > m_xFLGeometrie
Definition: float3d.hxx:93
std::unique_ptr< weld::Button > m_xBtnMatColor
Definition: float3d.hxx:169
std::unique_ptr< Svx3DCtrlItem > pControllerItem
Definition: float3d.hxx:202
std::unique_ptr< weld::Container > m_xFLCamera
Definition: float3d.hxx:124
std::unique_ptr< weld::MetricSpinButton > m_xMtrBackscale
Definition: float3d.hxx:97
std::unique_ptr< weld::ToggleButton > m_xBtnShadow3d
Definition: float3d.hxx:120
virtual ~Svx3DWin() override
Definition: float3d.cxx:330
virtual void Resize() override
Definition: float3d.cxx:2151
std::unique_ptr< weld::SpinButton > m_xNumVertical
Definition: float3d.hxx:105
std::unique_ptr< weld::ToggleButton > m_xBtnNormalsObj
Definition: float3d.hxx:108
std::unique_ptr< weld::ToggleButton > m_xBtnLight
Definition: float3d.hxx:86
std::unique_ptr< ColorListBox > m_xLbLight5
Definition: float3d.hxx:142
static SVX_DLLPRIVATE void LBSelectColor(ColorListBox *pLb, const Color &rColor)
Definition: float3d.cxx:2736
bool bUpdate
Definition: float3d.hxx:195
std::unique_ptr< weld::MetricSpinButton > m_xMtrEndAngle
Definition: float3d.hxx:99
std::unique_ptr< weld::ComboBox > m_xLbMatFavorites
Definition: float3d.hxx:167
std::unique_ptr< weld::Container > m_xFLNormals
Definition: float3d.hxx:107
std::unique_ptr< weld::ToggleButton > m_xBtnTexLuminance
Definition: float3d.hxx:152
std::unique_ptr< ColorListBox > m_xLbLight4
Definition: float3d.hxx:141
std::unique_ptr< LightButton > m_xBtnLight5
Definition: float3d.hxx:134
std::unique_ptr< weld::Label > m_xFtPercentDiagonal
Definition: float3d.hxx:94
std::unique_ptr< weld::Button > m_xBtnSpecularColor
Definition: float3d.hxx:175
SVX_DLLPRIVATE ColorListBox * GetCLbByButton(const LightButton *pBtn=nullptr)
Definition: float3d.cxx:2808
std::unique_ptr< weld::Scale > m_xHoriScale
Definition: float3d.hxx:182
std::unique_ptr< weld::ToggleButton > m_xBtnTexObjectY
Definition: float3d.hxx:159
SVX_DLLPRIVATE LightButton * GetLbByButton(const weld::Button *pBtn)
Definition: float3d.cxx:2853
std::unique_ptr< weld::MetricSpinButton > m_xMtrPercentDiagonal
Definition: float3d.hxx:95
std::unique_ptr< weld::ToggleButton > m_xBtnDoubleSided
Definition: float3d.hxx:113
std::unique_ptr< Svx3DPreviewControl > m_xCtlPreview
Definition: float3d.hxx:178
std::unique_ptr< SfxItemSet > mpRemember2DAttributes
Definition: float3d.hxx:212
std::unique_ptr< weld::Container > m_xFLMatSpecular
Definition: float3d.hxx:173
std::unique_ptr< weld::ToggleButton > m_xBtnRepresentation
Definition: float3d.hxx:85
void DocumentReload()
Definition: float3d.cxx:2760
std::unique_ptr< weld::MetricSpinButton > m_xMtrMatSpecularIntensity
Definition: float3d.hxx:176
virtual void dispose() override
Definition: float3d.cxx:335
std::unique_ptr< weld::ToggleButton > m_xBtnTexCircleX
Definition: float3d.hxx:158
FieldUnit eFUnit
Definition: float3d.hxx:209
std::unique_ptr< weld::Button > m_xBtnLatheObject
Definition: float3d.hxx:191
Svx3DWin(SfxBindings *pBindings, SfxChildWindow *pCW, vcl::Window *pParent)
Definition: float3d.cxx:86
std::unique_ptr< weld::Container > m_xFLTexture
Definition: float3d.hxx:151
std::unique_ptr< weld::ToggleButton > m_xBtnTwoSidedLighting
Definition: float3d.hxx:112
std::unique_ptr< ColorListBox > m_xLbMatSpecular
Definition: float3d.hxx:174
std::unique_ptr< ColorListBox > m_xLbLight7
Definition: float3d.hxx:144
std::unique_ptr< weld::Button > m_xBtnEmissionColor
Definition: float3d.hxx:171
std::unique_ptr< weld::MetricSpinButton > m_xMtrDistance
Definition: float3d.hxx:125
std::unique_ptr< weld::Button > m_xBtnAssign
Definition: float3d.hxx:90
std::unique_ptr< weld::Container > m_xFLMaterial
Definition: float3d.hxx:166
std::unique_ptr< weld::ToggleButton > m_xBtnTexReplace
Definition: float3d.hxx:154
void Update(SfxItemSet const &rSet)
Definition: float3d.cxx:462
std::unique_ptr< LightButton > m_xBtnLight1
Definition: float3d.hxx:130
std::unique_ptr< Svx3DLightControl > m_xLightPreview
Definition: float3d.hxx:185
std::unique_ptr< LightButton > m_xBtnLight7
Definition: float3d.hxx:136
std::unique_ptr< FmFormModel > pModel
Definition: float3d.hxx:199
std::unique_ptr< weld::ToggleButton > m_xBtnUpdate
Definition: float3d.hxx:89
std::unique_ptr< weld::Button > m_xBtn_Corner
Definition: float3d.hxx:184
std::unique_ptr< weld::ToggleButton > m_xBtnTexCircleY
Definition: float3d.hxx:161
std::unique_ptr< weld::ToggleButton > m_xBtnTexObjectX
Definition: float3d.hxx:156
std::unique_ptr< weld::ToggleButton > m_xBtnNormalsFlat
Definition: float3d.hxx:109
std::unique_ptr< weld::Widget > m_xLightPreviewGrid
Definition: float3d.hxx:181
SVX_DLLPRIVATE void Reset()
Definition: float3d.cxx:447
void GetAttr(SfxItemSet &rSet)
Definition: float3d.cxx:1644
std::unique_ptr< ColorListBox > m_xLbLight6
Definition: float3d.hxx:143
std::unique_ptr< Svx3DWinImpl > mpImpl
Definition: float3d.hxx:207
MapUnit ePoolUnit
Definition: float3d.hxx:208
std::unique_ptr< weld::Button > m_xBtnAmbientColor
Definition: float3d.hxx:148
std::unique_ptr< LightButton > m_xBtnLight3
Definition: float3d.hxx:132
std::unique_ptr< weld::ToggleButton > m_xBtnTexFilter
Definition: float3d.hxx:162
std::unique_ptr< ColorListBox > m_xLbLight8
Definition: float3d.hxx:145
std::unique_ptr< weld::Container > m_xFLRepresentation
Definition: float3d.hxx:116
std::unique_ptr< LightButton > m_xBtnLight2
Definition: float3d.hxx:131
std::unique_ptr< weld::ComboBox > m_xLbShademode
Definition: float3d.hxx:117
std::unique_ptr< weld::SpinButton > m_xNumHorizontal
Definition: float3d.hxx:104
std::unique_ptr< weld::Container > m_xFLLight
Definition: float3d.hxx:129
std::unique_ptr< LightButton > m_xBtnLight6
Definition: float3d.hxx:135
void ClickLight(const LightButton &rBtn)
Definition: float3d.cxx:2626
std::unique_ptr< weld::Label > m_xFtEndAngle
Definition: float3d.hxx:98
std::unique_ptr< weld::Container > m_xFLShadow
Definition: float3d.hxx:119
std::unique_ptr< ColorListBox > m_xLbMatEmission
Definition: float3d.hxx:170
std::unique_ptr< weld::MetricSpinButton > m_xMtrFocalLength
Definition: float3d.hxx:126
std::unique_ptr< SvxConvertTo3DItem > pConvertTo3DItem
Definition: float3d.hxx:204
std::unique_ptr< weld::ToggleButton > m_xBtnNormalsInvert
Definition: float3d.hxx:111
std::unique_ptr< ColorListBox > m_xLbAmbientlight
Definition: float3d.hxx:147
std::unique_ptr< weld::Scale > m_xVertScale
Definition: float3d.hxx:183
std::unique_ptr< weld::ToggleButton > m_xBtnGeo
Definition: float3d.hxx:84
std::unique_ptr< ColorListBox > m_xLbLight2
Definition: float3d.hxx:139
std::unique_ptr< ColorListBox > m_xLbLight3
Definition: float3d.hxx:140
std::unique_ptr< weld::Label > m_xFtDepth
Definition: float3d.hxx:100
std::unique_ptr< SvxConvertTo3DItem > pConvertTo3DLatheItem
Definition: float3d.hxx:205
std::unique_ptr< weld::Label > m_xFtBackscale
Definition: float3d.hxx:96
std::unique_ptr< LightButton > m_xBtnLight4
Definition: float3d.hxx:133
SVX_DLLPRIVATE void Construct()
Definition: float3d.cxx:440
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem *pState) override
Definition: float3d.cxx:2910
SvxConvertTo3DItem(sal_uInt16 nId, SfxBindings *pBindings)
Definition: float3d.cxx:2904
static VclPtr< reference_type > Create(Arg &&... arg)
virtual OutputDevice & get_ref_device()=0
virtual void set_size_request(int nWidth, int nHeight)=0
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define DBG_ASSERT(sCon, aError)
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
virtual void SetText(const OUString &rStr) override
FieldUnit GetModuleFieldUnit(const SfxItemSet &rSet)
Definition: dlgutil.cxx:31
sal_Int32 nState
FieldUnit
IMPL_LINK_NOARG(Svx3DWin, ClickUpdateHdl, weld::Toggleable &, void)
Definition: float3d.cxx:2198
IMPL_LINK(Svx3DWin, ClickViewTypeHdl, weld::Button &, rBtn, void)
Definition: float3d.cxx:2229
sal_Int16 nValue
Definition: fmsrccfg.cxx:81
SFX_IMPL_DOCKINGWINDOW_WITHID(SvxFontWorkChildWindow, SID_FONTWORK)
TriState
TRISTATE_INDET
TRISTATE_TRUE
aStr
sal_Int16 nId
const char GetValue[]
SfxItemState
SdrOnOffItem makeSdrShadowItem(bool bShadow)
Definition: sdshitm.hxx:25
SfxItemPool * pPool
Definition: float3d.cxx:62
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_8(SDRATTR_3DSCENE_FIRST+20)
constexpr TypedWhichId< Svx3DNormalsKindItem > SDRATTR_3DOBJ_NORMALS_KIND(SDRATTR_3DOBJ_FIRST+7)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_4(SDRATTR_3DSCENE_FIRST+16)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_SHADOW(SDRATTR_SHADOW_FIRST+0)
constexpr TypedWhichId< SvxB3DVectorItem > SDRATTR_3DSCENE_LIGHTDIRECTION_1(SDRATTR_3DSCENE_FIRST+21)
constexpr TypedWhichId< SvxB3DVectorItem > SDRATTR_3DSCENE_LIGHTDIRECTION_3(SDRATTR_3DSCENE_FIRST+23)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_1(SDRATTR_3DSCENE_FIRST+13)
constexpr TypedWhichId< SvxB3DVectorItem > SDRATTR_3DSCENE_LIGHTDIRECTION_2(SDRATTR_3DSCENE_FIRST+22)
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DOBJ_DEPTH(SDRATTR_3DOBJ_FIRST+2)
constexpr TypedWhichId< Svx3DPerspectiveItem > SDRATTR_3DSCENE_PERSPECTIVE(SDRATTR_3DSCENE_FIRST+0)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_TWO_SIDED_LIGHTING(SDRATTR_3DSCENE_FIRST+3)
constexpr TypedWhichId< SvxColorItem > SDRATTR_3DSCENE_LIGHTCOLOR_1(SDRATTR_3DSCENE_FIRST+4)
constexpr sal_uInt16 SDRATTR_START(XATTR_START)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_3(SDRATTR_3DSCENE_FIRST+15)
constexpr TypedWhichId< Svx3DTextureModeItem > SDRATTR_3DOBJ_TEXTURE_MODE(SDRATTR_3DOBJ_FIRST+17)
constexpr sal_uInt16 SDRATTR_3D_FIRST(SDRATTR_GRAF_LAST+1)
constexpr sal_uInt16 SDRATTR_3D_LAST(SDRATTR_3DSCENE_LAST)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DOBJ_TEXTURE_FILTER(SDRATTR_3DOBJ_FIRST+18)
constexpr TypedWhichId< SvxColorItem > SDRATTR_3DSCENE_LIGHTCOLOR_5(SDRATTR_3DSCENE_FIRST+8)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DOBJ_DOUBLE_SIDED(SDRATTR_3DOBJ_FIRST+6)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_5(SDRATTR_3DSCENE_FIRST+17)
constexpr TypedWhichId< SvxB3DVectorItem > SDRATTR_3DSCENE_LIGHTDIRECTION_7(SDRATTR_3DSCENE_FIRST+27)
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DSCENE_FOCAL_LENGTH(SDRATTR_3DSCENE_FIRST+2)
constexpr TypedWhichId< SvxB3DVectorItem > SDRATTR_3DSCENE_LIGHTDIRECTION_6(SDRATTR_3DSCENE_FIRST+26)
constexpr TypedWhichId< SvxColorItem > SDRATTR_3DSCENE_LIGHTCOLOR_6(SDRATTR_3DSCENE_FIRST+9)
constexpr TypedWhichId< SvxColorItem > SDRATTR_3DSCENE_LIGHTCOLOR_4(SDRATTR_3DSCENE_FIRST+7)
constexpr TypedWhichId< SvxColorItem > SDRATTR_3DSCENE_LIGHTCOLOR_7(SDRATTR_3DSCENE_FIRST+10)
constexpr TypedWhichId< Svx3DShadeModeItem > SDRATTR_3DSCENE_SHADE_MODE(SDRATTR_3DSCENE_FIRST+30)
constexpr TypedWhichId< Svx3DTextureKindItem > SDRATTR_3DOBJ_TEXTURE_KIND(SDRATTR_3DOBJ_FIRST+16)
constexpr sal_uInt16 SDRATTR_SHADOW_LAST(SDRATTR_SHADOWBLUR)
constexpr TypedWhichId< SfxUInt16Item > SDRATTR_3DOBJ_BACKSCALE(SDRATTR_3DOBJ_FIRST+1)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_6(SDRATTR_3DSCENE_FIRST+18)
constexpr TypedWhichId< SfxUInt16Item > SDRATTR_3DSCENE_SHADOW_SLANT(SDRATTR_3DSCENE_FIRST+29)
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DOBJ_VERT_SEGS(SDRATTR_3DOBJ_FIRST+4)
constexpr TypedWhichId< SvxColorItem > SDRATTR_3DOBJ_MAT_SPECULAR(SDRATTR_3DOBJ_FIRST+14)
constexpr TypedWhichId< SvxColorItem > SDRATTR_3DSCENE_AMBIENTCOLOR(SDRATTR_3DSCENE_FIRST+12)
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DSCENE_DISTANCE(SDRATTR_3DSCENE_FIRST+1)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_2(SDRATTR_3DSCENE_FIRST+14)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DOBJ_SHADOW_3D(SDRATTR_3DOBJ_FIRST+11)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DOBJ_NORMALS_INVERT(SDRATTR_3DOBJ_FIRST+8)
constexpr TypedWhichId< SvxColorItem > SDRATTR_3DSCENE_LIGHTCOLOR_8(SDRATTR_3DSCENE_FIRST+11)
constexpr TypedWhichId< SvxB3DVectorItem > SDRATTR_3DSCENE_LIGHTDIRECTION_8(SDRATTR_3DSCENE_FIRST+28)
constexpr TypedWhichId< SvxB3DVectorItem > SDRATTR_3DSCENE_LIGHTDIRECTION_4(SDRATTR_3DSCENE_FIRST+24)
constexpr TypedWhichId< SvxB3DVectorItem > SDRATTR_3DSCENE_LIGHTDIRECTION_5(SDRATTR_3DSCENE_FIRST+25)
constexpr TypedWhichId< SfxUInt16Item > SDRATTR_3DOBJ_PERCENT_DIAGONAL(SDRATTR_3DOBJ_FIRST+0)
constexpr TypedWhichId< SvxColorItem > SDRATTR_3DOBJ_MAT_EMISSION(SDRATTR_3DOBJ_FIRST+13)
constexpr TypedWhichId< SvxColorItem > SDRATTR_3DSCENE_LIGHTCOLOR_2(SDRATTR_3DSCENE_FIRST+5)
constexpr TypedWhichId< Svx3DTextureProjectionYItem > SDRATTR_3DOBJ_TEXTURE_PROJ_Y(SDRATTR_3DOBJ_FIRST+10)
constexpr TypedWhichId< Svx3DTextureProjectionXItem > SDRATTR_3DOBJ_TEXTURE_PROJ_X(SDRATTR_3DOBJ_FIRST+9)
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DOBJ_END_ANGLE(SDRATTR_3DOBJ_FIRST+5)
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DOBJ_HORZ_SEGS(SDRATTR_3DOBJ_FIRST+3)
constexpr TypedWhichId< SvxColorItem > SDRATTR_3DSCENE_LIGHTCOLOR_3(SDRATTR_3DSCENE_FIRST+6)
constexpr TypedWhichId< SfxUInt16Item > SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY(SDRATTR_3DOBJ_FIRST+15)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_7(SDRATTR_3DSCENE_FIRST+19)
SfxUInt16Item makeSvx3DBackscaleItem(sal_uInt16 nVal)
Definition: svx3ditems.hxx:38
SfxBoolItem makeSvx3DLightOnOff2Item(bool bVal)
Definition: svx3ditems.hxx:207
SvxColorItem makeSvx3DMaterialEmissionItem(const Color &rCol)
Definition: svx3ditems.hxx:108
class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DTextureKindItem final class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DTextureModeItem final SfxBoolItem makeSvx3DTextureFilterItem(bool bVal)
Definition: svx3ditems.hxx:140
SvxColorItem makeSvx3DLightcolor1Item(const Color &rCol)
Definition: svx3ditems.hxx:167
SfxUInt32Item makeSvx3DVerticalSegmentsItem(sal_uInt32 nVal)
Definition: svx3ditems.hxx:50
SfxBoolItem makeSvx3DTwoSidedLightingItem(bool bVal)
Definition: svx3ditems.hxx:163
SfxUInt16Item makeSvx3DMaterialSpecularIntensityItem(sal_uInt16 nVal)
Definition: svx3ditems.hxx:116
SvxColorItem makeSvx3DLightcolor8Item(const Color &rCol)
Definition: svx3ditems.hxx:195
SfxBoolItem makeSvx3DLightOnOff5Item(bool bVal)
Definition: svx3ditems.hxx:219
SfxUInt16Item makeSvx3DPercentDiagonalItem(sal_uInt16 nVal)
Definition: svx3ditems.hxx:34
SvxColorItem makeSvx3DLightcolor2Item(const Color &rCol)
Definition: svx3ditems.hxx:171
SfxBoolItem makeSvx3DDoubleSidedItem(bool bVal)
Definition: svx3ditems.hxx:58
SvxColorItem makeSvx3DLightcolor6Item(const Color &rCol)
Definition: svx3ditems.hxx:187
SfxUInt32Item makeSvx3DEndAngleItem(sal_uInt32 nVal)
Definition: svx3ditems.hxx:54
SfxUInt16Item makeSvx3DShadowSlantItem(sal_uInt16 nVal)
Definition: svx3ditems.hxx:267
SvxColorItem makeSvx3DLightcolor5Item(const Color &rCol)
Definition: svx3ditems.hxx:183
SvxColorItem makeSvx3DMaterialSpecularItem(const Color &rCol)
Definition: svx3ditems.hxx:112
SfxUInt32Item makeSvx3DDepthItem(sal_uInt32 nVal)
Definition: svx3ditems.hxx:42
SvxColorItem makeSvx3DAmbientcolorItem(const Color &rCol)
Definition: svx3ditems.hxx:199
class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DNormalsKindItem final SfxBoolItem makeSvx3DNormalsInvertItem(bool bVal)
Definition: svx3ditems.hxx:80
SfxBoolItem makeSvx3DLightOnOff7Item(bool bVal)
Definition: svx3ditems.hxx:227
class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DPerspectiveItem final SfxUInt32Item makeSvx3DDistanceItem(sal_uInt32 nVal)
Definition: svx3ditems.hxx:155
SfxBoolItem makeSvx3DLightOnOff1Item(bool bVal)
Definition: svx3ditems.hxx:203
SvxColorItem makeSvx3DLightcolor3Item(const Color &rCol)
Definition: svx3ditems.hxx:175
SfxBoolItem makeSvx3DLightOnOff3Item(bool bVal)
Definition: svx3ditems.hxx:211
SfxUInt32Item makeSvx3DFocalLengthItem(sal_uInt32 nVal)
Definition: svx3ditems.hxx:159
SvxColorItem makeSvx3DLightcolor4Item(const Color &rCol)
Definition: svx3ditems.hxx:179
SfxBoolItem makeSvx3DLightOnOff4Item(bool bVal)
Definition: svx3ditems.hxx:215
SfxBoolItem makeSvx3DLightOnOff8Item(bool bVal)
Definition: svx3ditems.hxx:231
class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DTextureProjectionXItem final class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DTextureProjectionYItem final SfxBoolItem makeSvx3DShadow3DItem(bool bVal)
Definition: svx3ditems.hxx:104
SfxBoolItem makeSvx3DLightOnOff6Item(bool bVal)
Definition: svx3ditems.hxx:223
SfxUInt32Item makeSvx3DHorizontalSegmentsItem(sal_uInt32 nVal)
Definition: svx3ditems.hxx:46
SvxColorItem makeSvx3DLightcolor7Item(const Color &rCol)
Definition: svx3ditems.hxx:191
SVT_DLLPUBLIC sal_Int64 GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
SVT_DLLPUBLIC void SetMetricValue(weld::MetricSpinButton &rField, sal_Int64 nCoreValue, MapUnit eUnit)
SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton &rCtrl, FieldUnit eUnit, bool bAll=false)
constexpr OUStringLiteral PERCENT(u"Percent")
RET_OK
ProjectionType
Definition: viewpt3d.hxx:38
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr TypedWhichId< XLineStyleItem > XATTR_LINESTYLE(XATTR_LINE_FIRST)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)