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