summaryrefslogtreecommitdiff
path: root/svx/source/engine3d/sphere3d.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/engine3d/sphere3d.cxx')
-rw-r--r--svx/source/engine3d/sphere3d.cxx46
1 files changed, 25 insertions, 21 deletions
diff --git a/svx/source/engine3d/sphere3d.cxx b/svx/source/engine3d/sphere3d.cxx
index ecac05170094..75670c2e28d7 100644
--- a/svx/source/engine3d/sphere3d.cxx
+++ b/svx/source/engine3d/sphere3d.cxx
@@ -33,25 +33,24 @@
#include <sdr/contact/viewcontactofe3dsphere.hxx>
#include <basegfx/polygon/b3dpolygon.hxx>
-
// DrawContact section
-
sdr::contact::ViewContact* E3dSphereObj::CreateObjectSpecificViewContact()
{
return new sdr::contact::ViewContactOfE3dSphere(*this);
}
-
sdr::properties::BaseProperties* E3dSphereObj::CreateObjectSpecificProperties()
{
return new sdr::properties::E3dSphereProperties(*this);
}
-
// Build Sphere from polygon facets in latitude and longitude
-
-E3dSphereObj::E3dSphereObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoint& rCenter, const basegfx::B3DVector& r3DSize)
-: E3dCompoundObject()
+E3dSphereObj::E3dSphereObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
+ const basegfx::B3DPoint& rCenter,
+ const basegfx::B3DVector& r3DSize)
+: E3dCompoundObject(rSdrModel)
{
// Set defaults
SetDefaultAttributes(rDefault);
@@ -60,23 +59,16 @@ E3dSphereObj::E3dSphereObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoi
aSize = r3DSize;
}
-// Create Sphere without creating the Polygons within
-
-// This call is from the 3D Object Factory (objfac3d.cxx) and only when loading
-// of documents. Here you do not need CreateSphere call, since the real number
-// of segments is not even known yet. This was until 10.02.1997 a (small)
-// memory leak.
-
-E3dSphereObj::E3dSphereObj(Dummy /*dummy*/)
-// the parameters it needs to be able to distinguish which
-// constructors of the two is meant. The above is the default.
+E3dSphereObj::E3dSphereObj(SdrModel& rSdrModel)
+: E3dCompoundObject(rSdrModel)
{
// Set defaults
- E3dDefaultAttributes aDefault;
+ const E3dDefaultAttributes aDefault;
+
SetDefaultAttributes(aDefault);
}
-void E3dSphereObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault)
+void E3dSphereObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault)
{
// Set defaults
aCenter = rDefault.GetDefaultSphereCenter();
@@ -95,9 +87,21 @@ SdrObject *E3dSphereObj::DoConvertToPolyObj(bool /*bBezier*/, bool /*bAddText*/)
return nullptr;
}
-E3dSphereObj* E3dSphereObj::Clone() const
+E3dSphereObj* E3dSphereObj::Clone(SdrModel* pTargetModel) const
+{
+ return CloneHelper< E3dSphereObj >(pTargetModel);
+}
+
+E3dSphereObj& E3dSphereObj::operator=(const E3dSphereObj& rObj)
{
- return CloneHelper< E3dSphereObj >();
+ if( this == &rObj )
+ return *this;
+ E3dCompoundObject::operator=(rObj);
+
+ aCenter = rObj.aCenter;
+ aSize = rObj.aSize;
+
+ return *this;
}
// Set local parameters with geometry re-creating