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 
40 namespace {
41 
42 class ImpRemap3DDepth
43 {
44  sal_uInt32 mnOrdNum;
45  double mfMinimalDepth;
46 
47  // bit field
48  bool mbIsScene : 1;
49 
50 public:
51  ImpRemap3DDepth(sal_uInt32 nOrdNum, double fMinimalDepth);
52  explicit ImpRemap3DDepth(sal_uInt32 nOrdNum);
53 
54  // for ::std::sort
55  bool operator<(const ImpRemap3DDepth& rComp) const;
56 
57  sal_uInt32 GetOrdNum() const { return mnOrdNum; }
58  bool IsScene() const { return mbIsScene; }
59 };
60 
61 }
62 
63 ImpRemap3DDepth::ImpRemap3DDepth(sal_uInt32 nOrdNum, double fMinimalDepth)
64 : mnOrdNum(nOrdNum),
65  mfMinimalDepth(fMinimalDepth),
66  mbIsScene(false)
67 {
68 }
69 
70 ImpRemap3DDepth::ImpRemap3DDepth(sal_uInt32 nOrdNum)
71 : mnOrdNum(nOrdNum),
72  mfMinimalDepth(0.0),
73  mbIsScene(true)
74 {
75 }
76 
77 bool ImpRemap3DDepth::operator<(const ImpRemap3DDepth& rComp) const
78 {
79  if(IsScene())
80  {
81  return false;
82  }
83  else
84  {
85  if(rComp.IsScene())
86  {
87  return true;
88  }
89  else
90  {
91  return mfMinimalDepth < rComp.mfMinimalDepth;
92  }
93  }
94 }
95 
97 {
98  std::vector< ImpRemap3DDepth > maVector;
99 
100 public:
101  explicit Imp3DDepthRemapper(E3dScene const & rScene);
102 
103  sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const;
104 };
105 
107 {
108  // only called when rScene.GetSubList() and nObjCount > 1
109  SdrObjList* pList = rScene.GetSubList();
110  const size_t nObjCount(pList->GetObjCount());
111 
112  for(size_t a = 0; a < nObjCount; ++a)
113  {
114  SdrObject* pCandidate = pList->GetObj(a);
115 
116  if(pCandidate)
117  {
118  if(dynamic_cast< const E3dCompoundObject*>(pCandidate))
119  {
120  // single 3d object, calc depth
121  const double fMinimalDepth(getMinimalDepthInViewCoordinates(static_cast< const E3dCompoundObject& >(*pCandidate)));
122  ImpRemap3DDepth aEntry(a, fMinimalDepth);
123  maVector.push_back(aEntry);
124  }
125  else
126  {
127  // scene, use standard entry for scene
128  ImpRemap3DDepth aEntry(a);
129  maVector.push_back(aEntry);
130  }
131  }
132  }
133 
134  // now, we need to sort the maVector by its members minimal depth. The
135  // smaller, the nearer to the viewer.
136  ::std::sort(maVector.begin(), maVector.end());
137 }
138 
139 sal_uInt32 Imp3DDepthRemapper::RemapOrdNum(sal_uInt32 nOrdNum) const
140 {
141  if(nOrdNum < maVector.size())
142  {
143  nOrdNum = maVector[(maVector.size() - 1) - nOrdNum].GetOrdNum();
144  }
145 
146  return nOrdNum;
147 }
148 
149 
150 // BaseProperties section
151 
152 std::unique_ptr<sdr::properties::BaseProperties> E3dScene::CreateObjectSpecificProperties()
153 {
154  return std::make_unique<sdr::properties::E3dSceneProperties>(*this);
155 }
156 
157 
158 // DrawContact section
159 
160 std::unique_ptr<sdr::contact::ViewContact> E3dScene::CreateObjectSpecificViewContact()
161 {
162  return std::make_unique<sdr::contact::ViewContactOfE3dScene>(*this);
163 }
164 
165 
167 : E3dObject(rSdrModel),
168  SdrObjList(),
169  aCamera(basegfx::B3DPoint(0.0, 0.0, 4.0), basegfx::B3DPoint()),
170  bDrawOnlySelected(false),
171  mbSkipSettingDirty(false)
172 {
173  // Set defaults
175 }
176 
178 {
179  // For WIN95/NT turn off the FP-Exceptions
180 #if defined(_WIN32)
181  _control87( _MCW_EM, _MCW_EM );
182 #endif
183 
184  // Set defaults
185  aCamera.SetViewWindow(-2, -2, 4, 4);
186  aCameraSet.SetDeviceRectangle(-2, 2, -2, 2);
188  tools::Rectangle aRect(0, 0, 10, 10);
190 
191  // set defaults for Camera from ItemPool
193  basegfx::B3DPoint aActualPosition(aCamera.GetPosition());
194  double fNew = GetDistance();
195 
196  if(fabs(fNew - aActualPosition.getZ()) > 1.0)
197  {
198  aCamera.SetPosition( basegfx::B3DPoint( aActualPosition.getX(), aActualPosition.getY(), fNew) );
199  }
200 
201  fNew = GetFocalLength() / 100.0;
202  aCamera.SetFocalLength(fNew);
203 }
204 
206 {
208 }
209 
211 {
212  return getSdrPageFromSdrObject();
213 }
214 
216 {
217  return const_cast< E3dScene* >(this);
218 }
219 
221 {
222  return const_cast< E3dScene* >(this);
223 }
224 
226 {
229  const basegfx::B3DPolyPolygon aCubePolyPolygon(CreateWireframe());
230 
232  aViewInfo3D.getObjectToView()));
233  aRetval.transform(rVCScene.getObjectTransformation());
234 
235  return aRetval;
236 }
237 
239 {
240  mp3DDepthRemapper.reset();
241 }
242 
243 sal_uInt32 E3dScene::RemapOrdNum(sal_uInt32 nNewOrdNum) const
244 {
245  if(!mp3DDepthRemapper)
246  {
247  const size_t nObjCount(GetSubList() ? GetSubList()->GetObjCount() : 0);
248 
249  if(nObjCount > 1)
250  {
251  mp3DDepthRemapper.reset(new Imp3DDepthRemapper(*this));
252  }
253  }
254 
256  {
257  return mp3DDepthRemapper->RemapOrdNum(nNewOrdNum);
258  }
259 
260  return nNewOrdNum;
261 }
262 
263 sal_uInt16 E3dScene::GetObjIdentifier() const
264 {
265  return E3D_SCENE_ID;
266 }
267 
269 {
271 
272  if(pScene == this)
273  {
274  // avoid resetting aOutRect which in case of a 3D scene used as 2d object
275  // is model data,not re-creatable view data
276  }
277  else
278  {
279  // if not the outmost scene it is used as group in 3d, call parent
281  }
282 }
283 
285 {
286  SetRectsDirty();
288  aCamera.SetDeviceWindow(rRect);
290 
292 }
293 
294 void E3dScene::NbcMove(const Size& rSize)
295 {
296  tools::Rectangle aNewSnapRect = GetSnapRect();
297  aNewSnapRect.Move(rSize);
298  NbcSetSnapRect(aNewSnapRect);
299 }
300 
301 void E3dScene::NbcResize(const Point& rRef, const Fraction& rXFact,
302  const Fraction& rYFact)
303 {
304  tools::Rectangle aNewSnapRect = GetSnapRect();
305  ResizeRect(aNewSnapRect, rRef, rXFact, rYFact);
306  NbcSetSnapRect(aNewSnapRect);
307 }
308 
309 // Set new camera, and thus mark the scene and if possible the bound volume
310 // as changed
311 
312 void E3dScene::SetCamera(const Camera3D& rNewCamera)
313 {
314  aCamera = rNewCamera;
315  static_cast<sdr::properties::E3dSceneProperties&>(GetProperties()).SetSceneItemsFromCamera();
316 
317  SetRectsDirty();
318 
319  // Turn off ratio
320  GetCameraSet().SetRatio(0.0);
321 
322  // Set Imaging geometry
324  basegfx::B3DVector aVPN(aVRP - aCamera.GetVRP());
326 
327  // use SetViewportValues() to set VRP, VPN and VUV as vectors, too.
328  // Else these values would not be exported/imported correctly.
329  GetCameraSet().SetViewportValues(aVRP, aVPN, aVUV);
330 
331  // Set perspective
334 
336 }
337 
338 // Inform parent of changes of a child
339 
341 {
343 
345 
346  if(nullptr != pScene && !pScene->mbSkipSettingDirty)
347  {
348  SetRectsDirty();
349  }
350 
352 }
353 
354 // Determine the overall scene object
355 
357 {
359 
360  if(nullptr != pParent)
361  {
362  return pParent->getRootE3dSceneFromE3dObject();
363  }
364 
365  return const_cast< E3dScene* >(this);
366 }
367 
369 {
370  E3DModifySceneSnapRectUpdater aUpdater(this);
371 
372  for(size_t a = 0; a < GetObjCount(); ++a)
373  {
374  SdrObject* pObj = GetObj(a);
375 
376  if(pObj)
377  {
378  bool bRemoveObject(false);
379 
380  if(dynamic_cast< const E3dScene*>(pObj))
381  {
382  E3dScene* pScene = static_cast<E3dScene*>(pObj);
383 
384  // iterate over this sub-scene
385  pScene->removeAllNonSelectedObjects();
386 
387  // check object count. Empty scenes can be deleted
388  const size_t nObjCount(pScene->GetSubList() ? pScene->GetSubList()->GetObjCount() : 0);
389 
390  if(!nObjCount)
391  {
392  // all objects removed, scene can be removed, too
393  bRemoveObject = true;
394  }
395  }
396  else if(dynamic_cast< const E3dCompoundObject*>(pObj))
397  {
398  E3dCompoundObject* pCompound = static_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  long dxOutRectHalf = labs(UpperLeft.X() - LowerRight.X());
536  dxOutRectHalf /= 2;
537  long dyOutRectHalf = labs(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<long>(Center.X() * cs - Center.Y() * sn) );
565  NewCenter.setY( static_cast<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, long 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 = basegfx::deg2rad(nAngle/100.0);
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  {
848  // call parent
849  E3dObject::handlePageChange(pOldPage, pNewPage);
850 
851  for(size_t a(0); a < GetObjCount(); a++)
852  {
853  E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
854 
855  if(pCandidate)
856  {
857  pCandidate->handlePageChange(pOldPage, pNewPage);
858  }
859  else
860  {
861  OSL_ENSURE(false, "E3dScene::handlePageChange invalid object list (!)");
862  }
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
void SetViewportRectangle(tools::Rectangle const &rRect, tools::Rectangle const &rVisible)
virtual void SetBoundRectDirty() override
Definition: scene3d.cxx:268
void SuspendReportingDirtyRects()
Definition: scene3d.cxx:452
ProjectionType GetProjection() const
Definition: viewpt3d.hxx:82
void SetPerspective(bool bNew)
virtual void SetTransformChanged()
Definition: obj3d.cxx:305
virtual void StructureChanged() override
Definition: scene3d.cxx:340
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:473
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:220
Camera3D aCamera
Definition: scene3d.hxx:65
std::vector< ImpRemap3DDepth > maVector
Definition: scene3d.cxx:98
void SetRatio(double fNew)
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:308
virtual OUString TakeObjNamePlural() const override
Definition: scene3d.cxx:590
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: obj3d.cxx:414
E3dScene & operator=(const E3dScene &)
Definition: scene3d.cxx:421
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:774
size_t GetObjCount() const
Definition: svdpage.cxx:768
virtual void SetBoundRectDirty()
Definition: svdobj.cxx:334
B3dCamera aCameraSet
Definition: scene3d.hxx:64
void SetGlueReallyAbsolute(bool bOn)
Definition: svdobj.cxx:2238
bool mbSkipSettingDirty
Definition: scene3d.hxx:72
void CopyObjects(const SdrObjList &rSrcList)
Definition: svdpage.cxx:159
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:674
const basegfx::B3DHomMatrix & GetTransform() const
Definition: obj3d.hxx:111
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:420
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:228
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:359
virtual const tools::Rectangle & GetSnapRect() const override
Definition: svdoattr.cxx:91
Center
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:226
virtual bool BckCreate(SdrDragStat &rStat) override
Definition: scene3d.cxx:727
double GetDistance() const
Definition: scene3d.hxx:107
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:269
void SetAllSceneRectsDirty()
Definition: scene3d.cxx:472
ProjectionType GetPerspective() const
Definition: scene3d.hxx:103
void Move(long nHorzMoveDelta, long nVertMoveDelta)
bool bSnapRectDirty
Definition: svdobj.hxx:928
basegfx::B3DHomMatrix maTransformation
Definition: obj3d.hxx:72
virtual sal_uInt16 GetObjIdentifier() const override
Definition: scene3d.cxx:263
virtual SdrObject * getSdrObjectFromSdrObjList() const override
Definition: scene3d.cxx:215
std::unique_ptr< Imp3DDepthRemapper > mp3DDepthRemapper
Definition: scene3d.hxx:67
bool IsMore() const
Definition: svditer.hxx:62
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:287
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
virtual void StructureChanged()
Definition: obj3d.cxx:236
void setX(long nX)
virtual void NbcSetTransform(const basegfx::B3DHomMatrix &rMatrix) override
Definition: scene3d.cxx:599
virtual bool IsBreakObjPossible()
Definition: obj3d.cxx:75
void SetCamera(const Camera3D &rNewCamera)
Definition: scene3d.cxx:312
void ImpCleanup3DDepthMapper()
Definition: scene3d.cxx:238
double GetFocalLength() const
Definition: scene3d.hxx:111
void SetOrtho4Possible(bool bOn=true)
Definition: svddrag.hxx:126
void removeAllNonSelectedObjects()
Definition: scene3d.cxx:368
void SetDefaultAttributes()
Definition: scene3d.cxx:177
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:736
tools::Rectangle maSnapRect
Definition: svdoattr.hxx:42
void setY(long nY)
virtual void NbcResize(const Point &rRef, const Fraction &rXFact, const Fraction &rYFact) override
Definition: scene3d.cxx:301
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
Definition: scene3d.cxx:717
virtual void NbcSetTransform(const basegfx::B3DHomMatrix &rMatrix)
Definition: obj3d.cxx:332
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:166
void ResizeRect(tools::Rectangle &rRect, const Point &rRef, const Fraction &rxFact, const Fraction &ryFact)
Definition: svdtrans.cxx:36
E3dScene * getParentE3dSceneFromE3dObject() const
Definition: obj3d.cxx:247
bool GetSelected() const
Definition: obj3d.hxx:135
sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const
Definition: scene3d.cxx:243
virtual E3dScene * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: scene3d.cxx:416
#define DBG_ASSERT(sCon, aError)
uno_Any a
void SetViewportValues(const basegfx::B3DPoint &rNewVRP, const basegfx::B3DVector &rNewVPN, const basegfx::B3DVector &rNewVUV)
OUString sName
tools::Rectangle aOutRect
Definition: svdobj.hxx:921
virtual ~E3dScene() override
Definition: scene3d.cxx:205
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:820
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:294
constexpr double deg2rad(double v)
const basegfx::B3DRange & GetBoundVolume() const
Definition: obj3d.cxx:289
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:398
Abstract DrawObject.
Definition: svdobj.hxx:312
virtual void ActionChanged()
void NbcRotateGluePoints(const Point &rRef, long nAngle, double sn, double cs)
Definition: svdobj.cxx:2248
virtual basegfx::B3DRange RecalcBoundVolume() const override
Definition: scene3d.cxx:872
virtual SdrObject * RemoveObject(size_t nObjNum)
Definition: svdpage.cxx:437
long X() const
OUString GetName() const
Definition: svdobj.cxx:722
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true) override
Definition: scene3d.cxx:812
virtual void RestGeoData(const SdrObjGeoData &rGeo) override
Definition: obj3d.cxx:422
BASEGFX_DLLPUBLIC void transform(const B3DHomMatrix &rMatrix)
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:601
virtual SdrObject * NbcRemoveObject(size_t nObjNum) override
remove from list without delete
Definition: scene3d.cxx:790
Imp3DDepthRemapper(E3dScene const &rScene)
Definition: scene3d.cxx:106
virtual void SetTransform(const basegfx::B3DHomMatrix &rMatrix)
Definition: obj3d.cxx:343
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:1626
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:103
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:210
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:387
const Point & GetNow() const
Definition: svddrag.hxx:95
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:459
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:139
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: scene3d.cxx:152
virtual void BrkCreate(SdrDragStat &rStat) override
Definition: scene3d.cxx:732
void rotate(double fAngleX, double fAngleY, double fAngleZ)
void SetDeviceRectangle(double fL=-1.0, double fR=1.0, double fB=-1.0, double fT=1.0)
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:366
virtual void SetSelected(bool bNew)
Definition: obj3d.cxx:66
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE) override
Definition: scene3d.cxx:752
virtual void NbcRotate(const Point &rRef, long nAngle, double sn, double cs) override
Definition: scene3d.cxx:617
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:160
basegfx::B3DPolyPolygon CreateWireframe() const
Definition: obj3d.cxx:354
virtual E3dScene * getRootE3dSceneFromE3dObject() const override
Definition: scene3d.cxx:356
void InvalidateBoundVolume()
Definition: obj3d.cxx:299
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: obj3d.cxx:229
B3dCamera & GetCameraSet()
Definition: scene3d.hxx:148
long Y() const
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: scene3d.cxx:225
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
Definition: scene3d.cxx:284
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
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:618
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
void setHeight(long nHeight)