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