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