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>
36#include <algorithm>
40#include <svx/svdmodel.hxx>
41
42namespace {
43
44class ImpRemap3DDepth
45{
46 sal_uInt32 mnOrdNum;
47 double mfMinimalDepth;
48
49 // bit field
50 bool mbIsScene : 1;
51
52public:
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
65ImpRemap3DDepth::ImpRemap3DDepth(sal_uInt32 nOrdNum, double fMinimalDepth)
66: mnOrdNum(nOrdNum),
67 mfMinimalDepth(fMinimalDepth),
68 mbIsScene(false)
69{
70}
71
72ImpRemap3DDepth::ImpRemap3DDepth(sal_uInt32 nOrdNum)
73: mnOrdNum(nOrdNum),
74 mfMinimalDepth(0.0),
75 mbIsScene(true)
76{
77}
78
79bool 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
102public:
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
141sal_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
154std::unique_ptr<sdr::properties::BaseProperties> E3dScene::CreateObjectSpecificProperties()
155{
156 return std::make_unique<sdr::properties::E3dSceneProperties>(*this);
157}
158
159
160// DrawContact section
161
162std::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
178E3dScene::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;
234}
235
237{
239}
240
242{
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
274sal_uInt32 E3dScene::RemapOrdNum(sal_uInt32 nNewOrdNum) const
275{
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{
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{
321
323}
324
325void E3dScene::NbcMove(const Size& rSize)
326{
327 tools::Rectangle aNewSnapRect = GetSnapRect();
328 aNewSnapRect.Move(rSize);
329 NbcSetSnapRect(aNewSnapRect);
330}
331
332void 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
343void 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(E3dScene* pScene = DynCastE3dScene(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 }
438 }
439 }
440}
441
443{
444 return new E3dScene(rTargetModel, *this);
445}
446
448{
450
451 if(nullptr != pScene)
452 {
453 pScene->mbSkipSettingDirty = true;
454 }
455}
456
458{
460
461 if(nullptr != pScene)
462 {
463 pScene->mbSkipSettingDirty = false;
464 }
465}
466
468{
470
471 if(nullptr != pScene)
472 {
474 }
475}
476
477// Rebuild Light- and label- object lists rebuild (after loading, allocation)
478
480{
481 // first delete
482 const SdrLayerID nCurrLayerID(GetLayer());
484
485 // then examine all the objects in the scene
486 while(a3DIterator.IsMore())
487 {
488 E3dObject* p3DObj(static_cast< E3dObject* >(a3DIterator.Next()));
489 p3DObj->NbcSetLayer(nCurrLayerID);
490 }
491
493}
494
495std::unique_ptr<SdrObjGeoData> E3dScene::NewGeoData() const
496{
497 return std::make_unique<E3DSceneGeoData>();
498}
499
501{
503
504 static_cast<E3DSceneGeoData &>(rGeo).aCamera = aCamera;
505}
506
508{
509 // #i94832# removed E3DModifySceneSnapRectUpdater here.
510 // It should not be needed, is already part of E3dObject::RestoreGeoData
512 SetCamera (static_cast<const E3DSceneGeoData &>(rGeo).aCamera);
513}
514
515// Something was changed in the style sheet, so change scene
516
518{
520 E3dObject::Notify(rBC, rHint);
521}
522
523void E3dScene::RotateScene (const Point& rRef, double sn, double cs)
524{
525 Point NewCenter;
526
527 auto const& rRectangle = getOutRectangle();
528 Point Center = rRectangle.Center();
529
530 // Only the center is moved. The corners are moved by NbcMove. For the
531 // rotation a cartesian coordinate system is used in which the pivot
532 // point is the origin, and the y-axis increases upward, the X-axis to
533 // the right. This must be especially noted for the Y-values.
534 // (When considering a flat piece of paper the Y-axis pointing downwards
535 Center.setX(Center.X() - rRef.X());
536 Center.setY(rRef.Y() - Center.Y());
537 // A few special cases has to be dealt with first (n * 90 degrees n integer)
538 if (sn==1.0 && cs==0.0) { // 90deg
539 NewCenter.setX( -Center.Y() );
540 NewCenter.setY( -Center.X() );
541 } else if (sn==0.0 && cs==-1.0) { // 180deg
542 NewCenter.setX( -Center.X() );
543 NewCenter.setY( -Center.Y() );
544 } else if (sn==-1.0 && cs==0.0) { // 270deg
545 NewCenter.setX( Center.Y() );
546 NewCenter.setY( -Center.X() );
547 }
548 else // Here it is rotated to any angle in the mathematically
549 // positive direction!
550 { // xnew = x * cos(alpha) - y * sin(alpha)
551 // ynew = x * sin(alpha) + y * cos(alpha)
552 // Bottom Right is not rotated: the pages of aOutRect must
553 // remain parallel to the coordinate axes.
554 NewCenter.setX( static_cast<tools::Long>(Center.X() * cs - Center.Y() * sn) );
555 NewCenter.setY( static_cast<tools::Long>(Center.X() * sn + Center.Y() * cs) );
556 }
557
558 Size Differenz;
559 Point DiffPoint = NewCenter - Center;
560 Differenz.setWidth( DiffPoint.X() );
561 Differenz.setHeight( -DiffPoint.Y() ); // Note that the Y-axis is counted ad positive downward.
562 NbcMove (Differenz); // Actually executes the coordinate transformation.
563}
564
566{
567 OUString sName(SvxResId(STR_ObjNameSingulScene3d));
568
569 OUString aName(GetName());
570 if (!aName.isEmpty())
571 sName += " '" + aName + "'";
572 return sName;
573}
574
576{
577 return SvxResId(STR_ObjNamePluralScene3d);
578}
579
580// The NbcRotate routine overrides the one of the SdrObject. The idea is
581// to be able to rotate the scene relative to the position of the scene
582// and then the objects in the scene
583
585{
586 if(maTransformation != rMatrix)
587 {
588 // call parent
590 }
591}
592
594{
595 if(rMatrix != maTransformation)
596 {
597 // call parent
599 }
600}
601
602void E3dScene::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
603{
604 // So currently the gluepoints are defined relative to the scene aOutRect.
605 // Before turning the gluepoints are defined relative to the page. They
606 // take no part in the rotation of the scene. To ensure this, there is the
607 // SetGlueReallyAbsolute(sal_True);
608
609 // So that was the scene, now the objects used in the scene
610 // 3D objects, if there is only one it can still have multiple surfaces but
611 // the surfaces do not have to be connected. This allows you to access child
612 // objects. So going through the entire list and rotate around the Z axis
613 // through the enter of aOutRect's (Steiner's theorem), so RotateZ
614
615 RotateScene (rRef, sn, cs); // Rotates the scene
616 double fAngleInRad = toRadians(nAngle);
617
618 basegfx::B3DHomMatrix aRotation;
619 aRotation.rotate(0.0, 0.0, fAngleInRad);
620 NbcSetTransform(aRotation * GetTransform());
621
622 SetBoundAndSnapRectsDirty(); // This forces a recalculation of all BoundRects
623 NbcRotateGluePoints(rRef,nAngle,sn,cs); // Rotate the gluepoints (who still
624 // have coordinates relative to the
625 // original page)
626 SetGlueReallyAbsolute(false); // from now they are again relative to BoundRect (that is defined as aOutRect)
628}
629
631{
633
634 if(pScene == this)
635 {
636 // The Scene is used as a 2D-Object, take the SnapRect from the
637 // 2D Display settings
639 }
640 else
641 {
642 // The Scene itself is a member of another scene, get the SnapRect
643 // as a composite object
644 // call parent
646
647 for(size_t a = 0; a < GetObjCount(); ++a)
648 {
649 E3dObject* pCandidate(DynCastE3dObject(GetObj(a)));
650
651 if(pCandidate)
652 {
653 maSnapRect.Union(pCandidate->GetSnapRect());
654 }
655 }
656 }
657}
658
660{
661 // Break scene, if all members are able to break
663
664 while ( a3DIterator.IsMore() )
665 {
666 E3dObject* pObj = static_cast<E3dObject*>(a3DIterator.Next());
667 if(!pObj->IsBreakObjPossible())
668 return false;
669 }
670
671 return true;
672}
673
675{
676 return TakeXorPoly();
677}
678
680{
681 rStat.SetOrtho4Possible();
682 tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
683 aRect1.Normalize();
684 rStat.SetActionRect(aRect1);
685 NbcSetSnapRect(aRect1);
686 return true;
687}
688
690{
691 tools::Rectangle aRect1;
692 rStat.TakeCreateRect(aRect1);
693 aRect1.Normalize();
694 rStat.SetActionRect(aRect1);
695 NbcSetSnapRect(aRect1);
697 m_bSnapRectDirty=true;
698 return true;
699}
700
702{
703 tools::Rectangle aRect1;
704 rStat.TakeCreateRect(aRect1);
705 aRect1.Normalize();
706 NbcSetSnapRect(aRect1);
708 return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
709}
710
712{
713 return false;
714}
715
717{
718}
719
721{
722 // call parent
724
725 for(size_t a(0); a < GetObjCount(); a++)
726 {
727 E3dObject* pCandidate(DynCastE3dObject(GetObj(a)));
728
729 if(pCandidate)
730 {
731 pCandidate->SetSelected(bNew);
732 }
733 }
734}
735
736void E3dScene::NbcInsertObject(SdrObject* pObj, size_t nPos)
737{
738 // Is it even a 3D object?
739 if(DynCastE3dObject(pObj))
740 {
741 // Normal 3D object, insert means call parent
743
744 // local needed stuff
747 }
748 else
749 {
750 // No 3D object, inserted a page in place in a scene ...
752 }
753}
754
755void E3dScene::InsertObject(SdrObject* pObj, size_t nPos)
756{
757 // Is it even a 3D object?
758 if(DynCastE3dObject(pObj))
759 {
760 // call parent
762
763 // local needed stuff
766 }
767 else
768 {
769 // No 3D object, inserted a page in place in a scene ...
771 }
772}
773
775{
776 // call parent
778
781
782 return pRetval;
783}
784
786{
787 // call parent
789
792
793 return pRetval;
794}
795
796void E3dScene::SetBoundAndSnapRectsDirty(bool bNotMyself, bool bRecursive)
797{
798 // call parent
799 E3dObject::SetBoundAndSnapRectsDirty(bNotMyself, bRecursive);
800
801 for(size_t a = 0; a < GetObjCount(); ++a)
802 {
803 E3dObject* pCandidate = DynCastE3dObject(GetObj(a));
804
805 if(pCandidate)
806 {
807 pCandidate->SetBoundAndSnapRectsDirty(bNotMyself, false);
808 }
809 }
810}
811
813{
814 // call parent
816
817 for(size_t a = 0; a < GetObjCount(); ++a)
818 {
819 E3dObject* pCandidate = DynCastE3dObject(GetObj(a));
820
821 if(pCandidate)
822 {
823 pCandidate->NbcSetLayer(nLayer);
824 }
825 }
826}
827
829{
830 if(pOldPage == pNewPage)
831 return;
832
833 // call parent
834 E3dObject::handlePageChange(pOldPage, pNewPage);
835
836 for(size_t a(0); a < GetObjCount(); a++)
837 {
838 E3dObject* pCandidate = DynCastE3dObject(GetObj(a));
839
840 if(pCandidate)
841 {
842 pCandidate->handlePageChange(pOldPage, pNewPage);
843 }
844 else
845 {
846 OSL_ENSURE(false, "E3dScene::handlePageChange invalid object list (!)");
847 }
848 }
849}
850
852{
853 return const_cast< E3dScene* >(this);
854}
855
857{
858 basegfx::B3DRange aRetval;
859 const size_t nObjCnt(GetObjCount());
860
861 for(size_t a = 0; a < nObjCnt; ++a)
862 {
863 const E3dObject* p3DObject = DynCastE3dObject(GetObj(a));
864
865 if(p3DObject)
866 {
867 basegfx::B3DRange aLocalRange(p3DObject->GetBoundVolume());
868 aLocalRange.transform(p3DObject->GetTransform());
869 aRetval.expand(aLocalRange);
870 }
871 }
872
873 return aRetval;
874}
875
877{
878 // call parent
880
881 for(size_t a = 0; a < GetObjCount(); ++a)
882 {
883 E3dObject* pCandidate = DynCastE3dObject(GetObj(a));
884
885 if(pCandidate)
886 {
887 pCandidate->SetTransformChanged();
888 }
889 }
890}
891
892/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetDeviceRectangle(double fL=-1.0, double fR=1.0, double fB=-1.0, double fT=1.0)
void SetViewportRectangle(tools::Rectangle const &rRect, tools::Rectangle const &rVisible)
void SetRatio(double fNew)
void SetPerspective(bool bNew)
void SetViewportValues(const basegfx::B3DPoint &rNewVRP, const basegfx::B3DVector &rNewVPN, const basegfx::B3DVector &rNewVUV)
void SetPosition(const basegfx::B3DPoint &rNewPos)
Definition: camera3d.cxx:48
void SetFocalLength(double fLen)
Definition: camera3d.cxx:172
const basegfx::B3DPoint & GetPosition() const
Definition: camera3d.hxx:51
void SetViewWindow(double fX, double fY, double fW, double fH)
Definition: camera3d.cxx:41
Helper for 3d object changes affecting 2d geometry.
void InvalidateBoundVolume()
Definition: obj3d.cxx:320
virtual void StructureChanged()
Definition: obj3d.cxx:254
basegfx::B3DPolyPolygon CreateWireframe() const
Definition: obj3d.cxx:375
virtual void SetTransformChanged()
Definition: obj3d.cxx:326
virtual void SetTransform(const basegfx::B3DHomMatrix &rMatrix)
Definition: obj3d.cxx:364
const basegfx::B3DRange & GetBoundVolume() const
Definition: obj3d.cxx:310
const basegfx::B3DHomMatrix & GetTransform() const
Definition: obj3d.hxx:112
virtual void NbcSetTransform(const basegfx::B3DHomMatrix &rMatrix)
Definition: obj3d.cxx:353
basegfx::B3DHomMatrix maTransformation
Definition: obj3d.hxx:72
E3dScene * getParentE3dSceneFromE3dObject() const
Definition: obj3d.cxx:265
virtual void SetSelected(bool bNew)
Definition: obj3d.cxx:84
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: obj3d.cxx:410
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
Definition: obj3d.cxx:418
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: obj3d.cxx:247
virtual bool IsBreakObjPossible()
Definition: obj3d.cxx:93
virtual void NbcResize(const Point &rRef, const Fraction &rXFact, const Fraction &rYFact) override
Definition: scene3d.cxx:332
void SetAllSceneRectsDirty()
Definition: scene3d.cxx:467
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: scene3d.cxx:256
virtual OUString TakeObjNamePlural() const override
Definition: scene3d.cxx:575
Camera3D aCamera
Definition: scene3d.hxx:64
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
Definition: scene3d.cxx:507
sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const
Definition: scene3d.cxx:274
virtual SdrObject * getSdrObjectFromSdrObjList() const override
Definition: scene3d.cxx:246
virtual E3dScene * getRootE3dSceneFromE3dObject() const override
Definition: scene3d.cxx:387
B3dCamera & GetCameraSet()
Definition: scene3d.hxx:145
virtual SdrObjList * getChildrenOfSdrObject() const override
Definition: scene3d.cxx:251
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: scene3d.cxx:828
void ResumeReportingDirtyRects()
Definition: scene3d.cxx:457
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: scene3d.cxx:517
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: scene3d.cxx:630
virtual rtl::Reference< SdrObject > NbcRemoveObject(size_t nObjNum) override
remove from list without delete
Definition: scene3d.cxx:774
bool mbSkipSettingDirty
Definition: scene3d.hxx:71
void ImpCleanup3DDepthMapper()
Definition: scene3d.cxx:269
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:495
virtual void SetTransformChanged() override
Definition: scene3d.cxx:876
virtual bool BckCreate(SdrDragStat &rStat) override
Definition: scene3d.cxx:711
virtual void StructureChanged() override
Definition: scene3d.cxx:371
virtual void SetTransform(const basegfx::B3DHomMatrix &rMatrix) override
Definition: scene3d.cxx:593
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: scene3d.cxx:500
virtual bool IsBreakObjPossible() override
Definition: scene3d.cxx:659
E3dScene(SdrModel &rSdrModel)
Definition: scene3d.cxx:168
void SetDefaultAttributes()
Definition: scene3d.cxx:208
B3dCamera aCameraSet
Definition: scene3d.hxx:63
virtual bool MovCreate(SdrDragStat &rStat) override
Definition: scene3d.cxx:689
virtual void SetSelected(bool bNew) override
Definition: scene3d.cxx:720
double GetFocalLength() const
Definition: scene3d.hxx:109
virtual void NbcMove(const Size &rSize) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: scene3d.cxx:325
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE) override
Definition: scene3d.cxx:736
virtual ~E3dScene() override
Definition: scene3d.cxx:236
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
Definition: scene3d.cxx:602
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const override
Definition: scene3d.cxx:442
void removeAllNonSelectedObjects()
Definition: scene3d.cxx:399
virtual void NbcSetLayer(SdrLayerID nLayer) override
Definition: scene3d.cxx:812
void RebuildLists()
Definition: scene3d.cxx:479
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum) override
Definition: scene3d.cxx:785
void RotateScene(const Point &rRef, double sn, double cs)
Definition: scene3d.cxx:523
virtual void SetBoundRectDirty() override
Definition: scene3d.cxx:299
virtual SdrObjKind GetObjIdentifier() const override
Definition: scene3d.cxx:294
virtual void NbcSetTransform(const basegfx::B3DHomMatrix &rMatrix) override
Definition: scene3d.cxx:584
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: scene3d.cxx:154
ProjectionType GetPerspective() const
Definition: scene3d.hxx:101
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
Definition: scene3d.cxx:701
virtual SdrPage * getSdrPageFromSdrObjList() const override
Definition: scene3d.cxx:241
double GetDistance() const
Definition: scene3d.hxx:105
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
Definition: scene3d.cxx:315
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: scene3d.cxx:162
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE) override
Definition: scene3d.cxx:755
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true) override
Definition: scene3d.cxx:796
virtual OUString TakeObjNameSingul() const override
Definition: scene3d.cxx:565
virtual void BrkCreate(SdrDragStat &rStat) override
Definition: scene3d.cxx:716
std::unique_ptr< Imp3DDepthRemapper > mp3DDepthRemapper
Definition: scene3d.hxx:66
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
Definition: scene3d.cxx:674
virtual SdrObjList * GetSubList() const override
Definition: scene3d.cxx:851
void SetCamera(const Camera3D &rNewCamera)
Definition: scene3d.cxx:343
virtual basegfx::B3DRange RecalcBoundVolume() const override
Definition: scene3d.cxx:856
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
Definition: scene3d.cxx:679
void SuspendReportingDirtyRects()
Definition: scene3d.cxx:447
std::vector< ImpRemap3DDepth > maVector
Definition: scene3d.cxx:100
sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const
Definition: scene3d.cxx:141
Imp3DDepthRemapper(E3dScene const &rScene)
Definition: scene3d.cxx:108
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
virtual const tools::Rectangle & GetSnapRect() const override
Definition: svdoattr.cxx:49
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Detects when a stylesheet is changed.
Definition: svdoattr.cxx:61
tools::Rectangle maSnapRect
Definition: svdoattr.hxx:41
void SetActionRect(const tools::Rectangle &rR)
Definition: svddrag.hxx:167
sal_Int32 GetPointCount() const
Definition: svddrag.hxx:101
void TakeCreateRect(tools::Rectangle &rRect) const
Definition: svddrag.cxx:115
void SetOrtho4Possible(bool bOn=true)
Definition: svddrag.hxx:136
const Point & GetStart() const
Definition: svddrag.hxx:102
const Point & GetNow() const
Definition: svddrag.hxx:105
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:174
SdrObject * Next()
Definition: svditer.hxx:63
bool IsMore() const
Definition: svditer.hxx:62
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:295
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:785
size_t GetObjCount() const
Definition: svdpage.cxx:779
void CopyObjects(const SdrObjList &rSrcList)
Definition: svdpage.cxx:134
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:244
virtual rtl::Reference< SdrObject > NbcRemoveObject(size_t nObjNum)
remove from list without delete
Definition: svdpage.cxx:334
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
Definition: svdpage.cxx:373
Abstract DrawObject.
Definition: svdobj.hxx:260
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:664
const tools::Rectangle & getOutRectangle() const
Definition: svdobj.cxx:3173
virtual sdr::properties::BaseProperties & GetProperties() const
Definition: svdobj.cxx:220
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:905
bool m_bSnapRectDirty
Definition: svdobj.hxx:902
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
Definition: svdobj.cxx:523
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1667
virtual const OUString & GetName() const
Definition: svdobj.cxx:771
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:261
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:279
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:645
void NbcRotateGluePoints(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:2338
void SetGlueReallyAbsolute(bool bOn)
Definition: svdobj.cxx:2328
virtual void SetBoundRectDirty()
Definition: svdobj.cxx:329
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:509
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:379
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
void SetProjection(ProjectionType ePrj)
Definition: viewpt3d.hxx:80
void SetDeviceWindow(const tools::Rectangle &rRect)
Definition: viewpt3d2.cxx:113
ProjectionType GetProjection() const
Definition: viewpt3d.hxx:82
const basegfx::B3DVector & GetVUV() const
Definition: viewpt3d.hxx:78
const basegfx::B3DPoint & GetVRP() const
Definition: viewpt3d.hxx:77
const tools::Rectangle & GetDeviceWindow() const
Definition: viewpt3d.hxx:87
const basegfx::B3DPoint & GetViewPoint()
Definition: viewpt3d2.cxx:50
void transform(const basegfx::B2DHomMatrix &rMatrix)
void rotate(double fAngleX, double fAngleY, double fAngleZ)
BASEGFX_DLLPUBLIC void transform(const B3DHomMatrix &rMatrix)
void expand(const B3DTuple &rTuple)
TYPE getX() const
TYPE getZ() const
TYPE getY() const
const basegfx::B3DHomMatrix & getObjectToView() const
const drawinglayer::geometry::ViewInformation3D & getViewInformation3D(const ::basegfx::B3DRange &rContentRange) const
const basegfx::B2DHomMatrix & getObjectTransformation() const
virtual void ActionChanged()
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
tools::Rectangle & Union(const tools::Rectangle &rRect)
double toRadians(D x)
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
OUString sName
double getMinimalDepthInViewCoordinates(const E3dCompoundObject &rObject)
support extracting the minimal depth of a 3d object in its scene
double mfMinimalDepth
OUString aName
uno_Any a
sal_uInt16 nPos
B2DPolyPolygon createB2DPolyPolygonFromB3DPolyPolygon(const B3DPolyPolygon &rCandidate, const B3DHomMatrix &rMat)
long Long
E3dObject * DynCastE3dObject(SdrObject *pObj)
Definition: svdobj.cxx:3205
E3dScene * DynCastE3dScene(SdrObject *pObj)
Definition: svdobj.cxx:3198
SdrObjKind
Definition: svdobjkind.hxx:25
void ResizeRect(tools::Rectangle &rRect, const Point &rRef, const Fraction &rxFact, const Fraction &ryFact)
Definition: svdtrans.cxx:38
SdrCreateCmd
Definition: svdtypes.hxx:27
Center
bool operator<(const Subset &rLHS, const Subset &rRHS)
Definition: ucsubset.hxx:50