28#include <com/sun/star/drawing/ProjectionMode.hpp>
44 rField.
set_range(-1*nLimit, nLimit, FieldUnit::DEGREE);
52 : m_xDiagram(
std::move( xDiagram ))
53 , m_aAngleTimer(
"chart2 ThreeD_SceneGeometry_TabPage m_aAngleTimer")
54 , m_aPerspectiveTimer(
"chart2 ThreeD_SceneGeometry_TabPage m_aPerspectiveTimer")
58 , m_bAngleChangePending( false )
59 , m_bPerspectiveChangePending( false )
60 , m_rControllerLockHelper( rControllerLockHelper )
61 , m_xBuilder(
Application::CreateBuilder(pParent,
"modules/schart/ui/tp_3D_SceneGeometry.ui"))
62 ,
m_xContainer(m_xBuilder->weld_container(
"tp_3DSceneGeometry"))
63 , m_xCbxRightAngledAxes(m_xBuilder->weld_check_button(
"CBX_RIGHT_ANGLED_AXES"))
64 , m_xMFXRotation(m_xBuilder->weld_metric_spin_button(
"MTR_FLD_X_ROTATION",
FieldUnit::
DEGREE))
65 , m_xMFYRotation(m_xBuilder->weld_metric_spin_button(
"MTR_FLD_Y_ROTATION",
FieldUnit::
DEGREE))
66 , m_xFtZRotation(m_xBuilder->weld_label(
"FT_Z_ROTATION"))
67 , m_xMFZRotation(m_xBuilder->weld_metric_spin_button(
"MTR_FLD_Z_ROTATION",
FieldUnit::
DEGREE))
68 , m_xCbxPerspective(m_xBuilder->weld_check_button(
"CBX_PERSPECTIVE"))
69 , m_xMFPerspective(m_xBuilder->weld_metric_spin_button(
"MTR_FLD_PERSPECTIVE",
FieldUnit::
PERCENT))
71 double fXAngle, fYAngle, fZAngle;
72 m_xDiagram->getRotationAngle( fXAngle, fYAngle, fZAngle );
78 OSL_ENSURE( fZAngle>=-90 && fZAngle<=90,
"z angle is out of valid range" );
83 ::basegfx::fround(fXAngle * pow(10.0,
m_xMFXRotation->get_digits())));
85 ::basegfx::fround(-1.0 * fYAngle * pow(10.0,
m_xMFYRotation->get_digits())));
87 ::basegfx::fround(-1.0 * fZAngle * pow(10.0,
m_xMFZRotation->get_digits())));
102 drawing::ProjectionMode aProjectionMode = drawing::ProjectionMode_PERSPECTIVE;
103 m_xDiagram->getPropertyValue(
"D3DScenePerspective" ) >>= aProjectionMode;
104 m_xCbxPerspective->set_active( aProjectionMode == drawing::ProjectionMode_PERSPECTIVE );
107 sal_Int32 nPerspectivePercentage = 20;
108 m_xDiagram->getPropertyValue(
"Perspective" ) >>= nPerspectivePercentage;
119 bool bRightAngledAxes =
false;
120 m_xDiagram->getPropertyValue(
"RightAngledAxes" ) >>= bRightAngledAxes;
149 double fXAngle = 0.0, fYAngle = 0.0, fZAngle = 0.0;
162 m_xDiagram->setRotationAngle( fXAngle, fYAngle, fZAngle );
170 m_nXRotation = m_xMFXRotation->get_value(FieldUnit::DEGREE);
171 m_nYRotation = m_xMFYRotation->get_value(FieldUnit::DEGREE);
173 m_bAngleChangePending =
true;
175 m_aAngleTimer.Start();
180 applyAnglesToModel();
188 ? drawing::ProjectionMode_PERSPECTIVE
189 : drawing::ProjectionMode_PARALLEL;
196 catch(
const uno::Exception & )
207 m_bPerspectiveChangePending =
true;
208 m_aPerspectiveTimer.Start();
213 applyPerspectiveToModel();
218 m_xMFPerspective->set_sensitive(m_xCbxPerspective->get_active());
219 applyPerspectiveToModel();
226 bool bEnableZ = !m_xCbxRightAngledAxes->get_active();
227 m_xFtZRotation->set_sensitive( bEnableZ );
228 m_xMFZRotation->set_sensitive( bEnableZ );
231 m_nXRotation = m_xMFXRotation->get_value(FieldUnit::DEGREE);
232 m_nYRotation = m_xMFYRotation->get_value(FieldUnit::DEGREE);
233 m_nZRotation = m_xMFZRotation->get_value(FieldUnit::DEGREE);
237 m_xMFZRotation->set_text(
"");
244 lcl_SetMetricFieldLimits( *m_xMFXRotation, 180 );
245 lcl_SetMetricFieldLimits( *m_xMFYRotation, 180 );
247 m_xMFXRotation->set_value(m_nXRotation, FieldUnit::DEGREE);
248 m_xMFYRotation->set_value(m_nYRotation, FieldUnit::DEGREE);
249 m_xMFZRotation->set_value(m_nZRotation, FieldUnit::DEGREE);
253 m_xDiagram->switchRightAngledAxes( m_xCbxRightAngledAxes->get_active() );
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
static bool isSupportingRightAngledAxes(const rtl::Reference< ::chart::ChartType > &xChartType)
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 double getValueClippedToRange(double fValue, const double &fPositivLimit)
static double getYDegreeAngleLimitForRightAngledAxes()
static double getXDegreeAngleLimitForRightAngledAxes()
std::unique_ptr< weld::CheckButton > m_xCbxRightAngledAxes
std::unique_ptr< weld::MetricSpinButton > m_xMFPerspective
std::unique_ptr< weld::MetricSpinButton > m_xMFZRotation
std::unique_ptr< weld::CheckButton > m_xCbxPerspective
~ThreeD_SceneGeometry_TabPage()
void commitPendingChanges()
Timer m_aPerspectiveTimer
rtl::Reference< ::chart::Diagram > m_xDiagram
bool m_bAngleChangePending
ControllerLockHelper & m_rControllerLockHelper
bool m_bPerspectiveChangePending
void applyAnglesToModel()
void applyPerspectiveToModel()
std::unique_ptr< weld::MetricSpinButton > m_xMFXRotation
ThreeD_SceneGeometry_TabPage(weld::Container *pWindow, rtl::Reference< ::chart::Diagram > xDiagram, ControllerLockHelper &rControllerLockHelper)
std::unique_ptr< weld::MetricSpinButton > m_xMFYRotation
#define DBG_UNHANDLED_EXCEPTION(...)
std::enable_if< std::is_signed< T >::value, T >::type NormAngle180(T angle)
#define LINK(Instance, Class, Member)
constexpr double rad2deg(double v)
constexpr double deg2rad(double v)
IMPL_LINK_NOARG(SplinePropertiesDialog, SplineTypeListBoxHdl, weld::ComboBox &, void)
Reference< XNameAccess > m_xContainer
#define EDIT_UPDATEDATA_TIMEOUT
constexpr OUStringLiteral PERCENT(u"Percent")