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