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