LibreOffice Module svx (master)  1
obj3d.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 <o3tl/numeric.hxx>
21 
22 #include <svx/strings.hrc>
23 #include <svx/dialmgr.hxx>
24 #include <svx/svdhdl.hxx>
25 #include <svx/svdmodel.hxx>
26 #include <svx/svdobjkind.hxx>
27 #include <svx/scene3d.hxx>
28 #include <svx/obj3d.hxx>
36 #include <svx/helperhittest3d.hxx>
39 #include <com/sun/star/uno/Sequence.h>
41 #include <svx/e3dsceneupdater.hxx>
42 #include <rtl/ustrbuf.hxx>
43 #include <unotools/configmgr.hxx>
44 
45 using namespace com::sun::star;
46 
47 std::unique_ptr<sdr::properties::BaseProperties> E3dObject::CreateObjectSpecificProperties()
48 {
49  return std::make_unique<sdr::properties::E3dProperties>(*this);
50 }
51 
53 : SdrAttrObj(rSdrModel),
54  maLocalBoundVol(),
56  maFullTransform(),
57  mbTfHasChanged(true),
58  mbIsSelected(false)
59 {
60  m_bIs3DObj = true;
61  m_bClosedObj = true;
62 }
63 
64 E3dObject::E3dObject(SdrModel& rSdrModel, E3dObject const & rSource)
65 : SdrAttrObj(rSdrModel, rSource),
66  maLocalBoundVol(),
68  maFullTransform(),
69  mbTfHasChanged(true),
70  mbIsSelected(false)
71 {
72  m_bIs3DObj = true;
73  m_bClosedObj = true;
74 
75  // BoundVol can be copied since also the children are copied
78 
79  // Because the parent may have changed, definitely redefine the total
80  // transformation next time
82 
83  // Copy selection status
84  mbIsSelected = rSource.mbIsSelected;
85 }
86 
88 {
89 }
90 
91 void E3dObject::SetSelected(bool bNew)
92 {
93  if(mbIsSelected != bNew)
94  {
95  mbIsSelected = bNew;
96  }
97 }
98 
99 // Break, default implementations
101 {
102  return false;
103 }
104 
105 std::unique_ptr<SdrAttrObj,SdrObjectFreeOp> E3dObject::GetBreakObj()
106 {
107  return nullptr;
108 }
109 
111 {
112  return SdrInventor::E3d;
113 }
114 
116 {
117  return E3D_OBJECT_ID;
118 }
119 
120 // Determine the capabilities of the object
122 {
123  rInfo.bResizeFreeAllowed = true;
124  rInfo.bResizePropAllowed = true;
125  rInfo.bRotateFreeAllowed = true;
126  rInfo.bRotate90Allowed = true;
127  rInfo.bMirrorFreeAllowed = false;
128  rInfo.bMirror45Allowed = false;
129  rInfo.bMirror90Allowed = false;
130  rInfo.bShearAllowed = false;
131  rInfo.bEdgeRadiusAllowed = false;
132  rInfo.bCanConvToPath = false;
133 
134  // no transparence for 3d objects
135  rInfo.bTransparenceAllowed = false;
136 
137  // Convert 3D objects in a group of polygons:
138  // At first not only possible, because the creation of a group of
139  // 2D polygons would be required which need to be sorted by depth,
140  // ie at intersections be cut relative to each other. Also the texture
141  // coordinates were an unsolved problem.
142  rInfo.bCanConvToPoly = false;
143  rInfo.bCanConvToContour = false;
144  rInfo.bCanConvToPathLineToArea = false;
145  rInfo.bCanConvToPolyLineToArea = false;
146 }
147 
148 // resize object, used from old 2d interfaces, e.g. in Move/Scale dialog (F4)
149 void E3dObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
150 {
151  // Movement in X, Y in the eye coordinate system
153 
154  if(nullptr == pScene)
155  {
156  return;
157  }
158 
159  // transform pos from 2D world to 3D eye
162  basegfx::B2DPoint aScaleCenter2D(static_cast<double>(rRef.X()), static_cast<double>(rRef.Y()));
163  basegfx::B2DHomMatrix aInverseSceneTransform(rVCScene.getObjectTransformation());
164 
165  aInverseSceneTransform.invert();
166  aScaleCenter2D = aInverseSceneTransform * aScaleCenter2D;
167 
168  basegfx::B3DPoint aScaleCenter3D(aScaleCenter2D.getX(), aScaleCenter2D.getY(), 0.5);
169  basegfx::B3DHomMatrix aInverseViewToEye(aViewInfo3D.getDeviceToView() * aViewInfo3D.getProjection());
170 
171  aInverseViewToEye.invert();
172  aScaleCenter3D = aInverseViewToEye * aScaleCenter3D;
173 
174  // Get scale factors
175  double fScaleX(xFact);
176  double fScaleY(yFact);
177 
178  // build transform
179  basegfx::B3DHomMatrix aInverseOrientation(aViewInfo3D.getOrientation());
180  aInverseOrientation.invert();
181  basegfx::B3DHomMatrix aFullTransform(GetFullTransform());
182  basegfx::B3DHomMatrix aTrans(aFullTransform);
183 
184  aTrans *= aViewInfo3D.getOrientation();
185  aTrans.translate(-aScaleCenter3D.getX(), -aScaleCenter3D.getY(), -aScaleCenter3D.getZ());
186  aTrans.scale(fScaleX, fScaleY, 1.0);
187  aTrans.translate(aScaleCenter3D.getX(), aScaleCenter3D.getY(), aScaleCenter3D.getZ());
188  aTrans *= aInverseOrientation;
189  aFullTransform.invert();
190  aTrans *= aFullTransform;
191 
192  // Apply
193  basegfx::B3DHomMatrix aObjTrans(GetTransform());
194  aObjTrans *= aTrans;
195 
196  E3DModifySceneSnapRectUpdater aUpdater(this);
197  SetTransform(aObjTrans);
198 }
199 
200 // Move object in 2D is needed when using cursor keys
201 void E3dObject::NbcMove(const Size& rSize)
202 {
203  // Movement in X, Y in the eye coordinate system
205 
206  if(nullptr == pScene)
207  {
208  return;
209  }
210 
211  //Dimensions of the scene in 3D and 2D for comparison
212  tools::Rectangle aRect = pScene->GetSnapRect();
213  basegfx::B3DHomMatrix aInvDispTransform;
215 
216  if(nullptr != pParent)
217  {
218  aInvDispTransform = pParent->GetFullTransform();
219  aInvDispTransform.invert();
220  }
221 
222  // BoundVolume from 3d world to 3d eye
225  basegfx::B3DRange aEyeVol(pScene->GetBoundVolume());
226  aEyeVol.transform(aViewInfo3D.getOrientation());
227 
228  if ((aRect.GetWidth() == 0) || (aRect.GetHeight() == 0))
229  throw o3tl::divide_by_zero();
230 
231  // build relative movement vector in eye coordinates
232  basegfx::B3DPoint aMove(
233  static_cast<double>(rSize.Width()) * aEyeVol.getWidth() / static_cast<double>(aRect.GetWidth()),
234  static_cast<double>(-rSize.Height()) * aEyeVol.getHeight() / static_cast<double>(aRect.GetHeight()),
235  0.0);
236  basegfx::B3DPoint aPos(0.0, 0.0, 0.0);
237 
238  // movement vector to local coordinates of objects' parent
239  basegfx::B3DHomMatrix aInverseOrientation(aViewInfo3D.getOrientation());
240  aInverseOrientation.invert();
241  basegfx::B3DHomMatrix aCompleteTrans(aInvDispTransform * aInverseOrientation);
242 
243  aMove = aCompleteTrans * aMove;
244  aPos = aCompleteTrans * aPos;
245 
246  // build transformation and apply
247  basegfx::B3DHomMatrix aTranslate;
248  aTranslate.translate(aMove.getX() - aPos.getX(), aMove.getY() - aPos.getY(), aMove.getZ() - aPos.getZ());
249 
250  E3DModifySceneSnapRectUpdater aUpdater(pScene);
251  SetTransform(aTranslate * GetTransform());
252 }
253 
255 {
257 }
258 
259 // Inform parent of changes in the structure (eg by transformation), in this
260 // process the object in which the change has occurred is returned.
262 {
264 
265  if(nullptr != pParent)
266  {
267  pParent->InvalidateBoundVolume();
268  pParent->StructureChanged();
269  }
270 }
271 
273 {
274  return dynamic_cast< E3dScene* >(getParentSdrObjectFromSdrObject());
275 }
276 
277 // Determine the top-level scene object
279 {
281 
282  if(nullptr != pParent)
283  {
284  return pParent->getRootE3dSceneFromE3dObject();
285  }
286 
287  return nullptr;
288 }
289 
290 // Calculate enclosed volume, including all child objects
292 {
293  basegfx::B3DRange aRetval;
294  if (utl::ConfigManager::IsFuzzing()) // skip slow path for fuzzing
295  return aRetval;
296 
297  const sdr::contact::ViewContactOfE3d* pVCOfE3D = dynamic_cast< const sdr::contact::ViewContactOfE3d* >(&GetViewContact());
298 
299  if(pVCOfE3D)
300  {
301  // BoundVolume is without 3D object transformation, use correct sequence
303 
304  if(!xLocalSequence.empty())
305  {
306  const uno::Sequence< beans::PropertyValue > aEmptyParameters;
307  const drawinglayer::geometry::ViewInformation3D aLocalViewInformation3D(aEmptyParameters);
308 
309  aRetval = xLocalSequence.getB3DRange(aLocalViewInformation3D);
310  }
311  }
312 
313  return aRetval;
314 }
315 
316 // Get enclosed volume and possibly recalculate it
318 {
320  {
321  const_cast< E3dObject* >(this)->maLocalBoundVol = RecalcBoundVolume();
322  }
323 
324  return maLocalBoundVol;
325 }
326 
328 {
330 }
331 
332 // Pass on the changes in transformation to all child objects
334 {
336  mbTfHasChanged = true;
337 }
338 
339 // Define the hierarchical transformation over all Parents, store in
340 // maFullTransform and return them
342 {
343  if(mbTfHasChanged)
344  {
345  basegfx::B3DHomMatrix aNewFullTransformation(maTransformation);
347 
348  if(nullptr != pParent)
349  {
350  aNewFullTransformation = pParent->GetFullTransform() * aNewFullTransformation;
351  }
352 
353  const_cast< E3dObject* >(this)->maFullTransform = aNewFullTransformation;
354  const_cast< E3dObject* >(this)->mbTfHasChanged = false;
355  }
356 
357  return maFullTransform;
358 }
359 
361 {
362  if(maTransformation != rMatrix)
363  {
364  maTransformation = rMatrix;
367  }
368 }
369 
370 // Set transformation matrix with repaint broadcast
372 {
373  if(rMatrix != maTransformation)
374  {
375  NbcSetTransform(rMatrix);
376  SetChanged();
379  }
380 }
381 
383 {
384  const basegfx::B3DRange aBoundVolume(GetBoundVolume());
386 }
387 
388 // Get the name of the object (singular)
390 {
391  OUStringBuffer sName(SvxResId(STR_ObjNameSingulObj3d));
392 
393  OUString aName(GetName());
394  if (!aName.isEmpty())
395  {
396  sName.append(' ');
397  sName.append('\'');
398  sName.append(aName);
399  sName.append('\'');
400  }
401  return sName.makeStringAndClear();
402 }
403 
404 // Get the name of the object (plural)
406 {
407  return SvxResId(STR_ObjNamePluralObj3d);
408 }
409 
411 {
412  return new E3dObject(rTargetModel, *this);
413 }
414 
415 std::unique_ptr<SdrObjGeoData> E3dObject::NewGeoData() const
416 {
417  return std::make_unique<E3DObjGeoData>();
418 }
419 
421 {
423 
424  static_cast<E3DObjGeoData &>(rGeo).maLocalBoundVol = maLocalBoundVol;
425  static_cast<E3DObjGeoData &>(rGeo).maTransformation = maTransformation;
426 }
427 
429 {
430  maLocalBoundVol = static_cast<const E3DObjGeoData &>(rGeo).maLocalBoundVol;
431  E3DModifySceneSnapRectUpdater aUpdater(this);
432  NbcSetTransform(static_cast<const E3DObjGeoData &>(rGeo).maTransformation);
434 }
435 
436 // 2D-rotation of a 3D-body, normally this is done by the scene itself.
437 // This is however a correct implementation, because everything that has
438 // happened is a rotation around the axis perpendicular to the screen and that
439 // is regardless of how the scene has been rotated up until now.
440 void E3dObject::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
441 {
442  // So currently the glue points are defined relative to the scene aOutRect.
443  // Before turning the glue points are defined relative to the page. They
444  // take no part in the rotation of the scene. To ensure this, there is the
445  // SetGlueReallyAbsolute(sal_True);
446  double fAngleInRad = toRadians(nAngle);
447 
448  basegfx::B3DHomMatrix aRotateZ;
449  aRotateZ.rotate(0.0, 0.0, fAngleInRad);
450  NbcSetTransform(aRotateZ * GetTransform());
451 
452  SetRectsDirty(); // This forces a recalculation of all BoundRects
453  NbcRotateGluePoints(rRef,nAngle,sn,cs); // Rotate the glue points (who still
454  // have coordinates relative to the
455  // original page)
456  SetGlueReallyAbsolute(false); // from now they are again relative to BoundRect (that is defined as aOutRect)
457 }
458 
459 std::unique_ptr<sdr::properties::BaseProperties> E3dCompoundObject::CreateObjectSpecificProperties()
460 {
461  return std::make_unique<sdr::properties::E3dCompoundProperties>(*this);
462 }
463 
465 : E3dObject(rSdrModel)
466 {
467 }
468 
470 : E3dObject(rSdrModel, rSource)
471 {
472 }
473 
475 {
476 }
477 
479 {
480  basegfx::B2DPolyPolygon aRetval;
481  const uno::Sequence< beans::PropertyValue > aEmptyParameters;
482  drawinglayer::geometry::ViewInformation3D aViewInfo3D(aEmptyParameters);
483  E3dScene* pRootScene = fillViewInformation3DForCompoundObject(aViewInfo3D, *this);
484 
485  if(pRootScene)
486  {
487  const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pRootScene->GetViewContact());
488  const basegfx::B3DPolyPolygon aCubePolyPolygon(CreateWireframe());
490  aViewInfo3D.getObjectToView() * GetTransform());
491  aRetval.transform(rVCScene.getObjectTransformation());
492  }
493 
494  return aRetval;
495 }
496 
498 {
499  // 8 corners + 1 E3dVolumeMarker (= Wireframe representation)
500  return 9;
501 }
502 
504 {
505  const uno::Sequence< beans::PropertyValue > aEmptyParameters;
506  drawinglayer::geometry::ViewInformation3D aViewInfo3D(aEmptyParameters);
507  E3dScene* pRootScene = fillViewInformation3DForCompoundObject(aViewInfo3D, *this);
508 
509  if(pRootScene)
510  {
511  const basegfx::B3DRange aBoundVolume(GetBoundVolume());
512 
513  if(!aBoundVolume.isEmpty())
514  {
515  const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pRootScene->GetViewContact());
516 
517  for(sal_uInt32 a(0); a < 8; a++)
518  {
519  basegfx::B3DPoint aPos3D;
520 
521  switch(a)
522  {
523  case 0 : aPos3D.setX(aBoundVolume.getMinX()); aPos3D.setY(aBoundVolume.getMinY()); aPos3D.setZ(aBoundVolume.getMinZ()); break;
524  case 1 : aPos3D.setX(aBoundVolume.getMinX()); aPos3D.setY(aBoundVolume.getMinY()); aPos3D.setZ(aBoundVolume.getMaxZ()); break;
525  case 2 : aPos3D.setX(aBoundVolume.getMinX()); aPos3D.setY(aBoundVolume.getMaxY()); aPos3D.setZ(aBoundVolume.getMinZ()); break;
526  case 3 : aPos3D.setX(aBoundVolume.getMinX()); aPos3D.setY(aBoundVolume.getMaxY()); aPos3D.setZ(aBoundVolume.getMaxZ()); break;
527  case 4 : aPos3D.setX(aBoundVolume.getMaxX()); aPos3D.setY(aBoundVolume.getMinY()); aPos3D.setZ(aBoundVolume.getMinZ()); break;
528  case 5 : aPos3D.setX(aBoundVolume.getMaxX()); aPos3D.setY(aBoundVolume.getMinY()); aPos3D.setZ(aBoundVolume.getMaxZ()); break;
529  case 6 : aPos3D.setX(aBoundVolume.getMaxX()); aPos3D.setY(aBoundVolume.getMaxY()); aPos3D.setZ(aBoundVolume.getMinZ()); break;
530  case 7 : aPos3D.setX(aBoundVolume.getMaxX()); aPos3D.setY(aBoundVolume.getMaxY()); aPos3D.setZ(aBoundVolume.getMaxZ()); break;
531  }
532 
533  // to 3d view coor
534  aPos3D *= aViewInfo3D.getObjectToView() * GetTransform();
535 
536  // create 2d relative scene
537  basegfx::B2DPoint aPos2D(aPos3D.getX(), aPos3D.getY());
538 
539  // to 2d world coor
540  aPos2D *= rVCScene.getObjectTransformation();
541 
542  rHdlList.AddHdl(std::make_unique<SdrHdl>(Point(basegfx::fround(aPos2D.getX()), basegfx::fround(aPos2D.getY())), SdrHdlKind::BezierWeight));
543  }
544  }
545  }
546 
547  const basegfx::B2DPolyPolygon aPolyPolygon(TakeXorPoly());
548 
549  if(aPolyPolygon.count())
550  {
551  rHdlList.AddHdl(std::make_unique<E3dVolumeMarker>(aPolyPolygon));
552  }
553 }
554 
556 {
557  return E3D_COMPOUNDOBJ_ID;
558 }
559 
561 {
562  const uno::Sequence< beans::PropertyValue > aEmptyParameters;
563  drawinglayer::geometry::ViewInformation3D aViewInfo3D(aEmptyParameters);
564  E3dScene* pRootScene = fillViewInformation3DForCompoundObject(aViewInfo3D, *this);
566 
567  if(!pRootScene)
568  return;
569 
570  // get VC of 3D candidate
571  const sdr::contact::ViewContactOfE3d* pVCOfE3D = dynamic_cast< const sdr::contact::ViewContactOfE3d* >(&GetViewContact());
572 
573  if(!pVCOfE3D)
574  return;
575 
576  // get 3D primitive sequence
578 
579  if(xLocalSequence.empty())
580  return;
581 
582  // get BoundVolume
583  basegfx::B3DRange aBoundVolume(xLocalSequence.getB3DRange(aViewInfo3D));
584 
585  // transform bound volume to relative scene coordinates
586  aBoundVolume.transform(aViewInfo3D.getObjectToView());
587 
588  // build 2d relative scene range
589  basegfx::B2DRange aSnapRange(
590  aBoundVolume.getMinX(), aBoundVolume.getMinY(),
591  aBoundVolume.getMaxX(), aBoundVolume.getMaxY());
592 
593  // transform to 2D world coordinates
594  const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pRootScene->GetViewContact());
595  aSnapRange.transform(rVCScene.getObjectTransformation());
596 
597  // snap to integer
599  sal_Int32(floor(aSnapRange.getMinX())), sal_Int32(floor(aSnapRange.getMinY())),
600  sal_Int32(ceil(aSnapRange.getMaxX())), sal_Int32(ceil(aSnapRange.getMaxY())));
601 }
602 
604 {
605  return new E3dCompoundObject(rTargetModel, *this);
606 }
607 
608 // convert given basegfx::B3DPolyPolygon to screen coor
610 {
611  const uno::Sequence< beans::PropertyValue > aEmptyParameters;
612  drawinglayer::geometry::ViewInformation3D aViewInfo3D(aEmptyParameters);
613  E3dScene* pRootScene = fillViewInformation3DForCompoundObject(aViewInfo3D, *this);
614  basegfx::B2DPolyPolygon aRetval;
615 
616  if(pRootScene)
617  {
619  aViewInfo3D.getObjectToView() * GetTransform());
620  const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pRootScene->GetViewContact());
621  aRetval.transform(rVCScene.getObjectTransformation());
622  }
623 
624  return aRetval;
625 }
626 
627 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: obj3d.cxx:149
virtual OUString TakeObjNameSingul() const override
Definition: obj3d.cxx:389
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: obj3d.cxx:560
virtual void SetTransformChanged()
Definition: obj3d.cxx:333
virtual void StructureChanged() override
Definition: scene3d.cxx:375
bool m_bClosedObj
Definition: svdobj.hxx:892
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
Definition: obj3d.cxx:428
double getMinZ() const
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
Definition: obj3d.cxx:420
void SetGlueReallyAbsolute(bool bOn)
Definition: svdobj.cxx:2283
tools::Long GetWidth() const
SdrInventor
Definition: svdobj.hxx:98
bool isEmpty() const
const drawinglayer::geometry::ViewInformation3D & getViewInformation3D(const ::basegfx::B3DRange &rContentRange) const
double toRadians(Degree10 x)
basegfx::B3DRange maLocalBoundVol
Definition: obj3d.hxx:71
B2DPolyPolygon createB2DPolyPolygonFromB3DPolyPolygon(const B3DPolyPolygon &rCandidate, const B3DHomMatrix &rMat)
drawinglayer::primitive3d::Primitive3DContainer getViewIndependentPrimitive3DContainer() const
const basegfx::B3DHomMatrix & GetTransform() const
Definition: obj3d.hxx:112
virtual const tools::Rectangle & GetSnapRect() const override
Definition: svdoattr.cxx:49
B3DPolyPolygon createCubePolyPolygonFromB3DRange(const B3DRange &rRange)
All geometrical data of an arbitrary object for use in undo/redo.
Definition: svdobj.hxx:172
void scale(double fX, double fY, double fZ)
SdrObjKind
Definition: svdobjkind.hxx:24
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:248
double getMaxZ() const
constexpr tools::Long Width() const
basegfx::B3DHomMatrix maTransformation
Definition: obj3d.hxx:72
Provides information about various ZObject properties.
Definition: svdobj.hxx:194
virtual SdrInventor GetObjInventor() const override
Definition: obj3d.cxx:110
bool mbTfHasChanged
Definition: obj3d.hxx:76
virtual SdrObjKind GetObjIdentifier() const override
Definition: obj3d.cxx:115
virtual SdrObjKind GetObjIdentifier() const override
Definition: obj3d.cxx:555
double getMinX() const
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:25
virtual void StructureChanged()
Definition: obj3d.cxx:261
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
Definition: obj3d.cxx:497
virtual bool IsBreakObjPossible()
Definition: obj3d.cxx:100
static bool IsFuzzing()
tools::Rectangle maSnapRect
Definition: svdoattr.hxx:42
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: obj3d.cxx:503
B2IRange fround(const B2DRange &rRange)
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect)
Definition: svdobj.cxx:131
virtual void NbcRotate(const Point &rRef, Degree100 nAngle, double sn, double cs) override
Definition: obj3d.cxx:440
virtual void NbcSetTransform(const basegfx::B3DHomMatrix &rMatrix)
Definition: obj3d.cxx:360
basegfx::B2DPolyPolygon TransformToScreenCoor(const basegfx::B3DPolyPolygon &rCandidate)
Definition: obj3d.cxx:609
E3dScene * getParentE3dSceneFromE3dObject() const
Definition: obj3d.cxx:272
virtual E3dObject * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: obj3d.cxx:410
virtual void RestoreGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1906
uno_Any a
OUString sName
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: obj3d.cxx:121
void BroadcastObjectChange() const
Definition: svdobj.cxx:982
bool mbIsSelected
Definition: obj3d.hxx:77
virtual void SaveGeoData(SdrObjGeoData &rGeo) const
Definition: svdobj.cxx:1883
SdrObjUserCall * m_pUserCall
Definition: svdobj.hxx:874
void transform(const basegfx::B2DHomMatrix &rMatrix)
const basegfx::B3DHomMatrix & getObjectToView() const
const basegfx::B3DRange & GetBoundVolume() const
Definition: obj3d.cxx:317
double getMinY() const
const basegfx::B3DHomMatrix & GetFullTransform() const
Definition: obj3d.cxx:341
virtual basegfx::B3DRange RecalcBoundVolume() const
Definition: obj3d.cxx:291
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: obj3d.cxx:415
OUString GetName() const
Definition: svdobj.cxx:775
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: obj3d.cxx:47
BASEGFX_DLLPUBLIC void transform(const B3DHomMatrix &rMatrix)
void translate(double fX, double fY, double fZ)
virtual void SetTransform(const basegfx::B3DHomMatrix &rMatrix)
Definition: obj3d.cxx:371
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override
The Xor-Polygon is required by the View to drag the object.
Definition: obj3d.cxx:478
sal_uInt32 count() const
drawinglayer::primitive3d::Primitive3DContainer const & getVIP3DSWithoutObjectTransform() const
E3dObject(SdrModel &rSdrModel)
Definition: obj3d.cxx:52
const basegfx::B2DHomMatrix & getObjectTransformation() const
constexpr tools::Long Height() const
OUString aName
SdrObject * getParentSdrObjectFromSdrObject() const
Definition: svdobj.cxx:726
virtual ~E3dCompoundObject() override
Definition: obj3d.cxx:474
virtual void NbcMove(const Size &rSize) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
Definition: obj3d.cxx:201
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:509
bool m_bIs3DObj
Definition: svdobj.hxx:894
bool mbIsSelected
Helper for 3d object changes affecting 2d geometry.
tools::Long GetHeight() const
basegfx::B2DHomMatrix maTransformation
void rotate(double fAngleX, double fAngleY, double fAngleZ)
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
Definition: obj3d.cxx:459
double getMaxX() const
E3dCompoundObject(SdrModel &rSdrModel, E3dCompoundObject const &rSource)
Definition: obj3d.cxx:469
virtual void SetSelected(bool bNew)
Definition: obj3d.cxx:91
virtual E3dScene * getRootE3dSceneFromE3dObject() const
Definition: obj3d.cxx:278
virtual std::unique_ptr< SdrAttrObj, SdrObjectFreeOp > GetBreakObj()
Definition: obj3d.cxx:105
virtual void SetChanged()
Definition: svdobj.cxx:1006
virtual ~E3dObject() override
Definition: obj3d.cxx:87
double getMaxY() const
virtual E3dCompoundObject * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: obj3d.cxx:603
basegfx::B3DPolyPolygon CreateWireframe() const
Definition: obj3d.cxx:382
virtual E3dScene * getRootE3dSceneFromE3dObject() const override
Definition: scene3d.cxx:391
void InvalidateBoundVolume()
Definition: obj3d.cxx:327
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
Definition: obj3d.cxx:254
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
Definition: svdhdl.cxx:2289
virtual OUString TakeObjNamePlural() const override
Definition: obj3d.cxx:405
basegfx::B3DHomMatrix maFullTransform
Definition: obj3d.hxx:73
void NbcRotateGluePoints(const Point &rRef, Degree100 nAngle, double sn, double cs)
Definition: svdobj.cxx:2293
E3dScene * fillViewInformation3DForCompoundObject(drawinglayer::geometry::ViewInformation3D &o_rViewInformation3D, const E3dCompoundObject &rCandidate)
support for getting a ViewInformation3D for a given CompoudObject3D with correct ObjectTransformation...