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