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