1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <svx/sdr/properties/e3dcompoundproperties.hxx>
21 #include <svl/itemset.hxx>
22 #include <svx/obj3d.hxx>
23 #include <svx/scene3d.hxx>
25 //////////////////////////////////////////////////////////////////////////////
31 E3dCompoundProperties::E3dCompoundProperties(SdrObject
& rObj
)
36 E3dCompoundProperties::E3dCompoundProperties(const E3dCompoundProperties
& rProps
, SdrObject
& rObj
)
37 : E3dProperties(rProps
, rObj
)
41 E3dCompoundProperties::~E3dCompoundProperties()
45 BaseProperties
& E3dCompoundProperties::Clone(SdrObject
& rObj
) const
47 return *(new E3dCompoundProperties(*this, rObj
));
50 const SfxItemSet
& E3dCompoundProperties::GetObjectItemSet() const
52 //DBG_ASSERT(sal_False, "E3dCompoundProperties::GetObjectItemSet() maybe the wrong call (!)");
53 return E3dProperties::GetObjectItemSet();
56 const SfxItemSet
& E3dCompoundProperties::GetMergedItemSet() const
58 // include Items of scene this object belongs to
59 E3dCompoundObject
& rObj
= (E3dCompoundObject
&)GetSdrObject();
60 E3dScene
* pScene
= rObj
.GetScene();
67 // add filtered scene properties (SDRATTR_3DSCENE_) to local itemset
68 SfxItemSet
aSet(*mpItemSet
->GetPool(), SDRATTR_3DSCENE_FIRST
, SDRATTR_3DSCENE_LAST
);
69 aSet
.Put(pScene
->GetProperties().GetObjectItemSet());
74 return E3dProperties::GetMergedItemSet();
77 void E3dCompoundProperties::SetMergedItemSet(const SfxItemSet
& rSet
, sal_Bool bClearAllItems
)
79 // Set scene specific items at scene
80 E3dCompoundObject
& rObj
= (E3dCompoundObject
&)GetSdrObject();
81 E3dScene
* pScene
= rObj
.GetScene();
88 // Generate filtered scene properties (SDRATTR_3DSCENE_) itemset
89 SfxItemSet
aSet(*mpItemSet
->GetPool(), SDRATTR_3DSCENE_FIRST
, SDRATTR_3DSCENE_LAST
);
94 pScene
->GetProperties().ClearObjectItem();
99 pScene
->GetProperties().SetObjectItemSet(aSet
);
103 // call parent. This will set items on local object, too.
104 E3dProperties::SetMergedItemSet(rSet
, bClearAllItems
);
107 void E3dCompoundProperties::PostItemChange(const sal_uInt16 nWhich
)
110 E3dProperties::PostItemChange(nWhich
);
112 // handle value change
113 E3dCompoundObject
& rObj
= (E3dCompoundObject
&)GetSdrObject();
118 // Added extra Item (Bool) for chart2 to be able to show reduced line geometry
119 case SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY
:
121 rObj
.ActionChanged();
124 case SDRATTR_3DOBJ_DOUBLE_SIDED
:
126 rObj
.ActionChanged();
129 case SDRATTR_3DOBJ_NORMALS_KIND
:
131 rObj
.ActionChanged();
134 case SDRATTR_3DOBJ_NORMALS_INVERT
:
136 rObj
.ActionChanged();
139 case SDRATTR_3DOBJ_TEXTURE_PROJ_X
:
141 rObj
.ActionChanged();
144 case SDRATTR_3DOBJ_TEXTURE_PROJ_Y
:
146 rObj
.ActionChanged();
151 } // end of namespace properties
152 } // end of namespace sdr
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */