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