LibreOffice Module chart2 (master) 1
tp_3D_SceneIllumination.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
21#include <CommonConverters.hxx>
23#include <ChartModel.hxx>
24
25#include <svx/colorbox.hxx>
26#include <svx/float3d.hxx>
27#include <svx/strings.hrc>
28#include <svx/dialmgr.hxx>
29#include <svtools/colrdlg.hxx>
30#include <svx/svx3ditems.hxx>
31#include <svx/svddef.hxx>
32#include <utility>
33#include <svx/obj3d.hxx>
34#include <vcl/svapp.hxx>
36
37#include <com/sun/star/beans/XPropertySet.hpp>
38
39namespace chart
40{
41
42using namespace ::com::sun::star;
43using namespace ::com::sun::star::chart2;
44
45namespace {
46
47struct LightSource
48{
50 css::drawing::Direction3D aDirection;
52
53 LightSource() :
54 nDiffuseColor( 0xcccccc ),
55 aDirection( 1.0, 1.0, -1.0 ),
56 bIsEnabled( false )
57 {}
58};
59
60}
61
63{
65 LightSource aLightSource;
66
69};
70
72 : pButton(nullptr)
73{
74 aLightSource.nDiffuseColor = Color(0xffffff); // white
75 aLightSource.aDirection = drawing::Direction3D(1,1,1);
76 aLightSource.bIsEnabled = false;
77}
78
80{
81 if (!pButton)
82 return;
84}
85
86namespace
87{
88 OUString lcl_makeColorName(const Color& rColor)
89 {
90 OUString aStr = SvxResId(RID_SVXFLOAT3D_FIX_R) +
91 OUString::number(rColor.GetRed()) +
92 " " +
93 SvxResId(RID_SVXFLOAT3D_FIX_G) +
94 OUString::number(rColor.GetGreen()) +
95 " " +
96 SvxResId(RID_SVXFLOAT3D_FIX_B) +
97 OUString::number(rColor.GetBlue());
98 return aStr;
99 }
100
101 void lcl_selectColor(ColorListBox& rListBox, const Color& rColor)
102 {
103 rListBox.SetNoSelection();
104 rListBox.SelectEntry({rColor, lcl_makeColorName(rColor)});
105 }
106
107 ::chart::LightSource lcl_getLightSourceFromProperties(
108 const uno::Reference< beans::XPropertySet > & xSceneProperties,
109 sal_Int32 nIndex )
110 {
111 ::chart::LightSource aResult;
112 if( 0 <= nIndex && nIndex < 8 )
113 {
114 OUString aIndex( OUString::number( nIndex + 1 ));
115
116 try
117 {
118 xSceneProperties->getPropertyValue( "D3DSceneLightColor" + aIndex ) >>= aResult.nDiffuseColor;
119 xSceneProperties->getPropertyValue( "D3DSceneLightDirection" + aIndex ) >>= aResult.aDirection;
120 xSceneProperties->getPropertyValue( "D3DSceneLightOn" + aIndex ) >>= aResult.bIsEnabled;
121 }
122 catch( const uno::Exception & )
123 {
124 DBG_UNHANDLED_EXCEPTION("chart2");
125 }
126 }
127 return aResult;
128 }
129
130 void lcl_setLightSource(
131 const uno::Reference< beans::XPropertySet > & xSceneProperties,
132 const ::chart::LightSource & rLightSource,
133 sal_Int32 nIndex )
134 {
135 if( 0 > nIndex || nIndex >= 8 )
136 return;
137
138 OUString aIndex( OUString::number( nIndex + 1 ));
139
140 try
141 {
142 xSceneProperties->setPropertyValue( "D3DSceneLightColor" + aIndex,
143 uno::Any( rLightSource.nDiffuseColor ));
144 xSceneProperties->setPropertyValue( "D3DSceneLightDirection" + aIndex,
145 uno::Any( rLightSource.aDirection ));
146 xSceneProperties->setPropertyValue( "D3DSceneLightOn" + aIndex,
147 uno::Any( rLightSource.bIsEnabled ));
148 }
149 catch( const uno::Exception & )
150 {
151 DBG_UNHANDLED_EXCEPTION("chart2");
152 }
153 }
154
155 Color lcl_getAmbientColor(
156 const uno::Reference< beans::XPropertySet > & xSceneProperties )
157 {
158 Color nResult;
159 try
160 {
161 xSceneProperties->getPropertyValue("D3DSceneAmbientColor") >>= nResult;
162 }
163 catch( const uno::Exception & )
164 {
165 DBG_UNHANDLED_EXCEPTION("chart2");
166 }
167 return nResult;
168 }
169
170 void lcl_setAmbientColor(
171 const uno::Reference< beans::XPropertySet > & xSceneProperties,
172 const Color & rColor )
173 {
174 try
175 {
176 xSceneProperties->setPropertyValue("D3DSceneAmbientColor",
177 uno::Any( rColor ));
178 }
179 catch( const uno::Exception & )
180 {
181 DBG_UNHANDLED_EXCEPTION("chart2");
182 }
183 }
184}
185
187 weld::Window* pTopLevel,
189 const rtl::Reference<::chart::ChartModel>& xChartModel)
190 : m_xSceneProperties(std::move( xSceneProperties ))
191 , m_aTimerTriggeredControllerLock( xChartModel )
192 , m_bInCommitToModel( false )
193 , m_aModelChangeListener( LINK( this, ThreeD_SceneIllumination_TabPage, fillControlsFromModel ) )
194 , m_xChartModel( xChartModel )
195 , m_pTopLevel(pTopLevel)
196 , m_xBuilder(Application::CreateBuilder(pParent, "modules/schart/ui/tp_3D_SceneIllumination.ui"))
197 , m_xContainer(m_xBuilder->weld_container("tp_3D_SceneIllumination"))
198 , m_aBtn_Light1(m_xBuilder->weld_toggle_button("BTN_LIGHT_1"))
199 , m_aBtn_Light2(m_xBuilder->weld_toggle_button("BTN_LIGHT_2"))
200 , m_aBtn_Light3(m_xBuilder->weld_toggle_button("BTN_LIGHT_3"))
201 , m_aBtn_Light4(m_xBuilder->weld_toggle_button("BTN_LIGHT_4"))
202 , m_aBtn_Light5(m_xBuilder->weld_toggle_button("BTN_LIGHT_5"))
203 , m_aBtn_Light6(m_xBuilder->weld_toggle_button("BTN_LIGHT_6"))
204 , m_aBtn_Light7(m_xBuilder->weld_toggle_button("BTN_LIGHT_7"))
205 , m_aBtn_Light8(m_xBuilder->weld_toggle_button("BTN_LIGHT_8"))
206 , m_xLB_LightSource(new ColorListBox(m_xBuilder->weld_menu_button("LB_LIGHTSOURCE"), [this]{ return m_pTopLevel; }))
207 , m_xBtn_LightSource_Color(m_xBuilder->weld_button("BTN_LIGHTSOURCE_COLOR"))
208 , m_xLB_AmbientLight(new ColorListBox(m_xBuilder->weld_menu_button("LB_AMBIENTLIGHT"), [this]{ return m_pTopLevel; }))
209 , m_xBtn_AmbientLight_Color(m_xBuilder->weld_button("BTN_AMBIENT_COLOR"))
210 , m_xHoriScale(m_xBuilder->weld_scale("hori"))
211 , m_xVertScale(m_xBuilder->weld_scale("vert"))
212 , m_xBtn_Corner(m_xBuilder->weld_button("corner"))
213 , m_xPreview(new Svx3DLightControl)
214 , m_xPreviewWnd(new weld::CustomWeld(*m_xBuilder, "CTL_LIGHT_PREVIEW", *m_xPreview))
215 , m_xCtl_Preview(new SvxLightCtl3D(*m_xPreview, *m_xHoriScale, *m_xVertScale, *m_xBtn_Corner))
216{
217 m_pLightSourceInfoList.reset(new LightSourceInfo[8]);
218 m_pLightSourceInfoList[0].pButton = &m_aBtn_Light1;
219 m_pLightSourceInfoList[1].pButton = &m_aBtn_Light2;
220 m_pLightSourceInfoList[2].pButton = &m_aBtn_Light3;
221 m_pLightSourceInfoList[3].pButton = &m_aBtn_Light4;
222 m_pLightSourceInfoList[4].pButton = &m_aBtn_Light5;
223 m_pLightSourceInfoList[5].pButton = &m_aBtn_Light6;
224 m_pLightSourceInfoList[6].pButton = &m_aBtn_Light7;
225 m_pLightSourceInfoList[7].pButton = &m_aBtn_Light8;
226
227 fillControlsFromModel(nullptr);
228
229 m_aBtn_Light1.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
230 m_aBtn_Light2.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
231 m_aBtn_Light3.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
232 m_aBtn_Light4.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
233 m_aBtn_Light5.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
234 m_aBtn_Light6.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
235 m_aBtn_Light7.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
236 m_aBtn_Light8.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) );
237
238 m_xLB_AmbientLight->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) );
239 m_xLB_LightSource->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) );
240
241 m_xBtn_AmbientLight_Color->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) );
242 m_xBtn_LightSource_Color->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ColorDialogHdl ) );
243
244 m_xCtl_Preview->SetUserInteractiveChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewChangeHdl ) );
245 m_xCtl_Preview->SetUserSelectionChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewSelectHdl ) );
246
247 ClickLightSourceButtonHdl(*m_aBtn_Light2.get_widget());
248
249 m_aModelChangeListener.startListening( uno::Reference< util::XModifyBroadcaster >(m_xSceneProperties, uno::UNO_QUERY) );
250}
251
253{
254}
255
256IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, fillControlsFromModel, void*, void)
257{
258 if( m_bInCommitToModel )//don't read own changes
259 return;
260
261 sal_Int32 nL=0;
262 for( nL=0; nL<8; nL++)
263 m_pLightSourceInfoList[nL].aLightSource = lcl_getLightSourceFromProperties( m_xSceneProperties, nL );
264 for( nL=0; nL<8; nL++)
265 m_pLightSourceInfoList[nL].initButtonFromSource();
266
267 lcl_selectColor( *m_xLB_AmbientLight, lcl_getAmbientColor( m_xSceneProperties ));
268
269 updatePreview();
270}
271
273{
275 m_bInCommitToModel = true;
276 sal_Int32 nIndex( nLightNumber );
277 lcl_setLightSource( m_xSceneProperties, m_pLightSourceInfoList[nIndex].aLightSource, nIndex );
278 m_bInCommitToModel = false;
279}
280
282{
285 for( sal_Int32 nL=0; nL<8; nL++)
288}
289
291{
292 m_aTimerTriggeredControllerLock.startTimer();
293
294 //update m_pLightSourceInfoList from preview
295 const SfxItemSet a3DLightAttributes(m_xCtl_Preview->GetSvx3DLightControl().Get3DAttributes());
296 LightSourceInfo* pInfo = &m_pLightSourceInfoList[0];
297
298 pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1).GetValue();
299 pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_1).GetValue();
300 pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1).GetValue());
301
302 pInfo = &m_pLightSourceInfoList[1];
303 pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2).GetValue();
304 pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_2).GetValue();
305 pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2).GetValue());
306
307 pInfo = &m_pLightSourceInfoList[2];
308 pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3).GetValue();
309 pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_3).GetValue();
310 pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3).GetValue());
311
312 pInfo = &m_pLightSourceInfoList[3];
313 pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4).GetValue();
314 pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_4).GetValue();
315 pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4).GetValue());
316
317 pInfo = &m_pLightSourceInfoList[4];
318 pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5).GetValue();
319 pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_5).GetValue();
320 pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5).GetValue());
321
322 pInfo = &m_pLightSourceInfoList[5];
323 pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6).GetValue();
324 pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_6).GetValue();
325 pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6).GetValue());
326
327 pInfo = &m_pLightSourceInfoList[6];
328 pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7).GetValue();
329 pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_7).GetValue();
330 pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7).GetValue());
331
332 pInfo = &m_pLightSourceInfoList[7];
333 pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8).GetValue();
334 pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_8).GetValue();
335 pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8).GetValue());
336
337 applyLightSourcesToModel();
338}
339
341{
342 sal_uInt32 nLightNumber = m_xCtl_Preview->GetSvx3DLightControl().GetSelectedLight();
343 if(nLightNumber<8)
344 {
345 LightButton* pButton = m_pLightSourceInfoList[nLightNumber].pButton;
346 if(!pButton->get_active())
347 ClickLightSourceButtonHdl(*pButton->get_widget());
348
349 applyLightSourcesToModel();
350 }
351}
352
353IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, weld::Button&, rButton, void )
354{
355 bool bIsAmbientLight = (&rButton == m_xBtn_AmbientLight_Color.get());
356 ColorListBox* pListBox = bIsAmbientLight ? m_xLB_AmbientLight.get() : m_xLB_LightSource.get();
357
358 SvColorDialog aColorDlg;
359 aColorDlg.SetColor( pListBox->GetSelectEntryColor() );
360 if( aColorDlg.Execute(m_pTopLevel) != RET_OK )
361 return;
362
363 Color aColor( aColorDlg.GetColor());
364 lcl_selectColor( *pListBox, aColor );
365 if( bIsAmbientLight )
366 {
367 m_bInCommitToModel = true;
368 lcl_setAmbientColor( m_xSceneProperties, aColor );
369 m_bInCommitToModel = false;
370 }
371 else
372 {
373 //get active lightsource:
374 LightSourceInfo* pInfo = nullptr;
375 sal_Int32 nL=0;
376 for( nL=0; nL<8; nL++)
377 {
378 pInfo = &m_pLightSourceInfoList[nL];
379 if(pInfo->pButton->get_active())
380 break;
381 pInfo = nullptr;
382 }
383 if(pInfo)
384 applyLightSourceToModel( nL );
385 }
386 SelectColorHdl( *pListBox );
387}
388
390{
391 ColorListBox* pListBox = &rBox;
392 if (pListBox == m_xLB_AmbientLight.get())
393 {
394 m_bInCommitToModel = true;
395 lcl_setAmbientColor( m_xSceneProperties, pListBox->GetSelectEntryColor());
396 m_bInCommitToModel = false;
397 }
398 else if (pListBox == m_xLB_LightSource.get())
399 {
400 //get active lightsource:
401 LightSourceInfo* pInfo = nullptr;
402 sal_Int32 nL=0;
403 for( nL=0; nL<8; nL++)
404 {
405 pInfo = &m_pLightSourceInfoList[nL];
406 if (pInfo->pButton->get_active())
407 break;
408 pInfo = nullptr;
409 }
410 if(pInfo)
411 {
412 pInfo->aLightSource.nDiffuseColor = pListBox->GetSelectEntryColor();
413 applyLightSourceToModel( nL );
414 }
415 }
416 updatePreview();
417}
418
419IMPL_LINK(ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl, weld::Button&, rBtn, void)
420{
421 LightButton* pButton = nullptr;
422 LightSourceInfo* pInfo = nullptr;
423 sal_Int32 nL=0;
424 for( nL=0; nL<8; nL++)
425 {
426 if (m_pLightSourceInfoList[nL].pButton->get_widget() == &rBtn)
427 {
428 pButton = m_pLightSourceInfoList[nL].pButton;
429 pInfo = &m_pLightSourceInfoList[nL];
430 break;
431 }
432 }
433
434 assert(pInfo);
435
436 bool bIsChecked = pInfo->pButton->get_prev_active();
437
438 ControllerLockGuardUNO aGuard( m_xChartModel );
439 for (sal_Int32 i = 0; i < 8; ++i)
440 {
441 LightButton* pLightButton = m_pLightSourceInfoList[i].pButton;
442 if (pLightButton == pButton)
443 {
444 pLightButton->set_active(true);
445 if (!pLightButton->get_widget()->has_focus())
446 pLightButton->get_widget()->grab_focus();
447 m_pLightSourceInfoList[i].pButton->set_prev_active(true);
448 }
449 else
450 {
451 pLightButton->set_active(false);
452 m_pLightSourceInfoList[i].pButton->set_prev_active(false);
453 }
454 }
455
456 //update light button
457 if (bIsChecked)
458 {
459 pButton->switchLightOn(!pButton->isLightOn());
460 pInfo->aLightSource.bIsEnabled=pButton->isLightOn();
461 applyLightSourceToModel( nL );
462 }
463
464 //update color list box
465 lcl_selectColor( *m_xLB_LightSource, pInfo->aLightSource.nDiffuseColor );
466 updatePreview();
467}
468
470{
471 SfxItemSet aItemSet(m_xCtl_Preview->GetSvx3DLightControl().Get3DAttributes());
473
474 // AmbientColor
475 aItemSet.Put(makeSvx3DAmbientcolorItem(m_xLB_AmbientLight->GetSelectEntryColor()));
476
477 aItemSet.Put(makeSvx3DLightcolor1Item(pInfo->aLightSource.nDiffuseColor));
478 aItemSet.Put(makeSvx3DLightOnOff1Item(pInfo->aLightSource.bIsEnabled));
480
481 pInfo = &m_pLightSourceInfoList[1];
482 aItemSet.Put(makeSvx3DLightcolor2Item(pInfo->aLightSource.nDiffuseColor));
483 aItemSet.Put(makeSvx3DLightOnOff2Item(pInfo->aLightSource.bIsEnabled));
485
486 pInfo = &m_pLightSourceInfoList[2];
487 aItemSet.Put(makeSvx3DLightcolor3Item(pInfo->aLightSource.nDiffuseColor));
488 aItemSet.Put(makeSvx3DLightOnOff3Item(pInfo->aLightSource.bIsEnabled));
490
491 pInfo = &m_pLightSourceInfoList[3];
492 aItemSet.Put(makeSvx3DLightcolor4Item(pInfo->aLightSource.nDiffuseColor));
493 aItemSet.Put(makeSvx3DLightOnOff4Item(pInfo->aLightSource.bIsEnabled));
495
496 pInfo = &m_pLightSourceInfoList[4];
497 aItemSet.Put(makeSvx3DLightcolor5Item(pInfo->aLightSource.nDiffuseColor));
498 aItemSet.Put(makeSvx3DLightOnOff5Item(pInfo->aLightSource.bIsEnabled));
500
501 pInfo = &m_pLightSourceInfoList[5];
502 aItemSet.Put(makeSvx3DLightcolor6Item(pInfo->aLightSource.nDiffuseColor));
503 aItemSet.Put(makeSvx3DLightOnOff6Item(pInfo->aLightSource.bIsEnabled));
505
506 pInfo = &m_pLightSourceInfoList[6];
507 aItemSet.Put(makeSvx3DLightcolor7Item(pInfo->aLightSource.nDiffuseColor));
508 aItemSet.Put(makeSvx3DLightOnOff7Item(pInfo->aLightSource.bIsEnabled));
510
511 pInfo = &m_pLightSourceInfoList[7];
512 aItemSet.Put(makeSvx3DLightcolor8Item(pInfo->aLightSource.nDiffuseColor));
513 aItemSet.Put(makeSvx3DLightOnOff8Item(pInfo->aLightSource.bIsEnabled));
515
516 // set lights and ambient light
517 m_xCtl_Preview->GetSvx3DLightControl().Set3DAttributes(aItemSet);
518
519 // select light
520 for(sal_uInt32 a(0); a < 8; a++)
521 {
522 if (m_pLightSourceInfoList[a].pButton->get_active())
523 {
524 m_xCtl_Preview->GetSvx3DLightControl().SelectLight(a);
525 m_xCtl_Preview->CheckSelection();
526 break;
527 }
528 }
529}
530
531} //namespace chart
532
533/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Color const & GetSelectEntryColor() const
void SelectEntry(const NamedColor &rColor)
void SetNoSelection()
sal_uInt8 GetBlue() const
sal_uInt8 GetRed() const
sal_uInt8 GetGreen() const
weld::ToggleButton * get_widget() const
bool isLightOn() const
bool get_active() const
bool get_prev_active() const
void switchLightOn(bool bOn)
void set_active(bool bActive)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const Color & GetColor() const
short Execute(weld::Window *pParent)
void SetColor(const Color &rColor)
This guard calls lockControllers at the given Model in the CTOR and unlockControllers in the DTOR.
void applyLightSourceToModel(sal_uInt32 nLightNumber)
rtl::Reference<::chart::ChartModel > m_xChartModel
css::uno::Reference< css::beans::XPropertySet > m_xSceneProperties
ThreeD_SceneIllumination_TabPage(weld::Container *pParent, weld::Window *pTopLevel, css::uno::Reference< css::beans::XPropertySet > xSceneProperties, const rtl::Reference<::chart::ChartModel > &xChartModel)
TimerTriggeredControllerLock m_aTimerTriggeredControllerLock
std::unique_ptr< LightSourceInfo[]> m_pLightSourceInfoList
std::unique_ptr< ColorListBox > m_xLB_AmbientLight
std::unique_ptr< SvxLightCtl3D > m_xCtl_Preview
virtual void grab_focus()=0
virtual bool has_focus() const=0
#define DBG_UNHANDLED_EXCEPTION(...)
SVXCORE_DLLPUBLIC OUString SvxResId(TranslateId aId)
std::deque< AttacherIndex_Impl > aIndex
sal_Int32 nIndex
uno_Any a
aStr
OOO_DLLPUBLIC_CHARTTOOLS::basegfx::B3DVector Direction3DToB3DVector(const css::drawing::Direction3D &rDirection)
Direction3D -> B3DVector.
OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Direction3D B3DVectorToDirection3D(const ::basegfx::B3DVector &rVector)
B3DVector -> Direction3D.
IMPL_LINK(StackingResourceGroup, StackingChangeHdl, weld::Toggleable &, rRadio, void)
IMPL_LINK_NOARG(SplinePropertiesDialog, SplineTypeListBoxHdl, weld::ComboBox &, void)
int i
Reference< XNameAccess > m_xContainer
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_8(SDRATTR_3DSCENE_FIRST+20)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_4(SDRATTR_3DSCENE_FIRST+16)
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< SvxColorItem > SDRATTR_3DSCENE_LIGHTCOLOR_1(SDRATTR_3DSCENE_FIRST+4)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_3(SDRATTR_3DSCENE_FIRST+15)
constexpr TypedWhichId< SvxColorItem > SDRATTR_3DSCENE_LIGHTCOLOR_5(SDRATTR_3DSCENE_FIRST+8)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_5(SDRATTR_3DSCENE_FIRST+17)
constexpr TypedWhichId< SvxB3DVectorItem > SDRATTR_3DSCENE_LIGHTDIRECTION_7(SDRATTR_3DSCENE_FIRST+27)
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< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_6(SDRATTR_3DSCENE_FIRST+18)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_2(SDRATTR_3DSCENE_FIRST+14)
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< SvxColorItem > SDRATTR_3DSCENE_LIGHTCOLOR_2(SDRATTR_3DSCENE_FIRST+5)
constexpr TypedWhichId< SvxColorItem > SDRATTR_3DSCENE_LIGHTCOLOR_3(SDRATTR_3DSCENE_FIRST+6)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DSCENE_LIGHTON_7(SDRATTR_3DSCENE_FIRST+19)
SvxB3DVectorItem makeSvx3DLightDirection6Item(const basegfx::B3DVector &rVec)
SfxBoolItem makeSvx3DLightOnOff2Item(bool bVal)
SvxColorItem makeSvx3DLightcolor1Item(const Color &rCol)
SvxColorItem makeSvx3DLightcolor8Item(const Color &rCol)
SfxBoolItem makeSvx3DLightOnOff5Item(bool bVal)
SvxB3DVectorItem makeSvx3DLightDirection3Item(const basegfx::B3DVector &rVec)
SvxColorItem makeSvx3DLightcolor2Item(const Color &rCol)
SvxColorItem makeSvx3DLightcolor6Item(const Color &rCol)
SvxB3DVectorItem makeSvx3DLightDirection5Item(const basegfx::B3DVector &rVec)
SvxB3DVectorItem makeSvx3DLightDirection8Item(const basegfx::B3DVector &rVec)
SvxColorItem makeSvx3DLightcolor5Item(const Color &rCol)
SvxColorItem makeSvx3DAmbientcolorItem(const Color &rCol)
SfxBoolItem makeSvx3DLightOnOff7Item(bool bVal)
SvxB3DVectorItem makeSvx3DLightDirection4Item(const basegfx::B3DVector &rVec)
SfxBoolItem makeSvx3DLightOnOff1Item(bool bVal)
SvxColorItem makeSvx3DLightcolor3Item(const Color &rCol)
SfxBoolItem makeSvx3DLightOnOff3Item(bool bVal)
SvxColorItem makeSvx3DLightcolor4Item(const Color &rCol)
SvxB3DVectorItem makeSvx3DLightDirection1Item(const basegfx::B3DVector &rVec)
SfxBoolItem makeSvx3DLightOnOff4Item(bool bVal)
SfxBoolItem makeSvx3DLightOnOff8Item(bool bVal)
SvxB3DVectorItem makeSvx3DLightDirection2Item(const basegfx::B3DVector &rVec)
SfxBoolItem makeSvx3DLightOnOff6Item(bool bVal)
SvxB3DVectorItem makeSvx3DLightDirection7Item(const basegfx::B3DVector &rVec)
SvxColorItem makeSvx3DLightcolor7Item(const Color &rCol)
css::drawing::Direction3D aDirection
Color nDiffuseColor
bool bIsEnabled
RET_OK