LibreOffice Module svx (master)  1
view3d.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 
20 
21 #include <svx/svdopath.hxx>
22 #include <svx/svditer.hxx>
23 #include <svx/svdmodel.hxx>
24 #include <svx/svdpagv.hxx>
25 #include <editeng/colritem.hxx>
26 #include <editeng/eeitem.hxx>
27 #include <svx/svdview.hxx>
28 #include <svx/strings.hrc>
29 #include <svx/dialmgr.hxx>
30 #include <svx/obj3d.hxx>
31 #include <svx/lathe3d.hxx>
32 #include <extrud3d.hxx>
33 #include <dragmt3d.hxx>
34 #include <svx/scene3d.hxx>
35 #include <svx/view3d.hxx>
36 #include <svx/svdundo.hxx>
37 #include <svx/xflclit.hxx>
38 #include <svx/xlnclit.hxx>
39 #include <svx/xfillit0.hxx>
40 #include <svx/xlineit0.hxx>
43 #include <svx/xlnwtit.hxx>
46 #include <svx/sdrpaintwindow.hxx>
53 #include <svx/e3dsceneupdater.hxx>
54 
55 using namespace com::sun::star;
56 
57 
58 // Migrate Marking
59 
61 {
62  // The OverlayObjects
64 
65  // the view
66  const E3dView& mrView;
67 
68  // the object count
69  size_t mnCount;
70 
71  // the unmirrored polygons
73 
74  // the overlay geometry from selected objects
76 
77  // Copy assignment is forbidden and not implemented.
79  Impl3DMirrorConstructOverlay & operator= (const Impl3DMirrorConstructOverlay &) = delete;
80 
81 public:
82  explicit Impl3DMirrorConstructOverlay(const E3dView& rView);
84 
85  void SetMirrorAxis(Point aMirrorAxisA, Point aMirrorAxisB);
86 };
87 
89 : mrView(rView),
90  mnCount(rView.GetMarkedObjectCount()),
91  mpPolygons(nullptr)
92 {
93  if(!mnCount)
94  return;
95 
97  {
98  SdrPageView* pPV = rView.GetSdrPageView();
99 
100  if(pPV && pPV->PageWindowCount())
101  {
102  for(size_t a = 0; a < mnCount; ++a)
103  {
105 
106  if(pObject)
107  {
108  // use the view-independent primitive representation (without
109  // evtl. GridOffset, that may be applied to the DragEntry individually)
112  maFullOverlay.append(aNewSequence);
113  }
114  }
115  }
116  }
117  else
118  {
120 
121  for(size_t a = 0; a < mnCount; ++a)
122  {
124  mpPolygons[mnCount - (a + 1)] = pObject->TakeXorPoly();
125  }
126  }
127 }
128 
130 {
131  // The OverlayObjects are cleared using the destructor of OverlayObjectList.
132  // That destructor calls clear() at the list which removes all objects from the
133  // OverlayManager and deletes them.
134  delete[] mpPolygons;
135 }
136 
137 void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirrorAxisB)
138 {
139  // get rid of old overlay objects
140  maObjects.clear();
141 
142  // create new ones
143  for(sal_uInt32 a(0); a < mrView.PaintWindowCount(); a++)
144  {
145  SdrPaintWindow* pCandidate = mrView.GetPaintWindow(a);
146  const rtl::Reference< sdr::overlay::OverlayManager >& xTargetOverlay = pCandidate->GetOverlayManager();
147 
148  if(xTargetOverlay.is())
149  {
150  // build transformation: translate and rotate so that given edge is
151  // on x axis, them mirror in y and translate back
152  const basegfx::B2DVector aEdge(aMirrorAxisB.X() - aMirrorAxisA.X(), aMirrorAxisB.Y() - aMirrorAxisA.Y());
154  -aMirrorAxisA.X(), -aMirrorAxisA.Y()));
155  aMatrixTransform.rotate(-atan2(aEdge.getY(), aEdge.getX()));
156  aMatrixTransform.scale(1.0, -1.0);
157  aMatrixTransform.rotate(atan2(aEdge.getY(), aEdge.getX()));
158  aMatrixTransform.translate(aMirrorAxisA.X(), aMirrorAxisA.Y());
159 
160  if(mrView.IsSolidDragging())
161  {
162  if(!maFullOverlay.empty())
163  {
165 
166  if(!aMatrixTransform.isIdentity())
167  {
168  // embed in transformation group
169  drawinglayer::primitive2d::Primitive2DReference aTransformPrimitive2D(new drawinglayer::primitive2d::TransformPrimitive2D(aMatrixTransform, std::move(aContent)));
170  aContent = drawinglayer::primitive2d::Primitive2DContainer { aTransformPrimitive2D };
171  }
172 
173  // if we have full overlay from selected objects, embed with 50% transparence, the
174  // transformation is added to the OverlayPrimitive2DSequenceObject
175  drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(std::move(aContent), 0.5));
176  aContent = drawinglayer::primitive2d::Primitive2DContainer { aUnifiedTransparencePrimitive2D };
177 
178  std::unique_ptr<sdr::overlay::OverlayPrimitive2DSequenceObject> pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(aContent));
179 
180  xTargetOverlay->add(*pNew);
181  maObjects.append(std::move(pNew));
182  }
183  }
184  else
185  {
186  for(size_t b = 0; b < mnCount; ++b)
187  {
188  // apply to polygon
189  basegfx::B2DPolyPolygon aPolyPolygon(mpPolygons[b]);
190  aPolyPolygon.transform(aMatrixTransform);
191 
192  std::unique_ptr<sdr::overlay::OverlayPolyPolygonStripedAndFilled> pNew(new sdr::overlay::OverlayPolyPolygonStripedAndFilled(
193  aPolyPolygon));
194  xTargetOverlay->add(*pNew);
195  maObjects.append(std::move(pNew));
196  }
197  }
198  }
199  }
200 }
201 
203  SdrModel& rSdrModel,
204  OutputDevice* pOut)
205 : SdrView(rSdrModel, pOut)
206 {
207  InitView();
208 }
209 
210 // DrawMarkedObj override, since possibly only a single 3D object is to be
211 // drawn
212 
214 {
215  // Does 3D objects exist which scenes are not selected?
216  bool bSpecialHandling = false;
217  E3dScene *pScene = nullptr;
218 
219  const size_t nCnt = GetMarkedObjectCount();
220  for(size_t nObjs = 0; nObjs < nCnt; ++nObjs)
221  {
222  SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
223  if(auto pCompoundObject = dynamic_cast<E3dCompoundObject*>(pObj))
224  {
225  // related scene
226  pScene = pCompoundObject->getRootE3dSceneFromE3dObject();
227 
228  if(nullptr != pScene && !IsObjMarked(pScene))
229  {
230  bSpecialHandling = true;
231  }
232  }
233  // Reset all selection flags
234  if(auto p3dObject = dynamic_cast< const E3dObject*>(pObj))
235  {
236  pScene = p3dObject->getRootE3dSceneFromE3dObject();
237 
238  if(nullptr != pScene)
239  {
240  pScene->SetSelected(false);
241  }
242  }
243  }
244 
245  if(bSpecialHandling)
246  {
247  // Set selection flag to "not selected" for scenes related to all 3D
248  // objects
249  for(size_t nObjs = 0; nObjs < nCnt; ++nObjs)
250  {
251  SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
252  if(auto pCompoundObject = dynamic_cast<E3dCompoundObject*>(pObj))
253  {
254  // related scene
255  pScene = pCompoundObject->getRootE3dSceneFromE3dObject();
256 
257  if(nullptr != pScene)
258  {
259  pScene->SetSelected(false);
260  }
261  }
262  }
263 
264  for(size_t nObjs = 0; nObjs < nCnt; ++nObjs)
265  {
266  SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
267  if(auto p3DObj = dynamic_cast<E3dObject*>(pObj))
268  {
269  // Select object
270  p3DObj->SetSelected(true);
271  pScene = p3DObj->getRootE3dSceneFromE3dObject();
272  }
273  }
274 
275  if(nullptr != pScene)
276  {
277  // code from parent
279 
280  pScene->SetDrawOnlySelected(true);
281  pScene->SingleObjectPainter(rOut);
282  pScene->SetDrawOnlySelected(false);
283  }
284 
285  // Reset selection flag
286  for(size_t nObjs = 0; nObjs < nCnt; ++nObjs)
287  {
288  SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
289  if(auto pCompoundObject = dynamic_cast<E3dCompoundObject*>(pObj))
290  {
291  // related scene
292  pScene = pCompoundObject->getRootE3dSceneFromE3dObject();
293 
294  if(nullptr != pScene)
295  {
296  pScene->SetSelected(false);
297  }
298  }
299  }
300  }
301  else
302  {
303  // call parent
305  }
306 }
307 
308 // override get model, since in some 3D objects an additional scene
309 // must be pushed in
310 
311 std::unique_ptr<SdrModel> E3dView::CreateMarkedObjModel() const
312 {
313  // Does 3D objects exist which scenes are not selected?
314  bool bSpecialHandling(false);
315  const size_t nCount(GetMarkedObjectCount());
316  E3dScene *pScene = nullptr;
317 
318  for(size_t nObjs = 0; nObjs < nCount; ++nObjs)
319  {
320  const SdrObject* pObj = GetMarkedObjectByIndex(nObjs);
321 
322  if(!bSpecialHandling)
323  if(auto pCompoundObj = dynamic_cast< const E3dCompoundObject*>(pObj))
324  {
325  // if the object is selected, but it's scene not,
326  // we need special handling
327  pScene = pCompoundObj->getRootE3dSceneFromE3dObject();
328 
329  if(nullptr != pScene && !IsObjMarked(pScene))
330  {
331  bSpecialHandling = true;
332  }
333  }
334 
335  if(auto p3dObject = dynamic_cast< const E3dObject*>(pObj))
336  {
337  // reset all selection flags at 3D objects
338  pScene = p3dObject->getRootE3dSceneFromE3dObject();
339 
340  if(nullptr != pScene)
341  {
342  pScene->SetSelected(false);
343  }
344  }
345  }
346 
347  if(!bSpecialHandling)
348  {
349  // call parent
351  }
352 
353  std::unique_ptr<SdrModel> pNewModel;
354  tools::Rectangle aSelectedSnapRect;
355 
356  // set 3d selection flags at all directly selected objects
357  // and collect SnapRect of selected objects
358  for(size_t nObjs = 0; nObjs < nCount; ++nObjs)
359  {
360  SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
361 
362  if(auto p3DObj = dynamic_cast<E3dCompoundObject*>(pObj))
363  {
364  // mark object, but not scenes
365  p3DObj->SetSelected(true);
366  aSelectedSnapRect.Union(p3DObj->GetSnapRect());
367  }
368  }
369 
370  // create new mark list which contains all indirectly selected3d
371  // scenes as selected objects
373  SdrMarkList aNewML;
374  SdrMarkList& rCurrentMarkList = const_cast<E3dView*>(this)->GetMarkedObjectListWriteAccess();
375  rCurrentMarkList = aNewML;
376 
377  for(size_t nObjs = 0; nObjs < nCount; ++nObjs)
378  {
379  SdrObject *pObj = aOldML.GetMark(nObjs)->GetMarkedSdrObj();
380 
381  if(auto p3dObject = dynamic_cast< E3dObject* >(pObj))
382  {
383  pScene = p3dObject->getRootE3dSceneFromE3dObject();
384 
385  if(nullptr != pScene && !IsObjMarked(pScene) && GetSdrPageView())
386  {
387  const_cast<E3dView*>(this)->MarkObj(pScene, GetSdrPageView(), false, true);
388  }
389  }
390  }
391 
392  // call parent. This will copy all scenes and the selection flags at the 3D objects. So
393  // it will be possible to delete all non-selected 3d objects from the cloned 3d scenes
394  pNewModel = SdrView::CreateMarkedObjModel();
395 
396  if(pNewModel)
397  {
398  for(sal_uInt16 nPg(0); nPg < pNewModel->GetPageCount(); nPg++)
399  {
400  const SdrPage* pSrcPg=pNewModel->GetPage(nPg);
401  const size_t nObjCount(pSrcPg->GetObjCount());
402 
403  for(size_t nOb = 0; nOb < nObjCount; ++nOb)
404  {
405  const SdrObject* pSrcOb=pSrcPg->GetObj(nOb);
406 
407  if(auto p3dscene = dynamic_cast< const E3dScene* >( pSrcOb))
408  {
409  pScene = const_cast<E3dScene*>(p3dscene);
410 
411  // delete all not intentionally cloned 3d objects
412  pScene->removeAllNonSelectedObjects();
413 
414  // reset select flags and set SnapRect of all selected objects
415  pScene->SetSelected(false);
416  pScene->SetSnapRect(aSelectedSnapRect);
417  }
418  }
419  }
420  }
421 
422  // restore old selection
423  rCurrentMarkList = aOldML;
424 
425  return pNewModel;
426 }
427 
428 // When pasting objects have to integrated if a scene is inserted, but
429 // not the scene itself
430 
432  const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions)
433 {
434  bool bRetval = false;
435 
436  // Get list
437  Point aPos(rPos);
438  SdrObjList* pDstList = pLst;
439  ImpGetPasteObjList(aPos, pDstList);
440 
441  if(!pDstList)
442  return false;
443 
444  // Get owner of the list
445  E3dScene* pDstScene(dynamic_cast< E3dScene* >(pDstList->getSdrObjectFromSdrObjList()));
446 
447  if(nullptr != pDstScene)
448  {
449  BegUndo(SvxResId(RID_SVX_3D_UNDO_EXCHANGE_PASTE));
450 
451  // Copy all objects from E3dScenes and insert them directly
452  for(sal_uInt16 nPg(0); nPg < rMod.GetPageCount(); nPg++)
453  {
454  const SdrPage* pSrcPg=rMod.GetPage(nPg);
455  const size_t nObjCount(pSrcPg->GetObjCount());
456 
457  // calculate offset for paste
458  tools::Rectangle aR = pSrcPg->GetAllObjBoundRect();
459  Point aDist(aPos - aR.Center());
460 
461  // Insert sub-objects for scenes
462  for(size_t nOb = 0; nOb < nObjCount; ++nOb)
463  {
464  const SdrObject* pSrcOb = pSrcPg->GetObj(nOb);
465  if(auto p3dscene = dynamic_cast< const E3dScene* >(pSrcOb))
466  {
467  E3dScene* pSrcScene = const_cast<E3dScene*>(p3dscene);
468  ImpCloneAll3DObjectsToDestScene(pSrcScene, pDstScene, aDist);
469  }
470  }
471  }
472  EndUndo();
473  }
474  else
475  {
476  // call parent
477  bRetval = SdrView::Paste(rMod, rPos, pLst, nOptions);
478  }
479 
480  return bRetval;
481 }
482 
483 // Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...)
484 bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene const * pSrcScene, E3dScene* pDstScene, Point /*aOffset*/)
485 {
486  bool bRetval(false);
487 
488  if(pSrcScene && pDstScene)
489  {
490  for(size_t i = 0; i < pSrcScene->GetSubList()->GetObjCount(); ++i)
491  {
492  E3dCompoundObject* pCompoundObj = dynamic_cast< E3dCompoundObject* >(pSrcScene->GetSubList()->GetObj(i));
493 
494  if(pCompoundObj)
495  {
496  E3dCompoundObject* pNewCompoundObj(pCompoundObj->CloneSdrObject(pDstScene->getSdrModelFromSdrObject()));
497 
498  if(pNewCompoundObj)
499  {
500  // get dest scene's current range in 3D world coordinates
501  const basegfx::B3DHomMatrix aSceneToWorldTrans(pDstScene->GetFullTransform());
502  basegfx::B3DRange aSceneRange(pDstScene->GetBoundVolume());
503  aSceneRange.transform(aSceneToWorldTrans);
504 
505  // get new object's implied object transformation
506  const basegfx::B3DHomMatrix aNewObjectTrans(pNewCompoundObj->GetTransform());
507 
508  // get new object's range in 3D world coordinates in dest scene
509  // as if it were already added
510  const basegfx::B3DHomMatrix aObjectToWorldTrans(aSceneToWorldTrans * aNewObjectTrans);
511  basegfx::B3DRange aObjectRange(pNewCompoundObj->GetBoundVolume());
512  aObjectRange.transform(aObjectToWorldTrans);
513 
514  // get scale adaptation
515  const basegfx::B3DVector aSceneScale(aSceneRange.getRange());
516  const basegfx::B3DVector aObjectScale(aObjectRange.getRange());
517  double fScale(1.0);
518 
519  // if new object's size in X,Y or Z is bigger that 80% of dest scene, adapt scale
520  // to not change the scene by the inserted object
521  const double fSizeFactor(0.5);
522 
523  if(aObjectScale.getX() * fScale > aSceneScale.getX() * fSizeFactor)
524  {
525  const double fObjSize(aObjectScale.getX() * fScale);
526  const double fFactor((aSceneScale.getX() * fSizeFactor) / (basegfx::fTools::equalZero(fObjSize) ? 1.0 : fObjSize));
527  fScale *= fFactor;
528  }
529 
530  if(aObjectScale.getY() * fScale > aSceneScale.getY() * fSizeFactor)
531  {
532  const double fObjSize(aObjectScale.getY() * fScale);
533  const double fFactor((aSceneScale.getY() * fSizeFactor) / (basegfx::fTools::equalZero(fObjSize) ? 1.0 : fObjSize));
534  fScale *= fFactor;
535  }
536 
537  if(aObjectScale.getZ() * fScale > aSceneScale.getZ() * fSizeFactor)
538  {
539  const double fObjSize(aObjectScale.getZ() * fScale);
540  const double fFactor((aSceneScale.getZ() * fSizeFactor) / (basegfx::fTools::equalZero(fObjSize) ? 1.0 : fObjSize));
541  fScale *= fFactor;
542  }
543 
544  // get translation adaptation
545  const basegfx::B3DPoint aSceneCenter(aSceneRange.getCenter());
546  const basegfx::B3DPoint aObjectCenter(aObjectRange.getCenter());
547 
548  // build full modification transform. The object's transformation
549  // shall be modified, so start at object coordinates; transform to 3d world coor
550  basegfx::B3DHomMatrix aModifyingTransform(aObjectToWorldTrans);
551 
552  // translate to absolute center in 3d world coor
553  aModifyingTransform.translate(-aObjectCenter.getX(), -aObjectCenter.getY(), -aObjectCenter.getZ());
554 
555  // scale to dest size in 3d world coor
556  aModifyingTransform.scale(fScale, fScale, fScale);
557 
558  // translate to dest scene center in 3d world coor
559  aModifyingTransform.translate(aSceneCenter.getX(), aSceneCenter.getY(), aSceneCenter.getZ());
560 
561  // transform from 3d world to dest object coordinates
562  basegfx::B3DHomMatrix aWorldToObject(aObjectToWorldTrans);
563  aWorldToObject.invert();
564  aModifyingTransform = aWorldToObject * aModifyingTransform;
565 
566  // correct implied object transform by applying changing one in object coor
567  pNewCompoundObj->SetTransform(aModifyingTransform * aNewObjectTrans);
568 
569  // fill and insert new object
570  pNewCompoundObj->NbcSetLayer(pCompoundObj->GetLayer());
571  pNewCompoundObj->NbcSetStyleSheet(pCompoundObj->GetStyleSheet(), true);
572  pDstScene->InsertObject(pNewCompoundObj);
573  bRetval = true;
574 
575  // Create undo
576  if( GetModel()->IsUndoEnabled() )
577  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pNewCompoundObj));
578  }
579  }
580  }
581  }
582 
583  return bRetval;
584 }
585 
587 {
588  bool bAny3D(false);
589  bool bGroupSelected(false);
590  bool bRetval(true);
591 
592  for(size_t a=0; !bAny3D && a<GetMarkedObjectCount(); ++a)
593  {
595  if(pObj)
596  {
597  ImpIsConvertTo3DPossible(pObj, bAny3D, bGroupSelected);
598  }
599  }
600 
601  bRetval = !bAny3D
602  && (
605  || IsImportMtfPossible());
606  return bRetval;
607 }
608 
609 void E3dView::ImpIsConvertTo3DPossible(SdrObject const * pObj, bool& rAny3D,
610  bool& rGroupSelected) const
611 {
612  if(!pObj)
613  return;
614 
615  if(dynamic_cast< const E3dObject* >(pObj) != nullptr)
616  {
617  rAny3D = true;
618  }
619  else
620  {
621  if(pObj->IsGroupObject())
622  {
624  while(aIter.IsMore())
625  {
626  SdrObject* pNewObj = aIter.Next();
627  ImpIsConvertTo3DPossible(pNewObj, rAny3D, rGroupSelected);
628  }
629  rGroupSelected = true;
630  }
631  }
632 }
633 
635 {
636  if(dynamic_cast<const SdrTextObj*>( pObj) == nullptr)
637  return;
638 
639  const SfxItemSet& rSet = pObj->GetMergedItemSet();
640  const SvxColorItem& rTextColorItem = rSet.Get(EE_CHAR_COLOR);
641  if(rTextColorItem.GetValue() != COL_BLACK)
642  return;
643 
644  //For black text objects, the color set to gray
645  if(pObj->getSdrPageFromSdrObject())
646  {
647  // if black is only default attribute from
648  // pattern set it hard so that it is used in undo.
650 
651  // add undo now
652  if( GetModel()->IsUndoEnabled() )
653  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
654  }
655 
657 }
658 
660 {
661  auto pPathObj = dynamic_cast<const SdrPathObj*>( pObj);
662  if(!pPathObj)
663  return;
664 
665  const SfxItemSet& rSet = pObj->GetMergedItemSet();
666  sal_Int32 nLineWidth = rSet.Get(XATTR_LINEWIDTH).GetValue();
667  drawing::LineStyle eLineStyle = rSet.Get(XATTR_LINESTYLE).GetValue();
668  drawing::FillStyle eFillStyle = rSet.Get(XATTR_FILLSTYLE).GetValue();
669 
670  if(pPathObj->IsClosed()
671  && eLineStyle == drawing::LineStyle_SOLID
672  && !nLineWidth
673  && eFillStyle != drawing::FillStyle_NONE)
674  {
675  if(pObj->getSdrPageFromSdrObject() && GetModel()->IsUndoEnabled() )
676  {
677  AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
678  }
679 
680  pObj->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
681  pObj->SetMergedItem(XLineWidthItem(0));
682  }
683 }
684 
685 void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix const & rLatheMat)
686 {
687  // Single PathObject, transform this
688  SdrPathObj* pPath = dynamic_cast<SdrPathObj*>( pObj );
689 
690  if(!pPath)
691  return;
692 
693  E3dDefaultAttributes aDefault = Get3DDefaultAttributes();
694 
695  if(bExtrude)
696  {
697  aDefault.SetDefaultExtrudeCharacterMode(true);
698  }
699  else
700  {
701  aDefault.SetDefaultLatheCharacterMode(true);
702  }
703 
704  // Get Itemset of the original object
705  SfxItemSet aSet(pObj->GetMergedItemSet());
706 
707  drawing::FillStyle eFillStyle = aSet.Get(XATTR_FILLSTYLE).GetValue();
708 
709  // line style turned off
710  aSet.Put(XLineStyleItem(drawing::LineStyle_NONE));
711 
712  //Determining if FILL_Attribute is set.
713  if(!pPath->IsClosed() || eFillStyle == drawing::FillStyle_NONE)
714  {
715  // This SdrPathObj is not filled, leave the front and rear face out.
716  // Moreover, a two-sided representation necessary.
717  aDefault.SetDefaultExtrudeCloseFront(false);
718  aDefault.SetDefaultExtrudeCloseBack(false);
719 
720  aSet.Put(makeSvx3DDoubleSidedItem(true));
721 
722  // Set fill attribute
723  aSet.Put(XFillStyleItem(drawing::FillStyle_SOLID));
724 
725  // Fill color must be the color line, because the object was
726  // previously just a line
727  Color aColorLine = aSet.Get(XATTR_LINECOLOR).GetColorValue();
728  aSet.Put(XFillColorItem(OUString(), aColorLine));
729  }
730 
731  // Create a new extrude object
732  E3dObject* p3DObj = nullptr;
733  if(bExtrude)
734  {
735  p3DObj = new E3dExtrudeObj(pObj->getSdrModelFromSdrObject(), aDefault, pPath->GetPathPoly(), fDepth);
736  }
737  else
738  {
739  // rLatheMat expects coordinates with y-axis up, pPath uses y-axis down
740  basegfx::B2DHomMatrix aFlipVerticalMat(1.0, 0.0, 0.0, 0.0, -1.0, 0.0);
741  basegfx::B2DPolyPolygon aPolyPoly2D(pPath->GetPathPoly());
742  aPolyPoly2D.transform(aFlipVerticalMat);
743  aPolyPoly2D.transform(rLatheMat);
744  // ctor E3dLatheObj expects coordinates with y-axis down
745  aPolyPoly2D.transform(aFlipVerticalMat);
746  p3DObj = new E3dLatheObj(pObj->getSdrModelFromSdrObject(), aDefault, aPolyPoly2D);
747  }
748 
749  // Set attribute
750  p3DObj->NbcSetLayer(pObj->GetLayer());
751 
752  p3DObj->SetMergedItemSet(aSet);
753 
754  p3DObj->NbcSetStyleSheet(pObj->GetStyleSheet(), true);
755 
756  // Insert a new extrude object
757  pScene->InsertObject(p3DObj);
758 }
759 
760 void E3dView::ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix const & rLatheMat)
761 {
762  if(!pObj)
763  return;
764 
765  // change text color attribute for not so dark colors
766  if(pObj->IsGroupObject())
767  {
769  while(aIter.IsMore())
770  {
771  SdrObject* pGroupMember = aIter.Next();
773  }
774  }
775  else
777 
778  // convert completely to path objects
779  SdrObject* pNewObj1 = pObj->ConvertToPolyObj(false, false).release();
780 
781  if(!pNewObj1)
782  return;
783 
784  // change text color attribute for not so dark colors
785  if(pNewObj1->IsGroupObject())
786  {
788  while(aIter.IsMore())
789  {
790  SdrObject* pGroupMember = aIter.Next();
792  }
793  }
794  else
796 
797  // convert completely to path objects
798  SdrObject* pNewObj2 = pObj->ConvertToContourObj(pNewObj1, true);
799 
800  if(pNewObj2)
801  {
802  // add all to flat scene
803  if(pNewObj2->IsGroupObject())
804  {
806  while(aIter.IsMore())
807  {
808  SdrObject* pGroupMember = aIter.Next();
809  ImpCreateSingle3DObjectFlat(pScene, pGroupMember, bExtrude, fDepth, rLatheMat);
810  }
811  }
812  else
813  ImpCreateSingle3DObjectFlat(pScene, pNewObj2, bExtrude, fDepth, rLatheMat);
814 
815  // delete object in between
816  if (pNewObj2 != pObj && pNewObj2 != pNewObj1)
817  SdrObject::Free( pNewObj2 );
818  }
819 
820  // delete object in between
821  if (pNewObj1 != pObj)
822  SdrObject::Free( pNewObj1 );
823 }
824 
825 void E3dView::ConvertMarkedObjTo3D(bool bExtrude, const basegfx::B2DPoint& rPnt1, const basegfx::B2DPoint& rPnt2)
826 {
827  if(!AreObjectsMarked())
828  return;
829 
830  // Create undo
831  if(bExtrude)
832  BegUndo(SvxResId(RID_SVX_3D_UNDO_EXTRUDE));
833  else
834  BegUndo(SvxResId(RID_SVX_3D_UNDO_LATHE));
835 
836  SdrModel& rSdrModel(GetSdrMarkByIndex(0)->GetMarkedSdrObj()->getSdrModelFromSdrObject());
837 
838  // Create a new scene for the created 3D object
839  E3dScene* pScene = new E3dScene(rSdrModel);
840 
841  // Determine rectangle and possibly correct it
843  if(aRect.GetWidth() <= 1)
844  aRect.SetSize(Size(500, aRect.GetHeight()));
845  if(aRect.GetHeight() <= 1)
846  aRect.SetSize(Size(aRect.GetWidth(), 500));
847 
848  // Determine the depth relative to the size of the selection
849  double fDepth = 0.0;
850  double fRot3D = 0.0;
851  basegfx::B2DHomMatrix aLatheMat;
852 
853  if(bExtrude)
854  {
855  double fW = static_cast<double>(aRect.GetWidth());
856  double fH = static_cast<double>(aRect.GetHeight());
857  fDepth = sqrt(fW*fW + fH*fH) / 6.0;
858  }
859  if(!bExtrude)
860  {
861  // Create transformation for the polygons rotating body
862  if (rPnt1 != rPnt2)
863  {
864  // Rotation around control point #1 with set angle
865  // for 3D coordinates
866  basegfx::B2DPoint aDiff(rPnt1 - rPnt2);
867  fRot3D = atan2(aDiff.getY(), aDiff.getX()) - F_PI2;
868 
869  if(basegfx::fTools::equalZero(fabs(fRot3D)))
870  fRot3D = 0.0;
871 
872  if(fRot3D != 0.0)
873  {
874  aLatheMat = basegfx::utils::createRotateAroundPoint(rPnt2, -fRot3D)
875  * aLatheMat;
876  }
877  }
878 
879  if (rPnt2.getX() != 0.0)
880  {
881  // Translation to Y=0 - axis
882  aLatheMat.translate(-rPnt2.getX(), 0.0);
883  }
884  else
885  {
886  aLatheMat.translate(static_cast<double>(-aRect.Left()), 0.0);
887  }
888 
889  // Form the inverse matrix to determine the target expansion
890  basegfx::B2DHomMatrix aInvLatheMat(aLatheMat);
891  aInvLatheMat.invert();
892 
893  // SnapRect extension enables mirroring in the axis of rotation
894  for(size_t a=0; a<GetMarkedObjectCount(); ++a)
895  {
896  SdrMark* pMark = GetSdrMarkByIndex(a);
897  SdrObject* pObj = pMark->GetMarkedSdrObj();
898  tools::Rectangle aTurnRect = pObj->GetSnapRect();
899  basegfx::B2DPoint aRot;
900  Point aRotPnt;
901 
902  aRot = basegfx::B2DPoint(aTurnRect.Left(), -aTurnRect.Top());
903  aRot *= aLatheMat;
904  aRot.setX(-aRot.getX());
905  aRot *= aInvLatheMat;
906  aRotPnt = Point(static_cast<tools::Long>(aRot.getX() + 0.5), static_cast<tools::Long>(-aRot.getY() - 0.5));
907  aRect.Union(tools::Rectangle(aRotPnt, aRotPnt));
908 
909  aRot = basegfx::B2DPoint(aTurnRect.Left(), -aTurnRect.Bottom());
910  aRot *= aLatheMat;
911  aRot.setX(-aRot.getX());
912  aRot *= aInvLatheMat;
913  aRotPnt = Point(static_cast<tools::Long>(aRot.getX() + 0.5), static_cast<tools::Long>(-aRot.getY() - 0.5));
914  aRect.Union(tools::Rectangle(aRotPnt, aRotPnt));
915 
916  aRot = basegfx::B2DPoint(aTurnRect.Right(), -aTurnRect.Top());
917  aRot *= aLatheMat;
918  aRot.setX(-aRot.getX());
919  aRot *= aInvLatheMat;
920  aRotPnt = Point(static_cast<tools::Long>(aRot.getX() + 0.5), static_cast<tools::Long>(-aRot.getY() - 0.5));
921  aRect.Union(tools::Rectangle(aRotPnt, aRotPnt));
922 
923  aRot = basegfx::B2DPoint(aTurnRect.Right(), -aTurnRect.Bottom());
924  aRot *= aLatheMat;
925  aRot.setX(-aRot.getX());
926  aRot *= aInvLatheMat;
927  aRotPnt = Point(static_cast<tools::Long>(aRot.getX() + 0.5), static_cast<tools::Long>(-aRot.getY() - 0.5));
928  aRect.Union(tools::Rectangle(aRotPnt, aRotPnt));
929  }
930  }
931 
932  // Walk through the selection and convert it into 3D, complete with
933  // Conversion to SdrPathObject, also fonts
934  for(size_t a=0; a<GetMarkedObjectCount(); ++a)
935  {
936  SdrMark* pMark = GetSdrMarkByIndex(a);
937  SdrObject* pObj = pMark->GetMarkedSdrObj();
938 
939  ImpCreate3DObject(pScene, pObj, bExtrude, fDepth, aLatheMat);
940  }
941 
942  if(pScene->GetSubList() && pScene->GetSubList()->GetObjCount() != 0)
943  {
944  // Arrange all created objects by depth
945  if(bExtrude)
946  DoDepthArrange(pScene, fDepth);
947 
948  // Center 3D objects in the middle of the overall rectangle
949  basegfx::B3DPoint aCenter(pScene->GetBoundVolume().getCenter());
950  basegfx::B3DHomMatrix aMatrix;
951 
952  aMatrix.translate(-aCenter.getX(), -aCenter.getY(), -aCenter.getZ());
953  pScene->SetTransform(aMatrix * pScene->GetTransform());
954 
955  // Initialize scene
956  pScene->NbcSetSnapRect(aRect);
957  basegfx::B3DRange aBoundVol = pScene->GetBoundVolume();
958  InitScene(pScene, static_cast<double>(aRect.GetWidth()), static_cast<double>(aRect.GetHeight()), aBoundVol.getDepth());
959 
960  // Insert scene instead of the first selected object and throw away
961  // all the old objects
962  SdrObject* pRepObj = GetMarkedObjectByIndex(0);
964  MarkObj(pRepObj, pPV, true);
965  ReplaceObjectAtView(pRepObj, *pPV, pScene, false);
966  DeleteMarked();
967  MarkObj(pScene, pPV);
968 
969  // Rotate Rotation body around the axis of rotation
970  if(!bExtrude && fRot3D != 0.0)
971  {
972  basegfx::B3DHomMatrix aRotate;
973  aRotate.rotate(0.0, 0.0, fRot3D);
974  pScene->SetTransform(aRotate * pScene->GetTransform());
975  }
976 
977  // Set default rotation
978  {
979  basegfx::B3DHomMatrix aRotate;
980  aRotate.rotate(DEG2RAD(20.0), 0.0, 0.0);
981  // E3DModifySceneSnapRectUpdater updates the 2D representation of the scene.
982  // It prepares things in ctor and acts in dtor.
984  pScene->SetTransform(aRotate * pScene->GetTransform());
985  }
986  }
987  else
988  {
989  // No 3D object was created, throw away everything
990  // always use SdrObject::Free(...) for SdrObjects (!)
991  SdrObject* pTemp(pScene);
992  SdrObject::Free(pTemp);
993  }
994 
995  EndUndo();
996 }
997 
998 //Arrange all created extrude objects by depth
999 
1000 namespace {
1001 
1002 struct E3dDepthNeighbour
1003 {
1004  E3dExtrudeObj* mpObj;
1005  basegfx::B2DPolyPolygon maPreparedPolyPolygon;
1006 
1007  E3dDepthNeighbour(E3dExtrudeObj* pObj, basegfx::B2DPolyPolygon const & rPreparedPolyPolygon)
1008  : mpObj(pObj),
1009  maPreparedPolyPolygon(rPreparedPolyPolygon)
1010  {
1011  }
1012 };
1013 
1014 struct E3dDepthLayer
1015 {
1016  E3dDepthLayer* mpDown;
1017  std::vector<E3dDepthNeighbour> mvNeighbours;
1018 
1019  E3dDepthLayer()
1020  : mpDown(nullptr)
1021  {
1022  }
1023 };
1024 
1025 }
1026 
1027 void E3dView::DoDepthArrange(E3dScene const * pScene, double fDepth)
1028 {
1029  if(!(pScene && pScene->GetSubList() && pScene->GetSubList()->GetObjCount() > 1))
1030  return;
1031 
1032  SdrObjList* pSubList = pScene->GetSubList();
1033  SdrObjListIter aIter(pSubList, SdrIterMode::Flat);
1034  E3dDepthLayer* pBaseLayer = nullptr;
1035  E3dDepthLayer* pLayer = nullptr;
1036  sal_Int32 nNumLayers = 0;
1037 
1038  while(aIter.IsMore())
1039  {
1040  E3dExtrudeObj* pExtrudeObj = dynamic_cast< E3dExtrudeObj* >(aIter.Next());
1041 
1042  if(pExtrudeObj)
1043  {
1044  const basegfx::B2DPolyPolygon aExtrudePoly(
1045  basegfx::utils::prepareForPolygonOperation(pExtrudeObj->GetExtrudePolygon()));
1046  const SfxItemSet& rLocalSet = pExtrudeObj->GetMergedItemSet();
1047  const drawing::FillStyle eLocalFillStyle = rLocalSet.Get(XATTR_FILLSTYLE).GetValue();
1048  const Color aLocalColor = rLocalSet.Get(XATTR_FILLCOLOR).GetColorValue();
1049 
1050  // sort in ExtrudeObj
1051  if(pLayer)
1052  {
1053  // do we have overlap with an object of this layer?
1054  bool bOverlap(false);
1055 
1056  for(const auto& rAct : pLayer->mvNeighbours)
1057  {
1058  // do rAct.mpObj and pExtrudeObj overlap? Check by
1059  // using logical AND clipping
1060  const basegfx::B2DPolyPolygon aAndPolyPolygon(
1062  aExtrudePoly,
1063  rAct.maPreparedPolyPolygon));
1064 
1065  if(aAndPolyPolygon.count() != 0)
1066  {
1067  // second criteria: is another fillstyle or color used?
1068  const SfxItemSet& rCompareSet = rAct.mpObj->GetMergedItemSet();
1069 
1070  drawing::FillStyle eCompareFillStyle = rCompareSet.Get(XATTR_FILLSTYLE).GetValue();
1071 
1072  if(eLocalFillStyle == eCompareFillStyle)
1073  {
1074  if(eLocalFillStyle == drawing::FillStyle_SOLID)
1075  {
1076  Color aCompareColor = rCompareSet.Get(XATTR_FILLCOLOR).GetColorValue();
1077 
1078  if(aCompareColor == aLocalColor)
1079  {
1080  continue;
1081  }
1082  }
1083  else if(eLocalFillStyle == drawing::FillStyle_NONE)
1084  {
1085  continue;
1086  }
1087  }
1088 
1089  bOverlap = true;
1090  break;
1091  }
1092  }
1093 
1094  if(bOverlap)
1095  {
1096  // yes, start a new layer
1097  pLayer->mpDown = new E3dDepthLayer;
1098  pLayer = pLayer->mpDown;
1099  nNumLayers++;
1100  pLayer->mvNeighbours.emplace_back(pExtrudeObj, aExtrudePoly);
1101  }
1102  else
1103  {
1104  // no, add to current layer
1105  pLayer->mvNeighbours.emplace(pLayer->mvNeighbours.begin(), pExtrudeObj, aExtrudePoly);
1106  }
1107  }
1108  else
1109  {
1110  // first layer ever
1111  pBaseLayer = new E3dDepthLayer;
1112  pLayer = pBaseLayer;
1113  nNumLayers++;
1114  pLayer->mvNeighbours.emplace_back(pExtrudeObj, aExtrudePoly);
1115  }
1116  }
1117  }
1118 
1119  // number of layers is done
1120  if(nNumLayers > 1)
1121  {
1122  // need to be arranged
1123  double fMinDepth = fDepth * 0.8;
1124  double fStep = (fDepth - fMinDepth) / static_cast<double>(nNumLayers);
1125  pLayer = pBaseLayer;
1126 
1127  while(pLayer)
1128  {
1129  // move along layer
1130  for(auto& rAct : pLayer->mvNeighbours)
1131  {
1132  // adapt extrude value
1133  rAct.mpObj->SetMergedItem(SfxUInt32Item(SDRATTR_3DOBJ_DEPTH, sal_uInt32(fMinDepth + 0.5)));
1134  }
1135 
1136  // next layer
1137  pLayer = pLayer->mpDown;
1138  fMinDepth += fStep;
1139  }
1140  }
1141 
1142  // cleanup
1143  while(pBaseLayer)
1144  {
1145  pLayer = pBaseLayer->mpDown;
1146  delete pBaseLayer;
1147  pBaseLayer = pLayer;
1148  }
1149 }
1150 
1151 // Start drag, create for 3D objects before possibly drag method
1152 
1153 bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut,
1154  SdrHdl* pHdl, short nMinMov,
1155  SdrDragMethod* pForcedMeth)
1156 {
1158  {
1159  // Determine all selected polygons and return the mirrored helper overlay
1160  mpMirrorOverlay->SetMirrorAxis(maRef1, maRef2);
1161  }
1162  else
1163  {
1164  bool bOwnActionNecessary;
1165  if (pHdl == nullptr)
1166  {
1167  bOwnActionNecessary = true;
1168  }
1169  else if (pHdl->IsVertexHdl() || pHdl->IsCornerHdl())
1170  {
1171  bOwnActionNecessary = true;
1172  }
1173  else
1174  {
1175  bOwnActionNecessary = false;
1176  }
1177 
1178  if(bOwnActionNecessary && GetMarkedObjectCount() > 0)
1179  {
1181  bool bThereAreRootScenes = false;
1182  bool bThereAre3DObjects = false;
1183  const size_t nCnt = GetMarkedObjectCount();
1184  for(size_t nObjs = 0; nObjs < nCnt; ++nObjs)
1185  {
1186  SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
1187  if(pObj)
1188  {
1189  if( auto pScene = dynamic_cast< const E3dScene* >(pObj) )
1190  if( pScene->getRootE3dSceneFromE3dObject() == pObj )
1191  bThereAreRootScenes = true;
1192 
1193  if(dynamic_cast< const E3dObject* >(pObj) != nullptr)
1194  {
1195  bThereAre3DObjects = true;
1196  }
1197  }
1198  }
1199  if( bThereAre3DObjects )
1200  {
1201  meDragHdl = ( pHdl == nullptr ? SdrHdlKind::Move : pHdl->GetKind() );
1202  switch ( meDragMode )
1203  {
1204  case SdrDragMode::Rotate:
1205  case SdrDragMode::Shear:
1206  {
1207  switch ( meDragHdl )
1208  {
1209  case SdrHdlKind::Left:
1210  case SdrHdlKind::Right:
1211  {
1212  eConstraint = E3dDragConstraint::X;
1213  }
1214  break;
1215 
1216  case SdrHdlKind::Upper:
1217  case SdrHdlKind::Lower:
1218  {
1219  eConstraint = E3dDragConstraint::Y;
1220  }
1221  break;
1222 
1223  case SdrHdlKind::UpperLeft:
1225  case SdrHdlKind::LowerLeft:
1227  {
1228  eConstraint = E3dDragConstraint::Z;
1229  }
1230  break;
1231  default: break;
1232  }
1233 
1234  // do not mask the allowed rotations
1235  eConstraint &= E3dDragConstraint::XYZ;
1236  pForcedMeth = new E3dDragRotate(*this, GetMarkedObjectList(), eConstraint, IsSolidDragging());
1237  }
1238  break;
1239 
1240  case SdrDragMode::Move:
1241  {
1242  if(!bThereAreRootScenes)
1243  {
1244  pForcedMeth = new E3dDragMove(*this, GetMarkedObjectList(), meDragHdl, eConstraint, IsSolidDragging());
1245  }
1246  }
1247  break;
1248 
1249  // later on
1250  case SdrDragMode::Mirror:
1251  case SdrDragMode::Crook:
1253  case SdrDragMode::Gradient:
1254  default:
1255  {
1256  }
1257  break;
1258  }
1259  }
1260  }
1261  }
1262  return SdrView::BegDragObj(rPnt, pOut, pHdl, nMinMov, pForcedMeth);
1263 }
1264 
1265 // Set current 3D drawing object, create the scene for this
1267 {
1268  DBG_ASSERT(p3DObj != nullptr, "Who puts in a NULL-pointer here");
1269 
1270  // get transformed BoundVolume of the object
1271  basegfx::B3DRange aVolume(p3DObj->GetBoundVolume());
1272  aVolume.transform(p3DObj->GetTransform());
1273  double fW(aVolume.getWidth());
1274  double fH(aVolume.getHeight());
1275 
1276  tools::Rectangle aRect(0,0, static_cast<tools::Long>(fW), static_cast<tools::Long>(fH));
1277 
1278  E3dScene* pScene = new E3dScene(p3DObj->getSdrModelFromSdrObject());
1279 
1280  InitScene(pScene, fW, fH, aVolume.getMaxZ() + ((fW + fH) / 4.0));
1281 
1282  pScene->InsertObject(p3DObj);
1283  pScene->NbcSetSnapRect(aRect);
1284 
1285  return pScene;
1286 }
1287 
1288 void E3dView::InitScene(E3dScene* pScene, double fW, double fH, double fCamZ)
1289 {
1290  Camera3D aCam(pScene->GetCamera());
1291 
1292  aCam.SetAutoAdjustProjection(false);
1293  aCam.SetViewWindow(- fW / 2, - fH / 2, fW, fH);
1294  basegfx::B3DPoint aLookAt;
1295 
1296  double fDefaultCamPosZ = GetDefaultCamPosZ();
1297  basegfx::B3DPoint aCamPos(0.0, 0.0, fCamZ < fDefaultCamPosZ ? fDefaultCamPosZ : fCamZ);
1298 
1299  aCam.SetPosAndLookAt(aCamPos, aLookAt);
1300  aCam.SetFocalLength(GetDefaultCamFocal());
1301  pScene->SetCamera(aCam);
1302 }
1303 
1305 {
1306  if (!GetMarkedObjectCount())
1307  return;
1308 
1309  //positioned
1310  tools::Long nOutMin = 0;
1311  tools::Long nOutMax = 0;
1312  tools::Long nMinLen = 0;
1313  tools::Long nObjDst = 0;
1314  tools::Long nOutHgt = 0;
1316 
1317  // first determine representation boundaries
1318  if (pOut != nullptr)
1319  {
1320  nMinLen = pOut->PixelToLogic(Size(0,50)).Height();
1321  nObjDst = pOut->PixelToLogic(Size(0,20)).Height();
1322 
1323  tools::Long nDst = pOut->PixelToLogic(Size(0,10)).Height();
1324 
1325  nOutMin = -pOut->GetMapMode().GetOrigin().Y();
1326  nOutMax = pOut->GetOutputSize().Height() - 1 + nOutMin;
1327  nOutMin += nDst;
1328  nOutMax -= nDst;
1329 
1330  if (nOutMax - nOutMin < nDst)
1331  {
1332  nOutMin += nOutMax + 1;
1333  nOutMin /= 2;
1334  nOutMin -= (nDst + 1) / 2;
1335  nOutMax = nOutMin + nDst;
1336  }
1337 
1338  nOutHgt = nOutMax - nOutMin;
1339 
1340  tools::Long nTemp = nOutHgt / 4;
1341  if (nTemp > nMinLen) nMinLen = nTemp;
1342  }
1343 
1344  // and then attach the marks at the top and bottom of the object
1345  basegfx::B2DRange aR;
1346  for(size_t nMark = 0; nMark < GetMarkedObjectCount(); ++nMark)
1347  {
1348  SdrObject* pMark = GetMarkedObjectByIndex(nMark);
1349  basegfx::B2DPolyPolygon aXPP(pMark->TakeXorPoly());
1350  aR.expand(basegfx::utils::getRange(aXPP));
1351  }
1352 
1353  basegfx::B2DPoint aCenter(aR.getCenter());
1354  tools::Long nMarkHgt = basegfx::fround(aR.getHeight()) - 1;
1355  tools::Long nHgt = nMarkHgt + nObjDst * 2;
1356 
1357  if (nHgt < nMinLen) nHgt = nMinLen;
1358 
1359  tools::Long nY1 = basegfx::fround(aCenter.getY()) - (nHgt + 1) / 2;
1360  tools::Long nY2 = nY1 + nHgt;
1361 
1362  if (pOut && (nMinLen > nOutHgt)) nMinLen = nOutHgt;
1363  if (pOut)
1364  {
1365  if (nY1 < nOutMin)
1366  {
1367  nY1 = nOutMin;
1368  if (nY2 < nY1 + nMinLen) nY2 = nY1 + nMinLen;
1369  }
1370  if (nY2 > nOutMax)
1371  {
1372  nY2 = nOutMax;
1373  if (nY1 > nY2 - nMinLen) nY1 = nY2 - nMinLen;
1374  }
1375  }
1376 
1377  maRef1.setX( basegfx::fround(aR.getMinX()) ); // Initial move axis 2/100mm to the left
1378  maRef1.setY( nY1 );
1379  maRef2.setX( maRef1.X() );
1380  maRef2.setY( nY2 );
1381 
1382  // Turn on marks
1383  SetMarkHandles(nullptr);
1384 
1385  //HMHif (bVis) ShowMarkHdl();
1387 
1388  // Show mirror polygon IMMEDIATELY
1389  const SdrHdlList &aHdlList = GetHdlList();
1391  mpMirrorOverlay->SetMirrorAxis(aHdlList.GetHdl(SdrHdlKind::Ref1)->GetPos(), aHdlList.GetHdl(SdrHdlKind::Ref2)->GetPos());
1392 }
1393 
1394 // what happens with a mouse movement when the object is created?
1395 
1396 void E3dView::MovAction(const Point& rPnt)
1397 {
1399  {
1400  SdrHdl* pHdl = GetDragHdl();
1401 
1402  if (pHdl)
1403  {
1404  SdrHdlKind eHdlKind = pHdl->GetKind();
1405 
1406  // reacts only due to a mirror axis
1407  if ((eHdlKind == SdrHdlKind::Ref1) ||
1408  (eHdlKind == SdrHdlKind::Ref2) ||
1409  (eHdlKind == SdrHdlKind::MirrorAxis))
1410  {
1411  const SdrHdlList &aHdlList = GetHdlList ();
1412 
1413  // delete the mirrored polygon, mirrors the original and draws
1414  // it anew
1415  SdrView::MovAction (rPnt);
1416  mpMirrorOverlay->SetMirrorAxis(
1417  aHdlList.GetHdl (SdrHdlKind::Ref1)->GetPos(),
1418  aHdlList.GetHdl (SdrHdlKind::Ref2)->GetPos());
1419  }
1420  }
1421  else
1422  {
1423  SdrView::MovAction (rPnt);
1424  }
1425  }
1426  else
1427  {
1428  SdrView::MovAction (rPnt);
1429  }
1430 }
1431 
1432 // The End. Create object and any child objects through ImpCreate3DLathe.
1433 // With the parameter value sal_True (SDefault: sal_False) is simply a
1434 // rotation body created, without letting the user set the position of the
1435 // axis. It is sufficient with this call, if an object is selected.
1436 // (No initialization necessary)
1437 
1438 void E3dView::End3DCreation(bool bUseDefaultValuesForMirrorAxes)
1439 {
1441 
1442  if(!AreObjectsMarked())
1443  return;
1444 
1445  if(bUseDefaultValuesForMirrorAxes)
1446  {
1448  if(aRect.GetWidth() <= 1)
1449  aRect.SetSize(Size(500, aRect.GetHeight()));
1450  if(aRect.GetHeight() <= 1)
1451  aRect.SetSize(Size(aRect.GetWidth(), 500));
1452 
1453  basegfx::B2DPoint aPnt1(aRect.Left(), -aRect.Top());
1454  basegfx::B2DPoint aPnt2(aRect.Left(), -aRect.Bottom());
1455 
1456  ConvertMarkedObjTo3D(false, aPnt1, aPnt2);
1457  }
1458  else
1459  {
1460  // Turn off helper overlay
1461  // Determine from the handle positions and the displacement of
1462  // the points
1463  const SdrHdlList &aHdlList = GetHdlList();
1464  Point aMirrorRef1 = aHdlList.GetHdl(SdrHdlKind::Ref1)->GetPos();
1465  Point aMirrorRef2 = aHdlList.GetHdl(SdrHdlKind::Ref2)->GetPos();
1466 
1467  basegfx::B2DPoint aPnt1(aMirrorRef1.X(), -aMirrorRef1.Y());
1468  basegfx::B2DPoint aPnt2(aMirrorRef2.X(), -aMirrorRef2.Y());
1469 
1470  ConvertMarkedObjTo3D(false, aPnt1, aPnt2);
1471  }
1472 }
1473 
1475 {
1476 }
1477 
1479 {
1480  mpMirrorOverlay.reset();
1481 }
1482 
1484 {
1485  mpMirrorOverlay = nullptr;
1486 }
1487 
1489 {
1490  const size_t nCount = GetMarkedObjectCount();
1491 
1492  if (nCount > 0)
1493  {
1494  for (size_t i = 0; i < nCount; ++i)
1495  {
1497 
1498  if (auto p3dObject = dynamic_cast< E3dObject* >(pObj))
1499  {
1500  if(!p3dObject->IsBreakObjPossible())
1501  return false;
1502  }
1503  else
1504  {
1505  return false;
1506  }
1507  }
1508  }
1509  else
1510  {
1511  return false;
1512  }
1513 
1514  return true;
1515 }
1516 
1518 {
1519  if(!IsBreak3DObjPossible())
1520  return;
1521 
1522  // ALL selected objects are changed
1523  const size_t nCount = GetMarkedObjectCount();
1524 
1525  BegUndo(SvxResId(RID_SVX_3D_UNDO_BREAK_LATHE));
1526  for(size_t a=0; a<nCount; ++a)
1527  {
1528  E3dObject* pObj = static_cast<E3dObject*>(GetMarkedObjectByIndex(a));
1529  BreakSingle3DObj(pObj);
1530  }
1531  DeleteMarked();
1532  EndUndo();
1533 }
1534 
1536 {
1537  if(dynamic_cast< const E3dScene* >(pObj) != nullptr)
1538  {
1539  SdrObjList* pSubList = pObj->GetSubList();
1540  SdrObjListIter aIter(pSubList, SdrIterMode::Flat);
1541 
1542  while(aIter.IsMore())
1543  {
1544  E3dObject* pSubObj = static_cast<E3dObject*>(aIter.Next());
1545  BreakSingle3DObj(pSubObj);
1546  }
1547  }
1548  else
1549  {
1550  SdrAttrObj* pNewObj = pObj->GetBreakObj().release();
1551  if (pNewObj)
1552  {
1554  {
1555  pNewObj->SetChanged();
1556  pNewObj->BroadcastObjectChange();
1557  }
1558  }
1559  }
1560 }
1561 
1563 {
1564  // call parent
1566 
1567  // Set other flags
1569  return;
1570 
1571  const size_t nMarkCnt = GetMarkedObjectCount();
1572  bool bCompound = false;
1573  bool b3DObject = false;
1574  for(size_t nObjs = 0; (nObjs < nMarkCnt) && !bCompound; ++nObjs)
1575  {
1576  SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
1577  if(dynamic_cast< const E3dCompoundObject* >(pObj))
1578  bCompound = true;
1579  if(dynamic_cast< const E3dObject* >(pObj))
1580  b3DObject = true;
1581  }
1582 
1583  // So far: there are two or more of any objects selected. See if
1584  // compound objects are involved. If yes, ban grouping.
1585  if(m_bGroupPossible && bCompound)
1586  m_bGroupPossible = false;
1587 
1588  if(m_bUnGroupPossible && b3DObject)
1589  m_bUnGroupPossible = false;
1590 
1591  if(m_bGrpEnterPossible && bCompound)
1592  m_bGrpEnterPossible = false;
1593 }
1594 
1595 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetAutoAdjustProjection(bool bAdjust)
Definition: camera3d.hxx:62
double getY() const
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
Definition: svdobj.cxx:1126
basegfx::B2DPolyPolygon * mpPolygons
Definition: view3d.cxx:72
B2DPoint getCenter() const
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr)
Definition: svddrgv.cxx:183
void expand(const B2DTuple &rTuple)
SfxBoolItem makeSvx3DDoubleSidedItem(bool bVal)
Definition: svx3ditems.hxx:58
void ImpGetPasteObjList(Point &rPos, SdrObjList *&rpLst)
Definition: svdxcgv.cxx:94
void SortMarkedObjects() const
Definition: svdmrkv.hxx:258
double getHeight() const
void ImpChangeSomeAttributesFor3DConversion2(SdrObject *pObj)
Definition: view3d.cxx:659
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
void ReplaceObjectAtView(SdrObject *pOldObj, SdrPageView &rPV, SdrObject *pNewObj, bool bMark=true)
Definition: svdedtv.cxx:1025
const tools::Rectangle & GetAllObjBoundRect() const
Definition: svdpage.cxx:752
bool equalZero(const T &rfVal)
constexpr tools::Long Left() const
virtual bool Paste(const SdrModel &rMod, const Point &rPos, SdrObjList *pLst, SdrInsertFlags nOptions)
Definition: svdxcgv.cxx:228
SdrHdlKind
Definition: svdhdl.hxx:52
bool AreObjectsMarked() const
Definition: svdmrkv.hxx:259
bool IsUndoEnabled() const
Definition: svdedtv.cxx:1064
void BreakSingle3DObj(E3dObject *pObj)
Definition: view3d.cxx:1535
long Long
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XLineWidthItem > XATTR_LINEWIDTH(XATTR_LINE_FIRST+2)
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:822
#define F_PI2
size_t GetObjCount() const
Definition: svdpage.cxx:816
void SetMirrorAxis(Point aMirrorAxisA, Point aMirrorAxisB)
Definition: view3d.cxx:137
void BegUndo()
Definition: svdedtv.hxx:178
const MapMode & GetMapMode() const
bool IsConvertTo3DObjPossible() const
Definition: view3d.cxx:586
void Break3DObj()
Definition: view3d.cxx:1517
SdrPageView * GetSdrPageViewOfMarkedByIndex(size_t nNum) const
Definition: svdmrkv.hxx:254
constexpr TypedWhichId< XLineStyleItem > XATTR_LINESTYLE(XATTR_LINE_FIRST)
SdrMark * GetMark(size_t nNum) const
Definition: svdmark.cxx:230
constexpr TypedWhichId< SfxUInt32Item > SDRATTR_3DOBJ_DEPTH(SDRATTR_3DOBJ_FIRST+2)
void append(std::unique_ptr< OverlayObject > pOverlayObject)
const Point & GetPos() const
Definition: svdhdl.hxx:197
#define DEG2RAD(fAngle)
Definition: def3d.hxx:27
const basegfx::B3DHomMatrix & GetTransform() const
Definition: obj3d.hxx:112
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:471
virtual SdrObjList * GetSubList() const override
Definition: scene3d.cxx:859
EmbeddedObjectRef * pObject
virtual void SetMarkHandles(SfxViewShell *pOtherShell) override
Definition: svddrgv.cxx:896
E3dScene * SetCurrent3DObj(E3dObject *p3DObj)
Definition: view3d.cxx:1266
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:748
virtual void MarkListHasChanged() override
Definition: svdedxv.cxx:2484
void setX(double fX)
bool InsertObjectAtView(SdrObject *pObj, SdrPageView &rPV, SdrInsertFlags nOptions=SdrInsertFlags::NONE)
Definition: svdedtv.cxx:983
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:251
SdrHdlKind meDragHdl
Definition: svddrgv.hxx:46
bool m_bUnGroupPossible
Definition: svdedtv.hxx:83
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1666
void End3DCreation(bool bUseDefaultValuesForMirrorAxes=false)
Definition: view3d.cxx:1438
virtual void MovAction(const Point &rPnt) override
Definition: view3d.cxx:1396
virtual SdrObject * getSdrObjectFromSdrObjList() const override
Definition: scene3d.cxx:248
virtual std::unique_ptr< SdrModel > CreateMarkedObjModel() const override
Definition: view3d.cxx:311
void InitScene(E3dScene *pScene, double fW, double fH, double fCamZ)
Definition: view3d.cxx:1288
double GetDefaultCamPosZ()
Definition: view3d1.cxx:167
void ImpCreate3DObject(E3dScene *pScene, SdrObject *pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix const &rLatheMat)
Definition: view3d.cxx:760
B3DPoint getCenter() const
bool IsMore() const
Definition: svditer.hxx:62
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:269
void SetCamera(const Camera3D &rNewCamera)
Definition: scene3d.cxx:345
std::unique_ptr< Impl3DMirrorConstructOverlay > mpMirrorOverlay
Definition: view3d.hxx:47
bool IsBreak3DObjPossible() const
Definition: view3d.cxx:1488
int nCount
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
bool IsClosed() const
Definition: svdopath.hxx:146
E3dDefaultAttributes & Get3DDefaultAttributes()
Definition: view3d.hxx:72
SfxStyleSheet * GetStyleSheet() const
Definition: svdobj.cxx:2225
oslFileHandle & pOut
constexpr tools::Long GetWidth() const
void removeAllNonSelectedObjects()
Definition: scene3d.cxx:401
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:2003
static void DoDepthArrange(E3dScene const *pScene, double fDepth)
Definition: view3d.cxx:1027
virtual void SetSelected(bool bNew) override
Definition: scene3d.cxx:728
OutputDevice * GetFirstOutputDevice() const
Definition: svdpntv.cxx:89
B2DPolyPolygon solvePolygonOperationAnd(const B2DPolyPolygon &rCandidateA, const B2DPolyPolygon &rCandidateB)
Point maRef1
Definition: svdmrkv.hxx:105
void SetDrawOnlySelected(bool bNew)
Definition: scene3d.hxx:115
B2IRange fround(const B2DRange &rRange)
void ImpCreateSingle3DObjectFlat(E3dScene *pScene, SdrObject *pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix const &rLatheMat)
Definition: view3d.cxx:685
Point maRef2
Definition: svdmrkv.hxx:106
void EndUndo()
Definition: svdedtv.cxx:303
sal_uInt32 PaintWindowCount() const
Definition: svdpntv.hxx:218
bool IsConvertToPolyObjPossible() const
Definition: svdedtv.hxx:350
void ResetCreationActive()
Definition: view3d.cxx:1478
SdrObject * GetMarkedSdrObj() const
Definition: svdmark.hxx:68
Everything a View needs to know about a selected object.
Definition: svdmark.hxx:44
sdr::overlay::OverlayObjectList maObjects
Definition: view3d.cxx:63
SdrDragMode meDragMode
Definition: svdmrkv.hxx:118
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdedtv.hxx:182
virtual std::unique_ptr< SdrModel > CreateMarkedObjModel() const
Definition: svdxcgv.cxx:709
#define DBG_ASSERT(sCon, aError)
int i
uno_Any a
void ImpChangeSomeAttributesFor3DConversion(SdrObject *pObj)
Definition: view3d.cxx:634
bool m_bGroupPossible
Definition: svdedtv.hxx:82
bool IsUndoEnabled() const
returns true if undo is currently enabled This returns false if undo was disabled using EnableUndo( f...
Definition: svdmodel.cxx:531
void SingleObjectPainter(OutputDevice &rOut) const
Definition: svdobj.cxx:1054
size_t GetMarkedObjectCount() const
Definition: svdmrkv.hxx:257
void SetSize(const Size &rSize)
void BroadcastObjectChange() const
Definition: svdobj.cxx:1008
const SdrMarkList & GetMarkedObjectList() const
Definition: svdmrkv.hxx:251
Size GetOutputSize() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
Definition: svdmodel.cxx:1795
constexpr tools::Long Right() const
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_GRAY
void InitView()
Definition: view3d.cxx:1483
drawinglayer::primitive2d::Primitive2DContainer getViewIndependentPrimitive2DContainer() const
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:279
void transform(const basegfx::B2DHomMatrix &rMatrix)
double GetDefaultCamFocal()
Definition: view3d1.cxx:172
virtual void DrawMarkedObj(OutputDevice &rOut) const override
Definition: view3d.cxx:213
virtual void append(const Primitive2DReference &) override
constexpr tools::Long Top() const
bool IsGroupObject() const
Definition: svdobj.cxx:743
const basegfx::B3DRange & GetBoundVolume() const
Definition: obj3d.cxx:311
void SetMergedItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1988
const basegfx::B3DHomMatrix & GetFullTransform() const
Definition: obj3d.cxx:335
std::size_t mnCount
Abstract DrawObject.
Definition: svdobj.hxx:259
void ConvertMarkedObjTo3D(bool bExtrude=true, const basegfx::B2DPoint &rPnt1=basegfx::B2DPoint(0.0, 0.0), const basegfx::B2DPoint &rPnt2=basegfx::B2DPoint(0.0, 1.0))
Definition: view3d.cxx:825
sal_Int32 nLineWidth
const tools::Rectangle & GetAllMarkedRect() const
Definition: svdmrkv.hxx:419
SdrInsertFlags
Definition: svdedtv.hxx:58
virtual bool Paste(const SdrModel &rMod, const Point &rPos, SdrObjList *pLst, SdrInsertFlags nOptions) override
Definition: view3d.cxx:431
B2DRange getRange(const B2DPolygon &rCandidate)
BASEGFX_DLLPUBLIC void transform(const B3DHomMatrix &rMatrix)
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:678
SdrHdl * GetDragHdl() const
Definition: svddrgv.hxx:104
void translate(double fX, double fY, double fZ)
constexpr tools::Long Bottom() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
virtual void CheckPossibilities()
Definition: svdedtv.cxx:483
drawinglayer::primitive2d::Primitive2DContainer maFullOverlay
Definition: view3d.cxx:75
virtual void SetTransform(const basegfx::B3DHomMatrix &rMatrix)
Definition: obj3d.cxx:365
SdrObject * Next()
Definition: svditer.hxx:63
virtual void SetTransform(const basegfx::B3DHomMatrix &rMatrix) override
Definition: scene3d.cxx:601
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
SdrHdl * GetHdl(size_t nNum) const
Definition: svdhdl.hxx:460
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
SdrObjectUniquePtr ConvertToPolyObj(bool bBezier, bool bLineToArea) const
Definition: svdobj.cxx:2595
Derived class of SdrView to edit 3D objects.
Definition: view3d.hxx:41
sal_uInt32 count() const
E3dView(SdrModel &rSdrModel, OutputDevice *pOut)
Definition: view3d.cxx:202
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE) override
Definition: scene3d.cxx:763
tools::Rectangle & Union(const tools::Rectangle &rRect)
constexpr tools::Long Height() const
Impl3DMirrorConstructOverlay(const Impl3DMirrorConstructOverlay &)=delete
SdrObject * ConvertToContourObj(SdrObject *pRet, bool bForceLineDash=false) const
Definition: svdobj.cxx:2557
SlideSorterView & mrView
eFillStyle
Definition: fillctrl.cxx:54
B2DHomMatrix createRotateAroundPoint(double fPointX, double fPointY, double fRadiant)
bool IsSolidDragging() const
Definition: svddrgv.cxx:912
void ImpIsConvertTo3DPossible(SdrObject const *pObj, bool &rAny3D, bool &rGroupSelected) const
Definition: view3d.cxx:609
virtual void DrawMarkedObj(OutputDevice &rOut) const
Definition: svdxcgv.cxx:695
const SfxItemSet & GetMergedItemSet() const
Definition: svdobj.cxx:1978
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
E3dDragConstraint
Definition: def3d.hxx:31
virtual void DeleteMarked()
Definition: svdview.cxx:1409
bool IsVertexHdl() const
Definition: svdhdl.hxx:213
void Start3DCreation()
Definition: view3d.cxx:1304
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
Definition: svdmrkv.hxx:256
const Point & GetOrigin() const
void translate(double fX, double fY)
const basegfx::B2DPolyPolygon & GetPathPoly() const
Definition: svdopath.hxx:141
SdrPageView * GetSdrPageView() const
Definition: svdpntv.hxx:299
virtual void CheckPossibilities() override
Definition: view3d.cxx:1562
Helper for 3d object changes affecting 2d geometry.
virtual void SetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1691
void rotate(double fAngleX, double fAngleY, double fAngleZ)
virtual void MovAction(const Point &rPnt) override
Definition: svdcrtv.cxx:207
double getX() const
double getMinX() const
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
Definition: svdmrkv.cxx:1883
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr) override
Definition: view3d.cxx:1153
const SdrHdlList & GetHdlList() const
Definition: svdmrkv.hxx:353
SdrMark * GetSdrMarkByIndex(size_t nNum) const
Definition: svdmrkv.hxx:255
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:365
bool IsCornerHdl() const
Definition: svdhdl.hxx:212
bool Is3DRotationCreationActive() const
Definition: view3d.hxx:101
bool IsConvertToPathObjPossible() const
Definition: svdedtv.hxx:349
double getDepth() const
bool IsImportMtfPossible() const
Definition: svdedtv.hxx:408
virtual void NbcSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
Definition: svdobj.cxx:2243
virtual ~E3dView() override
Definition: view3d.cxx:1474
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
virtual std::unique_ptr< SdrAttrObj, SdrObjectFreeOp > GetBreakObj()
Definition: obj3d.cxx:99
virtual void SetChanged()
Definition: svdobj.cxx:1032
B2DPolyPolygon prepareForPolygonOperation(const B2DPolygon &rCandidate)
constexpr TypedWhichId< XLineColorItem > XATTR_LINECOLOR(XATTR_LINE_FIRST+3)
SdrMarkList & GetMarkedObjectListWriteAccess()
Definition: svdmrkv.hxx:247
SdrModel * GetModel() const
Definition: svdpntv.hxx:260
const Camera3D & GetCamera() const
Definition: scene3d.hxx:127
virtual SdrObject * getSdrObjectFromSdrObjList() const
Definition: svdpage.cxx:128
virtual E3dCompoundObject * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: obj3d.cxx:594
virtual E3dScene * getRootE3dSceneFromE3dObject() const override
Definition: scene3d.cxx:389
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
Definition: svdpntv.cxx:73
bool ImpCloneAll3DObjectsToDestScene(E3dScene const *pSrcScene, E3dScene *pDstScene, Point aOffset)
Definition: view3d.cxx:484
const E3dView & mrView
Definition: view3d.cxx:66
sal_uInt16 GetPageCount() const
Definition: svdmodel.cxx:1805
const Color & GetValue() const
SdrHdlKind GetKind() const
Definition: svdhdl.hxx:194
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
Definition: scene3d.cxx:317
bool m_bGrpEnterPossible
Definition: svdedtv.hxx:84
constexpr tools::Long GetHeight() const
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:695
sal_uInt32 PageWindowCount() const
Definition: svdpagv.hxx:89
bool IsObjMarked(SdrObject const *pObj) const
Definition: svdmrkv.cxx:2150