LibreOffice Module svx (master) 1
e3dcompoundproperties.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
21#include <svl/itemset.hxx>
22#include <svx/obj3d.hxx>
23#include <svx/scene3d.hxx>
24
25
26namespace sdr::properties
27{
29 : E3dProperties(rObj)
30 {
31 }
32
34 : E3dProperties(rProps, rObj)
35 {
36 }
37
39 {
40 }
41
42 std::unique_ptr<BaseProperties> E3dCompoundProperties::Clone(SdrObject& rObj) const
43 {
44 return std::unique_ptr<BaseProperties>(new E3dCompoundProperties(*this, rObj));
45 }
46
48 {
49 // include Items of scene this object belongs to
50 const E3dCompoundObject& rObj = static_cast<const E3dCompoundObject&>(GetSdrObject());
52
53 if(nullptr != pScene)
54 {
55 // force ItemSet
57
58 // add filtered scene properties (SDRATTR_3DSCENE_) to local itemset
60 aSet.Put(pScene->GetProperties().GetObjectItemSet());
61 mxItemSet->Put(aSet);
62 }
63
64 // call parent
66 }
67
68 void E3dCompoundProperties::SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems)
69 {
70 // Set scene specific items at scene
71 E3dCompoundObject& rObj = static_cast<E3dCompoundObject&>(GetSdrObject());
73
74 if(nullptr != pScene)
75 {
76 // force ItemSet
78
79 // Generate filtered scene properties (SDRATTR_3DSCENE_) itemset
81 aSet.Put(rSet);
82
83 if(bClearAllItems)
84 {
86 }
87
88 if(aSet.Count())
89 {
90 pScene->GetProperties().SetObjectItemSet(aSet);
91 }
92 }
93
94 // call parent. This will set items on local object, too.
96 }
97
98 void E3dCompoundProperties::PostItemChange(const sal_uInt16 nWhich)
99 {
100 // call parent
102
103 // handle value change
104 E3dCompoundObject& rObj = static_cast<E3dCompoundObject&>(GetSdrObject());
105
106 switch(nWhich)
107 {
108 // #i28528#
109 // Added extra Item (Bool) for chart2 to be able to show reduced line geometry
111 {
112 rObj.ActionChanged();
113 break;
114 }
116 {
117 rObj.ActionChanged();
118 break;
119 }
121 {
122 rObj.ActionChanged();
123 break;
124 }
126 {
127 rObj.ActionChanged();
128 break;
129 }
131 {
132 rObj.ActionChanged();
133 break;
134 }
136 {
137 rObj.ActionChanged();
138 break;
139 }
140 }
141 }
142} // end of namespace
143
144/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual E3dScene * getRootE3dSceneFromE3dObject() const
Definition: obj3d.cxx:271
Abstract DrawObject.
Definition: svdobj.hxx:260
void ActionChanged() const
Definition: svdobj.cxx:273
virtual sdr::properties::BaseProperties & GetProperties() const
Definition: svdobj.cxx:220
sal_uInt16 Count() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual const SfxItemSet & GetObjectItemSet() const override
virtual void SetObjectItemSet(const SfxItemSet &rSet)=0
const SdrObject & GetSdrObject() const
Definition: properties.cxx:43
virtual const SfxItemSet & GetMergedItemSet() const
Definition: properties.cxx:53
virtual void ClearObjectItem(const sal_uInt16 nWhich=0)=0
virtual void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: properties.cxx:59
virtual const SfxItemSet & GetObjectItemSet() const =0
std::optional< SfxItemSet > mxItemSet
virtual void PostItemChange(const sal_uInt16 nWhich)
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
virtual void PostItemChange(const sal_uInt16 nWhich) override
virtual const SfxItemSet & GetMergedItemSet() const override
virtual void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false) override
static SfxItemSet & rSet
constexpr TypedWhichId< Svx3DNormalsKindItem > SDRATTR_3DOBJ_NORMALS_KIND(SDRATTR_3DOBJ_FIRST+7)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DOBJ_DOUBLE_SIDED(SDRATTR_3DOBJ_FIRST+6)
constexpr TypedWhichId< SfxBoolItem > SDRATTR_3DOBJ_NORMALS_INVERT(SDRATTR_3DOBJ_FIRST+8)
constexpr TypedWhichId< Svx3DReducedLineGeometryItem > SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY(SDRATTR_3DOBJ_FIRST+24)
constexpr TypedWhichId< Svx3DTextureProjectionYItem > SDRATTR_3DOBJ_TEXTURE_PROJ_Y(SDRATTR_3DOBJ_FIRST+10)
constexpr TypedWhichId< Svx3DTextureProjectionXItem > SDRATTR_3DOBJ_TEXTURE_PROJ_X(SDRATTR_3DOBJ_FIRST+9)