21 #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
22 #include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
23 #include <com/sun/star/drawing/ShadeMode.hpp>
24 #include <com/sun/star/drawing/Position3D.hpp>
25 #include <com/sun/star/drawing/Direction3D.hpp>
26 #include <com/sun/star/drawing/ProjectionMode.hpp>
27 #include <svx/svxids.hrc>
36 #include <svx/strings.hrc>
42 #include <rtl/math.hxx>
47 using namespace ::
svx;
48 using namespace ::
cppu;
57 { 0, SfxGroupId::NONE, SfxSlotMode::NONE, 0, 0,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr, 0, SfxDisableFlags::NONE,
nullptr }
64 GetStaticInterface()->RegisterObjectBar(
SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, ToolbarId::Svx_Extrusion_Bar);
71 DBG_ASSERT( pViewShell,
"svx::ExtrusionBar::ExtrusionBar(), I need a viewshell!" );
86 static const Direction3D aLighting1Defaults[9] =
88 Direction3D( -50000, -50000, 10000 ),
89 Direction3D( 0, -50000, 10000 ),
90 Direction3D( 50000, -50000, 10000 ),
91 Direction3D( -50000, 0, 10000 ),
92 Direction3D( 0, 0, 10000 ),
93 Direction3D( 50000, 0, 10000 ),
94 Direction3D( -50000, 50000, 10000 ),
95 Direction3D( 0, 50000, 10000 ),
96 Direction3D( 50000, 50000, 10000 )
99 static const Direction3D aLighting2Defaults[9] =
101 Direction3D( 50000,0, 10000 ),
102 Direction3D( 0, 50000, 10000 ),
103 Direction3D( -50000, 0, 10000 ),
104 Direction3D( 50000, 0, 10000 ),
105 Direction3D( 0, 0, 10000 ),
106 Direction3D( -50000, 0, 10000 ),
107 Direction3D( 50000, 0, 10000 ),
108 Direction3D( 0, -50000, 10000 ),
109 Direction3D( -50000, 0, 10000 )
112 *pLighting1Defaults = aLighting1Defaults;
113 *pLighting2Defaults = aLighting2Defaults;
118 static constexpr OUStringLiteral sExtrusion =
u"Extrusion";
119 static constexpr OUStringLiteral sRotateAngle =
u"RotateAngle";
121 sal_uInt16 nSID = rReq.
GetSlot();
124 case SID_EXTRUSION_TOGGLE:
137 css::beans::PropertyValue aPropValue;
138 aPropValue.Name = sExtrusion;
139 aPropValue.Value <<=
true;
145 case SID_EXTRUSION_TILT_DOWN:
146 case SID_EXTRUSION_TILT_UP:
147 case SID_EXTRUSION_TILT_LEFT:
148 case SID_EXTRUSION_TILT_RIGHT:
150 bool bHorizontal = ( nSID == SID_EXTRUSION_TILT_DOWN ) || ( nSID == SID_EXTRUSION_TILT_UP );
151 sal_Int32 nDiff = ( nSID == SID_EXTRUSION_TILT_LEFT ) || ( nSID == SID_EXTRUSION_TILT_UP ) ? 5 : -5;
152 EnhancedCustomShapeParameterPair aRotateAnglePropPair;
155 aRotateAnglePropPair.First.Value <<= fX;
156 aRotateAnglePropPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
157 aRotateAnglePropPair.Second.Value <<= fY;
158 aRotateAnglePropPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
160 if( pAny && ( *pAny >>= aRotateAnglePropPair ) )
162 aRotateAnglePropPair.First.Value >>= fX;
163 aRotateAnglePropPair.Second.Value >>= fY;
169 aRotateAnglePropPair.First.Value <<= fX;
170 aRotateAnglePropPair.Second.Value <<= fY;
171 css::beans::PropertyValue aPropValue;
172 aPropValue.Name = sRotateAngle;
173 aPropValue.Value <<= aRotateAnglePropPair;
178 case SID_EXTRUSION_DIRECTION:
184 Position3D aViewPoint( 3472, -3472, 25000 );
185 double fOriginX = 0.50;
186 double fOriginY = -0.50;
187 double fSkewAngle = nSkew;
193 aViewPoint.PositionY = 3472;
197 aViewPoint.PositionX = 0;
198 aViewPoint.PositionY = 3472;
203 aViewPoint.PositionX = -3472;
204 aViewPoint.PositionY = 3472;
209 aViewPoint.PositionY = 0;
213 aViewPoint.PositionX = 0;
214 aViewPoint.PositionY = 0;
220 aViewPoint.PositionX = -3472;
221 aViewPoint.PositionY = 0;
226 aViewPoint.PositionX = 0;
230 aViewPoint.PositionX = -3472;
235 css::beans::PropertyValue aPropValue;
237 aPropValue.Name =
"ViewPoint";
238 aPropValue.Value <<= aViewPoint;
242 EnhancedCustomShapeParameterPair aOriginPropPair;
243 aOriginPropPair.First.Value <<= fOriginX;
244 aOriginPropPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
245 aOriginPropPair.Second.Value <<= fOriginY;
246 aOriginPropPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
247 aPropValue.Name =
"Origin";
248 aPropValue.Value <<= aOriginPropPair;
251 EnhancedCustomShapeParameterPair aSkewPropPair;
252 aSkewPropPair.First.Value <<= fSkew;
253 aSkewPropPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
254 aSkewPropPair.Second.Value <<= fSkewAngle;
255 aSkewPropPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
256 aPropValue.Name =
"Skew";
257 aPropValue.Value <<= aSkewPropPair;
262 case SID_EXTRUSION_PROJECTION:
267 ProjectionMode eProjectionMode = nProjection == 1 ? ProjectionMode_PARALLEL : ProjectionMode_PERSPECTIVE;
268 css::beans::PropertyValue aPropValue;
269 aPropValue.Name =
"ProjectionMode";
270 aPropValue.Value <<= eProjectionMode;
275 case SID_EXTRUSION_DEPTH:
280 EnhancedCustomShapeParameterPair aDepthPropPair;
281 aDepthPropPair.First.Value <<= fDepth;
282 aDepthPropPair.First.Type = EnhancedCustomShapeParameterType::NORMAL;
283 aDepthPropPair.Second.Value <<= 0.0;
284 aDepthPropPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL;
286 css::beans::PropertyValue aPropValue;
287 aPropValue.Name =
"Depth";
288 aPropValue.Value <<= aDepthPropPair;
293 case SID_EXTRUSION_3D_COLOR:
299 const bool bAuto = aColor ==
COL_AUTO;
301 css::beans::PropertyValue aPropValue;
302 aPropValue.Name =
"Color";
303 aPropValue.Value <<= !bAuto;
318 case SID_EXTRUSION_SURFACE:
324 ShadeMode eShadeMode( ShadeMode_FLAT );
326 double fSpecularity = 0;
327 double fDiffusion = 0;
332 eShadeMode = ShadeMode_DRAFT;
337 fSpecularity = 122.0;
341 fSpecularity = 122.0;
346 css::beans::PropertyValue aPropValue;
347 aPropValue.Name =
"ShadeMode";
348 aPropValue.Value <<= eShadeMode;
351 aPropValue.Name =
"Metal";
352 aPropValue.Value <<= bMetal;
355 aPropValue.Name =
"Specularity";
356 aPropValue.Value <<= fSpecularity;
359 aPropValue.Name =
"Diffusion";
360 aPropValue.Value <<= fDiffusion;
365 case SID_EXTRUSION_LIGHTING_INTENSITY:
372 bool bHarsh2 =
false;
398 css::beans::PropertyValue aPropValue;
399 aPropValue.Name =
"Brightness";
400 aPropValue.Value <<= fBrightness;
403 aPropValue.Name =
"LightFace";
404 aPropValue.Value <<=
true;
407 aPropValue.Name =
"FirstLightHarsh";
408 aPropValue.Value <<=
true;
411 aPropValue.Name =
"SecondLightHarsh";
412 aPropValue.Value <<= bHarsh2;
415 aPropValue.Name =
"FirstLightLevel";
416 aPropValue.Value <<= fLevel1;
419 aPropValue.Name =
"SecondLightLevel";
420 aPropValue.Value <<= fLevel2;
425 case SID_EXTRUSION_LIGHTING_DIRECTION:
431 if((nDirection >= 0) && (nDirection < 9))
433 const Direction3D * pLighting1Defaults;
434 const Direction3D * pLighting2Defaults;
438 css::beans::PropertyValue aPropValue;
439 aPropValue.Name =
"FirstLightDirection";
440 aPropValue.Value <<= pLighting1Defaults[nDirection];
443 aPropValue.Name =
"SecondLightDirection";
444 aPropValue.Value <<= pLighting2Defaults[nDirection];
456 sal_uInt16 nSID = rReq.
GetSlot();
457 const char* pStrResId =
nullptr;
463 case SID_EXTRUSION_TOGGLE:
466 pStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_ON_OFF;
469 case SID_EXTRUSION_TILT_DOWN:
472 pStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_DOWN;
475 case SID_EXTRUSION_TILT_UP:
478 pStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_UP;
481 case SID_EXTRUSION_TILT_LEFT:
484 pStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_LEFT;
487 case SID_EXTRUSION_TILT_RIGHT:
490 pStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_RIGHT;
493 case SID_EXTRUSION_DIRECTION:
496 pStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_ORIENTATION;
499 case SID_EXTRUSION_PROJECTION:
502 pStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_PROJECTION;
505 case SID_EXTRUSION_DEPTH:
508 pStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_DEPTH;
511 case SID_EXTRUSION_3D_COLOR:
514 pStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_COLOR;
517 case SID_EXTRUSION_SURFACE:
520 pStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_SURFACE;
523 case SID_EXTRUSION_LIGHTING_INTENSITY:
526 pStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_BRIGHTNESS;
529 case SID_EXTRUSION_LIGHTING_DIRECTION:
532 pStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_LIGHTING;
539 for(
size_t i=0;
i<nCount; ++
i)
542 if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=
nullptr )
567 case SID_EXTRUSION_DEPTH_DIALOG:
576 sal_uInt16 nRet = aDlg.
run();
579 fDepth = aDlg.getDepth();
583 rBindings.
Execute( SID_EXTRUSION_DEPTH, const_cast<const SfxPoolItem**>(aItems) );
589 if( nSID != SID_EXTRUSION_TOGGLE )
592 static const sal_uInt16
SidArray[] = {
593 SID_EXTRUSION_TILT_DOWN,
594 SID_EXTRUSION_TILT_UP,
595 SID_EXTRUSION_TILT_LEFT,
596 SID_EXTRUSION_TILT_RIGHT,
597 SID_EXTRUSION_DEPTH_FLOATER,
598 SID_EXTRUSION_DIRECTION_FLOATER,
599 SID_EXTRUSION_LIGHTING_FLOATER,
600 SID_EXTRUSION_SURFACE_FLOATER,
601 SID_EXTRUSION_3D_COLOR,
603 SID_EXTRUSION_DIRECTION,
604 SID_EXTRUSION_PROJECTION,
605 SID_EXTRUSION_LIGHTING_DIRECTION,
606 SID_EXTRUSION_LIGHTING_INTENSITY,
607 SID_EXTRUSION_SURFACE,
618 static constexpr OUStringLiteral sExtrusion =
u"Extrusion";
620 const css::uno::Any* pAny;
622 double fFinalSkewAngle = -1;
623 bool bHasCustomShape =
false;
625 for(
size_t i=0;
i<nCount; ++
i)
628 if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=
nullptr )
633 if( !bHasCustomShape )
635 const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
637 *pAny_ >>= bHasCustomShape;
639 if( !bHasCustomShape )
643 bool bParallel =
true;
644 Position3D aViewPoint( 3472, -3472, 25000 );
645 double fSkewAngle = -135;
647 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion,
"ProjectionMode" );
648 sal_Int16 nProjectionMode = sal_Int16();
649 if( pAny && ( *pAny >>= nProjectionMode ) )
650 bParallel =
static_cast<ProjectionMode
>(nProjectionMode) == ProjectionMode_PARALLEL;
655 EnhancedCustomShapeParameterPair aSkewPropPair;
656 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion,
"Skew" );
657 if( pAny && ( *pAny >>= aSkewPropPair ) )
659 aSkewPropPair.First.Value >>= fSkew;
660 aSkewPropPair.Second.Value >>= fSkewAngle;
664 else if ( fSkewAngle == 0.0 )
669 double fOriginX = 0.50;
670 double fOriginY = -0.50;
671 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion,
"ViewPoint" );
673 *pAny >>= aViewPoint;
675 EnhancedCustomShapeParameterPair aOriginPropPair;
676 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion,
"Origin" );
677 if( pAny && ( *pAny >>= aOriginPropPair ) )
679 aOriginPropPair.First.Value >>= fOriginX;
680 aOriginPropPair.Second.Value >>= fOriginY;
683 const double e = 0.0001;
684 if( aViewPoint.PositionX > e )
686 if( aViewPoint.PositionY > e )
688 if( (fOriginX > e ) && ( fOriginY > e ) )
691 else if( aViewPoint.PositionY < -e )
693 if( ( fOriginX > e ) && ( fOriginY < -e ) )
698 if( ( fOriginX > e ) && ( fOriginY > -e ) && ( fOriginY < e ) )
702 else if( aViewPoint.PositionX < -e )
704 if( aViewPoint.PositionY < -e )
706 if( ( fOriginX < -e ) && ( fOriginY < -e ) )
709 else if( aViewPoint.PositionY > e )
711 if( ( fOriginX < -e ) && ( fOriginY > e ) )
716 if( ( fOriginX < e ) && ( fOriginY > -e ) && ( fOriginY < e ) )
722 if( aViewPoint.PositionY < -e )
724 if( ( fOriginX > -e ) && ( fOriginX < e ) && ( fOriginY < -e ) )
727 else if( aViewPoint.PositionY > e )
729 if( ( fOriginX > -e ) && ( fOriginX < e ) && ( fOriginY > e ) )
734 if( ( fOriginX > -e ) && ( fOriginX < e ) && ( fOriginY > -e ) && ( fOriginY < e ) )
740 if( rtl::math::approxEqual(fFinalSkewAngle, -1.0) )
742 fFinalSkewAngle = fSkewAngle;
744 else if( !rtl::math::approxEqual(fSkewAngle, fFinalSkewAngle) )
746 fFinalSkewAngle = -1.0;
749 if( rtl::math::approxEqual(fFinalSkewAngle, -1.0) )
754 if( bHasCustomShape )
755 rSet.
Put(
SfxInt32Item( SID_EXTRUSION_DIRECTION, static_cast<sal_Int32>(fFinalSkewAngle) ) );
765 static constexpr OUStringLiteral sExtrusion =
u"Extrusion";
767 const css::uno::Any* pAny;
769 sal_Int32 nFinalProjection = -1;
770 bool bHasCustomShape =
false;
772 for(
size_t i=0;
i<nCount; ++
i)
775 if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=
nullptr )
778 if( !bHasCustomShape )
781 const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
783 *pAny_ >>= bHasCustomShape;
785 if( !bHasCustomShape )
791 bool bParallel =
true;
793 ProjectionMode eProjectionMode;
794 if( pAny && ( *pAny >>= eProjectionMode ) )
795 bParallel = eProjectionMode == ProjectionMode_PARALLEL;
797 if( nFinalProjection == -1 )
799 nFinalProjection = bParallel ? 1 : 0;
801 else if( nFinalProjection != (bParallel ? 1 : 0) )
803 nFinalProjection = -1;
809 if( bHasCustomShape )
810 rSet.
Put(
SfxInt32Item( SID_EXTRUSION_PROJECTION, nFinalProjection ) );
820 static constexpr OUStringLiteral sExtrusion =
u"Extrusion";
822 const css::uno::Any* pAny;
824 sal_Int32 nFinalSurface = -1;
825 bool bHasCustomShape =
false;
827 for(
size_t i=0;
i<nCount; ++
i)
830 if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=
nullptr )
835 if( !bHasCustomShape )
837 const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
839 *pAny_ >>= bHasCustomShape;
841 if( !bHasCustomShape )
845 sal_Int32 nSurface = 0;
847 ShadeMode eShadeMode( ShadeMode_FLAT );
848 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion,
"ShadeMode" );
850 *pAny >>= eShadeMode;
852 if( eShadeMode == ShadeMode_FLAT )
855 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion,
"Metal" );
865 double fSpecularity = 0;
866 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion,
"Specularity" );
868 *pAny >>= fSpecularity;
870 const double e = 0.0001;
871 if( (fSpecularity > -e) && (fSpecularity < e) )
882 if( nFinalSurface == -1 )
884 nFinalSurface = nSurface;
886 else if( nFinalSurface != nSurface )
894 if( bHasCustomShape )
905 static constexpr OUStringLiteral sExtrusion =
u"Extrusion";
907 const css::uno::Any* pAny;
909 double fFinalDepth = -1;
910 bool bHasCustomShape =
false;
912 for(
size_t i=0;
i<nCount; ++
i)
915 if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=
nullptr )
920 if( !bHasCustomShape )
922 const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
924 *pAny_ >>= bHasCustomShape;
926 if( !bHasCustomShape )
930 double fDepth = 1270.0;
931 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion,
"Depth" );
934 EnhancedCustomShapeParameterPair aDepthPropPair;
935 if ( *pAny >>= aDepthPropPair )
936 aDepthPropPair.First.Value >>= fDepth;
939 if( fFinalDepth == -1 )
941 fFinalDepth = fDepth;
943 else if( !rtl::math::approxEqual(fFinalDepth, fDepth) )
954 rSet.
Put(
SfxUInt16Item( SID_ATTR_METRIC, static_cast<sal_uInt16>(eUnit) ) );
957 if( bHasCustomShape )
965 if( ((d1.DirectionX < 0) && (d2.DirectionX < 0)) || ((d1.DirectionX == 0) && (d2.DirectionX == 0)) || ((d1.DirectionX > 0) && (d2.DirectionX > 0)) )
967 if( ((d1.DirectionY < 0) && (d2.DirectionY < 0)) || ((d1.DirectionY == 0) && (d2.DirectionY == 0)) || ((d1.DirectionY > 0) && (d2.DirectionY > 0)) )
969 if( ((d1.DirectionZ < 0) && (d2.DirectionZ < 0)) || ((d1.DirectionZ == 0) && (d2.DirectionZ == 0)) || ((d1.DirectionZ > 0) && (d2.DirectionZ > 0)) )
984 static constexpr OUStringLiteral sExtrusion =
u"Extrusion";
986 const Direction3D * pLighting1Defaults;
987 const Direction3D * pLighting2Defaults;
991 const css::uno::Any* pAny;
993 int nFinalDirection = -1;
994 bool bHasCustomShape =
false;
996 for(
size_t i=0;
i<nCount; ++
i)
999 if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=
nullptr )
1004 if( !bHasCustomShape )
1006 const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
1008 *pAny_ >>= bHasCustomShape;
1010 if( !bHasCustomShape )
1014 Direction3D aFirstLightDirection( 50000, 0, 10000 );
1015 Direction3D aSecondLightDirection( -50000, 0, 10000 );
1017 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion,
"FirstLightDirection" );
1019 *pAny >>= aFirstLightDirection;
1021 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion,
"SecondLightDirection" );
1023 *pAny >>= aSecondLightDirection;
1025 int nDirection = -1;
1028 for( j = 0; j < 9; j++ )
1038 if( nFinalDirection == -1 )
1040 nFinalDirection = nDirection;
1042 else if( nDirection != nFinalDirection )
1044 nFinalDirection = -1;
1047 if( nFinalDirection == -1 )
1052 if( bHasCustomShape )
1053 rSet.
Put(
SfxInt32Item( SID_EXTRUSION_LIGHTING_DIRECTION, static_cast<sal_Int32>(nFinalDirection) ) );
1055 rSet.
DisableItem( SID_EXTRUSION_LIGHTING_DIRECTION );
1063 static constexpr OUStringLiteral sExtrusion =
u"Extrusion";
1065 const css::uno::Any* pAny;
1067 int nFinalLevel = -1;
1068 bool bHasCustomShape =
false;
1070 for(
size_t i=0;
i<nCount; ++
i)
1073 if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=
nullptr )
1078 if( !bHasCustomShape )
1080 const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
1082 *pAny_ >>= bHasCustomShape;
1084 if( !bHasCustomShape )
1088 double fBrightness = 22178.0 / 655.36;
1089 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion,
"Brightness" );
1091 *pAny >>= fBrightness;
1094 if( fBrightness >= 30.0 )
1098 else if( fBrightness >= 10.0 )
1107 if( nFinalLevel == -1 )
1109 nFinalLevel = nLevel;
1111 else if( nFinalLevel != nLevel )
1119 if( bHasCustomShape )
1120 rSet.
Put(
SfxInt32Item( SID_EXTRUSION_LIGHTING_INTENSITY, nFinalLevel ) );
1122 rSet.
DisableItem( SID_EXTRUSION_LIGHTING_INTENSITY );
1130 static constexpr OUStringLiteral sExtrusion =
u"Extrusion";
1132 const css::uno::Any* pAny;
1135 bool bAmbigius =
false;
1137 bool bHasCustomShape =
false;
1139 for(
size_t i=0;
i<nCount; ++
i)
1142 if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=
nullptr )
1147 if( !bHasCustomShape )
1149 const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
1151 *pAny_ >>= bHasCustomShape;
1153 if( !bHasCustomShape )
1159 bool bUseColor =
false;
1160 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion,
"Color" );
1162 *pAny >>= bUseColor;
1176 aFinalColor = aColor;
1179 else if( aFinalColor != aColor )
1190 if( bHasCustomShape )
1199 static constexpr OUStringLiteral sExtrusion =
u"Extrusion";
1203 bool bFound =
false;
1205 for(
size_t i=0;(
i<nCount) && !bFound ; ++
i)
1208 if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=
nullptr )
1213 const Any* pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
1230 if (rSet.
GetItemState(SID_EXTRUSION_DIRECTION) != SfxItemState::UNKNOWN)
1234 if (rSet.
GetItemState(SID_EXTRUSION_PROJECTION) != SfxItemState::UNKNOWN)
1238 const bool bOnlyExtrudedCustomShapes =
1240 if (rSet.
GetItemState(SID_EXTRUSION_TILT_DOWN) != SfxItemState::UNKNOWN)
1242 if (! bOnlyExtrudedCustomShapes)
1245 if (rSet.
GetItemState(SID_EXTRUSION_TILT_DOWN) != SfxItemState::UNKNOWN)
1247 if (! bOnlyExtrudedCustomShapes)
1250 if (rSet.
GetItemState(SID_EXTRUSION_TILT_UP) != SfxItemState::UNKNOWN)
1252 if (! bOnlyExtrudedCustomShapes)
1255 if (rSet.
GetItemState(SID_EXTRUSION_TILT_LEFT) != SfxItemState::UNKNOWN)
1257 if (! bOnlyExtrudedCustomShapes)
1260 if (rSet.
GetItemState(SID_EXTRUSION_TILT_RIGHT) != SfxItemState::UNKNOWN)
1262 if (! bOnlyExtrudedCustomShapes)
1265 if (rSet.
GetItemState(SID_EXTRUSION_3D_COLOR) != SfxItemState::UNKNOWN)
1267 if (! bOnlyExtrudedCustomShapes)
1270 if (rSet.
GetItemState(SID_EXTRUSION_DEPTH_FLOATER) != SfxItemState::UNKNOWN)
1272 if (! bOnlyExtrudedCustomShapes)
1275 if (rSet.
GetItemState(SID_EXTRUSION_DIRECTION_FLOATER) != SfxItemState::UNKNOWN)
1277 if (! bOnlyExtrudedCustomShapes)
1278 rSet.
DisableItem( SID_EXTRUSION_DIRECTION_FLOATER );
1280 if (rSet.
GetItemState(SID_EXTRUSION_LIGHTING_FLOATER) != SfxItemState::UNKNOWN)
1282 if (! bOnlyExtrudedCustomShapes)
1283 rSet.
DisableItem( SID_EXTRUSION_LIGHTING_FLOATER );
1285 if (rSet.
GetItemState(SID_EXTRUSION_SURFACE_FLOATER) != SfxItemState::UNKNOWN)
1287 if(! bOnlyExtrudedCustomShapes)
1288 rSet.
DisableItem( SID_EXTRUSION_SURFACE_FLOATER );
1290 if (rSet.
GetItemState(SID_EXTRUSION_TOGGLE) != SfxItemState::UNKNOWN)
1295 if (rSet.
GetItemState(SID_EXTRUSION_DEPTH) != SfxItemState::UNKNOWN)
1299 if (rSet.
GetItemState(SID_EXTRUSION_SURFACE) != SfxItemState::UNKNOWN)
1303 if (rSet.
GetItemState(SID_EXTRUSION_LIGHTING_INTENSITY) != SfxItemState::UNKNOWN)
1308 if (rSet.
GetItemState(SID_EXTRUSION_LIGHTING_DIRECTION) != SfxItemState::UNKNOWN)
1313 if (rSet.
GetItemState(SID_EXTRUSION_3D_COLOR) != SfxItemState::UNKNOWN)
static void getExtrusionSurfaceState(SdrView const *pSdrView, SfxItemSet &rSet)
void SetPropertyValue(const css::beans::PropertyValue &rPropVal)
size_t GetMarkCount() const
#define SFX_IMPL_INTERFACE(Class, SuperClass)
virtual ~ExtrusionBar() override
bool IsUndoEnabled() const
static void getExtrusionProjectionState(SdrView const *pSdrView, SfxItemSet &rSet)
SdrMark * GetMark(size_t nNum) const
static SfxSlot aExtrusionBarSlots_Impl[]
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
const sal_uInt16 SidArray[]
virtual void MarkListHasChanged() override
static void execute(SdrView *pSdrView, SfxRequest const &rReq, SfxBindings &rBindings)
constexpr::Color COL_AUTO(0xFF, 0xFF, 0xFF, 0xFF)
void ClearMergedItem(const sal_uInt16 nWhich=0)
OUString SvxResId(const char *pId)
static void getLightingDirectionDefaults(const Direction3D **pLighting1Defaults, const Direction3D **pLighting2Defaults)
static void getState(SdrView const *pSdrView, SfxItemSet &rSet)
static bool compare_direction(const Direction3D &d1, const Direction3D &d2)
static void getExtrusionColorState(SdrView const *pSdrView, SfxItemSet &rSet)
static void impl_execute(SfxRequest const &rReq, SdrCustomShapeGeometryItem &rGeometryItem, SdrObject *pObj)
bool checkForSelectedCustomShapes(SdrView const *pSdrView, bool bOnlyExtruded)
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
const Color & GetColorValue() const
FieldUnit GetUIUnit() const
SfxItemPool & GetPool() const
SdrObject * GetMarkedSdrObj() const
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define DBG_ASSERT(sCon, aError)
void SetRepeatTarget(SfxRepeatTarget *pTarget)
constexpr TypedWhichId< SdrCustomShapeGeometryItem > SDRATTR_CUSTOMSHAPE_GEOMETRY(SDRATTR_CUSTOMSHAPE_FIRST+2)
static void getExtrusionDepthState(SdrView const *pSdrView, SfxItemSet &rSet)
static void getExtrusionDirectionState(SdrView const *pSdrView, SfxItemSet &rSet)
constexpr TypedWhichId< XSecondaryFillColorItem > XATTR_SECONDARYFILLCOLOR(XATTR_FILL_FIRST+12)
void BroadcastObjectChange() const
const SdrMarkList & GetMarkedObjectList() const
void SetPool(SfxItemPool *pNewPool)
void SetMergedItem(const SfxPoolItem &rItem)
void SetName(const OUString &rName)
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
#define SFX_OBJECTBAR_OBJECT
static void getExtrusionLightingIntensityState(SdrView const *pSdrView, SfxItemSet &rSet)
weld::Window * GetFrameWeld() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
void DisableItem(sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static void getExtrusionLightingDirectionState(SdrView const *pSdrView, SfxItemSet &rSet)
css::uno::Any * GetPropertyValueByName(const OUString &rPropName)
virtual std::unique_ptr< SdrUndoAction > CreateUndoAttrObject(SdrObject &rObject, bool bStyleSheet1=false, bool bSaveText=false)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
SdrModel * GetModel() const