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