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 UpperLeft, LowerRight, Center, NewCenter;
526
529
530 tools::Long dxOutRectHalf = std::abs(UpperLeft.X() - LowerRight.X());
531 dxOutRectHalf /= 2;
532 tools::Long dyOutRectHalf = std::abs(UpperLeft.Y() - LowerRight.Y());
533 dyOutRectHalf /= 2;
534
535 // Only the center is moved. The corners are moved by NbcMove. For the
536 // rotation a cartesian coordinate system is used in which the pivot
537 // point is the origin, and the y-axis increases upward, the X-axis to
538 // the right. This must be especially noted for the Y-values.
539 // (When considering a flat piece of paper the Y-axis pointing downwards
540 Center.setX( (UpperLeft.X() + dxOutRectHalf) - rRef.X() );
541 Center.setY( -((UpperLeft.Y() + dyOutRectHalf) - rRef.Y()) );
542 // A few special cases has to be dealt with first (n * 90 degrees n integer)
543 if (sn==1.0 && cs==0.0) { // 90deg
544 NewCenter.setX( -Center.Y() );
545 NewCenter.setY( -Center.X() );
546 } else if (sn==0.0 && cs==-1.0) { // 180deg
547 NewCenter.setX( -Center.X() );
548 NewCenter.setY( -Center.Y() );
549 } else if (sn==-1.0 && cs==0.0) { // 270deg
550 NewCenter.setX( Center.Y() );
551 NewCenter.setY( -Center.X() );
552 }
553 else // Here it is rotated to any angle in the mathematically
554 // positive direction!
555 { // xnew = x * cos(alpha) - y * sin(alpha)
556 // ynew = x * sin(alpha) + y * cos(alpha)
557 // Bottom Right is not rotated: the pages of aOutRect must
558 // remain parallel to the coordinate axes.
559 NewCenter.setX( static_cast<tools::Long>(Center.X() * cs - Center.Y() * sn) );
560 NewCenter.setY( static_cast<tools::Long>(Center.X() * sn + Center.Y() * cs) );
561 }
562
563 Size Differenz;
564 Point DiffPoint = NewCenter - Center;
565 Differenz.setWidth( DiffPoint.X() );
566 Differenz.setHeight( -DiffPoint.Y() ); // Note that the Y-axis is counted ad positive downward.
567 NbcMove (Differenz); // Actually executes the coordinate transformation.
568}
569
571{
572 OUString sName(SvxResId(STR_ObjNameSingulScene3d));
573
574 OUString aName(GetName());
575 if (!aName.isEmpty())
576 sName += " '" + aName + "'";
577 return sName;
578}
579
581{
582 return SvxResId(STR_ObjNamePluralScene3d);
583}
584
585// The NbcRotate routine overrides the one of the SdrObject. The idea is
586// to be able to rotate the scene relative to the position of the scene
587// and then the objects in the scene
588
590{
591 if(maTransformation != rMatrix)
592 {
593 // call parent
595 }
596}
597
599{
600 if(rMatrix != maTransformation)
601 {
602 // call parent
604 }
605}
606
607void E3dScene::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
608{
609 // So currently the gluepoints are defined relative to the scene aOutRect.
610 // Before turning the gluepoints are defined relative to the page. They
611 // take no part in the rotation of the scene. To ensure this, there is the
612 // SetGlueReallyAbsolute(sal_True);
613
614 // So that was the scene, now the objects used in the scene
615 // 3D objects, if there is only one it can still have multiple surfaces but
616 // the surfaces do not have to be connected. This allows you to access child
617 // objects. So going through the entire list and rotate around the Z axis
618 // through the enter of aOutRect's (Steiner's theorem), so RotateZ
619
620 RotateScene (rRef, sn, cs); // Rotates the scene
621 double fAngleInRad = toRadians(nAngle);
622
623 basegfx::B3DHomMatrix aRotation;
624 aRotation.rotate(0.0, 0.0, fAngleInRad);
625 NbcSetTransform(aRotation * GetTransform());
626
627 SetBoundAndSnapRectsDirty(); // This forces a recalculation of all BoundRects
628 NbcRotateGluePoints(rRef,nAngle,sn,cs); // Rotate the gluepoints (who still
629 // have coordinates relative to the
630 // original page)
631 SetGlueReallyAbsolute(false); // from now they are again relative to BoundRect (that is defined as aOutRect)
633}
634
636{
638
639 if(pScene == this)
640 {
641 // The Scene is used as a 2D-Object, take the SnapRect from the
642 // 2D Display settings
644 }
645 else
646 {
647 // The Scene itself is a member of another scene, get the SnapRect
648 // as a composite object
649 // call parent
651
652 for(size_t a = 0; a < GetObjCount(); ++a)
653 {
654 E3dObject* pCandidate(DynCastE3dObject(GetObj(a)));
655
656 if(pCandidate)
657 {
658 maSnapRect.Union(pCandidate->GetSnapRect());
659 }
660 }
661 }
662}
663
665{
666 // Break scene, if all members are able to break
668
669 while ( a3DIterator.IsMore() )
670 {
671 E3dObject* pObj = static_cast<E3dObject*>(a3DIterator.Next());
672 if(!pObj->IsBreakObjPossible())
673 return false;
674 }
675
676 return true;
677}
678
680{
681 return TakeXorPoly();
682}
683
685{
686 rStat.SetOrtho4Possible();
687 tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
688 aRect1.Normalize();
689 rStat.SetActionRect(aRect1);
690 NbcSetSnapRect(aRect1);
691 return true;
692}
693
695{
696 tools::Rectangle aRect1;
697 rStat.TakeCreateRect(aRect1);
698 aRect1.Normalize();
699 rStat.SetActionRect(aRect1);
700 NbcSetSnapRect(aRect1);
702 m_bSnapRectDirty=true;
703 return true;
704}
705
707{
708 tools::Rectangle aRect1;
709 rStat.TakeCreateRect(aRect1);
710 aRect1.Normalize();
711 NbcSetSnapRect(aRect1);
713 return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
714}
715
717{
718 return false;
719}
720
722{
723}
724
726{
727 // call parent
729
730 for(size_t a(0); a < GetObjCount(); a++)
731 {
732 E3dObject* pCandidate(DynCastE3dObject(GetObj(a)));
733
734 if(pCandidate)
735 {
736 pCandidate->SetSelected(bNew);
737 }
738 }
739}
740
741void E3dScene::NbcInsertObject(SdrObject* pObj, size_t nPos)
742{
743 // Is it even a 3D object?
744 if(DynCastE3dObject(pObj))
745 {
746 // Normal 3D object, insert means call parent
748
749 // local needed stuff
752 }
753 else
754 {
755 // No 3D object, inserted a page in place in a scene ...
757 }
758}
759
760void E3dScene::InsertObject(SdrObject* pObj, size_t nPos)
761{
762 // Is it even a 3D object?
763 if(DynCastE3dObject(pObj))
764 {
765 // call parent
767
768 // local needed stuff
771 }
772 else
773 {
774 // No 3D object, inserted a page in place in a scene ...
776 }
777}
778
780{
781 // call parent
783
786
787 return pRetval;
788}
789
791{
792 // call parent
794
797
798 return pRetval;
799}
800
801void E3dScene::SetBoundAndSnapRectsDirty(bool bNotMyself, bool bRecursive)
802{
803 // call parent
804 E3dObject::SetBoundAndSnapRectsDirty(bNotMyself, bRecursive);
805
806 for(size_t a = 0; a < GetObjCount(); ++a)
807 {
808 E3dObject* pCandidate = DynCastE3dObject(GetObj(a));
809
810 if(pCandidate)
811 {
812 pCandidate->SetBoundAndSnapRectsDirty(bNotMyself, false);
813 }
814 }
815}
816
818{
819 // call parent
821
822 for(size_t a = 0; a < GetObjCount(); ++a)
823 {
824 E3dObject* pCandidate = DynCastE3dObject(GetObj(a));
825
826 if(pCandidate)
827 {
828 pCandidate->NbcSetLayer(nLayer);
829 }
830 }
831}
832
834{
835 if(pOldPage == pNewPage)
836 return;
837
838 // call parent
839 E3dObject::handlePageChange(pOldPage, pNewPage);
840
841 for(size_t a(0); a < GetObjCount(); a++)
842 {
843 E3dObject* pCandidate = DynCastE3dObject(GetObj(a));
844
845 if(pCandidate)
846 {
847 pCandidate->handlePageChange(pOldPage, pNewPage);
848 }
849 else
850 {
851 OSL_ENSURE(false, "E3dScene::handlePageChange invalid object list (!)");
852 }
853 }
854}
855
857{
858 return const_cast< E3dScene* >(this);
859}
860
862{
863 basegfx::B3DRange aRetval;
864 const size_t nObjCnt(GetObjCount());
865
866 for(size_t a = 0; a < nObjCnt; ++a)
867 {
868 const E3dObject* p3DObject = DynCastE3dObject(GetObj(a));
869
870 if(p3DObject)
871 {
872 basegfx::B3DRange aLocalRange(p3DObject->GetBoundVolume());
873 aLocalRange.transform(p3DObject->GetTransform());
874 aRetval.expand(aLocalRange);
875 }
876 }
877
878 return aRetval;
879}
880
882{
883 // call parent
885
886 for(size_t a = 0; a < GetObjCount(); ++a)
887 {
888 E3dObject* pCandidate = DynCastE3dObject(GetObj(a));
889
890 if(pCandidate)
891 {
892 pCandidate->SetTransformChanged();
893 }
894 }
895}
896
897/* 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:580
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:833
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:635
virtual rtl::Reference< SdrObject > NbcRemoveObject(size_t nObjNum) override
remove from list without delete
Definition: scene3d.cxx:779
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:881
virtual bool BckCreate(SdrDragStat &rStat) override
Definition: scene3d.cxx:716
virtual void StructureChanged() override
Definition: scene3d.cxx:371
virtual void SetTransform(const basegfx::B3DHomMatrix &rMatrix) override
Definition: scene3d.cxx:598
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: scene3d.cxx:500
virtual bool IsBreakObjPossible() override
Definition: scene3d.cxx:664
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:694
virtual void SetSelected(bool bNew) override
Definition: scene3d.cxx:725
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:741
virtual ~E3dScene() override
Definition: scene3d.cxx:236
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
Definition: scene3d.cxx:607
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:817
void RebuildLists()
Definition: scene3d.cxx:479
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum) override
Definition: scene3d.cxx:790
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:589
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:706
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:760
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true) override
Definition: scene3d.cxx:801
virtual OUString TakeObjNameSingul() const override
Definition: scene3d.cxx:570
virtual void BrkCreate(SdrDragStat &rStat) override
Definition: scene3d.cxx:721
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:679
virtual SdrObjList * GetSubList() const override
Definition: scene3d.cxx:856
void SetCamera(const Camera3D &rNewCamera)
Definition: scene3d.cxx:343
virtual basegfx::B3DRange RecalcBoundVolume() const override
Definition: scene3d.cxx:861
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
Definition: scene3d.cxx:684
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
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:175
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:332
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:822
size_t GetObjCount() const
Definition: svdpage.cxx:816
void CopyObjects(const SdrObjList &rSrcList)
Definition: svdpage.cxx:134
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:281
virtual rtl::Reference< SdrObject > NbcRemoveObject(size_t nObjNum)
remove from list without delete
Definition: svdpage.cxx:371
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
Definition: svdpage.cxx:410
Abstract DrawObject.
Definition: svdobj.hxx:261
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:662
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:869
bool m_bSnapRectDirty
Definition: svdobj.hxx:908
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage)
Definition: svdobj.cxx:523
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1670
virtual const OUString & GetName() const
Definition: svdobj.cxx:769
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:261
tools::Rectangle m_aOutRect
Definition: svdobj.hxx:901
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:2341
void SetGlueReallyAbsolute(bool bOn)
Definition: svdobj.cxx:2331
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:377
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()
constexpr Point TopLeft() const
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
constexpr Point BottomRight() const
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:3210
E3dScene * DynCastE3dScene(SdrObject *pObj)
Definition: svdobj.cxx:3203
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