summaryrefslogtreecommitdiff
path: root/svx/source/unodraw/unoshap3.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/unodraw/unoshap3.cxx')
-rw-r--r--svx/source/unodraw/unoshap3.cxx182
1 files changed, 57 insertions, 125 deletions
diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx
index 66ac52b876db..663dcc9f6bd9 100644
--- a/svx/source/unodraw/unoshap3.cxx
+++ b/svx/source/unodraw/unoshap3.cxx
@@ -45,6 +45,7 @@
#include <basegfx/polygon/b3dpolygontools.hxx>
#include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <basegfx/matrix/b3dhommatrixtools.hxx>
#include "shapeimpl.hxx"
using namespace ::cppu;
@@ -118,13 +119,13 @@ void SAL_CALL Svx3DSceneObject::add( const Reference< drawing::XShape >& xShape
SvxShape* pShape = SvxShape::getImplementation( xShape );
- if(!mpObj.is() || !mxPage.is() || pShape == nullptr || nullptr != pShape->GetSdrObject() )
+ if(!HasSdrObject() || !mxPage.is() || pShape == nullptr || nullptr != pShape->GetSdrObject() )
throw uno::RuntimeException();
SdrObject* pSdrShape = mxPage->CreateSdrObject_( xShape );
if( dynamic_cast<const E3dObject* >(pSdrShape) != nullptr )
{
- mpObj->GetSubList()->NbcInsertObject( pSdrShape );
+ GetSdrObject()->GetSubList()->NbcInsertObject( pSdrShape );
if(pShape)
pShape->Create( pSdrShape, mxPage.get() );
@@ -135,8 +136,7 @@ void SAL_CALL Svx3DSceneObject::add( const Reference< drawing::XShape >& xShape
throw uno::RuntimeException();
}
- if( mpModel )
- mpModel->SetChanged();
+ GetSdrObject()->getSdrModelFromSdrObject().SetChanged();
}
@@ -146,11 +146,11 @@ void SAL_CALL Svx3DSceneObject::remove( const Reference< drawing::XShape >& xSha
SvxShape* pShape = SvxShape::getImplementation( xShape );
- if(!mpObj.is() || pShape == nullptr)
+ if(!HasSdrObject() || pShape == nullptr)
throw uno::RuntimeException();
SdrObject* pSdrShape = pShape->GetSdrObject();
- if(pSdrShape == nullptr || pSdrShape->GetObjList()->GetOwnerObj() != mpObj.get())
+ if(pSdrShape == nullptr || pSdrShape->GetObjList()->GetOwnerObj() != GetSdrObject())
{
throw uno::RuntimeException();
}
@@ -184,8 +184,8 @@ sal_Int32 SAL_CALL Svx3DSceneObject::getCount()
sal_Int32 nRetval = 0;
- if(mpObj.is() && dynamic_cast<const E3dScene* >(mpObj.get()) != nullptr && mpObj->GetSubList())
- nRetval = mpObj->GetSubList()->GetObjCount();
+ if(HasSdrObject() && dynamic_cast<const E3dScene* >(GetSdrObject()) != nullptr && GetSdrObject()->GetSubList())
+ nRetval = GetSdrObject()->GetSubList()->GetObjCount();
return nRetval;
}
@@ -194,13 +194,13 @@ uno::Any SAL_CALL Svx3DSceneObject::getByIndex( sal_Int32 Index )
{
SolarMutexGuard aGuard;
- if( !mpObj.is() || mpObj->GetSubList() == nullptr )
+ if( !HasSdrObject() || GetSdrObject()->GetSubList() == nullptr )
throw uno::RuntimeException();
- if( Index<0 || mpObj->GetSubList()->GetObjCount() <= static_cast<size_t>(Index) )
+ if( Index<0 || GetSdrObject()->GetSubList()->GetObjCount() <= static_cast<size_t>(Index) )
throw lang::IndexOutOfBoundsException();
- SdrObject* pDestObj = mpObj->GetSubList()->GetObj( Index );
+ SdrObject* pDestObj = GetSdrObject()->GetSubList()->GetObj( Index );
if(pDestObj == nullptr)
throw lang::IndexOutOfBoundsException();
@@ -221,33 +221,16 @@ sal_Bool SAL_CALL Svx3DSceneObject::hasElements()
{
SolarMutexGuard aGuard;
- return mpObj.is() && mpObj->GetSubList() && (mpObj->GetSubList()->GetObjCount() > 0);
+ return HasSdrObject() && GetSdrObject()->GetSubList() && (GetSdrObject()->GetSubList()->GetObjCount() > 0);
}
static bool ConvertHomogenMatrixToObject( E3dObject* pObject, const Any& rValue )
{
- drawing::HomogenMatrix m;
- if( rValue >>= m )
+ drawing::HomogenMatrix aMat;
+ if( rValue >>= aMat )
{
- basegfx::B3DHomMatrix aMat;
- aMat.set(0, 0, m.Line1.Column1);
- aMat.set(0, 1, m.Line1.Column2);
- aMat.set(0, 2, m.Line1.Column3);
- aMat.set(0, 3, m.Line1.Column4);
- aMat.set(1, 0, m.Line2.Column1);
- aMat.set(1, 1, m.Line2.Column2);
- aMat.set(1, 2, m.Line2.Column3);
- aMat.set(1, 3, m.Line2.Column4);
- aMat.set(2, 0, m.Line3.Column1);
- aMat.set(2, 1, m.Line3.Column2);
- aMat.set(2, 2, m.Line3.Column3);
- aMat.set(2, 3, m.Line3.Column4);
- aMat.set(3, 0, m.Line4.Column1);
- aMat.set(3, 1, m.Line4.Column2);
- aMat.set(3, 2, m.Line4.Column3);
- aMat.set(3, 3, m.Line4.Column4);
- pObject->SetTransform(aMat);
+ pObject->SetTransform(basegfx::utils::UnoHomogenMatrixToB3DHomMatrix(aMat));
return true;
}
return false;
@@ -257,22 +240,7 @@ static void ConvertObjectToHomogenMatric( E3dObject const * pObject, Any& rValue
{
drawing::HomogenMatrix aHomMat;
const basegfx::B3DHomMatrix& rMat = pObject->GetTransform();
- aHomMat.Line1.Column1 = rMat.get(0, 0);
- aHomMat.Line1.Column2 = rMat.get(0, 1);
- aHomMat.Line1.Column3 = rMat.get(0, 2);
- aHomMat.Line1.Column4 = rMat.get(0, 3);
- aHomMat.Line2.Column1 = rMat.get(1, 0);
- aHomMat.Line2.Column2 = rMat.get(1, 1);
- aHomMat.Line2.Column3 = rMat.get(1, 2);
- aHomMat.Line2.Column4 = rMat.get(1, 3);
- aHomMat.Line3.Column1 = rMat.get(2, 0);
- aHomMat.Line3.Column2 = rMat.get(2, 1);
- aHomMat.Line3.Column3 = rMat.get(2, 2);
- aHomMat.Line3.Column4 = rMat.get(2, 3);
- aHomMat.Line4.Column1 = rMat.get(3, 0);
- aHomMat.Line4.Column2 = rMat.get(3, 1);
- aHomMat.Line4.Column3 = rMat.get(3, 2);
- aHomMat.Line4.Column4 = rMat.get(3, 3);
+ basegfx::utils::B3DHomMatrixToUnoHomogenMatrix(rMat, aHomMat);
rValue <<= aHomMat;
}
@@ -290,14 +258,14 @@ bool Svx3DSceneObject::setPropertyValueImpl( const OUString& rName, const SfxIte
case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
// patch transformation matrix to the object
- if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
+ if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( GetSdrObject() ), rValue ) )
return true;
break;
}
case OWN_ATTR_3D_VALUE_CAMERA_GEOMETRY:
{
// set CameraGeometry at scene
- E3dScene* pScene = static_cast< E3dScene* >( mpObj.get() );
+ E3dScene* pScene = static_cast< E3dScene* >( GetSdrObject() );
drawing::CameraGeometry aCamGeo;
if(rValue >>= aCamGeo)
@@ -402,13 +370,13 @@ bool Svx3DSceneObject::getPropertyValueImpl(const OUString& rName, const SfxItem
case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
// patch object to a homogeneous 4x4 matrix
- ConvertObjectToHomogenMatric( static_cast< E3dObject* >( mpObj.get() ), rValue );
+ ConvertObjectToHomogenMatric( static_cast< E3dObject* >( GetSdrObject() ), rValue );
break;
}
case OWN_ATTR_3D_VALUE_CAMERA_GEOMETRY:
{
// get CameraGeometry from scene
- E3dScene* pScene = static_cast< E3dScene* >( mpObj.get() );
+ E3dScene* pScene = static_cast< E3dScene* >( GetSdrObject() );
drawing::CameraGeometry aCamGeo;
// fill Vectors from scene camera
@@ -464,7 +432,7 @@ bool Svx3DCubeObject::setPropertyValueImpl( const OUString& rName, const SfxItem
case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
// pack transformationmatrix to the object
- if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
+ if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( GetSdrObject() ), rValue ) )
return true;
break;
}
@@ -475,7 +443,7 @@ bool Svx3DCubeObject::setPropertyValueImpl( const OUString& rName, const SfxItem
if( rValue >>= aUnoPos )
{
basegfx::B3DPoint aPos(aUnoPos.PositionX, aUnoPos.PositionY, aUnoPos.PositionZ);
- static_cast< E3dCubeObj* >( mpObj.get() )->SetCubePos(aPos);
+ static_cast< E3dCubeObj* >( GetSdrObject() )->SetCubePos(aPos);
return true;
}
break;
@@ -487,7 +455,7 @@ bool Svx3DCubeObject::setPropertyValueImpl( const OUString& rName, const SfxItem
if( rValue >>= aDirection )
{
basegfx::B3DVector aSize(aDirection.DirectionX, aDirection.DirectionY, aDirection.DirectionZ);
- static_cast< E3dCubeObj* >( mpObj.get() )->SetCubeSize(aSize);
+ static_cast< E3dCubeObj* >( GetSdrObject() )->SetCubeSize(aSize);
return true;
}
break;
@@ -498,7 +466,7 @@ bool Svx3DCubeObject::setPropertyValueImpl( const OUString& rName, const SfxItem
// pack sal_Bool bPosIsCenter to the object
if( rValue >>= bNew )
{
- static_cast< E3dCubeObj* >( mpObj.get() )->SetPosIsCenter(bNew);
+ static_cast< E3dCubeObj* >( GetSdrObject() )->SetPosIsCenter(bNew);
return true;
}
break;
@@ -517,13 +485,13 @@ bool Svx3DCubeObject::getPropertyValueImpl( const OUString& rName, const SfxItem
case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
// pack transformation to a homogeneous matrix
- ConvertObjectToHomogenMatric( static_cast< E3dObject* >( mpObj.get() ), rValue );
+ ConvertObjectToHomogenMatric( static_cast< E3dObject* >( GetSdrObject() ), rValue );
break;
}
case OWN_ATTR_3D_VALUE_POSITION:
{
// pack position
- const basegfx::B3DPoint& rPos = static_cast<E3dCubeObj*>(mpObj.get())->GetCubePos();
+ const basegfx::B3DPoint& rPos = static_cast<E3dCubeObj*>(GetSdrObject())->GetCubePos();
drawing::Position3D aPos;
aPos.PositionX = rPos.getX();
@@ -536,7 +504,7 @@ bool Svx3DCubeObject::getPropertyValueImpl( const OUString& rName, const SfxItem
case OWN_ATTR_3D_VALUE_SIZE:
{
// pack size
- const basegfx::B3DVector& rSize = static_cast<E3dCubeObj*>(mpObj.get())->GetCubeSize();
+ const basegfx::B3DVector& rSize = static_cast<E3dCubeObj*>(GetSdrObject())->GetCubeSize();
drawing::Direction3D aDir;
aDir.DirectionX = rSize.getX();
@@ -548,7 +516,7 @@ bool Svx3DCubeObject::getPropertyValueImpl( const OUString& rName, const SfxItem
}
case OWN_ATTR_3D_VALUE_POS_IS_CENTER:
{
- rValue <<= static_cast<E3dCubeObj*>(mpObj.get())->GetPosIsCenter();
+ rValue <<= static_cast<E3dCubeObj*>(GetSdrObject())->GetPosIsCenter();
break;
}
default:
@@ -583,7 +551,7 @@ bool Svx3DSphereObject::setPropertyValueImpl( const OUString& rName, const SfxIt
case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
// pack transformation matrix to the object
- if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
+ if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( GetSdrObject() ), rValue ) )
return true;
break;
}
@@ -595,7 +563,7 @@ bool Svx3DSphereObject::setPropertyValueImpl( const OUString& rName, const SfxIt
if( rValue >>= aUnoPos )
{
basegfx::B3DPoint aPos(aUnoPos.PositionX, aUnoPos.PositionY, aUnoPos.PositionZ);
- static_cast<E3dSphereObj*>(mpObj.get())->SetCenter(aPos);
+ static_cast<E3dSphereObj*>(GetSdrObject())->SetCenter(aPos);
return true;
}
break;
@@ -608,7 +576,7 @@ bool Svx3DSphereObject::setPropertyValueImpl( const OUString& rName, const SfxIt
if( rValue >>= aDir )
{
basegfx::B3DVector aPos(aDir.DirectionX, aDir.DirectionY, aDir.DirectionZ);
- static_cast<E3dSphereObj*>(mpObj.get())->SetSize(aPos);
+ static_cast<E3dSphereObj*>(GetSdrObject())->SetSize(aPos);
return true;
}
break;
@@ -627,13 +595,13 @@ bool Svx3DSphereObject::getPropertyValueImpl( const OUString& rName, const SfxIt
case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
// pack transformation to a homogeneous matrix
- ConvertObjectToHomogenMatric( static_cast< E3dObject* >( mpObj.get() ), rValue );
+ ConvertObjectToHomogenMatric( static_cast< E3dObject* >( GetSdrObject() ), rValue );
break;
}
case OWN_ATTR_3D_VALUE_POSITION:
{
// pack position
- const basegfx::B3DPoint& rPos = static_cast<E3dSphereObj*>(mpObj.get())->Center();
+ const basegfx::B3DPoint& rPos = static_cast<E3dSphereObj*>(GetSdrObject())->Center();
drawing::Position3D aPos;
aPos.PositionX = rPos.getX();
@@ -646,7 +614,7 @@ bool Svx3DSphereObject::getPropertyValueImpl( const OUString& rName, const SfxIt
case OWN_ATTR_3D_VALUE_SIZE:
{
// pack size
- const basegfx::B3DVector& rSize = static_cast<E3dSphereObj*>(mpObj.get())->Size();
+ const basegfx::B3DVector& rSize = static_cast<E3dSphereObj*>(GetSdrObject())->Size();
drawing::Direction3D aDir;
aDir.DirectionX = rSize.getX();
@@ -776,7 +744,7 @@ bool Svx3DLatheObject::setPropertyValueImpl( const OUString& rName, const SfxIte
case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
// pack transformation matrix to the object
- if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
+ if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( GetSdrObject() ), rValue ) )
return true;
break;
}
@@ -791,18 +759,18 @@ bool Svx3DLatheObject::setPropertyValueImpl( const OUString& rName, const SfxIte
// #105127# SetPolyPoly3D sets the Svx3DVerticalSegmentsItem to the number
// of points of the polygon. Thus, value gets lost. To avoid this, rescue
// item here and re-set after setting the polygon.
- const sal_uInt32 nPrevVerticalSegs(static_cast<E3dLatheObj*>(mpObj.get())->GetVerticalSegments());
+ const sal_uInt32 nPrevVerticalSegs(static_cast<E3dLatheObj*>(GetSdrObject())->GetVerticalSegments());
// set polygon
const basegfx::B3DHomMatrix aIdentity;
const basegfx::B2DPolyPolygon aB2DPolyPolygon(basegfx::utils::createB2DPolyPolygonFromB3DPolyPolygon(aNewB3DPolyPolygon, aIdentity));
- static_cast<E3dLatheObj*>(mpObj.get())->SetPolyPoly2D(aB2DPolyPolygon);
- const sal_uInt32 nPostVerticalSegs(static_cast<E3dLatheObj*>(mpObj.get())->GetVerticalSegments());
+ static_cast<E3dLatheObj*>(GetSdrObject())->SetPolyPoly2D(aB2DPolyPolygon);
+ const sal_uInt32 nPostVerticalSegs(static_cast<E3dLatheObj*>(GetSdrObject())->GetVerticalSegments());
if(nPrevVerticalSegs != nPostVerticalSegs)
{
// restore the vertical segment count
- static_cast<E3dLatheObj*>(mpObj.get())->SetMergedItem(makeSvx3DVerticalSegmentsItem(nPrevVerticalSegs));
+ static_cast<E3dLatheObj*>(GetSdrObject())->SetMergedItem(makeSvx3DVerticalSegmentsItem(nPrevVerticalSegs));
}
return true;
}
@@ -823,32 +791,14 @@ bool Svx3DLatheObject::getPropertyValueImpl( const OUString& rName, const SfxIte
{
// pack transformation to a homogeneous matrix
drawing::HomogenMatrix aHomMat;
- basegfx::B3DHomMatrix aMat = static_cast<E3dObject*>(mpObj.get())->GetTransform();
-
- // pack evtl. transformed matrix to output
- aHomMat.Line1.Column1 = aMat.get(0, 0);
- aHomMat.Line1.Column2 = aMat.get(0, 1);
- aHomMat.Line1.Column3 = aMat.get(0, 2);
- aHomMat.Line1.Column4 = aMat.get(0, 3);
- aHomMat.Line2.Column1 = aMat.get(1, 0);
- aHomMat.Line2.Column2 = aMat.get(1, 1);
- aHomMat.Line2.Column3 = aMat.get(1, 2);
- aHomMat.Line2.Column4 = aMat.get(1, 3);
- aHomMat.Line3.Column1 = aMat.get(2, 0);
- aHomMat.Line3.Column2 = aMat.get(2, 1);
- aHomMat.Line3.Column3 = aMat.get(2, 2);
- aHomMat.Line3.Column4 = aMat.get(2, 3);
- aHomMat.Line4.Column1 = aMat.get(3, 0);
- aHomMat.Line4.Column2 = aMat.get(3, 1);
- aHomMat.Line4.Column3 = aMat.get(3, 2);
- aHomMat.Line4.Column4 = aMat.get(3, 3);
-
+ basegfx::B3DHomMatrix aMat = static_cast<E3dObject*>(GetSdrObject())->GetTransform();
+ basegfx::utils::B3DHomMatrixToUnoHomogenMatrix(aMat, aHomMat);
rValue <<= aHomMat;
break;
}
case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
{
- const basegfx::B2DPolyPolygon& rPolyPoly = static_cast<E3dLatheObj*>(mpObj.get())->GetPolyPoly2D();
+ const basegfx::B2DPolyPolygon& rPolyPoly = static_cast<E3dLatheObj*>(GetSdrObject())->GetPolyPoly2D();
const basegfx::B3DPolyPolygon aB3DPolyPolygon(basegfx::utils::createB3DPolyPolygonFromB2DPolyPolygon(rPolyPoly));
B3dPolyPolygon_to_PolyPolygonShape3D(aB3DPolyPolygon, rValue);
@@ -886,7 +836,7 @@ bool Svx3DExtrudeObject::setPropertyValueImpl( const OUString& rName, const SfxI
case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
// pack transformation matrix to the object
- if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
+ if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( GetSdrObject() ), rValue ) )
return true;
break;
}
@@ -902,7 +852,7 @@ bool Svx3DExtrudeObject::setPropertyValueImpl( const OUString& rName, const SfxI
// set polygon
const basegfx::B3DHomMatrix aIdentity;
const basegfx::B2DPolyPolygon aB2DPolyPolygon(basegfx::utils::createB2DPolyPolygonFromB3DPolyPolygon(aNewB3DPolyPolygon, aIdentity));
- static_cast<E3dExtrudeObj*>(mpObj.get())->SetExtrudePolygon(aB2DPolyPolygon);
+ static_cast<E3dExtrudeObj*>(GetSdrObject())->SetExtrudePolygon(aB2DPolyPolygon);
return true;
}
break;
@@ -922,26 +872,8 @@ bool Svx3DExtrudeObject::getPropertyValueImpl( const OUString& rName, const SfxI
{
// pack transformation to a homogeneous matrix
drawing::HomogenMatrix aHomMat;
- basegfx::B3DHomMatrix aMat = static_cast<E3dObject*>(mpObj.get())->GetTransform();
-
- // pack evtl. transformed matrix to output
- aHomMat.Line1.Column1 = aMat.get(0, 0);
- aHomMat.Line1.Column2 = aMat.get(0, 1);
- aHomMat.Line1.Column3 = aMat.get(0, 2);
- aHomMat.Line1.Column4 = aMat.get(0, 3);
- aHomMat.Line2.Column1 = aMat.get(1, 0);
- aHomMat.Line2.Column2 = aMat.get(1, 1);
- aHomMat.Line2.Column3 = aMat.get(1, 2);
- aHomMat.Line2.Column4 = aMat.get(1, 3);
- aHomMat.Line3.Column1 = aMat.get(2, 0);
- aHomMat.Line3.Column2 = aMat.get(2, 1);
- aHomMat.Line3.Column3 = aMat.get(2, 2);
- aHomMat.Line3.Column4 = aMat.get(2, 3);
- aHomMat.Line4.Column1 = aMat.get(3, 0);
- aHomMat.Line4.Column2 = aMat.get(3, 1);
- aHomMat.Line4.Column3 = aMat.get(3, 2);
- aHomMat.Line4.Column4 = aMat.get(3, 3);
-
+ basegfx::B3DHomMatrix aMat = static_cast<E3dObject*>(GetSdrObject())->GetTransform();
+ basegfx::utils::B3DHomMatrixToUnoHomogenMatrix(aMat, aHomMat);
rValue <<= aHomMat;
break;
}
@@ -949,7 +881,7 @@ bool Svx3DExtrudeObject::getPropertyValueImpl( const OUString& rName, const SfxI
case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
{
// pack polygon definition
- const basegfx::B2DPolyPolygon& rPolyPoly = static_cast<E3dExtrudeObj*>(mpObj.get())->GetExtrudePolygon();
+ const basegfx::B2DPolyPolygon& rPolyPoly = static_cast<E3dExtrudeObj*>(GetSdrObject())->GetExtrudePolygon();
const basegfx::B3DPolyPolygon aB3DPolyPolygon(basegfx::utils::createB3DPolyPolygonFromB2DPolyPolygon(rPolyPoly));
B3dPolyPolygon_to_PolyPolygonShape3D(aB3DPolyPolygon, rValue);
@@ -987,7 +919,7 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const OUString& rName, const SfxI
case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
// pack transformation matrix to the object
- if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
+ if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( GetSdrObject() ), rValue ) )
return true;
break;
}
@@ -1001,7 +933,7 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const OUString& rName, const SfxI
if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
{
// set polygon
- static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyPolygon3D(aNewB3DPolyPolygon);
+ static_cast<E3dPolygonObj*>(GetSdrObject())->SetPolyPolygon3D(aNewB3DPolyPolygon);
return true;
}
break;
@@ -1015,7 +947,7 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const OUString& rName, const SfxI
if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
{
// set polygon
- static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyNormals3D(aNewB3DPolyPolygon);
+ static_cast<E3dPolygonObj*>(GetSdrObject())->SetPolyNormals3D(aNewB3DPolyPolygon);
return true;
}
break;
@@ -1031,7 +963,7 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const OUString& rName, const SfxI
// set polygon
const basegfx::B3DHomMatrix aIdentity;
const basegfx::B2DPolyPolygon aB2DPolyPolygon(basegfx::utils::createB2DPolyPolygonFromB3DPolyPolygon(aNewB3DPolyPolygon, aIdentity));
- static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyTexture2D(aB2DPolyPolygon);
+ static_cast<E3dPolygonObj*>(GetSdrObject())->SetPolyTexture2D(aB2DPolyPolygon);
return true;
}
break;
@@ -1041,7 +973,7 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const OUString& rName, const SfxI
bool bNew = false;
if( rValue >>= bNew )
{
- static_cast<E3dPolygonObj*>(mpObj.get())->SetLineOnly(bNew);
+ static_cast<E3dPolygonObj*>(GetSdrObject())->SetLineOnly(bNew);
return true;
}
break;
@@ -1059,26 +991,26 @@ bool Svx3DPolygonObject::getPropertyValueImpl( const OUString& rName, const SfxI
{
case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
- ConvertObjectToHomogenMatric( static_cast< E3dObject* >( mpObj.get() ), rValue );
+ ConvertObjectToHomogenMatric( static_cast< E3dObject* >( GetSdrObject() ), rValue );
break;
}
case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
{
- B3dPolyPolygon_to_PolyPolygonShape3D(static_cast<E3dPolygonObj*>(mpObj.get())->GetPolyPolygon3D(),rValue);
+ B3dPolyPolygon_to_PolyPolygonShape3D(static_cast<E3dPolygonObj*>(GetSdrObject())->GetPolyPolygon3D(),rValue);
break;
}
case OWN_ATTR_3D_VALUE_NORMALSPOLYGON3D:
{
- B3dPolyPolygon_to_PolyPolygonShape3D(static_cast<E3dPolygonObj*>(mpObj.get())->GetPolyNormals3D(),rValue);
+ B3dPolyPolygon_to_PolyPolygonShape3D(static_cast<E3dPolygonObj*>(GetSdrObject())->GetPolyNormals3D(),rValue);
break;
}
case OWN_ATTR_3D_VALUE_TEXTUREPOLYGON3D:
{
// pack texture definition
- const basegfx::B2DPolyPolygon& rPolyPoly = static_cast<E3dPolygonObj*>(mpObj.get())->GetPolyTexture2D();
+ const basegfx::B2DPolyPolygon& rPolyPoly = static_cast<E3dPolygonObj*>(GetSdrObject())->GetPolyTexture2D();
const basegfx::B3DPolyPolygon aB3DPolyPolygon(basegfx::utils::createB3DPolyPolygonFromB2DPolyPolygon(rPolyPoly));
B3dPolyPolygon_to_PolyPolygonShape3D(aB3DPolyPolygon,rValue);
@@ -1087,7 +1019,7 @@ bool Svx3DPolygonObject::getPropertyValueImpl( const OUString& rName, const SfxI
case OWN_ATTR_3D_VALUE_LINEONLY:
{
- rValue <<= static_cast<E3dPolygonObj*>(mpObj.get())->GetLineOnly();
+ rValue <<= static_cast<E3dPolygonObj*>(GetSdrObject())->GetLineOnly();
break;
}