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