26#include <com/sun/star/drawing/ShadeMode.hpp>
36struct lcl_ModelProperties
38 drawing::ShadeMode m_aShadeMode;
39 sal_Int32 m_nRoundedEdges;
40 sal_Int32 m_nObjectLines;
44 : m_aShadeMode(drawing::ShadeMode_FLAT)
53 lcl_ModelProperties aProps;
57 xDiagram->getPropertyValue(
"D3DSceneShadeMode" ) >>= aProps.m_aShadeMode;
59 aProps.m_eScheme = xDiagram->detectScheme();
61 catch(
const uno::Exception & )
73 xDiaProp->setPropertyValue(
"D3DSceneShadeMode" ,
uno::Any( aShadeMode ));
75 catch(
const uno::Exception & )
86#define POS_3DSCHEME_SIMPLE 0
87#define POS_3DSCHEME_REALISTIC 1
88#define POS_3DSCHEME_CUSTOM 2
93 : m_xChartModel(
std::move(xChartModel))
94 , m_bUpdateOtherControls(true)
95 , m_bCommitToModel(true)
96 , m_rControllerLockHelper(rControllerLockHelper)
97 , m_xBuilder(
Application::CreateBuilder(pParent,
"modules/schart/ui/tp_3D_SceneAppearance.ui"))
98 ,
m_xContainer(m_xBuilder->weld_container(
"tp_3D_SceneAppearance"))
99 , m_xLB_Scheme(m_xBuilder->weld_combo_box(
"LB_SCHEME"))
100 , m_xCB_Shading(m_xBuilder->weld_check_button(
"CB_SHADING"))
101 , m_xCB_ObjectLines(m_xBuilder->weld_check_button(
"CB_OBJECTLINES"))
102 , m_xCB_RoundedEdge(m_xBuilder->weld_check_button(
"CB_ROUNDEDEDGE"))
130 sal_Int32 nObjectLines = -1;
145 sal_Int32 nCurrentRoundedEdges = -1;
149 nCurrentRoundedEdges = 0;
152 nCurrentRoundedEdges = 5;
155 nCurrentRoundedEdges = -1;
162 m_xChartModel->getFirstChartDiagram(), nCurrentRoundedEdges, nObjectLines );
170 drawing::ShadeMode aShadeMode = drawing::ShadeMode_PHONG;
175 aShadeMode = drawing::ShadeMode_FLAT;
178 aShadeMode = drawing::ShadeMode_SMOOTH;
193 lcl_ModelProperties aProps( lcl_getPropertiesFromModel(
m_xChartModel ));
195 if(aProps.m_aShadeMode == drawing::ShadeMode_FLAT)
199 else if(aProps.m_aShadeMode == drawing::ShadeMode_SMOOTH)
208 if(aProps.m_nObjectLines == 0)
212 else if(aProps.m_nObjectLines==1)
221 if(aProps.m_nRoundedEdges >= 5)
225 else if(aProps.m_nRoundedEdges<0)
243 lcl_ModelProperties aProps( lcl_getPropertiesFromModel(
m_xChartModel ));
247 switch( aProps.m_eScheme )
266 if( !m_bUpdateOtherControls )
281 OSL_FAIL(
"Invalid Entry selected" );
286 initControlsFromModel();
291 if( !m_bUpdateOtherControls )
294 applyShadeModeToModel();
300 if( !m_bUpdateOtherControls )
303 if (&rCheckBox == m_xCB_ObjectLines.get())
305 m_bUpdateOtherControls =
false;
306 m_xCB_RoundedEdge->set_sensitive( !m_xCB_ObjectLines->get_active() );
307 if(!m_xCB_RoundedEdge->get_sensitive())
308 m_xCB_RoundedEdge->set_active(
false);
309 m_bUpdateOtherControls =
true;
312 applyRoundedEdgeAndObjectLinesToModel();
This guard calls lockControllers at the given ControllerLockHelper in the CTOR and unlockControllers ...
This helper class can be used to pass a locking mechanism to other objects without exposing the full ...
static void setRoundedEdgesAndObjectLines(const rtl::Reference< ::chart::Diagram > &xDiagram, sal_Int32 nRoundedEdges, sal_Int32 nObjectLines)
static void getRoundedEdgesAndObjectLines(const rtl::Reference< ::chart::Diagram > &xDiagram, sal_Int32 &rnRoundedEdges, sal_Int32 &rnObjectLines)
void initControlsFromModel()
ThreeD_SceneAppearance_TabPage(weld::Container *pParent, rtl::Reference<::chart::ChartModel > xChartModel, ControllerLockHelper &rControllerLockHelper)
rtl::Reference<::chart::ChartModel > m_xChartModel
ControllerLockHelper & m_rControllerLockHelper
void applyShadeModeToModel()
void applyRoundedEdgeAndObjectLinesToModel()
std::unique_ptr< weld::CheckButton > m_xCB_RoundedEdge
std::unique_ptr< weld::CheckButton > m_xCB_Shading
~ThreeD_SceneAppearance_TabPage()
std::unique_ptr< weld::ComboBox > m_xLB_Scheme
bool m_bUpdateOtherControls
std::unique_ptr< weld::CheckButton > m_xCB_ObjectLines
#define DBG_UNHANDLED_EXCEPTION(...)
#define LINK(Instance, Class, Member)
@ ThreeDLookScheme_Unknown
@ ThreeDLookScheme_Realistic
@ ThreeDLookScheme_Simple
IMPL_LINK(StackingResourceGroup, StackingChangeHdl, weld::Toggleable &, rRadio, void)
IMPL_LINK_NOARG(SplinePropertiesDialog, SplineTypeListBoxHdl, weld::ComboBox &, void)
Reference< XNameAccess > m_xContainer
Reference< XModel > xModel
#define POS_3DSCHEME_CUSTOM