1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: e3dcompoundproperties.cxx,v $
10 * $Revision: 1.9.226.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
33 #include <svx/sdr/properties/e3dcompoundproperties.hxx>
34 #include <svtools/itemset.hxx>
35 #include <svx/obj3d.hxx>
36 #include <svx/scene3d.hxx>
38 //////////////////////////////////////////////////////////////////////////////
44 E3dCompoundProperties::E3dCompoundProperties(SdrObject
& rObj
)
49 E3dCompoundProperties::E3dCompoundProperties(const E3dCompoundProperties
& rProps
, SdrObject
& rObj
)
50 : E3dProperties(rProps
, rObj
)
54 E3dCompoundProperties::~E3dCompoundProperties()
58 BaseProperties
& E3dCompoundProperties::Clone(SdrObject
& rObj
) const
60 return *(new E3dCompoundProperties(*this, rObj
));
63 const SfxItemSet
& E3dCompoundProperties::GetObjectItemSet() const
65 //DBG_ASSERT(sal_False, "E3dCompoundProperties::GetObjectItemSet() maybe the wrong call (!)");
66 return E3dProperties::GetObjectItemSet();
69 const SfxItemSet
& E3dCompoundProperties::GetMergedItemSet() const
71 // include Items of scene this object belongs to
72 E3dCompoundObject
& rObj
= (E3dCompoundObject
&)GetSdrObject();
73 E3dScene
* pScene
= rObj
.GetScene();
80 // add filtered scene properties (SDRATTR_3DSCENE_) to local itemset
81 SfxItemSet
aSet(*mpItemSet
->GetPool(), SDRATTR_3DSCENE_FIRST
, SDRATTR_3DSCENE_LAST
);
82 aSet
.Put(pScene
->GetProperties().GetObjectItemSet());
87 return E3dProperties::GetMergedItemSet();
90 void E3dCompoundProperties::SetMergedItemSet(const SfxItemSet
& rSet
, sal_Bool bClearAllItems
)
92 // Set scene specific items at scene
93 E3dCompoundObject
& rObj
= (E3dCompoundObject
&)GetSdrObject();
94 E3dScene
* pScene
= rObj
.GetScene();
101 // Generate filtered scene properties (SDRATTR_3DSCENE_) itemset
102 SfxItemSet
aSet(*mpItemSet
->GetPool(), SDRATTR_3DSCENE_FIRST
, SDRATTR_3DSCENE_LAST
);
107 pScene
->GetProperties().ClearObjectItem();
112 pScene
->GetProperties().SetObjectItemSet(aSet
);
116 // call parent. This will set items on local object, too.
117 E3dProperties::SetMergedItemSet(rSet
, bClearAllItems
);
120 void E3dCompoundProperties::PostItemChange(const sal_uInt16 nWhich
)
123 E3dProperties::PostItemChange(nWhich
);
125 // handle value change
126 E3dCompoundObject
& rObj
= (E3dCompoundObject
&)GetSdrObject();
131 // Added extra Item (Bool) for chart2 to be able to show reduced line geometry
132 case SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY
:
134 rObj
.ActionChanged();
137 case SDRATTR_3DOBJ_DOUBLE_SIDED
:
139 rObj
.ActionChanged();
142 case SDRATTR_3DOBJ_NORMALS_KIND
:
144 rObj
.ActionChanged();
147 case SDRATTR_3DOBJ_NORMALS_INVERT
:
149 rObj
.ActionChanged();
152 case SDRATTR_3DOBJ_TEXTURE_PROJ_X
:
154 rObj
.ActionChanged();
157 case SDRATTR_3DOBJ_TEXTURE_PROJ_Y
:
159 rObj
.ActionChanged();
164 } // end of namespace properties
165 } // end of namespace sdr
167 //////////////////////////////////////////////////////////////////////////////