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