LibreOffice Module svx (master)  1
EnhancedCustomShape3d.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 <svx/deflt3d.hxx>
22 #include <svx/svdmodel.hxx>
23 #include <tools/poly.hxx>
24 #include <svx/svditer.hxx>
25 #include <svx/svdobj.hxx>
26 #include <svx/svdoashp.hxx>
27 #include <svl/poolitem.hxx>
28 #include <svl/itemset.hxx>
29 #include <svx/xfillit0.hxx>
30 #include <svx/xlineit0.hxx>
31 #include <svx/xsflclit.hxx>
32 #include <svx/xbtmpit.hxx>
33 #include <svx/xflclit.hxx>
34 #include <svx/svdopath.hxx>
35 #include <svx/svddef.hxx>
36 #include <svx/svx3ditems.hxx>
37 #include <extrud3d.hxx>
38 #include <svx/xflbmtit.hxx>
39 #include <svx/xlnclit.hxx>
40 #include <svx/sdasitm.hxx>
41 #include <svx/scene3d.hxx>
42 #include <com/sun/star/drawing/Position3D.hpp>
43 #include <com/sun/star/drawing/Direction3D.hpp>
44 #include <com/sun/star/drawing/ShadeMode.hpp>
46 #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
52 #include <svx/xlnwtit.hxx>
53 #include <svx/xlntrit.hxx>
54 #include <svx/xfltrit.hxx>
55 
56 using namespace com::sun::star;
57 using namespace com::sun::star::uno;
58 
59 namespace {
60 
61 void GetOrigin( const SdrCustomShapeGeometryItem& rItem, double& rOriginX, double& rOriginY )
62 {
63  css::drawing::EnhancedCustomShapeParameterPair aOriginParaPair;
64  const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "Origin" );
65  if ( ! ( pAny && ( *pAny >>= aOriginParaPair ) && ( aOriginParaPair.First.Value >>= rOriginX ) && ( aOriginParaPair.Second.Value >>= rOriginY ) ) )
66  {
67  rOriginX = 0.50;
68  rOriginY =-0.50;
69  }
70 }
71 
72 void GetRotateAngle( const SdrCustomShapeGeometryItem& rItem, double& rAngleX, double& rAngleY )
73 {
74  css::drawing::EnhancedCustomShapeParameterPair aRotateAngleParaPair;
75  const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "RotateAngle" );
76  if ( ! ( pAny && ( *pAny >>= aRotateAngleParaPair ) && ( aRotateAngleParaPair.First.Value >>= rAngleX ) && ( aRotateAngleParaPair.Second.Value >>= rAngleY ) ) )
77  {
78  rAngleX = 0.0;
79  rAngleY = 0.0;
80  }
81  rAngleX = basegfx::deg2rad(rAngleX);
82  rAngleY = basegfx::deg2rad(rAngleY);
83 }
84 
85 void GetSkew( const SdrCustomShapeGeometryItem& rItem, double& rSkewAmount, double& rSkewAngle )
86 {
87  css::drawing::EnhancedCustomShapeParameterPair aSkewParaPair;
88  const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "Skew" );
89  if ( ! ( pAny && ( *pAny >>= aSkewParaPair ) && ( aSkewParaPair.First.Value >>= rSkewAmount ) && ( aSkewParaPair.Second.Value >>= rSkewAngle ) ) )
90  {
91  rSkewAmount = 50;
92  rSkewAngle = -135;
93  }
94  rSkewAngle = basegfx::deg2rad(rSkewAngle);
95 }
96 
97 void GetExtrusionDepth( const SdrCustomShapeGeometryItem& rItem, const double* pMap, double& rBackwardDepth, double& rForwardDepth )
98 {
99  css::drawing::EnhancedCustomShapeParameterPair aDepthParaPair;
100  double fDepth = 0, fFraction = 0;
101  const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "Depth" );
102  if ( pAny && ( *pAny >>= aDepthParaPair ) && ( aDepthParaPair.First.Value >>= fDepth ) && ( aDepthParaPair.Second.Value >>= fFraction ) )
103  {
104  rForwardDepth = fDepth * fFraction;
105  rBackwardDepth = fDepth - rForwardDepth;
106  }
107  else
108  {
109  rBackwardDepth = 1270;
110  rForwardDepth = 0;
111  }
112  if ( pMap )
113  {
114  double fMap = *pMap;
115  rBackwardDepth *= fMap;
116  rForwardDepth *= fMap;
117  }
118 }
119 
120 double GetDouble( const SdrCustomShapeGeometryItem& rItem, const OUString& rPropertyName, double fDefault )
121 {
122  double fRetValue = fDefault;
123  const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", rPropertyName );
124  if ( pAny )
125  *pAny >>= fRetValue;
126  return fRetValue;
127 }
128 
129 drawing::ShadeMode GetShadeMode( const SdrCustomShapeGeometryItem& rItem, const drawing::ShadeMode eDefault )
130 {
131  drawing::ShadeMode eRet( eDefault );
132  const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "ShadeMode" );
133  if ( pAny )
134  *pAny >>= eRet;
135  return eRet;
136 }
137 
138 bool GetBool( const SdrCustomShapeGeometryItem& rItem, const OUString& rPropertyName, const bool bDefault )
139 {
140  bool bRetValue = bDefault;
141  const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", rPropertyName );
142  if ( pAny )
143  *pAny >>= bRetValue;
144  return bRetValue;
145 }
146 
147 drawing::Position3D GetPosition3D( const SdrCustomShapeGeometryItem& rItem, const OUString& rPropertyName,
148  const drawing::Position3D& rDefault, const double* pMap )
149 {
150  drawing::Position3D aRetValue( rDefault );
151  const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", rPropertyName );
152  if ( pAny )
153  *pAny >>= aRetValue;
154  if ( pMap )
155  {
156  aRetValue.PositionX *= *pMap;
157  aRetValue.PositionY *= *pMap;
158  aRetValue.PositionZ *= *pMap;
159  }
160  return aRetValue;
161 }
162 
163 drawing::Direction3D GetDirection3D( const SdrCustomShapeGeometryItem& rItem, const OUString& rPropertyName, const drawing::Direction3D& rDefault )
164 {
165  drawing::Direction3D aRetValue( rDefault );
166  const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", rPropertyName );
167  if ( pAny )
168  *pAny >>= aRetValue;
169  return aRetValue;
170 }
171 
172 }
173 
175  const SdrObjCustomShape& rSdrObjCustomShape,
176  const double *pMap)
177 : aCenter(rSdrObjCustomShape.GetSnapRect().Center())
178  , eProjectionMode( drawing::ProjectionMode_PARALLEL )
179  , fSkewAngle(0.0)
180  , fSkew(0.0)
181  , fOriginX(0.0)
182  , fOriginY(0.0)
183 {
184  const SdrCustomShapeGeometryItem& rGeometryItem(rSdrObjCustomShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ));
185  const Any* pAny = rGeometryItem.GetPropertyValueByName( "Extrusion", "ProjectionMode" );
186  if ( pAny )
187  *pAny >>= eProjectionMode;
188 
189  if ( eProjectionMode == drawing::ProjectionMode_PARALLEL )
190  GetSkew( rGeometryItem, fSkew, fSkewAngle );
191  else
192  {
193  GetOrigin( rGeometryItem, fOriginX, fOriginY );
194  fOriginX = fOriginX * rSdrObjCustomShape.GetLogicRect().GetWidth();
195  fOriginY = fOriginY * rSdrObjCustomShape.GetLogicRect().GetHeight();
196 
197  drawing::Position3D aViewPointDefault( 3472, -3472, 25000 );
198  drawing::Position3D aViewPoint( GetPosition3D( rGeometryItem, "ViewPoint", aViewPointDefault, pMap ) );
199  fViewPoint.setX(aViewPoint.PositionX);
200  fViewPoint.setY(aViewPoint.PositionY);
201  fViewPoint.setZ(-aViewPoint.PositionZ);
202  }
203 }
204 
206 {
207  basegfx::B3DPolygon aRetval;
208 
209  sal_uInt32 j;
210  for ( j = 0; j < rPoly3D.count(); j++ )
211  {
212  const basegfx::B3DPoint aPoint(rPoly3D.getB3DPoint(j));
213  double fDepth(-( aPoint.getZ() * fSkew ) / 100.0);
214  aRetval.append(basegfx::B3DPoint(
215  aPoint.getX() + (fDepth * cos( fSkewAngle )),
216  aPoint.getY() - (fDepth * sin( fSkewAngle )),
217  aPoint.getZ()));
218  }
219 
220  return aRetval;
221 }
222 
224 {
225  Point aPoint2D;
226  if ( eProjectionMode == drawing::ProjectionMode_PARALLEL )
227  {
228  aPoint2D.setX( static_cast<sal_Int32>(rPoint3D.getX()) );
229  aPoint2D.setY( static_cast<sal_Int32>(rPoint3D.getY()) );
230  }
231  else
232  {
233  double fX = rPoint3D.getX() - fOriginX;
234  double fY = rPoint3D.getY() - fOriginY;
235  double f = ( - fViewPoint.getZ() ) / ( rPoint3D.getZ() - fViewPoint.getZ() );
236  aPoint2D.setX( static_cast<sal_Int32>(( fX - fViewPoint.getX() ) * f + fViewPoint.getX() + fOriginX ) );
237  aPoint2D.setY( static_cast<sal_Int32>(( fY - fViewPoint.getY() ) * f + fViewPoint.getY() + fOriginY ) );
238  }
239  aPoint2D.Move( aCenter.X(), aCenter.Y() );
240  return aPoint2D;
241 }
242 
244 {
245  return eProjectionMode == css::drawing::ProjectionMode_PARALLEL;
246 }
247 
249  const SdrObject* pShape2d,
250  const SdrObjCustomShape& rSdrObjCustomShape)
251 {
252  SdrObject* pRet(nullptr);
253  const SdrCustomShapeGeometryItem& rGeometryItem(rSdrObjCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY));
254  double fMap(1.0), *pMap = nullptr;
255  Fraction aFraction( rSdrObjCustomShape.getSdrModelFromSdrObject().GetScaleFraction() );
256 
257  if ( aFraction.GetNumerator() != 1 || aFraction.GetDenominator() != 1 )
258  {
259  fMap *= double(aFraction);
260  pMap = &fMap;
261  }
262 
263  if ( rSdrObjCustomShape.getSdrModelFromSdrObject().GetScaleUnit() != MapUnit::Map100thMM )
264  {
265  DBG_ASSERT( rSdrObjCustomShape.getSdrModelFromSdrObject().GetScaleUnit() == MapUnit::MapTwip, "EnhancedCustomShape3d::Current MapMode is Unsupported" );
266  fMap *= 1440.0 / 2540.0;
267  pMap = &fMap;
268  }
269 
270  if ( GetBool( rGeometryItem, "Extrusion", false ) )
271  {
272  bool bIsMirroredX(rSdrObjCustomShape.IsMirroredX());
273  bool bIsMirroredY(rSdrObjCustomShape.IsMirroredY());
274  tools::Rectangle aSnapRect(rSdrObjCustomShape.GetLogicRect());
275  long nObjectRotation(rSdrObjCustomShape.GetRotateAngle());
276  if ( nObjectRotation )
277  {
278  double a = (36000 - nObjectRotation) * F_PI18000;
279  long dx = aSnapRect.Right() - aSnapRect.Left();
280  long dy = aSnapRect.Bottom()- aSnapRect.Top();
281  Point aP( aSnapRect.TopLeft() );
282  RotatePoint( aP, rSdrObjCustomShape.GetSnapRect().Center(), sin( a ), cos( a ) );
283  aSnapRect.SetLeft( aP.X() );
284  aSnapRect.SetTop( aP.Y() );
285  aSnapRect.SetRight( aSnapRect.Left() + dx );
286  aSnapRect.SetBottom( aSnapRect.Top() + dy );
287  }
288  Point aCenter( aSnapRect.Center() );
289 
290  SfxItemSet aSet( rSdrObjCustomShape.GetMergedItemSet() );
291 
292  //SJ: vertical writing is not required, by removing this item no outliner is created
293  aSet.ClearItem( SDRATTR_TEXTDIRECTION );
294 
295  // #i105323# For 3D AutoShapes, the shadow attribute has to be applied to each
296  // created visualisation helper model shape individually. The shadow itself
297  // will then be rendered from the 3D renderer correctly for the whole 3D scene
298  // (and thus behind all objects of which the visualisation may be built). So,
299  // do NOT remove it from the ItemSet here.
300  // aSet.ClearItem(SDRATTR_SHADOW);
301 
302  std::vector< E3dCompoundObject* > aPlaceholderObjectList;
303 
304  double fExtrusionBackward, fExtrusionForward;
305  GetExtrusionDepth( rGeometryItem, pMap, fExtrusionBackward, fExtrusionForward );
306  double fDepth = fExtrusionBackward - fExtrusionForward;
307  if ( fDepth < 1.0 )
308  fDepth = 1.0;
309 
310  drawing::ProjectionMode eProjectionMode( drawing::ProjectionMode_PARALLEL );
311  const Any* pAny = rGeometryItem.GetPropertyValueByName( "Extrusion", "ProjectionMode" );
312  if ( pAny )
313  *pAny >>= eProjectionMode;
314  ProjectionType eProjectionType( eProjectionMode == drawing::ProjectionMode_PARALLEL ? ProjectionType::Parallel : ProjectionType::Perspective );
315  // pShape2d Convert in scenes which include 3D Objects
316  E3dDefaultAttributes a3DDefaultAttr;
317  a3DDefaultAttr.SetDefaultLatheCharacterMode( true );
318  a3DDefaultAttr.SetDefaultExtrudeCharacterMode( true );
319 
320  E3dScene* pScene = new E3dScene(rSdrObjCustomShape.getSdrModelFromSdrObject());
321 
322  bool bSceneHasObjects ( false );
323  bool bUseTwoFillStyles( false );
324 
325  drawing::ShadeMode eShadeMode( GetShadeMode( rGeometryItem, drawing::ShadeMode_FLAT ) );
326  bool bUseExtrusionColor = GetBool( rGeometryItem, "Color", false );
327 
328  drawing::FillStyle eFillStyle( aSet.Get(XATTR_FILLSTYLE).GetValue() );
329  pScene->GetProperties().SetObjectItem( Svx3DShadeModeItem( 0 ) );
330  aSet.Put( makeSvx3DPercentDiagonalItem( 0 ) );
331  aSet.Put( Svx3DTextureModeItem( 1 ) );
332  aSet.Put( Svx3DNormalsKindItem( 1 ) );
333 
334  if ( eShadeMode == drawing::ShadeMode_DRAFT )
335  {
336  aSet.Put( XLineStyleItem( drawing::LineStyle_SOLID ) );
337  aSet.Put( XFillStyleItem ( drawing::FillStyle_NONE ) );
338  aSet.Put( makeSvx3DDoubleSidedItem( true ) );
339  }
340  else
341  {
342  aSet.Put( XLineStyleItem( drawing::LineStyle_NONE ) );
343  if ( eFillStyle == drawing::FillStyle_NONE )
344  aSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) );
345  else if ( ( eFillStyle == drawing::FillStyle_BITMAP ) || ( eFillStyle == drawing::FillStyle_GRADIENT ) || bUseExtrusionColor )
346  bUseTwoFillStyles = true;
347 
348  // If shapes are mirrored once (mirroring two times correct geometry again)
349  // double-sided at the object and two-sided-lighting at the scene need to be set.
350 
351  // #i122777# Also use double sided for two fill styles since there several 3d objects get
352  // created with a depth of 0; one of them is the backside which needs double-sided to
353  // get visible
354  if(bUseTwoFillStyles || (bIsMirroredX && !bIsMirroredY) || (!bIsMirroredX && bIsMirroredY))
355  {
356  aSet.Put( makeSvx3DDoubleSidedItem( true ) );
358  }
359  }
360 
361  tools::Rectangle aBoundRect2d;
362  SdrObjListIter aIter( *pShape2d, SdrIterMode::DeepNoGroups );
363  const bool bMultipleSubObjects(aIter.Count() > 1);
364 
365  while( aIter.IsMore() )
366  {
367  const SdrObject* pNext = aIter.Next();
368  bool bIsPlaceholderObject = (pNext->GetMergedItem( XATTR_FILLSTYLE ).GetValue() == drawing::FillStyle_NONE )
369  && (pNext->GetMergedItem( XATTR_LINESTYLE ).GetValue() == drawing::LineStyle_NONE );
370  basegfx::B2DPolyPolygon aPolyPoly;
371  SfxItemSet aLocalSet(aSet);
372  drawing::FillStyle aLocalFillStyle(eFillStyle);
373 
374  if ( auto pPathObj = dynamic_cast<const SdrPathObj*>(pNext) )
375  {
376  const SfxItemSet& rSet = pNext->GetMergedItemSet();
377  bool bNeedToConvertToContour(false);
378 
379  // do conversion only for single line objects; for all others a fill and a
380  // line object get created. When we have fill, we want no line. That line has
381  // always been there, but since it was never converted to contour, it kept
382  // invisible (all this 'hidden' logic should be migrated to primitives).
383  if(!bMultipleSubObjects)
384  {
385  const drawing::FillStyle eStyle(rSet.Get(XATTR_FILLSTYLE).GetValue());
386 
387  if(drawing::FillStyle_NONE == eStyle)
388  {
391 
392  bNeedToConvertToContour = (0.0 < aLine.getWidth() || 0.0 != aLine.getFullDotDashLen());
393 
394  if(!bNeedToConvertToContour && !aLine.isDefault())
395  {
398 
399  if((aLineStartEnd.getStartWidth() && aLineStartEnd.isStartActive())
400  || (aLineStartEnd.getEndWidth() && aLineStartEnd.isEndActive()))
401  {
402  bNeedToConvertToContour = true;
403  }
404  }
405  }
406  }
407 
408  if(bNeedToConvertToContour)
409  {
410  SdrObject* pNewObj = pNext->ConvertToContourObj(const_cast< SdrObject* >(pNext));
411  SdrPathObj* pNewPathObj = dynamic_cast< SdrPathObj* >(pNewObj);
412 
413  if(pNewPathObj)
414  {
415  aPolyPoly = pNewPathObj->GetPathPoly();
416 
417  if(aPolyPoly.isClosed())
418  {
419  // correct item properties from line to fill style
420  if(eShadeMode == drawing::ShadeMode_DRAFT)
421  {
422  // for draft, create wireframe with fixed line width
423  aLocalSet.Put(XLineStyleItem(drawing::LineStyle_SOLID));
424  aLocalSet.Put(XLineWidthItem(40));
425  aLocalFillStyle = drawing::FillStyle_NONE;
426  }
427  else
428  {
429  // switch from line to fill, copy line attr to fill attr (color, transparence)
430  aLocalSet.Put(XLineWidthItem(0));
431  aLocalSet.Put(XLineStyleItem(drawing::LineStyle_NONE));
432  aLocalSet.Put(XFillColorItem(OUString(), aLocalSet.Get(XATTR_LINECOLOR).GetColorValue()));
433  aLocalSet.Put(XFillStyleItem(drawing::FillStyle_SOLID));
434  aLocalSet.Put(XFillTransparenceItem(aLocalSet.Get(XATTR_LINETRANSPARENCE).GetValue()));
435  aLocalFillStyle = drawing::FillStyle_SOLID;
436  }
437  }
438  else
439  {
440  // correct item properties to hairlines
441  aLocalSet.Put(XLineWidthItem(0));
442  aLocalSet.Put(XLineStyleItem(drawing::LineStyle_SOLID));
443  }
444  }
445 
446  SdrObject::Free(pNewObj);
447  }
448  else
449  {
450  aPolyPoly = pPathObj->GetPathPoly();
451  }
452  }
453  else
454  {
455  SdrObjectUniquePtr pNewObj = pNext->ConvertToPolyObj( false, false );
456  SdrPathObj* pPath = dynamic_cast<SdrPathObj*>( pNewObj.get() );
457  if ( pPath )
458  aPolyPoly = pPath->GetPathPoly();
459  }
460 
461  if( aPolyPoly.count() )
462  {
463  if(aPolyPoly.areControlPointsUsed())
464  {
465  aPolyPoly = basegfx::utils::adaptiveSubdivideByAngle(aPolyPoly);
466  }
467 
468  const basegfx::B2DRange aTempRange(basegfx::utils::getRange(aPolyPoly));
469  const tools::Rectangle aBoundRect(basegfx::fround(aTempRange.getMinX()), basegfx::fround(aTempRange.getMinY()), basegfx::fround(aTempRange.getMaxX()), basegfx::fround(aTempRange.getMaxY()));
470  aBoundRect2d.Union( aBoundRect );
471 
472  // #i122777# depth 0 is okay for planes when using double-sided
473  E3dCompoundObject* p3DObj = new E3dExtrudeObj(
474  rSdrObjCustomShape.getSdrModelFromSdrObject(),
475  a3DDefaultAttr,
476  aPolyPoly,
477  bUseTwoFillStyles ? 0 : fDepth );
478 
479  p3DObj->NbcSetLayer( pShape2d->GetLayer() );
480  p3DObj->SetMergedItemSet( aLocalSet );
481 
482  if ( bIsPlaceholderObject )
483  aPlaceholderObjectList.push_back( p3DObj );
484  else if ( bUseTwoFillStyles )
485  {
486  BitmapEx aFillBmp;
487  bool bFillBmpTile = p3DObj->GetMergedItem( XATTR_FILLBMP_TILE ).GetValue();
488  if ( bFillBmpTile )
489  {
490  const XFillBitmapItem& rBmpItm = p3DObj->GetMergedItem(XATTR_FILLBITMAP);
491  aFillBmp = rBmpItm.GetGraphicObject().GetGraphic().GetBitmapEx();
492 
493  // #i122777# old adaptation of FillStyle bitmap size to 5-times the original size; this is not needed
494  // anymore and was used in old times to male the fill look better when converting to 3D. Removed
495  // from regular 3D objects for some time, also needs to be removed from CustomShapes
496 
497  //Size aLogicalSize = aFillBmp.GetPrefSize();
498  //if ( aFillBmp.GetPrefMapMode() == MapUnit::MapPixel )
499  // aLogicalSize = Application::GetDefaultDevice()->PixelToLogic( aLogicalSize, MapUnit::Map100thMM );
500  //else
501  // aLogicalSize = OutputDevice::LogicToLogic( aLogicalSize, aFillBmp.GetPrefMapMode(), MapUnit::Map100thMM );
502  //aLogicalSize.Width() *= 5; ;// :-( nice scaling, look at engine3d/obj3d.cxx
503  //aLogicalSize.Height() *= 5;
504  //aFillBmp.SetPrefSize( aLogicalSize );
505  //aFillBmp.SetPrefMapMode( MapUnit::Map100thMM );
506  //p3DObj->SetMergedItem(XFillBitmapItem(String(), Graphic(aFillBmp)));
507  }
508  else
509  {
510  if ( aSnapRect != aBoundRect && aSnapRect.GetWidth() > 0 && aSnapRect.GetHeight() > 0)
511  {
512  const XFillBitmapItem& rBmpItm = p3DObj->GetMergedItem(XATTR_FILLBITMAP);
513  aFillBmp = rBmpItm.GetGraphicObject().GetGraphic().GetBitmapEx();
514  Size aBmpSize( aFillBmp.GetSizePixel() );
515  double fXScale = static_cast<double>(aBoundRect.GetWidth()) / static_cast<double>(aSnapRect.GetWidth());
516  double fYScale = static_cast<double>(aBoundRect.GetHeight()) / static_cast<double>(aSnapRect.GetHeight());
517 
518  Point aPt( static_cast<sal_Int32>( static_cast<double>( aBoundRect.Left() - aSnapRect.Left() )* static_cast<double>(aBmpSize.Width()) / static_cast<double>(aSnapRect.GetWidth()) ),
519  static_cast<sal_Int32>( static_cast<double>( aBoundRect.Top() - aSnapRect.Top() ) * static_cast<double>(aBmpSize.Height()) / static_cast<double>(aSnapRect.GetHeight()) ) );
520  Size aSize( static_cast<sal_Int32>( aBmpSize.Width() * fXScale ),
521  static_cast<sal_Int32>( aBmpSize.Height() * fYScale ) );
522  tools::Rectangle aCropRect( aPt, aSize );
523  aFillBmp.Crop( aCropRect );
524  p3DObj->SetMergedItem(XFillBitmapItem(OUString(), Graphic(aFillBmp)));
525  }
526  }
527  pScene->InsertObject( p3DObj );
528  p3DObj = new E3dExtrudeObj(
529  rSdrObjCustomShape.getSdrModelFromSdrObject(),
530  a3DDefaultAttr,
531  aPolyPoly,
532  fDepth);
533  p3DObj->NbcSetLayer( pShape2d->GetLayer() );
534  p3DObj->SetMergedItemSet( aLocalSet );
535  if ( bUseExtrusionColor )
536  p3DObj->SetMergedItem( XFillColorItem( "", rSdrObjCustomShape.GetMergedItem( XATTR_SECONDARYFILLCOLOR ).GetColorValue() ) );
537  p3DObj->SetMergedItem( XFillStyleItem( drawing::FillStyle_SOLID ) );
538  p3DObj->SetMergedItem( Svx3DCloseFrontItem( false ) );
539  p3DObj->SetMergedItem( Svx3DCloseBackItem( false ) );
540  pScene->InsertObject( p3DObj );
541 
542  // #i122777# depth 0 is okay for planes when using double-sided
543  p3DObj = new E3dExtrudeObj(
544  rSdrObjCustomShape.getSdrModelFromSdrObject(),
545  a3DDefaultAttr,
546  aPolyPoly,
547  0);
548 
549  p3DObj->NbcSetLayer( pShape2d->GetLayer() );
550  p3DObj->SetMergedItemSet( aLocalSet );
551 
552  basegfx::B3DHomMatrix aFrontTransform( p3DObj->GetTransform() );
553  aFrontTransform.translate( 0.0, 0.0, fDepth );
554  p3DObj->NbcSetTransform( aFrontTransform );
555 
556  if ( ( aLocalFillStyle == drawing::FillStyle_BITMAP ) && !aFillBmp.IsEmpty() )
557  {
558  p3DObj->SetMergedItem(XFillBitmapItem(OUString(), Graphic(aFillBmp)));
559  }
560  }
561  else if ( aLocalFillStyle == drawing::FillStyle_NONE )
562  {
563  const XLineColorItem& rLineColor = p3DObj->GetMergedItem( XATTR_LINECOLOR );
564  p3DObj->SetMergedItem( XFillColorItem( "", rLineColor.GetColorValue() ) );
565  p3DObj->SetMergedItem( makeSvx3DDoubleSidedItem( true ) );
566  p3DObj->SetMergedItem( Svx3DCloseFrontItem( false ) );
567  p3DObj->SetMergedItem( Svx3DCloseBackItem( false ) );
568  }
569  pScene->InsertObject( p3DObj );
570  bSceneHasObjects = true;
571  }
572  }
573 
574  if ( bSceneHasObjects ) // is the SdrObject properly converted
575  {
576  // then we can change the return value
577  pRet = pScene;
578 
579  // Camera settings, Perspective ...
580  Camera3D rCamera = pScene->GetCamera();
581  const basegfx::B3DRange& rVolume = pScene->GetBoundVolume();
582  pScene->NbcSetSnapRect( aSnapRect );
583 
584  // InitScene replacement
585  double fW = rVolume.getWidth();
586  double fH = rVolume.getHeight();
587 
588  rCamera.SetAutoAdjustProjection( false );
589  rCamera.SetViewWindow( -fW / 2, - fH / 2, fW, fH);
590  basegfx::B3DPoint aLookAt( 0.0, 0.0, 0.0 );
591  basegfx::B3DPoint aCamPos( 0.0, 0.0, 100.0 );
592  rCamera.SetPosAndLookAt( aCamPos, aLookAt );
593  rCamera.SetFocalLength( 1.0 );
594  rCamera.SetProjection( eProjectionType );
595  pScene->SetCamera( rCamera );
596  pScene->SetRectsDirty();
597 
598  double fOriginX, fOriginY;
599  GetOrigin( rGeometryItem, fOriginX, fOriginY );
600  fOriginX = fOriginX * aSnapRect.GetWidth();
601  fOriginY = fOriginY * aSnapRect.GetHeight();
602 
603  basegfx::B3DHomMatrix aNewTransform( pScene->GetTransform() );
604  aNewTransform.translate( -aCenter.X(), aCenter.Y(), -pScene->GetBoundVolume().getDepth() );
605 
606  double fXRotate, fYRotate;
607  GetRotateAngle( rGeometryItem, fXRotate, fYRotate );
608  double fZRotate(basegfx::deg2rad(rSdrObjCustomShape.GetObjectRotation()));
609  if ( fZRotate != 0.0 )
610  aNewTransform.rotate( 0.0, 0.0, fZRotate );
611  if ( bIsMirroredX )
612  aNewTransform.scale( -1.0, 1, 1 );
613  if ( bIsMirroredY )
614  aNewTransform.scale( 1, -1.0, 1 );
615  if( fYRotate != 0.0 )
616  aNewTransform.rotate( 0.0, -fYRotate, 0.0 );
617  if( fXRotate != 0.0 )
618  aNewTransform.rotate( -fXRotate, 0.0, 0.0 );
619  if ( eProjectionType == ProjectionType::Parallel )
620  {
621  double fSkew, fAlpha;
622  GetSkew( rGeometryItem, fSkew, fAlpha );
623  if ( fSkew != 0.0 )
624  {
625  double fInvTanBeta( fSkew / 100.0 );
626  if(fInvTanBeta)
627  {
628  aNewTransform.shearXY(
629  fInvTanBeta * cos(fAlpha),
630  fInvTanBeta * sin(fAlpha));
631  }
632  }
633  basegfx::B3DPoint _aLookAt( 0.0, 0.0, 0.0 );
634  basegfx::B3DPoint _aNewCamPos( 0.0, 0.0, 25000.0 );
635  rCamera.SetPosAndLookAt( _aNewCamPos, _aLookAt );
636  pScene->SetCamera( rCamera );
637  }
638  else
639  {
640  aNewTransform.translate( -fOriginX, fOriginY, 0.0 );
641  // now set correct camera position
642  drawing::Position3D aViewPointDefault( 3472, -3472, 25000 );
643  drawing::Position3D aViewPoint( GetPosition3D( rGeometryItem, "ViewPoint", aViewPointDefault, pMap ) );
644  double fViewPointX = aViewPoint.PositionX;
645  double fViewPointY = aViewPoint.PositionY;
646  double fViewPointZ = aViewPoint.PositionZ;
647  basegfx::B3DPoint _aLookAt( fViewPointX, -fViewPointY, 0.0 );
648  basegfx::B3DPoint aNewCamPos( fViewPointX, -fViewPointY, fViewPointZ );
649  rCamera.SetPosAndLookAt( aNewCamPos, _aLookAt );
650  pScene->SetCamera( rCamera );
651  }
652 
653  pScene->NbcSetTransform( aNewTransform );
654 
655 
656  // light
657 
658  double fAmbientIntensity = GetDouble( rGeometryItem, "Brightness", 22178.0 / 655.36 ) / 100.0;
659 
660  drawing::Direction3D aFirstLightDirectionDefault( 50000, 0, 10000 );
661  drawing::Direction3D aFirstLightDirection( GetDirection3D( rGeometryItem, "FirstLightDirection", aFirstLightDirectionDefault ) );
662  if ( aFirstLightDirection.DirectionZ == 0.0 )
663  aFirstLightDirection.DirectionZ = 1.0;
664 
665  double fLightIntensity = GetDouble( rGeometryItem, "FirstLightLevel", 43712.0 / 655.36 ) / 100.0;
666 
667  /* sal_Bool bFirstLightHarsh = */ GetBool( rGeometryItem, "FirstLightHarsh", false );
668 
669  drawing::Direction3D aSecondLightDirectionDefault( -50000, 0, 10000 );
670  drawing::Direction3D aSecondLightDirection( GetDirection3D( rGeometryItem, "SecondLightDirection", aSecondLightDirectionDefault ) );
671  if ( aSecondLightDirection.DirectionZ == 0.0 )
672  aSecondLightDirection.DirectionZ = -1;
673 
674  double fLight2Intensity = GetDouble( rGeometryItem, "SecondLightLevel", 43712.0 / 655.36 ) / 100.0;
675 
676  /* sal_Bool bLight2Harsh = */ GetBool( rGeometryItem, "SecondLightHarsh", false );
677  /* sal_Bool bLightFace = */ GetBool( rGeometryItem, "LightFace", false );
678 
679  sal_uInt16 nAmbientColor = static_cast<sal_uInt16>( fAmbientIntensity * 255.0 );
680  if ( nAmbientColor > 255 )
681  nAmbientColor = 255;
682  Color aGlobalAmbientColor( static_cast<sal_uInt8>(nAmbientColor), static_cast<sal_uInt8>(nAmbientColor), static_cast<sal_uInt8>(nAmbientColor) );
683  pScene->GetProperties().SetObjectItem( makeSvx3DAmbientcolorItem( aGlobalAmbientColor ) );
684 
685  sal_uInt8 nSpotLight1 = static_cast<sal_uInt8>( fLightIntensity * 255.0 );
686  basegfx::B3DVector aSpotLight1( aFirstLightDirection.DirectionX, - ( aFirstLightDirection.DirectionY ), -( aFirstLightDirection.DirectionZ ) );
687  aSpotLight1.normalize();
689  Color aAmbientSpot1Color( nSpotLight1, nSpotLight1, nSpotLight1 );
690  pScene->GetProperties().SetObjectItem( makeSvx3DLightcolor1Item( aAmbientSpot1Color ) );
691  pScene->GetProperties().SetObjectItem( makeSvx3DLightDirection1Item( aSpotLight1 ) );
692 
693  sal_uInt8 nSpotLight2 = static_cast<sal_uInt8>( fLight2Intensity * 255.0 );
694  basegfx::B3DVector aSpotLight2( aSecondLightDirection.DirectionX, -aSecondLightDirection.DirectionY, -aSecondLightDirection.DirectionZ );
695  aSpotLight2.normalize();
697  Color aAmbientSpot2Color( nSpotLight2, nSpotLight2, nSpotLight2 );
698  pScene->GetProperties().SetObjectItem( makeSvx3DLightcolor2Item( aAmbientSpot2Color ) );
699  pScene->GetProperties().SetObjectItem( makeSvx3DLightDirection2Item( aSpotLight2 ) );
700 
701  sal_uInt8 nSpotLight3 = 70;
702  basegfx::B3DVector aSpotLight3( 0.0, 0.0, 1.0 );
704  Color aAmbientSpot3Color( nSpotLight3, nSpotLight3, nSpotLight3 );
705  pScene->GetProperties().SetObjectItem( makeSvx3DLightcolor3Item( aAmbientSpot3Color ) );
706  pScene->GetProperties().SetObjectItem( makeSvx3DLightDirection3Item( aSpotLight3 ) );
707 
708  double fSpecular = GetDouble( rGeometryItem, "Specularity", 0 ) / 100;
709  bool bMetal = GetBool( rGeometryItem, "Metal", false );
710 
711  Color aSpecularCol( 225,225,225 );
712  if ( bMetal )
713  {
714  aSpecularCol = Color( 200, 200, 200 );
715  fSpecular += 0.15;
716  }
717  sal_Int32 nIntensity = static_cast<sal_Int32>(fSpecular) * 100;
718  if ( nIntensity > 100 )
719  nIntensity = 100;
720  else if ( nIntensity < 0 )
721  nIntensity = 0;
722  nIntensity = 100 - nIntensity;
723  pScene->GetProperties().SetObjectItem( makeSvx3DMaterialSpecularItem( aSpecularCol ) );
724  pScene->GetProperties().SetObjectItem( makeSvx3DMaterialSpecularIntensityItem( static_cast<sal_uInt16>(nIntensity) ) );
725 
726  pScene->SetLogicRect(
728  rSdrObjCustomShape,
729  aSnapRect,
730  aBoundRect2d,
731  pMap));
732 
733  // removing placeholder objects
734  for (E3dCompoundObject* pTemp : aPlaceholderObjectList)
735  {
736  pScene->RemoveObject( pTemp->GetOrdNum() );
737  // always use SdrObject::Free(...) for SdrObjects (!)
738  SdrObject* pTemp2(pTemp);
739  SdrObject::Free(pTemp2);
740  }
741  }
742  else
743  {
744  // always use SdrObject::Free(...) for SdrObjects (!)
745  SdrObject* pTemp(pScene);
746  SdrObject::Free(pTemp);
747  }
748  }
749  return pRet;
750 }
751 
753  const SdrObjCustomShape& rSdrObjCustomShape,
754  const tools::Rectangle& rSnapRect,
755  const tools::Rectangle& rBoundRect,
756  const double* pMap)
757 {
758  const SdrCustomShapeGeometryItem& rGeometryItem(rSdrObjCustomShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ));
759  const Point aCenter( rSnapRect.Center() );
760  double fExtrusionBackward, fExtrusionForward;
761  GetExtrusionDepth( rGeometryItem, pMap, fExtrusionBackward, fExtrusionForward );
762  sal_uInt32 i;
763 
764  // creating initial bound volume ( without rotation. skewing.and camera )
765  basegfx::B3DPolygon aBoundVolume;
766  const tools::Polygon aPolygon( rBoundRect );
767 
768  for ( i = 0; i < 4; i++ )
769  {
770  aBoundVolume.append(basegfx::B3DPoint(aPolygon[ static_cast<sal_uInt16>(i) ].X() - aCenter.X(), aPolygon[ static_cast<sal_uInt16>(i) ].Y() - aCenter.Y(), fExtrusionForward));
771  }
772 
773  for ( i = 0; i < 4; i++ )
774  {
775  aBoundVolume.append(basegfx::B3DPoint(aPolygon[ static_cast<sal_uInt16>(i) ].X() - aCenter.X(), aPolygon[ static_cast<sal_uInt16>(i) ].Y() - aCenter.Y(), fExtrusionBackward));
776  }
777 
778  drawing::Direction3D aRotationCenterDefault( 0, 0, 0 ); // default seems to be wrong, a fractional size of shape has to be used!!
779  drawing::Direction3D aRotationCenter( GetDirection3D( rGeometryItem, "RotationCenter", aRotationCenterDefault ) );
780 
781  double fXRotate, fYRotate;
782  GetRotateAngle( rGeometryItem, fXRotate, fYRotate );
783  double fZRotate(basegfx::deg2rad(rSdrObjCustomShape.GetObjectRotation()));
784 
785  // rotating bound volume
786  basegfx::B3DHomMatrix aMatrix;
787  aMatrix.translate(-aRotationCenter.DirectionX, -aRotationCenter.DirectionY, -aRotationCenter.DirectionZ);
788  if ( fZRotate != 0.0 )
789  aMatrix.rotate( 0.0, 0.0, fZRotate );
790  if (rSdrObjCustomShape.IsMirroredX())
791  aMatrix.scale( -1.0, 1, 1 );
792  if (rSdrObjCustomShape.IsMirroredY())
793  aMatrix.scale( 1, -1.0, 1 );
794  if( fYRotate != 0.0 )
795  aMatrix.rotate( 0.0, fYRotate, 0.0 );
796  if( fXRotate != 0.0 )
797  aMatrix.rotate( -fXRotate, 0.0, 0.0 );
798  aMatrix.translate(aRotationCenter.DirectionX, aRotationCenter.DirectionY, aRotationCenter.DirectionZ);
799  aBoundVolume.transform(aMatrix);
800 
801  Transformation2D aTransformation2D(
802  rSdrObjCustomShape,
803  pMap);
804 
805  if ( aTransformation2D.IsParallel() )
806  aBoundVolume = aTransformation2D.ApplySkewSettings( aBoundVolume );
807 
808  tools::Polygon aTransformed( 8 );
809  for ( i = 0; i < 8; i++ )
810  aTransformed[ static_cast<sal_uInt16>(i) ] = aTransformation2D.Transform2D( aBoundVolume.getB3DPoint( i ) );
811 
812  return aTransformed.GetBoundRect();
813 }
814 
815 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetAutoAdjustProjection(bool bAdjust)
Definition: camera3d.hxx:62
virtual SdrObject * RemoveObject(size_t nObjNum) override
Definition: scene3d.cxx:801
long GetWidth() const
SfxBoolItem makeSvx3DLightOnOff2Item(bool bVal)
Definition: svx3ditems.hxx:207
SfxBoolItem makeSvx3DDoubleSidedItem(bool bVal)
Definition: svx3ditems.hxx:58
long GetHeight() const
void SetViewWindow(double fX, double fY, double fW, double fH)
Definition: camera3d.cxx:41
ProjectionType
Definition: viewpt3d.hxx:38
const Fraction & GetScaleFraction() const
Definition: svdmodel.hxx:369
B3DVector & normalize()
sal_uInt32 count() const
static tools::Rectangle CalculateNewSnapRect(const SdrObjCustomShape &rSdrObjCustomShape, const tools::Rectangle &rSnapRect, const tools::Rectangle &rBoundRect, const double *pMap)
SvxColorItem makeSvx3DLightcolor2Item(const Color &rCol)
Definition: svx3ditems.hxx:171
const basegfx::B3DHomMatrix & GetTransform() const
Definition: obj3d.hxx:111
css::drawing::ProjectionMode eProjectionMode
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:395
virtual sdr::properties::BaseProperties & GetProperties() const
Definition: svdobj.cxx:203
virtual const tools::Rectangle & GetSnapRect() const override
Definition: svdoattr.cxx:48
Center
SfxUInt16Item makeSvx3DMaterialSpecularIntensityItem(sal_uInt16 nVal)
Definition: svx3ditems.hxx:116
void scale(double fX, double fY, double fZ)
double getMaxX() const
virtual long GetRotateAngle() const override
Definition: svdotxtr.cxx:84
SfxUInt16Item makeSvx3DPercentDiagonalItem(sal_uInt16 nVal)
Definition: svx3ditems.hxx:34
MapUnit GetScaleUnit() const
Definition: svdmodel.hxx:367
#define SDRATTR_CUSTOMSHAPE_GEOMETRY
Definition: svddef.hxx:400
bool IsMore() const
Definition: svditer.hxx:62
virtual void NbcSetTransform(const basegfx::B3DHomMatrix &rMatrix) override
Definition: scene3d.cxx:599
bool IsMirroredX() const
Definition: svdoashp.cxx:465
#define X
SfxBoolItem makeSvx3DLightOnOff1Item(bool bVal)
Definition: svx3ditems.hxx:203
void SetCamera(const Camera3D &rNewCamera)
Definition: scene3d.cxx:312
attribute::SdrLineAttribute createNewSdrLineAttribute(const SfxItemSet &rSet)
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:1908
void append(const B3DPoint &rPoint, sal_uInt32 nCount=1)
long Top() const
double getMaxY() const
B2IRange fround(const B2DRange &rRange)
Transformation2D(const SdrObjCustomShape &rSdrObjCustomShape, const double *pMap)
const Color & GetColorValue() const
Definition: xattr.cxx:309
SvxColorItem makeSvx3DMaterialSpecularItem(const Color &rCol)
Definition: svx3ditems.hxx:112
virtual void NbcSetTransform(const basegfx::B3DHomMatrix &rMatrix)
Definition: obj3d.cxx:332
const GraphicObject & GetGraphicObject() const
Definition: xbtmpit.hxx:56
bool IsEmpty() const
B3DPoint const & getB3DPoint(sal_uInt32 nIndex) const
Point Transform2D(const basegfx::B3DPoint &rPoint) const
virtual void SetObjectItem(const SfxPoolItem &rItem)=0
bool isClosed() const
#define DBG_ASSERT(sCon, aError)
int i
double getHeight() const
uno_Any a
void SetFocalLength(double fLen)
Definition: camera3d.cxx:172
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:272
#define SDRATTR_TEXTDIRECTION
Definition: svddef.hxx:307
#define XATTR_LINESTYLE
Definition: xdef.hxx:90
constexpr double deg2rad(double v)
virtual void SetLogicRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1630
const basegfx::B3DRange & GetBoundVolume() const
Definition: obj3d.cxx:289
void SetMergedItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1893
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
#define XATTR_FILLSTYLE
Definition: xdef.hxx:107
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:1918
basegfx::B3DPolygon ApplySkewSettings(const basegfx::B3DPolygon &rPolygon3D) const
Abstract DrawObject.
Definition: svdobj.hxx:312
size_t Count()
Definition: svditer.hxx:69
attribute::SdrLineStartEndAttribute createNewSdrLineStartEndAttribute(const SfxItemSet &rSet, double fWidth)
#define Y
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true) override
Definition: scene3d.cxx:812
B2DRange getRange(const B2DPolygon &rCandidate)
SvxColorItem makeSvx3DLightcolor1Item(const Color &rCol)
Definition: svx3ditems.hxx:167
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:576
void SetPosAndLookAt(const basegfx::B3DPoint &rNewPos, const basegfx::B3DPoint &rNewLookAt)
Definition: camera3d.cxx:69
void translate(double fX, double fY, double fZ)
#define XATTR_SECONDARYFILLCOLOR
Definition: xdef.hxx:119
double getWidth() const
SvxColorItem makeSvx3DAmbientcolorItem(const Color &rCol)
Definition: svx3ditems.hxx:199
SdrObject * Next()
Definition: svditer.hxx:63
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void RotatePoint(Point &rPnt, const Point &rRef, double sn, double cs)
Definition: svdtrans.hxx:114
SdrObjectUniquePtr ConvertToPolyObj(bool bBezier, bool bLineToArea) const
Definition: svdobj.cxx:2504
#define XATTR_FILLBMP_TILE
Definition: xdef.hxx:114
double getMinY() const
sal_uInt32 count() const
static SdrObject * Create3DObject(const SdrObject *pShape2d, const SdrObjCustomShape &rSdrObjCustomShape)
B2DPolygon adaptiveSubdivideByAngle(const B2DPolygon &rCandidate, double fAngleBound)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const Graphic & GetGraphic() const
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE) override
Definition: scene3d.cxx:771
tools::Rectangle & Union(const tools::Rectangle &rRect)
SvxB3DVectorItem makeSvx3DLightDirection2Item(const basegfx::B3DVector &rVec)
Definition: svx3ditems.hxx:239
unsigned char sal_uInt8
double GetObjectRotation() const
Definition: svdoashp.hxx:143
SdrObject * ConvertToContourObj(SdrObject *pRet, bool bForceLineDash=false) const
Definition: svdobj.cxx:2466
SvxB3DVectorItem makeSvx3DLightDirection1Item(const basegfx::B3DVector &rVec)
Definition: svx3ditems.hxx:235
void SetProjection(ProjectionType ePrj)
Definition: viewpt3d.hxx:80
const SfxItemSet & GetMergedItemSet() const
Definition: svdobj.cxx:1883
SvxB3DVectorItem makeSvx3DLightDirection3Item(const basegfx::B3DVector &rVec)
Definition: svx3ditems.hxx:243
#define F_PI18000
SfxBoolItem makeSvx3DLightOnOff3Item(bool bVal)
Definition: svx3ditems.hxx:211
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:114
long Left() const
const basegfx::B2DPolyPolygon & GetPathPoly() const
Definition: svdopath.hxx:139
css::uno::Any * GetPropertyValueByName(const OUString &rPropName)
SfxBoolItem makeSvx3DTwoSidedLightingItem(bool bVal)
Definition: svx3ditems.hxx:163
SvxColorItem makeSvx3DLightcolor3Item(const Color &rCol)
Definition: svx3ditems.hxx:175
#define XATTR_FILLBITMAP
Definition: xdef.hxx:111
void rotate(double fAngleX, double fAngleY, double fAngleZ)
double getMinX() const
void(* f)(TrueTypeTable *)
#define XATTR_LINECOLOR
Definition: xdef.hxx:93
tools::Rectangle GetBoundRect() const
double getDepth() const
bool areControlPointsUsed() const
const Size & GetSizePixel() const
void transform(const B3DHomMatrix &rMatrix)
bool IsMirroredY() const
Definition: svdoashp.cxx:475
bool Crop(const tools::Rectangle &rRectPixel)
const Camera3D & GetCamera() const
Definition: scene3d.hxx:127
#define XATTR_LINETRANSPARENCE
Definition: xdef.hxx:100
Point Center() const
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
Definition: scene3d.cxx:284
virtual const tools::Rectangle & GetLogicRect() const override
Definition: svdotxtr.cxx:69
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:593