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 <sdr/properties/e3dcompoundproperties.hxx>
21 #include <svl/itemset.hxx>
22 #include <svx/obj3d.hxx>
23 #include <svx/scene3d.hxx>
26 namespace sdr::properties
28 E3dCompoundProperties::E3dCompoundProperties(SdrObject
& rObj
)
33 E3dCompoundProperties::E3dCompoundProperties(const E3dCompoundProperties
& rProps
, SdrObject
& rObj
)
34 : E3dProperties(rProps
, rObj
)
38 E3dCompoundProperties::~E3dCompoundProperties()
42 std::unique_ptr
<BaseProperties
> E3dCompoundProperties::Clone(SdrObject
& rObj
) const
44 return std::unique_ptr
<BaseProperties
>(new E3dCompoundProperties(*this, rObj
));
47 const SfxItemSet
& E3dCompoundProperties::GetMergedItemSet() const
49 // include Items of scene this object belongs to
50 const E3dCompoundObject
& rObj
= static_cast<const E3dCompoundObject
&>(GetSdrObject());
51 E3dScene
* pScene(rObj
.getRootE3dSceneFromE3dObject());
58 // add filtered scene properties (SDRATTR_3DSCENE_) to local itemset
59 SfxItemSetFixed
<SDRATTR_3DSCENE_FIRST
, SDRATTR_3DSCENE_LAST
> aSet(*moItemSet
->GetPool() );
60 aSet
.Put(pScene
->GetProperties().GetObjectItemSet());
65 return E3dProperties::GetMergedItemSet();
68 void E3dCompoundProperties::SetMergedItemSet(const SfxItemSet
& rSet
, bool bClearAllItems
, bool bAdjustTextFrameWidthAndHeight
)
70 // Set scene specific items at scene
71 E3dCompoundObject
& rObj
= static_cast<E3dCompoundObject
&>(GetSdrObject());
72 E3dScene
* pScene(rObj
.getRootE3dSceneFromE3dObject());
79 // Generate filtered scene properties (SDRATTR_3DSCENE_) itemset
80 SfxItemSetFixed
<SDRATTR_3DSCENE_FIRST
, SDRATTR_3DSCENE_LAST
> aSet(*moItemSet
->GetPool());
85 pScene
->GetProperties().ClearObjectItem();
90 pScene
->GetProperties().SetObjectItemSet(aSet
);
94 // call parent. This will set items on local object, too.
95 E3dProperties::SetMergedItemSet(rSet
, bClearAllItems
, bAdjustTextFrameWidthAndHeight
);
98 void E3dCompoundProperties::PostItemChange(const sal_uInt16 nWhich
)
101 E3dProperties::PostItemChange(nWhich
);
103 // handle value change
104 E3dCompoundObject
& rObj
= static_cast<E3dCompoundObject
&>(GetSdrObject());
109 // Added extra Item (Bool) for chart2 to be able to show reduced line geometry
110 case SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY
:
112 rObj
.ActionChanged();
115 case SDRATTR_3DOBJ_DOUBLE_SIDED
:
117 rObj
.ActionChanged();
120 case SDRATTR_3DOBJ_NORMALS_KIND
:
122 rObj
.ActionChanged();
125 case SDRATTR_3DOBJ_NORMALS_INVERT
:
127 rObj
.ActionChanged();
130 case SDRATTR_3DOBJ_TEXTURE_PROJ_X
:
132 rObj
.ActionChanged();
135 case SDRATTR_3DOBJ_TEXTURE_PROJ_Y
:
137 rObj
.ActionChanged();
142 } // end of namespace
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */