LibreOffice Module svx (master)  1
scene3d.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 #include <sal/config.h>
21 
22 #include <cstdlib>
23 
24 #include <svx/strings.hrc>
25 #include <svx/dialmgr.hxx>
26 #include <svx/svditer.hxx>
27 
28 #include <stdlib.h>
29 #include <svx/svdobjkind.hxx>
30 #include <svx/svdpage.hxx>
31 #include <svx/scene3d.hxx>
32 #include <svx/svdtrans.hxx>
35 #include <svx/svddrag.hxx>
36 #include "helperminimaldepth3d.hxx"
37 #include <algorithm>
40 #include <svx/e3dsceneupdater.hxx>
41 #include <svx/svdmodel.hxx>
42 #include <rtl/ustrbuf.hxx>
43 
44 namespace {
45 
46 class ImpRemap3DDepth
47 {
48  sal_uInt32 mnOrdNum;
49  double mfMinimalDepth;
50 
51  // bit field
52  bool mbIsScene : 1;
53 
54 public:
55  ImpRemap3DDepth(sal_uInt32 nOrdNum, double fMinimalDepth);
56  explicit ImpRemap3DDepth(sal_uInt32 nOrdNum);
57 
58  // for ::std::sort
59  bool operator<(const ImpRemap3DDepth& rComp) const;
60 
61  sal_uInt32 GetOrdNum() const { return mnOrdNum; }
62  bool IsScene() const { return mbIsScene; }
63 };
64 
65 }
66 
67 ImpRemap3DDepth::ImpRemap3DDepth(sal_uInt32 nOrdNum, double fMinimalDepth)
68 : mnOrdNum(nOrdNum),
69  mfMinimalDepth(fMinimalDepth),
70  mbIsScene(false)
71 {
72 }
73 
74 ImpRemap3DDepth::ImpRemap3DDepth(sal_uInt32 nOrdNum)
75 : mnOrdNum(nOrdNum),
76  mfMinimalDepth(0.0),
77  mbIsScene(true)
78 {
79 }
80 
81 bool ImpRemap3DDepth::operator<(const ImpRemap3DDepth& rComp) const
82 {
83  if(IsScene())
84  {
85  return false;
86  }
87  else
88  {
89  if(rComp.IsScene())
90  {
91  return true;
92  }
93  else
94  {
95  return mfMinimalDepth < rComp.mfMinimalDepth;
96  }
97  }
98 }
99 
101 {
102  std::vector< ImpRemap3DDepth > maVector;
103 
104 public:
105  explicit Imp3DDepthRemapper(E3dScene const & rScene);
106 
107  sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const;
108 };
109 
111 {
112  // only called when rScene.GetSubList() and nObjCount > 1
113  SdrObjList* pList = rScene.GetSubList();
114  const size_t nObjCount(pList->GetObjCount());
115 
116  for(size_t a = 0; a < nObjCount; ++a)
117  {
118  SdrObject* pCandidate = pList->GetObj(a);
119 
120  if(pCandidate)
121  {
122  if(auto pCompoundObj = dynamic_cast< const E3dCompoundObject*>(pCandidate))
123  {
124  // single 3d object, calc depth
125  const double fMinimalDepth(getMinimalDepthInViewCoordinates(*pCompoundObj));
126  ImpRemap3DDepth aEntry(a, fMinimalDepth);
127  maVector.push_back(aEntry);
128  }
129  else
130  {
131  // scene, use standard entry for scene
132  ImpRemap3DDepth aEntry(a);
133  maVector.push_back(aEntry);
134  }
135  }
136  }
137 
138  // now, we need to sort the maVector by its members minimal depth. The
139  // smaller, the nearer to the viewer.
140  ::std::sort(maVector.begin(), maVector.end());
141 }
142 
143 sal_uInt32 Imp3DDepthRemapper::RemapOrdNum(sal_uInt32 nOrdNum) const
144 {
145  if(nOrdNum < maVector.size())
146  {
147  nOrdNum = maVector[(maVector.size() - 1) - nOrdNum].GetOrdNum();
148  }
149 
150  return nOrdNum;
151 }
152 
153 
154 // BaseProperties section
155 
156 std::unique_ptr<sdr::properties::BaseProperties> E3dScene::CreateObjectSpecificProperties()
157 {
158  return std::make_unique<sdr::properties::E3dSceneProperties>(*this);
159 }
160 
161 
162 // DrawContact section
163 
164 std::unique_ptr<sdr::contact::ViewContact> E3dScene::CreateObjectSpecificViewContact()
165 {
166  return std::make_unique<sdr::contact::ViewContactOfE3dScene>(*this);
167 }
168 
169 
171 : E3dObject(rSdrModel),
172  SdrObjList(),
173  aCamera(basegfx::B3DPoint(0.0, 0.0, 4.0), basegfx::B3DPoint()),
174  bDrawOnlySelected(false),
175  mbSkipSettingDirty(false)
176 {
177  // Set defaults
179 }
180 
182 {
183  // For WIN95/NT turn off the FP-Exceptions
184 #if defined(_WIN32)
185  _control87( _MCW_EM, _MCW_EM );
186 #endif
187 
188  // Set defaults
189  aCamera.SetViewWindow(-2, -2, 4, 4);
190  aCameraSet.SetDeviceRectangle(-2, 2, -2, 2);
192  tools::Rectangle aRect(0, 0, 10, 10);
193  aCameraSet.SetViewportRectangle(aRect);
194 
195  // set defaults for Camera from ItemPool
197  basegfx::B3DPoint aActualPosition(aCamera.GetPosition());
198  double fNew = GetDistance();
199 
200  if(fabs(fNew - aActualPosition.getZ()) > 1.0)
201  {
202  aCamera.SetPosition( basegfx::B3DPoint( aActualPosition.getX(), aActualPosition.getY(), fNew) );
203  }
204 
205  fNew = GetFocalLength() / 100.0;
206  aCamera.SetFocalLength(fNew);
207 }
208 
210 {
212 }
213 
215 {
216  return getSdrPageFromSdrObject();
217 }
218 
220 {
221  return const_cast< E3dScene* >(this);
222 }
223 
225 {
226  return const_cast< E3dScene* >(this);
227 }
228 
230 {
233  const basegfx::B3DPolyPolygon aCubePolyPolygon(CreateWireframe());
234 
236  aViewInfo3D.getObjectToView()));
237  aRetval.transform(rVCScene.getObjectTransformation());
238 
239  return aRetval;
240 }
241 
243 {
244  mp3DDepthRemapper.reset();
245 }
246 
247 sal_uInt32 E3dScene::RemapOrdNum(sal_uInt32 nNewOrdNum) const
248 {
249  if(!mp3DDepthRemapper)
250  {
251  const size_t nObjCount(GetSubList() ? GetSubList()->GetObjCount() : 0);
252 
253  if(nObjCount > 1)
254  {
255  mp3DDepthRemapper.reset(new Imp3DDepthRemapper(*this));
256  }
257  }
258 
260  {
261  return mp3DDepthRemapper->RemapOrdNum(nNewOrdNum);
262  }
263 
264  return nNewOrdNum;
265 }
266 
268 {
269  return E3D_SCENE_ID;
270 }
271 
273 {
275 
276  if(pScene == this)
277  {
278  // avoid resetting aOutRect which in case of a 3D scene used as 2d object
279  // is model data,not re-creatable view data
280  }
281  else
282  {
283  // if not the outmost scene it is used as group in 3d, call parent
285  }
286 }
287 
289 {
290  SetRectsDirty();
292  aCamera.SetDeviceWindow(rRect);
293  aCameraSet.SetViewportRectangle(rRect);
294 
296 }
297 
298 void E3dScene::NbcMove(const Size& rSize)
299 {
300  tools::Rectangle aNewSnapRect = GetSnapRect();
301  aNewSnapRect.Move(rSize);
302  NbcSetSnapRect(aNewSnapRect);
303 }
304 
305 void E3dScene::NbcResize(const Point& rRef, const Fraction& rXFact,
306  const Fraction& rYFact)
307 {
308  tools::Rectangle aNewSnapRect = GetSnapRect();
309  ResizeRect(aNewSnapRect, rRef, rXFact, rYFact);
310  NbcSetSnapRect(aNewSnapRect);
311 }
312 
313 // Set new camera, and thus mark the scene and if possible the bound volume
314 // as changed
315 
316 void E3dScene::SetCamera(const Camera3D& rNewCamera)
317 {
318  aCamera = rNewCamera;
319  static_cast<sdr::properties::E3dSceneProperties&>(GetProperties()).SetSceneItemsFromCamera();
320 
321  SetRectsDirty();
322 
323  // Turn off ratio
324  GetCameraSet().SetRatio(0.0);
325 
326  // Set Imaging geometry
328  basegfx::B3DVector aVPN(aVRP - aCamera.GetVRP());
330 
331  // use SetViewportValues() to set VRP, VPN and VUV as vectors, too.
332  // Else these values would not be exported/imported correctly.
333  GetCameraSet().SetViewportValues(aVRP, aVPN, aVUV);
334 
335  // Set perspective
337  GetCameraSet().SetViewportRectangle(aCamera.GetDeviceWindow());
338 
340 }
341 
342 // Inform parent of changes of a child
343 
345 {
347 
349 
350  if(nullptr != pScene && !pScene->mbSkipSettingDirty)
351  {
352  SetRectsDirty();
353  }
354 
356 }
357 
358 // Determine the overall scene object
359 
361 {
363 
364  if(nullptr != pParent)
365  {
366  return pParent->getRootE3dSceneFromE3dObject();
367  }
368 
369  return const_cast< E3dScene* >(this);
370 }
371 
373 {
374  E3DModifySceneSnapRectUpdater aUpdater(this);
375 
376  for(size_t a = 0; a < GetObjCount(); ++a)
377  {
378  SdrObject* pObj = GetObj(a);
379 
380  if(pObj)
381  {
382  bool bRemoveObject(false);
383 
384  if(auto pScene = dynamic_cast<E3dScene*>(pObj))
385  {
386  // iterate over this sub-scene
387  pScene->removeAllNonSelectedObjects();
388 
389  // check object count. Empty scenes can be deleted
390  const size_t nObjCount(pScene->GetSubList() ? pScene->GetSubList()->GetObjCount() : 0);
391 
392  if(!nObjCount)
393  {
394  // all objects removed, scene can be removed, too
395  bRemoveObject = true;
396  }
397  }
398  else if(auto pCompound = dynamic_cast<E3dCompoundObject*>(pObj))
399  {
400  if(!pCompound->GetSelected())
401  {
402  bRemoveObject = true;
403  }
404  }
405 
406  if(bRemoveObject)
407  {
408  NbcRemoveObject(pObj->GetOrdNum());
409  a--;
410  SdrObject::Free(pObj);
411  }
412  }
413  }
414 }
415 
417 {
418  return CloneHelper< E3dScene >(rTargetModel);
419 }
420 
422 {
423  if(this != &rSource)
424  {
425  // call parent
426  E3dObject::operator=(rSource);
427 
428  // copy child SdrObjects
429  if (rSource.GetSubList())
430  {
431  CopyObjects(*rSource.GetSubList());
432 
433  // tdf#116979: needed here, we need bSnapRectDirty to be true
434  // which it is after using SdrObject::operator= (see above),
435  // but set to false again using CopyObjects
436  SetRectsDirty();
437  }
438 
439  // copy local data
440  aCamera = rSource.aCamera;
441  aCameraSet = rSource.aCameraSet;
442  static_cast<sdr::properties::E3dSceneProperties&>(GetProperties()).SetSceneItemsFromCamera();
444  RebuildLists();
447  }
448 
449  return *this;
450 }
451 
453 {
455 
456  if(nullptr != pScene)
457  {
458  pScene->mbSkipSettingDirty = true;
459  }
460 }
461 
463 {
465 
466  if(nullptr != pScene)
467  {
468  pScene->mbSkipSettingDirty = false;
469  }
470 }
471 
473 {
475 
476  if(nullptr != pScene)
477  {
478  pScene->SetRectsDirty();
479  }
480 }
481 
482 // Rebuild Light- and label- object lists rebuild (after loading, allocation)
483 
485 {
486  // first delete
487  const SdrLayerID nCurrLayerID(GetLayer());
489 
490  // then examine all the objects in the scene
491  while(a3DIterator.IsMore())
492  {
493  E3dObject* p3DObj(static_cast< E3dObject* >(a3DIterator.Next()));
494  p3DObj->NbcSetLayer(nCurrLayerID);
495  }
496 
498 }
499 
501 {
502  return new E3DSceneGeoData;
503 }
504 
506 {
507  E3dObject::SaveGeoData (rGeo);
508 
509  static_cast<E3DSceneGeoData &>(rGeo).aCamera = aCamera;
510 }
511 
513 {
514  // #i94832# removed E3DModifySceneSnapRectUpdater here.
515  // It should not be needed, is already part of E3dObject::RestGeoData
516  E3dObject::RestGeoData (rGeo);
517  SetCamera (static_cast<const E3DSceneGeoData &>(rGeo).aCamera);
518 }
519 
520 // Something was changed in the style sheet, so change scene
521 
522 void E3dScene::Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
523 {
524  SetRectsDirty();
525  E3dObject::Notify(rBC, rHint);
526 }
527 
528 void E3dScene::RotateScene (const Point& rRef, double sn, double cs)
529 {
530  Point UpperLeft, LowerRight, Center, NewCenter;
531 
532  UpperLeft = aOutRect.TopLeft();
533  LowerRight = aOutRect.BottomRight();
534 
535  tools::Long dxOutRectHalf = std::abs(UpperLeft.X() - LowerRight.X());
536  dxOutRectHalf /= 2;
537  tools::Long dyOutRectHalf = std::abs(UpperLeft.Y() - LowerRight.Y());
538  dyOutRectHalf /= 2;
539 
540  // Only the center is moved. The corners are moved by NbcMove. For the
541  // rotation a cartesian coordinate system is used in which the pivot
542  // point is the origin, and the y-axis increases upward, the X-axis to
543  // the right. This must be especially noted for the Y-values.
544  // (When considering a flat piece of paper the Y-axis pointing downwards
545  Center.setX( (UpperLeft.X() + dxOutRectHalf) - rRef.X() );
546  Center.setY( -((UpperLeft.Y() + dyOutRectHalf) - rRef.Y()) );
547  // A few special cases has to be dealt with first (n * 90 degrees n integer)
548  if (sn==1.0 && cs==0.0) { // 90deg
549  NewCenter.setX( -Center.Y() );
550  NewCenter.setY( -Center.X() );
551  } else if (sn==0.0 && cs==-1.0) { // 180deg
552  NewCenter.setX( -Center.X() );
553  NewCenter.setY( -Center.Y() );
554  } else if (sn==-1.0 && cs==0.0) { // 270deg
555  NewCenter.setX( Center.Y() );
556  NewCenter.setY( -Center.X() );
557  }
558  else // Here it is rotated to any angle in the mathematically
559  // positive direction!
560  { // xnew = x * cos(alpha) - y * sin(alpha)
561  // ynew = x * sin(alpha) + y * cos(alpha)
562  // Bottom Right is not rotated: the pages of aOutRect must
563  // remain parallel to the coordinate axes.
564  NewCenter.setX( static_cast<tools::Long>(Center.X() * cs - Center.Y() * sn) );
565  NewCenter.setY( static_cast<tools::Long>(Center.X() * sn + Center.Y() * cs) );
566  }
567 
568  Size Differenz;
569  Point DiffPoint = NewCenter - Center;
570  Differenz.setWidth( DiffPoint.X() );
571  Differenz.setHeight( -DiffPoint.Y() ); // Note that the Y-axis is counted ad positive downward.
572  NbcMove (Differenz); // Actually executes the coordinate transformation.
573 }
574 
576 {
577  OUStringBuffer sName(SvxResId(STR_ObjNameSingulScene3d));
578 
579  OUString aName(GetName());
580  if (!aName.isEmpty())
581  {
582  sName.append(' ');
583  sName.append('\'');
584  sName.append(aName);
585  sName.append('\'');
586  }
587  return sName.makeStringAndClear();
588 }
589 
591 {
592  return SvxResId(STR_ObjNamePluralScene3d);
593 }
594 
595 // The NbcRotate routine overrides the one of the SdrObject. The idea is
596 // to be able to rotate the scene relative to the position of the scene
597 // and then the objects in the scene
598 
600 {
601  if(maTransformation != rMatrix)
602  {
603  // call parent
605  }
606 }
607 
609 {
610  if(rMatrix != maTransformation)
611  {
612  // call parent
613  E3dObject::SetTransform(rMatrix);
614  }
615 }
616 
617 void E3dScene::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
618 {
619  // So currently the glue points are defined relative to the scene aOutRect.
620  // Before turning the glue points are defined relative to the page. They
621  // take no part in the rotation of the scene. To ensure this, there is the
622  // SetGlueReallyAbsolute(sal_True);
623 
624  // So that was the scene, now the objects used in the scene
625  // 3D objects, if there is only one it can still have multiple surfaces but
626  // the surfaces do not have to be connected. This allows you to access child
627  // objects. So going through the entire list and rotate around the Z axis
628  // through the enter of aOutRect's (Steiner's theorem), so RotateZ
629 
630  RotateScene (rRef, sn, cs); // Rotates the scene
631  double fAngleInRad = toRadians(nAngle);
632 
633  basegfx::B3DHomMatrix aRotation;
634  aRotation.rotate(0.0, 0.0, fAngleInRad);
635  NbcSetTransform(aRotation * GetTransform());
636 
637  SetRectsDirty(); // This forces a recalculation of all BoundRects
638  NbcRotateGluePoints(rRef,nAngle,sn,cs); // Rotate the glue points (who still
639  // have coordinates relative to the
640  // original page)
641  SetGlueReallyAbsolute(false); // from now they are again relative to BoundRect (that is defined as aOutRect)
642  SetRectsDirty();
643 }
644 
646 {
648 
649  if(pScene == this)
650  {
651  // The Scene is used as a 2D-Object, take the SnapRect from the
652  // 2D Display settings
653  maSnapRect = pScene->aCamera.GetDeviceWindow();
654  }
655  else
656  {
657  // The Scene itself is a member of another scene, get the SnapRect
658  // as a composite object
659  // call parent
661 
662  for(size_t a = 0; a < GetObjCount(); ++a)
663  {
664  E3dObject* pCandidate(dynamic_cast< E3dObject* >(GetObj(a)));
665 
666  if(pCandidate)
667  {
668  maSnapRect.Union(pCandidate->GetSnapRect());
669  }
670  }
671  }
672 }
673 
675 {
676  // Break scene, if all members are able to break
678 
679  while ( a3DIterator.IsMore() )
680  {
681  E3dObject* pObj = static_cast<E3dObject*>(a3DIterator.Next());
682  DBG_ASSERT(dynamic_cast< const E3dObject*>(pObj), "only 3D objects are allowed in scenes!");
683  if(!pObj->IsBreakObjPossible())
684  return false;
685  }
686 
687  return true;
688 }
689 
691 {
692  return TakeXorPoly();
693 }
694 
696 {
697  rStat.SetOrtho4Possible();
698  tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
699  aRect1.Justify();
700  rStat.SetActionRect(aRect1);
701  NbcSetSnapRect(aRect1);
702  return true;
703 }
704 
706 {
707  tools::Rectangle aRect1;
708  rStat.TakeCreateRect(aRect1);
709  aRect1.Justify();
710  rStat.SetActionRect(aRect1);
711  NbcSetSnapRect(aRect1);
713  bSnapRectDirty=true;
714  return true;
715 }
716 
718 {
719  tools::Rectangle aRect1;
720  rStat.TakeCreateRect(aRect1);
721  aRect1.Justify();
722  NbcSetSnapRect(aRect1);
723  SetRectsDirty();
724  return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
725 }
726 
728 {
729  return false;
730 }
731 
733 {
734 }
735 
736 void E3dScene::SetSelected(bool bNew)
737 {
738  // call parent
740 
741  for(size_t a(0); a < GetObjCount(); a++)
742  {
743  E3dObject* pCandidate(dynamic_cast< E3dObject* >(GetObj(a)));
744 
745  if(pCandidate)
746  {
747  pCandidate->SetSelected(bNew);
748  }
749  }
750 }
751 
752 void E3dScene::NbcInsertObject(SdrObject* pObj, size_t nPos)
753 {
754  // Is it even a 3D object?
755  if(nullptr != dynamic_cast< const E3dObject* >(pObj))
756  {
757  // Normal 3D object, insert means call parent
758  SdrObjList::NbcInsertObject(pObj, nPos);
759 
760  // local needed stuff
763  }
764  else
765  {
766  // No 3D object, inserted a page in place in a scene ...
768  }
769 }
770 
771 void E3dScene::InsertObject(SdrObject* pObj, size_t nPos)
772 {
773  // Is it even a 3D object?
774  if(nullptr != dynamic_cast< const E3dObject* >(pObj))
775  {
776  // call parent
777  SdrObjList::InsertObject(pObj, nPos);
778 
779  // local needed stuff
782  }
783  else
784  {
785  // No 3D object, inserted a page in place in a scene ...
787  }
788 }
789 
791 {
792  // call parent
793  SdrObject* pRetval = SdrObjList::NbcRemoveObject(nObjNum);
794 
797 
798  return pRetval;
799 }
800 
802 {
803  // call parent
804  SdrObject* pRetval(SdrObjList::RemoveObject(nObjNum));
805 
808 
809  return pRetval;
810 }
811 
812 void E3dScene::SetRectsDirty(bool bNotMyself, bool bRecursive)
813 {
814  // call parent
815  E3dObject::SetRectsDirty(bNotMyself, bRecursive);
816 
817  for(size_t a = 0; a < GetObjCount(); ++a)
818  {
819  E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
820 
821  if(pCandidate)
822  {
823  pCandidate->SetRectsDirty(bNotMyself, false);
824  }
825  }
826 }
827 
829 {
830  // call parent
831  E3dObject::NbcSetLayer(nLayer);
832 
833  for(size_t a = 0; a < GetObjCount(); ++a)
834  {
835  E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
836 
837  if(pCandidate)
838  {
839  pCandidate->NbcSetLayer(nLayer);
840  }
841  }
842 }
843 
844 void E3dScene::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
845 {
846  if(pOldPage == pNewPage)
847  return;
848 
849  // call parent
850  E3dObject::handlePageChange(pOldPage, pNewPage);
851 
852  for(size_t a(0); a < GetObjCount(); a++)
853  {
854  E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
855 
856  if(pCandidate)
857  {
858  pCandidate->handlePageChange(pOldPage, pNewPage);
859  }
860  else
861  {
862  OSL_ENSURE(false, "E3dScene::handlePageChange invalid object list (!)");
863  }
864  }
865 }
866 
868 {
869  return const_cast< E3dScene* >(this);
870 }
871 
873 {
874  basegfx::B3DRange aRetval;
875  const size_t nObjCnt(GetObjCount());
876 
877  for(size_t a = 0; a < nObjCnt; ++a)
878  {
879  const E3dObject* p3DObject = dynamic_cast< const E3dObject* >(GetObj(a));
880 
881  if(p3DObject)
882  {
883  basegfx::B3DRange aLocalRange(p3DObject->GetBoundVolume());
884  aLocalRange.transform(p3DObject->GetTransform());
885  aRetval.expand(aLocalRange);
886  }
887  }
888 
889  return aRetval;
890 }
891 
893 {
894  // call parent
896 
897  for(size_t a = 0; a < GetObjCount(); ++a)
898  {
899  E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
900 
901  if(pCandidate)
902  {
903  pCandidate->SetTransformChanged();
904  }
905  }
906 }
907 
908 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Point TopLeft() const
virtual OUString TakeObjNameSingul() const override
Definition: scene3d.cxx:575
virtual SdrObject * RemoveObject(size_t nObjNum) override
Definition: scene3d.cxx:801
const tools::Rectangle & GetDeviceWindow() const
Definition: viewpt3d.hxx:87
void SetDeviceWindow(const tools::Rectangle &rRect)
Definition: viewpt3d2.cxx:113
virtual void SetBoundRectDirty() override
Definition: scene3d.cxx:272
void SuspendReportingDirtyRects()
Definition: scene3d.cxx:452
ProjectionType GetProjection() const
Definition: viewpt3d.hxx:82
virtual SdrObjKind GetObjIdentifier() const override
Definition: scene3d.cxx:267
void setWidth(tools::Long nWidth)
virtual void SetTransformChanged()
Definition: obj3d.cxx:306
virtual void StructureChanged() override
Definition: scene3d.cxx:344
void SetViewWindow(double fX, double fY, double fW, double fH)
Definition: camera3d.cxx:41
virtual void NbcSetLayer(SdrLayerID nLayer) override
Definition: scene3d.cxx:828
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
Definition: svdobj.cxx:449
const Point & GetStart() const
Definition: svddrag.hxx:92
virtual void SetTransformChanged() override
Definition: scene3d.cxx:892
double getMinimalDepthInViewCoordinates(const E3dCompoundObject &rObject)
support extracting the minimal depth of a 3d object in its scene
virtual SdrObjList * getChildrenOfSdrObject() const override
Definition: scene3d.cxx:224
Camera3D aCamera
Definition: scene3d.hxx:65
std::vector< ImpRemap3DDepth > maVector
Definition: scene3d.cxx:102
long Long
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:292
virtual OUString TakeObjNamePlural() const override
Definition: scene3d.cxx:590
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: obj3d.cxx:415
E3dScene & operator=(const E3dScene &)
Definition: scene3d.cxx:421
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:758
size_t GetObjCount() const
Definition: svdpage.cxx:752
virtual void SetBoundRectDirty()
Definition: svdobj.cxx:310
B3dCamera aCameraSet
Definition: scene3d.hxx:64
void SetGlueReallyAbsolute(bool bOn)
Definition: svdobj.cxx:2228
bool mbSkipSettingDirty
Definition: scene3d.hxx:72
void CopyObjects(const SdrObjList &rSrcList)
Definition: svdpage.cxx:143
const drawinglayer::geometry::ViewInformation3D & getViewInformation3D(const ::basegfx::B3DRange &rContentRange) const
double toRadians(Degree10 x)
B2DPolyPolygon createB2DPolyPolygonFromB3DPolyPolygon(const B3DPolyPolygon &rCandidate, const B3DHomMatrix &rMat)
virtual bool IsBreakObjPossible() override
Definition: scene3d.cxx:674
const basegfx::B3DHomMatrix & GetTransform() const
Definition: obj3d.hxx:111
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:396
virtual void RestGeoData(const SdrObjGeoData &rGeo) override
Definition: scene3d.cxx:512
virtual SdrObjList * GetSubList() const override
Definition: scene3d.cxx:867
virtual sdr::properties::BaseProperties & GetProperties() const
Definition: svdobj.cxx:204
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:343
virtual const tools::Rectangle & GetSnapRect() const override
Definition: svdoattr.cxx:44
Center
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:175
virtual bool BckCreate(SdrDragStat &rStat) override
Definition: scene3d.cxx:727
SdrObjKind
Definition: svdobjkind.hxx:24
double GetDistance() const
Definition: scene3d.hxx:107
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:245
void SetAllSceneRectsDirty()
Definition: scene3d.cxx:472
ProjectionType GetPerspective() const
Definition: scene3d.hxx:103
bool bSnapRectDirty
Definition: svdobj.hxx:882
basegfx::B3DHomMatrix maTransformation
Definition: obj3d.hxx:72
virtual SdrObject * getSdrObjectFromSdrObjList() const override
Definition: scene3d.cxx:219
std::unique_ptr< Imp3DDepthRemapper > mp3DDepthRemapper
Definition: scene3d.hxx:67
bool IsMore() const
Definition: svditer.hxx:62
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:263
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:25
virtual void StructureChanged()
Definition: obj3d.cxx:237
virtual void NbcSetTransform(const basegfx::B3DHomMatrix &rMatrix) override
Definition: scene3d.cxx:599
virtual bool IsBreakObjPossible()
Definition: obj3d.cxx:76
void SetCamera(const Camera3D &rNewCamera)
Definition: scene3d.cxx:316
void ImpCleanup3DDepthMapper()
Definition: scene3d.cxx:242
double GetFocalLength() const
Definition: scene3d.hxx:111
void SetOrtho4Possible(bool bOn=true)
Definition: svddrag.hxx:126
void removeAllNonSelectedObjects()
Definition: scene3d.cxx:372
void SetDefaultAttributes()
Definition: scene3d.cxx:181
void TakeCreateRect(tools::Rectangle &rRect) const
Definition: svddrag.cxx:115
virtual void SetSelected(bool bNew) override
Definition: scene3d.cxx:736
tools::Rectangle maSnapRect
Definition: svdoattr.hxx:42
virtual void NbcResize(const Point &rRef, const Fraction &rXFact, const Fraction &rYFact) override
Definition: scene3d.cxx:305
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
Definition: scene3d.cxx:717
virtual void NbcSetTransform(const basegfx::B3DHomMatrix &rMatrix)
Definition: obj3d.cxx:333
void RotateScene(const Point &rRef, double sn, double cs)
Definition: scene3d.cxx:528
const basegfx::B3DPoint & GetViewPoint()
Definition: viewpt3d2.cxx:50
Point BottomRight() const
E3dScene(SdrModel &rSdrModel)
Definition: scene3d.cxx:170
void ResizeRect(tools::Rectangle &rRect, const Point &rRef, const Fraction &rxFact, const Fraction &ryFact)
Definition: svdtrans.cxx:37
E3dScene * getParentE3dSceneFromE3dObject() const
Definition: obj3d.cxx:248
sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const
Definition: scene3d.cxx:247
virtual E3dScene * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: scene3d.cxx:416
#define DBG_ASSERT(sCon, aError)
uno_Any a
OUString sName
tools::Rectangle aOutRect
Definition: svdobj.hxx:875
virtual ~E3dScene() override
Definition: scene3d.cxx:209
void expand(const B3DTuple &rTuple)
sal_Int32 GetPointCount() const
Definition: svddrag.hxx:91
void SetFocalLength(double fLen)
Definition: camera3d.cxx:172
void transform(const basegfx::B2DHomMatrix &rMatrix)
sal_uInt32 GetOrdNum() const
The order number (aka ZOrder, aka z-index) determines whether a SdrObject is located above or below a...
Definition: svdobj.cxx:799
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: scene3d.cxx:844
virtual void NbcMove(const Size &rSize) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: scene3d.cxx:298
const basegfx::B3DRange & GetBoundVolume() const
Definition: obj3d.cxx:290
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: scene3d.cxx:505
virtual SdrObject * NbcRemoveObject(size_t nObjNum)
remove from list without delete
Definition: svdpage.cxx:382
Abstract DrawObject.
Definition: svdobj.hxx:261
virtual void ActionChanged()
virtual basegfx::B3DRange RecalcBoundVolume() const override
Definition: scene3d.cxx:872
virtual SdrObject * RemoveObject(size_t nObjNum)
Definition: svdpage.cxx:421
OUString GetName() const
Definition: svdobj.cxx:701
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true) override
Definition: scene3d.cxx:812
virtual void RestGeoData(const SdrObjGeoData &rGeo) override
Definition: obj3d.cxx:423
BASEGFX_DLLPUBLIC void transform(const B3DHomMatrix &rMatrix)
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:577
virtual SdrObject * NbcRemoveObject(size_t nObjNum) override
remove from list without delete
Definition: scene3d.cxx:790
Imp3DDepthRemapper(E3dScene const &rScene)
Definition: scene3d.cxx:110
virtual void SetTransform(const basegfx::B3DHomMatrix &rMatrix)
Definition: obj3d.cxx:344
SdrObject * Next()
Definition: svditer.hxx:63
virtual void SetTransform(const basegfx::B3DHomMatrix &rMatrix) override
Definition: scene3d.cxx:608
void SetActionRect(const tools::Rectangle &rR)
Definition: svddrag.hxx:157
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
Definition: scene3d.cxx:695
const basegfx::B3DPoint & GetPosition() const
Definition: camera3d.hxx:51
const basegfx::B2DHomMatrix & getObjectTransformation() const
bool operator<(const Subset &rLHS, const Subset &rRHS)
Definition: ucsubset.hxx:49
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1615
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE) override
Definition: scene3d.cxx:771
tools::Rectangle & Union(const tools::Rectangle &rRect)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: svdoattr.cxx:56
void RebuildLists()
Definition: scene3d.cxx:484
const basegfx::B3DPoint & GetVRP() const
Definition: viewpt3d.hxx:77
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: scene3d.cxx:645
virtual SdrPage * getSdrPageFromSdrObjList() const override
Definition: scene3d.cxx:214
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
Definition: scene3d.cxx:617
void SetProjection(ProjectionType ePrj)
Definition: viewpt3d.hxx:80
OUString aName
virtual bool MovCreate(SdrDragStat &rStat) override
Definition: scene3d.cxx:705
E3dObject & operator=(const E3dObject &rObj)
Definition: obj3d.cxx:388
const Point & GetNow() const
Definition: svddrag.hxx:95
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:435
void setHeight(tools::Long nHeight)
Helper for 3d object changes affecting 2d geometry.
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: scene3d.cxx:522
sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const
Definition: scene3d.cxx:143
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: scene3d.cxx:156
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
virtual void BrkCreate(SdrDragStat &rStat) override
Definition: scene3d.cxx:732
void rotate(double fAngleX, double fAngleY, double fAngleZ)
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:365
virtual void SetSelected(bool bNew)
Definition: obj3d.cxx:67
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE) override
Definition: scene3d.cxx:752
double mfMinimalDepth
SdrCreateCmd
Definition: svdtypes.hxx:27
void SetPosition(const basegfx::B3DPoint &rNewPos)
Definition: camera3d.cxx:48
const basegfx::B3DVector & GetVUV() const
Definition: viewpt3d.hxx:78
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: scene3d.cxx:164
basegfx::B3DPolyPolygon CreateWireframe() const
Definition: obj3d.cxx:355
virtual E3dScene * getRootE3dSceneFromE3dObject() const override
Definition: scene3d.cxx:360
void InvalidateBoundVolume()
Definition: obj3d.cxx:300
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: obj3d.cxx:230
B3dCamera & GetCameraSet()
Definition: scene3d.hxx:148
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: scene3d.cxx:229
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
Definition: scene3d.cxx:288
void ResumeReportingDirtyRects()
Definition: scene3d.cxx:462
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
Definition: scene3d.cxx:690
void NbcRotateGluePoints(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:2238
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:594
virtual SdrObjGeoData * NewGeoData() const override
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...
Definition: scene3d.cxx:500